input
stringlengths
51
42.3k
output
stringlengths
18
55k
A PHP API for retrieving Mail From Yahoo, GMail, Hotmail <p>There are a few APIs for grabbing the address book/contact list from the major providers of email.</p> <p>I was wondering do APIs like this exist for grabbing emails/messages received?</p> <p>Thanks all</p> <h2>EDIT</h2> <p>I am sure I can do this myself. ...
<p>I think all of this services provide POP/IMAP protocol which you can acces with PHP's functions: <a href="http://php.net/book.imap" rel="nofollow">http://php.net/book.imap</a></p>
I need a fast key substitution algorithm for java <p>Given a string with replacement keys in it, how can I most efficiently replace these keys with runtime values, using <strong>Java</strong>? I need to do this often, fast, and on reasonably long strings (say, on average, 1-2kb). The form of the keys is my choice, si...
<p>The appendReplacement method in <a href="http://java.sun.com/javase/6/docs/api/java/util/regex/Matcher.html" rel="nofollow">Matcher</a> looks like it might be useful, although I can't vouch for its speed.</p> <p>Here's the sample code from the Javadoc:</p> <pre><code>Pattern p = Pattern.compile("cat"); Matcher m =...
How to eliminate post-render "flicker"? <p>I've tried my best to be a purist with my usage of Javascript/Ajax techniques, ensuring that all Ajax-y behavior is an enhancement of base functionality, while the site is also fully functional when Javascript is disabled. However, this causes some problems.</p> <p>In some c...
<p>How about combining some of these solutions:</p> <pre><code>&lt;style type="text/javascript"&gt; .only-without-script { display: none; } &lt;/style&gt; &lt;noscript&gt; &lt;style type="text/javascript"&gt; .only-with-script { display: none; } .only-without-scr...
How do you manage your run once sql install scripts in subversion? <p>I'm working at a company that does several releases to production every year and during the build up to each release we gather up a collection of 1 time sql install scripts like table creation and dataports.</p> <p>The way things currently work is t...
<p>Synchronising database changes and code changes in subversion is hard</p> <p>If you have the option of building the Database from scratch you can put the whole DDL into the repository along with the code, then you don’t need to worry about which changes go with which release. </p> <p>Looking at your situation I ...
jQuery $(document).ready() failing in IE6 <p>I have the following code:</p> <pre><code>// Creates a timer to check for elements popping into the dom timer = setInterval(function () { for (p in pixelTypes) { checkElems(pixelTypes[p]); } ...
<p>Just a few pointers for anyone that's interested:</p> <p><code>$(document).ready(function() {...});</code> and <code>$(function() {...});</code> means exactly the same thing. The latter is a shorthand for the former.</p> <p>If you develop for a large site, using multiple Javascript libraries, or you develop plugin...
High Level Graphics <p>I did a lot of VRML+Java work in college and loved it, but I feel like it's not really a marketable skill. Has anyone worked with a high level graphics API like open inventor, coin..etc that is actually in use to a degree that makes investing a lot of time in the API worthwhile for something mor...
<p>Here are some industries that need such graphics programming skills:</p> <ul> <li>Entertainment - Dreamworks, Pixar</li> <li>Engineering - companies into Computation Fluid mechanics/ Dynamics (CFM, CDM)</li> <li>Gaming - EA Games and so on</li> </ul> <p>Also check with companies into "photo realistic rendering". <...
When to exploit type inference in Haskell? <p>I'm curious as to how often experienced Haskell programmers really use type inference in practice. I often see it praised as an advantage over the always-explicit declarations needed in certain other languages, but for some reason (perhaps just because I'm new) it "feels" r...
<p>It's still an advantage, even if you write type signatures, because the compiler will catch type errors in your functions. I usually write type signatures too, but omit them in places like <code>where</code> or <code>let</code> clauses where you actually define new symbols but don't feel the need to specify a type s...
String conversions <p>I have a method which takes String argument.In some cases i want to pass int value to that method.For invoking that method i want to convert int into String.For that i am doing the following</p> <pre><code> aMethod(""+100); </code></pre> <p>One more option is </p> <pre><code> aMethod(Stri...
<p>Good article by Jon Skeet about your question's topic: <a href="http://www.yoda.arachsys.com/java/stringconv.html" rel="nofollow">String conversions - the Good, the Okay-I-Suppose, and the Utterly Horrible</a></p>
Simple Dynamic Graph Display for C++ <p>I am looking for a simple graph layout library for C++. I want to embed the library into our visualizer based on wxWidgets. In summary, I am looking for something like <a href="http://www.graphviz.org/Gallery.php">graphviz</a>, except dynamic - that is when an event occurs, only ...
<p>The layout that Graphviz generates is based on the global structure - any single addition can dramatically change the output (unless you're using fixed coordinates, in which case you probably wouldn't be asking this question). Basically, if you want automatic placement of elements, you need to accept one of these s...
django application configuration <p>I'm dying to get started Django but I'm really struggling with the initial setup. I have Python/MySql/Apache2.2/mod_python installed. Now I'm trying to create a proper directory structure and then update Django and Apache settings.py/httpd docs respectively. Specifically the location...
<p>Don't use Apache for development, that'll make you tear your hair out restarting Apache every fifteen seconds (<strong>EDIT</strong>: or you could just use PythonDebug On).</p> <p><a href="http://docs.djangoproject.com/en/dev/howto/static-files/#limiting-use-to-debug-true" rel="nofollow">This technique</a> is how t...
How are POST and GET variables handled in Python? <p>In PHP you can just use <code>$_POST</code> for POST and <code>$_GET</code> for GET (Query string) variables. What's the equivalent in Python?</p>
<p>suppose you're posting a html form with this:</p> <pre><code>&lt;input type="text" name="username"&gt; </code></pre> <p>If using <a href="http://docs.python.org/library/cgi.html">raw cgi</a>:</p> <pre><code>import cgi form = cgi.FieldStorage() print form["username"] </code></pre> <p>If using <a href="http://docs...
Getting base station name using J2ME <p>How can get the base station name using J2ME?</p>
<p>I'm not aware of any way generally for vanilla J2ME/MIDP. Specific platforms though may provide some way. For example, with BlackBerry you can use <code>net.rim.device.api.system.GPRSInfo</code> and related classes.</p>
CURL usages in PHP <p>I had a doubt in CURL (PHP) . I want to login directly into a site using CURL. Is it possible, if possible please guide me. </p> <p>I tried with the following but its not working</p> <pre><code>http://username:password@myurl </code></pre>
<p>This is probably what you're looking for:</p> <pre><code>$ch = curl_init("http://myurl"); curl_setopt($ch, CURLOPT_USERPWD, "[username]:[password]"); $output = curl_exec($ch); </code></pre> <p>You can find more options for CURL <a href="http://us2.php.net/manual/en/function.curl-setopt.php" rel="nofollow">here</a>...
Embedding Fonts in PDF from LaTeX Source with pdflatex <p>I need to embed the fonts that I'm using in my TeX document in my output PDF. I'm using pdflatex for TeX processing, and TextMate as my editor.</p> <p>I can't find any reference on how to embed the fonts I need in the PDF document.</p>
<p>From the pdfTex documentation,</p> <blockquote> <h1>5 Setting up fonts</h1> <p>pdfTEX can work with Type 1 and TrueType fonts (and to some extent also with OpenType fonts). Font les should be available and embedded for all fonts used in the document. It is possible to use METAFONT-- generated fonts in ...
ASP.NET MVC ViewData Null <p>I am currently creating an e-commerce site using C# ASP.NET MVC and have just come across a problem. On pages such as product pages and search results pages, I have to pass Lists of data from my controller to the ViewPage and that works just fine. However, a null reference exception occurs ...
<p>In your case I would have your database.GetByCategory(category, page) method simply return an empty list rather than null, this way your foreach statement just won't have any data to loop through but you won't get a null exception.</p> <p>In the case that you're not dealing with a list and the item is null, we use ...
best deployment approach for VSeWSS 1.2 <p>Can anyone suggest the best deployment approach for VSeWSS 1.2 based development?</p> <p>I have been working with this for more than 6 months now.. has anyone tried using WSPBuilder for this purpose?</p>
<p>I Personally prefer using stsdev (<a href="http://www.codeplex.com/stsdev" rel="nofollow">http://www.codeplex.com/stsdev</a>). I've used both WSPbuilder and STSDEV. Stsdev offers some development project templates that you create using an stsdev gui, not like the standard project templates you create using new > pro...
How to use #include directive correctly? <p>Is there any material about how to use <code>#include</code> correctly? I didn't find any C/C++ text book that explains this usage in detail. In formal project, I always get confused in dealing with it.</p>
<p>The big one that always tripped me up was this:</p> <p>This searches in the header path: </p> <pre><code>#include &lt;stdio.h&gt; </code></pre> <p>This searches in your local directory:</p> <pre><code>#include "myfile.h" </code></pre> <p>Second thing you should do with EVERY header is this:</p> <p>myfilename.h...
Login to windows xp programatically <p>Anyone heard that its possible to login to windows xp programatically, I want to modify the way the Domain Controller authenticates the user and if the user authenticated in my special way it returns the user name and password to the service working on the client machine so it sho...
<p>Have a look at this: <a href="http://msdn.microsoft.com/en-us/library/aa375457(VS.85).aspx">Gina.dll MSDN</a></p> <p>Gina is the system that fingerprint readers etc. use to customise the login screen. You may be able to use this to achieve your purpose?</p> <p>To future proof your app (Vista and Windows 7) you ma...
Can someone explain the difference between @Remote / @Local or only @Stateless in ejb? <p>I guess the topic says it. I have tried googling this, but havent gotten the answer I am looking for.</p> <p>I have many EJB's with only @Stateless. And sometimes I put @Local on them withouth really knowing why, and the benefits...
<p>Annotations are part of EJB 3.0. For ex. @stateless means it is a stateless session bean. @local is used for local interface and @Remote for remote bean interface. A detailed description of the anotations is given <a href="http://edocs.bea.com/wls/docs100/ejb30/annotations.html#wp1416811">here</a>. To understand the...
Code golf: combining multiple sorted lists into a single sorted list <p>Implement an algorithm to merge an arbitrary number of sorted lists into one sorted list. The aim is to create the smallest working programme, in whatever language you like.</p> <p>For example:</p> <pre><code>input: ((1, 4, 7), (2, 5, 8), (3, 6,...
<p>OCaml in 42 characters:</p> <pre><code>let f=List.fold_left(List.merge compare)[] </code></pre> <p>I think I should get extra credit for 42 exactly?</p>
Parsing Functions <p>I'm making a script parser in python and I'm a little stuck. I am not quite sure how to parse a line for all its functions (or even just one function at a time) and then search for a function with that name, and if it exists, execute that function short of writing a massive list if elif else block....
<p>Once you get the name of the function, use a dispatch dict to run the function:</p> <pre><code>def mysum(...): ... def myotherstuff(...): ... # create dispatch dict: myfunctions = {'sum': mysum, 'stuff': myotherstuff} # run your parser: function_name, parameters = parse_result(line) # run the function: myfunctio...
in ssis how do I include a reference to a global variable from a script component? <p>I have a script component which I need to reference a global variable? I guess I can dtsconfig file. How do I set this and read it back out from my script component?</p>
<p>You can use </p> <pre><code>Me.Variables.YourVariableName </code></pre> <p>this will work only in script component of Data Flow task. In script task you can use like this:</p> <pre><code>Dts.Variables("YourVariableName").Value.ToString </code></pre> <p>All you need is to configure the package variable in the dts...
SQL Server security via TSQL <p>I want to construct a transact sql script that will stop specified people from running certain commands against all databases: </p> <pre><code>drop database, drop table or preferbly drop * delete update </code></pre> <p>Is this possible? The user will already have access to the serve...
<p>(<strong>caveat</strong>, this is per-database; I don't know of anything server-wide, since the database is the main standalone unit)</p> <p>Presumably your user isn't the owner of the schema (or dbo)? In which case, they already shouldn't have access to, well, anything unless you GRANT it. So don't <a href="http:/...
Complex ASP.NET web applications and nant <p>Working on an intranet where we have about 20 different web apps - some .net, some classic asp. </p> <p>Currently each .net app is its own solution. There are advantages to this - we can build &amp; deploy just one app, without affecting other apps, and all the apps share ...
<p>I'm not sure you can do what you want to do, sadly. VS tends to make one DLL per unique project (not solution), and it appears you have just one project, so hence, one DLL.</p> <p>I'd suggest you keep one project (csproj) per application, but use NANT to build them all (ie, one at a time, together, in order), and p...
What does the iPhone developer program give me over and above simple registration as an iPhone developer? <p>Simply put; what does my $99 get me, that I can't already get for free?</p> <p>OK, OK, sounds like a dumb question, but the Apple site is not clear to me.</p> <p>My hunch is that you get the ability to submit ...
<p>After paying the $99 the main benefits are shown below:</p> <ul> <li>Install your developed apps on your device without Jailbreaking</li> <li>Submit and distribute paid and free apps to the Apple App Store</li> <li>Access to coupon codes to distribute your paid app to reviewers (neat feature)</li> <li>Distribute an...
Sharing C# code between Windows and Silverlight class libraries <p>We wrote a small Windows class library that implements extension methods for some standard types (strings initially). I placed this in a library so that any of our projects would be able to make use of it by simply referencing it and adding using XXX.Ex...
<p>You cannot set a reference from a Silverlight assembly to a regular .NET assembly but you can do so the other way round. </p> <p>So create a shared Silverlight assembly and add your code to that assembly. Now you can set a reference fro both your regular .NET and you other Silverlight assembly to the shared Silverl...
Using Autoconf to find variably named libraries <p>I am writing my first project that will use autoconf and teaching it to myself as I go. For the most part, things are going extremely well. I have one last significant hurdle. I am having trouble locating library and header files that may be named differently from one ...
<p>AC_TRY_LINK (with or without a loop) is unnecessarily redundant. Just take, for example, this recipe:</p> <pre><code>LIBS="" AC_SEARCH_LIBS([spidermonkey_init], [mozjs js], [sp_libs="$LIBS"; LIBS=""], []) </code></pre>
How to assign values to the whole row of a dynamic two dimensional array? <p>I need to perform 9 different operations on a coordinate, depending on the position of the coordinate. I have a function that returns the coordinates of a position around the given coordinate (down, up, left, right or diagonals). The 9 differe...
<p>Assuming C99, you can use a compound literal and <code>memcpy()</code> it over your row. For the <code>k</code>-th row, this could look like this:</p> <pre><code>#define SEARCH_DIRECTIONS 9 memcpy(searches-&gt;library[k], ((int [SEARCH_DIRECTIONS]){ 1, 2, 3 }), sizeof(int) * SEARCH_DIRECTIONS); </code></pre>
Applying Styles to ASP.Net MVC ViewData objects <p>I have the following code in a MVC User Control (the field names have been changed to protect the innocent):</p> <p>&lt;%=ViewData.Model.foo%></p> <p>&lt;%=ViewData.Model.Bar%></p> <p>&lt;%=ViewData.Model.Widget%></p> <p>&lt;%=ViewData.Model.Thingy%></p> <p>&lt;%=...
<p>It appears, from your sample code, but you are just directly outputting string properties into the web page. In this case, you would need to surround the output string with a span or a div in order to assign it a class, like this:</p> <pre><code>&lt;div class="foo"&gt;&lt;%=ViewData.Model.foo %&gt;&lt;/div&gt; </co...
ASP.Net: Authentication via Browser's Login Window <p>I have what appears to be a fairly common scenario: I have a database that contains a list of users/passwords, and ideally, when someone visits the site, I'd like to use their windows name (internal), otherwise whatever name the user provided (external).</p> <p>My...
<p>You can use ASP.net Membership libraries with Windows authentication. Here is the <a href="http://weblogs.asp.net/scottgu/archive/2006/07/12/Recipe_3A00_-Enabling-Windows-Authentication-within-an-Intranet-ASP.NET-Web-application.aspx" rel="nofollow">ScottGu blog</a> talking about it</p>
HTML / CSS - DIV Element hidden when it shouldn't be? <p><a href="http://i41.tinypic.com/23rr095.jpg" rel="nofollow"><img src="http://i41.tinypic.com/23rr095.jpg" width="640"></a> (clickable)</p> <p>Mainad has a valid height and width, however it isn't shown like subad1/subad2. Which are in essence exactly the same! (...
<p>Do you have AdBlock installed? That might be hiding that div.</p>
How to handle diacritics (accents) when rewriting 'pretty URLs' <p>I rewrite URLs to include the title of user generated travelblogs.</p> <p>I do this for both readability of URLs and SEO purposes. </p> <pre> http://www.example.com/gallery/280-Gorges_du_Todra/ </pre> <p>The first integer is the id, the rest is for...
<p>Ultimately, you're going to have to give up on the idea of "correct", for this problem. Translating the string, no matter how you do it, destroys accuracy in the name of compatibility and readability. All three options are equally compatible, but #1 and #2 suffer in terms of readability. So just run with it and g...
How to properly test this controller action with Shoulda? <p>I have the following controller action and test. I'm new to testing with Shoulda and I <em>know</em> there are areas of my controller that I can test further. For example, my flash messages as well as verifying the renders.</p> <p>So my question is, how wo...
<p>Right now, it appears that you're testing functionality specific to the model inside your controller, that should be in a unit test.</p> <p>I would advise re-factoring your controller to include the required logic for updating the Owner's email inside the Owner model. By doing that, you should be able to simplify t...
Can you search SQL Server 2005 Stored Procedure content? <p>SQL Server Server 2005. I'm staring at a database that has 500+ stored procedures, and trying to glean the intricacies of how they interact with the data - particularly in regards to how they insert/modify data. I was hoping to find a search" or "find" funct...
<p>Try using third party tools such as <a href="http://www.apexsql.com/sql_tools_search.aspx">ApexSQL Search</a> (free) or SSMS Toolpack (free) apart from those already mentioned here. </p> <p>I’ve had a similar problem in the past when I inherited 500+ objects database. My experience is that queries are ok but what...
php disk_total_space <p>i need help with disk_total_space function..</p> <p>i have this on my code</p> <pre><code>&lt;?php $sql="select * from users order by id"; $result=mysql_query($sql); while($row=mysql_fetch_array($result)) { ?&gt; Name : &lt;?php echo $row['name']; ?&gt; Email : &l...
<p><a href="http://us2.php.net/disk_total_space" rel="nofollow">http://us2.php.net/disk_total_space</a> says,</p> <blockquote> <p>"Given a string containing a directory, this function will return the total number of bytes on the <strong>corresponding filesystem</strong> or <strong>disk partition</strong>."</p> </blo...
.NET ThreadPool clarification - Available vs idle threads <p>I'm a little confused about one aspect of the .NET ThreadPool: namely, how you can tell how many of its 'Available' threads are idle ones waiting to be reused, and how many haven't yet been created.</p> <p>The summary for the <code>GetAvailableThreads()</cod...
<p>The ThreadPool does not have a way to determine how many threads are currently idle. That is, created but not actually doing anything.</p> <p>My experience with the ThreadPool shows that it's pretty good about keeping threads around. I don't know if they've put logic in there to keep track of the average number o...
How do I prevent a swf from refreshing when an iframe is resized? <p>I am resizing an iframe, and when I do that in Firefox, the content gets refreshed.</p> <p>I have a swf that extends, and in Firefox when the iframe extends to accommodate the swf, the swf appears in its normal position. </p> <p>In IE this doesn't h...
<p>Antonio, I'm afraid that the problem is in Firefox it self. When Gecko detects a change to the width of an iFrame, it repaints the page and causes that "refresh." There's no way that I know of to change this behavior, short of using a different technique.</p> <p>I confirmed that the problem exists in other Gecko-ba...
Get bounds of filters applied to Flash Sprite within Sprite <p>I have a Flash library with Sprite symbols composed of other sprites with design-time applied filters. I'm embedding those symbols into a Flex application like so:</p> <pre><code>&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&gt; &lt;mx:...
<p>Oh sweet success! (and thanks for the tips) A friend helped solve the problem with a nice recursive function to handle the filters which may exist on nested sprites:</p> <pre><code>private function getDisplayObjectRectangle(container:DisplayObjectContainer, processFilters:Boolean):Rectangle { var final_rectangle:...
VB.NET Queue constructor Error: Queue grow factor must be between 1 and 10 <p>First some background: VB.NET 2005 Application that accesses a MS-SQL back-end, using multiple Web Services for data gathering/publishing.</p> <p>On to the error: Our application mysteriously crashes on one of our clients computers, it work...
<p>Is it possible that this user doesn't have the appropriate .net framework? I'm guessing your application requires 2.0, but maybe he/she has 3.5? Is he running a different version of windows than the other users?</p> <p>The problem is not happening with your code but the lower level .net BCL.</p>
What is Your Tool-of-Choice for Creating Stubs? <p>Following on from my last question "<a href="http://stackoverflow.com/questions/463278/what-is-a-stub">What is a "Stub"</a>, I would really like to sit down tonight and play more with creating stub objects.</p> <p><strong>What is your tool of choice for creating Stub ...
<p>Simply, Rhino.Mocks. Yes, "Mocks Aren't Stubs", but Rhino.Mocks does both. Before wrapping my brain around Rhino.Mocks I hand-coded my own stubs. Never again.</p> <p>Sorry, I don't get the bonus points. Ayende.com, the place to get Rhino.Mocks, has decent online documentation, and a forum full of questions. Th...
What is Rhino Mocks Repeat? <p>What is Rhino Mocks Repeat ?</p> <pre><code>Repeat.Any(); Repeat.Once(); </code></pre> <p>What does it mean and how it works ?</p>
<p>It's used with the <code>Expect</code> construct as part of a fluent declaration. As for what it means, it means that the previous even is expected to occur that many times.</p> <p>For instance, <code>Expect.Call(someMethod()).Repeat.Twice()</code> says that <code>someMethod()</code> will be called exactly two tim...
treeview checkbox: how to check on select and vice versa <p>I'm working on a treeview with its CheckBoxes property set to true. I want the same functionality as in a CheckListBox in that if I check the box of a treenode, that node will be selected; and if I select a node, that node's checkbox will be checked. I'm not ...
<p>Try the following:</p> <pre><code> private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { treeView1.SelectedNode.Checked = true; } </code></pre> <p>This event is tied to the treeviews AfterSelect event</p>
Getting row index from an ImageButton click in a GridView <p>I have a Gridview with ImageButtons added to a column via a templatefield. I've attached a function to the "OnClick" event.</p> <p>Once in this function, how can I get the index of the row that has the button that has been clicked. It appears that all I ha...
<p>Cast the sender to an ImageButton then cast the image button's NamingContainer to a row:</p> <p>VB:</p> <pre><code>Dim btn as ImageButton = CType(sender, ImageButton) Dim row as GridViewRow = CType(btn.NamingContainer, GridViewRow) </code></pre> <p>C#: </p> <pre><code>ImageButton btn = (ImageButton)sender; Gri...
Can anybody give me an example of overused design patterns? <p>I've been hearing and reading about cases when people had come across cases of overused design patterns. Ok, missused design patterns are understandable phenomenon. What does it actually mean overused design patterns?</p> <p>Do you have any examples and wh...
<p>The <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton</a> is probably the most <a href="http://www.ibm.com/developerworks/webservices/library/co-single.html">overused design pattern</a>. I often see it used in many cases when it's out of scope and much more appropriate to directly instantiate object...
Flex Datagrid to Array? <p>I need to convert a datagrid table in Adobe Flex to an ArrayCollection. I was expecting to be able to loop through each row of a datagrid and write that to the Array collection, but the only method for accessing data in the datagrid that I can find is SelectedItem, which doesn't help me.</p>...
<p>If your DataGrid is:</p> <pre><code>&lt;mx:DataGrid id="someDG" dataProvider="{this.provider}" /&gt; </code></pre> <p>Then check if this.provider is Array or ArrayCollection. If it is ArrayCollection then access it simply by:</p> <pre><code>var gotIt:ArrayCollection = this.someDG.dataProvider as ArrayCollection; ...
Class Access question <p>I know this should be simple and I should know it but it's eluding me for the time being.</p> <p>I am using a singleton pattern to help with logging stuff. However, logging only happens in one class, and the singleton is basically a watcher for a boolean that opens and closes the log file. Bec...
<p>Make it a private class inside the class in which you want to use it. Also, consider making it a static class.</p>
Add Multiple User Control of the Same Type to a Page <p>Similar questions to this one have been asked but none seem to address my exact situation here's what I am trying to do.</p> <p>I have a user control that manages student info. i.e. FirstName, LastName, Address etc.</p> <p>I have a webpage/form that has a button...
<p>What is happening is that every time you do a postback your previous control was lost. Remember, every postback uses a brand new instance of your page class. The instance you added the control to last time was <em>destroyed</em> as soon as the http request finished &mdash; possibly before the browser even finished...
Windows Mobile Emulator networking to host machine <p>I'm trying to do some Windows Mobile dev in VS2008. The WM app is making a WCF call (or trying to). The emulator and my WCF server are running on the same desktop PC. I found some details about how to configure the network card on the WM5 emulator in conjunction wi...
<p>In visual studio that you are doing win mobile development from, go to tools menu then select device emulator manager. If your device emulator is running you will see it with a small arrow in the list. Right click this emulator and select "cradle". This should open activesync for XP or windows mobile device cente...
Assembly code vs Machine code vs Object code? <p>What is the difference between object code, machine code and assembly code?</p> <p>Can you give a visual example of their difference?</p>
<p>Machine code is binary (1's and 0's) code that can be executed directly by the cpu. If you were to open a "machine code" file in a text editor you would see garbage, including unprintable characters (no, not <em>those</em> unprintable characters ;).</p> <p>Object code is a portion of machine code that hasn't yet b...
Math Resources for C/C++ Programmers <p>My degree is in Electrical and Computer Engineering but i'm currently employed as a Software Engineer. I took all of the algebra, geometry and calculus classes that one would expect from someone with my degree however I must admit, I think I learned just enough to pass the test b...
<p>I found this blog on the subject intresting:</p> <p><a href="http://steve-yegge.blogspot.com/2006/03/math-for-programmers.html" rel="nofollow">http://steve-yegge.blogspot.com/2006/03/math-for-programmers.html</a></p> <p>also has some recommendations for books.</p>
Camera output, while performing functions, SLOW converting from linux to windows (C++) <p>I know this is probably general, please bear with me!</p> <p>We've got a program that uses a web camera and, based on what the camera is seeing, runs certain functions. The program runs excellently on MacOS and Linux, and it comp...
<p>What do you use to compile the program on Windows? Visual Studio? Cygwin? Are you sure you are not compiling a debug version? Have you turned on compiler optimization? You may also want to check your data types. You may be assuming int to be 64 bits, while you may be using 32-bit Windows, where it is 32 bits.<...
Is R a compiled language? <p>I can't find it anywhere on the web (and I don't want to install it). Is the <a href="http://en.wikipedia.org/wiki/R_(programming_language)" rel="nofollow">R language</a> a compiled language? How fast does it run a pre-written script? Does it do any kind of compilation, or just execute inst...
<p>In most cases R is an interpreted language that runs in a read-evaluate-print loop. There are numerous extensions to R that are written in other languages like C and Fortran where speed or interfacing with native libraries is helpful. </p>
What are some good C++ resources for effectively using Apache XML Security? <p>I'm looking for some resources that allow me to understand how to use this library, particularly for signing XML. Most of what I found out there is Java related, and I would prefer to get documentation/FAQs/tutorials on the C++ library.</p>
<p>I had the same problem. The best information I could find was on the Apache website itself ( <a href="http://santuario.apache.org/c/programming.html" rel="nofollow">http://santuario.apache.org/c/programming.html</a> ), the API docs and by looking at the code of the examples and tools (like templatesign) they provide...
How does one parse an XML document after first validating against a DTD in VB6 <p>I am attempting to write a XML parser in VB6.<br /> The standards that the XML is based off of comes with a DTD to verify the XML before you begin parsing. I have also written a sample XML file so that I have something with which to test....
<p>I can't reproduce your error. It works just fine with both files in the same folder for me.</p> <p>It's not a problem of the DTD not being well-formed either; that throws another error. I get the same error as you if it can't find the DTD, while I get error <code>-1072896757</code> ("Invalid character found in DTD....
SQL Server won't perform regular expression validation on XML column <p>I have an XML column in my table which contains this xsd snippet:</p> <pre><code>&lt;xsd:element name="Postcode" minOccurs="0"&gt; &lt;xsd:simpleType&gt; &lt;xsd:restriction base="xsd:string"&gt; &lt;xsd:pattern value="^[0-...
<p>Does your source XML look like this:</p> <pre><code>&lt;Postcode&gt;1234&lt;/Postcode&gt; </code></pre> <p>or like this:</p> <pre><code>&lt;Postcode&gt; 1234 &lt;/Postcode&gt; </code></pre> <p>Since you are trimming the string (with <code>^</code> and <code>$</code>) make sure that your XML looks like the fo...
dojo.require issues <p>I'm having trouble configuring my initial installation of dojo to include the widget framework correctly. </p> <p>Following most of the code I see, including dijit should look like this:</p> <pre><code>dojo.require("dijit"); </code></pre> <p>and that's that. Unfortunately, that doesn't seem to...
<p>You don't actually <em>have to</em> include dijit, just point directly to widgets you want to use: <code>dojo.require("dijit.Dialog");</code>. Weird widget behavior could be explained also by:</p> <ul> <li>missing theme css files: check with FireBug that everything gets loaded</li> <li>missing theme class attribute...
Use data with variable structure <p>Imagine a system that works with data, which structure changes over time. Say, for example, today your User object contains Name : String and Email : String, but tomorrow you need to add Age : Integer and Address which consists of Country, Zip code, etc. Then you may want to create n...
<p>I think this would largely depend on the longevity of the data and the language you're in.</p> <p>For a short lived structure, in a dynamic language, then I would be tempted to go low-brow and use a Hash of Lists.</p> <p>On the other end of the scale - something you need to persist and you really want a relational...
Hibernate session handling in spring web services <p>I am using spring-ws with Jaxb2Marshaller, PayloadRootAnnotationMethodEndpointMapping and GenericMarshallingMethodEndpointAdapter to configure my web services via the @Endpoint and @PayloadRoot annotations.</p> <p>When I try to use the DAO's of my project I am able ...
<p>Wrap a org.springframework.aop.framework.ProxyFactoryBean around the object in the spring context that needs the hibernate session to be present.</p> <p>This article <a href="http://springtips.blogspot.com/2007/06/spring-and-hibernate.html" rel="nofollow">http://springtips.blogspot.com/2007/06/spring-and-hibernate....
How to use msxml with Visual Studio 2008 Express (no ATL classes) without becoming crazy? <p>It is not really a question because I have already found a solution. It took me a lot of time, that's why I want to explain it here.</p> <p>Msxml is based on COM so it is not really easy to use in C++ even when you have helpfu...
<p>Maybe try using the <code>#import</code> statement. </p> <p>I've used it in a VS6 project I have hanging around, you do something like this (for illustrative purposes only; this worked for me but I don't claim to be error proof):</p> <pre><code>#import "msxml6.dll" ... MSXML2::IXMLDOMDocument2Ptr pdoc; HRESUL...
WCF Fails Under Load - MessageSecurityException <p>I am load testing my website. The site calls to a WCF service running on the same box using clientCredentialType="Windows". Everything works until I reach a certain load (which is not even very high), then I get the following error:</p> <blockquote> <p>System.Serv...
<p>Is your Service a Sessionful Service or do you not worry about keeping state between calls? If you don't have state, you may want to mark your service as a PerCall service. This will make sure that the service instance only exists when a client call is in progress.</p> <p>Chapter 4 of Juval Lowy's excellent book ...
What is the best approach for decoupled database design in terms of data sharing? <p>I have a series of Oracle databases that need to access each other's data. The most efficient way to do this is to use database links - setting up a few database links I can get data from A to B with the minimum of fuss. The problem fo...
<p>Streams is the Oracle replication technology. You can use MVs over database links (so database 'A' has a materialized view of the data from database 'B'. If 'B' goes down, the MV can't be refreshed but the data is still in 'A').</p> <p>Mileage may depend on DB volumes, change volumes...</p>
How can I read system information in Python on OS X? <p>Following from this <a href="http://stackoverflow.com/questions/466684/how-can-i-return-system-information-in-python">OS-agnostic question</a>, specifically <a href="http://stackoverflow.com/questions/466684/how-can-i-return-system-information-in-python#467291">th...
<p>You can get a large amount of system information from the command line utilities <a href="http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man8/sysctl.8.html" rel="nofollow"><code>sysctl</code></a> and <a href="http://developer.apple.com/DOCUMENTATION/DARWIN/Reference/ManPages/man1/vm_stat.1.html" ...
How can I deploy a django appserver as an egg, running behind fastcgi? <p>I want to run a django appserver behind apache/fastcgi. That's no problem, django does that out of the box.</p> <p>I want this appserver to be deployable via setuptools. That is, I will make it as an egg and install it with easy_install. And ...
<p>What you probably want to do instead is use something like <a href="http://pythonpaste.org/" rel="nofollow">Paste</a> to delegate to your egg (see example Paste deployment config file <a href="http://pythonpaste.org/deploy/#the-config-file" rel="nofollow">here</a>); this means doing the <code>flup</code> stuff (whic...
Compiler Error when adding dll reference to managed c++ project <p>I am using VS 2008 and get compiler errors sporadically when adding a dll reference to a managed c++ file in my C++ project. I am trying to add a reference to the dll so as to be able to use smart pointers. <strong>ex: #import items.tlb</strong></p> <...
<p>Whenever I've had this problem, it was caused by linking a Debug build to a Release DLL or a Release build to a Debug DLL.</p>
Is there a Perl equivalent of Python's re.findall/re.finditer (iterative regex results)? <p>In Python compiled regex patterns <a href="http://docs.python.org/library/re.html#re.findall">have a <code>findall</code> method</a> that does the following:</p> <blockquote> <p>Return all non-overlapping matches of pattern...
<p>Use the <code>/g</code> modifier in your match. From the <code>perlop</code> manual:</p> <blockquote> <p>The "<code>/g</code>" modifier specifies global pattern matching--that is, matching as many times as possible within the string. How it behaves depends on the context. In list context, it returns a list of t...
In what situation should the built-in 'operator' module be used in python? <p>I'm speaking of this module: <a href="http://docs.python.org/library/operator.html">http://docs.python.org/library/operator.html</a></p> <p>From the article:</p> <blockquote> <p>The operator module exports a set of functions implemented...
<p>Possibly the most popular usage is operator.itemgetter. Given a list <code>lst</code> of tuples, you can sort by the ith element by: <code>lst.sort(key=operator.itemgetter(i))</code></p> <p>Certainly, you could do the same thing without operator by defining your own key function, but the operator module makes it s...
How to restructure this code hierarchy (relating to the Law of Demeter) <p>I've got a game engine where I'm splitting off the physics simulation from the game object functionality. So I've got a pure virtual class for a physical body</p> <pre><code>class Body </code></pre> <p>from which I'll be deriving various impl...
<p>One approach you could take is to split the <code>Body</code> interface into multiple interfaces, each with a different purpose and give <code>GameObject</code> ownership of only the interfaces that it would have to expose.</p> <pre><code>class Positionable; class Movable; class Collidable; //etc. </code></pre> <p...
Specifying connection string in config file for a class library and re-use/modify in ASP.NET Web Application <p>How can one specify the connection string in a config file of a class library and later modify this when used in a ASP.NET Web Application?</p> <p>The Class library is a data access layer that has a Dataset ...
<p>With the .config files the name has to match the main executing assembly. For example I had a situation like yours, I needed a class library to have its settings in a .dll.config file. While it was able to reference it the actual application would not be able to read the config file because it was expecting .exe.con...
Is it possible to display a panel or div in between gridview rows on RowCommand event <p>Currentaly I am using a gridView and on RowCommand event of gridview the details of selected row are displayed below the Gridview. But now I have to display the details just below the row clicked. Means it will be displayed in betw...
<p>You probably want to use a Repeater and build the table yourself. I don't think that you'll be able to get a GridView to work as you can only control what goes in each row and what you want to do is alternate rows between general and detailed information. More information on how to connect it to your data source an...
How do you run Android instrumentation tests from Eclipse? <p>Currently I'm running instrumentations tests from the command line this way:</p> <pre><code>adb shell am instrument -w com.blah.blah/android.test.InstrumentationTestRunner </code></pre> <p>Is there a way to run them from Eclipse (with automatic installatio...
<p>I was not able to determine automatic deployment to the emulator. However, you can take that same "adb shell" command and create an external launch configuration. I blogged on this same topic <a href="http://stuffikeepforgettinghowtodo.blogspot.com/2009/01/unit-testing-android-applications.html" rel="nofollow">her...
A Regex to match a SHA1 <p>I'm trying to match SHA1's in generic text with a regular expression.</p> <p>Ideally I want to avoid matching words. </p> <p>It's safe to say that full SHA1's have a distinctive pattern (they're long and a consistent length) - so I can match these reliably - but what about abbreviated SHA1'...
<p>You can consider the SHA1 hashes to be completely random, so this reduces to a matter of probabilities. The probability that a given digit is not a number is 6/16, or 0.375. The probability that three SHA1 digits are all not numbers is 0.375 ** 3, or 0.0527 (5% ish). At six digits, this reduces again to 0.00278 (0.2...
Any reason to use DataSets with Local Databases with SQL Server CE? <p>Does it make sense to use .NET DataSets even in applications that use a local in-process database for application data persistence?</p> <p>If DataSets are mainly meant for in-memory caching of database results, it sounds like they're not so benefic...
<p>Let me try to answer my own question.</p> <p>It seems to me that DataSets were designed for use-cases such as this:</p> <ol> <li>Data is loaded from a remote DB to an in-memory cache (the DataSet).</li> <li>The cached copy is operated on in non-trivial ways (multiple tables, delete, add, update) without an active ...
Is there a way to automatically sort the using directives alphabetically in Visual Studio 2005? <p>There is <a href="http://msdn.microsoft.com/en-us/library/bb514113.aspx" rel="nofollow">this option</a> available in Visual Studio 2008.</p> <p>Is there a similar option in Visual Studio 2005? Or something else that woul...
<p>If you've got Visual Assist, that's got a 'Sort Selected Lines' command that will do what you need.</p>
How should I refer to Team Foundation Server builds? <p>I am building a release of my project using tfs build which generates a unique identity for the build in tfs build explorer such as "MyProject_20090122.1" indicating that this is the first build on 2009-01-22. However this is my release 1.0.0 of MyProject. Is ther...
<p>You can override the versioning target to supply your own version number. That way you can conform to x.x.x or whatever style you want. Ideally, x.y.x would mean x is major version, y is minor (point release) and z is a unique build number that increments each build. You might also want to check in again the assembl...
ob_get_contents equivalent in asp <p>Working on an old site in asp classic. I want to write a function that returns some html. Right now I'm reduced to writing everything in a string.</p> <p>The downsides are: </p> <ul> <li>I have to escape quotes</li> <li>There is no code completion on the tags nor attributes</li> <...
<p>There is no way to access the Response buffer contents in ASP.</p> <p>When code generating a HTML content string gets ugly I tend to resort to using an MSXML dom document as a place to create the content. Then return the .XML property of the DOM, not effecient but when done properly much more readable.</p> <p>Alt...
Should i use @property for Controller Classes variables? <p>Question is should i use properties for my view controllers?</p> <p>Consider the following case:</p> <ol> <li><p>I have a view controller object in my parent class: MyViewController *myVC;</p></li> <li><p>I don't release this view controller in parent class'...
<p>What Brad Larson said. myVC will leak unless you release it in the owning class' dealloc method. Making it a property will not affect this behavior (and where does the itemEditVC var come from?) The only reason to expose it as a property would be if external classes need access to this variable and you want to ensur...
Free code coverage tools in .NET for personal project <p>I need a free code coverage tools in .NET for personal project. NCover is bit expensive for person use.</p>
<p>Discontinued versions of NCover are still free (and still work quite well, in my opinion). Get them <a href="http://www.ncover.com/download/discontinued" rel="nofollow">here</a>.</p> <p>UPDATE (20th Nov, 2012): I believe <a href="https://github.com/sawilde/opencover" rel="nofollow">OpenCover</a> is now the best opt...
How to get the data in a System.Object <p>I'm using a COM object that has a function called GetImage.</p> <p><a href="http://www.pdf-tools.com/asp/products.asp?name=P2IA" rel="nofollow">http://www.pdf-tools.com/asp/products.asp?name=P2IA</a></p> <p>When I use it in Visual Studio 2008 it returns byte[], but when I use...
<p>There is no data in an instance of Object itself. However since objects inherit from Object they may be referenced by an Object reference. To get data from the instance (assuming there is any) you have to cast the reference to the appropriate type. </p>
ASP.NET: How to hide ListBox control vertical scrollbar? <p>I have tried CSS: overflow: auto. It doesn't work. Any way to achieve it?</p> <p>Do I need to create my custom control as I have seen it on ASP.NET forum?</p>
<p>I would go with creating a custom control like you mentioned.</p> <p>What is your desired goal? Creating your own scrollbar to put in the listbox?</p>
How can I combine multiple rows into a comma-delimited list in Oracle? <p>I have a simple query:</p> <pre><code>select * from countries </code></pre> <p>with the following results:</p> <pre><code>country_name ------------ Albania Andorra Antigua ..... </code></pre> <p>I would like to return the results in one row, ...
<p>The <code>WM_CONCAT</code> function (if included in your database, pre Oracle 11.2) or <code>LISTAGG</code> (starting Oracle 11.2) should do the trick nicely. For example, this gets a comma-delimited list of the table names in your schema:</p> <pre><code>select listagg(table_name, ', ') within group (order by table...
Is it safe to use incremental rebuild for generating release build in visual C++? <p>I sometimes have issues with the incremental rebuild on visual C++ (2003 currently ). Some dependencies does not seem correctly checked and some files aren't build when they should. I suppose thoses issues come from the timestamp appro...
<p>You need a build you distrubute to be recreatable again should users experience problems that need investigating.</p> <p>I would not rely on an incremental build. Also, I would always delete all source from the build machine, and fetch it from scratch from the source control system before building a release. This w...
How to make it so if one copy of a program is running another won't be able to open? <p>How to make it so if one copy of a program is running another won't be able to open?</p> <p>Or better yet, how to make it so that if one copy is already running, then trying to run another copy will just act as if you maximized the...
<p>Scott Hanselman wrote <a href="http://www.hanselman.com/blog/TheWeeklySourceCode31SingleInstanceWinFormsAndMicrosoftVisualBasicdll.aspx" rel="nofollow">a post on doing this sort of thing</a></p>
In Django how do i return the total number of items that are related to a model? <p>In Django how can i return the total number of items (count) that are related to another model, e.g the way stackoverflow does a list of questions then on the side it shows the count on the answers related to that question.</p> <p>This...
<p><a href="http://docs.djangoproject.com/en/dev/ref/models/querysets/#count">QuerySet.count()</a></p> <p>See also an <a href="http://docs.djangoproject.com/en/dev/topics/db/queries/#following-relationships-backward">example</a> how to build QuerySets of related models.</p>
Any Python OLAP/MDX ORM engines? <p>I'm new to the MDX/OLAP and I'm wondering if there is any ORM similar like Django ORM for Python that would support OLAP.</p> <p>I'm a Python/Django developer and if there would be something that would have some level of integration with Django I would be much interested in learning...
<p>Django has some OLAP features that are nearing release.</p> <p>Read <a href="http://www.eflorenzano.com/blog/post/secrets-django-orm/" rel="nofollow">http://www.eflorenzano.com/blog/post/secrets-django-orm/</a></p> <p><a href="http://doughellmann.com/2007/12/30/using-raw-sql-in-django.html" rel="nofollow">http://d...
Installation file names in Windows Vista <p>I read in this article:</p> <p><a href="http://technet.microsoft.com/en-us/library/cc709628.aspx" rel="nofollow">http://technet.microsoft.com/en-us/library/cc709628.aspx</a></p> <p>That Windows detects Installers through file names, following this tip, Is it better to inclu...
<p>This only applies to EXE files. If you've got an MSI file, it's up to the MSI file to specify which parts of the MSI require elevation or not.</p>
How to resolve "Only one project can be specified" error from <msbuild> task in CruiseControl.NET <p>I'm trying to use the task in CruiseControl.NET version 1.3.0.2918 with a rather straight forward :</p> <pre><code> &lt;project name="AppBuilder 1.0 (Debug)"&gt; &lt;workingDirectory&gt;c:\depot\AppBuilder\1.0\&l...
<p>I think maybe it is your space in the artifact directory path. MSBuild really does not like spaces as it considers it a break between arguments. Can you try an remove the space from that path and see what happens?</p>
VerQueryValue Fileversion doesn't match Windows Shell <p>I'm using the <a href="http://www.google.co.uk/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;url=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fms647464(VS.85).aspx&amp;ei=V4N4SbfNGNzFjAfoq4mzAQ&amp;usg=AFQjCNGKeUAmRnuBiua6Y8uBzbkBFRGQxg&amp;sig2=yInI3Sqsq...
<p>Is the lpSubBlock parameter (the 2nd parameter) of VerQueryValue set to the correct value for the locale you're in? For <em>English - United Kingdom</em> this would be:</p> <pre><code>StringFileInfo\080904E4\FileVersion </code></pre> <p><a href="http://techsupt.winbatch.com/TS/T000001050F49.html" rel="nofollow">Th...
How do I move service references to their own assembly? <p>A little background:</p> <p>I'm creating a set of adapters to allow communication with mobile devices over different cellular networks. This will be achieved using a class factory pattern. At least one of the networks requires a service reference to communic...
<p>In the end, I just removed the service reference and added a web reference [i.e. did it the 2.0 way]. For some reason the web reference will access its own app.config instead of the main application's app.config.</p> <p>Far easier than the alternative...</p>
jquery append to front/top of list <p>I have this unordered list</p> <pre><code>&lt;ul&gt; &lt;li&gt;two&lt;/li&gt; &lt;li&gt;three&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>Is there a way I can prepend to the unordered list so that it ends up like this?</p> <pre><code>&lt;ul&gt; &lt;li&gt;ONE&lt;/li&gt; &...
<pre><code>$("ul").prepend("&lt;li&gt;ONE&lt;/li&gt;"); </code></pre>
"Property 'Path' does not have a value" <p>I'm using the following xaml to fill the dataContext:</p> <pre><code>DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" </code></pre> <p>The application works fine, but Cider complains that I must set the Path property. I'm interested in the entire objec...
<p>Have a look at section 2.3.8.7 here (you'll need to scroll down a bit):</p> <p><a href="http://download.microsoft.com/download/A/2/8/A2807F78-C861-4B66-9B31-9205C3F22252/VS2008SP1Readme.htm#Windows%20Presentation%20Foundation%20(WPF)%20Designer%20for%20Visual%20Studio" rel="nofollow">Visual Studio 2008 Service Pack...
Detect closed pipe in redirected console output in .NET applications <p>The .NET <code>Console</code> class and its default <code>TextWriter</code> implementation (available as <code>Console.Out</code> and implicitly in e.g. <code>Console.WriteLine()</code>) does not signal any error when the application is having its ...
<p>To solve this one, I had to write my own basic stream implementation over Win32 file handles. This wasn't terribly difficult, as I didn't need to implement asynchronous support, buffering or seeking.</p> <p>Unfortunately, unsafe code needs to be used, but that generally isn't a problem for console applications that...
problem using an instance in a with_statement <p>I've recently started to learn python , and I reached the <strong>with</strong> statement . I've tried to use it with a class instance , but I think I'm doing something wrong . Here is the code :</p> <pre><code> from __future__ import with_statement import pdb class Ge...
<p>Your <code>__enter__</code> method needs to return the object that should be used for the "<code>as g</code>" part of the with statement. See the <a href="http://docs.python.org/reference/compound_stmts.html#with">documentation</a>, where it states:</p> <ul> <li>If a target was included in the with statement, the ...
Command line (or equivalent) tools for .NET development <p>Spending most of my time in Visual Studio and using all the IDE tools, I wish I could spend more time using either of the following.</p> <ul> <li>The Command Window in Visual Studio</li> <li>CMD.EXE</li> <li><a href="http://en.wikipedia.org/wiki/Cygwin" rel="n...
<p>The most critical PowerShell commands are Get-Command (alias gcm) and Get-Member (alias gm). Those two commands allow you to explore and exploit most of the functionality available. Get-Member is great for interactively exploring and working with .NET objects.</p> <p>The other useful series of commands are:</p> ...
Calling Assembly to get Application Name VB.NET <p>I have a console application (<code>MyProgram.EXE</code>) that references a Utilities assembly.</p> <p>In my Utilities assembly, I have code that does:</p> <pre><code>Dim asm As Assembly = Assembly.GetExecutingAssembly() Dim location As String = asm.Location Dim appN...
<p>Use <code>GetEntryAssembly()</code> instead to get the assembly containing the entry point.</p> <p>The better way to do it is using <code>System.Environment.CommandLine</code> property instead.</p> <p>Specifically:</p> <pre><code>Dim location As String = System.Environment.GetCommandLineArgs()(0) Dim appName As S...
boost::bind with functions that have parameters that are references <p>I noticed that when passing reference parameters to boost bind, those parameters won't act like references. Instead boost creates another copy of the member and the original passed in variable remains unchanged. </p> <p>When I change the reference...
<p>The <a href="http://www.boost.org/doc/libs/1_37_0/libs/bind/bind.html#with_functions">boost documentation for bind</a> suggests that you can use boost::ref and boost::cref for this.</p>
When is it best to change code to match standards? <p>I have recently been put in charge of debugging two different programs which will eventually need to share an XML parsing script, at the minimum. One was written with PureMVC, and another was built from scratch. While it made sence, originally, to write the one fr...
<p>In my opinion this type of refactoring is often not considered in schedules and can only be done when there is extra time.</p> <p>More often than not, the criterion for shipping code is if it works, <strong>not necessarily if it's the best possible code solution</strong>.</p> <p>So in answer to your question, <str...
Using a Function to create an Object in actionscript 3.0 <p>Since actionscript 3.0 is based on ECMAscript it shares some similarities with javascript. One such similarity that I have been playing around with is creating Objects from functions. </p> <p>In javascript to create an object,</p> <pre><code>var student = ne...
<p>Syntactically, this is one area (among many) where the two diverge. ;)</p> <p>You can create an object using a function:</p> <pre><code>private var studentName:String = "Joe"; private function init():void { var s = new Student("Chris"); trace(s.studentName); trace(this.studentName); trace(typeof...
Where can I find code profiling and/or code coverage modules that work with mod_perl2? <p>Is there a way to get this functionality under mod_perl2?</p> <p>And can it be triggered via web requests as opposed to the command line? Or do I need to fake whatever $ENV variables and query strings and cookies that my script ...
<p>Assuming you want to profile your perl code, and not the server itself, the profilers generally do not care if it's mod_perl or mod_perl2, the major difference is in the apache API modules and what you can get apache to do for you using perl.</p> <p>Take a look at <a href="http://metacpan.org/pod/Devel%3a%3aNYTProf...
Main UI windows not updating control -Cross-thread operation not valid <p>Ok..here is the problem</p> <p>I have a main UI form that has a control container that i can add some buttons item to it,and also i have a backgroundworker object that starts up a listner. When the listner events fire, i would like to create a b...
<p>Assuming you moved all UI operations into the RunWorkerCompleted method, it looks like a bug:</p> <p><a href="http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=116930" rel="nofollow">http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=116930</a> <a href="htt...
java.util.logging.Logger doesn't respect java.util.logging.Level? <p>In plain Java SE 6 environment:</p> <pre><code>Logger l = Logger.getLogger("nameless"); l.setLevel(Level.ALL); l.fine("somemessage"); </code></pre> <p>Nothing shows up in Eclipse console. <em>l.info("")</em> and above works just fine, but anything b...
<p>Even though the Logger level is set to ALL, the ConsoleHandler (the default Handler on the logger) still has a default level of INFO. This comes from the default logging.properties in *JAVA_HOME/jre/lib*</p>