input
stringlengths
51
42.3k
output
stringlengths
18
55k
How to append tr to top of table <p>how can i append a new tr to the top of the table instead of under other tr.</p> <p>Example:</p> <pre><code>&lt;table width='100%'&gt; &lt;tr&gt;&lt;td&gt;something&lt;/td&gt;&lt;td&gt;else here&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;something2&lt;/td&gt;&lt;td&gt;else here2&lt;...
<pre><code>$('table').prepend('&lt;tr&gt;&lt;td&gt;something3&lt;/td&gt;&lt;td&gt;else here3&lt;/td&gt;&lt;/tr&gt;'); </code></pre> <p>or...</p> <pre><code>$('&lt;tr&gt;&lt;td&gt;something3&lt;/td&gt;&lt;td&gt;else here3&lt;/td&gt;&lt;/tr&gt;').prependTo('table'); </code></pre> <p><hr /></p> <p>More info on 'prepen...
CSS Image Caching <p>In terms of client-side image caching, is there a difference between the following:</p> <pre><code>**Option #1** &lt;div style="background:url('myimage.jpg');display:none;"&gt;&lt;/div&gt; </code></pre> <p>and</p> <pre><code>**Option #2** &lt;div id="myimage"&gt;&lt;/div&gt; style.css #myimage ...
<p>No. Client caching is controlled by headers returned from the server in the request for the image, not the css.</p> <p>As an aside, if you're looking for image caching, I highly recommend using a CDN. <a href="http://aws.amazon.com/cloudfront/" rel="nofollow">Amazon's CloudFront</a> makes this easy and cheap.</p>
Effective strategies for studying frameworks/ libraries partially <p>I remember the old effective approach of studying a new framework. It was always the best way to read a good book on the subject, say MFC. When I tried to skip a lot of material to speed up coding it turned out later that it would be quicker to read t...
<p>I use a three phase technique for evaluating APIs.</p> <p>1) Discovery - In this phase I search StackOverflow, CodeProject, Google and Newsgroups with as many different combination of search phrases as possible and add everything that might fit my needs into a huge list.</p> <p>2) Filter/Sort - For each item I fou...
What is the best resource for learning C# expression trees in depth? <p>When I first typed this question, I did so in order to find the duplicate questions, feeling sure that someone must have already asked this question. My plan was to follow those dupe links instead of posting this question. But this question has not...
<p>Chapter 11 (Inside Expression Trees) and chapter 12 (Extending Linq) of Programming Microsoft Linq (ISBN 13: 978-0-7356-2400-9 or ISBN 10: 0-7356-2400-3) has been invaluable for me. I haven't read Jons book, but he is a quality guy and explains things well, so I assume that his coverage would also be good.</p> <p>A...
ejb vs hibernate <p>When is better to use hibernate and when ejb3? Aren't there any impediments with either hibernate or ejb3?</p>
<p>I'm in the direct hibernate camp here. </p> <p>Just think how likely it is that your going to what to change your database say from DB2 to oracle, well that is about as likely as changing from Hibernate to Toplink or eclipse it just isn't going happen that often. It's the same old thing that programmers just love t...
How do I reorder/clear the connection history in SQL Management Studio 2008? <p>I connect to a lot of different servers in SQL Management Studio, but I find that not only is there no way to delete the old connections (dbnames, usernames, etc.), they also start to show up as duplicates.</p> <p>Is there any way to clear...
<p>I had the same issue and found the file in question is SqlStudio.bin. I'm not sure how you'd go about editing it, but if you re/move it, you get a blank slate for your SQL connections.</p> <p>We still use XP here at work, so the file is located in the C:\Documents and Settings\%USERNAME%\Application Data\Microsoft\...
distributed application model, server and multiple clients (client can run on server) <p>I've got a system i'm designing where we're using 4 specialized PC's we manufacture in house that have 16 serial ports (db-9 RS232) I need to communicate with 64 units near simultaneously (4x16) and manage the communications. <str...
<p>Definitely check out the Concurrency and Coordination Runtime (CCR):</p> <p><a href="http://msdn.microsoft.com/en-us/library/bb648752.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb648752.aspx</a></p> <p>EDIT:</p> <p>Link to download: </p> <p><a href="http://msdn.microsoft.com/en-us/robotics/aa73...
SQLCE - Ignoring query execution <p>Deploying database(*.sdf) to Pocket PC WM 5.0. Via C# i am attempting to DELETE records. The DELETE query returns that 5 rows are affected(there are 5 rows). However, when i view database in Pocket PC under its Query Tool the rows remain. No error or issue arise at my code lev...
<p>Are you doing the DELETE in a transaction, and forgetting to .Commit() it?</p>
How to set up properly resource pools in VMWare ESXi? <p>How to set up properly resource pools in VMWare ESXi? Does anyone have any blog entries etc.?</p> <p>Thanks</p>
<p>Sign up for a VMworld Account and watch the videos from <a href="http://www.vmworld.com/community/sessions/2007" rel="nofollow">VMworld 2007</a></p> <p>Particularly IO20 and IO21. You have to have an account to view, and the direct links are a little flaky.</p>
Referencing Error to the AudioToolbox in Objective C <p>I'm getting the following error in a simple Roulett app where I'm trying to play some wav files. I'm not sure what the error means because no warning flags come up in the code, and I've imported </p> <p>Here is the error:</p> <blockquote> <p>Undefined symbol...
<p>Found it. Realized I had not imported the Framework AudioToolbox.Framework in XCode. :)</p>
How to avoid hardcoded field names in entity framework? <p>How do i avoid using hardcoded table and field names in entity framework? For example:</p> <pre><code> Contact contact = contactQuery.Include("SalesOrderHeader.SalesOrderDetail") .FirstOrDefault(); </code></pre> <p>Is there a way to get that ...
<p>If you want to use the Entity Frameworks metadata, you need to go looking through the <code>MetadataWorkspace</code> which hangs off the <code>ObjectContext</code>.</p> <p>The starting point is to get the EntityType for your base type, in your case Contact.</p> <p>I have an <a href="http://blogs.msdn.com/alexj/arc...
use M-q in Emacs without turning all my code into comments <p>Say you write some code like this (using ruby-mode, but I've seen this happen in other modes too):</p> <pre><code># This is a comment. def foo puts "foo!" end </code></pre> <p>If you put the point on the first line and hit M-q, you get this:</p> <pre>...
<p><a href="http://www.emacswiki.org/emacs/FillAdapt">filladapt.el</a> does the trick. That with the latest version of <a href="http://www.emacswiki.org/emacs/RubyMode">RubyMode</a>.</p> <p>Using those two packages solves the M-q problem you're seeing. (Using GNU Emacs 22.1)</p> <p>Looking at the code for ruby-mode...
What's the best way to resolve a combinatorial explosion of interactions? <p>One of the things I'm working on right now has some similarities to a game. For purposes of illustration, I'm going to explain my problem using an example drawn from a fictitious, hypothetical game.</p> <p>Let's call it <em>DeathBlaster 4: Th...
<p>An interesting potential option would be to use a variant of the <a href="http://en.wikipedia.org/wiki/Visitor%5Fpattern" rel="nofollow">Visitor Pattern</a>.</p> <p>Judith Bishop and R. Nigel Horspool wrote a paper about <a href="http://webhome.cs.uvic.ca/~nigelh/Publications/Tools08.pdf" rel="nofollow">design patt...
Windows Services and shutting down EC2 nodes <p>I've got a fairly simple Windows service running on testbed EC2 nodes right now that basically:</p> <ul> <li>Calls a Web Service on a machine in our local data center when the service starts (the service is set to Automatic startup, so it runs when the instance comes onl...
<p>A lot of things happen when Windows shutsdown so my guess is something has already stopped that your web service call needs, first guess would be the network connection.</p> <p>It's a bit of a tricky one since you can't keep a local log file on the C or D drives to check whether the call is at least ebing attempted...
Synchronizing a timer to prevent overlap <p>I'm writing a Windows service that runs a variable length activity at intervals (a database scan and update). I need this task to run frequently, but the code to handle isn't safe to run multiple times concurrently.</p> <p>How can I most simply set up a timer to run the task...
<p>I'd use Monitor.TryEnter in your elapsed code:</p> <pre><code>if (Monitor.TryEnter(lockobj)) { try { // we got the lock, do your work } finally { Monitor.Exit(lockobj); } } else { // another elapsed has the lock } </code></pre>
SSRS: ASP.NET ReportViewer parameters reset to default when clicking View Report <p>I have a SQL Reporting Services report (SQL 2008 built using Report Builder v2.0) which has a multi select integer parameter (in this case a list of stores).</p> <p>The default value is <code>0</code> ("All Stores"). The parameter is p...
<p>I made a mistake. The <code>ReportViewer</code> control was inside a Master Page. Each time the "View Report" button was clicked it did a postback and reset the session.</p> <p>I added <code>if (!IsPostBack)</code> to before the report setup method.</p>
Using interfaces on abstract classes in C# <p>I'm learning C# coming from C++ and have run into a wall.</p> <p>I have an abstract class AbstractWidget, an interface IDoesCoolThings, and a class which derives from AbstractWidget called RealWidget:</p> <pre><code>public interface IDoesCoolThings { void DoCool(); } ...
<p>You're running into the issue because you used <strong><a href="http://msdn.microsoft.com/en-us/library/aa288461%28VS.71%29.aspx"><em>explicit interface implementation</em></a></strong> (EII). When a member is explicitly implemented, it can't be accessed through a class instance -- only through an instance of the in...
Modifying look/behavior of the new Popup control (ChildWindow) in Silverlight 3 <p>I would like to remove grey header of the new Popup control in Silverlight 3.</p> <p>Any ideas if this is possible? </p>
<p>Pretty easy, just edit the default ChildWindow style.</p> <ol> <li>In Blend 3 create a new Item of type ChildWindow. (Right Click on the Project --> New Item --> Select ChildWindow from the list)</li> <li>Right click on ChildWindow in the "Objects and Timeline" pane --> Edit Template --> Edit Copy.</li> <li>Navigat...
How can protocol-buffers support serialization/deserialization of std containers? <p>We plan to replace <code>Boost.serialization</code> with protocol-buffers used in distributed system design. How protocol-buffers support complicated data structures such as std containers?</p> <p>For instance, such a class is require...
<p>Protocol buffers have employ a parser which takes a .proto file and creates appropriate serialization routines. See <a href="http://code.google.com/apis/protocolbuffers/docs/overview.html" rel="nofollow">this</a>.</p> <p>Update: You can represent a vector of strings as:</p> <pre><code>message MyCollection { ...
Conditional comments not loading IE6 specific CSS file <p>I'm trying to override a few CSS selectors that are causing problems in IE6 by using the following code inside the head tag in an HTML file:</p> <pre><code>&lt;!--[if IE 6] &lt;style type="text/css"&gt; @import ("ie6.css"); &lt;/style&gt; &lt;![endif]--&gt;...
<p>Actually you only left out the closing bracket for the opening conditional comment tag [if IE 6]> &lt;----</p> <pre><code>&lt;!--[if IE 6]&gt; IE6 stuff here. &lt;![endif]--&gt; </code></pre> <p>Also, you may want to do the @import with either url("ie6.css"); or just the quotes.</p> <pre><code>@import url("ie6.c...
Make 16-bit code work in WinXP or Vista (or alternately how to find Win98 retail licenses?) <p>We have thousands of DOS programs that were all written in the 80s using 16-bit C, comprising over 1,000,000 lines of code. Many of these programs utilize libraries that directly access the screen, drive, etc. (and we don't ...
<p>You could see if they run in DosBox ?</p> <p><a href="http://www.dosbox.com/" rel="nofollow">http://www.dosbox.com/</a></p> <p><a href="http://superuser.com/questions/96812/using-a-printer-in-dosbox">Some versions of DosBox actually supports printing</a>.</p>
Backup and Recovery Scenario <p>Can anyone show me the step of restore and recovery of below scenario?</p> <p>I have used the differential backup (cumulative) everyday.</p> <pre><code>RUN { RECOVER COPY OF DATABASE WITH TAG "whole_database_copy"; BACKUP INCREMENTAL LEVEL 1 CUMULATIVE FOR RECOVER OF COPY WITH TAG ...
<p>Contact Oracle support right now.. Unless you can afford to lose this data, don't mess about with listening to what people on forums have to say, now is not the time to experiment.</p>
How can I display my SSN id in the ASP web page with PCI standards <p>In my ASP web page I am displaying SSN number </p> <p>" name ="txtSSNID" size ="20"></p> <p>The Fortify Developer tool detects this as error. How can I fix this issue.</p> <p>I need to display the SSN Number but the thing is it should not caught w...
<p>I am not sure exactly what you want? but like Creidt card numbers cant you just show few 'X' and the last few letters?</p>
Advantage of using Thread.Start vs QueueUserWorkItem <p>In multithreaded .NET programming, what are the decision criteria for using ThreadPool.QueueUserWorkItem versus starting my own thread via new Thread() and Thread.Start()? </p> <p>In a server app (let's say, an ASP.NET app or a WCF service) I think the ThreadPo...
<p>The ThreadPool is always there, however, there are a finite number of threads allocated to the pool based on the number of processors. For ASP.NET applications, it is generally a bad idea to use Threads unless you really are starting off an Async process and know that there won't be a large number of requests (remem...
Cannot Update google adwords account through API (i.e., UpdateAccount()) <p>i'm not able to pro grammatically update the google account using UpdateAccount() method in AccountService . I'm getting exception, when trying to update the address field. can some one let me know . what is the updateable fields in AccountIn...
<p>Both primaryAddress and billingAddress fields of AccountInfo are not updateable.</p> <p>If you are looking an easy way to programmatically manage AdWords account and you are using .NET platform, you should take a look at GemBox.Ppc <a href="http://www.gemboxsoftware.com/Ppc/Overview.htm" rel="nofollow">AdWords API ...
Activerecord - callback after all associated objects are saved <p>I have a model and I would like to store ids of associated objects (denormalize) for performance reasons. I have a method which looks like this:</p> <pre><code>def cache_ids self._tag_ids = self.tag_ids end </code></pre> <p>I thought I could just run...
<p>You might try it in reverse - have the associated objects update their parent's <code>_tag_ids</code> in <code>after_create</code>, <code>after_save</code> (if they are removed from the association and/or added to a new one) and <code>after_destroy</code>. </p> <p>Whether or not this is a better solution would depe...
How do I delete a record from a table? <p>How do I delete a record from a table?</p> <p>For example, the table has two columns: <code>eno</code> and <code>ename</code>. I want to delete one value in ename from the table:</p> <blockquote> <p><strong>Eno</strong>&nbsp;&nbsp;&nbsp;<strong>Ename</strong></p> <p>&...
<p>Your question is somewhat ambiguous. </p> <p>If, as in the title, you want to delete the <em>record</em> containing 'Bimal' then you would write something like:</p> <pre><code>DELETE FROM [table_name] WHERE Eno = 2 </code></pre> <p>However if, as the question body implies, you mean you want to keep the <em>record...
Retrieving Device Context from .NET print API <p>I am working on a .NET application to control DataCard Desktop Card printers, and I have stumbled upon a problem. In order to execute Magnetic Stripe and Chip encoding, I have to call a function in a native printer API dll to enable the printers Interactive mode.</p> <p...
<p>You can do a <code>OpenPrinter</code> to retrieve a printer handle (<code>HANDLE</code>) and then call <code>CreateDC</code> by passing in this handle to get a printer DC anytime (before <code>StartDoc</code>).</p>
Embedding .NET usercontrol in IE8 <p>I have a simple webpage containing a .NET usercontrol embedded using the OBJECT tag. In IE7, the page displays and I can use the usercontrol.</p> <p>However, in IE8, the usercontrol does not even load.</p> <p>Any thoughts / ideas? </p>
<p>This is a change in IE8 due to a vulnerability in assembly loading. See <a href="http://blogs.msdn.com/askie/archive/2009/05/22/net-control-no-longer-loads-in-ie8-in-internet-zone.aspx" rel="nofollow">this post</a> for more details.</p> <p>The control will load if the site is added to the Trusted Sites list. There ...
How to detect SQL Server Express in WiX installer <p>How do I detect if Sql Server Express is installed and running on a machine in a WiX installer?</p> <p>I want to check before installing my application and if it's not installed and running, to inform a user that it has to install it first before installing my appli...
<p>Ok, I found by trial and error option that works:</p> <pre><code>&lt;Property Id="SQLSERVER"&gt; &lt;RegistrySearch Id="SQLServer" Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft Sql Server" Type="raw" Name="InstalledInstances"/&gt; &lt;/Property&gt; </code></pre> <p>I define a registry search, and then check its ...
How focus a textbox after using extjs Ext.MessageBox.alert <p>I want to validate my extjs form. When the text field is empty, there should display an alert box and after that our cursor have to focus on the text box. I tried with the coding below. Alert is working fine. but cursor is not focusing. Can you please help m...
<p>The <a href="http://extjs.com/deploy/dev/docs/?class=Ext.MessageBox">documentation</a> states that MessageBox is asynchronous:</p> <blockquote> <p>Note that the MessageBox is asynchronous. Unlike a regular JavaScript alert (which will halt browser execution), showing a MessageBox will not cause the code t...
Is there a standard closure interface that is Serializable? <p>If not, maybe you could tell me why.</p> <p>I get NotSerializableException when my class is being serialized.</p> <p>Inside the class I am passing this anonymous class to a method:</p> <pre><code>new org.apache.commons.collections.Closure() { ... }; <...
<p>All references in your class must be of the type Serializable as well, even the Closure type. Is it an interface? It must extend the java.io.Serializable interface.</p> <p>I.e:</p> <pre><code>interface Closure extends java.io.Serializable { ... } class YourClass implements java.io.Serializable { private C...
design a stack such that getMinimum( ) should be O(1) <p>This is one of an interview question. You need to design a stack which holds an integer value such that getMinimum() function should return the minimum element in the stack.</p> <p>For example: consider the below example</p> <pre> case #1 5 --> TOP 1 4 6 2 W...
<p>EDIT: This fails the "constant space" constraint - it basically doubles the space required. I very much doubt that there's a solution which <em>doesn't</em> do that though, without wrecking the runtime complexity somewhere (e.g. making push/pop O(n)). Note that this doesn't change the <em>complexity</em> of the spac...
Implementing run-length encoding <p>I've written a program to perform run length encoding. In typical scenario if the text is</p> <pre><code>AAAAAABBCDEEEEGGHJ </code></pre> <p>run length encoding will make it</p> <pre><code>A6B2C1D1E4G2H1J1 </code></pre> <p>but it was adding extra 1 for each non repeating characte...
<p>Why don't you encode each <code>$</code> in the original file as <code>$$</code> in the compressed file?</p> <p>And/or use some other character instead of <code>$</code> - one that is not used much in bmp files.</p> <p>Also note that the BMP format has RLE compression 'built-in' - look <a href="http://www.fileform...
Flash ad network for non-games <p>I'm looking for a flash ad network which serves preloader ads for my flash application, just like <a href="http://www.mochiads.com" rel="nofollow">MochiAds</a>, <em>except</em> that my flash apps are, strictly speaking, not games, and therefore are not eligible for sign-up at MochiAds....
<p>The NewGrounds API is used for anything posted in their Portal, be it apps, games or cartoons.</p>
Office 2007 Style UI Ribbons: DevExpress or TMS? <p>Who provides the better solution for this particular component?</p>
<p>We have been using both. As I see it, each solution has it's pro and contra. </p> <p><strong>DevExpress</strong></p> <ol> <li>Responsive (as in fast) components.</li> <li>Adheres to the Microsoft standard.</li> <li>Clean code.</li> <li>Very good support</li> <li>Expensive.</li> </ol> <p><strong>TMS</strong></p> ...
Is there a way to override class variables in Java? <pre><code>class Dad { protected static String me = "dad"; public void printMe() { System.out.println(me); } } class Son extends Dad { protected static String me = "son"; } public void doIt() { new Son().printMe(); } </code></pre> <...
<p>In short, no, there is no way to override a class variable. </p> <p>You do not override class variables in Java you hide them. Overriding is for instance methods. Hiding is different from overriding. </p> <p>In the example you've given, by declaring the class variable with the name 'me' in class Son you hide the c...
Finding a legacy firebird/Interbase database password <p>I have a customer that has an old non-existant application; he had a problem with the company that made the application and they won't disclose his database password. He realized that he signed a contract (back then) where it said that he was sort of "renting" th...
<p>Firebird does not (yet) store passwords inside the database file.<br /> With this in mind, move the database file to another server where the sysdba password is known. </p>
Encrypted data size using RSA encryption (RSACryptoServiceProvider) <p>I need to use some encryption mechanism in one of the project I am working on. I was exploring RSA encryption and wrote some sample programs to learn.</p> <p>I understand that block size of RSA encryption is 16 bytes. So I gave the string "12345678...
<p>You are mistaken. RSA is not a block cipher, so you cannot really talk about the block size of it.</p> <p>The output of a RSA encryption will have the same length as the RSA modulus. You have not indicated any RSA key in your code, so the runtime will (as far as I recall) use a default key. That key apparently has ...
UIAlertView inside an NSOperation is not modal in iPhone <p>So I am trying to create a check that tries to connect to the WWW. when it fails it needs to then retry several times before the application gives up and quits. Each time it retries the user is propted with an UIAlertView with the options to Retry or Cancel.<...
<p>If I understand you correctly, you want a modal version of UIAlertView, but only modal within the calling thread/NSOperation? A few problems with this: </p> <ul> <li>You should probably only call interface operations from the main thread (easily addressed using performSelectorOnMainThread:)</li> <li>Modal dialogs a...
Help with jQuery UI dialog <p>I am using jQuery UI.Dialog. I'm having a small problem, when I click the link to show dialog box the text from #Test disappears and the modal overlay is shown but the actual modal box is not displayed.</p> <p>Using FireBug the dialog box is created but has Display:None so is not shown. ...
<p>You might want to add to the click is e.preventDefault(); so it doesn't try to load the # which may refresh the page. </p> <pre><code> $("a").click(function(e){ e.preventDefault(); $('#Test').css('display','inline'); $("#Test").dialog({modal: true}); }); </code></pre>
Finding the current active language on windows <p>What are the possible solutions for finding the current active language which appears on the Windows language bar ? </p>
<p><code>CultureInfo.CurrentCulture</code>. This has information on the language and culture. If you just want the language name, try <code>CultureInfo.CurrentCulture.ThreeLetterISOLanguageName</code>.</p>
Why should member variables be initialized in constructors? <p>When I first started working with object-oriented programming languages, I was taught the following rule:</p> <blockquote> <p>When declaring a field in a class, don't initialize it yet. Do that in the constructor.</p> </blockquote> <p>An example in C#:<...
<ul> <li><p>If you have multiple constructors, you might want to initialize a field to different values</p></li> <li><p>When you initialize the field in the constructor, there can be no confusion over when exactly it is initialized in regard to the rest of the constructor. This may seem trivial with a single class, but...
Optimize jQuery code <p>I've written this jQuery code that fades in a overlay with some links over an image. What i found out is that it is painfully slow when I add like 10 of these images. I would really appreciate some tips and tricks on how to make this code faster.</p> <p>If you have some tips for my HTML and CSS...
<p>I got it to respond a little better by simply changing the following within the hover(..):</p> <pre><code> function () { $(".download", this).fadeTo("fast", 1); $(".hud", this).fadeTo("fast", 0.7); }, function () { $(".download, .hud", this).fadeTo("fast", 0); } </code></pre> <p>The biggest dif...
Run multiple commands in one ExecuteScalar in Oracle <p>I have a batch of sql statements such as ...</p> <p>insert into.... ; insert into.... ; delete .........;</p> <p>etc</p> <p>When i try to execute them against oracle it gives me <a href="http://ora-00911.ora-code.com/">this</a> error (ORA-00911 Invalid Characte...
<p>Try wrapping with a <code>BEGIN..END</code></p> <pre><code>BEGIN insert into.... ; insert into.... ; delete .........; END; </code></pre>
LINQ Conflict Detection: Setting UpdateCheck attribute <p>I've been reading up on LINQ lately to start implementing it, and there's a particular thing as to how it generates UPDATE queries that bothers me.</p> <p>Creating the entities code automatically using SQLMetal or the Object Relational Designer, apparently all ...
<p>Well, to answer the first question - I agree with you. I'm not a big fan of this "built in" optimistic concurrency, especially if you have timestamp columns or any fields which are not guaranteed to be the same after an update occurs.</p> <p>To address the second question - I don't know of any way to override SqlM...
What is the meaning of the default build qualities provided by TFS? <p>There is this set of default build qualities:</p> <ul> <li>Initial Test Passed</li> <li>Lab Test Passed</li> <li>Ready for Deployment</li> <li>Ready for Initial Test</li> <li>Rejected</li> <li>Released</li> <li>UAT Passed</li> <li>Under Investigati...
<p>Those are the default build qualities provided with TFS. They probably won't mean anything to you unless your organization's release process includes steps that would correspond to those qualities.</p> <p>Resources that might help:</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/ms181734%28VS.80%29....
Tips on speeding up a SqlDataSource? <p>I have two SqlDataSource controls on a page. One loads high level data and the other loads more details based on which high level item you choose. It is a part of a large search that has over 900,000 records and I am looking for ways to speed it up. Whether it is options I can...
<p>I don't think your data source control itself would need to be the target for any optimizations. It is only going to work with the data that you get from it (meaning you should optimize your SQL) or the data put into it before sending it off to SQL (meaning you should optimize your application code).</p>
URL Rewriter.NET web.config node issue <p>I'm using <a href="http://urlrewriter.net/" rel="nofollow">URL Rewriter.NET</a> (which I'm liking a lot, by comparison to URL Rewriting.NET - more versitile it seems, don't get me wrong, I like URL Rewriting.NET, but it didn't seem to satisfy the need, given what I know of the ...
<p>I've used urlrewriter before, and had some problems with actually setting a default document as well. However, eventually we got it (and other minor annoyances) to work by moving the urlrewriter config to different config file than web.config.</p> <pre><code>&lt;rewriter configSource="urlrewriter.config"/&gt; </cod...
Asp.Net User Control Event Wireup from aspx file <p>I've got a user control that has an event that I can subscribe to. This works (ignore syntax):</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { ucControl.Event += new Event(ucControl_Event); } </code></pre> <p>but if I removed this line and p...
<p>What's the visibility of your event handler? If it's private then approach 1 works, approach 2 doesn't. If it's protected or public, both work.</p>
How do I install an ASP.Net MVC application on IIS 7 using Wix? <p>For IIS6 I can use the IIS helpers in Wix to install a web application like this:</p> <pre><code>&lt;iis:WebAppPool Id="AP_MyApp" Name="My Application Pool" Identity="networkService" /&gt; &lt;iis:WebApplication Id="WA_MyApp" N...
<p>I personally recommend using AppCmd.exe (matthewthurlow's first bullet) because you don't have to count on the legacy management components being installed, or risk modifying the configuration XML manually.</p> <p>If you are not comfortable with AppCmd, Mike Volodarsky has a great article on <a href="http://learn.i...
Making an entire row clickable in a gridview <p>I have a gridview and I need to make an event fire when a row is clicked.</p> <p>Is there an existing GridView event I need to bind to to make this happen?</p>
<p>Here's something I prepared earlier:</p> <pre><code> public class RowClickableGridView : GridView { public Style HoverRowStyle { get { return ViewState["HoverRowStyle"] as Style; } set { ViewState["HoverRowStyle"] = value; } } public bool EnableRowClickSe...
borrowing costructors and prototype chain <p>in many books and online tutorial there are examples on passing data to a super-class constructor via a borrowing method pattern:</p> <pre><code>var Parent = function(name) { this.name = name; this.my_parent = "parent_property"; this.go = function() { ...
<p>By calling .call() you don't inherit in the classical sense of the word instead you tell Child to apply Parents prototype onto itself and thus Child.prototype has cloned properties and methods from Parent. This has no issues performance wise whatsoever though so abandoning prototype for efficiency reasons is not a v...
log4cpp gives `unresolved external` errors <p>I'm trying to make work the library and run the tests provided with the latest version of log4cpp on Borland Codegear 2007, in which it's included a bpr project for Borland C++ Builder 5, which is meant to be able to build and run the different tests. The problem is that I'...
<p>Are you linking in the log4cpp library (.LIB)? I'm not familiar with BCB5 or Codegear but check your link libraries in your project settings and make sure the log4cpp library is included.</p> <p>If it is, then you might have a problem with where the compiler is looking for libraries. Usually an IDE will have a pr...
SQL Inserting data from staging table to two other tables <p>I have a situation in which a CSV is uploaded to my application and each line essentially needs to be put into the database. I read each line and build a data table and then SqlBulkCopy that table up to a staging table.</p> <p>The staging table looks like th...
<p>I'd just bulk copy the CSV into a staging database table. You can delete the table later, if space is a concern.</p> <p>After copying the CSV into, say, StagingTable, the trick is to split it into the other tables. Since your CSV can now be referenced in the database, you can join the other tables to retrieve the...
Use GZIP to boost XML-parsing <p>I am facing the problem to handle many xml-files that are all greater than 70 MB. Validating and accessing them cost a lot of time. Now I am wondering if the following steps could increase my applications performence.</p> <p>I can compress a 70MB xml-file in a gzip-file &lt; 1MB. So I ...
<p>Reading 70 MB from the HD should take no more than 1-2 seconds (depending on your hardware, of course), so if you're having a delay greater than, say, 4 seconds, the bottleneck is not your HD but XML processing and anything you do with that.</p> <p>Before getting into coding your gzip idea (which sounds fine), you ...
What is the difference among heap spraying, heap overflow, heap overrun? <p>What is the difference among heap spraying, heap overflow, heap overrun?</p> <p>Can those terms be replaced with buffer spraying, buffer overflow, buffer overrun?</p> <p>Do they have the same definitions as well?</p>
<ul> <li>Spraying is writing things to random (or at least arbitrary) addresses in the named space, thus corrupting arbitrary things in the space</li> <li>Overflow is putting more data in the space than it will hold, thus corrupting adjacent spaces</li> <li>Overrun is putting more data in a subset of the space (e.g. an...
Ruby exception handling: can't suppress NoMethodError <p>I simply want my method call to suppress all "NoMethodError" exceptions that might arise in the methods it in turn calls.</p> <pre><code>def foo begin bar1 bar2 rescue Exception return '--' end end </code></pre> <p>But this doesn't work. NoMe...
<pre><code>class Object def method_missing(meth,*args) # do whatever you want here end end </code></pre> <p>If you want something less global, you can do this on an narrower class, or even a specific instance:</p> <pre><code>class &lt;&lt; my_object # and so forth </code></pre>
Why is my return type meaningless? <p>I am trying to use a return type of <code>const MyClass * const</code>. However, I get a warning:</p> <blockquote> <p>Warning: #815-D: type qualifier on return type is meaningless.</p> </blockquote> <p>Is this not a valid type? I want a pointer than cannot be changed, and I w...
<p>The pointer itself has value type, so it doesn't make sense to make it const. What the caller function does with the returned value can't be restricted by the called function. This is akin to trying to define something like:</p> <pre><code>const int getInt(); </code></pre> <p>getInt(), in this case, just returns a...
What are the most important infrastructure components in large-scale development? <p>What are some of the building blocks foundational to enterprise business applications? I'm thinking about re-usable components multiple applications share to:</p> <ol> <li>Scale up faster</li> <li>Speed development by eliminating re-...
<p>I'd add GUI widgets that allow teams to maintain the same look and feel across the application(s).</p> <p>As well, in a large project where multiple teams must work on sub-systems that are going to plug together at some point a set of design patterns for similar sub-systems is invaluable.</p> <p>Additionally, crea...
Is there any use for Flex + Python/Ruby without a web framework (Django/Rails)? <p>I often hear about Flex being combined with web frameworks on the backend. The idea being that Flex serves as the presentation framework while the web framework (Django/Rails) does the database lookups and sends the data to Flex to prese...
<p>You can still code against WSGI directly in Python. If that's the route you want to go, <a href="http://www.python.org/dev/peps/pep-0333/" rel="nofollow">PEP 333</a> is about the only way to go.</p> <p>With that said, doing so is a good learning experience, but WSGI wasn't really intended to be used directly. You...
Flex 3 sorting object fields <p>I have an object in <strong>ActionScript3</strong> code, which I need to sort.</p> <p>I iterate through the object and print out each value:</p> <pre><code>for (var i:String in columnData) { </code></pre> <p>However I need the data I am iterating to be sorted alphabetically. Any sugge...
<p>You can only sort Array/Lists, not fields in an object.</p> <p>If you want a sorted order, you first need to iterate thru the object and push the values in an array/list and <em>then</em> sort it.</p> <p><strong>[Edit]:</strong> OK, so I assumed you just needed the data. No, flex doesn't provide a hashmap (like a ...
"home-brew" STL for performance? <p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html" rel="nofollow">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html</a></p> <p>According to that article STL isn't suited for game-development. What are your thoughts about this ?</p> <p>My c...
<p>Your approach is the only sane option in this case. Rule #1 for optimization is "do not optimize unless you know exactly where the bottlenecks are". </p> <p>You should still be able to swap your container relatively easily later on, especially if you use a type defined via typedef instead of directly using the STL ...
Is there a way to define symbolic constants in Javascript? <p>I searched if JavaScript offers a mean to define symbolic constants, but didn't find anything. Did I miss something ? </p> <p>Is it a common practices to use const var instead ? </p> <pre><code>var const MAXIMUM_VALUE = 100; </code></pre> <p>Thanx.</p>
<p><code>const</code> is not supported by IE, so if you want to support IE that is out of the question.</p> <p>As far as I know, and the best way of doing this to keep it simple is to just have a naming convention for your constants like the ever-popular ALL UPPERCASE. There are some examples out there to force consta...
Static Generic Class as Dictionary <p>A static field in a generic class will have a separate value for each combination of generic parameters. It can therefore be used as a Dictionary&lt;Type, <em>whatever</em>&gt;</p> <p>Is this better or worse than a static Dictionary&lt;Type, <em>whatever</em>&gt;?</p> <p>In ot...
<p>I like using generic types this way. In particular, I often have private nested generic classes for precisely this purpose.</p> <p>The main thing I like about it is that it's hard <em>not</em> to get the initialization right this way (in terms of thread safety), given the way type initialization works. The only pro...
Google analytics, why have two script blocks? <p>Why does the Google Analytics script I add to my webpage need to come in two script blocks?</p> <pre><code>&lt;script type="text/javascript"&gt; var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("...
<p>The first script in your quote above writes a new <code>&lt;script&gt;</code> loading tag into the document. The second block has dependencies that are loaded by that dynamically written script tag, so the browser has to have a chance to load and parse the script before the second block runs. If everything was in on...
Embed Python script <p>I have some Python Scripts which I would like to use from my VB.NET class library however instead of increasing the amount of files that I distribute is it possible to embed the script into my project/dll in Visual Studio and then run the script from the dll during my program runtime?</p> <p>Tha...
<p><a href="http://docs.python.org/extending/embedding.html" rel="nofollow">Yes, it is possible</a>.</p>
Best resources for starting Jython <p>I just got my first Jython (and Python) project, and I was wondering what documentation, IDEs, etc. are best suited to a Java buff like me. </p> <p>I know there are a lot of questions about starting out with Python, so I'm asking for things that might be specific to Jython. Where ...
<p>For starters, I'd read <a href="http://dirtsimple.org/2004/12/python-is-not-java.html" rel="nofollow">python is not java</a>. It'll give you a good idea of some habits you may have to break to program in Python effectively. As has been mentioned, pydev is a pretty good development environment. Although I would sa...
ASP.net C# Silverlight server component and ajax modal inside firefox <p>I have a modal popup inside of an update panel with a silverlight control. <p>The video displays fine in IE 7/8 but in firefox all I get is a white screen</p> <p>I am using the following video skin from <a href="http://sl2videoplayer.codeplex.c...
<p>I use Object tag, and init params injected to aspx like this : </p> <pre><code>&lt;%= initparams %&gt; </code></pre> <p>initparams is protected variable of my Page class: </p> <pre><code>public partial class _Default : System.Web.UI.Page { protected string initparams; protected void Page_Load(object sen...
Cannot see the last row in my UiTableView <p>I have a UITableView added in InterfaceBuilder. My app runs in LandScape. Because I was unable to use autorotation (still can't figure that out). I am using Transforming it for now. Having said that, I now have to place the UITableView in some weird position for it to look c...
<p>Have you tried logging your view's width and height? Maybe the view is just too big and scaling the UITableView to large?</p> <p>I have had no problems with UITableViews and rotation so far.</p>
Large Object Heap Fragmentation <p>The C#/.NET application I am working on is suffering from a slow memory leak. I have used CDB with SOS to try to determine what is happening but the data does not seem to make any sense so I was hoping one of you may have experienced this before.</p> <p>The application is running on...
<p>Why can't Microsoft provide us with a simple API in .NET called:</p> <pre><code>GC.CompactLargeObjectHeap() </code></pre> <p>even if this method causes the application to hang for 10 seconds or more -- it beats the heck out of crashing and requiring Application restart to clean up the memory!</p> <p>There are a g...
DataTable Wrapper or How to decouple UI from Business logic <p>I am using web forms, C#, Asp.net. As we all know, in this model UI and business logic are often mixed in. How do I separate these effectively?</p> <p>The example I would like to use is: I have a GridView and a DataTable (GridView binds to the DataTable a...
<p>I went through this recently while decoupling much the same thing from our UI layer.</p> <p>You can see my progress <a href="http://stackoverflow.com/questions/583689/dictionaryt-of-listt-and-listviews-in-asp-net">here</a> and <a href="http://stackoverflow.com/questions/609276/listview-dataitem-shows-null">here</a>...
Why would AccessDataSource return different results to query in Access? <p>I have a query to return random distinct rows from an Access database. Here is the query:</p> <pre><code>SELECT * FROM (SELECT DISTINCT m.MemberID, m.Title, m.FullName, m.Address, m.Phone, m.EmailAddress, m.WebsiteAddress FROM Members...
<p>When executing the ACE/Jet RND function against a new connection the same seed value is used each time. When using MS Access you are using the same connection each time, which explains why you get a different value each time.</p> <p>Consider these VBA examples: the first uses a new connection on each iteration:</p>...
Looking for MISSING records <p>I'm a bit rusty when it comes to MS Access and I am hoping someone can help me out.....</p> <p>I have a list of all items that have been scanned (for purchase) by each store, by UPC for a one month period. I also have a particular group of UPC's that I want data for. What I want to get...
<p>I would use:</p> <pre><code>SELECT ul.upc FROM upc_list ul LEFT JOIN upc_scanned us ON ul.upc = us.upc WHERE us.upc Is Null </code></pre> <p>With your tables and fields:</p> <pre><code>SELECT [Master UPC List].UPC FROM [Master UPC List] LEFT JOIN [No Scans] ON [Master UPC List].UPC = [No Scans].UPC WHERE [No ...
C#: How to access a button outside the form class <p>I want to either enable or disable a button from another file,what should I do?</p> <p>This is the form class declaration: </p> <pre><code>public partial class Form1 : Form </code></pre> <p>I tried with </p> <pre><code>Form.btnName.enabled = false/true </code></...
<p>Simply expose a public method:</p> <pre><code>public void EnableButton(bool enable) { this.myButton.Enabled = enable; } </code></pre> <p>Correction:</p> <pre><code>public void EnableButton() { this.myButton.Enabled = true; } </code></pre>
Legacy html form in ASP .net application <p>I have an html page that I am converting over to an asp .net page. This page contained a form that accesses an external website that I have no control over. There is some sample code below:</p> <pre><code>&lt;asp:Content ID="sample" ContentPlaceHolderID="body" Runat="Server"...
<p>The issue was with nested forms as others have mentioned.</p> <p>I was able to fix all my issues by simply doing the following:</p> <ol> <li>Remove the extra form element i was adding.</li> <li>Leave all controls as simply html controls, except for the submit button.</li> <li>Replace the submit button with an asp ...
Unable to debug ASP .NET 1.0 Application <p>When I try to debug a web site in .NET 1.0, I get the following error "Error while trying to run project: Unable to start debugging on the web server. Could not read key from registry"</p> <p>I was not able to find any documentation on this particular error for not not being...
<p>Consider running the <a href="http://technet.microsoft.com/en-us/sysinternals/bb896652.aspx" rel="nofollow">RegMon</a> from SysInternals. It should show your which registry keys get denied.</p>
Parameterized SQL Query error <p>I have an application that builds dynamic parameterized SQL queries. The following query returns an inner exception of "syntax error at or near "="... </p> <p>I am thinking it is in the way that I am assigning the parameter to the column name but, I'm not sure. Code follows.</p> <pre>...
<p>Try just</p> <pre><code>WHERE C_CredCardSSN LIKE @sp1 </code></pre> <p>or </p> <pre><code>WHERE C_CredCardSSN LIKE @sp1+'%' </code></pre> <p>depending on why you had a "%" there (thanks to Joel Coehoorn's comment for pointing out the "%" I'd missed).</p> <p>Or (in response to your comment) maybe:</p> <pre><cod...
C# Shorthand Property Question <p>So here is a bit of syntax that I have never seen before, can someone tell me what this means? Not sure if this is supposed to be some shorthand for an abstract property declaration or something or what.</p> <pre><code>public Class1 myVar { get; set; } </code></pre> <p>For what its ...
<p>In C# 3.0 and later, <a href="http://msdn.microsoft.com/en-us/library/bb384054.aspx">auto-implemented properties</a> make property-declaration more concise when no additional logic is required in the property accessors. They also enable client code to create objects When you declare a property as shown in the follow...
How to send signed emails from java? <p>What APIs/Libraries do you recommend for sending signed emails from Java code? What are the requirements on our company's SMTP-Server to make it transport these signed mails, if any? </p> <p>We already hava a PKI infrastructure running, so certificates are no issue here. </p>
<p>The <a href="http://www.bouncycastle.org/java.html" rel="nofollow">BouncyCastle</a> S/MIME library is easy to use and compatible with common mail clients that support secure mail.</p> <p>BouncyCastle also offers PGP-style email support, but this usually requires recipients to install a plug-in or find other support...
How do you default to Soft Tabs while programming in Textmate? <p>My "Soft Tabs" setting in TextMate is not sticky. After I restart TextMate, I often have to set the option again for the same file. How can I make this setting the sticky default across all files?</p>
<h2>For Textmate 1</h2> <p>After doing some research, I found that you can set TextMate 1 to default to using Soft tabs.</p> <p>In the "Shell Variables" area of the Advanced preferences pane, add a new entry with the name <code>TM_SOFT_TABS</code> and a value of <code>YES</code>.</p> <p>From that point on, TextMate ...
How do I compare two git repositories? <p>I've got two different exports of our CVS repository into git. They diverge at some point, and I'm doing some investigation into why. The development line goes back several years and over tens of thousands of commits.</p> <p>At the beginning of the development line, the SHA1...
<p>Since the two git repositories start out the same, you can pull both into the same working repository.</p> <pre><code>$ git remote add cvsimport-a git://.../cvsimport-a.git $ git remote add cvsimport-b git://.../cvsimport-b.git $ git remote update $ git log cvsimport-a/master..cvsimport-b/master # in B, not in A? ...
How to "flatten" or "collapse" a 2D Excel table into 1D? <p>I have a two dimensional table with countries and years in Excel. eg. </p> <pre><code> 1961 1962 1963 1964 USA a x g y France u e h a Germany o x ...
<p>You can use the excel pivot table feature to reverse a pivot table (which is essentially what you have here):</p> <p>Good instructions here:</p> <p><a href="http://spreadsheetpage.com/index.php/tip/creating_a_database_table_from_a_summary_table/">http://spreadsheetpage.com/index.php/tip/creating_a_database_table_f...
How do I expand a tuple into variadic template function's arguments? <p>Consider the case of a templated function with variadic template arguments:</p> <pre><code>template&lt;typename Tret, typename... T&gt; Tret func(const T&amp;... t); </code></pre> <p>Now, I have a tuple <code>t</code> of values. How do I call <co...
<p>Here's my code if anyone is interested</p> <p>Basically at compile time the compiler will recursively unroll all arguments in various inclusive function calls &lt;N> -> calls &lt;N-1> -> calls ... -> calls &lt;0> which is the last one and the compiler will optimize away the various intermediate function calls to on...
How do you obtain the maximum possible date in Oracle? <p>Is there a function built into Oracle that will return the highest possible date that may be inserted into a date field?</p>
<pre><code>SELECT TO_DATE('31.12.9999 23:59:59', 'dd.mm.yyyy hh24:mi:ss') FROM dual </code></pre> <p>Note that minimal date is much more simple:</p> <pre><code>SELECT TO_DATE(1, 'J') FROM dual </code></pre>
PreparedStatements and performance <p>So I keep hearing that PreparedStatements are good for performance.</p> <p>We have a Java application in which we use the regular 'Statement' more than we use the 'PreparedStatement'. While trying to move towards using more PreparedStatements, I am trying to get a more thorough un...
<p>The notion that prepared statements are primarily about performance is something of a misconception, although it's quite a common one.</p> <p>Another poster mentioned that he noted a speed improvement of about 20% in Oracle and SQL Server. I've noted a similar figure with MySQL. It turns out that parsing the query ...
3d elements as items in a WPF ListBox <p>I'm wondering if anyone knows if it's possible in XAML to have a ListBox whose DataTemplate defines the ListBoxItem as a 3d element. Something along the lines of:</p> <pre><code> &lt;ListBox x:Name="lst3D" HorizontalAlignment="Stretch" VerticalAlignment="Stretch...
<p>There's a couple of ways to do this.</p> <p>You can change the DataTemplate to a ControlTemplate, and have it apply to all the items in the ListBox. But you cannot bind it to a specific data type.</p> <p>The other option is move the DataTemplate to a resources section, and set the DataType to the type of the item ...
Open source survey/questionnaire engine for Java <p>Is there an open source survey engine for java that will allow branching of questions? i.e. Question 1 has the options of A, B, or C and they each take you to a different set of follow-up questions.</p> <p>I've found a couple (JSurveyLib and Socrates QE), but those s...
<p>Please have a look at <a href="http://jcaif.sourceforge.net/jcaif.html" rel="nofollow">JCaiF</a> - "The Java Computer Aided Interviewing Framework (JCaiF) is a collection of Java interfaces that define the common elements of a questionnaire or survey" - so perhaps you can implement your application against these int...
documenting shell scripts' parameters <p>Is there a convention for documenting shell scripts' parameters?</p> <p>For example:</p> <pre><code>#!/usr/bin/env bash # &lt;description&gt; # # Usage: # $ ./myScript param1 [param2] # * param1: &lt;description&gt; # * param2: &lt;description&gt; </code></pre> <p>A few thi...
<p>Traditionally you document your arguments in the usage() function:</p> <pre><code>#!/bin/bash programname=$0 function usage { echo "usage: $programname [-abch] [-f infile] [-o outfile]" echo " -a turn on feature a" echo " -b turn on feature b" echo " -c turn on feature c" echo " -h display...
Scheduling identical SSIS packages to run in parallel <p>We've got an architecture where we intend to use SSIS as a data-loading engine for incoming batches. The intent is to reduce the need for manual intervention &amp; configuration and automate the function as much as possible so we're looking at setting up our "ba...
<p>I don't know of any reason you couldn't do this. You could launch the packages each with a different configuration (or configurations) pointing to different working directories, input folders, etc.</p>
Using Guid in ADO.Net Data Service <p>I'm pulling my hair out on this one. I'm trying to implement a ADO.Net Data Service that uses a Linq to SQL data context. I thought I had it working, but the URL for one of my tables always gets an exception.</p> <p>The obvious difference between the table that isn't working and...
<p>That looks like a bug. I suggest you report it at <a href="http://connect.microsoft.com/visualstudio/" rel="nofollow">http://connect.microsoft.com/visualstudio/</a>, then post the URL of your bug report here, so we can vote on it.</p>
What applications do you use for data entry and retrieval via ODBC? <p>What apps or tools do you use for data entry into your database? I'm trying to improve our existing (cumbersome) system that uses a php web based system for entering data one ... item ... at ... a ... time.</p> <p>My current solution to this is to ...
<p>As j_random_hacker noted, I've used MS Access for years (since Access 97) to connect to an ODBC Data Source.</p> <p>You can do this via linking to external tables: (in Access 2010:)</p> <pre><code>New -&gt; Blank Database External Data -&gt; ODBC Database -&gt; Link to Data Source Machine Data Source -&gt; New -&g...
Microsoft Message Queue - priority flag or a separate queue? <p>I've implemented a system in C# that uses the Microsoft Message Queue (<code>System.Messaging</code>) for communication between related processes. Essentially, a number of <i>Sender</i> services generate messages to put in the queue and a number of <i>Rec...
<p>Should I use this Priority flag rather than implementing another queue? <strong>Yes</strong>.</p> <p>Will it successfully and efficiently jump these messages ahead of the rest? <strong>Yes</strong>.</p> <p>If so, what conditions and side effects are there likely to be if any? <strong>None, MSMQ was designed to wor...
Is there any way to pass an NSArray to a method that expects a variable number of arguments, such as +stringWithFormat: <p>Some context: I'm trying to clean up some of my FMDB code. My one table has a lot of columns and the method in FMDB I need to use is one that expects a variable number of arguments, similar to NSSt...
<p>(Edit: This worked back in the GCC days. It doesn't under Clang as of Xcode 4.6.)</p> <hr> <p>Get the objects in the array into a C array, then treat that as a varargs list:</p> <pre><code>//The example input array int i = 42; NSArray *array = [NSArray arrayWithObjects: [NSString stringWithFormat:@"number %d"...
Same rules for multiple directories in Apache? <p>I have 2 subdomains which use the same rules, as seen below:</p> <pre><code>&lt;Directory /srv/project/sites/project.hu/htdocs/&gt; RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)\?*$ index.php?...
<p>put the rewrite rules into a separate file, eg. <code>rewrite.conf</code>, and <a href="http://httpd.apache.org/docs/2.2/mod/core.html#include">include</a> it like so</p> <pre><code>&lt;Directory /srv/project/sites/project.hu/htdocs/&gt; Include rewrite.conf &lt;/Directory&gt; &lt;Directory /srv/project/sites/ad...
IDE for debugging 'C source in linux <p>Recently I am developing using 'C in Linux platforms, the tools like gcc are fast. But I wish it would be great to have an IDE like the VC++ IDE for windows.</p>
<ul> <li><a href="http://www.codeblocks.org/">Code::Blocks</a></li> <li><a href="http://anjuta.sourceforge.net/">Anjuta</a></li> <li><a href="http://www.kdevelop.org/">KDevelop</a></li> <li>Or <a href="http://www.google.com/search?q=site:stackoverflow.com%2Bc%2Bide%2Blinux">check</a> <a href="http://stackoverflow.com/q...
Formula for a orthogonal projection matrix? <p>I've been looking around a bit and can't seem to find just what I"m looking for. I've found "canonical formulas," but what's the best way to use these? Do I have to scale every single vertex down? Or is there a better way?</p> <p>A formula would really help me out, but I'...
<p>Here is a reasonable source that derives an <a href="http://www.codeguru.com/cpp/misc/misc/math/article.php/c10123__2/" rel="nofollow">orthogonal project matrix</a>:</p> <blockquote> <p>Consider a few points: First, in eye space, your camera is positioned at the origin and looking directly down the z-axis. ...
How to read integer in Erlang? <p>I'm trying to read user input of integer. (like cin >> nInput; in C++)<br> I found io:fread bif from <a href="http://www.erlang.org/doc/man/io.html">http://www.erlang.org/doc/man/io.html</a>, so I write code like this.<br></p> <blockquote> <p>{ok, X} = io:fread("input : ", "~d"),<...
<pre><code>1&gt; {ok, [X]} = io:fread("input : ", "~d"). input : 10 {ok,"\n"} 2&gt; X. 10 3&gt; {ok, [A,B]} = io:fread("input : ", "~d,~d"). input : 456,26 {ok,[456,26]} </code></pre> <p>That's all.</p>
Using Winsock and C to talk with an FTP server <p>How would I go about doing this?</p>
<p><a href="http://cs.baylor.edu/~donahoo/practical/CSockets/winsock.html" rel="nofollow">TCP/IP Sockets in C: Practical Guide for Programmers</a> has a number of C code examples using Winsock.</p> <p>There isn't one for FTP but it will get you on your way.</p>
How to get the memory a function consumes <p>Our application consumes lots of memory and we need to identify which function cause the maximum usage of the memory. Is their any way or even any existing tool to do this(Windows, Native)?</p> <p><strong>Here is the environment:</strong></p> <p>Windows Xp</p> <p>VS2008</...
<p>If you have Visual Studio 2008 Team System you can use the <a href="http://blogs.msdn.com/buckh/archive/2007/10/09/using-vsts-2008-memory-allocation-profiling.aspx" rel="nofollow">built-in memory allocation</a> profiler. Here's a good MSDN article, <a href="http://msdn.microsoft.com/en-us/magazine/cc337887.aspx" re...