input
stringlengths
51
42.3k
output
stringlengths
18
55k
If someone wants to build a web app that handles photos - what language is best? <p>Are there any better web languages for a web app that is designed to handle user-submitted images?</p> <p>Essentially a web app that will accept user submitted pictures and be able to create albums, etc. All the features of a Flickr or...
<p>Just about any language with a good developer community would be a good choice. If you have any programming experience, choose something syntactically similar to what you are already familiar with.</p> <p>If you have no programming experience, run through some tutorials for Rails, Django, and maybe a PHP framework,...
Why is jQuery Ajax so slow on IE7? <p>I am having a problem with jQuery AJAX calls on IE7. This simple code works fine on FF and Opera. But on IE7 it takes 3-5sec. - that's 20 times slower than FF! Loading content is pure HTML and inline JavaScript code. No JS rendering. I even turned of the inline JavaScript code. Bu ...
<blockquote> <p>How to overcome this problem ? Any help would be highly appreciated.</p> </blockquote> <p>Detect IE7 on page load, and provide a discrete suggestion that users who don't like slow loading should upgrade.</p>
Silverlight in aspx page not loading <p>I have developed a simple Silverlight control. I created this by using the Silverlight application project template in VS 2008, adding a test page to my existing website.</p> <p>Now, my control works perfectly in the auto-generated aspx, where I have now got it functioning as re...
<p>You can use Firebug or Internet Explorer's developer toolbar (and Fiddler) to see if the xap file is being requested and the rendered object tag has the proper size. If using the control check for any JavaScript errors.</p>
Error trying to set svn password on Hudson <p>After filling the Repository URL, User name and password I get the following error.</p> <p>Does anyone knows how to fix it?</p> <p>No authentication was attemped. FAILED: svn: Operation cancelled</p> <p>org.tmatesoft.svn.core.SVNCancelException: svn: Operation cancelled ...
<p>See Hudson issue <a href="http://issues.hudson-ci.org/browse/HUDSON-2073" rel="nofollow">2073</a> The Hudson users mailing list would be a better place to get help.</p>
How do you copy a file into SharePoint using a WebService? <p>I am writting a winforms c# 2.0 application that needs to put an XML file into a document library on SharePoint. </p> <p>I want to use a WebService instead of using the object model (no sharepoint.dll to reference here) </p> <p>I am currently using the <...
<p>I know this is an old thread but it kept coming up as I was searching for a solution to the same problem.</p> <p>Check Steve Curran's answer on this thread <a href="http://social.msdn.microsoft.com/Forums/en-SG/sharepointdevelopment/thread/833e38a8-f13c-490d-8ba7-b889b6b25e38">http://social.msdn.microsoft.com/Forum...
I consume a web service on server1 how can i change to server2 if server1 fails (using C#) <p>I want to be able to use server2 if server1 fails, so I have two web references but this leads to an "Ambiguous reference" error because it is the same service on both servers.</p> <p>This is the C# code:</p> <p>using App.or...
<p>I would do something like this</p> <pre><code>public R CallWebservice&lt;T,R&gt;(T service, IEnumerable&lt;string&gt; urls, Func&lt;T,R&gt; serviceCall) where T : SoapHttpClientProtocol, IDisposable { foreach (var url in urls) { try { service.Url = url; return serviceCall...
SQL Server PIVOT help <p>Source table:</p> <pre><code>Create Table ExamAnswers { StudentID varchar(12), QuestionID int, Answer char(1) } </code></pre> <p>and this will be filled with</p> <pre><code>Bob 1 a Bob 2 c ... Bob 100 b Chris 1 c Chris 2 d ... Chris 100 null </code></pre> <p>etc, for about 500 stud...
<p>Look at this article: <a href="http://msdn.microsoft.com/en-us/library/ms177410.aspx" rel="nofollow">Using PIVOT and UNPIVOT</a></p> <p>Quote:</p> <pre><code>The following is annotated syntax for PIVOT. SELECT &lt;non-pivoted column&gt; , [first pivoted column] AS &lt;column name&gt; , [second pivoted c...
How to make the division of 2 ints produce a float instead of another int? <p>In another Bruce Eckels exercise in calculating velocity, <code>v = s / t</code> where s and t are integers. How do I make it so the division cranks out a float?</p> <pre><code>class CalcV { float v; float calcV(int s, int t) { v = ...
<p>Just cast one of the two operands to a float first.</p> <pre><code>v = (float)s / t; </code></pre> <p>The cast has higher precedence than the division, so happens before the division.</p> <p>The other operand will be effectively automatically cast to a float by the compiler because the rules say that if either op...
iis 7 deploying a new build of an existing site <p>I would like to automate the process of deploying a new build of an existing site and allow for me to go back to the previous version of the site easily. Up until this point I have been copying my new build to the production server and placing it into a folder with a...
<p>you could probably use powershell <a href="http://learn.iis.net/page.aspx/161/an-introduction-to-windows-power-shell-and-iis7/" rel="nofollow">Intro to Power Shell for IIS7</a></p> <p>EDIT: <a href="http://learn.iis.net/page.aspx/433/powershell-snap-in-creating-web-sites-web-applications-virtual-directories-and-app...
ASP.NET MVC: How to render a partial view on all but one view? <p>I have a partial view/user control called LogOnUserControl which I display in a side bar on my site (defined in Site.Master). I also have a separate LogOn view, which also renders the LogOnUserControl. </p> <p>I don't want two instances of the LogOnUs...
<p>Have you considered using a different master page for your login View without the login partial in the sidebar? If you are concerned about duplication of html markup you could use nested master pages to avoid that issue.</p>
What is the correct way to clean up when using PyOpenAL? <p>I'm looking at PyOpenAL for some sound needs with Python (obviously). Documentation is sparse (consisting of a demo script, which doesn't work unmodified) but as far as I can tell, there are two layers. Direct wrapping of OpenAL calls and a lightweight 'python...
<pre><code>#relese reference to l b and s del l del b del s #now the WaveBuffer and Source should be destroyed, so we could: pyopenal.quit() </code></pre> <p>Probably de destructor of pyopenal calls <code>quit()</code> before exit so you dont need to call it yourself.</p>
Alternatives to rotating buffers into Players in J2ME? <p>Due to (quite annoying) limitations on many J2ME phones, audio files cannot be played until they are fully downloaded. So, in order to play live streams, I'm forced to download chunks at a time, and construct <code>ByteArrayInputStream</code>s, which I then feed...
<p>The only good way to play long (3 minutes and more) tracks with J2ME JSR135, moderately reliably, on the largest number of handsets out there, is to use a "file://" url when you create the player, or to have the inputstream actually come from a FileConnection.</p> <p>recent blackberry phones can use a ByteArrayInpu...
What attributes should belong to a page and what should belong to a model? <p>Say you have an Events model that contains information about the event. But what about things like slugs, titles and meta description that would go into the html? </p> <p>It would seem like such things properly belong as attributes to a Page...
<p>An Event has some first-class attributes and some "derived" attributes.</p> <p>Let's focus on Django.</p> <p>For example, your model might have a big long title and a derived slug.</p> <p>You can easily define class methods for this derived data.</p> <p>However, in some cases, you need to denormalize your model ...
Does CI need a CI-Server <p>Is a CI server required for continous integration?</p>
<p>In order to facilitate continous integration you need to automate the build, distribution, and deploy processes. Each of these steps is possible without any specialized CI-Server. Coordinating these activities can be done through file notifications and other low level mechanisms; however, a database driven backend...
CPU Cards for Parallel Computation? <p>I remember reading some time ago that there were cpu cards for systems to add additional processing power to do mass parallelization. Anyone have any experience on this and any resources to get looking into the hardware and software aspects of the project? Is this technology inf...
<p>There are two cool options. one is the use of GPU's as Mitch mentions. The other is to get a PS/3, which has a multicore Cell processor.</p> <p>You can also set up multiple inexpensive motherboard PCs and run Linux and Beowulf.</p>
Free/Paid Silverlight Video Players? <p>I'm looking for some nice looking silverlight video players to be used on a website. Similar to this question regarding flash: <a href="http://stackoverflow.com/questions/167072/free-paid-flash-video-players">http://stackoverflow.com/questions/167072/free-paid-flash-video-player...
<ol> <li><a href="http://smf.codeplex.com/releases/view/88970" rel="nofollow">Microsoft Media Platform Player Framework</a></li> <li><a href="http://sl2videoplayer.codeplex.com/" rel="nofollow">Silverlight 2 Video Player on CodePlex</a></li> <li>The ASP.Net MediaPlayer control in the <a href="http://www.microsoft.com/d...
Automatically sorting on insert in QTreeWidget <p>I have a QTreeWidget that I insert items in, and the user can select a column to sort it. As the items are being inserted, they just get appended to the end instead of having the sort being done automatically. If I click the header to switch between ascending/descending...
<p>I don't have a setup for testing but according to the documentation, this should cause sorting to occur as items are inserted.</p> <pre><code>... treeWidget.sortByColumn(0, Qt::AscendingOrder); // column/order to sort by treeWidget.setSortingEnabled(true); // should cause sort on add </code></pre> <p>Q...
How to add value of checked checkbox to textarea using jquery? <p>How can I use jQuery to delete the text in the <code>textarea</code> that gets from the <code>input_one</code> when it not checked (<code>one_1 one_3 one_4</code>) ,and when it checked add it into <code>textarea</code> again?</p> <p>The code is below:</...
<p>You can select <code>checked</code> checkbox using <a href="https://api.jquery.com/checked-selector/" rel="nofollow"><code>:checked</code></a> selector and use <a href="http://api.jquery.com/jquery.map/" rel="nofollow"><code>.map()</code></a> to replace item of checkboxs array with value of it.</p> <pre><code>$("#i...
.NET Default Properties Error <p>I have a VB.NET project where I am able to iterate through the keys and values collections of a dictionary object using an index:</p> <pre><code> MyDictionary.Keys(idx) MyDictionary.Values(idx) </code></pre> <p>When this code is taken from the test project and placed into the real pro...
<p>KeyCollection does not implement indexers like that, you must enumerate through the MyDictionary.Keys. </p> <p>c#</p> <pre><code>foreach(double key in MyDictionary.Keys) Console.Write( MyDictionary[ key ] ) </code></pre> <p>vb</p> <pre><code>For Each key As Double in MyDictionary.Keys Console.Write( MyDictio...
Liquify filter/iwarp <p>I'm trying to build something like the Liquify filter in Photoshop. I've been reading through image distortion code but I'm struggling with finding out what will create similar effects. The closest reference I could find was the iWarp filter in Gimp but the code for that isn't commented at all.<...
<p>Excuse me if I make this sound a little simplistic, I'm not sure how much you know about gfx programming or even what techniques you're using (I'd do it with HLSL myself).</p> <p>The way I would approach this problem is to generate a texture which contains offsets of x/y coordinates in the r/g channels. Then the ou...
Wrapping boost::function with a C++/CLI class event <p>I'm trying to figure out how to wrap a boost::function member (used as an event callback) of an unmanaged class with a C++/CLI class event. I do not have control over the unmanaged class. All I can do is figure out how to write the C++/CLI class properly.</p> <p...
<p>CLI probably won't let you declare a boost::function as a static member. Make it a pointer:</p> <p><code>boost::function&lt;void(double&gt; *XChanged;</code></p> <p>Then allocate/deallocate in the constructor and finalizer and call it with (*XChanged)(arg);</p>
Using .onKeyUp and .onChange with Javascript DOM objects <p>I'm having a weird problem with some Javascript/DOM code I've ben playing with. I'm trying to assign the .onKeyUp and .onChange events/methods to a text input like so:</p> <pre><code>form.elements["article"].onkeyup = "alert('test');"; </code></pre> <p>Oddly...
<p>Try this:</p> <pre><code>form.elements["article"].onkeyup = function() { alert("test"); }; </code></pre> <p>Steve</p>
How can i get primary key value when i insert a new record? <p>I am using LINQ-to-SQL class. It has a method object.InsertOnSubmit() .But it returns void so can i get primary key values after inserting a record.</p> <p>I want the primary key value of recently inserted record.</p>
<p>yes (Assuming it is an identity field).</p> <p>Calling InsertOnSubmit alone doesn't send the insert to the db. You need to call SubmitChanges in order for any changes in the current datacontext instance to be sent to the db. </p> <p>After you have called SubmitChanges, you can access the values from the instance y...
Passing arguments to JavaScript function from code-behind <p>I would like to call a javascript function from an aspx control. For instance, suppose I had:</p> <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;Untitled Page&lt;/title&gt; &lt;script type="text/jav...
<p>Look at the <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.registerstartupscript.aspx">ScriptManager.RegisterStartupScript</a> method if you're using a ScriptManager or any Ajax controls/asynchronous postbacks.</p> <p>Edit:</p> <p>Actually, the function you want is probably <a href="h...
C#: find current process <p>How to get currently running application without using a system process?</p>
<p>It depends on what you look for. If you are interested in the assembly that is calling you,then you can use <a href="http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getcallingassembly.aspx" rel="nofollow">GetCallingAssembly</a>. You could also use <a href="http://msdn.microsoft.com/en-us/library/s...
Flex Bipmapdata and Scrolled Canvas <p>I have a canvas wich is a drawing area. This canvas can be scrolled horizontally and vertically. </p> <p>I am trying to make a screenshot of the <strong>whole canvas</strong>, this include visible and scrolled parts.</p> <pre><code>var bmd:BitmapData = new BitmapData(board.width...
<p>I think your best bet is to nest canvases. One canvas is a fixed size which contains the smaller scrollable area and the other is the full canvas. Something like</p> <pre><code>&lt;mx:Canvas id="boardContainer" width="800" height="600"&gt; &lt;mx:Canvas id="board" width="800" height="1200" /&gt; &lt;/mx:Canvas&gt...
Is there a shorter way to require a file in the same directory in ruby? <p>Is there a shorter way to require a file located in the same directory (as the script being executed)?</p> <pre><code>require File.expand_path(File.dirname(__FILE__) + '/some_other_script') </code></pre> <p>I read that <code>require "my_script...
<p>Since ruby 1.9 you can use <code>require_relative</code>.</p>
Click button and load navigation controller <p>A very simple question: My iPhone app has a button in MainWindow.xib. When I press that button a new view should load. That view will contain a nice navigation controller. How can I do that?</p> <p>All the information I've found is about apps that start directly from a na...
<p>Another way to go about this is to simply hide the navigation bar in your root controller:</p> <pre><code>- (void) viewDidLoad { ... if (![self.navigationController isNavigationBarHidden]) [self.navigationController setNavigationBarHidden:YES animated:NO]; ... } </code></pre> <p>That way, you have a nice...
Google Web Toolkit: RichTextArea installation for PHP application <p>Google Web Toolkit features gwt-RichTextArea, a simple but effective WYSIWYG editor. Now I would like to use this editor in my PHP application but don't know how to implement it. I'm not sure but it seems it's only possible to implement when you're us...
<p>Everything created in GWT is eventually compiled to HTML, javascript, and CSS, so you will be able to use this control even if your app is using PHP. But you will need to know Java to create the initial GWT application with the <code>RichTextToolbar</code> control which can then be compiled to Javascript.</p> <p>Se...
Keeping request parameters on Spring SimpleFormController with Validator <p>I hope I'll be able to explain this properly. I'm developing a portlet for Liferay by using Spring. It's a pinboard system. So I have a view (Jsp) which shows the detail of a certain pinboard entry, given its id. Furthermore there is a link whi...
<p>An even easier solution is to set the renderParameters property. The renderParameters property is an array of parameter names that SimpleFormController will always forward. For example:</p> <pre><code> &lt;bean id="addCommentController" class="..."&gt; .... &lt;property name="renderParameters...
MS SQL Server 2005 - case insensitive password problem <p>I am checking for username and password for login in a procedure in MS SQL SERVER 2005. Since SQL Server 2005 is case insensitive even if user gives a lowercase password instead of a upper case one, the system allows to login.</p> <p>What should I do?? Is there...
<p>Use a case sensitive collation - e.g.</p> <pre><code>...where Password = @password COLLATE SQL_Latin1_General_CP1_CS_AS </code></pre> <p>and yes, you shouldn't really store plain text passwords in the database!</p>
How do I have mod_perl reload source files on change? <p>I am using <code>mod_perl</code> for web development. I do not want to restart <code>mod_perl</code> every time I modify a Perl module.</p> <p>I came across one solution that suggested using the <code>Apache::Reload</code> module and I installed this module from...
<p>I use this solution, from Perrin Harkins via PerlMonks:</p> <p>"Set MaxRequestsPerChild to 1, then load any potentially-changing modules in the <em>child</em>, not the parent (obviously only for development environments). Each request will hit a fresh child server, which will load all of your potentially-changing m...
Passing youtube video id from video feed to flash <p>I'm working on a flash web application (Actionscript 2.0) for my honours project but am having trouble embedding youtube videos. Basically the user selects symbols which queries the youtube api with certain tags depending on the symbols chosenand a random video is th...
<p>What you are getting is not a webpage but an <a href="http://gdata.youtube.com/feeds/api/videos?q=danger%2Bpassion&amp;orderby=published&amp;start-index=1&amp;max-results=1&amp;v=2" rel="nofollow">RSS feed.</a></p> <p>If you just want the youtube video ID you could split the string you get by <code>watch?v=</code> ...
How can i create a link in displaytag? <p>I want to create edit , delete link in display tag with struts2. How can i do so ? If anybody knows please help me ....</p> <p>i am doing this.</p> <pre><code>&lt;display:column property="id" title="ID" href="details.jsp" paramId="id" /&gt; </code></pre> <p>but the link is...
<p>You can write your stuff within the tag like this:</p> <pre><code>&lt;display:table id="row" &gt; &lt;display:column property="id" title="ID" paramId="id" &gt; &lt;a href="details.jsp?${row.id}"&gt;Details&lt;/a&gt; &lt;/display:column&gt; &lt;/display:table&gt; </code></pre>
HTML.Encode localization with ASP.NET MVC <p>How can I escape localized string encoding: </p> <pre><code>&lt;%= Html.Encode("ÆØÅ") %&gt; from rendering &amp;#198;&amp;#216;&amp;#197; </code></pre> <p>is there another way to encode localized strings?</p>
<p>That's being encoded twice - are you using this in a HtmlHelper call?</p> <pre><code>// this will display&amp;#198;&amp;#216;&amp;#197; as Html.TextBox encodes the // value passed to it so it's encoded twice in this line &lt;%=Html.TextBox("sdfsdf", Html.Encode("ÆØÅ"))%&gt;&lt;br /&gt; // this will display ÆØ...
Compress multiple files individually with Gzip <p>I have several directories that look like this:</p> <pre><code>dir1/ |_foo.txt |_bar.txt dir2/ |_qux.txt |_bar.txt </code></pre> <p>For each of this directory I want to compress the files inside it into *.gz format then delete the uncompressed ones. So finally...
<pre><code>gzip */*.txt </code></pre> <p>But the extension for each file will be .txt.gz, as gzip uses it to know the original filename.</p>
How to Insert Data? <p>How i can insert data into more than one table of an Access database which have a join of inner by using C#?</p>
<p>I agree the question is vague but implies the oft asked question for the ACE/Jet engine, "If I can create an <code>INNER JOIN</code> between two tables, can I <code>INSERT</code> into both tables with one SQL statement?" usually closely followed by the qualifier, "...and if there is a <code>FOREIGN KEY</code> (Acces...
How to synchronize SVN revision and version ressources of EXE/DLL files? <p>Say I have some C++ project which builds an exe or dll file. The project is checked into a SVN repository. I want to automatically synchronize the revision from SVN with the version resource embedded in my exe/dll file, i.e. the version should ...
<p>If you have TortoiseSVN installed, then there is a program installed with it, <code>SubWCRev</code>.</p> <p>If, in your file, you have this value:</p> <pre><code>$WCREV$ </code></pre> <p>Then it'll be replaced with the highest committed revision number if you execute something like this:</p> <pre><code>SubWCRev ...
How can I import the sqlite3 module into Python 2.4? <p>The sqlite3 module is included in Python version 2.5+. However, I am stuck with version 2.4. I uploaded the sqlite3 module files, added the directory to sys.path, but I get the following error when I try to import it:</p> <pre><code>Traceback (most recent call la...
<p>I had same problem with CentOS and python 2.4</p> <p>My solution:</p> <pre><code>yum install python-sqlite2 </code></pre> <p>and try following python code</p> <pre><code>try: import sqlite3 except: from pysqlite2 import dbapi2 as sqlite3 </code></pre>
Best practice for renaming property/method names that are reserved words? <p>I'm creating a class. What's the best practice for naming properties/methods when your preferred name is a reserved word?</p>
<p>I usually try to think of some synonymous alternative word, or variation, though it doesn't sound like that is applicable for you.</p> <p>Alternatively, you can use the '@' prefix (in C#) or [square braces] (in VB.NET) to explicitly avoid the conflict with reserved words in the language.</p>
Why is django slow to generate select boxes for foreign keys? <p>I have an admin view which contains four foreign keys each with a few thousand entries. It is slow to appear in the browser. </p> <p>If I change the django model to eliminate the select boxes by adding raw_id_fields things become nice and snappy. So the ...
<p>Transferring huge select lists does take quite a bit of time. The markup can really start to add up. Try checking to see how large in KB/MB your html output is. I remember once seeing a select list (a few 1000 entries) bloat a page up to 5 or so megabytes at a previous job. This was on an ASP.NET project; it doe...
Scala: Is there a way to use PriorityQueue like I would in Java? <p>I have a class that I would like to use in a scala.collection.mutable.PriorityQueue, but I don't want to make it Ordered[A] just for this one purpose. I don't consider the ordering I want to use with respect to the PriorityQueue as the natural orderin...
<p>The syntax</p> <pre><code>class PriorityQueue[A &lt;% Ordered[A]] ... </code></pre> <p>is really just a light sugaring on top of</p> <pre><code>class PriorityQueue[A]()(implicit convert: A =&gt; Ordered[A]) ... </code></pre> <p>This means you can write your own method A => Ordered[A]</p> <pre><code>case class F...
Eziriz Intellilock on Vista 64 bits <p>I'm using Eziriz Intellilock to protect a .NET windows application. The application targets .NET 2.0 and is built with "Any CPU" target. When it's unlocked it works fine in both 32bit and 64bit Vista. However, when I lock it with Eziriz Intellilock, I can only run the locked versi...
<p>Please try the latest version, probably it fixes the problem. It works fine for our "Any CPU" compiled products.</p>
How to get a list of the playlists and songs in an iPhone/iPod Touch? <p>Can I get a list of the playlists and songs in each playlist in an iPhone? This is for a legal app. so hidden APIs/jailbroken solutions don't apply.</p>
<p>You can't do it with the 2.x public APIs, and the 3.x is under a NDA, so it can't be discussed here.</p>
Under UAC, why can't I write a file as an impersonated user? <p>I'm impersonating a user until Windows 2008 with UAC enabled. I'm trying to write some files to a temp directory. But even if a user has write access to a directory, when I impersonate that user, I'm unable to write to that directory (I get an Access Den...
<p>Vista introduced integrity levels in addition to the standard permissions. Perhaps the integrity level your application is running as is lower than that required to write to the location/file. </p> <p>Windows comes with a built in tool "cacls.exe", but I suggest chml from <a href="http://www.minasi.com/apps/" rel="...
ASP.NET MVC unit tests with NUnit <p>I've been trying to learn <a href="http://en.wikipedia.org/wiki/ASP.NET_MVC_Framework" rel="nofollow">ASP.NET MVC</a> using the videos posted on the <a href="http://www.asp.net/learn/mvc-videos/video-421.aspx" rel="nofollow">ASP.NET website</a> and I'm running into a problem doing u...
<p>Copy your connection strings in the <strong>web.config</strong> project to <strong>app.config</strong> in your nunit test project. </p>
What application does google use to show PDF attachments in gmail <p>I watched the traffic when google displays PDF attachments in gmail in a new window. The content is served as PNG images for each PDF page. And its text can be selected. What does google use on server side to generate a PNG file for a particular page ...
<p>By default attachments are viewed securely using https://docs.google.com/gview, however it turns out you are allowed to request files over plain HTTP. This makes it a little bit easier to figure out what is going on using <a href="http://www.wireshark.org/">Wireshark</a>. </p> <p>As you indicated it was already cle...
(id) vs. (NSSomeObject *) in Objective-C/Cocoa? <p>Is it better practice to use id or NSSomeObject * when possible? I know the compiler can do better checking when it's explicit, but I was just wondering which is better practice.</p> <p>E.g.:</p> <pre><code>- (IBAction)someButton:(id)sender </code></pre> <p>vs.</p> ...
<p>If you use <code>- (IBAction)someButton:(id)sender</code>, you could have an <code>NSNotification</code> or other event call this as a selector. Whereas, in your second case, only an <code>NSButton *</code> will be able to use this method. </p> <p>As to whether allowing multiple object types to call an action is a ...
Fundamental Objective-C question...driving me crazy <p>Its been a long time since I've done any programming. Used to be 'ok' at reading C &amp; C++...never wrote much.</p> <p>I have an extremely simple Class that I want to use to manipulate the contents of an Array (using <code>NSMutableArray</code>). The Array need...
<p>If your array is used throughout the lifetime of your ViewController, you can probably alloc/init the array in the ArrayManagerViewController init (override) method, and call release in a dealloc override.</p> <pre><code>@implementation ArrayManagerViewController - (ArrayManagerViewController *) init { if (sel...
Javascript function hooks <p>EDIT: OK, I believe the following solutions are valid:</p> <ol> <li><p>Use the jQuery AOP plugin. It basically wraps the old function together with the hook into a function sandwich and reassigns it to the old function name. This causes nesting of functions with each new added hook.<br /> ...
<p>Might not be pretty but it seems to work...</p> <pre><code>&lt;script&gt; function A(x) { alert(x); return x; } function B() { alert(123); } function addHook(functionB, functionA, parent) { if (typeof parent == 'undefined') parent = window; for (var i in parent) { if (parent[i] === function...
C#: Convert a UInt16 in string format into an integer(decimal) <p>Here's the problem.</p> <p>I ,for example,have a string "2500".Its converted from byte array into string.I have to convert it to decimal(int).</p> <p>This is what I should get:</p> <pre><code>string : "2500" byte[] : {0x25, 0x00} UInt16 : 0x0025 //not...
<p>Converting from hex string to UInt16 is <code>UInt16.Parse(s, NumberStyles.AllowHexSpecifier)</code>.</p> <p>You'll need to write some code to do the "reversal in two-digit blocks" though. If you have control over the code that generates the string from the byte array, a convenient way to do this would be to build...
Publishing from IDE removes wildcard mapping in IIS7 in classic mode <p>I have an ASP.Net app that I deploy to a IIS 7.0 server in classic mode.</p> <p>I use the publish feature from the Visual Studio IDE. Every time I perform a publish, the wild card mapping is removed. Anyone know how to prevent this?</p> <p>Thanks...
<p>The wildcard mapping is stored in the application's web.config. You could create the mapping and then copy the section from the system.webServer->handlers section into your dev web.config. </p> <p>Or you could use a Web.Deploy project to setup the web.config exactly as it needs to be for deployments.</p>
Dynamic loading of items in Google Reader <p>I've been using <a href="http://www.google.com/reader/" rel="nofollow">Google Reader</a> and want to implement a similar technique to the way they "seem" to late load the content of each post. When you click on one of your subscriptions, you see a series of posts with a snip...
<blockquote> <p>They're doing an AJAX request and inserting the response, thus loading and rendering any images as and when needed.</p> </blockquote> <p>Well, yes, that's what they're doing.</p> <p>So, what's the question exactly? What you're doing with visibility is completely different, and as you yourself ...
Can someone assist in explaining the backtrace output having the term 'stack smash'? <p>plz explain the follwing result of the stack smash after running a programming in which input i gave is much more than the capacity of the charachter array.</p> <pre><code> *** stack smashing detected ***: ./a.out terminated ...
<p>Edit: Just reread the title of your problem. You want to know why it's called a Stack Smash. When you called the function that the array was created in C generated a frame for all of your local variables, arguments to the function and the return address for the function. This frame was made on the stack and is known...
Why does my Falcon script print the date a month ahead instead of today's date? <p>Today is April 25, 2009 which in US format is abbreviated month-day-year, so today is 04-25-09. This line</p> <pre><code>&gt; CurrentTime().toString("%m-%d-%y") </code></pre> <p>should print "04-25-09". Instead it prints "05-25-09". Wh...
<p>I also posted this question on the Falcon <a href="http://groups.google.it/group/falconpl/browse%5Fthread/thread/21525a601a90de4d" rel="nofollow">Google Group</a>. Apparently, this is an issue with Falcon itself and is fixed in version 0.9.1. Version 0.9.1 will be officially released in a week or two according to th...
Terminology - parts of a composite relationship <p>Assume I have a <em>composite</em> relationship, say a Customer having a collection of Orders (and assuming an Order cannot exist without an "owning" Customer.) So, I'm <strong>not</strong> talking about <em>aggregation</em>.</p> <p>What terms are used to describe the...
<p>You want the "has a" relationship; our thing "has a"nother thing attached, as opposed to inheritance of "is a" relationship. You can build fairly robust models around just those two relationships. But.</p> <p>To postulate further, in Topic Maps (since we're talking about meta models) we have a few in-built relation...
How do I match two identical database tables with LINQ? <p>I want to match 2 identical tables:</p> <pre><code>sourceProducts (productName, ProductionDate, ManID, shipper, distributer) CommProducts (productName, ProductionDate, ManID, shipper, distributer) </code></pre> <p>but the number of rows and the record conte...
<p>I would join on <code>ManId</code> and then compare the rest of the values in a where clause:</p> <pre><code>bool productExists = ( from p in mySdb.Products join s in mySdb.SourceProducts on p.ManId equals s.ManId where p.ProductName == s.ProductName &amp;&amp; p.ProductionDate == s.Product...
Does StackOverflow use Lucene for tagged searches? <p>How has SO implemented the tagged search? Is it using Lucene or any other open-source search engine library for tagged searching? </p> <p>What is the best way to search document (PDF, XML, HTML, MS Word) or database?</p>
<p>Searching tags is very different than searching text. A tagged search is searching for an association where questions are all associated with a particular tag. This can be implemented with a full-text engine where the tags are all appended in a single large entry, but a relational database will probably be best in...
I need help with the $(this) context in jQuery <p>I need some help in this code block:</p> <pre><code>options.imgs.click(function() { var allImgs = $("#big img"); $("#big img").each(function(n) { this.index = n; }) animateImage(allImgs); }) }; function animateImage(images)...
<p>As soon as you call your function your "<em>this</em>" variable is changed:</p> <pre><code>function test() { alert(this); // this will be the window object } $('p b').click(function() { alert(this); // this will be the bold element object test(); }); </code></pre> <p>For example, running this against this ...
How do I block people from intentionally re-submitting a form? <p>I'm building a website using Ubuntu, Apache, and Django. I'd like to block people from filling out and submitting a particular form on my site more than once. I know it's pretty much impossible to block a determined user from changing his IP address, del...
<p>If your main concern is to prevent someone writes a script and automatically submit the form many times, you may want to use <a href="http://en.wikipedia.org/wiki/Captcha" rel="nofollow">CAPTCHA</a> with your form.</p>
How to create and use a XML document object properly considering browser compatibility? <p>Now I'm working on a web project. I need to create a XML document object using a given string buffer in JavaScript. I've successfully made it run smoothly on IE, but apparently I need to do some more work to improve its compatibi...
<p><a href="https://developer.mozilla.org/En/DOMParser">DOMParser</a> should work. It is not a standard, but it is supported at least on WebKit (Safari, Chrome, etc), and Gecko (Firefox); I don't know about Opera:</p> <pre><code>var buffer = "&lt;Messages&gt;&lt;Item&gt;aaa&lt;/Item&gt;&lt;Item&gt;bbb&lt;/Item&gt;&lt;...
Reporting Services Chart - Hard Coded Series <p>I am developing an SSRS 2008 report which contains a number of simple charts. On the x axis I have the 12 months of this year - Jan 2009 thru December 2009. On the Y is an integer value ranging from 0 to 100 in increments of 10. I am plotting the number of times an issue ...
<p>Can you use a column / line hybrid chart? If so then add a constant or dynamic target value to the chart:</p> <p>Design the chart. On the Data tab in the Chart Properties dialog box, add a new data value (for example, Target). Set the target value (see the example in Figure 9 on link this uses a constant target val...
OracleDependency not firing event <p>I have an Oracle Connection to a ORACLE 10.2 database and want to listen for changes to a table. The user of the connection was granted the privilege "CHANGE NOTIFICATION".</p> <p>Listening is initialized with the following method:</p> <pre><code>private OracleDependency Subscribe...
<p>Have you run through the trouble shooting in the <a href="http://www.mcs.csueastbay.edu/support/oracle/doc/10.2/appdev.102/b14251/adfns%5Fdcn.htm#BDCHDCFH" rel="nofollow">documentation</a>?</p>
Updating file in a jar throws ZipException <p>I'm trying to update a file in an existing jar (in this example antlr) using the command:</p> <pre><code>jar -uf antlrworks-1.2.3.jar org/antlr/codegen/templates/Java/Java.stg </code></pre> <p>But I get the following message</p> <blockquote> <p>java.util.zip.ZipExcepti...
<p>You're trying to do the right thing, but the jar file is problematic - it's got the same entry twice :( (This is legal for a zip file, but not really helpful - and as you can see, it makes <code>jar</code> complain.)</p> <p>If you run</p> <pre><code>jar tvf antlrworks-1.2.3.jar &gt; contents </code></pre> <p>and ...
Object class override or modify <p>Is it possible to add a method to an object class, and use it on all objects?</p>
<p>In Python attributes are implemented using a dictionary :</p> <pre><code>&gt;&gt;&gt; t = test() &gt;&gt;&gt; t.__dict__["foo"] = "bla" &gt;&gt;&gt; t.foo 'bla' </code></pre> <p>But for "object", it uses a 'dictproxy' as an interface to prevent such assignement :</p> <pre><code>&gt;&gt;&gt; object.__dict__["test"...
How to select .NET framework version running from Excel? <p>How can I specify that Excel uses the .NET framework version 2.0 when running .NET dlls other than adding an excel.exe.config file to the Office Binary folder?</p> <p>Our application runs in Excel and uses VBA which makes calls into managed code in .NET assem...
<p>Another way to configure the runtime version selected for Excel is to change the following registry key:</p> <pre><code>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\Policy\AppPatch\v2.0.50727.00000\excel.exe </code></pre> <p>By default, this key forces Excel to use the 1.1 framework; removing it (or renamin...
sql server 2005: Value truncation <p>My table contains a field password whose size is Varchar(70). But when I enter the hash value of the password which is of size 40 the last few characters are getting truncated. I'm using SQL SERVER 2005. Why is it so??</p>
<p>The only time I've seen this is when you cast to varchar without specifying a length</p> <p>Run this :</p> <pre><code>declare @test varchar(70) set @test = '1111111111222222222233333333334444444444555555555566666666667777777777' select @test select cast(@test as varchar) as CastedWithoutLength, cast(@te...
compile AMR-nb codec with RVCT for WinCE/Window Mobile <p>I'm working on amr speech codec (porting/optimization) I have an arm (for WinCE) optimized version from voiceage and I use it as a reference in performance testing. So far, binary produced with my lib beats the other one by around 20-30%! I use Vs2008 and I have...
<p>Just an update... I compiled gnu binutils with support for arm-pe and arm-elf. convert arm-elf to arm-coff: <strong>objcopy.exe -I elf32-littlearm -O pe-arm-wince-little test.o test.obj</strong></p> <p>Now test.obj contains the same function: int add(int, int); the problem is that ms compiler rejects the test.obj f...
How should I handle Multi-threading in Java? <p>I am working on a practical scenario related with Java;a socket program. The existing system and the expected system are as follows.</p> <p><strong>Existing System</strong> - The system checks that a certain condition is satisfied. If so It will create some message to be...
<p>Consider using <a href="http://java.sun.com/products/jms/" rel="nofollow">Java Message Services (JMS)</a> rather than re-inventing the wheel?</p>
Eclipse IDE: How to zoom in on text? <p>I want the same behaviour Firefox has, when you use the scroll button in the mouse to zoom in and out on the current view. Is there something like it for eclipse?</p>
<p>There is a project from a guy called 'tarlog' that made a plugin for eclipse at this google code site: <a href="http://code.google.com/p/tarlog-plugins/downloads/detail?name=tarlog.eclipse.plugins_1.4.2.jar&amp;can=2&amp;q=">http://code.google.com/p/tarlog-plugins/downloads/detail?name=tarlog.eclipse.plugins_1.4.2.j...
Is extending String class with IsNullOrEmpty confusing? <p>Everyone knows and love String.IsNullOrEmpty(yourString) method.</p> <p>I was wondering if it's going to confuse developers or make code better if we extend String class to have method like this:</p> <pre><code>yourString.IsNullOrEmpty(); </code></pre> <p><s...
<p>If I'm not mistaken, every answer here decries the fact that the extension method can be called on a null instance, and because of this they do not support believe this is a good idea.</p> <p>Let me counter their arguments.</p> <p>I don't believe AT ALL that calling a method on an object that may be null is confus...
SQL server write once column <p>Is there any way to configure a SQL server instance to not permit updates to values inserted in the database?</p> <p>e.g. once inserted, the value is fixed, other columns in that same row may be changed, but that value is only written once.</p>
<p>Write a trigger on update that checks the current column against the new value being inserted and rolls back the transaction if the values differ.</p> <pre><code>create trigger dbo.tr_no_updates on mytable for update as if update(mycolumn) rollback transaction </code></pre>
Python - lines from files - all combinations <p>I have two files - prefix.txt and terms.txt both have about 100 lines. I'd like to write out a third file with the <em>Cartesian product</em> </p> <p><a href="http://en.wikipedia.org/wiki/Join%5F%28SQL%29#Cross%5Fjoin" rel="nofollow">http://en.wikipedia.org/wiki/Join_(S...
<p>You need <code>itertools.product</code>.</p> <pre><code>for prefix, term in itertools.product(open('prefix.txt'), open('terms.txt')): print(prefix.strip() + term.strip()) </code></pre> <p>Print them, or accumulate them, or write them directly. You need the <code>.strip()</code> because of the newline that come...
Error updating JScript IntelliSense with Google Apis hosted jQuery <p>I reference jQuery in my application via: <a href="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js</a>.</p> <p>This generates an error with vs.net: "Erro...
<p>I finally found the answer to this question: </p> <p>Basically, add the following to above your jQuery include:</p> <pre><code>&lt;% /* %&gt;&lt;script type="text/javascript" src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.3.2-vsdoc.js"&gt;&lt;/script&gt;&lt;% */ %&gt; </code></pre> <p>Via: <a href="http://bi...
Jquery getJSON to external PHP page <p>I've been trying to make an ajax request to an external server. I've learned so far that I need to use getJSON to do this because of security reasons ?</p> <p>Now, I can't seem to make a simple call to an external page. I've tried to simplify it down as much as I can but it's sti...
<p>It <em>could</em> be that you haven't got a callback in test.php. Also, <code>json_encode</code> only accepts an array: </p> <pre><code>$results = array("key" =&gt; "value"); echo $_GET['callback'] . '(' . json_encode($results) . ')'; // the callback stuff is only needed if you're requesting from different domains ...
How hard is it to get a Cocoa application to run on Windows? <p>In the <a href="http://en.wikipedia.org/wiki/Cocoa%5F%28API%29">wikipedia article on Cocoa</a> it says:</p> <blockquote> <p>There are also open source implementations of major parts of the Cocoa framework that allows cross-platform (including Microsoft ...
<p>Don't forget:</p> <ol> <li>“Major parts of the Cocoa frameworks” is not the same as “the entirety of the Cocoa frameworks”. Tweetie could be using something that's missing.</li> <li>Tweetie could be (very probably is) using APIs from the non-Cocoa frameworks, such as Core Foundation, Core Services, Core Gra...
How to synthesize sounds? <p>I'd like to produce sounds that would resemble audio from real instruments. The problem is that I have very little clue how to get that.</p> <p>What I know this far from real instruments is that sounds they output are rarely clean. But how to produce such unclean sounds?</p> <p>This far I...
<p>Sound synthesis is a complex topic which requires many years of study to master. </p> <p>It is also not an entirely solved problem, although relatively recent developments (such as physical modelling synthesis) have made progress in imitating real-world instruments.</p> <p>There are a number of options open to you...
Render User control as string template <p>what do you think of rendering user control as a string template, basically an implementation like <a href="http://aspadvice.com/blogs/ssmith/archive/2007/10/19/Render-User-Control-as-String-Template.aspx" rel="nofollow">Irenderable implementation</a> do you guys think it has a...
<p>You could also use this approach to render html for emails or PDF. I've done a lot of hackery to grab my pages and render their output to a string builder so I can convert them or email. </p> <p>I do this when you need a print to pdf for the current page, or email this page and you want to send the html that the us...
Setting up multiple MySQL databases with scalability options <p>I need to set up a MySQL environment that will support adding many unique databases over time (thousands, actually). I assume that at some point I will need to start adding MySQL servers, and would like my environment to be prepared for the case beforehan...
<p>Great question. I know of several companies that have done this (Facebook jumps out as the biggest). None are happy, but alternatives kind of suck, too. </p> <p>More things for you to consider -- what happens when some of these databases or servers fail? What happens when you need to do a cross-database query (and ...
Should I store Enum ID/values in the database or a C# enumeration? <p>Say my database tables have columns like <code>UserType</code>, <code>SalesType</code>, etc.</p> <p>Should I have database tables with <code>UserTypeID</code>, <code>userTypeName</code> or should I just create a C# enumeration?</p>
<p>What's wrong with both? If value's are user-defined or changing, definitely <code>enum</code> will not be suitable.</p> <p>If values are strictly non-changing (such as gender), you can have them as <code>enums</code> for ease of reference in the application and also in the DB as separate table to enforce foreign ke...
What tools to automatically inline CSS style to create email HTML code? <p>When you take a look at <a href="http://www.campaignmonitor.com/css/">http://www.campaignmonitor.com/css/</a> you learn that you need to embed inline styles in your HTML, in order for your email to be read in any mail client.</p> <p>Do you know...
<p>Check the <a href="http://premailer.dialect.ca/">premailer.dialect.ca</a> online converter or this <a href="http://www.peterbe.com/plog/premailer.py">Python script</a> to do it.</p>
Mocking Toolkit using JMockit Expectations <p>I am trying to mock java.awt.Toolkit.beep() using JMockit Expectations. I have the following code in my test case:</p> <pre><code>new Expectations() { Toolkit mock; { mock.beep(); } }.endRecording(); </code></pre> <p>When I run the test case (JUnit 4)...
<p>The default jmock can only mock interface. To mock class, you need to following <a href="http://www.jmock.org/mocking-classes.html" rel="nofollow">these instructions</a></p>
Elixir reflection <p>I define some Entities which works fine; for meta programming issues. I now need to reflect the field properties defined in the model.</p> <p>For example:</p> <pre><code>class Foo(Entity): bar = OneToMany('Bar') baz = ManyToMany('Baz') </code></pre> <p>Which type of relation is set: ...
<p>You can do introspection in Elixir as you would anywhere in Python -- get all names of attributes of <code>class Foo</code> with <code>dir(Foo)</code>, extract an attribute given its name with <code>getattr(Foo, thename)</code>, check the type of the attribute with <code>type(theattr)</code> or <code>isinstance</cod...
RegularExpressionValidator doesn't detect empty strings <p>I have the following regex set as the <code>ValidationExpression</code> property on a RegularExpressionValidator in a web form. When I enter an illegal character in the validated control, the validator detects it and shows an error message. </p> <pre><code>&...
<p>It is by design. You should also add a <code>RequiredFieldValidator</code> to force user entry. <code>RegularExpressionValidator</code> assumes empty fields as valid (and doesn't even run them through <code>Regex</code>). The reason behind this is that for instance, you might have an optional <code>Email address 2</...
WPF custom error-handling dialog box? <p>I am trying to set up my WPF application so that when an exception goes unhandled, an error dialog pops up. In good ol' WinForms this was possible by adding</p> <pre><code>Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadExceptio...
<p>You'll need to set Handled to true in the EventArgs.</p>
How can I include break lines in mysql records? <p>When someone types in the following to be put into a database:</p> <pre><code>Hello, My name is John and I am 22, and looking for a good time. My Phone Number is: 555-NOT-REAL Sincerely, John D. </code></pre> <p>I want the break lines to stay there, but it seems t...
<p>If you are displaying the text in the browser, you <em>have</em> to put HTML tags in. Browsers do not automatically put linebreaks for you. This is most commonly done with the <a href="http://www.php.net/nl2br" rel="nofollow"><code>nl2br</code></a> function:</p> <pre><code>nl2br($message); </code></pre> <p>However...
Where is the documentation for the standard ASP.NET MVC ModelBinder? <p>I don't seem to be able to find any authoritative, up-to-date (i.e. for 1.0 final) documentation for the capabilities of the standard model-binder in ASP.NET MVC, particularly with respect to binding complex objects involving collections (and the n...
<p>For binding complex objects involving collections, check out <a href="http://stackoverflow.com/questions/711184/asp-net-mvc-example-of-editing-multiple-child-records/712817#712817">my answer</a> to <a href="http://stackoverflow.com/questions/711184/asp-net-mvc-example-of-editing-multiple-child-records">this question...
More Elegant Exception Handling Than Multiple Catch Blocks? <p>Using C#, is there a better way to handle multiple types of exceptions rather than a bunch of ugly catch blocks?</p> <p>What is considered best practice for this type of situation?</p> <p>For example:</p> <pre><code>try { // Many types of exceptions ...
<p>In my opinion, a bunch of "ugly" catch blocks IS the best way to handle that situation.</p> <p>The reason I prefer this is that it is very explicit. You are explicitly stating which exceptions you want to handle, and how they should be handled. Other forms of trying to merge handling into more concise forms lose ...
Complex iPhone tableviews, where's the trick? <p>I was wondering how do people fill a tableview like the one in Safari's preferences, in the iPhone simulator.</p> <p>I guess I have a tableview controller and then I add controls programmatically? (one by one!?) Is there any trick I'm missing? If I use a resource list o...
<p>Safari's iPhone preferences is a grouped table view with multiple custom table cell classes-- it looks like at least three different types. Some of them might just be standard cells with text and an accessory view. You create custom table cells by subclassing UITableViewCell. In your implementation of –tableVie...
Website --> Add Reference also creates files with pdb extensions <p><br></p> <p>Q1 Any assemblies stored in Bin directory will automatically be referenced by web application. We can add assembly reference via <em>Website --> Add Reference</em> or simply by copying dll into Bin folder. But I noticed that when we add re...
<ol> <li>PDB is used to give you line numbers in stack trace. It's always optional</li> <li>No. You need to specifically reference from each project.</li> </ol>
What is ec2-authorize? <p>I am new to EC2 and am trying to get it set up so that I can publish directly to it from VS2008. Everyone keeps mentioning using "ec2-authorize" to enable certain things, but what the heck is this? Nowhere seems to explain what it is or where it's accessed from. I tried it from a command line ...
<p>What are you trying to do exactly? Manage large number of instances or just publish/deploy new code to one instance?</p> <p><a href="http://docs.amazonwebservices.com/AWSEC2/2009-03-01/DeveloperGuide/index.html?CLTRG-authorize.html" rel="nofollow">ec2-authorize</a> is a simple command to control firewall rules rela...
Java jogl applet paint not working? <p>My jogl applet screen is blank. I have this for my paint code:</p> <pre><code> public void paint(Graphics g){ canvas.update(g); } </code></pre> <p>if I add g.fillRect(0,0,50,50); to it it'll draw the filled rect, but still not the jogl stuff.</p>
<p>I'm not exactly clear what the rest of your program looks like. However you should be aware that JOGL components don't draw like other components; in other words if this code is on an instance of GLAutoDrawable (i.e. GLJPanel or GLCanvas) then it won't do anything useful.</p> <p>What you need to do is create a GLEv...
Microsoft Entity Framework <p>I'm not sure if this question is appropriate for SO, but I'm sure a few people here have been through it:</p> <p>I'm trying to follow the MVC tutorials on the ASP.NET website and there's a point at which it has you add an ADO.NET entity to the project, but for some reason, it doesn't appe...
<p>The Entity Data Source appears on the Toolbox, in the Data section. </p> <p>Here's some helpful information from <a href="http://blogs.msdn.com/adonet/archive/2008/05/14/can-t-find-the-entity-data-source.aspx" rel="nofollow">an MSDN blog</a> for people who can't see the item in the Toolbox:</p> <p><strong>Can't fi...
how to validate dates in asp.net <p>I have been having this issue with dates since "ever"</p> <p>I live in a country where we use the british date formats e.g. dd/mm/yyyy but everytime I try to do a query to a sql db hosted in a US server, 100% of the time I come accross to errors. </p> <p><code>Convert.ToDateTime("2...
<p>Use <a href="http://msdn.microsoft.com/en-us/library/ms131044.aspx" rel="nofollow">DateTime.TryParseExact</a> and give some format, that represent your date string</p>
Java bytecode equivalents for ilasm / ildasm <p>For CIL / MSIL, I can write the code in a text editor and compile / decompile with ilasm / ildasm.</p> <p>I can use Reflector to see the CIL generated by a .NET class.</p> <p>In the Java world, javap -c shows the disassembled byte code.</p> <p>How do I compile Java byt...
<p><a href="http://asm.ow2.org/eclipse/index.html">Bytecode Outline plugin for Eclipse</a></p> <p>to play with bytecode you can use ASM or <a href="http://jakarta.apache.org/bcel/manual.html">BCEL</a></p> <p>Take a look at org.apache.bcel.util.BCELifier, it takes a given class and converts it to a BCEL program (in Ja...
Unable to get Google definitions to Standard Output <p>I aim to filter my Google results right at terminal such that I get only Google's definitions.</p> <p>I am trying to run the following in Mac's terminal</p> <pre><code>open http://www.google.com/search?q=define:cars&amp;ie=utf-8&amp;oe=utf-8:en-GB:official&amp;cl...
<p>To use Google search not through their web interface, you're almost certainly better off using their <a href="http://code.google.com/apis/ajaxsearch/" rel="nofollow">API</a>.</p> <p>However, I think <code>curl</code> is the right tool to use to download a web page if that's what you have to do (and it probably isn'...
Easy to implement .net library for geocoding using a free service? <p>I need to geocode adresses (get lat/long from addresses) using in .Net, to store in the database.</p> <p>What is the library/project to look into, to get that done? </p> <p>After a search here, on google and <a href="http://www.codeplex.com/site/se...
<p>Check out <a href="https://github.com/chadly/Geocoding.net" rel="nofollow">GeoCoding.Net</a> - generic geocoding API for Google, Yahoo, and Bing</p>
CSS Positioning and Display Order <p>I have a block of HTML:</p> <pre><code>&lt;ul&gt; &lt;li&gt;a&lt;/li&gt; &lt;li&gt;b&lt;/li&gt; &lt;li class="nav"&gt;c&lt;/li&gt; &lt;li class="nav"&gt;d&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>and a CSS ruleset:</p> <pre><code>ul li { display: inline; } li.nav { floa...
<p>Well, the obvious quick fix is to just reverse the order of the elements in the list:</p> <pre><code>&lt;ul&gt; &lt;li&gt;a&lt;/li&gt; &lt;li&gt;b&lt;/li&gt; &lt;li class="nav"&gt;d&lt;/li&gt; &lt;li class="nav"&gt;c&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>I'm guessing what happens is that whenever the ren...
ant: list folders on command line <p>I'm new to ant. I'm looking to a way to do this</p> <p>I have a folder, with a variable number of subfolders. Suppose subfolders are s1,s2,s3...,sN (N is not known)</p> <p>I need to create and execute this command line</p> <p>java -jar myjar.jar s1\ s2\ s3\ ... sN\</p> <p>I woul...
<p>I think the 'fileset' type is what you're looking for:</p> <p><a href="http://ant.apache.org/manual/Types/fileset.html" rel="nofollow">http://ant.apache.org/manual/Types/fileset.html</a></p> <p>The 'jar' task can work with implicit filesets, or you can define custom filesets within the jar task.</p> <p><a href="h...
Unable to import a file to your .emacs <p><strong>How can you import a new chunk of <a href="http://edward.oconnor.cx/elisp/google.el" rel="nofollow">code</a> (an Emacs lisp library) into your <code>.emacs</code> file?</strong> </p> <p>I do not want to put everything into one huge <code>.emacs</code> file.</p>
<p>Put the file <code>google.el</code> in a directory, say <code>~/lisp</code>, and then in your .emacs:</p> <pre><code>(add-to-list 'load-path "~/lisp") (require 'google) </code></pre> <p>If you want to add a directory and its sub-directories, you can check out the <a href="http://stackoverflow.com/questions/221365/...