input
stringlengths
51
42.3k
output
stringlengths
18
55k
Hide a DIV [Rails] <p>Hiding a DIV would be easy enough in Javascript, but is there some Rails-y way to do it? I can think of some ways to do it by calling Javascript from a partial (.erb), of course, but I'd prefer not to write any Javascript at all. Possible?</p> <p><strong>Edit:</strong> The page is loaded and I wo...
<p>Or, right in your view:</p> <p>For a class-specified div: </p> <pre><code>&lt;%= link_to_function "Toggle", "$('.some_div').toggle()" %&gt; </code></pre> <p>For an ID-specified div: </p> <pre><code>&lt;%= link_to_function "Toggle", "$('#some_div').toggle()" %&gt; </code></pre> <p>(notice the hash-mark)</p> ...
Rails inline Javascript and Best Practices <p>I'm <em>kinda</em> new to using Rails, and an app I am working on is progressing well - however I'm looking though the generated HTML and noticed things like...</p> <pre><code>&lt;script type="text/javascript"&gt; //&lt;![CDATA[ Droppables.add(...); //]]&gt; &lt;/script&gt...
<p>Well if you really want to use best practices...Do not use inline javascript. Keep your HTML, CSS and Javascript clean and seperated from eachother. Ideally the html file should be usable without CSS and javascript.</p> <p>The cleanest way, imo, is to just build your app using plain html/css, and enhance it with un...
How to Set User-Agents in an HttpRequest (Unit Testing) <p>I've got a method that takes in an HttpRequest object and performs differently based on what User Agent is set. I'm trying to unit test it and am having a heck of a time tracking down how to set the User Agent string. I've tried the raw HttpRequest object and...
<p>You can set the UserAgent property on an HttpWebRequest, are you able to use that type instead?</p>
In ASP.NET MVC, preserve URL when return RedirectToAction <p>I have an action method, and depending on what is passed to it, I want to redirect to another action in another controller. The action and controller names are determined at run time. </p> <p>If I return RedirectToAction(), it will force a redirect and cha...
<p>You should be able to just call the other method directly and, assuming that it returns a ViewResult, it will render that view in response to the request and the url will not change. Note, you'll be responsible for making sure that all of the data that the other method needs is available to it. For example if your...
Difference between div id versus div class <p>What's the difference between <code>&lt;div class=""&gt;</code> and <code>&lt;div id=""&gt;</code> when it comes to CSS? Is it right to use <code>&lt;div id=""&gt;</code>?</p> <p>I see different developers doing this in both ways, and since I'm self taught, I've never rea...
<p><code>ids</code> must be unique where as <code>class</code> can be applied to many things. In CSS, <code>id</code>s look like <code>#elementID</code> and <code>class</code> elements look like <code>.someClass</code></p> <p>In general, use <code>id</code> whenever you want to refer to a specific element and <code>cl...
Are there reasons to still use the "@import" css rule? <p>I recently came across a use of the @import rule on Coda.com. They're actually using to import the main style sheet for the site, specifically the format:</p> <pre><code>&lt;style type="text/css" media="screen"&gt; @import url(./coda.css); &lt;/style&gt; </co...
<p>None. Using a <code>&lt;link&gt;</code> element also has the advantage of getting rid of the <a href="http://bluerobot.com/web/css/fouc.asp/" rel="nofollow">FOUC</a>.</p> <p><strong>EDIT</strong>: Using <code>@import</code> in another stylesheet (<code>.css</code> file) can be used like an <code>#include</code> in ...
XAMPP shows error for .exe from non-local domains <p>In FireFox3 when I go to URL's such as:</p> <p><a href="http://download.microsoft.com/download/4/A/A/4AA524C6-239D-47FF-860B-5B397199CBF8/windows-kb890830-v2.7.exe" rel="nofollow">http://download.microsoft.com/download/4/A/A/4AA524C6-239D-47FF-860B-5B397199CBF8/wind...
<p>This issue was caused by a root kit.</p>
Does visibility affect DOM manipulation performance? <p>IE7/Windows XP</p> <p>I have a third party component in my page that does a lot of DOM manipulation to adjust itself each time the browser window is resized.</p> <p>Unfortunately I have little control of what it does internally and I have optimized everything el...
<p>Caveat: I have not specifically tested this with IE7, but I am reasonably confident based on what I know about its DOM manipulation model.</p> <p>Changing CSS properties (whether <code>display: none</code> or <code>visibility: hidden</code> or what-have-you) will not affect the performance of DOM manipulation in an...
Sharepoint 2007 document management <p>We are developing a document management solution with Sharepoint 2007 and I'm having some issues figuring out a couple items with the structure. The documents are templates that are used to merge data into letters sent to clients. While the templates will be managed in Sharepoin...
<p>Aaak. You can create a field based on a lookup of information on the BDC. You can also create a lookup based on a list in SharePoint.</p>
Linking to Boost.Signals using Xcode <p>I can't for the life of me get Xcode to link to Boost.Signals properly. I've built Boost using MacPorts, and I even went as far as downloading Boost myself and manually building it.</p> <p>I've set the Library Search Paths to include /opt/local/lib, and I've added "-lboost_signa...
<p>Check the target architecture in your Xcode project. It looks like you're trying to compile a universal binary. Unless you explicitly ask for it, boost will be built for the architecture of the build machine only.</p>
C++ wrappers for ncurses? <p>Can anyone recommend a C++ wrapper for ncurses?</p>
<p>ncurses itself includes a set of C++ bindings. I don't know if any of the major distributions include the C++ bindings but if you get the <a href="http://ftp.gnu.org/pub/gnu/ncurses/">ncurses source</a> you will find them in the c++ directory.</p> <p>I don't know if I would necessarily recommend them but they are p...
Best way to change the value of an element in C# <p>I'm trying to look at the best way of changing the value of an element in XML.</p> <pre><code>&lt;MyXmlType&gt; &lt;MyXmlElement&gt;Value&lt;/MyXmlElement&gt; &lt;/MyXmlType&gt; </code></pre> <p>What is the easiest and/or best way to change "Value" in C#?</p> <p...
<p>You could use the System.Xml.Linq namespace stuff for the easiest to read code. This will load the full file into memory. </p> <pre><code>XDocument xdoc = XDocument.Load("file.xml"); var element = xdoc.Elements("MyXmlElement").Single(); element.Value = "foo"; xdoc.Save("file.xml"); </code></pre>
Are there any software guarantees in critical systems? <p>Are there systems or is there software out there that is developed with a proof of correctness to back it up? Or are all critical systems developed merely with an aggressive code review and test cycle?</p>
<p>See <a href="http://www.fastcompany.com/magazine/06/writestuff.html" rel="nofollow"><strong>They Write The Right Stuff</strong></a> for an interesting look at how they develop software for the Space Shuttle. </p> <p>Excerpt: </p> <blockquote> <p>But how much work the software does is not what makes it remarkab...
Detecting honest web crawlers <p>I would like to detect (on the server side) which requests are from bots. I don't care about malicious bots at this point, just the ones that are playing nice. I've seen a few approaches that mostly involve matching the user agent string against keywords like 'bot'. But that seems aw...
<p>You said matching the user agent on ‘bot’ may be awkward, but we’ve found it to be a pretty good match. Our studies have shown that it will cover about 98% of the hits you receive. We also haven’t come across any false positive matches yet either. If you want to raise this up to 99.9% you can include a few o...
Spring embedded ldap server in unit tests <p>I am currently trying to use an embedded ldap server for unit tests.</p> <p>In Spring Security, you can quickly define an embedded ldap server for testing with the tag with some sample data loaded from the specified ldif.</p> <p>I will be using Spring Ldap to perform ldap...
<p>Doesn't Spring LDAP provide transactional control around LDAP operations? If so, why not use Spring test framework with its auto-rollback capability? </p> <p>I also know of a JDBC-LDAP bridge driver that wraps an LDAP repository, presenting it as a relational database. I've used iBatis to connect to this (I've writ...
How can I view Flash Source Code? <p>I found a Flash program online that would be perfect for a project I'm working on. Obviously with web content you can usually just use your browser to view the source code of whatever HTML, PHP, etc that you may be looking at. But when it comes to Flash it seems we're left in the da...
<p>There's no source code in a .swf - that's the compiled product. The source code is in the .fla. </p>
Regular expression that returns a constant value as part of a match <p>I have a regular expression to match 2 different number formats: <i>\=(?[0-9]+)\?|\+(?[0-9]+)\?</i></p> <p>This should return 9876543 as its Value for <i>;1234567890123456?+1234567890123456789012345123=9876543?</i><br> and <i>;1234567890123456?+987...
<p>Another option, which is not quite the solution you wanted, but saves you using two separate regexes, is to use named groups, if your implementation supports it.</p> <p>Here is some C#:</p> <pre><code>var regex = new Regex(@"\=(?&lt;Long&gt;[0-9]+)\?|\+(?&lt;Short&gt;[0-9]+)\?"); string test1 = ";1234567890123456?...
Custom .ttf fonts to use in C# windows.Form <p>How do I use a custom .tff font file I have with my current windows.forms application? I read some where that I use it as an embedded resource, but how do I set it the System.Drawing.Font type?</p>
<p>This article: <a href="http://www.bobpowell.net/embedfonts.htm" rel="nofollow">How to embed a true type font</a> shows how to do what you ask in .NET.</p> <p><strong>How to embed a True Type font</strong></p> <blockquote> <p>Some applications, for reasons of esthetics or a required visual style, will embed cer...
How do I test localization in a winforms application? <p>Is there a way to test different languages in a Windows application without changing the localization of the OS or adding code to the application to forcibly change the current culture?</p> <p>Perhaps some type of a launcher that will launch the application with...
<p>There is this <a href="http://www.microsoft.com/globaldev/tools/apploc.mspx" rel="nofollow">AppLocale</a> Utility for XP, which can also be installed on <a href="http://www.mydigitallife.info/2007/05/26/workaround-to-install-microsoft-applocale-utility-in-windows-vista/" rel="nofollow">vista</a>.</p> <p>AppLocale a...
Flex with PHP <p>I'm new to Flex and done a few application with only client side programming. Now I'm trying to do the back-end stuff using PHP. Can some one explain where(which folder) to put the PHP file for the Flex file to communicate with PHP. I'm using Flexbuilder 3 IDE.</p> <p>Thanks</p>
<p>Flex will not access your PHP script via the filesystem, you have to invoke your PHP script via a web server. The easiest solution is to use XML as in your data transport language. But you can get fancy and use something like BlazeDS</p>
Making cut/replace methods with JTextArea <p>I am to make a cut and a replace method on JTextArea. I have the code for copy and paste, and I reckon I could just use that, in addition to just deleting the marked text in the JTA.</p> <p>How would the code for a code for cut and replace methods look like?</p> <p>The cod...
<p>JTextArea supports cut/copy/paste by default using keyword combination (Ctrl+C etc). If you want to have custom invocations (like menu action), JTextComponent itself provides cut/copy/paste methods which you can re-use.</p>
How to select multiple records (row) from a column in mysql? <p>I want to display four (4) items'name from these id: Can I do like this?</p> <pre><code>SELECT item_name from items WHERE item_id IN ('001', '012', '103', '500') </code></pre> <p>or</p> <pre><code>SELECT item_name from items WHERE item_id = '001' or ite...
<p>You can do either one, but the IN query is much more efficient for this purpose for any large queries. I did some simple testing long ago that revealed it's about 10 times faster to use the IN construct for this. If you're asking if the syntax is correct then yes, it looks fine, other than missing semi-colons to com...
Need TwinView Help with NVidia <p>I am trying to set up dual monitors on ubuntu 8.10 and am having a lot of difficulty. I have tried going through many tutorials with no luck so I figure I will try here as well.</p> <p>For some reason my computer does not detect my Dell S199WFP monitor. It only lets me run it at maxim...
<p>I use an old CRT View Sonic monitor as Screen0 and a LCD Samsung 720p TV as Screen1. It used to work "out of the box" with my "old" Nvidia drivers, but now the resolution in the Screen0 kept going automatically to 640x480, even tough my monitor supports 1024x768; Option "metamodes" was not solving the problem, and t...
How to set Row Filter for Dataview to filter rows according to valu of column? <p>Hii, I am using DataView control to bind a gridview. In dataview data is coming from a table 'cloneUserEntry'. cloneUserEntry table contains a column 'Visibility' whose value is true or false (boolean type). I want to display rows whose v...
<p>Try removing the # characters from the filter statement, i.e., <code>"Visibility = true"</code> instead of <code>"Visibility = #true#"</code>. The # are used when filtering using DateTime objects.</p>
Is there any algorithm for search an element in sorted array with complexity less than log2(n) <p>i have coded an algorithm for search in sorted array with complexity log2(n)/5 .Is it useful?</p>
<p>It is provable that you can't get lower than O(log(n)) for a search that assumes only compare operations. a complexity of log2(n)/5 is the same thing as O(log(n)).<br /> Usefulness depends on what you use it for.</p>
Programtically Reloading a C# Project <p>HI</p> <p>Does anyone know if its is possible to programatically reload a C# project , in one of my previous <a href="http://stackoverflow.com/questions/510295/auto-include-files-in-a-c-project">questions</a> i needed to add all the CS files in a specific folder , now while thi...
<p>I assume, for the first time when you output all the DAL files, you are also creating a file with extension .csproj listing in it, all the files you just added in the folder.</p> <p><strong><em>If my assumption above is right</em>:</strong> When you want to add more files, you can programatically edit the same .csp...
Looking for commercial UI rich controls for ASP.NET MVC <p>I'm looking for a commercial suite of rich UI controls for ASP.NET MVC. (<em>commercial</em> suites, I know jQuery has a lot of free stuff) This means no postbacks. And preferably built with jQuery.</p> <p>some webform examples: <a href="http://www.infragistic...
<p><a href="http://www.telerik.com/products/aspnet-ajax.aspx" rel="nofollow">Telerik RadControls</a> for ASP .NET <a href="http://blogs.telerik.com/AtanasKorchev/Posts/08-11-06/ASP_NET_Ajax_Controls_in_ASP_NET_MVC.aspx" rel="nofollow">has support for ASP .NET MVC</a>.</p>
Advice on moving to a multi tier Delphi architecture <p>We have a relatively large application that is strongly tied into Firebird (stored procedures, views etc). We are now getting a lot of requests to support additional databases and we would also like to move a lot of the functionality from the client to the server....
<p>I can recommend using the KBM Middleware components from Components4Developers. There is a bit of a learning curve but they are very flexible and hold up well under use in real world conditions.</p> <p><A HRef="http://www.components4programmers.com/usercomments/commentfromapowerusertoaquestion.htm" rel="nofollow">C...
Getting WM/Picture using C# and WM Encoder SDK <p>I was hoping someone could help point me in the right direction and/or provide a sample for me to look at. I need to get the WM/Picture field inside a WMA file that I decode using WM Encoder and C#. I have been able to get all the other tags fine, but media.getAttribu...
<p>program chat voice with c#</p>
How to set the UIImageView's position relative to sibling views <p>How to set the UIImageView's <s>layer</s> position relative to sibling views?</p> <p>I mean like the swapDepths() / setChildIndex() in flash</p> <p>many thanks for reading</p>
<p>It would be useful to describe what you are attempting in absolute terms, not by referring to another framework people may not be familiar with (particularly since "Layer" has its own special meaning in Cocoa.</p> <p>If by "layer" you mean its position relative to sibling views then you can use the following functi...
C#: Anonymous types and property names <p>Is there any difference at all between this:</p> <pre><code>dataContext.People.Select(ø =&gt; new { Name = ø.Name, }); </code></pre> <p>and this:</p> <pre><code>dataContext.People.Select(ø =&gt; new { ø.Name, }); </code></pre> <p>?</p>
<p>They are identical; if no name is specified (and the right-hand-side is a simple member-access) then the name of the existing member is assumed. The name is only necessary to:</p> <ul> <li>change the name to something <em>else</em> (for example <code>Name = grp.Key</code>)</li> <li>to give a name to a non-member-ac...
Does the ClientScriptmanager work when called in a partial postback? <p>I would like to close the browser window when an ASP.NET operation has succeeded. The code below is triggered by a button that resides in an Ajax UpdatePanel.</p> <pre><code>Page.ClientScript.RegisterClientScriptBlock(typeof(LeaveApproval), "ShowS...
<p><a href="http://www.gotjeep.net/Blogs/CommentView,guid,4be2f278-12e4-40d5-b154-0e8ecaf18fac.aspx" rel="nofollow">This link</a> by Scott Klueppel helped me solve the problem... </p> <p>Rather use...</p> <pre><code>ScriptManager.RegisterStartupScript </code></pre> <p>instead of </p> <pre><code>Page.ClientScript.Re...
Weird Bug: "DoCmd.OutputTo acOutputQuery" is deleting the query <p>I'm encountering a problem where <code>DoCmd.OutputTo acOutputQuery</code> deletes the query itself the second time it is run.</p> <p>Is there any workaround/patch for this bug (at least seems like a bug to me)?</p>
<p>I think the behaviour you described "...deletes the query itself, the second time it is run" occurs when the query returns no records.</p>
How would you query an array of 1's and 0's chars from a database? <p>Say you had a long array of chars that are either 1 or 0, kind of like a bitvector, but on a database column. How would you query to know what values are set/no set? Say you need to know if the char 500 and char 1500 are "true" or not.</p>
<pre><code>SELECT Id FROM BitVectorTable WHERE SUBSTRING(BitVector, 500, 1) = '1' AND SUBSTRING(BitVector, 1000, 1) = '1' </code></pre> <p>No index can be used for this kind of query, though. When you have many rows, this will get slow very quickly.</p> <p>Edit: On SQL Server at least, all built-in string fun...
JavaScript drag and drop photo resizer cropper <p>I have an image of arbitrary size on the page. As an output I need an image of a fixed size, say <em>90x120px</em>. I would like the user to chose the area of the image by drag-and-dropping the big image behind the <em>90x120px</em> 'window'. The window would specify th...
<p>For cropping, use <a href="http://jquery.com/">jQuery</a> and <a href="http://deepliquid.com/content/Jcrop.html">Jcrop</a>.</p>
How to force a Silverlight container to expand/contract to the size of its child controls? <p>I've got a root UserControl that is 300 high.</p> <p>Inside that I have a Border that I want to expand to the size of its own controls, so if I stack in more controls, it will expand -- less controls, it will contract.</p> <...
<p>Wrap it in a StackPanel should do it:</p> <pre><code>&lt;UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:basics="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="400" Height="300"&...
ADO.NET - What is best practice for getting datareader values? <p>Just wondering what is best practice for getting the values of a datareader. For example:</p> <p>I have been doing this:</p> <pre><code>MyValue = Dr("ColumnName") </code></pre> <p>But have noticed other people doing:</p> <pre><code>MyValue = Dr.GetSt...
<p>The DbDataReader.GetString(int) method can only be used if you know the index of the column. Using DbDataReader.GetString("ColumnName") is not possible as there is no such overload. I.e. you have the following two options:</p> <pre><code> string myValue1 = (string) Dr["ColumnName"]; string myValue2 = Dr.GetStrin...
Ajax onSuccess callback while not having any control over ajax calls <p>I have a simple JS function that needs to get called when AJAX call succeeds, however i don't have any control over the AJAX calls since the framework (DNN5) handles all that.</p> <p>How do i call my function on AJAX success?</p> <p>I use DNN5 an...
<p>I'm not familiar with DNN5, but am with UpdatePanels. Can you hook into the Client events of an async postback in ASP.NET AJAX i.e. add an eventhandler to the PageRequestManager endRequest event.</p> <p>As an example,</p> <pre><code> var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_endRequest(E...
How to use Drupal 6 views and panels arguments together? <p>I need to acheive the following layout/setup for a section of my website:</p> <p>Using the following panels layout:</p> <p><strong>Top column spanning full width</strong> containing:<br /> - a view (prob themed using jquery cycle) of images relating to curre...
<p>You're probably better off ditching panels and just making a block yourself to display the top panel. The <a href="http://drupal.org/project/acquia%5Fmarina" rel="nofollow">Acquia Marina theme</a> has a layout that lets you have this exact setup - a block above your content but below the header, with up to 3 column...
Complex query in nHibernate using DetachedCriteria <p>I'm currently trying to move from hand-crafted hql to queries constructed via DetachedCriteria. I have and HQL:</p> <pre><code>from GenericObject genericObject left join fetch genericObject.Positions positions where (positions.Key.TrackedSourceID, posi...
<p>I cannot see the advantage in moving from hql to DetachedCriteria, if the latter is more difficult to write. And read.</p> <p>In my projects I use preferrably DetachedCriteria, unless the syntax gets too complicated. Then I use hql. Until it gets complicated again. Then I give it a try in sql, and go back to hql if...
Tool (or combination of tools) for reproducible environments in Python <p>I used to be a java developer and we used tools like ant or maven to manage our development/testing/UAT environments in a standardized way. This allowed us to handle library dependencies, setting OS variables, compiling, deploying, running unit t...
<ol> <li><p><a href="http://pypi.python.org/pypi/virtualenv">virtualenv</a> to create a contained virtual environment (prevent different versions of Python or Python packages from stomping on each other). There is increasing buzz from people moving to this tool. The author is the same as the older working-env.py menti...
Which .config element affects exception handling with UnhandledExceptionMode set to UnhandledExceptionMode.Automatic? <p>I have a Windows Forms application that has this code in the program's start up:</p> <pre><code>Application.SetUnhandledExceptionMode(UnhandledExceptionMode.Automatic); </code></pre> <p>In the MSDN...
<p>You can add a JitDebugging section to your config file like this:</p> <pre><code>&lt;configuration&gt; &lt;system.windows.forms jitDebugging="true"/&gt; &lt;/configuration&gt; </code></pre> <p>This is equivalent to setting the UnhandledExceptionMode to <code>UnhandledExceptionMode.ThrowException</code> (incident...
how to have make targets for separate debug and release build directories? <p>I am looking for suggestions to properly handle separate debug and release build subdirectories, in a recursive makefile system that uses the $(SUBDIRS) target as documented in the gnumake manual to apply make targets to (source code) subdire...
<p>One option is to have specific targets in the subdirectories for each build type. So if you do a "make all" at the top level, it looks at COMPILETYPE and invokes "make all-debug" or "make all-release" as appropriate.</p> <p>Alternatively, you could set a COMPILETYPE environment variable at the top level, and have ...
How to call web service using vbscript (synchronous)? <p>Actually there many examples and I have used one of them. But it works asynchronous, I mean it is not waiting the function that I called to finish.</p> <pre><code>function ProcessSend() Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.4.0") Set oXMLDoc = Cre...
<p>If you're doing synchronous calls, you don't need the callback, and you can shrink the code into this:</p> <pre><code>function ProcessSend() Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.4.0") Set oXMLDoc = CreateObject("MSXML2.DOMDocument") strEnvelope = "callNo=" &amp; callNo &amp; "&amp;exp=" &amp; e...
Creating two pdf pages with Imagick <p>Currently i can create PDF files from images in Imagick with this function</p> <pre><code>$im-&gt;setImageFormat("pdf"); $im-&gt;writeImage("file.pdf"); </code></pre> <p>And it's possible to fetch multiple pages with imagick like this</p> <pre><code>$im = new imagick("file.pdf[...
<p>I know this is long past due, but this result came up when I was trying to do the same thing. Here is how you create a multi-page PDF file in PHP and Imagick.</p> <pre><code> $images = array( 'page_1.png', 'page_2.png' ); $pdf = new Imagick($images); $pdf-&gt;setImageFormat('pdf'); if (!$pdf-&gt;writeIm...
Converting XML between schemas - XSLT or Objects? <p>Given:</p> <ul> <li>Two similar and complex Schemas, lets call them XmlA and XmlB.</li> <li>We want to convert from XmlA to XmlB</li> <li>Not all the information required to produce XmlB is contained withing XmlA (A database lookup will be required)</li> </ul> <p>C...
<p>With C# you can always provide extension objects to XSLT transforms, so that's a non-issue.</p> <p>It's hard to qualitatively say without having the schemas and XML to hand, but I imagine a compiled transform will be faster than object mapping since you'll have to do a fair amount of wheel reinventing.</p> <p>Furt...
Algorithm to compute a Voronoi diagram on a sphere? <p>I'm looking for a simple (if exists) algorithm to find the Voronoi diagram for a set of points on the surface of a sphere. Source code would be great. I'm a Delphi man (yes, I know...), but I eat C-code too.</p>
<p>I don't have ACM document access but there's a paper on <a href="http://portal.acm.org/citation.cfm?id=636913">spherical Voronoi diagrams</a>.</p> <p>Or if you grok Fortran (bleah!) there's <a href="http://people.sc.fsu.edu/~burkardt/f_src/sxyz_voronoi/sxyz_voronoi.html">this site</a>.</p>
Do you know of anyway to get a distinct result set without using the ResultTransformer when using SetFirstResult and SetMaxResults? <p>When i use SetFirstResult and SetMaxResult and if the query has joins the result have duplicate results instead of unique.</p> <p>Then i use all type of Distinct helpers for criteria a...
<p>I have found a <a href="http://opensource.atlassian.com/projects/hibernate/browse/HB-520" rel="nofollow">hacky thing to overcome</a> this issue.</p> <blockquote> <p>The only "workaround" for this that I've been able to come up with is to issue two queries from the criteria same criteria object. The first on...
Firefox Div Problem <p>I'm trying to make a little gallery of some school works I've done in my animation class. I want to put 3 images on each line and they are all in divs because I did onion skin wrapping for a dropshadow on them. Unfortunately this makes them all just stick together in two lines across the page. Bu...
<p>It looks like your second image may be slightly taller than your third. So your floated second line is only floating back until it hits the second image. Either set your image or wrap1 heights, or add style="clear:both" to the break tags between lines.</p>
Calling MS .Net Webservices with Ruby <p>Has anyone done this / have some example code? </p>
<pre><code>#use .wsdl file to initialize an RPC driver driver = SOAP::WSDLDriverFactory.new('dotnetwebservice.wsdl').create_rpc_driver #useful debugging call driver.wiredump_dev = STDERR #Set the enconding style to ASP.NET driver.default_encodingstyle = SOAP::EncodingStyle::ASPDotNetHandler::Namespace #call method d...
Float in Database to ? in .NET <p>If you have a float in MSSQLServer, to what do you map this in .NET?</p> <p>Can you convert it to Double or will you lose numbers?</p>
<p>SQLServer <code>float</code> and C#/VB <code>double</code> have the same representation. This is the correct mapping. What you don't want to do is map SQL Server <code>float</code> to C#/VB <code>float</code> as that may involve a loss of precision. SQL Server <code>real</code> maps onto C#/VB <code>float</code>....
What is Erlang written in? <p>What is Ericsson's implementation of Erlang and Erlang/OTP written and compiled in? Is is assembly, C or Erlang itself?</p> <p>Update 1: Thanks to DrJokepu. If I understand correctly, Erlang source-to-VM compiler is written in Erlang itself. But the VM is written in C.</p> <p>Update 2: H...
<p>Erlang itself is written in Erlang. Sounds strange? Yes, because it is only partially true. OK look at it in more detail:</p> <ol> <li>Erlang preprocessor is written in Erlang.</li> <li>Erlang parser is written in Erlang.</li> <li>Erlang compiler to BEAM (byte-code VM) is written in Erlang.</li> <li>Erlang compiler...
Is silverlight a good choice for web applications which display large amounts of data and focus on user productivity? <p>I've played some on-line demos of silverlight component packs, like Telerik, NetAdvantage and ComponentOne and although I was very impressed by what I saw, I had also the impression that the demo app...
<p>Silverlight isn't superspeedy at displaying large lists of rich data, but then well designed system would not attempt to display large lists of rich data only enough data that a user can make sense of at one time.</p> <p>Hence silverlight makes an excellent platform for display and entry of data in an engaging mann...
How to match the first word after an expression with regex? <p>For example, in this text:</p> <blockquote> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc eu tellus vel nunc pretium lacinia. Proin sed lorem. Cras sed ipsum. Nunc a libero quis risus sollicitudin imperdiet.</p> </blockquote> <p>I wan...
<p>This sounds like a job for lookbehinds, though you should be aware that not all regex flavors support them. In your example:</p> <pre><code>(?&lt;=\bipsum\s)(\w+) </code></pre> <p>This will match any sequence of letter characters which follows "ipsum" as a whole word followed by a space. It does <strong>not</stron...
OpenID vs custom user login for a website used by non-tech people <p>Does anyone have experience with implementing OpenID on a non technical website? If you do, how were your non tech users reacting to the concept of OpenID and creation of the account on a different website? </p> <p>I really like the idea of a single ...
<p>Yahoo released their <a href="http://developer.yahoo.net/blog/archives/2008/10/open_id_research.html" rel="nofollow">OpenID usability research</a> results a while back. This will give you an insight on how OpenID is perceived by non-techies.</p>
How to UNPIVOT to split columns into rows? <p>I've got a sql query (using MS-SQL 2005) that generates data with these columns:</p> <pre><code>TimeStamp | SpeedMax | SpeedMin | HeightMax | HeightMin ------------------------------------------------------- 10 | 50 | 10 | 300 | 70 </code></pre> <...
<pre><code>SELECT TimeStamp, minmax, CASE WHEN minmax = 0 THEN SpeedMax ELSE SpeedMin END AS Speed CASE WHEN minmax = 0 THEN HeightMax ELSE HeightMin END AS Height FROM Table, ( SELECT 0 AS minmax UNION ALL SELECT 1 ) mm </code></pre> <p>You may add</p> <pre><code>OPTION (FORCE ORDER)...
Search, Filter AND Remove a List<List<T>> <p>I've a problem!</p> <p>I've a </p> <pre><code>List &lt;List&lt;Class&gt;&gt; L = new List&lt;List&lt;Class&gt;&gt;(); </code></pre> <p>where Class contains</p> <pre><code>IDLinea Posizione </code></pre> <p>And so on...</p> <p>I want to have a Distinct <code>List&lt;Lis...
<p>Edited based on your further explanation </p> <pre><code>enum LineComparisonMode { ///&lt;summary&gt;the order of the line numbers matters, default&lt;/summary&gt; Ordered = 0, ///&lt;summary&gt;the order of the line numbers doesn't matter /// Has a higher cost to the default. ///&lt;/summary&gt;...
Adding html in DataTextFormatString <p>I have a DropDownList populated from a LINQ query. As per the design requirements of this project, I need to append 4 "&nbsp;" to the DDL's ListItem.Text.</p> <p>It works when I add the ListItems manually like so:</p> <pre><code>&lt;asp:ListItem Value="NULL"&gt;&amp;nsbp;&amp;n...
<pre><code>DropDownList ddl = new DropDownList(); ddl.Items.Add(new ListItem(Server.HtmlDecode("&amp; n b s p;&amp;n b s p ;&amp; n b s p ;&amp;n bs p;abc"), "abc")); </code></pre> <p>Hope this helps !</p> <p><strong>Note :</strong> remove the spaces between characters..</p>
converting RELAX NG to XSD with trang while keeping external namespace elements (for use with JAXB) <p>I am using <a href="http://www.thaiopensource.com/relaxng/trang.html" rel="nofollow"><code>trang</code></a> to convert a RELAX NG .rng file to an XML Schema .xsd file for use with JAXB. Is there a way to put attribut...
<p>My opinion is that what you're doing now is the best way and you should keep your JAXB customizations separate from your RELAX NG schema. JAXB customizations in an XML Schema are ugly at best, distracting and confusing at worse. With RELAX NG, there's much less of a mapping and my guess is that you'll still need ...
Passing arrays and matrices to functions as pointers and pointers to pointers in C <p>Given the following code:</p> <pre><code>void foo( int* array ) { // ... } void bar( int** matrix ) { // ... } int main( void ) { int array[ 10 ]; int matrix[ 10 ][ 10 ]; foo( array ); bar( matrix ); ...
<p>Well, it's certainly not well understood by the C community as can be seen by glancing over SO. The magic is, <strong>all of the following are totally, 100%, equivalent</strong>:</p> <pre><code>void foo(int (*array)[10]); void foo(int array[][10]); void foo(int array[10][10]); void foo(int array[42][10]); </code></...
Why is a font in .NET of size 8 displayed as 8.25? <p>When you select, for example, a Size of 8 in a Font Dialog for Microsoft Sans Serif, it returns a font that .NET displays as having a size 8.25? </p> <p>Why is this exactly?</p>
<p>A point is 1/72 of an inch, so the font should be 8/72 (0.111111) inches high. Windows assumes a standard display is 96 DPI, unless you take pains to configure it otherwise. That means it tries to create a font that's 10.66667 pixels high; it rounds to 11 pixels. When you convert that back to points ((11 / 96) * 72...
Why can't you build a website in release mode? <p>In ASP.Net, if I set up a <strong>web application</strong> I can configure it to be in <strong>release mode</strong> but with a <strong>website</strong> I can only set the configuration to be in <strong>debug mode</strong>. Why is this?</p>
<p>In web site projects each page is compiled dynamically upon first request. It will compile without debugging symbols unless you specify otherwise in the config file.</p>
Datasnap : Is there a way to detect connection loss globally? <p>I'm looking to detect local connection loss. Is there a mean to do that, as with the events on the Corelabs components ?</p> <p>Thanks</p> <p>EDIT: Sorry, I'm going to try to be more specific: I'm currently designing a prototype using datasnap 2009. So ...
<p>Normally there is no event fired when a connection is broken, unless a statement is fired against the database. This is because there is no way of knowing a connection loss unless there is some sort of is-alive pinging going on.</p> <p>Many frameworks check if a connection is still valid by doing a very small query...
How to quickly organize functions in source code (c#) to order by alphabetical order? <p>I'm doing some class clean to organize the functions in cs file in alphabetical order. I'm using Visual Studio 2008.</p> <p>When writing them, I just put them arbitrarily, but it now looks quite messy. </p> <p>Is there some easy ...
<p>Why bother organizing in alpha order? The IDE provides a drop down list in order for you to use if you wish to access them in that manner.</p> <p>Instead the source file should contain them in a meaningful order (what is meaningful is rather subjective) either by the specifics of their tasks or by some sensible con...
Automatic feedback on JavaScript error <p>Is there a way to get an automatic feedback if an error (even syntax errors) occurs when running a JavaScript on the client side?</p> <p>I was thinking of something like this:</p> <pre><code>&lt;script src="debugger.js"&gt;&lt;/script&gt; &lt;script&gt; // some script wit...
<p>EDIT: I misunderstood your question initially, this should work:</p> <p>Also note, this needs to go BEFORE any javascript that might cause errors.</p> <pre><code>window.onerror = function(msg,u,l) { txt ="Error: " + msg + "\n"; txt+="URL: " + u + "\n"; txt+="Line: " + l + "\n\n"; //Insert AJAX cal...
Why would you choose a fixed-width design? <p><strong>Update:</strong> I deleted my motivation because it seems to distract readers. This is not about "why don't you make your window smaller". See the screenshots and you will see obstructed text because of fixed width. See my reference to "em/ex" notation in CSS. I wou...
<p>And here, as expected, comes the usual canard: “long lines are too hard to read”.</p> <p><strong>[Citation needed]</strong>, folks.</p> <p>See <a href="http://webusability.com/article_line_length_12_2002.htm" rel="nofollow">http://webusability.com/article_line_length_12_2002.htm</a> for a summary of actual res...
MS SQL2005 Query/Stored Proc Results To Text using SqlCommand or any other method <p>I have a simple question.</p> <p>I need to return results as simple text, either as a string or similar. </p> <p>i.e. I want the same behavior such as </p> <p>Results to Text (Cntrl + T) </p> <p>When you run a Query from SQL Server...
<p>No, you will have to build the sting yourself by reading from dbreader.</p>
Searching numbers with Zend_Search_Lucene <p>So why does the first search example below return no results? And any ideas on how to modify the below code to make number searches possible would be much appreciated.</p> <h1>Create the index</h1> <pre><code>$index = new Zend_Search_Lucene('/myindex', true); $doc-&gt;addF...
<p>First you need to change your text analizer to include numbers</p> <p>Zend_Search_Lucene_Analysis_Analyzer::setDefault( new Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum() );</p> <p>Then for fields with numbers you want to use <strong>Zend_Search_Lucene_Field::Keyword</strong> instead of <strong>Zend_Search_...
Is the "empty base optimization" in GCC configurable? <p>Consider these types:</p> <pre><code> struct A {}; struct B : A { int i; }; </code></pre> <p><code>sizeof(A) &gt; 0</code> as required by the standard.</p> <p><code>sizeof(B)</code> should be 4 due to the empty base optimization. Yet on GCC 4.1.1 it's 5 (I'...
<p>This always happens. I post immediately before I figure it out. Maybe the act of posting gets me thinking in a different way..</p> <p>So in my question the sample was a little bit over-simplified. It's actually more like this:</p> <pre><code>struct Base {}; struct C1 : Base { int i; } struct C2 : Base { C1 c; int ...
Java library inspector? <p>I am currently working on a mantenance project that is written in Java. We are currently working to clean up the code some and try to provide a little more organization to the project overall.</p> <p>The list of libraries that are included in the build have grown long, and honestly no one re...
<p>Since you're using NetBeans, I suggest the <a href="https://sqe.dev.java.net/" rel="nofollow">SQE</a> plugin, which includes <a href="http://depfind.sourceforge.net/" rel="nofollow">Dependency Finder</a>. (And if you weren't already using FindBugs, this is a good time to start.)</p>
C# string won't concatenate <pre><code>// Reads NetworkStream into a byte buffer. NetworkStream ns; System.Net.Sockets.TcpClient client = new TcpClient(); byte[] receiveBytes = new byte[client.ReceiveBufferSize]; ns.Read(receiveBytes, 0, (int)client.ReceiveBufferSize); String returndata = Encoding.UTF8.GetString(rece...
<p>Are you assigning it to a string or back to itself?</p> <pre><code>returndata = string.Concat(returndata, "test"); returndata += "test"; </code></pre>
Send Info from Script to Module Python <p>Hi I wonder how you can send info over to a module </p> <p>An Example main.py Looks like this</p> <pre><code>from module import * print helloworld() </code></pre> <p>module.py looks like this</p> <pre><code>def helloworld(): print "Hello world!" </code></pre> <p>An...
<p>It is not clear what you mean by "send info", but if you but the typical way of passing a value would be with a function parameter.</p> <p>main.py:</p> <pre><code>helloworld("Hello world!") </code></pre> <p>module.py</p> <pre><code>def helloworld(message): print message </code></pre> <p>Is that what your lo...
javascript in html spacing <pre><code>&lt;SCRIPT LANGUAGE="JavaScript"&gt; DynamicImage1(xx) DynamicImage2(yy) DynamicImage3(zz) &lt;/SCRIPT&gt; </code></pre> <p>This snippet of JS is in my HTML sheet. (Each function will display a different value based on the input parameter.)</p> <p>How do I set the spacing be...
<p>The cleaner approach is going to be to separate them:</p> <pre><code>&lt;div id="image1"&gt; &lt;SCRIPT LANGUAGE="JavaScript"&gt; DynamicImage1(xx) &lt;/SCRIPT&gt; &lt;/div&gt; &lt;div id="image2"&gt; &lt;SCRIPT LANGUAGE="JavaScript"&gt; DynamicImage2(xx) &lt;/SCRIPT&gt; &lt;/div&gt; &lt;div id="ima...
Long query prevents inserts <p>I have a query that runs each night on a table with a bunch of records (200,000+). This application simply iterates over the results (using a DbDataReader in a C# app if that's relevant) and processes each one. The processing is done outside of the database altogether. During the time ...
<p>It depends what Isolation Level you are using. You might try doing your selects using the With (NoLock) hint, that will prevent the read locks, but will also mean the data being read might change before the selecting transaction completes. </p>
Why is Syntactic Sugar sometimes considered a bad thing? <p>Syntactic sugar, IMHO, generally makes programs much more readable and easier to understand than coding from a very minimalistic set of primitives. I don't really see a downside to good, well thought out syntactic sugar. Why do some people basically think th...
<p><em>Syntactic sugar causes cancer of the semicolon.</em> Alan Perlis</p> <p>It is difficult to reason about syntactic sugar if the reasoning takes place without reference to a context. There are lots of examples about why "syntactic sugar" is good or bad, and all of them are meaningless without context. </p> <p>Yo...
SQL Data Services database design guidelines <p>I've been playing around lately with SQL Data Services. Although (or perhaps because) I can knock out a well-structured relational database in my sleep, I'm struggling to get my head round how to design a performant database in an environment that has (for example) no enf...
<p>It seems the phrases that are being used are:</p> <ul> <li><p>Spread your data out amongst many containers for best performance</p></li> <li><p>Modeling your data via Entities </p></li> <li><p>Process your queries in parallel for best performance</p></li> <li><p>Caching data in the service hosted middle tier</p></l...
Modern day, unicode-friendly ".ini file" to store config data in VB6 <p>I'd like to store the contents of a data structure, a few arrays, and a dozen or so variables in a file that can be saved and reloaded by my software as well as optionally edited in a text editor by a user reloaded. For the text editing, I need th...
<p>Consider using <a href="http://en.wikipedia.org/wiki/XML" rel="nofollow">XML</a>. It's completely standard, many text editors will highlight/manage it properly, every programming language and script language on Earth has good support for reading it, and it handles Unicode perfectly.</p> <p>For simple name/value pa...
Adding a child node to XML in flex <p>In a Flex application, I'm have an xml object that I'm binding to a tree control. I'm able to add a child node to the xml but when I try to add a child to the child node it doesn't appear on the tree control</p> <pre><code>tree = &lt;node label="Root"&gt; &lt;n...
<p>If you are using flex, use AS3. XMLNode is AS2. In short, try this:</p> <pre><code>tree = &lt;node label="Root"&gt; &lt;node label="Category 1"/&gt; &lt;node label="Category2"/&gt; &lt;node label="Category3"/&gt; &lt;node label="Category 4"&gt; &lt;node l...
Getting a SSL connection to work with STUNNEL/Win32 <p>The service I need to connect to has provided me three files and I'm trying to figure out what I need to create the Cert=xxx.PEM file that STUNNEL needs</p> <p>I have a "keystore.jks" file. Dumping that with keytool says it's a "Private key entry"</p> <p>I have a...
<p>It sounds like your provider has provided your keypair (for client side authentication) as a java keystore, and (I'm guessing) the remote server's public certificate or CA certificate in PEM format. </p> <p>That's some fairly heavy guesswork, but it's strange that they've sent you a private key if you aren't doing ...
Rails nested resources <p>Here's the routes.rb: </p> <pre><code>map.resources :assignments, :shallow =&gt; true do |assignment| assignment.resources :problems end </code></pre> <p>How do i get the url to edit a problem (/assignments/xyz/problems/abc/edit), in code? I have tried both<br /> edit_assignmen...
<p>Run this at your command line:</p> <pre><code>rake routes </code></pre> <p>It will tell you all the routes that you have defined, and how they map. Very handy.</p>
Is there any value in creating a pool of Dom4J SaxReader objects? <p>I'm using Dom4J 1.4.2.</p> <p>Right now my code creates a new SaxReader every time I want to parse a new XML document:</p> <pre><code>SAXReader reader = new SAXReader( ); </code></pre> <p><strong>Is there any value in creating a pool of SaxReader ...
<p>As with all so-called performance issues and urges to pool objects: are you experiencing an actual problem, or are you trying to prematurely optimize here? Rolling your own pooling in Java has been <a href="http://www.ibm.com/developerworks/java/library/j-jtp09275.html?ca=dgr-jw22JavaUrbanLegends" rel="nofollow">out...
Replacing escape characters in Powershell <p>I have a string that consists of </p> <pre><code>"some text \\computername.example.com\admin$". </code></pre> <p>How would I do a replace so my final result would be just "computername"</p> <p>My problems appears to not knowing how to escape two backslashes. To keep thing...
<p>I don't think you're going to get away from regular expressions in this case.</p> <p>I would use this pattern:</p> <pre><code>'Some text \\computername\admin$' -replace '\\\\(\w+)\\(\w+)\$', '$1' </code></pre> <p>which gives you </p> <pre><code>PS C:\&gt; 'Some text \\computername\admin$' -replace '\\\\(\w+)\\(\...
Dynamic SQL - EXEC(@SQL) versus EXEC SP_EXECUTESQL(@SQL) <p>What are the real world pros and cons of executing a dynamic SQL command in a stored procedure in SQL Server using</p> <pre><code>EXEC (@SQL) </code></pre> <p>versus</p> <pre><code>EXEC SP_EXECUTESQL @SQL </code></pre> <p>?</p>
<p><code>sp_executesql</code> is more likely to promote query plan reuse. When using <code>sp_executesql</code>, parameters are explicitly identified in the calling signature. This excellent article descibes this <a href="http://technet.microsoft.com/en-au/library/cc966425.aspx">process</a>.</p> <p>The oft cited refer...
Java : ignore single click on double click? <p>can anyone think of a good way to ignore the single click that comes with a double-click in Java ? </p> <p>I'm looking to have different behaviors for each such that:</p> <ul> <li>single-click paints crosshairs on the click point</li> <li>double-click selects an object o...
<p>Indeed you'll need to set up a Timer in your overridden mouseClicked() method of your MouseAdapter to detect the time interval between the two clicks. The default interval in ms can be found by querying <code>Toolkit.getDefaultToolkit().getDesktopProperty("awt.multiClickInterval")</code>. If another mouse click is d...
Getting the font size of a Menu Item in the Win32 API? <p>Is it possible to retrieve the size of the font used in a menu via the Win32 API? I have found the <code>GetTextMetrics()</code> call, but cannot find a way to specify it getting the font used in a menu. Any suggestions?</p>
<p>It looks like you can use this call</p> <pre><code>SystemParametersInfo(SPI_GETNONCLIENTMETRICS) </code></pre> <p>to get various system parameters. The resulting structure contains a <a href="http://msdn.microsoft.com/en-us/library/ms901140.aspx" rel="nofollow">LOGFONT</a> item for the menu font and you should be...
How to break CAPTCHA? <p>What are the methods, algorithms used to break CAPTCHA ?</p>
<p>The Security Now Podcast has an episode about this. Link to transcript follows.</p> <p><a href="http://www.grc.com/sn/sn-101.txt" rel="nofollow">http://www.grc.com/sn/sn-101.txt</a></p> <p>Update, better links:</p> <p><a href="http://www.grc.com/sn/notes-101.htm" rel="nofollow">http://www.grc.com/sn/notes-101.ht...
best way to generate mass insert statement in c#? <p>I am needing to insert a bunch of similar records into a table, and was wondering if there was a nice/easy way to do this. </p> <p>I know it would be easy to just build a big string, but I was hoping I could find a more graceful way to do this.</p>
<p>The <code>SqlBulkCopy</code> class has <code>WriteToServer</code> methods which write multiple records.</p> <p>I created a class which implemented the <code>IDataReader</code> interface, which I can pass as a parameter to a <code>SqlBulkCopy.WriteToServer</code> method (see <a href="http://msdn.microsoft.com/en-us/...
How to generate Winamp-Style visualization effects with openGL? (Milkdrop, etc) <p>I'm trying to create an animated ambient abstract background for my game. I'm picturing something very similar to what Winamp has when you turn on it's visualization plug-in. Here's a link to some <a href="http://www.nullsoft.com/free/...
<p>You might also want to check out <a href="http://projectm.sourceforge.net/" rel="nofollow">ProjectM</a>, it's an open source reimplementation of Milkdrop in OpenGL.</p>
TSQL to LINQ conversion reference? <p>I'm trying to find a good reference to help me convert this TSQL statement to Linq:</p> <p>EXAMPLE:</p> <pre><code>SELECT * FROM Categories WHERE ProductID IN (SELECT ProductID FROM ProductCategories WHERE CatID = 23) </code></pre> <p>I can't find anywhere that references how to...
<p>While it's not <em>exactly</em> a TSQL to LINQ reference, I have found the <a href="http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx" rel="nofollow">101 LINQ Samples</a> page on MSDN helpful for this purpose.</p> <p>See also <a href="http://stackoverflow.com/questions/51339/how-can-you-handle-an-in-sub-query-w...
How can I make changes to only the first line of a file? <p>I would like to know which pattern can I use in sed to make changes in the first line of huge files (~2 GB). The preference for sed is only because I assume it must be faster than a Python or Perl script.</p> <p>The files have the following structure:</p> <p...
<p>To edit the first 10 lines</p> <pre><code>sed -i -e '1,10s/ /_/g' </code></pre> <p>In Perl, you can use the flip-flop operator in scalar context:</p> <pre><code>perl -i -pe 's/ /_/g if 1 .. 10' </code></pre>
How can I configure Mercurial to use WinMerge for merges, under cygwin? <p>When Mercurial is running under cygwin, it's a bit tricky to figure out how to spawn <a href="http://winmerge.org/">WinMerge</a> to resolve merge conflicts. How can I do this?</p>
<p>The trick is that cygwin paths are not the same as Windows paths, so you need a little script that converts the cygwin paths to Windows paths before passing them as arguments to WinMerge.</p> <p>Here's how to do it:</p> <p>(1) Create a shell script in <code>/usr/bin/winmerge</code> as follows:</p> <pre><code>#!/b...
jQuery and Auto-populat selects <p>I have a simple page where I can select a client, then once I chose that autopopulate to the projects that belong to the client. I am using PHP/MySQL to pull the results.</p> <p>I took at a look at this: <a href="http://remysharp.com/2007/01/20/auto-populating-select-boxes-using-jque...
<p>If you have HTML like this:</p> <pre><code>&lt;select id='clients'&gt;...&lt;/select&gt; &lt;select id='projects'&gt;...&lt;/select&gt; </code></pre> <p>You can have jQuery code like this:</p> <pre><code>$(document).ready(function() { var $clients = $('#clients'); $clients.change(function() { var ...
How To Pass Soap Header When WSDL Doesn't Define It? <p>I have a web service that I am calling and their published WSDL doesn't actually define much of the service, 3/4 of it you have to manually build afterwards.</p> <p>The problem I have is that they need a SoapHeader with some specific information in it, but I don'...
<p>I was able to get this done by modifying the auto-generated proxy code manually and simply injecting a class that inherited "SoapHeader" and added the attribute to the method!</p> <p>I cannot re-generate or re-fresh the proxy, but it got the job done, and only took 15 minutes.</p>
UIApplication launching the phone app and returning user to the wrong screen <p>My iPhone app initiates a phone call with:</p> <pre><code>NSURL *phoneURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel://%@", @"11111111"]]; [[UIApplication sharedApplication] openURL:phoneURL]; </code></pre> <p>This is from a ...
<p>You don't.</p> <p>If you insert appropriate debugging code, I think you'll find that your app actually closes when the call is placed and reopens when the call ends. This is by design; resources are limited in mid-call, and Apple doesn't want to have to decide between dropping the call and killing your app. So wh...
Which free database with replication support? <p>I need to have 2 or 3 synchronized sql database instances at different locations. Which of FREE databases can do that?</p>
<p>mysql can do it and also postgresql</p> <ul> <li><a href="http://www.mysql.com" rel="nofollow">www.mysql.com</a></li> <li><a href="http://www.postgresql.org" rel="nofollow">www.postgresql.org</a></li> </ul> <p>I only have experience with mysql, for more info, just look into the documentation:</p> <ul> <li><a href...
Static Actionscript code analysis? <p>I want to see class, function and variable/property, dependencies visually, like <a href="http://www.ndepend.com/Screenshots.aspx">NDepend</a>, but for ActionScript 2 or AS3 code.</p> <p>Any programs or ideas?</p> <p>Use <a href="http://www.stack.nl/~dimitri/doxygen/">Doxygen</a>...
<p>Download <a href="http://www.headwaysoftware.com/downloads/structure101/g.php">Structure101g</a> and select the Actionscript flavor after installing the software. </p> <p>I've confirmed that it is able to map out class level and even function call dependencies in Flex/AS3 projects, and generate a visual map of th...
excel: charting with unknown number of data <p>Let's (for discussion purposes) say that I have x and y data in 2 columns. They're some measured data which, several times a day, a few of them are added (usually 4 times a day). Now, I wish to plot y=f(x) (linear scale), but the problem is since data is constantly added t...
<p>You can do this without any VBA. Jon Peltier has an example by Debra Dalgleish on his website:</p> <p><a href="http://peltiertech.com/Excel/Charts/DynamicColumnChart1.html" rel="nofollow">http://peltiertech.com/Excel/Charts/DynamicColumnChart1.html</a></p> <p>It can be pretty frustrating to Google anything related...
Recommendations for AJAH Library <p>I have a classic ASP application</p> <p>I would like to add some AJAX-style partial page updates to avoid server roundtrip. For example, list of rows displayed, option to add another in-situ, save it, and table redisplayed / add another.</p> <p>I don't think I need all the other b...
<p>AJAH? There is to my knowledge no such thing as AJAH. Does the H stand for HTML instead of XML? If so, let me disabuse you of the notion that AJAX entails XML. That may have been its inception but that is not the case (now at least). In the moern vernacular Ajax has come to mean pages making Javascript calls ba...
mysql keyword search <p>I have a table with names of movies, and I want to be able to search for a movie in that table. But I want to be able to search for part of the title, and still return a result. For example, if there is a record with the name "The quantum of solace", then I want to be able to do a search for "qu...
<p>Use a <a href="http://dev.mysql.com/doc/refman/5.1/en/fulltext-boolean.html" rel="nofollow">MySQL Full Text Search</a> in boolean mode. If you do this when you search for '007: quantum solace' as it contains at least one matching result in the column it will be displayed, you can then order by relevancy.</p> <pre>...
Visually edit C# imagemap control? <p>I just discovered the imagemap control in Visual Studio 2008. I'm familiar with the imagemap concept from HTML, I'm just used to having editors that allow you to select areas visually, like drawing a hotspot on the image itself, and the software generates the HTML itself. But I can...
<p>No, AFAIK there is no designer support for hotspots - I use a piece of paper.</p> <p>Concerning the code, you'll have to set HotSpotMode="PostBack" PostBackValue="HS1" for each hotspot and use a switch statement in ImageMap1_Click to react to the different Postback values.</p>