input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
ASP.NET MVC Html.BeginForm Problem <p>I have a partial view:</p>
<pre><code><%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DomainModel.Entities.Product>" %>
<div class="item">
<h3><%= Model.Name %></h3>
<%= Model.Description %>
<% using (Ht... | <p>It looks like you don't have a default route set up. <code>BeginForm</code> uses <code>UrlHelper.GenerateUrl</code> to match up the action/controller names to your route collection. So if you don't have a route that maps to <code>AddToCart</code>, then it can't generate a URL for it. Try adding this to the bottom of... |
Why can't typed optional arguments have a default of Null? <p>In ActionScript 3, when you declare an optional argument by giving it a default value, the value <strong>null</strong> cannot be used on typed arguments.</p>
<pre><code>function Action(Param:int=null){
// 1184: Incompatible default value of type Null wh... | <p>You can change your int to Number and then can set it to NaN which is a special number that means 'not a number' and this can represent your null state for a Number.</p>
<p>To check if something is NaN, you must use the isNaN() function and not <code>val == NaN</code>, or you will not get what you expect.</p>
<pre... |
Not locking mutex for pthread_cond_timedwait and pthread_cond_signal ( on Linux ) <p>Is there any downside to calling pthread_cond_timedwait without taking a lock on the associated mutex first, and also not taking a mutex lock when calling pthread_cond_signal ? </p>
<p>In my case there is really no condition to check,... | <p>The first is not OK:</p>
<blockquote>
<p>The <code>pthread_cond_timedwait()</code> and
<code>pthread_cond_wait()</code> functions shall
block on a condition variable. They
shall be called with mutex locked by
the calling thread or undefined
behavior results.</p>
</blockquote>
<p><a href="http://opengro... |
Has anyone used UDS (Unified Development Server) on a clustered system? <p>UDS (formerly known as Forte 4GL) is the platform our current system is running on. I remember finding a flag in a forum that documented how to deploy this on a Veritas cluster. However, now that we have modern hardware coming in, I can't find t... | <p>Finally found it (after hours of searching) at <a href="http://sundusum.com/gpunkt/knowledgebase/articles/7240.html" rel="nofollow">http://sundusum.com/gpunkt/knowledgebase/articles/7240.html</a></p>
<p>"To allow for configurations like clustered environments, a test for a
new environment variable, FORTE_CM_NO_CANO... |
SQL Server 2005 Clustered Index Query Speed <p>Our sites are getting pounded pretty hard so we're taking a look into optimizing some of our existing queries.</p>
<p>While looking into this we ran across several queries whose execution plan was about 4-5 times faster when a simple reference of the clustered index is in... | <p>seems pretty obvious to me</p>
<p>your first query is not covered by the clustered index while the second is since lotID is not in the WHERE clause of the first query</p>
<p>You might want to read <a href="http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/sql-server-covering-indexes" rel="nofollow">SQL Se... |
Custom button in navigation bar does not work <p>I have added a custom button (subclass UIButton) to my navigation bar but the button does not change states when clicked.</p>
<p>The button is configured correctly as it does work in, for example, a table view.</p>
<p>All advice is welcome.</p>
| <p>Have you tried subclassing UIBarButton instead of UIButton?</p>
|
WPF Interop & Dialogs <p>I have an existing WinForms application for which I'm now designing new bits in WPF. Things are going reasonably well and I have run into my first need for a dialog.</p>
<p>I'd like to do the dialog in WPF. It appears as though I'm going to need to do a UserControl for the actual content and... | <p>You can open a WPF window from a WinForms application.</p>
<p>Just create the window and call <code>ShowDialog()</code>. The CLR will load the WPF framework and open the window.</p>
|
Is there a natural language parser for dates/times in ColdFusion? <p>Is there a <a href="http://en.wikipedia.org/wiki/Natural%5Flanguage%5Fprocessing" rel="nofollow">natural language parser</a> for date/times in ColdFusion?</p>
| <p>There's a (reportedly -- I've not used it) good one for Java called <a href="https://github.com/samtingleff/jchronic" rel="nofollow">JChronic</a> -- a port of the Ruby Chronic date parser. You could try using it.</p>
<p>It hasn't been updated since 2006, but should still be useful.</p>
|
Why is Chrome searching for my favicon.ico when I serve up a file from ASP.NET MVC? <p>I have a controller in MVC serving up images from a database.</p>
<p><b>EDIT:</b> This still happens if I serve up a file over completely standard means in MVC.</p>
<p>Every time I request my image, Google Chrome also searches for ... | <p>This has nothing to do with MVC. I am using webforms with a custom built log service and I stumbled upon this post wondering why I had continuous 'File does not exist' errors in my logs. This is locally on my development machine, I have no favicon.ico files in my projects, and I have tried IE, Firefox and Google try... |
Complete C++ i18n gettext() "hello world" example <p>I am looking for a complete i18n <code>gettext()</code> hello world example. I have started a script based upon <a href="http://oriya.sarovar.org/docs/gettext%5Fsingle.html">A tutorial on Native Language Support using GNU gettext</a> by G. Mohanty. I am using Linux a... | <p>Your problem is that <code>hellogt.mo</code> is in the wrong location - your program isn't actually opening it. You can tell this by using <code>strace</code> to trace <code>open</code> syscalls:</p>
<pre><code>strace -e trace=open ./hellogt
...
open("/tmp/.//es_MX/LC_MESSAGES/hellogt.mo", O_RDONLY) = -1 ENOENT (No... |
Measure a String without using a Graphics object? <p>I am using pixels as the unit for my font. In one place, I am performing a hit test to check if the user has clicked within the bounding rectangle of some text on screen. I need to use something like <code>MeasureString</code> for this. Unfortunately, the code doing ... | <p>If you have a reference to System.Windows.Forms, try using the TextRenderer class. There is a static method (MeasureText) which takes the string and font and returns the size. <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.textrenderer.aspx">MSDN Link</a></p>
|
NET SEND to users Across Network <p>Not sure how to phrase this again, but... this is what I'm trying to do:</p>
<p>I'm writing a program to scan for duplicate logged on users (Users logged on more than once) on my network at work.</p>
<p>I can write the duplicity finder, but I need a way to be able to send a message... | <p>You can also net send to computers - have you tried that?</p>
|
Excel document recovery <p>Does anyone know how this process works? It appears that when Excel closes non-gracefully (due to a power outage or system problem) the AutoRecover version of the file is available, but if someone accidentally closes the Excel application, it is not.</p>
<p>I am trying to help a coworker re... | <p>ecounsis, look in;</p>
<p>C:\Documents and Settings\ {User Name} \Application Data\Microsoft\Excel</p>
<p>For files with the XAR extension.</p>
<p>Make a copy of each and change the extension to xls.</p>
<p>Cross your fingers that one of them is the file you need!</p>
<p>If not, search your systems for any file... |
Retrieving available font sizes on Windows <p>When I open the Windows Common Font Dialog, it lists, for each font, a bunch of sizes. For all of the OpenType/TrueType fonts, it has the same list - 9, 10, 11, 12, 14, 16, 18... For bitmap fonts, the list varies according to the available bitmaps. "Small fonts" has 2,3,... | <p>See <a href="http://www.catch22.net/tuts/enumfont">here</a> for an explanation on how to enumerate fonts / font sizes for a specific font. Note, that TrueType fonts can be displayed at any size (and not just predetermined ones), since they are vector-based.</p>
|
How do I load data to a list from a dataReader? <p>I am tryin to add data to my list object.<br />
For a string, I just say, this.name = myDaraReader["test"]toTring(); How do I go about doing that for a list?</p>
| <p>Maybe there is more to this than I see but is there a reason you can't just write</p>
<p>theList.Add(myDataReader["test"].toString());</p>
<p>I think that will work unless I am missing something..</p>
|
IE 8 only has access to session cookies? <p>Project I'm working on gets cookies from the browser to check for certain things. In FF, Safari, or Chrome, this works fine, but in IE 8 (don't have an earlier version of IE to test and MSFT won't let me uninstall IE 8 and have a working IE 7), the only cookies it sees are th... | <p>It's probably the privacy policy. There are headers that you can set to allow cookies from other domains than the one shown in the address bar. Here's <a href="http://www.hanselman.com/blog/TheImportanceOfP3PAndACompactPrivacyPolicy.aspx" rel="nofollow">the best description I've found</a> on how to go about fixing i... |
Detect ClickOnce program's server? <p>I'm deploying a ClickOnce application. I need to find a way to detect from which server the application was downloaded and installed from - because the application checks for updates on launch, I know that somewhere it knows the "parent" server - can I get at that value somehow?</p... | <p>You can use </p>
<pre><code>ApplicationDeployment.CurrentDeployment
</code></pre>
<p>(specifically, <code>ApplicationDeployment.CurrentDeployment.UpdateLocation</code>) to access the ClickOnce properties associated with the running instance.</p>
<p>Note that if you're debugging, these won't be available - you can... |
How do I replace a text box with a drop down populate by web service in fogbugz using greasemonkey script? <p>I want to replace the 'client' field text box in fogbugz when you edit a case to be a drop down instead populated from a separate web service that will keep the client options up to date in our fogbugz. Is this... | <p>If you are on Windows, email us at <a href="http://contact.fogcreek.com" rel="nofollow">http://contact.fogcreek.com</a> and get on the FogBugz 7 beta which has the ability to do this with plugins (instead of GM) or even, just with a custom field.</p>
|
What does "singleton modeless" mean? <p>I know what a singleton is, but while walking through a web-app, my co-worker said "singleton-modeless". What does he mean by this?</p>
| <p>Well a <em>modeless</em> form is the opposite of a <em>modal</em> form.</p>
<p><strong>modeless form</strong></p>
<blockquote>
<p>Allows you to change the focus from form to form.</p>
</blockquote>
<p><strong>modal form</strong></p>
<blockquote>
<p>Disallows focus change until the modal form is closed.</p>
<... |
How do I install Jetty WTP Server Adapter for Eclipse 3.5? <p>Currently I am attempting to install the Jetty WTP Server Adapter for Eclipse 3.5 and get the following errors:</p>
<pre><code>An error occurred while collecting items to be installed session context was:(profile=epp.package.jee,phase=org.eclipse.equinox.in... | <p>I also found the 'Download additional server adapters" route to adding the Jetty (and Glassfish) server adapters failed, with the same dependency issues as the Original Poster.</p>
<p>Downloading the .jar and copying it into the 'plugins' dir of my Eclipse install idd not work. The Jetty server adapter was still n... |
Problems with starling/workling in production mode <p>I have a rails app that has asynchronous processing, and I'm having trouble getting it to work in production mode. I start starling from the root of the application like so: </p>
<pre><code>starling -d -P tmp/pids/starling.pid -q log/
</code></pre>
<p>then I start... | <p>the answer is that starling has to be started as such:</p>
<pre><code>RAILS_ENV=production ./script/workling_client start -t
</code></pre>
|
Free online resources for OOP class design? <p>I love having a book in front of me, but right now I can't afford to buy anymore books and all my libraries suck, so I'm wondering what free sites/resources exist where I can learn about best practices for designing classes? </p>
| <p>I think <strong>Martin Fowler'</strong>s <a href="http://martinfowler.com/articles/enterprisePatterns.html" rel="nofollow">collection of enterprise patterns</a> is very good...</p>
<p>I not only has his but has Gang of Four, java, Microsoft, and many others...</p>
<p>Another good one is <a href="http://www.industr... |
Allow logout while multiple large files are uploaded <p>I have been asked to implement a file upload program. The program is a Java Web Start application responsible for uploading the contents of a CD to a web application. There are two requirements here:</p>
<ol>
<li>The uploader should operate in the background wi... | <p>I'm not sure why this is complicated even if a user logs out.</p>
<p>Session is started at login, session id assigned.</p>
<p>User begins uploading file with session id information in filename.
e.g. session_id_user_name.DAT</p>
<p>User Logs out</p>
<p>File is complete, background process on host identifies infor... |
Combining Multiple outputs in single view in asp.net MVC <p>I am looking to use asp.net MVC for new project. I looked at different examples at asp.net and over web. I still didn't get answer to , what is the best way to combine output of different models into a single view. For example my home page will contain catgori... | <p>You create a ViewModel for your homepage... something like...</p>
<pre><code>public class MyHomepageViewModel
{
public Categories MyCategories { get; set; }
public Locations MyLocations { get; set; }
public Snapshots MySnapshots { get; set; }
public MyHomepageViewModel(Categories categories, Locati... |
Comparing folder structure in two environments <p>Are there any good tools for comparing two folder structures (files included) between two environments?</p>
<p>i.e. comparing a dev computer with production</p>
<p>Edit:</p>
<p>A note on some lessons learned: <code>dir /s /o:N >> output.txt</code> works well in... | <p>I use Diff merge (<a href="http://www.sourcegear.com/diffmerge/">http://www.sourcegear.com/diffmerge/</a> - it has a free version) for comparing folder structures on Windows</p>
|
In Windows, What Makes qmake Append a "d" to a Debug Target? <p>I'm using a provided <code>.pro</code> file and for some reason, it's configured so that the debug libraries do not have "d" appended to their library name. What causes this and how do I restore it?</p>
<p>E.g. <code>QtGui4.dll</code> (release) and <code>... | <p>Add this to the .pro file and it will append <strong>_debug</strong> for mac and a <strong>d</strong> for windows debug build.</p>
<pre><code> CONFIG += debug_and_release
CONFIG(debug, debug|release) {
mac: TARGET = $$join(TARGET,,,_debug)
win32: TARGET = $$join(TARGET,,,d)
}
</code></pre>
<p><br>
<c... |
DB Design: when should you make a superclass of common attributes? <p>To describe my dilemma, let me first start with an example problem (stolen from <a href="http://www.tomjewett.com/dbdesign/dbdesign.php?page=subclass.php" rel="nofollow">here</a>). Let's say you have a GradStudent table in your database that looks li... | <p>I consider myself relatively new to database design, so take this for what it's worth. In the first example, my first thought would be to indeed maintain a separate "GradStudent" table which would include name and other personal information. In my opinion, it leaves you flexible for potential changes in the future. ... |
Pros and Cons of massive table that controls all data flow with stored procs <p>DBA (with only 2 years of google for training) has created a massive data management table (108 columns and growing) containing all neccessary attribute for any data flow in the system. Well call this table BFT for short.</p>
<p>Of these c... | <p>Sounds like he reinvented <a href="http://www.microsoft.com/biztalk/en/us/default.aspx" rel="nofollow">BizTalk</a>.</p>
|
Is it possible to override facelets.development for different environments? <p>We'd like to set facelets.development to false to suppress stack traces in non-development environments, but we'd like to have it set to true in dev for debugging.</p>
<p>Our deployment process dictates one CI build that is migrated through... | <p>I can think of a few ways to do this, none of them very pleasant.</p>
<ul>
<li>Decorate the <a href="http://java.sun.com/javaee/5/docs/api/javax/faces/context/FacesContextFactory.html" rel="nofollow">FacesContext</a> to control the <a href="http://java.sun.com/javaee/5/docs/api/javax/faces/context/ExternalContext.h... |
ASP.NET MVC DefaultModelBinder with nested lists <p>I have a View with a table representing an employee's timesheet. Days across the top, projects down the side, with each day/project intersection containing two values for regular hours and overtime.</p>
<p>The (simplified) class definitions for the page model are:</p... | <p>I eventually figured out why <code>DefaultModelBinder</code> wasn't picking up on the properties of <code>WorkUnit</code>: Because they weren't <i>properties</i>, they were <i>fields</i>. <code>DefaultModelBinder</code> only works with properties. Changing the class definition of <code>WorkUnit</code> and <code>Proj... |
Linq Join on Mutliple Properties <p>Are the below two queries functionally the same?
The first one doesn't return any data, but the second works fine with same exact input.
Can someone point out what's wrong in my first query?</p>
<pre><code>Dim LTest2 As IEnumerable = From e1 As QNCEntity In Shape.Entities _
... | <p>An instance of an anonymous type with <b><i>no key properties</i></b> is <code>Equal</code> only to itself.</p>
<p>See: <a href="http://msdn.microsoft.com/en-us/library/bb384767.aspx" rel="nofollow">MSDN article on Anonymous Types, Header - Key Properties, Equality</a></p>
<p>To make the first query work the same ... |
How to read .net xml serialized datetimes from java? <p>I am porting some of our app from c# to java. Some data objects get xml serialized and stored for later use. The built in .net xml serialization automatically saves DateTime properties in the format below:</p>
<pre><code>2009-05-11T16:47:08.6033346-04:00
</code... | <p><a href="http://java.sun.com/javase/6/docs/api/javax/xml/bind/DatatypeConverter.html#parseDateTime%28java.lang.String%29" rel="nofollow"><code>parseDateTime</code></a>?</p>
|
Modify a Controller to Accept Additional Field in Ruby on Rails <p>Using Ruby on Rails, I have created a blog. The blog has posts, and comments associated with each post.</p>
<p>I want to add a name field to the comment controller (or model, not sure), so that the commenter is identified. Since right now it's just a... | <p>You want to create a database migration file that adds a column to the Comments table in your database. You'll need to adjust your views to display a form field for the commenters name and for the blog to display the name along side the comment. This RoR Guide should get you started
<a href="http://guides.rubyonrail... |
Visual Studio, Distributed Version Control, and Sourceforge <p>I'm trying to set up a new Windows computer with Visual Studio 2008 to work on a Sourceforge project I maintain. I'd like to use a distributed version control system (tried SVN, didn't like it).</p>
<p>I've used git and mercurial before on UNIX, but I'm ha... | <p>I've been using Mercurial with VS 2008 for a while now and have found that a combination of <a href="http://bitbucket.org/tortoisehg/stable/wiki/Home" rel="nofollow">TortoiseHg</a> and an open command prompt solves most issues. Prior to Mercurial, we used Microsoft Visual Source Safe (VSS) with Visual Studio integr... |
INSERT SELECT in MySQL with superfluous aggregate column <p>I'd like to do an insert select where the select statement has aggregate columns for use by a "HAVING" clause, but where I do not actually want those columns to be inserted. A simple example:</p>
<pre><code>INSERT INTO table1 ( a )
SELECT a, MAX (b) AS max... | <pre><code>INSERT INTO table1 ( a )
SELECT a FROM (SELECT a, MAX (b) AS maxb FROM table2
GROUP BY a
HAVING maxb = 1) t
</code></pre>
|
Want to use a jquery pop up, but get the data from server side <p>When somebody clicks on my google adwords link like this:</p>
<p><a href="http://www.myshoppingsite.com/product/rubberball.aspx?promo=promo123" rel="nofollow">http://www.myshoppingsite.com/product/rubberball.aspx?promo=promo123</a></p>
<p>I want my asp... | <p>If you really think about it, there's no reason to do a trip back to the server in this kind of situation. You can simply check server-side if the <code>promo</code> GET parameter was passed, and if so display a hidden <code><div></code> with the promotion information:</p>
<pre><code><div style='display: n... |
Validating nested models? <p>To be more specific, <strong><em>"How do I validate that a model requires at least x valid associated models to be created?"</em></strong>. I've been trying to validate nested models that get created in the same form as the parent (and ultimately show immediate validations a la jQuery). As ... | <p>I actually found a nice solution here using transactions in DataMapper. Basically this transaction tries to save the parent object as well as all the child objects. As soon as one fails to save, then the transaction stops and nothing gets created. If all goes well, then the objects will save successfully.</p>
<pre>... |
fail hudson build on single unit test failure <p>Is there a way to cause hudson to report a build as failed, rather than unstable, if only a single unit test fails? thanks.</p>
| <p>Hudson actually enables the ignoring of test failures. It just needs to be put as a property in hudson.
-Dmaven.test.failure.ignore=false</p>
|
Rhino Mocks & Compact Framework <p>I've been experimenting with Rhino Mocks for unit testing my .Net Compact Framework application, and have hit a problem. I can get a basic unit test using Rhino Mocks built, but every time I run the test that has the Rhino Mocks code in it, the test fails because it can't find the Rhi... | <p>My bet is that it can't find a dependency. IIRC, Rhino uses a lot of the CompilerServices and Reflection.Emit pieces which simply don't exist in the CF, so it's probably puking when trying to generate the mocks. I've not seen any mocking framework that works with the CF, and I've done quite a bit of looking (and t... |
phxsoftware System.Data.SQLite DbDataReader misbehaving <p>The following post relates to the System.Data.SQLite data provider by phxsoftware (<a href="http://sqlite.phxsoftware.com" rel="nofollow">http://sqlite.phxsoftware.com</a>)</p>
<p>I have a question (and possibly a problem) with DbDataReaderâs Read method and... | <ol>
<li><p>Think about it like this after you run ExecuteReader the set is on row -1. You need to execute Read to get to row 0. </p></li>
<li><p>IDataReader is a forward only structure, you can only iterate through it once, the debugger is iterating through it. </p></li>
</ol>
<p>General questions: </p>
<ul>
<li>Why... |
ASP.NET LoginStatus Control - Overriding the ReturnURL in generated QueryString <p>I have a website that uses the <a href="http://msdn.microsoft.com/en-us/library/ms178329.aspx" rel="nofollow">ASP.NET Login Controls</a> and Forms Authentication. I've placed the asp:LoginStatus control inside another Web User Control th... | <p>Why do you do a Server.Execute of the Header.aspx from your Header.ascx? Why don't you just put the Header.aspx code in the Header.ascx. That way the ReturnUrl will be the page you expect it to be.</p>
|
Data Model design and Domain Model design <p>I'm attempting to model a grocery store. In the store, there are several "aisles". Each "aisle" has a group of "categories" of "items" it stores. Each "category" can only belong to one "aisle". Each "item" can only have one "category". </p>
<p>The data model seems stra... | <p>I vote for choice #2. Makes more sense than #1 or #3.</p>
<p>Do you think the relationships need to be bi-directional? Should an Item need to be able to figure out who its parent Category and grandparent Aisle are?</p>
|
To pad or not to pad - creating a communication protocol <p>I am creating a protocol to have two applications talk over a TCP/IP stream and am figuring out how to design a header for my messages. Using the TCP header as an initial guide, I am wondering if I will need padding. I understand that when we're dealing with... | <p>If word alignment of the message body is of some use, then by all means, pad the message to avoid other contortions. The padding will be of benefit if most of the message is processed as machine words with decent intensity.</p>
<p>If the message is a stream of bytes, for instance xml, then padding won't do you a w... |
jruby on tomcat - RackInitializationException <p>After following <a href="http://kenai.com/projects/jruby/pages/JrubyOnRailsOnTomcat#Rails_2.0" rel="nofollow">http://kenai.com/projects/jruby/pages/JrubyOnRailsOnTomcat#Rails_2.0</a>
though with tomcat 5.5, jruby 1.3.0, rails 2.3.2</p>
<p>tomcat gives:</p>
<p>SEVERE: u... | <p>needed to do the following ...</p>
<p>gem install activerecord-jdbcmysql-adapter
gem install jruby-openssl</p>
<p>uncomment the following line from warble.rb</p>
<pre><code>config.gems += ["activerecord-jdbcmysql-adapter", "jruby-openssl"]
</code></pre>
|
Should interfaces be placed in a separate package? <p>I'm new to a team working on a rather large project, with lots of components and dependencies. For every component, there's an <code>interfaces</code> package where the exposed interfaces for that component are placed. Is this a good practice?</p>
<p>My usual pract... | <p>Placing both the interface and the implementation is common place, and doesn't seem to be a problem.</p>
<p>Take for example the Java API -- most classes have both interfaces and their implementations included in the same package. </p>
<p>Take for example the <a href="http://java.sun.com/javase/6/docs/api/java/uti... |
Most Efficient Unicode Hash Function for Delphi 2009 <p>I am in need of the fastest hash function possible in Delphi 2009 that will create hashed values from a Unicode string that will distribute fairly randomly into buckets.</p>
<p>I originally started with <a href="http://stackoverflow.com/users/4997/gabr">Gabr</a>'... | <p>ASM output is not a good indication of algorithm speed. Also, from what I can see, the two pieces of code are doing almost the identical work. The biggest difference seem to be the memory access strategy and the first is using roll-left instead of the equivalent set of instructions (shl | shr -- most higher-level ... |
C# WinForms: Waiting for a button press inside an infinite loop <p>I'm making a simple Guess-The-Number game with a GUI. I need to wait on a loop waiting for the user to input a number in a text box and press "OK". How do I wait for an event inside a loop?</p>
<p>Note: I don't want message boxes. This is done in the m... | <p>C# automatically loops infinitely waiting for events until your form is closed. You just need to respond to the button click event.</p>
|
Effective Extensions for Development Wiki <p>Our small team of 3-4 developers uses a wiki for documentation and collaboration. I'm trying to put together a list of some solid extensions which would help make it better. We are using MediaWiki, but if you know of a good extension/plug-in for another platform I'd like t... | <p>Two things come to mind:</p>
<ul>
<li>Bug tracking tool integration </li>
<li>SCM tool integration</li>
</ul>
<p>For MediaWiki there are already</p>
<p>Bugzilla integration:</p>
<ul>
<li><a href="http://www.mediawiki.org/wiki/Extension:BugzillaReports" rel="nofollow">http://www.mediawiki.org/wiki/Extension:Bugzi... |
get method for testing in rails <p>I'm following along with <a href="http://railsspace.com" rel="nofollow">RailsSpace: Building a Social Networking Website with Ruby on Rails by Michael Hartl</a>. Running rails v2.3.2.</p>
<p>I've gotten to the 5th chapter in which testing is introduced. The following is supposed to m... | <p>Replace <strong>all</strong> the following code </p>
<pre><code># Re-raise errors caught by the controller.
class SiteController; def rescue_action(e) raise e end; end
class SiteControllerTest < Test::Unit::TestCase
def setup
@controller = SiteController.new
@request = ActionController::TestR... |
Delphi Form Drag Lockup <p>Make a Delphi 2007 application, TForm as main window.
Run application. Try to drag the form using the caption bar. The debugger shows an unending stream of error messages, complaining it can't find some unnamed routine. Escape and Break don't work. 3 finger salute doesn't work.
Clicking i... | <p>This doesn't sound related to Delphi specifically. The "stream of error messages, complaining it can't find some unnamed routine" sounds very odd. Could you post one or two of the actual messages, please?</p>
<p>In the meanwhile, my guess is some form of hook or injected code. Try looking for programs that do th... |
Need help optimizing my 2d drawing on iPhone <p>I'm writing a game that displays 56 hexagon pieces filling the screen in the shape of a board. I'm currently drawing each piece using a singleton rendering class that when called to draw a piece, creates a path from 6 points based of the coordinate passed in. This path is... | <p>General thoughts:</p>
<ul>
<li>Game programming on iPhone usually necessitates OpenGL. Core Graphics is a bit easier to work with, but OpenGL is optimized for speed.</li>
<li>Prerender this "shiny look" into the textures as much as is possible (as in: do it in Photoshop before you even insert them into your projec... |
how stackoverflow permalink works? <p>how does stackoverflow manage permalinks. For example an arbitary qn like: <a href="http://stackoverflow.com/questions/1002230/asp-net-jquery-dynamically-created-hyperlink-controls">http://stackoverflow.com/questions/1002230/asp-net-jquery-dynamically-created-hyperlink-controls</a>... | <p>The number is the question id which is unique - they only increment and are not reused. The human-readable string is ignored by the server when you retrieve the page by URL - it's for convenience and pretty look - to solve the same task you have. So each question URL has two parts - the machine-readable (the startin... |
What kind of SEO Technique need to apply for my website <p>I have a website called <a href="http://www.demandb.com" rel="nofollow">http://www.demandb.com</a> and it's a classified sites... Can any one tell me the different SEO Techniques for my site to get huge amount of visitors....I dint yet started SEO for this webs... | <p>Content, content, content and then the header tag (<code>h1</code>,<code>h2</code>,etc). These are by far the most important parts of a site. It can be difficult to get the content on a site like yours, but that's what Google wants--both quality and content. Without these, why would Google send a user to your site.<... |
jQuery not register $ <p>I am using prototype + jquery on a site. Now the prototype plugins use $. I do not want jQuery to use $. How do I make jQuery not register the $. Also, how do I then call jQuery functions. </p>
<p>Thank you for your time.</p>
| <p>The jQuery <a href="http://docs.jquery.com/Using%5FjQuery%5Fwith%5FOther%5FLibraries" rel="nofollow">documentation</a> has an article on how to make jQuery play nice with other libraries.</p>
<p>This is one suggested way from that article:</p>
<pre><code><html>
<head>
<script src="prototype.js">... |
What language is used to develop spiceworks desktop IT software? <p>What language/Technologies are used to develop <a href="http://www.spiceworks.com" rel="nofollow">Spiceworks</a>?</p>
<p>How did they archive that, its like a desktop app running inside a browser, actually it has its own webserver!</p>
<p>I am very c... | <p>Spiceworks is written in Ruby.</p>
<p>Source: <a href="https://web.archive.org/web/1/http://blogs.techrepublic%2ecom%2ecom/programming-and-development/?p=350" rel="nofollow">https://web.archive.org/web/1/http://blogs.techrepublic%2ecom%2ecom/programming-and-development/?p=350</a></p>
<p>On a side note, they have a... |
How to use jquery for scrolling horizontally <p>I am new to use jquery. I need to scroll to the place where the menu indicates as in this site <a href="http://www.newworkmag.com/issue1.html" rel="nofollow">http://www.newworkmag.com/issue1.html</a>. If I am not mistaken then I can use scrollTo. But I could not find how ... | <p>This can be achieved using the jQuery <a href="http://flesler.blogspot.com/2007/10/jqueryscrollto.html" rel="nofollow">scrollTo plug-in</a> which allows you to scroll the entire window as in your example.</p>
<p><strong>EDIT:</strong> Here's a similar <a href="http://stackoverflow.com/questions/832860/how-to-scroll... |
how to export a grid view in to excel? <p>hi i am developing an application where i am using a grid to dispaly data and adding a dynamic datatable as the header of the gridview and iam using the following code to export the grid view into excel but i am unable get the datatable which was added dynamically to the grid i... | <p>I don't see where you are adding the dynamic datatable as the header?? This should come after the databind and before the GridView1.RenderControl(hw); </p>
|
How to replicate facebook photo view and show photos very fast from web <p>I have to create same functionality as facebook has does like all the photos display at one view and from that user can choose photo and it goes to large photo. This photos are showing very fast. I have 5 photos from web but it take so much time... | <p>I don't know the answer but I suggest you look at the <a href="http://github.com/joehewitt/three20/tree/master" rel="nofollow">three20 source code on github</a>. Joe Hewitt (who wrote the Facebook app) published much of its code including the photo view. There is also <a href="http://groups.google.com/group/three20/... |
SQL data and JTable <p>I'm trying one sample program for practice and i want to display results of database in JTable. The problem is i have no idea how to do that. I know how to get data from database and display it on text field or console but never tried with JTable. How to do that ? </p>
<p>Consider that i've tabl... | <p>JDBC + JTable @ google:</p>
<ul>
<li><a href="http://www.onjava.com/pub/a/onjava/excerpt/swinghks%5Fhack24/index.html" rel="nofollow">Hacking Swing: A JDBC Table Model</a></li>
<li><a href="http://java.sys-con.com/node/36190" rel="nofollow">Mastering the JTable</a></li>
<li><a href="http://www.oreillynet.com/pub/a/... |
clipboard image send to email <p>how to clipboard image send to email using C#.Net with java script web application</p>
| <p>Check out <a href="http://stackoverflow.com/questions/999847/client-system-clipboard-print-screen-image-save-in-server-system">this related post.</a></p>
|
Restart background worker <p>Is there a way to directly "restart" a background worker?
Calling CancelAsync() followed by RunWorkerAsync() clearly won't do it as their names imply.</p>
<p>Background info:
I have a background worker which calculates a total in my .net 2.0 Windows Forms app.
Whenever the user modifies an... | <p>The backgriound work itself does not do any cancleing.</p>
<p>When you call <code>bgw.CancelAsync</code> it sets a flag on the background worker that you need to check yourself in the DoWork handler.</p>
<p>something like:</p>
<pre><code>bool _restart = false;
private void button1_Click(object sender, EventArgs ... |
How to add encoding information to the response stream in ASP.NET? <p>I have following piece of code:</p>
<pre><code>public void ProcessRequest (HttpContext context)
{
context.Response.ContentType = "text/rtf; charset=UTF-8";
context.Response.Charset = "UTF-8";
context.Response.ContentEncoding = System.Te... | <p>What you call "encoding-information" is actually a BOM. I suspect each of those "characters" is getting encoded separately. To write the BOM manually, you have to write it as three <em>bytes</em>, not three characters. I'm not familiar with the .NET I/O classes, but there should be a method available to you that ... |
What is the runtime complexity of python list functions? <p>I was writing a python function that looked something like this</p>
<pre><code>def foo(some_list):
for i in range(0, len(some_list)):
bar(some_list[i], i)
</code></pre>
<p>so that it was called with</p>
<pre><code>x = [0, 1, 2, 3, ... ]
foo(x)
</c... | <p>there is <a href="http://wiki.python.org/moin/TimeComplexity">a very detailed table on python wiki</a> which answers your question.</p>
<p>However, in your particular example you should use <code>enumerate</code> to get an index of an iterable within a loop. like so:</p>
<pre><code>for i, item in enumerate(some_s... |
Programatically include JQuery in high conflict environment - <p>I'm writing a snippet of code to be put on any third party website and have NO idea what environment it will be dropped into. My end goal is for the badge to be </p>
<pre><code><script src="http://example.com/js/badge.js"></script>
</code></p... | <p>I ended up going with <a href="http://yourock.paulisageek.com/js/popup.js">http://yourock.paulisageek.com/js/popup.js</a> . See the test (with console logging avialable) <a href="http://paulisageek.com/tmp/jquery-programatically.html">http://paulisageek.com/tmp/jquery-programatically.html</a>. It doesn't reset jQuer... |
Why does DockPanel.Dock="Bottom" put element at the top? <p>The following code puts the two text elements at the top even though the second one is marked "Bottom". The background color goes all the way to the bottom so the DockPanel seems to stretch to the bottom.</p>
<p>What am I not understanding about DockPanel?</p... | <p>By <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.dockpanel.aspx">default</a> a DockPanel's last item will fill the remaining content area available.</p>
<p>If you set <code>LastChildFill="False"</code> on the DockPanel, you'll see the behavior you are expecting. You can also set <code>Ve... |
Scoping rules when inheriting - C++ <p>I was reading the C++0x FAQ by Stroustrup and got stuck with this code. Consider the following code</p>
<pre><code>struct A
{
void f(double)
{
std::cout << "in double" << std::endl;
}
};
struct B : A
{
void f(int)
{
std::cout << "i... | <p>Its because A::f is "hidden" rather than "overloaded" or "overridden". Refer:</p>
<p><a href="http://www.parashift.com/c%2B%2B-faq-lite/strange-inheritance.html#faq-23.9" rel="nofollow">http://www.parashift.com/c++-faq-lite/strange-inheritance.html#faq-23.9</a></p>
|
Are writing triggers in MS SQL server the same as writing them in MS Access? <p>I have written the following trigger in SQL server:</p>
<pre><code>create trigger test_trigger
on invoice -- This is the invoice table
for insert
as
declare @invoiceAmount int -- This is the amount specified in the invoice
declare @cus... | <p>The Access database engine (formerly called Jet) does not have triggers and regardless has no control-of-flow syntax e.g. a PROCEDURE must consist of exactly one SQL statement.</p>
<p>Tell us what you really want to do and there could be an alternative syntax. </p>
<p>For example, you could create a new key using ... |
searching equivalent function/way to "list()" from php <p>i'm searching for an equivalent function for php's "list()". i'd like to split a string with "split()" and put the array values in two different variables. hopefully there's another way to do this as short and performance-optimized as it could be.</p>
<p>thanks... | <p>Here's a list implementation in javascript:</p>
<p><a href="http://solutoire.com/2007/10/29/javascript-left-hand-assignment/" rel="nofollow">http://solutoire.com/2007/10/29/javascript-left-hand-assignment/</a></p>
|
windbg: Command output to text file <p>How can I Save Output of a command in WinDbg to a Text File?</p>
| <p>Start WinDbg from the command line using the -logo option:</p>
<pre><code>windbg.exe -logo logfile.txt
</code></pre>
<p>That will get everything done logged to the file specified. You can find more details of the command line options <a href="http://msdn.microsoft.com/en-us/library/windows/hardware/hh451024(v=vs.8... |
What is Public key infrastucture <p>I need to know what is public key infastructure. I need to know is this related to sending requests and response as like WsHttpbinding in WCF.</p>
| <p>There is no direct relation between a PKI and a WCF service. <a href="http://en.wikipedia.org/wiki/Public%5Fkey%5Finfrastructure" rel="nofollow">PKI</a> is the infrastructure for creating and managing digital certificates that among many other purposes can be used to encrypt the data flowing through a WCF service.</... |
File Access Denied <p>I am using an FTPClient library to transfer files from a Windows share to an FTP server.</p>
<p>The SendFile method of the library uses the following code:</p>
<pre><code>FileStream stream = new FileStream(localFileName, FileMode.Open);
</code></pre>
<p>This results in a System.UnauthorizedAcce... | <p>Are you sure it's the same user account?
Can you try something like</p>
<pre><code>MessageBox.Show(WindowsIdentity.GetCurrent().Name);
</code></pre>
<p>?</p>
<p>Also, are you sure the file isn't read-only? Do you need write access to the file?
Otherwise you could try:</p>
<pre><code>FileStream stream = new FileS... |
Run Tests Unavailable in Visual Studio <p>Not strictly a programming question, but definately programming related.</p>
<p>The option to run tests in Visual Studio is greyed out for some reason. I've just started a File | new MVC Application, using VS2008pro.</p>
<p><img src="http://www.olympianbot.co.uk/images/greyed... | <p>Visual Studio recognizes test projects by a special GUID. If there's a project with the GUID : <code>FAE04EC0-301F-11D3-BF4B-00C04F79EFBC</code>, VS will automatically load tests from it. So make sure that in the .csproj of your test project you have the correct GUID:</p>
<pre><code><ProjectTypeGuids>{3AC096D... |
axis - how to access it? <p>Hi I have axis in webapp and I can access <a href="http://localhost:8080/oop/services/test2?wsdl" rel="nofollow">http://localhost:8080/oop/services/test2?wsdl</a> correctly. I wrote client:</p>
<pre><code>
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
im... | <p>Your endpount URL is wrong?</p>
<p><a href="http://localhost:8080/oopfwsDB/services/test2" rel="nofollow">http://localhost:8080/oopfwsDB/services/test2</a> - works
<a href="http://localhost:8080/oop/servlet/AxisServlet/services/test2" rel="nofollow">http://localhost:8080/oop/servlet/AxisServlet/services/test2</a> ... |
Should I use JSON or AJAX for response data? <p>Why JSON? I have done some tests today, and the request time for both JSON, or a normal AJAX request was the same. In the "normal request" I have returned the complete text+html tags, in the JSON request, logically I returned a "json return type" and I have created the HT... | <p>You are perhaps a little confused.</p>
<p>JSON and AJAX are not an either-or choice.</p>
<p>JSON and XML is a choice.</p>
<p>JSON and AJAX are distinct and largely unrelated, although AJAX often uses JSON, it can just easily use XML, HTML or plain text.</p>
<p>Or are you referring to the X in AJAX (XML)? If so, ... |
Is there difference in defining DropTarget in View and in Editor? <p>The code is:</p>
<pre><code> DropTarget target = new DropTarget(sqlViewer.getTextWidget(),
DND.DROP_DEFAULT | DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK);
Transfer[] types = new Transfer[] {TreeLeafListTransfer.getInstance(),
TextTra... | <blockquote>
<p>it works normally for a view, but fails in an editor. What's the difference?</p>
</blockquote>
<p>The difference should be in the <strong><a href="http://www.eclipse.org/articles/Article-Workbench-DND/drag%5Fdrop.html" rel="nofollow">transfert type</a></strong>:</p>
<blockquote>
<p>To recap, trans... |
Nginx Reverse Proxy to custom Mochiweb application <p>I have Nginx as my front-end web server listening on port 80. And certain requests, I've set up nginx to reverse proxy it to a mochiweb based web server that I've written, listening on Port 8000. My nginx configuration for this looks like this:</p>
<pre><code>locat... | <p>Fixed!</p>
<p>Reference: <a href="http://timanovsky.wordpress.com/2009/01/09/toward-a-million-user-long-poll-http-application-nginx-erlang-mochiweb/" rel="nofollow">http://timanovsky.wordpress.com/2009/01/09/toward-a-million-user-long-poll-http-application-nginx-erlang-mochiweb/</a></p>
<p>I had to turn off proxy ... |
Capitalizing non-ASCII words in Python <p>How to capitalize words containing non-ASCII characters in Python? Is there a way to tune <code>string</code>'s <code>capitalize()</code> method to do that?</p>
| <p>Use Unicode strings:</p>
<pre><code># coding: cp1252
print u"é".capitalize()
# Prints Ã
</code></pre>
<p>If all you have is an 8-bit string, decode it into Unicode first:</p>
<pre><code># coding: cp1252
print "é".decode('cp1252').capitalize()
# Prints Ã
</code></pre>
<p>If you then need it as an 8-bit string... |
Clientside Javascript --> Serverside Java --> user is served a .doc <p>I am helping someone out with a javascript-based web app (even though I know next to nothing about web development) and we are unsure about the best way to implement a feature we'd like to have.</p>
<p>Basically, the user will be using our tool to ... | <p>Yep, its possible. Your saviour is the <a href="http://poi.apache.org/" rel="nofollow">Apache POI library</a>. Its HWPF library will help you generate Microsoft word files using java. The rest is just clever use of HTTP.</p>
|
How to detect that DetailsView displays not a data but EmptyDataText <p>I have a <code>DetailsView</code> and few buttons on my page.</p>
<p>So I want to hide them if <code>DetailsView</code> displays not a data but just a value if <code>EmptyDataText</code> property.</p>
<p>How can I do that?</p>
<p>I found only on... | <p>Please try DetailView properties like DataItemIndex and DataItemCount</p>
|
Printing a PDF from a Windows service <p>With C#, how can I print a PDF document (without any dialog boxes in the background) to an indicated printer?</p>
| <p>I have used the following PDF library in the past to perform batch printing of PDF documents from a C# Windows Service. </p>
<p><a href="http://www.quickpdflibrary.com/" rel="nofollow">http://www.quickpdflibrary.com/</a></p>
<p>It's a pretty decent library and if I remember correctly it only took a few lines of co... |
What is the default session timeout value in ASP.NET? <p>What is the default session timeout value in ASP.NET?</p>
| <p>default is 20 minutes but you can change in web.conifg </p>
<pre><code><sessionState timeout="20"></sessionState>
</code></pre>
|
How to call a second-level base class method like base.base.GetHashCode() <pre><code> class A
{
public override int GetHashCode()
{
return 1;
}
}
class B : A
{
public override int GetHashCode()
{
return ((object)this).GetHashCode();
... | <p>(edit - misread question)</p>
<p>If you want to get the original <code>object.GetHashCode()</code> version; you can't - at least, not unless <code>A</code> makes it available via something like:</p>
<pre><code>protected int GetBaseHashCode() { return base.GetHashCode();}
</code></pre>
<p>(and have <code>B</code> ... |
Is there a tool for non-developers (translators!) to edit resource bundles? <p>What we do in our company to let our software be translated by external translators is ... well .. how to put it...</p>
<ol>
<li>cvs co someModule</li>
<li>ant translation.export (behind this target there is a self-made ant task, exporting ... | <p>java also provides its own <a href="https://resourcebundleeditor.dev.java.net/" rel="nofollow">resource bundle editor</a>. </p>
|
Javascript : accessing function arguments generically <p>Here is what I have :</p>
<pre><code>var log = function(arg1, arg2){
console.log("inside :" + arg1 + " / " + arg2);
};
var wrap = function(fn){
return function(args){
console.log("before :");
fn(args);
console.log("after :");
}
};
... | <p>You can use <a href="https://developer.mozilla.org/en/Core%5FJavaScript%5F1.5%5FReference/Objects/Function/apply">apply</a> to call a function with a specified 'this' and argument array, so try </p>
<pre><code>var wrap = function(fn){
return function(){
console.log("before :");
fn.apply(this, a... |
sIFR 3 r4.36 has problem with Flash 8 <p>I cannot export any font with Flash 8 using sIFR 3 r4.36. Flash 8 always shows the following error message. Any idea why?</p>
<pre><code>** Error ** Scene=Scene 1, layer=code, frame=1:Line 19: The class or interface 'sIFR' could not be loaded.
import Options
Total ActionS... | <p>Make sure the <code>sifr.fla</code> file and the ActionScript files are in the same directory.</p>
|
How to develop and test an app that sends emails (without filling someone's mailbox with test data)? <p>I have a lot of apps that send email. Sometimes it's one or two messages at a time. Sometimes it's thousands of messages.</p>
<p>In development, I usually test by substituting my own address for any recipient addres... | <p>I faced the same problem a few weeks ago and wrote this: <a href="http://smtp4dev.codeplex.com">http://smtp4dev.codeplex.com</a></p>
<blockquote>
<p>Windows 7/Vista/XP/2003/2010 compatible dummy SMTP server. Sits in the system tray and does not deliver the received messages. The received messages can be quickly v... |
Ant target to move directories out of another directory <p>What is the simplest way to move everything out of a target directory?</p>
<p>I have this <code>basedir/parentdir/<subdir></code>. I have many different <code><subdir></code>. I need to move them out into the same level as <code>parentdir</code> so... | <p>Try this</p>
<pre><code><project name="moveproject" basedir="." default="moveDirs">
<target name="moveDirs">
<move todir="${basedir}" includeEmptyDirs="yes" verbose="true">
<fileset dir="parentdir" >
<include name="**/*" />
</fileset>
</move>
</ta... |
How to use a different version of Java on the command line <p>OK I have 2 different version of Java install on my machine (CentOS 5), the system defaults to 1.5.0_14 but I need to run a command on the command line with the newer version of Java. How can I pass the newer version in the command line?</p>
<p>Sorry this i... | <p>Just use the full pathname for your java executable, rather than allowing the OS to pick one based on your PATH.</p>
|
Google Calendar API: java.lang.ClassNotFoundException: com.google.common.collect.Maps <p>I am creating a fairly simple Java client that connects to my account and gets all the events. Here I am getting an exception saying :</p>
<pre>
java.lang.ClassNotFoundException: com.google.common.collect.Maps</pre>
<p>Could anyo... | <p><a href="http://code.google.com/p/google-collections/">Google collections</a>, now known as <a href="https://code.google.com/p/guava-libraries/">Guava</a>.</p>
|
How do I select the previous control to a container control? <p>I have a control which contains a <code>NumericUpDown</code>. The updown is only shown when the container has focus, so the container has to be selectable (or else it could never receive focus). I want the control to behave as a single entity with regard... | <p>if you know the direction of the tab you could use <code>SendKeys.Send("+{TAB}");</code> and <code>SendKeys.Send("{TAB}");</code></p>
<p>or you could use <code>Control.SelectNextControl()</code></p>
|
C# Multidimensional Arrays Like PHP <p>I've been trying to do this for about 6 hours now and i'm stumped..</p>
<p>I want the equivalent of this in C#:</p>
<pre><code>
$settings = array();
foreach(file('settings.txt') as $l) $settings[]=explode(',',$l);
print $settings[0][2];
</code></pre>
<p>This is wha... | <p>Use a <em>jagged array</em> instead of a multidimensional one â or better yet, a <code>List<string[]></code>:</p>
<pre><code>var settings = new List<string[]>();
foreach (string line in File.ReadLines("settings.txt", System.Text.Encoding.ASCII))
settings.Add(line.Split(','));
</code></pre>
<p>Ma... |
Can Scala actors process multiple messages simultaneously? <p><a href="http://stackoverflow.com/questions/1005659/scala-actors-as-single-threaded-queues/1006491#1006491">The reply</a> to a recent question of mine indicated that an actor processed its messages <em>one at a time</em>. Is this true? I see nothing that exp... | <p>Actors process one message at a time. The classic pattern to process multiple messages is to have one coordinator actor front for a pool of consumer actors. If you use react then the consumer pool can be large but will still only use a small number of JVM threads. Here's an example where I create a pool of 10 con... |
Midnight in UTC time zone with unix timestamp <p>I was looking for a numeric representation for a date and unix time for midnight (in UTC) seems to be reasonable choice for that. However, as I'm not sure in my math skills, so is</p>
<pre><code>date = date - date % (24 * 60 * 60);
</code></pre>
<p>where <code>date</co... | <p>Yes, your formula is a perfectly good way of doing that. Another way of accomplishing the same thing is:</p>
<pre><code>date = (date / 86400) * 86400;
</code></pre>
<p>It may be worth noting that the above formula assumes integer (truncating) division. Also, I feel that <code>86400</code> is a sufficiently commonl... |
Does any button in a form automatically submit? How do I disable this? <p>I'm trying to have a clear button inside a html form, but it appears to automatically submit. How do I work around this?</p>
<p>I feel like I am missing something obvious.</p>
<p>Thank you, I have a working answer ... so now I'm just curious. ... | <p>You have to make the type of the input element "<code>reset</code>", not "<code>submit</code>".</p>
<p>edit: fixed .. reset, not clear</p>
|
Split a non-power-of-two based int <p>I know that you can split a power-of-two number in half like so:</p>
<pre><code>halfintR = some32bitint & 0xFFFF
halfintL = some32bitint >> 16
</code></pre>
<p>can you do the same thing for an integer which is bounded by a non-power of two space?</p>
<p>(say that you w... | <p>Well, of course. <code>& 0xffff</code> is the same as <code>% 0x10000</code> and <code>>> 16</code> is the same as <code>/ 0x10000</code>. It is just that division by a power-of-two is more efficient when done with bit operations like shifting and masking. Division works with any number (within range of re... |
Catch and continue in SQLServer <p>I have this sql procedure:</p>
<pre><code>create procedure DELETE as
DECLARE VARIABLES
begin TRY
DECLARE CURSOR FOR SELECT ANYTHING
OPEN CURUPD
FETCH NEXT FROM CURUPD INTO VARIABLES
WHILE @@FETCH_STATUS = 0 BEGIN
UPDATE TABLE BASED SON VARIABLES
FETCH NEXT FROM CURUPD INTO VARIABL... | <p>You would have to put the TRY/CATCH inside of the WHILE loop. The way you have it, you can't <em>continue</em> the WHILE loop, because it's already finished.</p>
|
Want to fire Dropdown SelectedIndexChanged Event in Javascript <p>I have dropdown on my page, I am changing selected value of dropdown from popup window using javascript. I have some logic in dropdown SelectedIndexChanged event, so I need to fire the SelectedIndexChanged event when dropdown selection changed from javas... | <pre><code>document.getElementById('<%= yourDropdown.ClientID %>').onchange();
</code></pre>
<p>This should work, if you are still getting some error, you can try like this:</p>
<pre><code>setTimeout('__doPostBack(\'yourcontrolClientSideID\',\'\')', 0);
</code></pre>
<p><code>yourcontrolClientSideID</code> is ... |
ASP.Net cannot create/shadow copy <p>I get this error repeatedly when developing ASP.Net applications:</p>
<pre><code> Cannot create/shadow copy 'XXXXX' when that file already exists
</code></pre>
<p>Where XXXXX is a random DLL. Typically the DLL is one of the DLLs from Microsoft's Enterprise Library, but it varies.... | <p>Wait somewhere between 10-30 seconds and hit refresh. For some reason this always works for me.</p>
|
IIS not serving shtml files properly, instead the browser tries to download the file <p>Okay, so I'm at a temporary office and they've given me a machine with XP to do dev on. Awesome.</p>
<p>I've set the site up in IIS and I need it to serve shtml files.</p>
<p>Problem is, when I browse to the shtml file, the browse... | <p>are you serving it with the correct mime type?</p>
<p>shtml simply use the <code>text/html</code> mime type but your IIS might not be configured to match that file extension with that mime type</p>
<p>See <a href="http://technet.microsoft.com/en-us/library/cc725608%28WS.10%29.aspx" rel="nofollow">http://technet.mi... |
Which dialect of Lisp should I learn? <p>I know there are a few different dialects of Lisp. Having decided that learning Lisp would be a new intellectual experience, I would like to know which Lisp dialect to learn, and why.</p>
<p>Is there one which is more popular than the others? Is any one of them more "complete",... | <p>You want to look for a balance between simplicity and cleanliness, attractive features, and a platform that will allow you to write interesting and useful software (to yourself) as well as serve as a learning tool. (This last will keep you going and learning for a lot longer.) Here are some possibilities:</p>
<ol>
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.