input
stringlengths
51
42.3k
output
stringlengths
18
55k
Changing tables from MyISAM to InnoDB make the system slow <p>Hi I am using Mysql 5.0.x</p> <p>I have just changed a lot of the tables from MyISAM to InnoDB </p> <p>With the MyISAM tables it took about <strong>1 minute</strong> to install our database With the InnoDB it takes about <strong>15 minute</strong> to inst...
<p>Modify the Insert Data step to start a transaction at the start and to commit it at the end. You will get an improvement, I guarantee it. (If you have a lot of data, you might want to break the transaction up to per table.)</p> <p>If you application does not use transactions at all, then you should set the paramate...
How do I disable tabs for <a> tag <p>I am using tags for links on a web page. How do I disable tab key from selecting either of them. </p>
<p>Alternatively you could go for plain HTML solution.</p> <p><code> &lt;a href="http://foo.bar" tabindex="-1"&gt;inaccessible by tab link&lt;/a&gt; </code></p> <p>The <a href="http://www.w3.org/TR/html5/editing.html#attr-tabindex">HTML5 spec says</a>:</p> <blockquote> <p><strong>If the value is a negative integer...
What's the difference between $(...) and `...` <p>The question is as simple as stated in the title: What's the difference between the following two expressions?</p> <pre><code>$(...) `...` </code></pre> <p>For example, are the two variables <code>test1</code> and <code>test2</code> different?</p> <pre><code>test1=$(...
<p>The result is the same, but the newer $() syntax is far clearer and easier to read. At least doubly so when trying to nest. Nesting is not easy with the old syntax, but works fine with the new.</p> <p>Compare:</p> <pre><code>$ echo $(ls $(pwd)) </code></pre> <p>versus:</p> <pre><code>$ echo `ls \`pwd\`` </code><...
The Most Efficient Algorithm to Find First Prefix-Match From a Sorted String Array? <p>Input:</p> <p>1) A huge sorted array of string SA;</p> <p>2) A prefix string P;</p> <p>Output:</p> <p>The index of the first string matching the input prefix if any. If there is no such match, then output will be -1.</p> <p>Exam...
<p>If you only want to do this once, use <a href="http://en.wikipedia.org/wiki/Binary_search">binary search</a>, if on the other hand you need to do it for many different prefixes but on the same string array, building a <a href="http://en.wikipedia.org/wiki/Radix_tree">radix tree</a> can be a good idea, after you've b...
Symfony Propel criteria <p>Is there any possible way to convert the MySQL object into criteria object? I tried this query:</p> <pre><code>select p.disrepid, p.subject, p.body, c.disrepid as disrepid1, c.subject as subject1, c.body as body1 from discusreply as p, discusreply as c where p.distopid=' . $...
<p>You can use your own SQL do perform a query, but there is no automated way to turn sql into a Criteria object. </p> <pre><code>$con = Propel::getConnection(DATABASE_NAME); $sql = "SELECT books.* FROM books WHERE NOT EXISTS (SELECT id FROM review WHERE book_id = book.id)"; $stmt = $con-&gt;createStatement(); $r...
Syntax Prob: Using Variables in Stored Procedures <p>Can anyone tell how correct the following code below. Iam tryin to create a stored procedure that returns the rowcount of a table whose name is passed to it.</p> <pre><code>CREATE PROCEDURE spROWCOUNTER ( @tablename nvarchar(20) @rowCountVal int OUTPUT ) AS...
<pre><code>CREATE PROCEDURE spROWCOUNTER @tablename nvarchar(20), @rowCountVal int OUTPUT AS SELECT @rowCountVal = ISNULL(SUM(spart.rows), 0) FROM sys.partitions spart WHERE spart.object_id = object_id(@tablename) AND spart.index_id &lt; 2 RETURN @rowCountVal </code></pre>
C# How can I hide the cursor in a winforms app? <p>Im developing a touchscreen app and I need to hide the cursor whenever it is within the main Form. </p> <p>Any ideas?</p>
<p>I knew this was a stupid question! Simply put</p> <pre><code>Cursor.Hide(); </code></pre> <p>is all I needed in the forms constructor.</p>
C#: How to convert BITMAP byte array to JPEG format? <p>How can I convert a BITMAP in byte array format to JPEG format using .net 2.0?</p>
<p>What type of <code>byte[]</code> do you mean? The raw file-stream data? In which case, how about something like (using <code>System.Drawing.dll</code> in a client application):</p> <pre><code> using(Image img = Image.FromFile("foo.bmp")) { img.Save("foo.jpg", ImageFormat.Jpeg); } </code></pre> <...
MovieClipLoader fails (has something to do with cache) <p>I have a small flash file that just loads and shows one image scaled to fit inside the content area. We use these with a javascript gallery so we have several instances on one html page (embedded with swfObject) I've been using MovieClipLoader to load the jpgs b...
<p>I've had troubles in the past when using multiple instances of MovieClipLoader. Similar to you, some of the loaders seemed to timeout, never displaying the image they were supposed to load. I was told this is due to HTTP simultaneous thread limitations, supposedly two downloads at a time(but never got confirmation o...
Async Method Call <p>How can I call a method asynchronously ?</p>
<p>How to call a Visual C# method asynchronously:<br /> <a href="http://support.microsoft.com/kb/315582" rel="nofollow">http://support.microsoft.com/kb/315582</a></p>
How to generate a hash value in J2ME? <p>How can I generate hash value for a byte array, in J2ME?</p> <p>It doesn't have to be very very secure but it should be fast.</p>
<p>As suggested by Josh Bloch in his Effective Java book:</p> <pre><code>public int hashCode() { int result = 17; for (int i = 0; i &lt; array.length; i++) { result = 31*result + (int)array[i]; } return result; } </code></pre>
C# Is holding data in a delimited string bad practice <p>Is it bad practice to have a string like "name=Gina;postion= HouseMatriarch;id=1234" to hold state data in an application.I know that I could just as well have a struct , class or hashtable to hold this info. </p> <p>Is it acceptable practice to hold delimited...
<p>Yes, holding your data in a string like "name=Gina;postion= HouseMatriarch;id=1234" is very bad practice. This data structure should be stored in structs or objects, because it is hard to access, validate and process the data in a string. It will take you much more time to write the code to parse your string to get ...
Good example problems to solve with threading <p>I have used threads one or two times to try and boost the performance of my code, with varying degrees of success. It is obvious that I need some more experience working with multi thread code. Are there any good programming problems to solve which will help to get a gri...
<p>The standard multithreaded problem is the <a href="http://en.wikipedia.org/wiki/Producer-consumer_problem" rel="nofollow">producer-consumer problem</a>. It exists in various flavors that highlight different problems with multithreaded applications. The link I referenced also has several other threading problems li...
How to throttle login attemps in Java webapp? <p>I want to implement an efficient mechanism to throttle login attemps in my Java web application, to prevent brute-force attacks on user accounts.</p> <p><a href="http://www.codinghorror.com/blog/archives/001206.html" rel="nofollow">Jeff explained the why, but not the ho...
<p>I think even EHCache is killing a fly with a napalm bomb. The problem is simple and so is the implementation.</p> <p>I suggest using a servlet filter a the top level so that as little processing as possible is done.</p> <p>Create a class to store the following:</p> <ul> <li>The number of attempts (count)</li> <li...
Which character set to choose when compiling a c++ dll <p>Could someone give some info regarding the different character sets within visual studio's project properties sheets.</p> <p>The options are:<br /> None<br /> Unicode<br /> Multi byte</p> <p>I would like to make an informed decision as to which to choose.<br /...
<p>All new software should be Unicode enabled. For Windows apps that means the UTF-16 character set, and for pretty much everyone else UTF-8 is often the best choice. The other character set choices in Windows programming should only be used for compatibility with older apps. They do not support the same range of ch...
Organization of many forms on many pages <p>I have a web app I'm building that has about 50 forms.</p> <p>I have a very nice form-building class that handles the creation and submission of these forms very nicely and it's wrapped with error handlers, etc. No help needed there.</p> <p>However, the forms are scattered...
<p>Go for 3. - it will be easier to maintain the code later than to change 120 pages one by one.</p>
PickupDirectoryFromIis, Sender property and SMTP MAIL FROM envelope <p>When you send an email using <code>System.Net.Mail</code> you can set the SMTP MAIL FROM envelope by using the <code>MailMessage.Sender</code> Property.</p> <p>If you set the smtp network <code>deliveryMethod</code> property to be "Network", the MA...
<p>What about if you use:</p> <pre><code> &lt;smtp deliveryMethod="SpecifiedPickupDirectory" from="me@mydomain.com"&gt; &lt;specifiedPickupDirectory pickupDirectoryLocation="c:\Temp\Mail" /&gt; &lt;/smtp&gt; </code></pre> <p>??</p>
Is it possible to view all services/types registered to StructureMap? <p>I am just trying out structuremap and would like to be able to see which of my classes are registered for which service.</p> <p>For example with castle windsor I can bring up the debugger and view container.Kernel.GraphNodes to see a list of all ...
<p>ObjectFactory.WhatDoIHave() or container.WhatDoIHave() where container is a Container. A link might be useful : <a href="http://nhibernate.codebetter.com/blogs/jeremy.miller/archive/2008/11/30/a-gentle-quickstart-for-structuremap-2-5.aspx" rel="nofollow">http://nhibernate.codebetter.com/blogs/jeremy.miller/archive/2...
Keep HTML tags in XML using LINQ to XML <p>I have an xml file from which I am extracting html using LINQ to XML. This is a sample of the file:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;tips&gt; &lt;tip id="0"&gt; This is the first tip. &lt;/tip&gt; &lt;tip id="1"&gt; Use &lt;b&gt;Windows ...
<p>Call <code>t.ToString()</code> instead of <code>Value</code>. That will return the XML as a string. You may want to use the overload taking SaveOptions to disable formatting. I can't check right now, but I suspect it will include the element tag (and elements) so you would need to strip this off.</p> <p>Note that i...
Needed: Wrappable Counter where < and > do "the right thing", language C <p>I need the code to a couter that is allowed to overflow and where &lt; > continue to tell earlier values from later values, for some defined interval. </p> <p>To clarify, one possible implementation would be:</p> <p>Consider two such counters...
<p>I think you're talking about handling the wraparound of the number circle correctly. It's quite easy, actually.</p> <p>This doesn't do precisely what you said (not sure why you have that "exception" interval), but:</p> <pre><code>typedef unsigned short uint16_t; typedef signed short int16_t; // abstract out 16-bit...
ICallBackEventHandler does not update controls with form values <p>I want to use ICallBackEventHandler however when I use it to call back to the server I find that my form control objects don't have the latest form values. Is there a way to force populate the values with the form data?</p> <p>Thanks.</p>
<p>Have a look at <a href="http://msdn.microsoft.com/en-us/magazine/cc163863.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/magazine/cc163863.aspx</a>.</p> <p>In short, you have to clear the variable '__theFormPostData', and call the 'WebForm_InitCallback()' before the 'CallbackEventReference' script. This updat...
Intercepting Method Access on the Host Program of IronPython <p>Greetings,</p> <p>Most of the information I see around concerning the construction of Proxies for objects assume that there exists a Type somewhere which defines the members to be proxied. My problem is: I can't have any such type.</p> <p>To make the pro...
<p><a href="http://blogs.msdn.com/srivatsn/archive/2008/04/12/turning-your-net-object-models-dynamic-for-ironpython.aspx" rel="nofollow">This post</a> might be useful.</p>
Is there a better layout language than HTML for printing? <p>I'm using Python and Qt 4.4 and I have to print some pages. Initially I thought I'd use HTML with CSS to produce those pages. But HTML has some limitations.</p> <p>Now the question is: is there anything that's better than HTML but just (or almost) as easy to...
<p>I have been fighting with printed (or PDF) output from Python for 8 years now and so far I came across the following approaches (in order of personal preference):</p> <ul> <li>Using <a href="http://www.jaspersoft.com/JasperSoft_JasperReports.html?utm_source=google&amp;utm_medium=cpc&amp;utm_content=JasperReports&am...
What is the best way to implement 'Excel like column sizing' for an HTML table? <p>I want to allow the user to resize columns in an HTML table, using the same method as you would in Excel. Drag the space between columns and size.</p> <p>I did some research on this last year, and found a few hacks and kludges. Most w...
<p>I've built a html grid myself in the past and having done so my best advice would be: use someone else's. </p> <p>I've looked at this jquery grid control in the past but have never got around to trying it out: <a href="http://www.trirand.com/blog/" rel="nofollow">http://www.trirand.com/blog/</a></p>
XmlDocument dropping encoded characters <p>My C# application loads XML documents using the following code:</p> <pre><code>XmlDocument doc = new XmlDocument(); doc.Load(path); </code></pre> <p>Some of these documents contain encoded characters, for example:</p> <pre><code>&lt;xsl:text&gt;&amp;#10;&lt;/xsl:text&gt; </...
<p>Are you sure the character is dropped? character 10 is just a line feed- it wouldn't exactly show up in your debugger window. It could also be treated as whitespace. Have you tried playing with the whitespace settings on your xmldocument?</p> <p><hr /></p> <p>If you need to preserve the encoding you only have t...
Standard way to embed version into python package? <p>Is there a standard way to associate version string with a python package in such way that I could do the following?</p> <pre><code>import foo print foo.version </code></pre> <p>I would imagine there's some way to retrieve that data without any extra hardcoding, s...
<p>Here is how I do this. Advantages of the following method:</p> <ol> <li><p>It provides a <code>__version__</code> attribute.</p></li> <li><p>It provides the standard metadata version. Therefore it will be detected by <code>pkg_resources</code> or other tools that parse the package metadata (EGG-INFO and/or PKG-INFO...
How to get proxy definitions from within an activeX <p>Ok, so here is the scenario:</p> <p>I have an activeX that uploads files using HttpWebRequest class. My problem is that I have to specify the network credentials in order to get the activeX to work properly behind a proxy server.</p> <p>Here is the code:</p> <pr...
<p>I managed to do it ;)</p> <pre><code> private static WebProxy QueryIEProxySettings(string strFileURL) { HttpWebRequest WebReqt = (HttpWebRequest)HttpWebRequest.Create(strFileURL); WebProxy WP = new WebProxy(WebReqt.Proxy.GetProxy(new Uri(strFileURL))); WP...
Can IntelliJ create hyperlinks to the source code from log4j output? <p>In the IntelliJ console, stack traces automatically contain hyperlinks that bring you to the relevant source files. The links appear at the end of each line in the format (Log4jLoggerTest.java:25). I can configure log4j to output text in a simila...
<p>Yes you can, try this pattern:</p> <pre> <code>&lt;param name="ConversionPattern" value="%-5p - [%-80m] - at %c.%M(%F:%L)%n"/></code> </pre>
Free software for Windows installers: NSIS vs. WiX? <p>I'm need to choose a software package for installing software. NSIS and WiX seem promising. Which one would you recommend over the other and why?</p> <p>Feel free to offer something else if you think it's better than these two.</p>
<p>If you want to get an installer done <strong>today</strong>, with the minimum amount of overhead, use NSIS. Simple scripting language, good documentation, fast.</p> <p>If you want to build MSI files, integrate with the Windows Installer transactional system, and have plenty of time to devote to learning the declara...
Can I assign keyboard shortcut to the Microsoft Intellitype keyboard? <p>Anyone know if I can assign a keyboard shortcut such as <kbd>Ctrl</kbd> + <kbd>F4</kbd> (for closing the current tab in IE/Firefix etc) to the Microsoft Keyboard favourite keys 1-5.</p> <p>I have Microsoft Keyboard software installed and I can on...
<p>Unlock the Function button on top of the Numkey pad, then use the F6/Close key ;)</p>
Visual Studio 2005 stopped adding code-behind files <p>This morning, when I tried to add a new ASPX page to my project, Visual Studio decided that I no longer needed any .CS files associated with it. Trying to add a web control produced same results: .ascx file with no .cs. I've got two questions so far:</p> <ol> <li>...
<p>there is a check box you may have accidentaly un-checked: Place code in separate file<br /> <img src="http://blogs.msdn.com/blogfiles/mikeormond/WindowsLiveWriter/NewWebItemTemplatesinVisualStudioOrcasBe_CC5B/image%5B9%5D.png" alt="dialog" /></p>
Managing Wireless Network Connections with C# and the Compact Framework <p>The title kinda sums it up--I need to be able to pro grammatically connect to a known access point (the SSID and credentials will be loaded during device provisioning). I understand that both the Compact Framework SDK and the OpenNETCF SDK offe...
<p>OpenNETCF's <a href="http://www.smartdeviceframework.com" rel="nofollow">Smart Device Framework</a> is probably the simplest mechanism to do this. The chanllenge with wireless is that the radio OEM (whether is was the device oem or not) can choose any number of ways to advertise the interface. Maybe as a plain NDI...
Rotating flash movie clip <p>I would like to do a flash menu similar to <a href="http://accuval.net" rel="nofollow">this company's</a>, I have the rotation down, I just cannot figure out how to make it rotate to the top. For example, if you click "Financing" on their menu, the word financing rotates to the top. If some...
<p>The simplest way to do that, is figure out the angles at which each button would be straight (i mean, by hand or on paper). There's 360degrees in a circle, however be careful as flash angle ranges from -180 to +180 degrees (not from 0 to 360 like you would expect).</p> <p>For the rotation, you need to group all the...
Can .Net custom controls be used in VB6 form? <p>I am doing some maintenance on a VB6 Windows application. I have a .Net custom control component that I would like to use on a VB6 form. Is this possible? I know how to access non-visual .Net components from VB6 by generating a COM type library for the .Net DLL, but can ...
<p>The Interop Forms toolkit will give you what you need:</p> <p><a href="http://msdn.microsoft.com/en-us/vbasic/bb419144.aspx">http://msdn.microsoft.com/en-us/vbasic/bb419144.aspx</a></p> <p>It lets you create UserControls in VB.net which you can then add to VB6. It also lets you display .net forms from your VB6 cod...
Equations for 2 variable Linear Regression <p>We are using a programming language that does not have a linear regression function in it. We have already implemented a single variable linear equation:</p> <blockquote> <p>y = Ax + B</p> </blockquote> <p>and have simply calculated the A and B coefficents from the data...
<p>so you have three linear equations</p> <pre><code>k = aX1 + bY1 + cZ1 k = aX2 + bY2 + cZ2 k = aX3 + bY3 + cZ3 </code></pre> <p>What you can do is rewrite it as matriz</p> <pre><code>| x1 y1 z1 | | a | | k | | x2 y2 z2 | | b | = | k | | x3 y3 y3 | | c | | k | </code></pre> <p>to work out <code>[a b c ]</code>...
Objective-C error: initializer element is not constant <p>Why does the compiler give me the following error message on the provided code: "initializer element is not constant". The corresponding C/C++ code compiles perfectly under gcc.</p> <pre><code>#import &lt;Foundation/Foundation.h&gt; const float a = 1; const f...
<p>That code will only compile correctly if the <code>const float</code> statements appear somewhere other than the file scope.</p> <p>It is part of the standard, apparently. It is important that all file-scope declared variables are initialised with constant expressions, not expressions involving constant variables.<...
Initialize library on Assembly load <p>I have a .net library dll that acts like a functional library. There are a bunch of static types along with static methods.</p> <p>There is some initialization code that I need to run to set up the library ready for use.</p> <p>When the assembly gets loaded is there a way to ens...
<p>Yes there is - sort of.</p> <p>Use the excellent little utility by by Einar Egilsson, <a href="https://github.com/einaregilsson/InjectModuleInitializer">InjectModuleInitializer</a>.</p> <p>Run this executable as a post build step to create a small .cctor function (the module initializer function) that calls a stat...
Call C# Web Service with using PHP <p>I would like to call C# service with using PHP, anyone know how to do it? Thanks</p>
<p>Create an SOAP XML document that matches up with the WSDL and send it via HTTP POST. See <a href="http://www.w3schools.com/webservices/tempconvert.asmx?op=CelsiusToFahrenheit" rel="nofollow">here for an example</a>.</p> <p>You send this:</p> <pre><code>POST /webservices/tempconvert.asmx HTTP/1.1 Host: www.w3school...
What is the difference betwen including modules and embedding modules? <pre><code>module Superpower # instance method def turn_invisible ... end # module method def Superpower.turn_into_toad ... end module Fly def flap_wings ... end end end Class Superman ...
<p>I'm assuming that when you say embedding a module you mean the "Fly" module from your example is embedded in "Superpower".</p> <p>If that is the case, I would call it a nested module. The only time I would use a Nested Module is when the nested module deals specifically with the main module, such that the code in F...
How do I provide two default templates for a Custom Control in WPF? <p>In Charles Petzold's "Using Templates to Customize WPF Controls" article in the Jan 2007 edition of MSDN Magazine (<a href="http://msdn.microsoft.com/en-us/magazine/cc163497.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/magazine/cc163497.aspx...
<p>You can see how its done in the scrollbar sample control template <a href="http://msdn.microsoft.com/en-us/library/ms742173.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms742173.aspx</a></p> <p>I copied only the relevant parts of the sample here.</p> <p>In short there are two templates in the resou...
Should I explicitly release? <p>I currently have an array of strings, I'm getting a NSString object from this array by calling the <code>-componentsJoinedByString:</code> method. Example:</p> <pre><code>NSString *someString = [[NSString alloc] initWithString: [myStrings componentsJoinedByString:@","]; </code></pre> <...
<p>The first example you wrote is correct, although in practice it would be clearer just to write <code>NSString *someString = [[myStrings componentsJoinedByString:@","] copy];</code> (note that this will be retained, so you will have to release it at some point in the future.</p> <p>If you're having trouble with memo...
ASP.NET Membership provider with SQL schema's <p>I would like to use the ASP.NET Membership Provider security framework but would like it to use SQL Server schema's. So instead of having tables such as aspnet_Membership I would prefer it to be something like sec.Membership. Has anyone tried this and got it to work?</p>...
<p>I believe the table names are hard-coded into the default SQL providers for ASP.NET. You'll have to implement custom providers to do the same things as the default providers, but using an alternate table name instead. <a href="http://www.devx.com/asp/Article/29256" rel="nofollow">This article</a> can help you figure...
Work-around for PHP5's PDO rowCount MySQL issue <p>I've recently started work on a new project using PHP5 and want to use their PDO classes for it. The problem is that the MySQL PDO Driver doesn't support rowCount() so there's no way to run a query and then get the number of affected rows, or rows returned, which is a ...
<p>You can issue a <code>SELECT FOUND_ROWS()</code> query right after the original <code>SELECT</code> query to get row count.</p> <pre><code>$pdo-&gt;query("SELECT * FROM users"); $foundRows = $pdo-&gt;query("SELECT FOUND_ROWS()")-&gt;fetchColumn(); </code></pre> <p>See also: <a href="http://dev.mysql.com/doc/refman...
ASP execute stored procedure with Null <p>In asp.net can use dbnull.value to send Null value to db. How to use in ASP?</p> <p>Thanks a lot!!</p>
<p>In ASP, you need to use the keyword <strong>NULL</strong> as the null value for the stored procedure.</p> <p>Note: don't use vbNull as this evaluates to 1 rather than null.</p>
detecting mistyped email addresses in javascript <p>I notice sometimes users mistype their email address (in a contact-us form), for example, typing @yahho.com, @yhoo.com, or @yahoo.co instead of @yahoo.com</p> <p>I feel that this can be corrected on-the-spot with some javascript. Simply check the email address for po...
<p>Here's a dirty implementation that could kind of get you some simple checks using the <a href="http://en.wikipedia.org/wiki/Levenshtein_distance"><code>Levenshtein distance</code></a>. Credit for the "levenshteinenator" goes to <a href="http://andrew.hedges.name/experiments/levenshtein/"><code>this link</code></a>. ...
Access 2007 integration with Sharepoint 2007 Tasks list <p>A customer of ours has an Access 2007 application with a form for creating tasks for upload to a Sharepoint Task List. The user fills in the form (title, status, priority, start date, due date). The user then places check marks next to the sharepoint user nam...
<ol> <li>have the attachments upload as part of the Access form. </li> <li>load attachments into a Document Library</li> <li>Check off users like they are currently being done</li> <li>Add hyperlinks to the attachments uploaded in step 2 to the Description (rich text) field. (maybe done automatically in steps 1-2)</li>...
Is there a decent way to inhibit screensavers in linux? <p>I'm looking for a decent, non-lame way to inhibit xscreensaver, kscreensaver, or gnome-screensaver, whichver might be running, preferably in a screensaver-agnostic manner, and it absolutely positively must execute <em>fast</em>.</p> <p>I've read the xscreensav...
<p>No, but yes...</p> <p>There's no nice clean way to do this. In my opinion there should be a mechanism administrated by the X server, which both screensavers and interested applications can voluntarily use to negotiate suppression of any screensaver during the runtime of one or more programs. But no such mechanism y...
Custom C# data transfer objects from javascript PageMethods <p>I've created a custom object that I'd like to return in JSON to a javascript method. This object was created as a class in C#. </p> <p>What's the best way to return this object from a PageMethod ([WebMethod] if you like) to a javascript onPageMethodCallb...
<p>ASP.NET AJAX on the server side will handle serializing the object for you. For example:</p> <pre><code>public class Name { public string FirstName; public string LastName; } [WebMethod] public Name GetName() { Name name = new Name(); name.FirstName = "Dave"; name.LastName = "Ward"; return name; } <...
Storing Queries in C# or use Stored Functions in Postgres? <p>Should I be storing the raw SQL queries in my c# code, or should I be delegating them to stored functions in the Postgres Backend?</p> <p>If I should be storing them in code, since they can get quite long, what is the optimal way to store them (ie. as const...
<p>As a rule we do all of our database interactions via stored procedures instead of direct SQL statements; this allows a lot of flexibility for adjusting to schema changes and performance issues without having to rebuild or redeploy binary images or configuration files to all targets.</p>
PHP sessions for storing lots of data? <p>I'm developing a media bookmarking site and am looking for a way to remember whether a user has bookmarked an item (without having to go to the DB every page load to check).</p> <p>I haven't used PHP sessions before, but I'm thinking they would do the trick.</p> <p>Would it m...
<p>As well you can take a look at Memcached extension - it uses server's memory as data storage.</p>
serve postscript file with php script <p>I want to give a link to a postscript file, but first I want to make a script that will monitor the downloads of this file. The link has to be 'direct' so I added <code>.ps</code> extension to be interpreted by PHP. In the begining the script opens the text file, writes some inf...
<p>You can use <a href="http://nz2.php.net/readfile" rel="nofollow">readfile</a>:</p> <pre><code>header('Content-type: application/postscript'); readfile('appendix.ps'); </code></pre> <p>You also may want to send a "<a href="http://www.ietf.org/rfc/rfc2183.txt" rel="nofollow">Content-Disposition</a>" header to hint t...
How can I find out how many connections to my slapd LDAP server? <p>I have a slapd LDAP server which is critical to my application. I want to monitor it in order to detect when it has become over-loaded or if it fails.</p> <p>Unfortunately we are stuck with a very old edition of slapd which has a known bug: It cannot ...
<p>The best tool for that is <a href="http://people.freebsd.org/~abe/">lsof</a>.</p> <pre><code>lsof -i tcp:389 </code></pre> <p>will show you all TCP connections to your LDAP server.</p>
Delphi Personal Edition or Turbo Delphi- saving and searching for data <p>i'm interested if it is possible to make an application like an Address Book (Windows: Start->All Programs->Accessories->Address Book) in Delphi Personal Edition or in Turbo Delphi.</p> <p>If yes, how to make it? Which components to use?</p> <p...
<p>To start with the first question, you can write (almost) any application in Delphi. Other version often implies a smaller library and possible limited use (as far as I know you can't sell comercial applications build with the free version, but maybe codegear changed this)</p> <p>An addressbook is a nice and simple ...
Skinning Google Maps To Look Like The Native Google Maps iPhone App <p>I could use a goog set of eyes on my project. I am designing a skin for the google maps API that resembles the native Google Maps App on the iPhone. Ive already got it:</p> <p>1) Displaying a custom info window</p> <p>2) Custom pins/markers</p> ...
<p>turns out this had to do with the version of google maps I was using. 2.0 allows for the custom infowindow, but does not allow the pins to fall from the sky. the opposite was true for v 2.123. go figure.</p>
How do I separate markup from application code when building a Java website? <p>I'm a .NET web developer who has just been asked to produce a small demo website using NetBeans IDE 5.5. I have no experience with Java up to this point.</p> <p>I've followed a couple of quick tutorials, one which just uses a JSP file and ...
<p>You can't do something similar with ASP.NET code behind using pure Java EE technologies. You need to use an MVC framework like Spring MVC or Struts. The idea is that you create your controller (Java Class) and a JSP page and configure an action to tie the JSP page with the controller.</p> <p>It isn't a simple as th...
SQL exception when trying make an prepared statement <p>I'm trying to pass the following <code>String</code> to a <code>PreparedStatement</code>:</p> <pre><code>private static final String QUICK_SEARCH = "select * from c where NAME like '% ? %'"; </code></pre> <p>However, I get an SQL exception that the bind variable...
<p>You can't put binding variables inside a string like that.</p> <p>You need to use:</p> <pre><code>SELECT * FROM c WHERE name LIKE CONCAT('%', ?, '%') </code></pre> <p>or similar, depending on what functions are supported by your version of SQL.</p>
Where can I find the default icons used for folders and applications? <p>I'm trying to load the default HICON that explorer displays for: </p> <ul> <li>An open folder</li> <li>An exe that has no embedded default icon of its own. This can also be seen in 'Add/Remove Programs' or 'Programs and Features' as it's called ...
<p>Use the <a href="http://msdn.microsoft.com/en-us/library/bb762179(VS.85).aspx">SHGetFileInfo</a> API.</p> <pre><code>SHFILEINFO sfi; SecureZeroMemory(&amp;sfi, sizeof sfi); SHGetFileInfo( _T("Doesn't matter"), FILE_ATTRIBUTE_DIRECTORY, &amp;sfi, sizeof sfi, SHGFI_ICON | SHGFI_SMALLICON | SHGFI_USEF...
Uploading data into remote database <p>What is the most secure and easier way to send approx. 1000 different records into database that is not directly accessible - MySQL database on Web provider's server - using Windows application . Data will be stored into different tables.</p> <p>Edited: The application will be d...
<p>If you can export the data as a sql script you can just run it against the remote server using your application of choice. 1000 records wont create that big a script.</p>
Mysterious EOF exception while reading a file with Java IO functions <p>I got following exception when I am trying to seek to some file. </p> <blockquote> <p>> Error while seeking to 38128 in myFile, File length: 85742 java.io.EOFException at java.io.RandomAccessFile.readInt(RandomAccessFile.java:725) ...
<p>I would be very careful when trying to do random access on a file that is concurrently being written to from another process. It might lead to all kinds of strange synchronisation problems, as you are experiencing right now. </p> <p>Do you determine the length of the file from the same process as the one doing the ...
How to center a mask in a Panel when rendering <p>I have a simple scenario where a panel needs a masked loading indicator over it while its loading the content. I have the mask working fine using the following code but the loading indicator appears at the top when calling it the first time. When calling it after the pa...
<p>It appears the mask is applied to the panel before the html has been rendered completely. A simple solution was to delay the mask shortly before applying it.</p> <pre><code>render: function(comp) { setTimeout(function() { comp.loadPermissions(); }, 100); } </code></pre>
Need technology recommendation/suggestion <p>We (my company) is trying to develop a solution (application) for document management. We have considered using MS Sharepoint Server 2007 or Sharepoint Services, but we need recommendation or suggestion for this.</p> <p>We are planning to use windows workflow fundation for ...
<p>Well, I should just say that my one experience with Sharepoint is not great, and I am irritated by it's limitations every day, which is constantly adding to my frustration with it. I'm sure that it could be made more useful, but not as of yet.</p> <p>What you are looking for is a Business Process Management (Workfl...
c# Read line from PDF <p>I want to be able to read line by line from a pdf, compare it to a string( a filename), and if the string appears in that line, write that line to a list.</p> <p>So far I had a quick look at ITextSharp and at PDFSharp, but it doesn't seem like these are the right tools for the job as they focu...
<p>I use <a href="http://www.pdfbox.org/userguide/dot_net.html" rel="nofollow">PDFBox</a> with Lucene. It was easy to find out how it works and it does the job. It's opensource and free.</p>
Is there a maximum number you can set Xmx to when trying to increase jvm memory? <p>Is there a max. size you can set Xmx to? I set it to 1024m and eclipse opens ok. When I set it above 1024, eclipse doesn't open and I get the error "jvm terminated. Exit code=-1"...</p> <p>I was doing this because I keep getting an "ja...
<p>Yes, there is a maximum, but it's system dependent. Try it and see, doubling until you hit a limit then searching down. At least with Sun JRE 1.6 on linux you get interesting if not always informative error messages (peregrino is netbook running 32 bit ubuntu with 2G RAM and no swap):</p> <pre><code>peregrino:$ ja...
Are Transactions allowed by default in SQLServer? <p>I need to use DbTransactions (on a single db) but I am not sure about how to make sure it will keep working when I deploy to the production environment.</p> <p>What are the requirements for an application to be able to use SQL DbTransactions? Are they allowed by def...
<p>Yes, transactions are enabled by default--I don't think this is something you can disable. Each time you run a query, it probably runs as an autocommit, implicit transaction, unless otherwise specified.</p> <p>MSDTC comes into play if you run distributed transactions. I'd avoid it if you can. That aspect <em>can</e...
How to express the content referenced by the anchor tag <p>I'd like to express in an HTML document what kind of document is pointed by an anchor tag (<code>&lt;a&gt;</code>). For example, is it a list of dates, or a list of people, etc... All referenced documents will be Atom feeds, but the links will be displayed diff...
<p>Perhaps something like <a href="http://microformats.org/" rel="nofollow">microformats</a> will help?</p>
Persistence solutions for C++ (with a SQL database)? <p>I'm wondering what kind of persistence solutions are there for C++ with a SQL database? In addition to doing things with custom SQL (and encapsulating the data access to DAOs or something similar), are there some other (more general) solutions?</p> <p>Like some g...
<p><a href="http://www.sqlite.org/">SQLite</a> is great: it's fast, stable, proven, and easy to use and integrate. </p> <p>There is also <a href="http://www.equi4.com/metakit/">Metakit</a> although the learning curve is a bit steep. But I've used it with success in a professional project.</p>
ASP.NET - Trust Level = Full? <p>I recently joined a firm and when analyzing their environment I noticed that the SharePoint web.config had the trust level set to Full. I know this is an absolutely terrible practice and was hoping the stackoverflow community could help me outline the flaws in this decision. </p> <p>...
<p>Todd,</p> <p>The book, "<a href="http://www.google.com/search?sourceid=navclient&amp;ie=UTF-8&amp;rlz=1T4DMUS%5FenUS233US239&amp;q=Programming%2BMicrosoft%2BASP.Net%2B3.5" rel="nofollow">Programming Microsoft ASP.Net 3.5</a>", by Dino Espisito provides some sound reasoning for not allowing Full Trust in ASP.Net app...
Finding out who is listening for PropertyChangedEventHandler in c# <p>I have a WPF form and I am working with databinding. I get the events raised from INotifyPropertyChanged, but I want to see how to get a list of what items are listening, which i fire up the connected handler.</p> <p>How can I do this?</p>
<p><a href="http://msdn.microsoft.com/en-us/library/system.delegate.getinvocationlist.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.delegate.getinvocationlist.aspx</a></p>
Automatic configuration reinitialization in Spring <p>In Log4j, there is a feature wherein the system can be initialized to do a configure and watch with an interval. This allows for the log4j system to reload its properties whenever the property file is changed. Does the spring framework have such a Configuration Obse...
<p>I found a utility that does something similar to Log4J <a href="http://www.wuenschenswert.net/wunschdenken/archives/138">here</a>. It's basically an extension to PropertyPlaceholderConfigurer that reloads properties when they change.</p>
OracleDataReader loses results after examination <p>I have come across a quirky "feature" in Visual Studio and I was interested in seeing if anyone else had noticed this. Or if it is specific to myself.</p> <p>I have some methods that perform SQL queries on a database and then return an OracleDataReader</p> <pre><cod...
<p>ADO.NET objects that derive from IDataReader (like your OracleDataReader) provide connected, forward-only access to the data returned by the query, so when you view the results in the debugging visualizer, you are actually stepping through the real data. When the program runs, the DataReader has iterated past the d...
cruisecontrol config.xml special characters svnbootstrapper <p>I have a line like : </p> <pre><code> &lt;svnbootstrapper LocalWorkingCopy="${projects.dir}/${project.name}" Password="4udr=qudafe$h$&amp;e4Rub" Username="televic-education" /&gt; </code></pre> <p>in my config.xml. Because of special characters in the Pa...
<p>Replace &amp; with &amp;amp; in the password attribute. I don't know if that's the problem, but it's definitely <em>a</em> problem.</p>
Multiple submit buttons/forms in Rails <p>I am trying to write a rails application which lets you go to a certain page, say /person/:id. On this page it shows a set of available resources. I want each resource to have a button next to it, which reserves that resource to that person (by creating a new instance of an All...
<p>im using jQuery, and this is what i did :</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { $('#bulk_print').click(function(){ var target = '&lt;%= bulk_print_prepaid_vouchers_path(:format =&gt; :pdf) %&gt;'; $('#prepaidvoucher_bulk_print').attr...
Can you convert the output of php crypt() to valid MD5? <p>I have some strings that have been encrypted using the <a href="http://php.net/crypt" rel="nofollow">PHP function <code>crypt()</code></a>.</p> <p>The outputs look something like this:</p> <pre><code>$1$Vf/.4.1.$CgCo33ebiHVuFhpwS.kMI0 $1$84..vD4.$Ps1PdaLWRoai...
<p>OK, so maybe this answer is a year late, but I'll give it a shot. In your own answer, you note that <code>crypt()</code> is using the FreeBSD MD5, which also does some interesting transformations on the salt before running the hash, so the result of what I'm about to give you will never quite match up with the resu...
copy Word document contents without using clipboard (VBA) <p>I was wondering how to avoid using Windows clipboard, when you want to "replicate" multiple sections of a Word document (using VBA in macros)</p> <p>Why to avoid? Because we're using Word on a server, in a multiuser environment (I know that it is officially ...
<p>I finally resolved to copy word by word. FormattedText seemed to work fairly well, until the last word (some special (evidently) characters), where suddenly the cell that I just filled with copied content would go blank. When I increased the number of cells, other run-time errors would pop up, like Your table got co...
Internet Explorer CSS Line Height For MusiSync Font <p>I'm trying to use the MusiSync font to embed a sharp and flat symbol in a line of text. In order to keep these symbols from being tiny I have to make their point size twice the size of the rest of the text. Unfortunately, this messes up the line height in Internet ...
<p>I opened up Photoshop and used the font you link to. There is a huge amount of white-space above each glyph in the font itself. The font is poorly designed.</p> <p>If you set your style to this, you'll see the issue:</p> <pre><code>.style2 { font-family: MusiSync; font-size: 24pt; border:1px solid #000...
Selecting an index in a QListView <p>This might be a stupid question, but I can't for the life of me figure out how to select the row of a given index in a QListView.</p> <p>QAbstractItemView , QListView's parent has a setCurrentIndex(const QModelIndex &amp;index). The problem is, I can't construct a QModelIndex with ...
<p><a href="http://doc.trolltech.com/4.4/model-view-selection.html">This</a> should help you get started</p> <pre><code>QModelIndex index = model-&gt;createIndex( row, column ); if ( index.isValid() ) model-&gt;selectionModel()-&gt;select( index, QItemSelectionModel::Select ); </code></pre>
Is there a method in PL/SQL to convert/encode text to XML compliant text? <p>I have a colleague who needs to convert text from a PL/SQL method into XML compliant text, as he is constructing a excel spreadsheet by updating a text template.</p> <p>Is there a method in PL/SQL to convert/encode text to XML compliant text?...
<p>Well, if you just want to convert XML characters, you'll want to do something like...</p> <pre><code> outgoing_text := DBMS_XMLGEN.CONVERT(incoming_text) </code></pre> <p>Where <code>outgoing_text</code> and <code>incoming_text</code> are both VARCHAR2 or CLOB.</p> <p>You can specify a second argument, but it de...
Bash script to create symbolic links to shared libraries <p>I think this question is rather easy for you shell scripting monsters.</p> <p>I am looking for the most elegant and shortest way to create symbolic links to shared libraries for Unix by means of a bash shell script.</p> <p>What I need is starting out with a ...
<p>I believe <code>ldconfig</code> is the standard tool that does this. </p> <p>I recall somewhere it can generate symlinks based on internal version info, but can't find the source right now.</p> <p><strong>EDIT</strong> Yes, if you run </p> <pre><code>ldconfig -v </code></pre> <p>You'll see it generating all the ...
Acquiring drive names (as opposed to drive letters) in Java <p>On my Windows machine, my main hard drive has the letter C: and the name "Local disk". </p> <p>To list the drive letters in Java on Windows, the File object has the static listRoots() method. But I can't find a way to acquire the drive names (as opposed to...
<p>Ah yes, you need to get the FileSystemView object and use <a href="http://java.sun.com/javase/6/docs/api/javax/swing/filechooser/FileSystemView.html#getSystemDisplayName(java.io.File)" rel="nofollow">getSystemDisplayName</a>. (I once implemented a Filesystem browser in Java).</p> <p>It's not perfect though but it w...
VB6: List available commands, then execute a random one of them <p>Hallo! I'm a n00b, and I'm looking for a few lines of code in VB6 to implement this: I want to list a certain number of commands to execute, then tell my program to chose a random one among them and execute it: strictly speaking, I'm dealing with a MSAg...
<pre><code>Public Sub MakeFace() 'Reset random seed. Randomize 'Generate a random integer with the specified range. Dim Min As Integer, Max As Integer, N As Integer Min = 1 Max = 5 N = Min + Round(Rnd) * Max 'Select and call the desired function. Select Case N Case 1 Call MakeHappyFace ...
Launching a C++ executable from a C# app and keeping role based security context <p>First off I know this is probably a tall order but... :)</p> <p>We have some software that interacts with the hardware our company produces. This software loads a .NET assembly and this acts as our interface to the hardware. </p> <p>C...
<p>You would have to modify the C++ application to check the roles as well.</p> <p>If you can do that, you might consider breaking up part of your C# application into multiple assemblies. Specifically, take the roles part the C# application, and compile that as a dll with COM/ActiveX extensions.</p> <p>Then you can ...
Why doesn't C++ have a pointer to member function type? <p>I could be totally wrong here, but as I understand it, C++ doesn't really have a native "pointer to member function" type. I know you can do tricks with Boost and mem_fun etc. But why did the designers of C++ decide not to have a 64-bit pointer containing a po...
<p>@RocketMagnet - This is in response to your <a href="http://stackoverflow.com/questions/462491/again-why-doesnt-c-have-a-pointer-to-member-function-type">other question</a>, the one which was labeled a duplicate. I'm answering <em>that</em> question, not this one.</p> <p>In general, C++ pointer to member functions...
Get File Icon used by Shell <p>In .Net (C# or VB: don't care), given a file path string, FileInfo struct, or FileSystemInfo struct for a real existing file, how can I determine the icon(s) used by the shell (explorer) for that file?</p> <p>I'm not currently planning to use this for anything, but I became curious about...
<pre><code>Imports System.Drawing Module Module1 Sub Main() Dim filePath As String = "C:\myfile.exe" Dim TheIcon As Icon = IconFromFilePath(filePath) If TheIcon IsNot Nothing Then ''#Save it to disk, or do whatever you want with it. Using stream As New ...
Window-overflowing widget in wxWidgets <p>I'm looking for a way to implement this design in wxPython on Linux...<br /> I have a toolbar with a button, when the button is pressed a popup should appear, mimicking an extension of the toolbar (like a menu), and this popup should show two columns of radio buttons (say 2x5) ...
<p>Using a menu is a no-go, because <code>wxWidgets</code> can't put widgets on a menu. Using the shaped frame would be possible in principle, but the problem is then to get the position of the button you clicked, to display the window at the right position. I tried to do that back then, but didn't have luck (in C++ wx...
Page refreshing after the parameter selection in SSRS report <p>I have couple of parameters in my SSRS report. some are multivalued and some are regular with drop down list. each time while selecting a different parameter value the page is getting refreshed. Is there any way to avoid this page refreshment on each para...
<p>I just encountered to this problem today, and the following post definitely helped me.</p> <p><a href="http://blog.summitcloud.com/2009/12/fix-refresh-of-parameters-in-ssrs/" rel="nofollow">http://blog.summitcloud.com/2009/12/fix-refresh-of-parameters-in-ssrs/</a></p> <p>quoting from the post:</p> <blockquote> ...
How to stretch in width a WPF user control to its window? <p>I have a Window with my user control and I would like to make usercontrol width equals window width. How to do that?</p> <p>The user control is a horizontal menu and contains a grid with three columns:</p> <pre><code>&lt;ColumnDefinition Name="LeftSideMenu"...
<p>You need to make sure your usercontrol hasn't set it's width in the usercontrol's xaml file. Just delete the Width="..." from it and you're good to go!</p> <p><strong>EDIT:</strong> This is the code I tested it with:</p> <p><em>SOUserAnswerTest.xaml:</em></p> <pre><code>&lt;UserControl x:Class="WpfApplication1.SO...
Version of XSLT in iPhone <p>I plan to use XML/XSLT in my iPhone application. </p> <p>What version of XSLT is currently supported on the iPhone? Can I use XSLT 2.0 or just 1.0 ?</p>
<p>Using <code>libxslt</code> on the iPhone OS is actually quite easy:</p> <ol> <li><a href="http://xmlsoft.org/XSLT/downloads.html">Download the source-code of libxslt</a> and extract it.</li> <li>Add the "libxslt" dir to <strong>Header search paths</strong> in your build settings. Also, add the path to the libxml-he...
Can I get the matrix determinant using Numpy? <p>I read in the manual of Numpy that there is function <code>det(M)</code> that can calculate the determinant. However, I can't find the <code>det()</code> method in Numpy.</p> <p>By the way, I use Python 2.5. There should be no compatibility problems with Numpy.</p>
<p>You can use <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.det.html"><code>numpy.linalg.det</code></a> to compute the determinant of an array:</p> <pre><code>In [1]: import numpy In [2]: M = [[1, 2], [3, 4]] In [3]: print numpy.linalg.det(M) Out[3]: -2.0000000000000004 </code></pre>
String.Format for C++ <p>Looking for an implementation for C++ of a function like .NET's String.Format. Obviously there is printf and it's varieties, but I'm looking for something that is positional as in:</p> <blockquote> <p>String.Format("Hi there {0}. You are {1} years old. How does it feel to be {1}?", na...
<p>Look at the <a href="http://www.boost.org/doc/libs/1_37_0/libs/format/index.html" rel="nofollow">boost format library.</a></p>
Tiny flash in safari - very strange bug! <p>We have a flash file that in every other browser displays at its correct size (which is something like 1600px) however, in safari it appears tiny. We have also noticed that sometimes when the flash file is not cached it appears at normal size, then after a soft refresh the f...
<p>Here is a <a href="http://forums.macrumors.com/showthread.php?t=583623" rel="nofollow">discussion</a> about a similar problem with Safari and Flash Video, perhaps it helps.</p>
Best way to optimize dataset that contains linestrings. Some lines start and end at same coordinates <p><strong>THE SETUP</strong><br /> I have a table which contains linestrings. Linestrings are made up of multiple geographic points. Each point is made up of a latitude and longitude. Note: the linestring value is stor...
<p>I think the easiest way to go here is using the MySQL spatial extensions. </p> <p>Particularly I have only used Oracle spatial extensions. In Oracle we can use functions like <a href="http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14255/sdo_objgeom.htm#BGHCDIDG" rel="nofollow">SDO_GEOM.RELATE</a> or <a ...
Checkstyle for ActionScript (Flex) <p>HI, I'm currently working on a project that uses Flex and Java. In Java we easily enforced a coding standard with Checkstyle, and we want to do this for Flex.</p> <p>Does anybody know of a tool similar to Checkstyle that would allow coding standard checks? (I've googled for this b...
<p>The long and the short is that there is... kind of, but only for Actionscript, and you have to test it yourself... There is a <a href="http://code.google.com/p/checkstyleas3/downloads/list" rel="nofollow">prototype</a> of an Actionscript 3 version, but it is not even in Beta yet (and I admit that I haven't had the ...
Getting odd error on .net ExecuteNonQuery <p>I'm working in .NET with SQL server on the backend</p> <p>I have a database that I create a record in using a web control - then I need to update some of the fields.<br /> I can trap the sql statement and run it in sql server successfully - however, when I try to run execut...
<p>before i even look where the error might be i suggest you stop immediatly what your doing and first go change all sql code to use parameters. if you don't your site will be open to sql injection attacks that can destroy your database.</p> <p>to find out where the problem is run profiler and check the stmt:starting ...
C++ Library for image recognition: images containing words to string <p>Does anyone know of a c++ library for taking an image and performing image recognition on it such that it can find letters based on a given font and/or font height? Even one that doesn't let you select a font would be nice (eg: readLetters(Image im...
<p>I've been looking into this a lot lately. Your best is simply Tesseract. If you need layout analysis on top of the OCR than go with Ocropus (which in turn uses Tesseract to do the OCR). Layout analysis refers to being able to detect position of text on the image and do things like line segmentation, block segmentati...
Most efficient way to convert BCD to binary <p>I have the code below to convert a 32 bit BCD value (supplied in two uint halves) to a uint binary value.</p> <p>The values supplied can be up to 0x9999, to form a maximum value of 0x99999999. </p> <p>Is there a better (ie. quicker) way to achieve this? </p> <pre><code>...
<p>If you've space to spare for a 39,322 element array, you could always just look the value up.</p>
How can I get and set the 'read-only' property of an edit box? <p>How can I get and set the 'read-only' property of an edit box?</p>
<p>The CEdit class has a SetReadOnly method which can be called at run-time. Details on MSDN: <a href="http://msdn.microsoft.com/en-gb/library/aa279328(VS.60).aspx">http://msdn.microsoft.com/en-gb/library/aa279328(VS.60).aspx</a></p>
Hide the uninstaller in Add/Remove Programs? <p>I am creating windows installer project using Visual Studio 2005.</p> <p>Is there an option make it so that my project does NOT have an uninstall option in Add/Remove programs?</p> <p>One of my customers has asked me to do this.. <strong>Here's Why</strong>: Because the...
<p>You just need to set ARPSYSTEMCOMPONENT=1 in the Property table of the installer using <a href="http://www.microsoft.com/DownLoads/details.aspx?familyid=6A35AC14-2626-4846-BB51-DDCE49D6FFB6&amp;displaylang=en">Orca</a> (Can't be done directly in Visual Studio from what I know)</p> <p>This is commonly used when a pr...
ASP.NET MVC Release Date <p>Does anybody know if there is an official or estimated release date for the ASP.NET MVC framework? I'm starting on a project that I hope to have completed by mid March and it would be a perfect candidate for the platform, but I don't want to release it under a framework that isn't completed...
<p>Originally it was supposed to RTW by the end of 2008. That was delayed without explanation. <a href="http://2009.visitmix.com/" rel="nofollow">Mix is March 18-20</a>. I would guess that's a pretty likely time for it to RTW. According to Phil Haack's twittering, a release candidate will be out soon.</p>
What is the best way to pass information from java to c++? <p>I have a java application I need to pass some info to a C++ program. It has been suggested that I use some simple socket programming to do this. Is this the best way? If not what are the alternatives? If so, how should I go about learning about socket pr...
<p>You have a few options:</p> <ul> <li>Pass a file from Java to C++. This is probably simplest. It's easy to test and shouldn't require any 3rd party libraries on either end.</li> <li>Use sockets as mentioned. In C++, if you require a cross-platform solution a library such as <a href="http://www.cs.wustl.edu/~schmidt...
How to rename the Node running a mnesia Database <p>I created a Mnesia database / Schema on machine1. The node was named mypl@machine1. I then moved all files to machine2, because machine1 broke down. Everything runs fine as long as the code is running with the name "mypl@machine1". Obviously this is somewhat confugsin...
<p>I don't think this can be done online on a single node(anyone?), but it is possible to do via a backup/restore in addition to running two nodes and adding table copies. In the <a href="http://erlang.org/doc/apps/mnesia/part_frame.html">Mnesia User's guide</a> section 6.9.1 you'll find some code that uses mnesia:trav...