input
stringlengths
51
42.3k
output
stringlengths
18
55k
garbage collection for inner objects <pre><code>class Stage { Actor act1 = new Actor(); Actor act2 = new Actor(); Actor act3 = new Actor(); } Stage stg = new Stage(); </code></pre> <p>how will garbage collection behave in java this scenario?</p> <pre><code>stg = null; </code></pre> <p>will the three object...
<p>Yes. </p> <p>When the garbage collector runs, it will see references to the old object are gone, and clean it up. The next time it runs, it will see that now nothing refers to the other three objects, and clean them up too.</p> <p>Conceptually, anyway; I'm sure most garbage collectors will be a little smarter than...
How to monitor a POP, SMTP and Exchange Server for mail activity <p>We need to write a .Net (C#) application that monitors all mail activity through a POP, SMTP and Exchange Server (2007 and later) and essentially grab the mail for archiving into a document management system. I realise that the way to monitor each type...
<p>Many countries have rather narrow regulations for what such a system must do and what it must not do in order to be in compliance with the law. If you are developing a product for a company in SA that wants to sell it internationally, I would suggest that need a more targeted approach. Depending on the legal framewo...
Handling close-to-impossible collisions on should-be-unique values <p>There are many systems that depend on the uniqueness of some particular value. Anything that uses GUIDs comes to mind (eg. the Windows registry or other databases), but also things that create a hash from an object to identify it and thus need this h...
<ul> <li>If you do handle them, how do you justify this work (to yourself and others), considering there are more probable cases you don't handle, like a supernova?</li> </ul> <p>The answer to that is you aren't testing to spot a GUID collision occurring by chance. You're testing to spot a GUID collision occurring bec...
reading bytes directly from RAM C++ <p>Can anyone explain the following behaviour to a relative newbie...</p> <pre><code>const char cInputFilenameAndPath[] = "W:\\testerfile.bin"; int filesize = 4584; char * fileinrampointer; fileinrampointer = (char*) malloc(filesize); ifstream fsInputFileStream; fsInputFileStream....
<p>The expression <code>*fileinrampointer</code> is of type <code>signed char</code>, and it is being promoted to a <code>signed int</code> while being passed to printf. Thus, the sign bit propagates. Later on, you print it out with <code>%x</code> which means <code>unsigned int in hex</code>, which causes you to print...
mysql query excluding a set of data but includindg certain items from the set if item contains value in a specific column <p>I need to exclude a product line from a database so I do pline != prodctline but certain products in that product line I do not want to be excluded. For instance: here is simlplistic version of ...
<h2>Actual Answer</h2> <p>I want all info about all products that have a product line other than 10. I also want the ones that have a product line of 10 but also have an option of "option1" or "option2". Here's how I express that:</p> <pre><code>select part_name, product_line, option from products where product_l...
Checking if a key exists in a JavaScript object? <p>How do I check if a particular key exists in a JavaScript object or array?</p> <p>If a key doesn't exist, and I try to access it, will it return false? Or throw an error?</p>
<p>Checking for undefined-ness is not an accurate way of testing whether a key exists. What if the key exists but the value is actually <code>undefined</code>?</p> <pre><code>var obj = { key: undefined }; obj["key"] != undefined // false, but the key exists! </code></pre> <p>You should instead use the <code>in</code>...
Emacs and ESS: Using the correct version of R <p>I have installed R-2.9.1 and I am using Emacs+ESS. When I start an R process, though, the version of R that gets used by Emacs is 2.6. I thought maybe Emacs was running R from a weird starting directory. However, if I select my home directory ESS still starts R 2.6. (R...
<p>Try adding something like the following to your ~/.emacs file:</p> <pre><code>(setq inferior-R-program-name "c:/path/to/Rterm.exe") </code></pre> <p>and restart emacs.</p>
Error with propel-generate-crud in Symfony 1.0 <p>When I try to generate a CRUD test for a new project I am getting a PHP Warning and a Fatal Error.</p> <p>The errors relate to files that it cannot find, however, I have checked and the files are definitely there.</p> <p>The error text is 'require_once(lib/model/map/Q...
<p>I think it's a problem with your include path.</p> <p>Check it, the require_once() call is looking for <code>lib/model/map/QuestionMapBuilder.php</code></p> <p>But your include_path is <code>C:\webroot\askeet\lib</code></p> <p>Which, when resolved together into a full path, would look like this</p> <pre><code>C:...
2008 SQL EXPRESS stored procedures - mine are missing <p>I'm using VWD 2008 (SP1) and SQLExpress 2008. I'm creating a database first and then looking at using DynamicDataControls (seem useful and staright foward for a beginner like me).</p> <p>Within VWD I created a new Dynamic Data Web Application. Then I added a new...
<p>When you create a new database only system objects are included, tables, views, UDFs, triggers, indexes etc etc have to be created by the user</p> <p>whatever is in the model database will be in any new user generated database. If you want objects to be created every time you create a new database, create them in t...
what are the different testings like DST, Wanem......? <p>can anybody explain the what are the different testings like DST,Wanem. </p>
<p>the WANem enables you to do performance tests like simulating different connection speeds. For example you can simulate VPN, 3G, ISDN, DSL speeds to see if your application is still reacting in a timely fashion.</p> <p>WANem is free, based on linux, and acts like a router. there are several other testing tools out ...
Unit Testing of private methods in Xcode <p>I'm trying out test driven development in a toy project. I can get the tests working for the public interface to my classes (although I'm still on the fence because I'm writing more testing code than there is in the methods being tested).</p> <p>I tend to use a lot of privat...
<p>Remember that there's actually no such thing as "private methods" in Objective-C, and it's not just because it's a dynamic language. By design, Objective-C has visibility modifiers for ivars, but not for methods — it's not by accident that you can call any method you like.</p> <p><strong>@Peter</strong>'s suggest...
Marginal browser support by the BBC (and why the BBC they can't use jQuery) <p>The BBC just released their JavaScript library, <a href="http://www.bbc.co.uk/glow/docs/articles/what%5Fis%5Fglow.shtml" rel="nofollow">Glow</a>. They rolled their own because the major libraries don't adequately support older browsers.</p> ...
<p>The BBC's primary duty is not to make money, instead, it is to serve the license-payer. In order to reach the widest possible audience, they have to support those older browsers. There's a large number of people in this world who couldn't be bothered—or don't even know how—to upgrade their web browsers from IE 5...
What would you submit as an example of your best code for peer review? <p>If your company was being audited, or you were in an interview, and you were asked to provide an example of your best code for peer review, what would you submit? (I would like actual code examples for people to vote on).</p> <p>Try to keep the ...
<p>It can only give you a vague idea of how the guy programs. </p> <p>Usually the best code cannot be shown for an experienced developer, for legal reasons obviously. The code is owned by the companies that the programmer worked for. Once I was talking about my previous projects to a guy and he was like "Can I see the...
How to use C# to get column's description of Sql Server 2005? <p>I can use " Microsoft.SqlServer.Management.Smo.Table " in C# to get a table columns of a Sql Server 2005 database. </p> <p>I have got the column.Name, but how can I get the column's Description in C#?</p> <p>I have saw the link: <a href="http://stackove...
<p>Say your Smo.Table object is named t.</p> <p>This will get the description:</p> <pre><code>t.Columns["ProductID"].ExtendedProperties["MS_Description"].Value </code></pre>
Microsoft.Web.Administration.ServerManager can't read config sections containing encrypted passwords in applicationHost.config <p>I have some sites in IIS7 that are configured to run as domain users (MYDOMAIN\someuser).</p> <p>I'm using the Microsoft.Web.Administration namespace to scan my server configuration, but it...
<p>IIS uses encryption for attributes that are marked as "encrypted=true" in its schema. Also in its schema it defines the provider to use for the encryption (See C:\Windows\System32\inetsrv\config\schema\IIS_Schema.xml), in the case of password inside the Virtual Directory it uses the AesProvider which is defined in t...
Restart Apache from php on windows <p>I'm making a really simple virtual host administrator in my office intranet (on a windows pc) and I'm trying to restart the apache service from php when a new virtual host is created.</p> <p>But I can't manage to do it, I tried with apache -k restart, httpd -k restart with the sys...
<p>Trying this from inside a script running under apache will not work or fail miserable, on windows as well as linux.</p> <p>Usually the user that apache runs as (on any platform) does not have the privileges to restart apache, and it should stay that way.</p> <p>As mentioned in the link Haim posted, you will probab...
Is AnkhSVN a good alternative to Visual SourceSafe? <p>We've had it with Microsoft Visual SourceSafe 6.0d and want to move to SubVersion. Our IDE is Visual Studio 2005, but we plan to ugprade to 2008 soon. We are considering to install VisualSVN server, and then use the <a href="http://ankhsvn.open.collab.net/" rel="...
<p>I've migrated from VSS to SVN using AnkhSVN coupled with TortoiseSVN. I haven't had any problems making the change. IMO it's a much better environment to be working in.</p> <p>I've used both in team environments, and SVN on solo ventures. For solo ventures, SVN is definitely the way to go, it's much faster. In ...
AS3:How to change a colored Bitmap's BitmapData to black and white? <p>How can I change the bitmapdata of a coloured Bitmap to <strong>Black and White</strong> in <strong>AS3</strong> ? I'm developing a simple image editor tool for a CMS in flash. </p> <p>People should be able to switch the colour of the uploaded Bit...
<p>this would be the most elegant solution i presume (with <code>source</code> being you <code>BitmapData</code>):</p> <pre><code>const rc:Number = 1/3, gc:Number = 1/3, bc:Number = 1/3; source.applyFilter(source.bitmapData, source.bitmapData.rect, new Point(), new ColorMatrixFilter([rc, gc, bc, 0, 0,rc, gc, bc, 0, 0,...
for statement and i.find in list <pre><code>for a in ('90','52.6', '26.5'): if a == '90': z = (' 0',) elif a == '52.6': z = ('0', '5') else: z = ('25') for b in z: cmd = exepath + ' -a ' + str(a) + ' -b ' + str(b) process = Popen(cmd, shell=True, stderr=STDOUT,...
<p>you are missing quotes around you first for statement try</p> <pre><code>for a in ('90','52.6', '26.5'): </code></pre>
ASP.Net Cross Page Posting <p>Currently I have two pages:</p> <p>The first page contains an input form, and the 2nd page generates an excel document. The input form's button posts to this 2nd page.</p> <p>What I'd like to do is add a second button which also posts to the 2nd page; however, I'll need requests created...
<p>You could have a hidden text box on the form from the first page that each button sets a value in before posting to the second page. The second page could then evaluate the value of that hidden text box.</p> <p><strong>Edit</strong>: After re-reading your post, I think I misunderstood what you were attempting to a...
Why is this code giving me a date 39k years in the future? <p>I've written a method that returns the milisecond value of a string formatted date, and for some reason it's giving me dates 39000 years in the future. any ideas why?</p> <pre><code>private long getTimeInMs(String currentStartTimeString) { //String new...
<p>I'm guessing that you interpreted the returned value from getTime() as if it was a Unix time_t value. It's not - it's milliseconds past the Java epoch, not seconds past the Unix epoch.</p>
Union with Count OR Join with Sum - MySQL <p>I want to combine three tables - date, lead and click - in a query.</p> <p>The tables looks like this:</p> <p><strong>date:</strong></p> <pre><code>|date| </code></pre> <p><strong>lead:</strong></p> <pre><code>id|time|commission </code></pre> <p><strong>click:</strong>...
<pre><code>SELECT date, COALESCE(lcomm, 0), COALESCE(lcnt, 0), COALESCE(ccomm, 0), COALESCE(ccnt, 0), COALESCE(ccomm, 0) + COALESCE(lcomm, 0), COALESCE(ccnt, 0) + COALESCE(lcnt, 0) LEFT JOIN ( SELECT date, SUM(commission) AS lcomm, COUNT(*) AS lcnt FROM leads...
JMS, Detect when a temp queue is destroyed <p>I have a "server" application receiving messages from a JMS queue. And client applications which create a temp queue, and then send a message to the server, setting the JMSReplyTo header to the temp queue.</p> <p>The server replies back to the client using the temp queue. ...
<p>Well, posting to that queue should fail since it should no longer exist once the client is gone. The temporary queue is only supposed to exist while the session that created it exists.</p> <p>So I don't see that there is a need to be notified when the client is gone, which you can't do via JMS, as the attempt to s...
SQL min / max group by question <p>I have something like the following data structure:</p> <pre> Category StartDateTime EndDateTime =============================================== 1 12/1/2009 12:00 12/1/2009 12:12 1 12/1/2009 04:00 12/1/2009 04:20 2 12/2/2009 10:15 12...
<p>Your first solution looks correct except for the order by clause; try:</p> <pre><code>select Category, min(StartDateTime) [MinStartDateTime], max(EndDateTime) [MaxDateTime] from MyTable group by Category order by Category, MinStartDateTime, MaxDateTime </code></pre>
Anyone have experience with Telerik's RadGrid Paging? <p>I am having an issue with the paging system on Telerik's RadGrid (AJAX). First take a look at this screenshot:</p> <p><img src="http://i25.tinypic.com/2eyjsj7.jpg" alt="alt text" /></p> <p>As you can see, the First/Last Prev/Next buttons are there, but there is...
<p>Most probably the (embedded) skin CSS files have failed to load. You can use Fiddler or Firebug to check your web site for failing requests. I have a blog post showing how to troubleshoot and resolve such problems. You can check it <a href="http://blogs.telerik.com/AtanasKorchev/Posts/08-07-18/Web%5FResources%5Fdemy...
Best practice: JSON/JQuery/Codeignitor with different tabs <p>I am creating a calendar list system, that has tabbed dates on top, with data listings below it. I think I know how to use JSON and load the data with JQUERY into a div, but I am not sure how to load it dynamically, based on which tab I selected. </p> <p>Ho...
<p>Add an event listener to each tab that calls a function which will control what to send to the ajax function.</p> <p>The tab itself would store the date somewhere on it, for an example lets say your tab is set up like this</p> <pre><code>&lt;ul&gt; &lt;li&gt;&lt;span class="something"&gt;08/09&lt;/span&gt;&lt;/...
Simple Unix question - Configure <p>I'm using Solaris 10, <a href="http://en.wikipedia.org/wiki/Korn_shell" rel="nofollow">ksh</a>. Whenever I do a <code>./configure</code>, I get the error "ksh: ./configure: not found"</p> <p>When I do a "where configure", nothing is found.</p> <p>How do I "install configure"?</p>
<p><code>./configure</code> means that you want to run an executable called <code>configure</code> in your current directory (signified by a <code>.</code>). I'm guessing you're trying to build and install from source, and the directions say to do the standard <code>./configure; make; make install</code>. You should do...
How can I get only a partial rectangle from a CALayer? <p>I'm getting a "snapshot" of an UITextView as CGImage, but the problem is that the content of the UITextView is very long ( about ~110k contentSize.height ) and when I render the UITextView layer in to the context the memory usage becomes ~130MB which causes the ...
<p>Try something like the following: (untested, but you'll get the gist)</p> <pre><code>CGSize contentSize = self.viewref.contentSize; CGFloat verticalChunkHeight = 1024.0; CGFloat verticalOffset = 0.0; while (verticalOffset &lt; contentSize.height) { CGFloat height = fmin(verticalChunkHeight, contentSize.height ...
What's the difference between getPath(), getAbsolutePath(), and getCanonicalPath() in Java? <p>What's the difference between <code>getPath()</code>, <code>getAbsolutePath()</code>, and <code>getCanonicalPath()</code> in Java?</p> <p>And when do I use each one?</p>
<p>Consider these filenames:</p> <p><code>C:\temp\file.txt</code> - This is a path, an absolute path, and a canonical path.</p> <p><code>.\file.txt</code> - This is a path. It's neither an absolute path nor a canonical path.</p> <p><code>C:\temp\myapp\bin\..\\..\file.txt</code> - This is a path and an absolute path....
c# updatepanel with timer page_load <p>I'm experimenting with some AJAX now. I have a custom control which appears on my masterpage in which there is an update panel and a timer. The timer fires and the panel updates and everything is dandy. Except that there are some operations that I don't want it to perform on ev...
<p>You could take a look at Request["__EVENTTARGET"] in the page load event to see what control caused the postback. If it's the timer control, jump out of the function.</p> <p>Assuming your timer is called "refreshtimer":</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { if (Request["__EVENTTA...
Java UI designer + framework similar to visual studio (drag and drop, floating controls) <p>I'm looking for a Java UI designer allowing me to drag and drop controls directly to the design surface in a floating mode (without the hassle of north, south etc that comes with SWT). Is there any such tool?<br /> Also, I'm onl...
<p>You can use NetBeans to design your GUI. Instead of messing with Layout Managers, just use the "Absolute" layout. It will put the UI Components exactly where you drop them, pixel for pixel.</p>
Getting events in a button in a panel used as a Table cell <p>I'm using GWT 1.6.</p> <p>I am creating a panel that contains a Button and a Label, which I then add to a FlexTable as one of its cells.</p> <p>The Button is not receiving any Click events. I see that the table supports determining which Cell is clicked on...
<p>Yeah, I hit that, too - no widgets in the table will receive events. I ended up using code like this:</p> <pre><code> FixedWidthGrid dataTable = createDataTable(); ... dataTable.addTableListener(new TableListener() { public void onCellClicked(SourcesTableEvents sender, int row, int cell) { storyViewer...
Returning A Value To a Swing Class from another Swing Class <p>Some background on myself. Former AS/400 guy, recently downsized and unemployed. Taking this opportunity to learn java. I’m fairly new to Java and Netbeans. Since I’m unemployed and not in an organization with ‘experts’, I’m trying to find resour...
<p>I'm not sure that many projects use the Swing Application Framework. It's way immature IMHO </p> <p>and companies already have their "own" frameworks or solutions for speed up development or</p> <p>deal with common annoyances. </p> <p>I would suggest to look at the JSR296 documentation in details.</p> <p>By the ...
How do you provide a default type for generics? <p>I have a class that currently has several methods that take integer parameters. These integers map to operations that the application can perform. I'd like to make the class generic so that the consumers of the class can provide an enum type that they have with all the...
<p>So... why not use simple inheritance? Like:</p> <pre><code>class MyGenericClass&lt;T&gt; { } class MyGenericClass : MyGenericClass&lt;int&gt; { } </code></pre> <p>This way you can write both ways:</p> <pre><code>var X = new MyGenericClass&lt;string&gt;(); var Y = new MyGenericClass(); // Is now MyGenericClass&lt...
How do I get the response returned from Rack in a Cucumber step? <p>I have a Cucumber step for my Rails application:</p> <pre><code>Then /^I should be redirected to the sign in page$/ do assert_equal 302, @response.status end </code></pre> <p>But that <code>@response</code> object is the one returned by my <code>Co...
<p>From your step definition it sounds like you should be testing whether you're on the sign in page, not whether you got a 302. But to go your way, here's the step:</p> <pre><code>Then /^I should be redirected to the sign in page$/ do |url| assert @integration_session.status == 302, "Expected status to be 302, got...
JQuery Text slideDown / slideUp Overlay on Image Keeps Bouncing? <p>I am trying to replicate the text overlay effect that occurs when you mouse over an image - found on the <a href="http://www.guardian.co.uk" rel="nofollow">Guardian web site</a>.</p> <p>I have it working except when my mouse goes over the <strong>trai...
<p>The problem is that the <code>mouseover</code> and <code>mouseout</code> events bubble upward, which means they fire every time the mouse enters or leaves any element within your div.</p> <p>You should use jQuery's <a href="http://docs.jquery.com/Events/hover#overout" rel="nofollow"><code>hover</code></a> method, l...
WPF - Swapping ContentControl (relinking elements???) <p>I'm working on a custom panel control and one of the things I'm trying to have it do is swap it's content at run-time. There's two states to this control: Maximized and Normal. When the user clicks a button on the control the state switches. There's two propertie...
<p>I suggest not swapping the content itself, but rather placing two ContentControl instances in your control and changing the visibility. In addition to being cleaner overall, this will have the performance advantage of only updating the control layout and not forcing the trees to be rebuilt. Also it means both Conten...
Visual Basic 6.0 Passing by reference problem <p>In the following code, I get a compile time error:</p> <pre><code>ByRef Argument type mismatch. </code></pre> <p>But if I change the declaration of i,j to :</p> <pre><code>Dim i As Integer Dim j As Integer </code></pre> <p>The error goes away. Why?</p> <pre><code>Pr...
<p>This is because when you do this in VB6:</p> <pre><code>Dim i, j As Integer </code></pre> <p>It reads to the compiler as </p> <pre><code>Dim i As Variant, j As Integer </code></pre> <p>Leading to your type mismatch. The answer is, as you said, to declare both with types, either as in your code:</p> <pre><code>D...
Is there a function in Android analogous to "int main" in C/C++ which contains the program's main loop? <p>Normally in a C or C++ program there's a main loop/function, usually <code>int main ()</code>. Is there a similar function that I can use in android Java development?</p>
<p>As far as an Android program is concerned there is no main(). There is a UI loop that the OS runs that makes calls to methods you define or override in your program. These methods are likely called from/defined in onCreate(), onStart(), onResume(), onReStart(), onPause(), onStop(), or onDestroy(). All these metho...
How to sort by number in SQL Server? <p>I have a table with a column stored as string, but it is really a number like this:</p> <pre><code>17 - Doe 2 - Mike 3 - James </code></pre> <p>I need to sort them and create a output like this:</p> <pre><code>2 - Mike 3 - James 17 - Doe </code></pre> <p>How to write the SQL?...
<p>try this:</p> <pre><code>DECLARE @Yourtable table (data varchar(50)) insert into @Yourtable values ('17 - Doe') insert into @Yourtable values ('2 - Mike') insert into @Yourtable values ('3 - James') SELECT * FROM @Yourtable order by CONVERT(int,left(data, charindex('-', data)-1)) </code></pre> <p><strong>You shou...
Find matched directories using a list of regular expressions <p>I have an IEnumerable&lt;DirectoryInfo&gt; that I want to filter down using an array of regular expressions to find the potential matches. I've been trying to join my directory and regex strings using linq, but can't seem to get it right. Here's what I'm...
<p>If you only want directories that match all regular expressions.</p> <pre><code>var result = directories .Where(d =&gt; regexStrings.All(s =&gt; Regex.IsMatch(d.FullName, s))); </code></pre> <p>If you only want directories that match at least one regular expressions.</p> <pre><code>var result = directories ...
Contact form in SiteFinity C# <p>I want to do basic functionality with a simple contact form and on submit the form emails to someone. This is quite easy to do in asp.net, however I am having trouble once I upload it as a user control. Do you have a good example I can look at? Thank you! </p>
<p>It is the same as you would have in a normal asp.net page, the sample assumes you are using the latest version of Sitefinity and that you are have a RadScriptManager or ScriptManager on your master page.</p> <p>Firstly here is my example form codebehind:</p> <pre><code>using System; using System.Collections.Generi...
Webpage in WebBrowser Control too large, need to resize width <p>I have a WebBrowser control on a form and have set the URL to a website. When I run the application the webpage is much larger than the size of the WebBrowser control and causes the WebBrowser to now contain a horizontal and vertical scrollbar.</p> <p>I...
<p>What you're looking for is called a fluid layout. Here's a <a href="http://www.alistapart.com/articles/holygrail" rel="nofollow">tutorial on A List Apart</a> which will help you build one of these.</p>
XSLT: Copy Where current type value equals the name of an element <p>Using <a href="http://www.pesc.org/library/docs/standards/Sector%20Library/AcademicRecord%5Fv1.4.0.xsd" rel="nofollow">this file</a> as source, I have a situation where I need to retrieve an element from either the local source file or a related one n...
<p>I have to say, and take no offense, that your question is really difficult to understand; could you break it down a little more?</p> <p>Meanwhile, as far as excluding xs:annotation and xs:restriction elements, just change your copy-of statement to leave them out:</p> <pre><code>&lt;xsl:copy-of select="node()[not(...
SQL Server: any equivalent of strpos()? <p>I'm dealing with an annoying database where one field contains what really should be stored two separate fields. So the column is stored something like "The first string~@~The second string", where "~@~" is the delimiter. (Again, I didn't design this, I'm just trying to fix ...
<p>User charindex:</p> <pre><code>Select CHARINDEX ('S','MICROSOFT SQL SERVER 2000') Result: 6 </code></pre> <p><a href="http://msdn.microsoft.com/en-us/library/aa258228%28SQL.80%29.aspx">Link</a></p>
DevExpress CheckEdit Control - Place label part on left <p>How do I place the label portion of a DevExpress CheckEdit control to the left of the checkbox?</p>
<p>If you go to the Properties of the CheckEdit and navigate to the special DevExpress <em>Properties</em> item. You will find a item called <em>GlyphAlignment</em>, set this to <strong>Far</strong> and the label will be on the left portion of the control</p>
How to automate installer testing <p>I'm wondering if anyone has any best practices for automating the testing of installers on various machines with potentially different hardware / software profiles and by specifying various options to the installer. The idea would be that I could write "unit test like" code to set ...
<p>We have created a set of VMs and find it is very easy to manage. We run the tests for 13 different Windows installers over night. The VMs we have created our very bare bones, so it is possible to run a number of tests in parallel.</p>
Looking for an efficient integer square root algorithm for ARM Thumb2 <p>I am looking for a fast, integer only algorithm to find the square root (integer part thereof) of an unsigned integer. The code must have excellent performance on ARM Thumb 2 processors. It could be assembly language or C code.</p> <p>Any hints w...
<p><a href="http://www.embedded.com/electronics-blogs/programmer-s-toolbox/4219659/Integer-Square-Roots" rel="nofollow">Integer Square Roots</a> by Jack W. Crenshaw could be useful as another reference.</p> <p>The <a href="http://web.archive.org/web/20101204075137/http://c.snippets.org/" rel="nofollow">C Snippets Ar...
FFT-based 2D convolution and correlation in Python <p>Is there a FFT-based 2D cross-correlation or convolution function built into scipy (or another popular library)?</p> <p>There are functions like these:</p> <ul> <li><code>scipy.signal.correlate2d</code> - "the direct method implemented by <code>convolveND</code> w...
<p>I found <code>scipy.signal.fftconvolve</code>, <a href="http://stackoverflow.com/a/1477259/125507">as also pointed out by magnus</a>, but didn't realize at the time that it's <em>n</em>-dimensional. Since it's built-in and produces the right values, it seems like the ideal solution.</p> <p>From <a href="http://www...
Why is JFrame layout not the one I set? <p>If I set a layout on a <code>JFrame</code> with <code>setLayout</code> and then retrieve it with <code>getLayout</code> then I get a different <code>LayoutManager</code>. What is going on here??</p> <pre><code>public class Lay { public static void main(String[] args) { ...
<p>From the <a href="http://java.sun.com/javase/6/docs/api/javax/swing/JFrame.html">Java API for <code>JFrame</code></a>:</p> <blockquote> <pre><code>public void setLayout(LayoutManager manager) </code></pre> <p>Sets the <code>LayoutManager</code>. Overridden to conditionally forward the call to the <code>content...
What is this constructor call with following double braces? <p>Unfortunately I haven't coded Java for about five years and I absolutely can not remember how or why the following code is working.</p> <p>I stumbled across a similar example and broke it down to this. The emphasis is on the part below the comment: I don'...
<p>This is known as <a href="http://www.c2.com/cgi/wiki?DoubleBraceInitialization" rel="nofollow"><em>double brace initialization</em></a>:</p> <blockquote> <p>The first brace creates a new AnonymousInnerClass, the second declares an instance initializer block that is run when the anonymous inner class is in...
Detecting Presence of Horizontal Scrollbar in all browsers <p>I'm testing a web application. This web application should never have a horizontal scrollbar (as it resizes automatically). I want to test whether or not the horizontal bar exists (it should not).</p> <p>Is this possible to do with JavaScript or even Seleni...
<p>Try using scrollWidth and clientWidth properties. See <a href="http://bytes.com/groups/javascript/157924-detect-if-scrollbars-visible-inside-div" rel="nofollow">this</a> thread for more info</p>
Where can I find more details of the Enabler pattern popularized by Ken Auer? <p>In his book <em>Extreme Programming Applied</em>, Ken Auer casually mentions an Enabler pattern. Kent Beck also mentions it (at the very least in an email dated November 08, 2004), but I haven't been able to find any details in the usual p...
<p>The Enabler pattern is really just a variation of an Observer pattern. You set up observers on interesting parts of a system, creating Conditions. Enablers can then observe the conditions and enable/disable widgets.</p> <p>E.g. when you load up a Window, you create Conditions that watch stuff like whether a list ...
How to pass a parameter from Batch file to a function inside a Powershell script <p>I have a Batch file which will call a Powershell Script :</p> <p><strong>BATCH FILE :</strong> @ECHO OFF powershell ..\PowerShellScript.ps1</p> <p>The powershell script in turn has a function which expects a parameter :</p> ...
<p>modify your script to look like the following</p> <pre><code>function PSFunction([string]$Parameter1) { Write-Host $Parameter1 } PSFunction $args[0] </code></pre> <p>and from the batch file, it would look like</p> <pre><code>powershell ..\PowerShellScript.ps1 VALUE1 </code></pre>
How to create FILETIME in Win32? <p>I have a value <code>__int64</code> that is a 64-bit <code>FILETIME</code> value. <code>FILETIME</code> has a <code>dwLowDateTime</code> and <code>dwHighDateTime</code>. When I try to assign a <code>__int64</code> to a <code>FILETIME</code> I get a C2440. How do I assign the <code>__...
<p>Here's the basic outline.</p> <pre><code>__int64 t; FILETIME ft; ft.dwLowDateTime = (DWORD)t; ft.dwHighDateTime = (DWORD)(t &gt;&gt; 32); </code></pre> <p><strong>NOT RECOMMENDED</strong> approach</p> <pre><code>ft = *(FILETIME *)(&amp;t); </code></pre> <p>It'll work due to the clever arrangement of FILETIME, b...
Multiline String Literal in C# <p>Is there an easy way to create a multiline string literal in C#?</p> <p>Here's what I have now:</p> <pre><code>string query = "SELECT foo, bar" + " FROM table" + " WHERE id = 42"; </code></pre> <p>I know PHP has</p> <pre><code>&lt;&lt;&lt;BLOCK BLOCK; </code></pre> <p>Does C# hav...
<p>You can use the <code>@</code> symbol in front of a <code>string</code> to form a <a href="http://dotnetslackers.com/CSharp/re-51752%5FThe%5FChash%5FString%5FLiteral.aspx">verbatim string literal</a>:</p> <pre><code>string query = @"SELECT foo, bar FROM table WHERE id = 42"; </code></pre> <p>You also <a href="http...
Setting User Control's DataContext from Code-Behind <p>This should be pretty easy, but it throws VS2008 for a serious loop.</p> <p>I'm trying out WPF with MVVM, and am a total newbie at it although I've been developing for about 15 years, and have a comp. sci. degree. At the current client, I am required to use VB.Ne...
<p>The root cause of your issue appears to be either the raw amount of data you're loading or some inefficiency in how you load that data. Having said that, the reason you're seeing the application lock up is that you're locking the UI thread when loading the data. </p> <p>I believe that in your first case the data ...
Popup window not opening on IE7 <p>Hi Javascript gurus, I have this Javascript code which is working fine on Firefox , but it is not working on IE 7. Any ideas why?</p> <p>Here is the code </p> <pre><code>function TestWindow() { SimpleWindow('Default.aspx', 'Simple Test', 200, 200, 'yes') } function SimpleWindo...
<p>You may have realized that IE is giving the error "Invalid argument."</p> <p>IE doesn't seem to like window names with spaces in them. Change 'Simple Test' to 'SimpleTest' etc.</p>
Flex-AIR: Make application with NO tab in taskbar? <p>I have an AIR app about half way done right now. I was informed by the client today that he does not want a tab to show up in his task bar. I already have this in place for new windows by making them lightweight. I do not know how to make the main window lightweight...
<p>Check <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=taskbar%5F1.html">this doc out.</a> -- Yes, you can do this. In short, you have to hide the initial window - then display your application in a lightweight window.</p> <p>Also - do note: On a Mac - the behavior is different. By convention, a win...
Reading and assigning a void type parameter <p>I wrote two methods with a void type parameter:</p> <pre><code>procedure Method1(const MyVar; size: cardinal); var Arr: array of byte; begin SetLength(Arr, size); {now copy the data from MyVar to Arr, but how?} end; procedure Method2(var MyVar; size: cardinal); v...
<p>There's no such thing a a void type in Delphi. What you're referring to is called an <a href="http://www.cs.wisc.edu/~rkennedy/untyped"><em>untyped parameter</em></a>.</p> <p>An untyped parameter is always the <em>actual thing itself</em>, not a pointer to the thing you're supposed to use. Therefore, the correct wa...
Crystal Reports XI and MySQL Stored Procedure with Parameters <p>I am having a problem with a Crystal Report that displays data from a MySQL table. I am currently gathering the data directly from the table, however when the users try to input parameters, problems arise such as:</p> <ol> <li>null values for parameter...
<p>If I'm reading your IF tree correctly, I think you could do this instead (I'm a T-SQL guy, so I can't confirm if this will run in MySQL):</p> <pre><code>SELECT * FROM tblData WHERE ((field1=@param1) OR (@param1 is null)) AND ((field2=@param2) OR (@param2 is null)) AND ((field3=@param3) OR (@param3 is null)...
Monitor queries in an access database <p>Is there a way to monitor queries in an access database, similar to the way SQL Profiler works?</p> <p>I have a very old piece of software that I do not have the source for and it has an ODBC connection to an access database on another computer. Is there a way to monitor what ...
<p>Have you tried turning on the ODBC trace function? Use the ODBC Data Sources control panel applet. Switch to the 'Trace' tab and review the options available.</p>
How can you have a Tab Bar Controller and a Table View? <p>I am trying to make it so that on one of the tabs there is a table view</p> <p>Any ideas?</p> <p>Thanks</p>
<p>Use Interface builder to create a Tab Bar Controller and on one of the tabs add a Table View Controller. This is pretty basic and just requires dragging and dropping in Interface Builder and then connecting the outlets in Xcode. There are plenty of tutorials online for this, he is one of them: <a href="http://www.ip...
Installing native assembly into GAC <p>I have an assembly containing a mixture of Managed and unmanaged C++ code. I have signed it and installed into Global Assembly Cache. My program (.Net, C#) won't find it there, although it worked perfectly well when the assembly was in the program directory. The program uses DllIm...
<p>No you can't. The way <code>DllImport</code> resolves libraries is completely different from they way runtime finds managed assemblies.</p>
With Eclipselink/JPA, can I have a Foreign Composite Key that shares a field with a Primary Composite Key? <p>My database has two entities; Company and Person. A Company can have many People, but a Person must have only one Company. The table structure looks as follows.</p> <pre>COMPANY ---------- owner PK comp_id P...
<p>Your code should work. Ensure you recompiled/deployed it correctly. What version are you using?</p> <p>Also ensure that your Company object has a valid id set.</p> <p>You could also try putting ,</p> <pre><code>insertable = false, updatable = false </code></pre> <p>in your owner field's @Column and leave the en...
What algorithm to use to calculate a check digit? <p>What algorithm to use to calculate a check digit for a list of digits?<br /> The length of the list is between 8 and 12 digits.</p> <p>see also:<br /> <a href="http://stackoverflow.com/questions/46231/how-to-generate-a-verification-code-number">How to generate a ver...
<p>The <a href="http://en.wikipedia.org/wiki/Luhn%5Falgorithm" rel="nofollow">Luhn algorithm</a> is good enough for the credit card industry...</p>
IRC Python Bot: Best Way <p>I want to build a bot that basically does the following:</p> <ol> <li>Listens to the room and interacts with users and encourages them to PM the bot.</li> <li>Once a user has PMed the bot engage with the client using various AI techniques. </li> </ol> <p>Should I just use the IRC library o...
<p>Use <a href="http://twistedmatrix.com">Twisted</a> or <a href="http://docs.python.org/library/asynchat.html">Asynchat</a> if you want to have a sane design. It is possible to just do it with sockets but why bother doing it from scratch?</p>
Apache loading queue problems <p>I now have 8GB of ram in my server, so bare that in-mind when making recommendations on how much to up settings.</p> <p>Basically, Apache won't concurrently load more than one page at a time. What the hell could be causing this? This causes real problems when I execute a page that take...
<p>Problem solved, changed memory usage in scripts.</p>
Cant open a doc file from the browser <p>I have a link using tag and it is linked to a .doc file in the server. When I click on the link, instead of giving the open, save box, it opens the file in the browser in the binary format. Has anyone encountered this problem? I am using a Weblogic server.</p>
<p>As Russ said, sometimes you have to add the <code>Content-Type</code> header to explicitly set the mime type; and sometimes, you also have to add a <code>Content-Disposition</code> header, perhaps to a value like</p> <blockquote> <p>"attachment; filename=doc1.doc"</p> </blockquote> <p>If Russ' fix doesn't work f...
android LinearLayout <p>I want to lay two TextView to the left, and one button to the right inside a linear layout, is this possible? The following is my code where I had to hardcode the leftMargin of the button, this is inflexible. Is it possible to layout children that flows in different directions? </p> <pre><cod...
<blockquote> <p>I want to lay two TextView to the left, and one button to the right inside a linear layout, is this possible?</p> </blockquote> <p>Not with a single <code>LinearLayout</code>. You either need two <code>LinearLayout</code>s (one for a column of two <code>TextView</code>s on the left), or one Rel...
Can't get URL to resolve...htaccess, mod_rewrite, wordpress issue <p>I'm having an issue with a rewrite.</p> <p>I have a Wordpress install in my /blog directory, but I want the Wordpress Pages to appear outside of the blog directory.</p> <p>So, in my root .htaccess I added a line: (The first three lines were already...
<p>Wouldn't this rule:</p> <pre><code>RewriteRule ^(.*)$ "/blog/$1" [L] </code></pre> <p>cause <code>www.tooboss.com/blog</code> to get sent to <code>www.tooboss.com/blog/blog</code>?</p> <p>I think you want:</p> <pre><code>RewriteCond %{REQUEST_FILENAME} !^/blog/$ RewriteRule ^(.*)$ "/blog/$1" [L] </code></pre> <...
Executing a command programatically in Eclipse console <p>From my Eclipse plugin, I want to execute a command and show the results in the Console view (and later do some formatting and hyperlinking and pattern matching, which is done via the <code>org.eclipse.ui.console.consolePatternMatchListeners</code> extension poi...
<p>Using <a href="http://wiki.eclipse.org/FAQ%5FHow%5Fdo%5FI%5Fwrite%5Fto%5Fthe%5Fconsole%5Ffrom%5Fa%5Fplug-in%3F" rel="nofollow">Eclipse FAQ</a>, <a href="http://stackoverflow.com/questions/716615/writing-to-the-eclipse-console">this SO question</a> and <a href="http://www.java-tips.org/java-se-tips/java.util/from-run...
Determine if running on a rooted device <p>My app has a certain piece of functionality that will only work on a device where root is available. Rather than having this feature fail when it is used (and then show an appropriate error message to the user), I'd prefer an ability to silently check if root is available firs...
<p>Here is a class that will check for Root one of three ways. </p> <pre><code>/** @author Kevin Kowalewski */ public class RootUtil { public static boolean isDeviceRooted() { return checkRootMethod1() || checkRootMethod2() || checkRootMethod3(); } private static boolean checkRootMethod1() { ...
Oracle SQL Developer: sharing configuration via Dropbox <p>I would like to share my Oracle SQL Developer configuration across my several computers that use Dropbox.</p> <p>How can I do this?</p>
<p>In case anyone comes here looking for the location of user configured options like me, they are hiding here:</p> <pre><code>%appdata%\SQL Developer\ </code></pre> <p>This is useful to know when copying your preferences to a new computer. If you are looking for the connection settings, search for <code>connections....
Convert a base25 String to binary String in Java <p>So I have a set of base digits like "BCDFGHJKLMNPQRSTVWXZ34679"</p> <p>how do I convert a value say "D6CN96W6WT" to binary string in Java?</p>
<p>This should work (assuming 0,1 for you binary digits):</p> <pre><code>// your arbitrary digits private static final String DIGITS = "BCDFGHJKLMNPQRSTVWXZ34679"; public String base25ToBinary(String base25Number) { long value = 0; char[] base25Digits = base25Number.toCharArray(); for (char digit : base2...
Why does Django's built-in "url" tag cause an error when running unit tests? <p>In my Django templates, I have a couple pieces of code that are like this:</p> <pre><code>&lt;a href="{% url root %}"&gt;Root&lt;/a&gt; </code></pre> <p>They work properly when rendering the template. However, whenever I run my unit tests...
<p>Evidently, the tests were actually failing because Django couldn't find a Site record in the database. It may be because my <code>SITE_ID</code> is set to something other than 1; this was supposedly fixed, as mentioned in this <a href="http://code.djangoproject.com/ticket/5979" rel="nofollow">ticket</a>, but it does...
Are there any .NET Graphics Calculate Libraries? <p>I want to find a Calculate Library not a Drawing Library to help me do some graphics calulation like Bezier's length, point on Beziers or other metadata.</p> <p>Is there any library like this?</p>
<p>ALGLIB may have what you need and is open source:</p> <ul> <li><a href="http://www.alglib.net/" rel="nofollow">http://www.alglib.net/</a></li> </ul> <p>IMSL is a well regarded commercial library which implements many numerical algorithms:</p> <ul> <li><a href="http://www.vni.com/products/imsl/cSharp/overview.php"...
Why my Python test generator simply doesn't work? <p>This is a sample script to test the use of yield... am I doing it wrong? It always returns '1'...</p> <pre><code>#!/usr/bin/python def testGen(): for a in [1,2,3,4,5,6,7,8,9,10]: yield a w = 0 while w &lt; 10: print testGen().next() w += 1...
<p>You're creating a new generator each time. You should only call <code>testGen()</code> once and then use the object returned. Try:</p> <pre><code>w = 0 g = testGen() while w &lt; 10: print g.next() w += 1 </code></pre> <p>Then of course there's the normal, idiomatic generator usage:</p> <pre><code>for n i...
Entity Framework and Oracle <p>I've got to look at the ORM solution for a new ASP.NET Web App with an Oracle backend.</p> <p>Has anyone had good/bad experience with using Entity Framework with Oracle?</p> <p>Are there any (free preferably) alternatives?</p>
<p>Microsoft doesn't have a supported option for Oracle for the Entity Framework - all the current options are non-free 3rd party providers.</p> <p>NHibernate works very well with Oracle in my experiences, as does LLBLGenPro (not free, but has a reasonably priced per-developer license for the entity mapping designer)....
Fix my Tic Tac Toe game in Visual Basic 2005 <p>I'm having 2 problems with my game. </p> <p>1.) Upon initialization, if I select multiplayer, the buttons are still disabled. I have to refresh to get it to work.</p> <p>2.) When I'm doing single player, my AI is not working right. When the AI picks its square, it still...
<p>Trust me on this one. You have more than 2 problems with your game.</p> <p>With respect to (1), I don't see a handler for the multiplayer button. For the single player button, you re-enable the buttons, but for multiplayer you don't. Add a handler and do the multiplayer set up in it.</p> <p>With respect to (2)...
JavaScript regex exec takes too long to execute <p>I've got a simple JavaScript regex check (written by other developer) that works perfectly on thousands of different strings. However I've just discovered one particular string value that's causing that regex to take as long as 10min to execute in Firefox/IE which is u...
<p>You probably meant to have a + after the space group, rather than *. If you replace it back with a +, things go much faster. The * causes the regex evaluator to try a huge number of combinations, all of which fail when they reach the ','. You might want to add a ',' to the first character group too.</p> <p>Overall,...
Configuration error after deploying asp.net files into iis server <p>I am getting the following error which deploying my code in the production server. Code is working fine in development. </p> <pre><code> Configuration Error Description: An error occurred during the processing of a configuration file required to ...
<p>The server doesn't have .NET 3.5 SP1 installed on it.</p>
GUI not responding while fetching data <p>My application often fetch data from a webpage using WebRequest, but it isn't possible to click buttons etc while it's fetching. I've understood that I have to use threads/a backgroundworker, but I can't get it to work properly; it doesn't make the GUI more respondable. </p> <...
<p>Here's a simple example of how to use the <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx" rel="nofollow"><code>BackgroundWorker</code></a> as it applies to your code:</p> <pre><code>private void StartQuery(string query) { BackgroundWorker backgroundWorker1 = new Bac...
Jquery very slow in IE7 <p><strong>Summary</strong></p> <p>jquery is used to retrieve search results via the get() call. When rendering the bulk of results there is no problem, but then when rendering part of the results, IE7 consistently hangs for 5-30 seconds before rendering.</p> <p><strong>Problem</strong></p> <...
<p>The problem came from a fact which I omitted - which is that the search results, each one, contains an flash object. removing the flash object makes the speed comparable to FF.</p> <p>The flash is now loaded after <code>$(document).ready()</code> using swfobject, and the problem has disappeared.</p> <p>The behavio...
Tkinter: AttributeError: NoneType object has no attribute get <p>I have seen a couple of other posts on similar error message but couldn't find a solution which would fix it in my case.</p> <p>I dabbled a bit with TkInter and created a very simple UI. The code follows-</p> <pre><code>from string import * from Tkinter...
<p>The <code>grid</code> (and <code>pack</code>, and <code>place</code>) function of the <code>Entry</code> object (and of all other widgets) returns <code>None</code>. In python when you do <code>a().b()</code>, the result of the expression is whatever <code>b()</code> returns, therefore <code>Entry(...).grid(...)</co...
Automate any software <p>A quick question. Is there any method to control or automate any Windows application, using the command line. I've tried AutoIt. Any other methods? I'm targetting to control WinCE Test Kit (CETK) to perform the test without having to go to the GUI,or click the menu, connect etc, manually.</p> ...
<p>We use Rational Robot for this but keep in mind it's not cheap. It's also probably been renamed 27 times since we started using it so you may want to just search for Rational testing products in general.</p> <p>It's fully script-able, allowing you to monitor the screen and send key presses and whatnot.</p>
Object is blank after getting it from Google Datastore <p>I <a href="http://stackoverflow.com/questions/1100915/complex-class-hierarchy-in-google-appengine-java">asked question</a> before asking if it is possible to save complex class composition in to the Google Datastore inside Google AppEngine with Java, but I was n...
<p>I don't know exactly what's causing your error, but here are a few steps you can try to help troubleshoot:</p> <p>First, try to narrow down your problem to as small a test case as possible. You have a lot of classes posted above, and most likely this problem could be duplicated with just 2 or maybe 3 of them.</p> ...
Consuming PHP webservice(SOAP, WSDL) from ASP.NET C# app - problems with array <p>I have a web service, defined(WSDL) and implemented in PHP. This one is relatively simple, important bits defined as the following:</p> <pre><code>&lt;message name='registerAccountRequest'&gt; &lt;part name='key' type='xsd:string...
<p><code>Hashtable</code> would be the most exact approximation of a PHP associative array... However, the best comparison for 'normal' use of an associative array would be a <code>Dictionary&lt;string, object&gt;</code> or perhaps even <code>Dictionary&lt;string, string&gt;</code> (depending on what your data actually...
Exception handling: how granular would you go when it comes to argument validation? <p>I'm coding a simple little class with a single method send an email. My goal is to implement it in a legacy Visual Basic 6 project, exposing it as a COM object via the COM Interop facility.</p> <p>There's a detail I'm finding diffic...
<p>Consider the contract that you are imposing upon the callers of SendMail. They are required to pass you a "valid email address". Who decides what is valid? SendMail does. Basically your method is "high maintenance" -- it wants things exactly the way it likes, and the only way to tell whether what you're going to gi...
How to navigate from one screen to another screen <p>How to navigate from one Activity screen to another Activity screen? In the first screen I'm having one button if I click the button it has to move to another Activity screen.</p>
<pre><code>Button x.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent i = new Intent(y.this, Activity.class); startActivity(i); } }); </code></pre> <p>Here we've defined a listener for Button x....
Good diagramming software for UML and Webdesign? <p>I'm looking for a simple, easy to use and possibly free diagramming tool for both basic UML diagrams (mainly use case and activity diagrams) and webdesign wireframes. I don't need any complex UML &lt;-> coding functionality (as provided in <strong>StarUML</strong> or ...
<p>For web design wireframes I would suggest <a href="http://www.balsamiq.com/products/mockups" rel="nofollow">Balsamiq Mockups</a> - it is great for doing rough sketches, and most of the functionality is available in the free version (you can also get a free license in some cases).</p> <p>For UML diagrams, you could ...
Conflicting user management design <p>I'm building a user notification system on a website which involves 2 levels of registration: admin and client</p> <p>I have all users register into a single registration table with the fields: </p> <pre><code>uid email password owner cid admin </code></pre> <p>When an admi...
<p>Why can't you put a unique constraint on the email? This would ensure that a user couldn't be created more than once with the same email.</p> <p>The when you're creating a new user you just need to do a quick db check for the email address.</p> <pre><code> SELECT uid from users where email = '$email'; if (userexis...
AS3 Loader ignoring .png transparency <p>In Flash CS4, open a new document, change the background colour to something recognizeable (like magenta) and add the following code:</p> <pre><code>var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function(e:Event){addChild(e.target.c...
<p>The image doesn't actually have a transparent background...</p> <p><img src="http://liranuna.com/junk/trans-image.png" alt="alt text" /></p> <p>For your pleasure, fixed image:</p> <p><img src="http://liranuna.com/junk/newsnakelub8.png" alt="alt text" /></p>
Replacement of compute by clause in t-sql <p>i have been working on query which uses compute by clause for avg and sum operators . As Microsoft declared this will be a discontinued feature ,what will be the replacement for this feature </p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms181708.aspx" rel="nofollow">Use ROLLUP</a> which is part of the <a href="http://msdn.microsoft.com/en-us/library/ms177673.aspx" rel="nofollow">GROUP BY</a> clause</p>
jQuery DatePicker Bug? <p>I'm using jQuery DatePicker and it shows wrong date for November, 2009.</p> <p>You can see this in my sample page.</p> <p><a href="http://project-base-23.codepremise.com/door/test_calendar" rel="nofollow">http://project-base-23.codepremise.com/door/test_calendar</a></p> <p>Is this a known b...
<p>The issue is daylight savings. Essentially, because of the "fall back" of one hour, November 1st has 25 hours. The bug is resolved in the most recent version of datepicker: <a href="http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/scripts/jquery.datePicker.js" rel="nofollow">http://www.kelvinluck.com/ass...
How do I set up RewriteRule for urls that all start with the same folder and then some but not all subfolders <p>I am trying to write a rule to redirect some but not all of the content of a certain folder:</p> <ul> <li>^folder1/ any .html files</li> <li>^folder1/blackberry</li> <li>^folder1/content</li> <li>^folder1/d...
<p>Use a rule to catch everything and exclude the exceptions with a <code>RewriteCond</code> directive:</p> <pre><code>RewriteCond %{REQUEST_URI} !^/folder1/blackberry$ RewriteRule ^folder1/ http://sub.example.com/main.html [L,R=301] </code></pre> <p>This rule redirects every request with a URL path that starts with ...
How to provide custom string placeholder for string format <p>I have a string </p> <pre><code>string str ="Enter {0} patient name"; </code></pre> <p>I am using string.format to format it.</p> <pre><code>String.Format(str, "Hello"); </code></pre> <p>Now if i want patient also to be retrieved from some config then I ...
<p>You might want to check out <a href="http://james.newtonking.com/archive/2008/03/29/formatwith-2-0-string-formatting-with-named-variables.aspx">FormatWith 2.0</a> by <a href="http://james.newtonking.com/">James Newton-King</a>. It allows you to use property names as formatting tokens such as this:</p> <pre><code>va...
mysql stored proc <p>hi all how can i execute a stored proc in mysql db? i have to pass parameters and to catch the result out off stored proc.</p>
<p>Check the articles at <a href="http://dev.mysql.com/usingmysql/dotnet/" rel="nofollow">http://dev.mysql.com/usingmysql/dotnet/</a>.</p>
How to open a file for independent read/write? <p>I'd like to open the same file for both reading and writing. The file pointer should be independent. So a read operation should not move the write position and vice versa.</p> <p>Currently, I'm using this code:</p> <pre><code>FileStream fileWrite = File.Open (path, Fi...
<p>I think I just figured it out myself. In the second <code>File.Open</code>, we're trying to <em>deny</em> other applications write access by specifying <code>FileShare.Read</code>. Instead, we need to <em>allow</em> the first stream to write to the file:</p> <pre><code>FileStream fileRead = File.Open (path, FileMod...
Installing .NET 3.5 SP1 on server broke WCF <p>I installed .NET 3.5 SP1 on server which previously had .NET 3.0 SP2. </p> <p>Before install site was working perfectly. After install and subsequeny server restart, site displays but anything that makes use of the WCF service has stopped working. The exception log report...
<p>Did you rebuild the code using .NET 3.5 SP1 (Visual Studio 2008 SP1)?</p> <p>Please post the full exceptions, along with stack traces. These might be available in the Application event log, as warnings from source "ASP.NET".</p> <p><hr /></p> <p>I vaguely remember a bug like this, having to do with the order of t...