input
stringlengths
51
42.3k
output
stringlengths
18
55k
Java keeps lock on files for no apparent reason <p>Despite closing streams in finally clauses I seem to constantly run into cleaning up problems when using Java. File.delete() fails to delete files, Windows Explorer fails too. Running System.gc() helps sometimes but nothing short of terminating the VM helps consistentl...
<p>The code you posted looks good - it should not cause the issues you are describing. I understand you posted just a piece of the code you have - can you try extracting just this part to a separate program, run it and see if the issue still happens? My guess is that there is some other place in the code that does <cod...
Best way to implement "Post Card Sized" Web Pages <p>If I wanted to create a web page with content about the size of a post card, how would I go about positioning it on the screen?</p> <p>Horizontally isn't an issue (margins auto); however, centering it vertically is a an issue. </p> <p>What's the best way of center...
<p>You can do this with CSS. Center a container DIV using 50% left and top. Then simply offset your contained postcard 50% of its width &amp; height back.</p> <pre><code>&lt;div id="postcard_container"&gt; &lt;div id="postcard"&gt; Postcard here &lt;/div&gt; &lt;/div&gt; #postcard_container { position...
VS Builtin web server sends images as octet-stream <p>I am debugging an ASP.NET website which has a lot of javascripts and images using Visual Studio 2008 development web server.</p> <p>One of the many scripts try to create an <code>&lt;img&gt;</code> tag on the fly and supply it with a proper <code>src</code> attribu...
<p>Are you using a GenericHandler that renders the image?</p> <p>It would seem like an easy choice to do so.</p> <p>Eg.</p> <pre><code>public class RenderImage : IHttpHandler, IReadOnlySessionState { public void ProcessRequest(HttpContext context) { context.Response.ContentType = "image/png"; context.R...
iPhone SDK: UIWebView to stop images from loading/downloading <p>How can I use the UIWebView in Xcode so that when it loads up pages it DOESN'T download the images (to cause a faster loading page)?</p>
<p><code>UIWebView</code> is a pale, poor little shadow of WebKit's full <code>WebView</code>, for which this is easy. <code>-webView:shouldStartLoadWithRequest:navigationType:</code> only gets called for navigation. It doesn't get called for every request like <code>WebPolicyDelegate</code> does on mac. With <code>UIW...
BinarySearch not having expected results <p>I have populated a sorted list of dates(stored as strings in the format dd/mm/yyyy) from an xml file using xpath.</p> <p>However when querying the list to see if a date exists within the list I always get negative result(i.e. doesnt exist) even though i have hardcode the que...
<p>I believe it has to do with the format of the strings. You list is being sorted by day, month, then year, which isn't correct.</p> <p>You need to format your strings like so:</p> <p>yyyy/mm/dd</p> <p>And then sort the list, and your search should work.</p> <p>If these were dates (as in <a href="http://msdn.micr...
Test IE6 on Mac OS X <p>I like to be able to fully test compatibility of my web pages on Mac OS X. I have installed Parallels desktop. It works fine, but it uses a lot a of resources...</p> <p>So I would like to be able to test everything inside OS X. In fact I am looking for Explorer 6 for the Mac.</p> <p>Any sugges...
<p>IE 6 was never written for the Mac. </p> <p>You might try VMWare Fusion instead of Parallels; you might have better results with resource usage.</p> <p>The other solution, as other posters will indicate, is to run IE on OS X via Wine. However, IE 6 on Wine is nothing like guaranteed to be the same as running it ...
Using a Delegate with Messages <p>I'm learning about delegates and think I may have found a use for one. Basically what I have is a series of string properties that take in a minimum value and a maximum value, like so:</p> <pre><code>string weightInvalid(min as int32, max as int32) </code></pre> <p>There are several...
<p>on c#:</p> <pre><code>delegate string weightInvalid(int min, int max); string MyWeightInvalid(int min, int max) { return ""; } string SomeMethod() { weightInvalid myFunc = new weightInvalid(MyWeightInvalid); return myFunc(0, 1); } </code></pre>
C++ constructor syntax <p>Simple question: are the following statements equivalent? or is the second one doing more implicit things behind the scenes (if so, what?)</p> <pre><code>myClass x(3); myClass x = myClass(3); </code></pre> <p>Thanks!</p>
<p>They are not completely identical. The first is called "direct initialization" while the second is called "copy initialization". </p> <p>Now, the Standard makes up two rules. The first is for direct initialization and for copy initialization where the initializer is of the type of the initialized object. The second...
What kind of data can apps store in the Mesh (and how) <p>Currently one of our applications is being deployed using ClickOnce and it creates a SQL Server Compact 3.5 database in the user profile Application Directory (roaming).</p> <p>I am wondering if Live Mesh would enable us to store this data in the Mesh instead? ...
<p>You can currently use Live Mesh (www.mesh.com) to sync files including database files if you choose. However, be aware that synchronization can result in conflicts if the database is changed in two different locations at the same time. I don't think you want your conflict resolution to happen at the entire-databas...
Good ASP.NET excel-like Grid control? <p>We are looking for an ASP.NET compatible data grid that allows for multi-line editing similar to Excel or a WinForms data grid. It must also support very basic keyboard input (tab, arrow keys, return). Note that we are <strong>not</strong> looking for Excel capabilities (funct...
<p>It does not exist today. There are products such as those you have mentioned which have tried, but in my experience none of them will make an experienced Excel user happy.</p> <p>My company makes Excel compatible spreadsheet components for use with Windows Forms and ASP.NET. We have been getting this question for y...
Why does this code cause an "illegal start of expression" exception? <p>These are my questions:</p> <ol> <li><p>I'm getting a couple of errors on the line "public static boolean validNumCheck(String num){" - "illegal start of expression", "';' expected", and "')' expected".</p></li> <li><p>How can I give the user 3 tr...
<p>I think it is important to create a pseudo code or algorithm of the problem <strong>first</strong> and then if it works deal with the programming <strong>later</strong>. Otherwise you'll be solving two things at the same time 1. Problem logic and 2. Implementation details.</p> <p>This is how I would do it.</p> <pr...
How do I get intellisense for WCF Ajax Services? <p>I've finally got Intellisense working for JQuery by applying patch KB958502 to Visual Studio 2008 and including this line:</p> <pre><code>/// &lt;reference path="JQuery\jquery-1.3.2.js"/&gt; </code></pre> <p>at the top of my .js files. Now I'm trying to figure out ...
<p>Did <code>/// &lt;reference path="../Services/DocLookups.svc" /&gt;</code> not work?</p>
PHP Warning: Too many open files -- any ideas? <p>I'm running PHP 5.2 on Fedora, and I keep getting this warning after about 1000 iterations of my loop, which means the program has stopped working and needs to be restarted. I could set this up to exit after 1000 iterations and restart via a cron shortly thereafter, bu...
<p>You should close the pointer after using it with <a href="http://docs.php.net/pclose" rel="nofollow"><code>pclose</code></a>.</p>
IIS7 - only serves up one page at a time. It's a making me crAzY! <p>Situation: Classic ASP application, using a custom Application Pool. Default settings.</p> <p>On <em>some</em> IIS7 machines, IIS decides to serve only one page at a time. So if multiple load any pages from a site, each one has to load in successio...
<p>In IIS manager click on the application in the tree.</p> <p>Double click ASP under the IIS section.</p> <p>Expand "Debugging Properties"</p> <p>Ensure both "Enable Client-side Debugging" and "Enable Server-side debugging" are set to false.</p> <p>When debugging is enabled ASP is limited to processing one request...
How to get at contents of Forms Authentication ticket with PHP <p>I need to undo the following ASP.Net processes in PHP so I can get at the username and expiration date in a ticket. I've decrypted the 3DES encryption (step 3 below) but I'm not sure what I need to do next. Is the string that results from decryption a by...
<p>I don't think this is possible...</p> <p><strong>A few pre-requisite questions:</strong></p> <ul> <li>Are you sure you have decrypted the string correctly, with the correct <code>MachineKey</code> value and decryption algorithm? I know ASP.NET 1.0 used 3DES but newer versions generally use AES by default.</li> <li...
How to detect if an aspx page was called from Server.Execute? <p>I have the following example page structure:</p> <ul> <li>Webpage.aspx</li> <li>Script.aspx</li> </ul> <p>If I call <code>Server.Execute("Script.aspx")</code> from Webpage.aspx, how can I detect in Script.aspx that it was called from Webpage.aspx and no...
<p>Since Server.Execute runs the new page with the same context as the original page, all the properties of Request should still reflect the original request to Webpage.aspx (except for CurrentExecutionFilePath, which hopefully contains "/Script.aspx"). Request.Path should contain "/Webpage.aspx", while Request.Url wil...
How can I login to Active Directory with C#? <p>How can I login to AD without logout from current user and get new logged user's rights. (OS: Windows XP)</p> <h3>Note:</h3> <p>Not to Modify AD or something like this.Only wanna to login with another user from C# and getting new login's permissions/rights. (I wanna use...
<p>You can use impersonation to change thread identity to a different user, given a valid username and password. There is no way to change the user identity for the whole shell other than logging in as a different user manually, but anything executed on the thread you impersonate on will receive the new rights.</p> <p...
Extract an object schema from wsdl <p>I have an wsdl file that describes a group of objects, but I want to extract the definition just from a subset of them, is this possible, and if so what's the best way to achieve this? My goal is to generate an XSD schema for that subset.</p> <p>What if you are not using the WSDL ...
<p>If you know precisely what objects you want to extract from the schema you could take the wsdl file, run it through a XSL tranformation to keep the pieces you want (or remove the things you don't). </p>
DotNetNuke module development with webservices <p>I need to deploy a webservice as part of a DotNetNuke 4.x module that I'm creating - but am not sure how I can do that and know that it'll always stay in the same place. How can I add an asmx file to my module project, and when I create my .DNN file specify where the w...
<p>You can include the ASMX file by including a element in the <code>&lt;files&gt;</code> section:</p> <pre><code>&lt;files&gt; &lt;file&gt; &lt;name&gt;YourWebService.asmx&lt;/name&gt; &lt;path&gt;&lt;/path&gt; &lt;/file&gt; &lt;/files&gt; </code></pre> <p>Generally, you don't need to specify a path.</p> <p>...
Entity Framework: Update multiple rows in set with data from other set <p>I simply want to achieve this line of SQL:</p> <pre><code>UPDATE table1 SET table1.col = table2.col FROM table2 INNER JOIN table1 ON table2.id = table1.id </code></pre> <p>How can that be done using Entity Framework with minimal number of ...
<p>There is, unfortunately, <a href="http://msdn.microsoft.com/en-us/library/bb387145.aspx" rel="nofollow">no UPDATE in Entity SQL</a> at present. A workaround is to <a href="http://blogs.msdn.com/alexj/archive/2007/12/07/rolling-your-own-sql-update-on-top-of-the-entity-framework-part-1.aspx" rel="nofollow">use regular...
How to distinguish between multiple input devices in C# <p>I have a barcode scanner (which acts like a keyboard) and of course I have a keyboard too hooked up to a computer. The software is accepting input from both the scanner and the keyboard. I need to accept only the scanner's input. The code is written in C#. Is t...
<p><a href="https://web.archive.org/web/20150108213851/http://nicholas.piasecki.name/blog/2009/02/distinguishing-barcode-scanners-from-the-keyboard-in-winforms">You could use the Raw Input API to distinguish between the keyboard and the scanner like I did recently.</a> It doesn't matter how many keyboard or keyboard-li...
Best way to lay out multiple projects in AccuRev <p>I am in the process of switching to AccuRev from another SCM. I have quite a few projects and am struggling how to properly lay them out in AccuRev. </p> <p>I have quite a few related projects and would like to keep them in a single depot, but I haven't found out how...
<p>The concept in Accurev is that the root of your depot represents all of your source code. </p> <p>You then create per-project streams (branches) where work is performed, and which themselves may split into further streams (patches, revisions etc).</p> <p>Users then attach their individual workspaces to these strea...
ASP.NET master pages order of adding scripts <p>I have a master page that adds the jquery library via a registerclientscriptinclude:</p> <pre><code>Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "JQuery", Page.ResolveUrl("~/Scripts/jquery-1.2.6.min.js")); </code></pre> <p>In a page that uses ...
<p>You could re-include the jQuery library in the page, if it's already there it will simply override it, if not it will be added.</p>
UpdateModel won't properly convert a boolean value <p>I have a custom object called S2kBool that can be converted to and from a regular Boolean object. Basically, it allows my application to treat boolean values in my legacy database the same way it treats C# booleans. Then problem is, when I attempt to use a check box...
<p>You could have an additional bool property of type bool that when set changes the value of your S2kBool property.</p> <pre><code>public class MyClass { public S2kBool MyProperty { get; set; } public bool MyPropertyBool { get { return (bool)MyProperty; } set ...
Link to open jQuery Accordion <p>I'm trying to open an accordion div from an external link. I see the "navigation: true" option but I'm not sure how to implement it. Do you give each div an id and call the link like this? <a href="http://domain.com/link#anchorid">http://domain.com/link#anchorid</a> </p> <p>I'm new to ...
<p>The navigation option isn't for panel activation. It's for telling the user where they are. </p> <p>Using simplified html code:</p> <pre><code>&lt;div id="accordion"&gt; &lt;div&gt; &lt;h2&gt;&lt;a href="#services"&gt;Services&lt;/a&gt;&lt;/h2&gt; &lt;p&gt;More information about all of these...
window.onload vs document.onload <p>Which is more widely supported: <code>window.onload</code> or <code>document.onload</code>?</p>
<h2>window.onload</h2> <p><strong>When do they fire?</strong></p> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers.onload">window.onload</a></p> <ul> <li>By default, it is fired when the entire page loads, including its content (images, css, scripts, etc.)</li> <li>In some browsers it...
Why is it so difficult to do a loop in T-SQL <p>OK, I know it can be done, I do it quite often, but why so difficult to do a loop in T-SQL? I can think of a ton of reasons I'd want to parse thru a query result set and do something that simply can't be done without a loop, yet the code to setup and execute my loop is > ...
<p>SQL is a set-based, <a href="http://en.wikipedia.org/wiki/Declarative_programming" rel="nofollow">declarative language</a>; not a procedural or <a href="http://en.wikipedia.org/wiki/Imperative_programming" rel="nofollow">imperative language</a>. T-SQL tries to straddle the two, but it's still built on a fundamentall...
Is there a JAWS-friendly date picker for ASP.NET? <p>Does anyone know of an ASP.NET date picker control that works well with <a href="http://www.freedomscientific.com/products/fs/jaws-product-page.asp" rel="nofollow">JAWS</a>? Barring that, do you have any tips for making the existing ASP.NET date picker control easier...
<p>I doubt you'll have much luck getting the ASP.NET control to be accessible. If I were you, I would look into a client-side version of the control. I found this <a href="http://www.websemantics.co.uk/tutorials/accessible%5Fdate%5Fpicker%5Fcalendar/" rel="nofollow">accessible date picker calendar</a> online that is ...
This BackgroundWorker is currently busy and cannot run multiple tasks concurrently <p>I get this error if I click a button that starts the backgroundworker twice.</p> <pre><code>This BackgroundWorker is currently busy and cannot run multiple tasks concurrently </code></pre> <p>How can I avoid this?</p>
<p>Simple: Don't start the BackgroundWorker twice.</p> <p>You can check if it is already running by using the <code>IsBusy</code> property, so just change this code:</p> <pre><code>worker.RunWorkerAsync(); </code></pre> <p>to this:</p> <pre><code>if( !worker.IsBusy ) worker.RunWorkerAsync(); else MessageBox...
WPF: Best (reliable) way to translate (move) a Canvas AND monitor Every step <p>I have tried translating (moving) a canvas but I'm having trouble with the timers.</p> <p>I tried 2 different methods:</p> <p>First method was with the <code>BeginAnimation</code> function, and the second with <code>DispatcherTimer</code>...
<p>Your problem is that everything is time based, you don't get a callback every time the canvas moves one pixel, you get a callback every time a frame is rendered - and the system doesn't even try to hard to render the frames at a constant rate.</p> <p>The end result is what you are seeing, sometimes you can get a ca...
limit choices to foreignkey using middleware <p>I'm looking to do something like this:</p> <p><a href="http://stackoverflow.com/questions/160009/django-model-limitchoicestouser-user">http://stackoverflow.com/questions/160009/django-model-limitchoicestouser-user</a></p> <p>with some differences.</p> <p>Some models ma...
<p>Ok, I hate to throw a monkey wrench in your works, but you seriously don't need to use threadlocals hacks.</p> <p>The user is in the request object which means there is no need to extract it using middleware. It's passed as an argument to every view.</p> <p>The trick to limiting your form choices is therefore to ...
Table Prefix Using Castle Active Record <p>Is there anyway to add a prefix to table names at configuration time using Castle Active Record?</p> <pre><code>[ActiveRecord("Address")] public class Address : ActiveRecord&lt;Address&gt; {} </code></pre> <p>I'd like the actual table created/referenced to be "PRODAddress" o...
<p>I think you'll have to <a href="http://www.castleproject.org/activerecord/documentation/trunk/manual/xmlconfigref.html" rel="nofollow">configure</a> your own <a href="http://www.hibernate.org/hib%5Fdocs/v3/api/org/hibernate/cfg/NamingStrategy.html" rel="nofollow">INamingStrategy</a></p>
C++ Compile problem with WinHttp/Windows SDK <p>Trying to compile a sample http class with the SDK, and getting some strange link errors... I am sure its something to do with a missing option, or directory...</p> <p>I am no expert in c++ as you can see, but looking for any assistance.</p> <p>I included my sample clas...
<p>If you check the MSDN reference for the WinHttp* functions you will see that you need to link with the library Winhttp.lib.</p> <p>Open the project settings, select the linker options then 'input' and add WinHttp.lib to the 'Additional Dependencies' list.</p> <p>Or you could put</p> <pre><code>#pragma comment(lib...
What is the best way to escape non-format characters in Oracle's to_char? <p>I am trying to print a date in a select statement, but I need to add a letter to the output:</p> <pre><code>to_char(date_updated, 'YYYY-MM-DDTHH:mm:ss') </code></pre> <p>Oracle does not like the T. I just want the T to be output like the col...
<p>You just need double-quotes around it:</p> <pre><code>to_char(date_updated, 'YYYY-MM-DD"T"HH:mm:ss') </code></pre>
Why does GNU make delete a file <p>I've got a slightly hackish makefile for running tests:</p> <pre><code>### Run the tests tests := tests/test1 tests/test2 ... test: $(tests) $(tests): %: %.c gcc -o $@ $(testflags) $&lt; $@ </code></pre> <p>It works, but it makes Make do something I've never seen it do be...
<p>Because the target might not have been built correctly. The next time you <code>make</code> the project, it will attempt to rebuild the target. If the file had not been removed, <code>make</code> would have no way of knowing something went wrong. <code>make</code> can't know that the failure was coming from a tes...
Why can't my software initialize hardware on a different motherboard? <p>I am not a developer, but I think that my question is interesting enough (and I am desperate enough) to post here on stackoverflow</p> <p>My company uses a program written in C# to drive a kiosk PC that uses .Net 2.0 SP1 and a USB signature pad. ...
<p>It's could possibly related to programing/but i am thinking its the hardware/driver issue. </p> <p>You could try removing all drivers and reinstall new drivers under computer management. </p> <p>Most new motherboards of a different model/brand require windows to be reinstalled. </p>
.NET Exception Explorer <p>Does anyone know of a program or plug-in or anything that I can find out what are all the exceptions any method may throw?</p> <p>I think JAVA has this build in if I'm not mistaken. Where the compiler tells you what exceptions this method will throw.</p> <p>Does the same exist for .NET?</p...
<p>I don't know if this is exactly what you are looking for, but:</p> <p><a href="http://www.red-gate.com/Products/Exception_Hunter/index.htm" rel="nofollow">http://www.red-gate.com/Products/Exception_Hunter/index.htm</a></p> <p>Note: I've never used the product, and I don't work for Red Gate, I just remember seeing ...
What is WPF and how does it compare to WinForms? <p>I've been looking at WPF, but I've never really worked in it (except for 15 minutes, which prompted this question). I looked at this <a href="http://stackoverflow.com/questions/193005/are-wpf-more-flashy-like-than-winforms">post</a> but its really about the "Flash" of...
<p>WPF is a vector graphics based UI presentation layer where WinForms is not. Why is that important/interesting? By being vector based, it allows the presentation layer to smoothly scale UI elements to any size without distortion.</p> <p>WPF is also a composable presentation system, which means that pretty much any U...
Programmer productivity with STL vs. custom utility classes <p>I work in an environment where, for historical reasons, we are using a hodgepodge of custom utility classes, most of which were written before STL arrived on the scene. There are many reasons why I think it is a good idea to at least write new code using ST...
<p>There are no studies that will show STL is more productive just because it is STL. Productivity gains from using it are due to it being a standard programmers are familiar with it, and because the code is already written and tested.</p> <p>If your company already has utility classes that employees are familiar with...
How to get the Freebase Python libraries to work in IronPython <p>How do I get the <a href="http://code.google.com/p/freebase-python/" rel="nofollow">Python libraries for using the Freebase API</a> to work under <a href="http://www.codeplex.com/IronPython" rel="nofollow">IronPython 2.0</a>?</p> <p>When I "import freeb...
<p>You're missing the simplejson module. Since easy_install doesn't yet work with IronPython, your best bet is to grab the latest code using SVN from their <a href="http://code.google.com/p/simplejson/source/checkout" rel="nofollow">Google Code project</a>, or <a href="http://apiguy.com/files/simplejson-2.0.9.zip" rel=...
DataMember property [ObjectName] cannot be found on the DataSource <p>I have a business object, which is a composite of child objects.<br /> I am using databinding in Visual Studio 2008 to bind to controls on a Windows form.</p> <p>But I am getting the above error in the InitializeComponent method of the form.</p> <p...
<p>I tried several experiments about this The problem only happens in this condition İf you have a BaseForm and BindingSource on it if you inherit a new InheritedForm from this BaseForm if you have additional binding source on InheritedForm related to the BindingSource (which inherited by BaseForm) you have the desi...
Documentation driven design. Your experiences <p>I noticed this project (<a href="http://blog.tplus1.com/index.php/2009/02/22/my-new-ticket-tracking-system-is-now-vaporware/" rel="nofollow">pitz</a>) that is being written first with the documentation, then tests, and finally code. Has anyone else tried this "Documentat...
<p>Yes, I've done it a couple of times, the most succesful of which was when we were developing a library for use by another part of the organisation, with whom we had erm, "issues". To avoid endless &amp; fruitless arguements, I wrote up the whole library API in the same form that Microsoft use to document the Win32 A...
WPF - UserControl sizing on Custom Canvas <p>I have a custom canvas that I can drop controls on, move, and resize. I need to be able to at least start with a pre-determined size but then allow re-sizing.</p> <p>My problem is that I have a user control that doesn't appear to resize. I set Height and Width on the user...
<p>The WPF layout system can be confusing, as you've discovered. There is no substitute for a solid understanding of the layout and measurement system. If you plan on doing much WPF development, it's worth taking 20 minutes to read <a href="http://msdn.microsoft.com/en-us/library/ms745058.aspx#LayoutSystem%5FMeasure%...
How to easily apply a function to a collection in C++ <p>I'm storing images as arrays, templated based on the type of their elements, like <code>Image&lt;unsigned&gt;</code> or <code>Image&lt;float&gt;</code>, etc. Frequently, I need to perform operations on these images; for example, I might need to add two images, or...
<p>This is why the unary_function, binary_function, etc. types in he STL have the result_type typedefs. If you use std::ptr_fun, you can take advantage of this with Apply,</p> <p>e.g.</p> <pre><code>template&lt;typename Func, typename Arg, typename Result = Func::result_type&gt; Image&lt;Result&gt; Apply(Arg a1, Arg ...
What is the Best way to do Browser Detection in Javascript? <p>In one of my Web Development classes we where asked to create a script that detects NE4,NE6+,IE4,IE6+ Browsers that display a compatable CSS script for each browser.</p> <p>he gave us an article to read about these and the article mentioned <a href="https...
<p>The standard way to detect what browser is used is to check the user agent supplied.</p> <pre><code>var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(n...
How do you detect the main hard drive letter such as C: drive? <p>How do you detect the main hard drive letter such as C: drive?</p>
<p>Try</p> <pre><code>Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System)); </code></pre> <p>That will return (normally) C:\</p> <p>But it depends on how you define the "main" hard drive. This will give you the drive Windows is installed on.</p>
TFrame inheritance refactoring <p>Yet another TFrame IDE-registered-component question from me. Thanks for all the help, fellow programmers. : )</p> <p>Playing around with Darrian's TFrame inheritance suggestion <a href="http://stackoverflow.com/questions/382562/delphi-visual-component-moving-away-from-tframe-base/38...
<p>In addition to changing base class of <code>TMyFrameTreeView</code> to <code>TMyBaseFrame</code> change the first word in the dfm file for <code>TMyFrameTreeView</code> from <code>object</code> to <code>inherited</code>.</p>
Are CSS based menus simply toggling display none/block and z-index? <p>Just trying to understand how to get drop down menus to work (the theory behind them).</p> <p>From what I have seen, it is just playing around with CSS using display:none and block along with the z-index.</p> <p>Events are attached on mouseover an...
<p>There's an alternative where you can make give menu items visibility dependent on the hover style of the parent element, eg.</p> <pre><code>li ul {display: none;} li:hover &gt; ul {display: block;} </code></pre> <p>this means you can make menus simply by using </p> <pre><code>&lt;ul id="menu"&gt; &lt;li&gt;...
jQuery and appending large amounts of HTML <p>I have come to find that using jQuery to create HTML client-side can be a huge performance booster if done properly. I use AJAX returning JSON to retrieve dynamic content and then I build the relevant HTML and insert it using jQuery. The first time I messed with this techn...
<p>There's a performance issue with jQuery and inserting a large string of html to the DOM, due to its $.trim function.</p> <p>I sometimes find plain old dom scripting much faster than using jquery. Try something like</p> <pre><code>document.getElementById('id').innerHTML = myarray.join('') </code></pre>
How to set the final value of an Animation to the property when the Animation finishes or is canceled? <p>I try to animate a DependencyProperty from a value to a target value (in code) and when the animation finishes (<strong>or is canceled</strong>) set the <em>final</em> value to the property. The final value would b...
<p>It looks like you are trying to set value back to the initial value prior to the animation starts just after the animation finishes. This actually happens automatically if you stop the animation (or when the animation timeline finishes). Animations, in WPF, can be though of as an value overlay on top of the current ...
Taking a screenshot with tooltip and cursor visible <p>This is the code I am using to take a screenshot:</p> <pre><code>[DllImport("gdi32.dll",EntryPoint="DeleteDC")] public static extern IntPtr DeleteDC(IntPtr hDc); [DllImport("gdi32.dll",EntryPoint="DeleteObject")] public static extern IntPtr DeleteObject(IntPtr hD...
<p>Vista has a snipping Tool to easily do so as given in <a href="http://blog.falafel.com/2008/08/12/CaptureScreenShotsWithToolTipsAndPopupsUsingVistaSnippingTool.aspx" rel="nofollow">http://blog.falafel.com/2008/08/12/CaptureScreenShotsWithToolTipsAndPopupsUsingVistaSnippingTool.aspx</a>.</p> <p>There is also an appl...
How to alloc a dynamic typed object <p>I have seen a lot of talk about dynamic typing in objective-c. But i haven't seen any examples of what i think it is supposed to be.</p> <p>lets say I have a generic function that is supposed to juggle two objects (one gets allocated and the other gets freed) and the calling obje...
<p>I have no idea what the code you have there is trying to do, it is not syntactically valid, and manipulating views has nothing to do with your questions. Anyway, if you really don't know the type you generally use "id" which is type cast to a "void *" for codegen. It has the special property that it is assumed to re...
How do you fix this mysql query without the use of a subquery? <p>I have 3 tables. For the purposes of this example I will simplify it as much as I can.</p> <p>First table contains movie ids and names, second table contains genre ids and genre names (action, drama, etc). 3rd table stores the genre id associated with ...
<p>Your select should build the Cartesian product, so you'll get output like</p> <pre><code>MovieA GenreA MovieA GenreB MovieB GenreA ... </code></pre> <p>But it sounds like you want this instead:</p> <pre><code>MovieA GenreA, GenreB MovieB GenreA ... </code></pre> <p>MySQL has a GROUP_CONCAT function to ...
Passing data from a jquery ajax request to a wcf service fails deserialization? <p>I use the following code to call a wcf service. If i call a (test) method that takes no parameters, but returns a string it works fine. If i add a parameter to my method i get a wierd error:</p> <blockquote> <p>{"ExceptionDetail":{"He...
<p>Use double quotes instead of single quotes in the JSON you are sending to the service. That is, change:</p> <pre><code>data: "{'customerId': '2'}", </code></pre> <p>to </p> <pre><code>data: '{"customerId": "2"}', </code></pre> <p>I've tested this locally and this fixes the problem. </p> <p>Incidentally, I debug...
Using the All operator <p>I would like to see an example that makes the best use of the ALL operator when using a parent child reltaionship in LINQ. Can you show me one please?</p>
<p>The All() extension method checks a predicate against all the items; for example, at execution:</p> <pre><code>if(order.Lines.All(l=&gt;l.IsClosed)) order.Close(); </code></pre> <p>(checks all lines are closed, and if so, closes the order)</p> <p>of in a query:</p> <pre><code>var qry = from order in ctx.Orders ...
How to convert Byte array into string? <p>I have structure as follows:</p> <p>struct data {int no; string name; int id};</p> <p>I am converting this structure into bytearray. I need to convert this back into structure format. For that I need to convert first members into integer and string. How to convert bytearray i...
<p>Well the answer really depends on how are you converting the structure into byte array. In theory, you will need to perform the same steps in reverse sequence!</p> <p>For example if you serialize the structure such that:</p> <ul> <li>first 4 bytes = no</li> <li>second 4 bytes = id</li> <li>rest bytes = byte stream...
In what languages/platforms is Invoke for GUI operations required? <p>I understand that in .NET, one needs to use Control.Invoke(delegate) to perform operations on a control. This lead me to wondering in which environments Invoke is actually required. As far as i know, it was not required in older versions of, say, Vis...
<p>You are mistaken. Control.Invoke is not required to perform operations on a control.</p> <p>Control.Invoke is a useful tool to help marshall code across thread boundaries, but it is not the only way to do it. You will see this used most often when you do some work in a background thread.</p> <p>When you call cod...
Flex/AS3 Drag Drop - Custom Drop Feedback <p>I am using a <code>HorizontalList</code> component to display a list of images, you can drag images from another component to join the list, this all works fine.</p> <p>If I do <code>list.showDropFeedback(event)</code> I get an unsightly black bar at the top of images in th...
<p>Yuo can sove it by overriding showDropFeedback() method. My code below:</p> <pre><code> import mx.controls.HorizontalList; import mx.controls.listClasses.IListItemRenderer; import mx.core.mx_internal; import mx.events.DragEvent; use namespace mx_internal; public class HList extends HorizontalList { public fun...
Should I use Java date and time classes or go with a 3rd party library like Joda Time? <p>I'm creating a web based system which will be used in countries from all over the world. One type of data which must be stored is dates and times.</p> <p>What are the pros and cons of using the Java date and time classes compared...
<p>EDIT: Now that Java 8 has been released, if you can use that, do so! <code>java.time</code> is even cleaner than Joda Time, in my view. However, if you're stuck pre-Java-8, read on...</p> <p>Max asked for the pros and cons of using Joda...</p> <p>Pros:</p> <ul> <li>It works, very well. I strongly suspect there ar...
What options are available for the layout of directed or undirected graphs in .NET? <p>By <em>graph</em> here I mean something resembling these images:</p> <p><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/e/e4/Directed_graph_with_back_edge.svg/298px-Directed_graph_with_back_edge.svg.png" width="202"> <...
<p><a href="http://graphsharp.codeplex.com/">Graph#</a> is also another option. I haven't used it personally, but I've been meaning to get around to looking over it.</p>
default value of a variable at the time of declaration in C# and VB? <p>Can anybody tell me what is the default value of a variable at the time of declaration in C# and vb??</p>
<p>In c# you can use the default keyword to determine default values.</p> <p>For example:</p> <pre> default(bool) default(int) default(int?) </pre>
How popular are security code reviews? <p>Real world, how many here undergo in-depth security code reviews? Those that do, how often - once a quarter, once a version, once a blue moon? Those that don't - why not? (Not referring to small or hobby programmers - not that I'm trivializing them, its just I don't expect them...
<p>I'm from Australia and I have to say that security reviews are (maybe) more popular here.<br /> In the last two projects I've worked we had formal security reviews. I have one more review aligned in the close future but from my perspective a "security review" is wrong by design. </p> <p>People who do security revi...
Setting the HTTP_REFERER in a global before(:all) in Rspec <p>In order to avoid adding</p> <pre><code>request.env["HTTP_REFERER"] = '/' </code></pre> <p>to a before block on every controller_spec file I create, I have tried to add this to the global config (in spec_helper.rb)</p> <pre><code>config.before(:each) {req...
<p>Have you tried</p> <pre><code> config.before(:type =&gt; :controller) do request.env["HTTP_REFERER"] = "/" end </code></pre>
How to Log Stack Frames with Windows x64 <p>I am using Stackdumps with Win32, to write all return adresses into my logfile. I match these with a mapfile later on (see my article [Post Mortem Debugging][1]). </p> <p><strong>EDIT:: Problem solved - see my own answer below.</strong></p> <p>With Windows x64 i do not find...
<p>I finally found a reliable way to log the stack frames in x64, using the Windows function CaptureStackBackTrace(). As i did not want to update my SDK, i call it via GetProcAddress(LoadLibrary());</p> <pre><code> typedef USHORT (WINAPI *CaptureStackBackTraceType)(__in ULONG, __in ULONG, __out PVOID*, __out_opt PUL...
Html Bugs in Opera <p>In versions of opera greater than 9.0, I have found a bug that fails to render a large portion of my text. This happens with links, span and strong tags. As well as this, it throws a strange error with sup tags.</p> <p>Here is the link to the live site: <a href="http://clients.bionic-comms.co.uk/...
<p>I don't know why, as I know sod all about Javascript, but its your shadedbo.js that's causing the error. Removal of that (and only that) makes the site render correctly on Opera 9.26</p>
create .project file for flex application <p>I want to add my flex project to a SCM like Clearcase and then allow other developers download it and use in FlexBuilder. </p> <p>What foramt do i need to place it in my clearcase so users can simply download and import into Flex Builder? Is there some way to create a .proj...
<p>I do not know Flex Builder project config files (I do know very well ClearCase though), but this question looks like "<a href="http://stackoverflow.com/questions/116121/do-you-keep-your-project-files-under-version-control/119377#119377">Do you keep your project files under version control ?</a>" or "<a href="http://...
Tips for manual merge of diverged code <p>I am fairly used to using svn for branching and merging, normally this works fine. However one component was worked on in two branches and basically took the component in different directions, so automatic merge won't work and using beyond compare shows the files as mostly diff...
<p>What you're talking about is essentially trying to rebase one of the branches. There is support for this in <a href="http://git-scm.com/docs/git-rebase" rel="nofollow">some DVCSs</a> but I'm not aware of any support for this kind of thing in SVN.</p> <p>Your best bet is to pick one of the branches (the one that is ...
How to change a Python module name? <p>Is it only possible if I rename the file? Or is there a <code>__module__</code> variable to the file to define what's its name?</p>
<p>If you really want to import the file 'oldname.py' with the statement 'import newname', there is a trick that makes it possible: Import the module <em>somewhere</em> with the old name, then inject it into <code>sys.modules</code> with the new name. Subsequent import statements will also find it under the new name....
Java TCP Socket Sniffing <p>I am using TCP sockets to communicate data between a server and client program using a specific port number on the same computer (localhost).</p> <p>I need a software that can capture the data being sent/received through that socket?</p> <p>(or)</p> <p>What's the simplest way of sniffing ...
<p>I suggest using Wireshark. It's easy to use and runs on many platforms.</p> <p><a href="http://www.wireshark.org/" rel="nofollow">http://www.wireshark.org/</a></p>
C#: Declaring and using a list of generic classes with different types, how? <p>Having the following generic class that would contain either <strong><code>string, int, float, long</code></strong> as the type:</p> <pre><code>public class MyData&lt;T&gt; { private T _data; public MyData (T value) { ...
<p>I think the issue that you're having is because you're trying to create a generic type, and then create a list of that generic type. You could accomplish what you're trying to do by contracting out the data types you're trying to support, say as an IData element, and then create your MyData generic with a constrain...
GWT: Capturing URL parameters in GET request <p>I need to build a GWT application that will be called by an external application with specific URL parameters. </p> <p>For example: </p> <p><a href="http://www.somehost.com/com.app.client.Order.html?orderId=99999">http://www.somehost.com/com.app.client.Order.html?orderI...
<p>Try,</p> <pre><code>string value = com.google.gwt.user.client.Window.Location.getParameter("orderId"); // parse the value to int </code></pre> <p>P.S. GWT can invoke native javascript which means if the stuff javascript can do, GWT can do it too. e.g. in GWT, you can write</p> <pre><code>public static native void...
Making sure OnPropertyChanged() is called on UI thread in MVVM WPF app <p>In a WPF app that I'm writing using the MVVM pattern, I have a background process that doing it's thing, but need to get status updates from it out to the UI.</p> <p>I'm using the MVVM pattern, so my ViewModel knows virtually nothing of the view...
<p>WPF automatically marshals property changes to the UI thread. However, it does not marshal collection changes, so I suspect your adding a message is causing the failure.</p> <p>You can marshal the add manually yourself (see example below), or use something like <a href="http://kentb.blogspot.com/2008/01/cross-threa...
Network performance measurement in asp.net 2.0 via HttpHandlers and HttpModules strangeness <p>We have a performance measurement module that relies on HttpModule and HttpHandlers and works like this:</p> <ol> <li>Request comes in to server for a page.</li> <li>HttpModule_Begin writes start time in the cookie.</li> <li...
<p>Extend your troubleshooting: append values to the IIS log (<a href="http://msdn.microsoft.com/en-us/library/system.web.httpresponse.appendtolog.aspx" rel="nofollow">HttpContext.Current.Response.AppendToLog(string)</a>).</p> <p>The IIS log will show your entries and you can determine when those requests were actuall...
Powerful audio lib <p>Can you recommend a powerful audio lib?</p> <p>I need it to timestrech &amp; pitchshift independently, as well as give me full access to the raw audio data and let me stream bytes into its pipeline.</p> <p>Other effects like eq, filtering, distortion are a plus.</p> <p>Needs to be accessible fr...
<p>I think <a href="http://www.fmod.org/" rel="nofollow"><strong>FMod</strong></a> is widely recognized as one of the most powerful audio engine available for free until you do something commercial with it, and cross-platform, like in console-mac-pc cross-platform.</p> <p>Now, <a href="http://connect.creativelabs.com/...
NInject: Where do you keep your reference to the Kernel? <p>I'm using NInject on a new web application and there are two things that are unclear to me:</p> <ol> <li><p>Don't I need to keep a reference to the Kernel around (Session/App variable) to insure that GC doesn't collect all my instances? For example, if I spe...
<p>It's true that you don't want to pass around the kernel. Typically, in a web app, I store the kernel in a static property in the HttpApplication. If you need a reference to the kernel, you can just expose a dependency (via constructor argument or property) that is of the type IKernel, and Ninject will give you a ref...
Making a .NET Windows application show-up on keystroke <p>My application resides mostly on the system tray on minimize. I'd like the user to be able to hit a keystroke (like ALT+SHIFT etc.) and it shows up on the screen (sort of like Launchy, if you've used it; or the Google search bar).</p> <p>Anyone knows how to do ...
<p>You want the SetWindowsHookEx Windows API call. There is some details on using it in this CodeProject article:</p> <p><a href="http://www.codeproject.com/KB/system/CSLLKeyboard.aspx" rel="nofollow">http://www.codeproject.com/KB/system/CSLLKeyboard.aspx</a></p> <p>There is also some useful advice about what will an...
as3 Access to undefined property? <p>Can someone help me to find out why I'm getting the error message "Access to undefined property: removeChild(goBack)" on the following snipped?</p> <p>BTW, this is for flash CS4</p> <pre><code>function nameOfFunction() { var goBack:backButton_mc = new backButton_mc(); goBack.x =...
<p>You are wrong with the scope. (surprise :-D)</p> <p>The variable goBack is just defined inside of "nameOfFunction", when you try to access this from a another function like "anotherFunction" it will not exists anymore (even if it is on the display list)</p> <p>There are different possibilities to solve this proble...
What's the best WYSIWYG editor when using the ASP.NET MVC Framework? <p>Was wondering what the best WYSIWYG editor that I can embed in a web-site based on the ASP.NET MVC Framework? Ideally it should be Xhtml compliant and allow users to embed images etc.</p> <p>The only one I've used before is the <a href="http://www...
<p>I really like <a href="http://tinymce.moxiecode.com/">TinyMCE</a> which also should fit your requirements. It is well documented and offers a lot of possibilities to configure.</p>
Identify IDisposable objects <p>i have to review a code made by some other person that has some memory leaks. Right now i'm searching the disposable objects to enclause them with the using statement and i would like to know if there is a quick way that tells you all the disposable objects declared in. I mean something ...
<p>I know what you mean. I don't know, but look at FxCop. It might have a rule in there somewhere that checks whether objects implementing IDisposable are not disposed. Just a hunch, mind.</p> <p><strong>UPDATE</strong>: <a href="http://stackoverflow.com/users/16076/mitch-wheat">Mitch Wheat</a> writes:</p> <blockq...
How do I search XML files on a .NET Windows Mobile Handheld? <p>I have a .NET Windows Mobile 5.0 application that is used for data collection. For purposes of this question let's say it's a survey application with two screens - a survey list screen and a survey detail screen. You click on a survey in the survey list sc...
<p>There is no difference to how you would do this on the desktop, imho.</p> <ul> <li>Iterate through all the files in the directory</li> <li>read the XML into an XMLDocument</li> <li>use XMLDocument.SelectNodes and an XPath query to do the search</li> </ul>
Can I add a <br/> and links to a javascript alert? <p>I have the following statement:</p> <pre><code>btnApply.Attributes.Add("onclick", "alert('Must be a member to Use this Tool')"); </code></pre> <p>Is there a way to add a new line. I tried, but it showed the in the text. In addition, can I add a link that would ...
<p>You can't use HTML, but you can add line breaks:</p> <pre><code>alert('line1\nline2'); </code></pre> <p>If a rich modal popup is really what you want though, you can use <a href="http://docs.jquery.com/UI/Dialog">jQuery's dialog</a> feature and put whatever you want in there.</p>
Can I use a decorator to mutate the local scope of a function in Python? <p>Is there any way of writing a decorator such that the following would work?</p> <pre><code>assert 'z' not in globals() @my_decorator def func(x, y): print z </code></pre> <p><hr /></p> <p>EDIT: moved from anwser</p> <p>In answer to hop'...
<p>Echoing Hop's answer</p> <ol> <li>Don't do it.</li> <li>Seriously, don't do this. Lisp and Ruby are more appropriate languages for writing your own custom syntax. Use one of those. Or find a cleaner way to do this</li> <li>If you must, you want dynamic scoped variables, not lexically scoped.</li> </ol> <p>Pytho...
mysql explain different results on different servers, same query, same db <p>After much work I finally got a rather complicated query to work very smootly and return results very quickly. </p> <p>It was running well on both dev and testing, but now testing has slowed considerably. The explain query which takes 0.06 se...
<p>I would try regenerating statistics and rebuilding the indexes for all the tables and see if that fixes your problem - it's likely that is why the plans would be different.</p> <p>There are lots of other things it could be (memory, disk, os differences, other loads, etc) but I'm assuming those probably aren't the i...
How can I automate Winforms in .NET? <p>I want to get the ControlName of .NET properties in VB6 code, just like described in <a href="http://msdn.microsoft.com/en-us/library/ms996405.aspx" rel="nofollow">this article</a>. But unfortunately, it doesn't work for me. I always got 0 for bufferMem.</p> <pre><code> b...
<p>Do you set the size beforehand? </p> <pre><code>size = 65536 </code></pre>
How can I modify password expiration in Windows using Python? <p>How can I modify the password expiration to "never" on Windows XP for a local user with Python? I have the PyWIN and WMI modules on board but have no solution. I managed to query the current settings via WMI(based on Win32_UserAccount class), but how can ...
<p>If you are running your python script with ActvePython against Active Directory, then you can use something like this:</p> <pre><code>import win32com.client ads = win32com.client.Dispatch('ADsNameSpaces') user = ads.getObject("", "WinNT://DOMAIN/username,user") user.Getinfo() user.Put('userAccountControl', 65536 | ...
Convert SELECT to an update statement <pre><code>SELECT t1.status, t3.guid, t3.objectID FROM Table1 t1, Table2 t2, Table3 t3 WHERE t2.ID = t3.ID AND t1.ID = t2.ID AND t3.Guid IN ('', '', '') </code></pre> <p>How can I convert this to an update statement where I set the <code>t1.status = 1</code>?</p>
<p>I would start by converting it to using joins instead of "classical joining":</p> <pre><code>select t1.status, t3.guid, t3.objectID from Table1 t1 inner join Table2 t2 on t2.ID = t1.ID inner join Table3 t3 on t3.ID = t2.ID where t3.Guid in ('', '', '') </code></pre> <p>Then you can just rip of the select statement...
Getting the local iPhone number through SDK <p>I am looking for a SDK API to retrieve the device's local phone number<br> from the SIM card. Is there a way to do it?</p>
<p>There's no reliable way. You'll find code online that tells you to look up SBFormattedPhoneNumber, and sometimes that works, but not consistently. Mostly it's people who brought their phone number over from another cell carrier. In those cases, you get a phone number, but not one for the current phone, and not on...
How can you programmatically tell the CPython interpreter to enter interactive mode when done? <p>If you invoke the cpython interpreter with the -i option, it will enter the interactive mode upon completing any commands or scripts it has been given to run. Is there a way, within a program to get the interpreter to do ...
<p>You want the <a href="http://docs.python.org/library/code.html">code module</a>.</p> <pre><code>#!/usr/bin/env python import code code.interact("Enter Here") </code></pre>
CSS: Cascade just one level <p>Say i have a &lt;table> with a css class defined (&lt;table class="x">) and i want to change the 'color' property of just the first level of &lt;td>, is this possible using css without setting classes on the relevant &lt;td>?</p> <p>I.e.</p> <pre><code>&lt;table class="x"&gt; &lt;tr...
<p>Try this:</p> <pre><code>table.x &gt; tr &gt; td { ... } </code></pre> <p>The <code>&gt;</code> is the immediate child selector.</p>
JTable sorting rows in Java 1.5 <p>Is there a simple way to sort rows in a JTable with Java 1.5 (<code>setAutoCreateRowSorter</code> and <code>TableRowSorter</code> appear to be Java 1.6 features)?</p>
<p>Sorting in Java 1.5 is only possible via libraries.</p> <p>E.g. use the JXTable mentioned from Kaarel or VLTable from <a href="http://www.vlsolutions.com/en/documentation/articles/jtable/index.php" rel="nofollow">here</a>.</p> <p>Another good library is <a href="http://publicobject.com/glazedlists/" rel="nofollow"...
Footertemplate in gridview <p>I am using datatable to fill gridview.</p> <p>How can i add blank row in datatable to view footertemplate even if i don't have any data ?</p> <p>I am using asp.net 2005. I am using gridview control to add,edit and modify the data. i put add control at footertemplate. it's working fine bu...
<p>I ran into this as well. If I remember correctly, there is no way to actually fix it. I worked around the issue by creating an empty data template that had the controls I needed to be able to add the data.</p>
How to disable file input text box in IE? <p>Is it possible to prevent a user from typing in a file input text box in IE? The reason I ask is that if a user enters text that does not look like a file system path (eg. doesn't start with something like c:...) then when the user clicks the submit button nothing will happ...
<p>How about this one? You can't type, or right click and paste.</p> <pre><code>&lt;input type="file" name="file" onKeyDown="this.blur()" onContextMenu="return false;"&gt; </code></pre>
How do I unit test my asp.net-mvc controller's OnActionExecuting method? <p>I've overridden my controller's OnActionExecuting method to set some internal state based on the executing filterContext. How do I test this? The method itself is protected so I assume I'll have to go higher up in the call stack. </p> <p>What ...
<p>You need to add and use a Private Accessor. Right click in your controller class and choose <code>Create Private Accessors</code> from the menu and add them to your test project. Once in your test project, create your controller, then create an accessor for it. The method should be available on the accessor. Her...
Stream (.NET) handling best-practices <p>The question is entitled with the word "Stream" because the question below is a concrete example of a more generic doubt I have about Streams:</p> <p>I have a problem that accepts two solutions and I want to know the best one:</p> <ol> <li>I download a file, save it to disk (2...
<p>Unless the increased latency is really killing you, I'd usually go for Option 1 unless there's a good reason you don't want the data on the file system (e.g. concerns about security, capacity, ...).</p> <p>Or maybe <a href="http://stackoverflow.com/questions/591760/stream-net-handling-best-practices/591814#591814">...
.NET Membership <p>Hi I am trying out the membership features for .NET and I am using the ASP.NET Web application Administration Tool. My question is where is the user data being stored? I checked my databases and I cannot find it anywhere. I also tried to look for any information within Providers in the admin tool ...
<p>I think, it would create a database by name aspnet by default.</p> <p>Check it :)</p>
Triggering haslayout in IE 6, what's the side effect of using * html div { height: 1%; } <p>For a while, I've been putting * html div { zoom: 1; } in my base stylesheet, and it has worked great. However, I now run into situations where there're elements that are absolute positioned that are losing their heights and wid...
<p>This is known as <a href="http://www.communitymx.com/content/article.cfm?page=2&amp;cid=c37E0" rel="nofollow">The Holly Hack</a>. As far as I know, there isn't a side effect, especially if you <code>* html</code> it for IE6 directly. I agree with the other posters that placing it on the <code>&lt;div&gt;</code> tag ...
resume/suspend enery star linux from command line <p>I have an ssh connection to a linux machine which is hibernated after some non-activity time.</p> <p>I want to make it resume, how do I do that? (writing to /dev/mouse to simulate mouse movement didn't do the trick)</p>
<p>A machine that is hibernating cannot come out of sleep without pressing the power button, or sending a magic packet if the ethernet adaptor has Wake On Lan (WOL) capability and the motherboard supports that. WOL packets can only be generated on the local network, not remotely from other networks.</p>
Huge main.cs file <p>I am new to C# (coming from Delphi) and find my main.cs file becoming quite large. In Delphi I can create classes in a .pas file and use it from my main application file. I simply add the uses (filename) keyword.</p> <p>My question is how do I do something similar in C#? Example:</p> <p>Delphi:</...
<p>First, you need to make sure you're in the same namespace:</p> <pre><code>namespace mynamesspace { </code></pre> <p>Next, if your class members are declared privately, you need to indicate you're working on that class:</p> <pre><code>public partial class frmMyForm : Form { </code></pre> <p>Note though, that this...
SQL Express remote access <p>Is there any way to install SQL Express 2005 silently while configuring to allow remote access, or must the configuration be done with the SQL Server Management Studio UI?</p>
<p>After the SQL Service is installed log into the database and run the following and then restart the SQL Service.</p> <pre><code>exec sp_configure 'remote access', 1 reconfigure </code></pre> <p>This will allow remote access to the service. If you are installing a named instance you'll need to ensure that the SQL ...
static vs extern "C"/"C++" <p>What is the difference between a static member function and an extern "C" linkage function ? For instance, when using "makecontext" in C++, I need to pass a pointer to function. Google recommends using extern "C" linkage for it, because "makecontext" is C. But I found out that using static...
<p>Yes, you are just lucky :) The extern "C" is one language linkage for the C language that every C++ compiler has to support, beside extern "C++" which is the default. Compilers may supports other language linkages. GCC for example supports extern "Java" which allows interfacing with java code (though that's quite cu...