input
stringlengths
51
42.3k
output
stringlengths
18
55k
UIComboBox... Where is it? <p>So I'm pretty sure i already know the answer to this, but does the SDK include access to the combo box control used in mobile safari?</p> <p>It should be easy enough to build one... but I'm not looking to re-invent the wheel if I don't have to.</p>
<p>Not built in, no. Even as they have its just a text field and a UITable working together.</p>
ASP.net: Does anyone know how to implement youtube search box like effect? <p>When the search text box on youtube have focus on it, it is sort of highlighted with blue color around the text box. I'll like to implement that kind of effect on my web app. does anyone know how that's done or something similar?</p> <p>Jack...
<p>You'll use Javascript to change the textbox behavior based on the client events (gaining/losing focus). You might see <a href="http://www.dotnet2themax.com/showcontent.aspx?id=00fa0fd6-4970-4ddf-aa6b-335c3d1259be" rel="nofollow">this article</a> to start which covers the highlighting. Adjusting border properties w...
Good tools for analysing COM object registry interference? <p>I have inherited two complicated COM objects. One was derived from the other and (allegedly) the GUIDs, etc., were all changed so that they should not interfere. They do interfere and so far our debugging has not identified the culprit -- we've done registr...
<p>If you have Visual Studio, you could use <a href="http://nidget.wordpress.com/2012/08/01/create-registry-file-reg-equivalent-to-the-regsvr32-command/" rel="nofollow">regcap</a> to pull out the registry entries and then just collect a list of GUIDs via a script. You could also use OLEView (also from Visual Studio) to...
Google maps api database interaction <p>I am currently working on a project where users need to be able to enter geological data (such as a certain street name) into a website which will be put into a database and then retrieved and displayed on a Google map for all users to see.</p> <p>I've done a little research and...
<p>Looks like your problem has a few separate steps:</p> <ol> <li><p>Sign up for a Google Maps API key.</p></li> <li><p>Write something that lets the user input the address and save it in the database.</p></li> <li><p>The same script should convert the address to a coordinate using Geocodeing. The result should (must)...
How to fix: Dynamic SQL generation for the DeleteCommand is not supported against a SelectCommand that does not return any key column information <p>My code works. After I copy about 10 tables I get an error. <code>Dynamic SQL generation for the DeleteCommand is not supported against a SelectCommand that does not retur...
<p>No coding example is really going to work. You have to make a determination from the table as to what is the unique identifier for the table. If there is no primary key (or at the least, a unique index), then you are out of luck.</p> <p>The only way around this is to create a dynamic command yourself, which compa...
Passing a method as a parameter in Ruby <p>I am trying to mess around a little bit with Ruby. Therefor I try to implement the algorithms (given in Python) from the book "Programming Collective Intelligence" Ruby.</p> <p>In chapter 8 the author passes a method a as parameter. This seems to work in Python but not in Rub...
<p>The comments referring to blocks and Procs are correct in that they are more usual in Ruby. But you can pass a method if you want. You call <code>method</code> to get the method and <code>.call</code> to call it:</p> <pre><code>def weightedknn( data, vec1, k = 5, weightf = method(:gaussian) ) ... weight = weigh...
How can I strip Python logging calls without commenting them out? <p>Today I was thinking about a Python project I wrote about a year back where I used <code>logging</code> pretty extensively. I remember having to comment out a lot of logging calls in inner-loop-like scenarios (the 90% code) because of the overhead (<c...
<p>What about using <a href="http://docs.python.org/library/logging.html?highlight=logging#logging.disable">logging.disable</a>?</p> <p>I've also found I had to use <a href="http://docs.python.org/library/logging.html?highlight=logging#logging.Logger.isEnabledFor">logging.isEnabledFor</a> if the logging message is exp...
Android TextView Timer <p>For my Android application there is a timer that measures how much time has passed. Ever 100 milliseconds I update my TextView with some text like "Score: 10 Time: 100.10 seconds". But, I find the TextView only updates the first few times. The application is still very responsive, but the labe...
<p>The general solution is to use android.os.Handler instead which runs in the UI thread. It only does one-shot callbacks, so you have to trigger it again every time your callback is called. But it is easy enough to use. A blog post on this topic was written a couple of years ago: </p> <p><a href="http://android-de...
How do you specify a tab in .screenrc? <p>According to <a href="http://www.mattcutts.com/blog/screen-power-tips-screenrc/" rel="nofollow">this website</a>, you can change to command key sequence used by the Unix "screen" utility like this:</p> <pre><code>escape ^Bb # Instead of Control-a, make the # escape...
<p>Never tried it, but you may have a go with this <a href="http://www.staldal.nu/tech/2009/01/10/how-to-use-ctrl-tab-in-gnu-screen/" rel="nofollow">link</a></p>
C# regular expressions - matching whole words? <p>I am writing a program that needs to search a LARGE text document for a large collection of words. The words are all file names, with underscores in them (eg, this_file_name). I know how to open and iterate through a text document, but I'm curious whether I should use...
<p>It would be helpful to see a sample of the source text. but maybe this helps</p> <pre><code>var doc = @"asdfsdafjkj;lkjsadf asddf jsadf asdfj;lksdajf sdafjkl;sjdfaas sadfj;lksadf sadf jsdaf jf sda sdaf asdf sad jasfd sdf sadf sadf sdajlk;asdf this_file_name asdfsadf asdf asdf asdf asdf sadf asdfj asdf sdaf sadfs...
Star Programmers [Team] vs Overall team quality <p>I want to know if others have experienced the situation where people around you are very smart and have few star programmers but as a team you are still struggling to move. I am not talking about people with arrogance/pride or social handicap. </p> <p>Does motivation ...
<p>Star programmers are supposed to be the <strong>leaders</strong>. If none of your programmers are taking intiative and carrying on the project, <strong>none of them are star programmers</strong> (or good star programmers, if bad ones exist).</p> <p>That, or, as <a href="http://stackoverflow.com/questions/523050/st...
How do I get a user GUID from a selected item in a DropDownBox that is databound to a LINQ datasource? <p>This should be pretty straight forward but I can't seem to get my newbie mind around it. I have a ASP.net page that needs to create a new database entry based on user input from a web form. </p> <p>One control in ...
<p>Can you post some code of how you're binding this?</p> <p>If it is bound to the user properly, you should be able to do the following.</p> <pre><code>UserClass user = MyDropDown.SelectedValue as UserClass; </code></pre> <p>Just substitute the actual class name for the user and the proper name for the dropdown.</p...
Awesome Visual Studio Macros <p>For a small community discussion, what are some essential Visual Studio macros you use?</p> <p>I just started learning about them, and want to hear what some of you can't live without.</p>
<p>I add buttons on the toolbar for the following 3 macros. Each will take the currently selected text in any file and google it (or MSDN-it, or spell-check-it). Make up a nifty icon for the toolbar for extra style-points.</p> <pre><code>Private Const BROWSER_PATH As String = "C:\Program Files\Mozilla Firefox\firefox....
Sequentially firing multiple random timeouts in JavaScript <p>I know at first glance (due to the title) this looks like one of the "Did you try searching Google before posting?" questions, but I can't seem to find an answer for the specific issue I'm experiencing. Sorry if I'm a noob.... still learning :)</p> <p>I n...
<p>Have you tried cumulatively setting the timeout? Stick a variable outside of your loop and initialize it to 0. Let's call it timeout for now. Add a random amount of time to this variable at the beginning of each iteration of your loop, and make the timeout work off of that. This way, you are ensured that functio...
Kdevelop as a Rails IDE <p>I would like to use Kdevelep as a Ruby on Rails IDE as I'm using Linux. How do I set up Kdevelop to enable this?</p>
<p>You could use Kdevelop or Kate, although I don't know that there is a big community of support for these editors. If you are on Linux you are best to check out VIM, it's the 2nd most popular editor for Ruby/Rails (with Textmate being #1). </p> <p>There is a really good writeup on how to set-up VIM at:</p> <p><a ...
Crawling Ajax.request url directly ... permission error <p>I need to crawl a web board, which uses ajax for dynamic update/hide/show of comments without reloading the corresponding post. I am blocked by this comment area.</p> <p>In Ajax.request, url is specified with a path without host name like this :</p> <pre><cod...
<p>Cross site XMLHttpRequest are forbidden by most browsers. If you want to crawl different sites, you will need to do it in a server side script.</p>
retrieve a multi-column PK in MySQL <p>How do I retrieve a multi-column PK in MySQL?</p> <p>For example I have my primary key setup as PRIMARY KEY (<code>donor_id</code>,<code>country_id</code>)</p> <p>Now if I want to get the primary key value without concatenating those 2 fields in a select query, how do I do t...
<p>It's not clear what you mean by "without concatenating". A simple</p> <pre><code>SELECT donor_id, country_id FROM table WHERE ...; </code></pre> <p>will retrieve the records; you don't need to apply a <code>CONCATENATE()</code> function or anything like that. This is the Right Way to select two records from a tabl...
Is there a view for inputing integers in Android? <p>I'm looking for something like the individual parts of the date picker dialog. A view that allows you to input integers (and only integers) that you can limit (between 1 and 10 for example), where you can use the keyboard or the arrows in the view itself. Does it exi...
<p>The NumberPicker widget is probably what you want. Unfortunatly it's located in com.android.internal.Widget.NumberPicker which we cannot get to through normal means.</p> <p>There are two ways to use it:</p> <ol> <li>Copy the code from android source</li> <li>Use reflection to access the widget</li> </ol> <p>Here...
JUMP and CALL <p>How is a JUMP and CALL instruction different? How does it relate to the higher level concepts such as a GOTO or a procedure call? (Am I correct in the comparison?)</p> <p>This is what I think: </p> <p>JUMP or GOTO is a transfer of the control to another location and the control does not automatically...
<p>You're mostly right, if you are talking about CALL/JMP in x86 assembly or something similar. The main difference is:</p> <ul> <li>JMP performs a jump to a location, without doing anything else</li> <li>CALL pushes the current instruction pointer on the stack (rather: one after the current instruction), and then JMP...
How to return value from html popup <p>I need a terse, clean way to implement this in asp.net mvc (+/- jquery or js)?</p> <p>User clicks an element in webform A; Webform B pops up; User interracts with webform B; On closing webform B, probably by a submit button, the source element in webform a is updated with a valu...
<p>With ASP.NET MVC, I'd probably render a DIV on the page, initially hidden, perhaps via AJAX if the contents depend on values selected on the initial page. I'd use the jQuery UI dialog plugin to popup the dialog. The dialog could contain a form that submits back to the server. You could also use the onclose handle...
Find and Remove some text in Excel Worksheet with c# <p>i wanna find some text for example "Joe" and remove it from where it is in Excel Worksheet with C# ?</p>
<p>You would need to use the Range.Replace method, and simply replace with an empty string. </p> <pre class="lang-cs prettyprint-override"><code>static void ReplaceTextInExcelFile(string filename, string replace, string replacement) { object m = Type.Missing; // open excel. Application app = new Applicati...
Union or Use Flow Control Logic to Determine which table to report on <p>I'm working with a 3rd pary app where I can't alter the tables. We built custom matching "Monthly" tables with an additional datetime column "AsOfDate" where we dump the data at the end of the month and flag those data with the date of last day of...
<p>I prefer the non-union solution. Selecting from a single table will always be faster than doing a union and selecting a single table's data from the union.</p>
Update trigger behavior in SQL 2005 <p>I used an Update statement inside a procedure to update a table which has an update trigger. Does the update statement complete after the trigger completes or what?</p>
<p>the trigger runs as part of the UPDATE statement (after the data in the table has been updated); the proc resumes after this. There are also "instead of" triggers that <em>replace</em> the UPDATE statement.</p> <p>See <a href="http://msdn.microsoft.com/en-us/magazine/cc164047.aspx" rel="nofollow">here</a> for more....
Generate combinations ordered by an attribute <p>I'm looking for a way to generate combinations of objects ordered by a single attribute. I don't think lexicographical order is what I'm looking for... I'll try to give an example. Let's say I have a list of objects A,B,C,D with the attribute values I want to order by be...
<p>Actually, I think you <em>do</em> want lexicographic order, but descending rather than ascending. In addition:</p> <ul> <li>It's not clear to me from your description that A, B, ... D play any role in your answer (except possibly as the container for the values).</li> <li>I think your question example is simply "Fo...
jQuery UI datepicker translation <p>How can I translate the datepicker from jQuery UI into an other language (german for exaple)?</p>
<p>There are already <a href="http://ui.jquery.com/demos/datepicker/#localization">localized versions of the jQuery Datepicker</a>. The demo doesn't appear to work as intended, but if you take the source code and build a page, you can see that it works</p> <p><strong>EDIT:</strong></p> <p>You can see the <a href="htt...
.Net- should I use the Split-function or the split-method? <p>Background:</p> <p>I needed to split a string of numerous words into an array which separates the words for me for further use later on in my code. However, I needed to get rid of any numbers which might be present in the string so I declared a string conta...
<p>Here's the code that gets executed for both; decide for yourself. I like string.split() more. </p> <p>Here is the code that gets executed when you call <strong>string.split()</strong>:</p> <pre><code>Private Function InternalSplitKeepEmptyEntries(ByVal sepList As Integer(), ByVal lengthList As Integer(), ByVal num...
Sockets in C#: How to get the response stream? <p>I'm trying to replace this:</p> <pre><code>void ProcessRequest(object listenerContext) { var context = (HttpListenerContext)listenerContext; Uri URL = new Uri(context.Request.RawUrl); HttpWebRequest.DefaultWebProxy = null; HttpWebRequest httpWebRequest ...
<p>Here's some code that works for me.</p> <pre><code>using System; using System.Collections.Generic; using System.IO; using System.Net; using System.Net.Sockets; using System.Text; using System.IO.Compression; namespace HttpUsingSockets { public class Program { private static readonly Encoding DefaultEnc...
ASP.NET: Your most used httpmodules <p>Interested in description of your most used ASP.NET httpmodules that solved a specific problem for your webapp.<br/> Best practices and in-the-field usages are welcome.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa479332.aspx" rel="nofollow">ELMAH</a> is very popular and useful for exception logging in ASP.NET applications.</p>
Is there a Delphi library which reads and writes .properties files? <p>I thought about creating my own, but there are many details to consider to make it 100% compatible with Java .properties files, so I'm asking first.</p>
<p>There used to be a Java IDE called <a href="http://www.gexperts.com/products/gel/gel.asp" rel="nofollow">Gel</a>. It was written in Delphi, and it was a good IDE, so I expect it was capable of working with property files. The author has discontinued work on the project. In his <a href="http://www.gexperts.com/blog/a...
How do you find the paths of linked images in Adobe Illustrator 9? <p>I have an Illustrator file with linked images. I'd actually like to instead embed the images. I first have to know which files they are. How do I find out? I'm using Illustrator 9.</p>
<p>The first Illustrator version I ever used was 10, but, is there a links pallete in version 9? Try the window menu and look for "links". It has a few options there to search for the image you want, relink, open the original, etc.</p>
Easy way to pdf a web report <p>We are trying to create a web reporting system, with the standard flash chart's, one of the major requirements is that this report must be emailed to customers on a regular schedule as a PDF file.</p> <p>Does anyone know of either</p> <ul> <li>An easy tool to point at the webpage and p...
<p>If your web reporting system is being built using .NET you may want to look into ABCpdf Component for .NET which can be found <a href="http://www.websupergoo.com/abcpdf-1.htm" rel="nofollow">here</a>. I am not sure if it works with flash charts, as at my work we use charts that are images, but give it a try.</p>
Using ironscheme in visual studio 2008 <p>Though it says on the IronScheme codeplex site that a plugin is included for visual studio, I have no idea how to get ironscheme working with VS...</p> <p>Is it possible? If so , how?</p> <p>Thanks </p>
<p>Firstly, you definitely need Visual Studio 2008 SP1, without SP1 it will <a href="http://ironscheme.codeplex.com/Thread/View.aspx?ThreadId=50805" rel="nofollow">cause problems</a>.</p> <p>Secondly, follow the instructions in the <a href="https://ironscheme.svn.codeplex.com/svn/IronScheme/IronScheme.Console/docs/vis...
Timer code for online quiz on mobiles <p>We are doing project on online quiz tool for mobile devices using J2ME. We got the code for midlet interface, webserver and connections. But we need to implement timer in it. So anyone can give suggestions for that code and where can be it beneficial to implement it?</p>
<p>I am not sure if I understand the question but it sounds like you want to use java.util.Timer. See <a href="http://www.java2s.com/Code/Java/J2ME/Timer.htm" rel="nofollow">http://www.java2s.com/Code/Java/J2ME/Timer.htm</a> for the details.</p>
Best Practice for PK in SQL Server <p>I have been wondering what the best practices or ramifications are in setting up the PK in a M2M table in SQL Server. For instance:</p> <p>I have 2 tables</p> <ul> <li>Users</li> <li>Roles</li> </ul> <p>I am making a new table</p> <ul> <li>UserRole</li> </ul> <p>Which has 2 fi...
<p>Standard procedure for these cases is to have two indexes. The unique PK is the two fields composite, with the field with the greater cardinality first, i.e. UserID; and the second index with just the secondary field (i.e. RoleID).</p> <p>Then cluster on whichever is likely to be involved in more multirecord result...
what is the best way to mark any text? <p>I need users to mark some section of text with custom tags, I can't use the xml based tags as the whole text will be embedded in XML documents and all the &lt; will be converted to html escape code &lt;. I want users to marks some section of text with tags like skip, bookmark, ...
<p>The three common markups I know of for this purpose are <a href="http://daringfireball.net/projects/markdown/" rel="nofollow">Markdown</a> (used, I believe, by SO), <a href="http://www.textism.com/tools/textile/" rel="nofollow">textile</a>, and <a href="http://pear.php.net/pepr/pepr-bbcode-help.php" rel="nofollow">B...
Asp.net E-commerce performance <p>I am developing e-commerce project on Asp.Net 3.5 with C#. I am using 3 tiers (Data + Business + UI) structure to reach the data from database (Msql 2005).</p> <p>There are stored procedures and everything going on from them.(CRUD methods)</p> <p>There is a performance issue here, pr...
<p>Since there is upwards of 1000 Databases sharing resources I would take a stab that might be your issue.... If you connect to your database and it takes 5 seconds to run a simple query then you can guess the problem.</p> <p>I would add some stopwatch functionality onto a "testpage" that runs on your web server. Thi...
The right language for OpenGL UI prototyping. Ditching Python <p>So, I got this idea that I'd try to prototype an experimental user interface using OpenGL and some physics. I know little about either of the topics, but am pretty experienced with programming languages such as C++, Java and C#. After some initial researc...
<p>It seems you aren't mainly having a problem with Python itself, but instead with the IDE.</p> <p><em>"Bad API documentation"</em></p> <p>To what API? Python itself, Qt or some other library you are using?</p> <p><em>"lacking code completion (due to dynamic typing)"</em></p> <p>As long as you are not doing anythi...
Fast min on span <p>Given a list of arrays and lots of setup time I need to quickly find the smallest value in some sub-span of each array. In concept:</p> <pre><code>class SpanThing { int Data; SpanThing(int[][] data) /// must be rectangulare { Data = data; //// process, can take a wh...
<p>Your described approach sounds like you're trying to do some sort of <a href="http://en.wikipedia.org/wiki/Memoization" rel="nofollow">memoization</a> or caching, but that's only going to help you if you're checking the same spans or nested spans repeatedly.</p> <p>The general case for <em>min([0..n])</em> is going...
Showing data and counting from multiple databases in MySQL <p>I have two tables, that is joined in some way. I've spent the last hour googling around, not finding any concrete answers that worked in my case.</p> <p>The case is, table 1 is called Clients, and table 2 is called Projects. I need to list all the client na...
<p>You don't say anything about your app, but I'd recommend separating querying from displaying. Let SQL get the data for you and then let something else do presentation.</p>
C# ComboBox in DropDownList style, how do I set the text? <p>I want to use a ComboBox with the DropDownList style (the one that makes it look like a button so you can't enter a value) to insert a value into a text box. I want the combobox to have a text label called 'Wildcards' and as I select a wildcard from the list ...
<p>The code you specify:</p> <pre><code>comboBox.Text = "Wildcards"; </code></pre> <p>...should work. The only reason it would not is that the text you specify is not an item within the comboBox's item list. When using the DropDownList style, you can only set Text to values that actually appear in the list.</p> <p>I...
Best way to send email from my web app so it looks like it came from my users account <p>I'm working on a web application. A user will create an email message that will be sent to another person.</p> <p>I would like the e-mail that gets sent to appear from the user's name and e-mail address of the user on my system. A...
<p>Basically all you need to do is set the <code>From</code> header to the email address of the user sending the email. The value of <code>From</code> is what is displayed in a recipient's email client. Most spam detection systems in place today look only at the message content, not the email headers, so you currently ...
Ajax.BeginForm, user controls and updating something <p>I have a bit of a problem with user controls. Basically what I want to accomplish is the following:</p> <ol> <li>I have a view for editing an invoice.</li> <li>In this view I have a usercontrol with a list of invoice items</li> <li>I also have a div that is activ...
<p>First you would call an aspx page w/ jQuery (we will use an http handler that we will map in the web.config below, more on this later)</p> <p>the basic idea is that we want the server side to render the user control as xhtml and dump this "updated" markup back into the DOM in our success method (client side)</p> <...
NumPy, PIL adding an image <p>I'm trying to add two images together using NumPy and PIL. The way I would do this in <a href="http://en.wikipedia.org/wiki/MATLAB">MATLAB</a> would be something like:</p> <pre><code>&gt;&gt; M1 = imread('_1.jpg'); &gt;&gt; M2 = imread('_2.jpg'); &gt;&gt; resM = M1 + M2; &gt;&gt; imwrite(...
<p>As everyone suggested already, the weird colors you're observing are overflow. And as you point out in the <a href="http://stackoverflow.com/questions/524930/numpy-pil-adding-an-image/524943#524943">comment of schnaader's answer</a> you <strong>still get overflow</strong> if you add your images like this:</p> <pre>...
python coding speed and cleanest <p>Python is pretty clean, and I can code neat apps quickly. But I notice I have some minor error someplace and I dont find the error at compile but at run time. Then I need to change and run the script again. Is there a way to have it break and let me modify and run?</p> <p>Also, I di...
<p><strong>"I don't find the error at compile but at run time"</strong></p> <p>Correct. True for all non-compiled interpreted languages.</p> <p><strong>"I need to change and run the script again"</strong></p> <p>Also correct. True for all non-compiled interpreted languages.</p> <p><strong>"Is there a way to have ...
LdapContext, how to do select count(*) <p>I am using an LdapContext in java to query an LDAP server (I think the server is Sun server version 5.2). I use the LdapContext.search(String name, String filter, SearchControls cons) method for the regular querys, but I don't know how to run a query equivalent to sql's "select...
<p>Have you tried the Context.list(String name) method? I don't know about the performance and you can't apply filters.</p>
which design pattern to use for filtering query? c# <p>I have a database table with a list of products (clothing). The products belong to categories and are from different stores.</p> <p>Sample categories: tops, bottoms, shoes</p> <p>Sample stores: gap.com, macys.com, target.com</p> <p>My customers can request to fi...
<p>According to Eric Evan's "Domain Drive Design" you need the specification pattern. Something like this</p> <pre><code>public interface ISpecification&lt;T&gt; { bool Matches(T instance); string GetSql(); } public class ProductCategoryNameSpecification : ISpecification&lt;Product&gt; { readonly string Catego...
Java: Accounting for taskbars/menubars/etc when placing a window on the desktop? <p>When my program starts, the main window places itself where it was when it was last closed. I want to modify this behavior some so if the window is off-screen (or partially off-screen) it moves itself to fully on screen. </p> <p>I've...
<p>Use getScreenInsets (Java 4+):</p> <pre><code>static public Insets getScreenInsets(Window wnd) { Insets si; try { if(wnd==null) { si=Toolkit.getDefaultToolkit().getScreenInsets(new Frame().getGraphicsConfiguration()); } else { si=wnd.getToolkit() ...
C# to SQL Server on client's network <p>I have a client with an established accounting database for which I want to write a report. I am planning to use VS 2008. I have no difficulty doing this for SQL Server running on my own machine but want to know how best to publish a c# program to run on the client's network SQ...
<p>Store the connection string in a configuration file (Visual Studio will do this for you most of the time now) and just adjust it when you deploy the app on the client's network.</p> <p>Remote Assistance Method - check out Microsoft SharedView, and if you want to pay for a higher-end solution, LogMeIn Rescue. Edit -...
How to remove diagramming support objects from SQL Server? <p>I need to remove diagramming support tables, stored procs, views, etc from SQL Servrer using TSQL script. </p> <p>Is there such a script available? </p> <p>SQL 2005 and 2008.</p>
<pre><code>DROP PROCEDURE dbo.sp_alterdiagram; DROP PROCEDURE dbo.sp_creatediagram; DROP PROCEDURE dbo.sp_dropdiagram; DROP PROCEDURE dbo.sp_helpdiagramdefinition; DROP PROCEDURE dbo.sp_renamediagram; DROP PROCEDURE dbo.sp_upgraddiagrams; DROP PROCEDURE dbo.sp_helpdiagrams; DROP FUNCTION dbo.fn_diagramobjects; ...
How are variables on the stack accessed? <p>Suppose we have these local variables:</p> <pre><code>int a = 0; int b = 1; int c = 2; int d = 3; </code></pre> <p>As far as I know, these will be allocated on the system stack, like this:</p> <pre><code>| | | 3 | d | 2 | c | 1 | b |_0_| a </code></pre> <p>Does this mea...
<p>The local variables on the stack are usually accessed relative to the so-called <i>frame pointer</i>, which points at the start of your stack frame. It would also be possible to do this relative to the stack pointer, but since this moves around during evaluation of expressions it is more difficult to keep track of.<...
Large Text and Images In SQL <p>Is it a good idea to store large amounts of text (eg html pages) inside your SQL database? Or is it a better idea to store it as html files in the filesystem?</p> <p>The same goes for images - is it a good idea to store image data in the database or better to put them on disk?</p> <p>W...
<p>Storing binary data (documents, images etc) in the database has some advantages.</p> <ul> <li><p>You can commit the update of the document itself in the same transaction as the information (name, date etc) you want to store about the document. This means you don't have to worry about writing your own two-phase com...
Pathname.rb error on running a minitest testcase <p>I'm running Ruby 1.8.6. </p> <p>I installed the minitest 1.3.1 gem, which is the new defacto replacement for the Test::Unit framework in Ruby 1.9 The API is supposed to be the same.</p> <p>I wrote a small test to get things rolling:</p> <pre><code>require 'rubygems...
<p>I can't see anything wrong with your code. It looks almost exactly the same as the Ruby 1.8.6 &amp; MiniTest example in my blog post: <a href="http://blog.floehopper.org/articles/2009/02/02/test-unit-and-minitest-with-different-ruby-versions" rel="nofollow">Test::Unit and MiniTest with different Ruby versions</a>.</...
Should I use Java applets or Flash to make webpage-embeddable physics simulations? <p>I want to start working on some simple physics simulations that I can embed onto my website. I have a lot of experience with web programming with languages like PHP and javascript, a fair amount of experience with python and some expe...
<p>I have a fair amount in pyhsics and java applet and flash.</p> <p>I strongly recommend doing it in flash. First of all is the flash player much better distributed than the java runtime. Second is it since flash player 9 (10 is current) and actionscript3 much faster and less ressource hungry.</p> <p>There are some ...
Bind POCO to UserControl <p>Hi I am in the process of writing my first .net gui. I am wondering if there is some specific way I need to apply to my poco objects for them to be bindable to a usercontrol. I have a few objects but I seem to be unable to bind them to my usercontrol. </p> <p>I read somewhere that they need...
<p>Which architecture?</p> <p>For 1-way binding, you don't need anything other than public properties - and maybe some <code>TypeConverter</code> implementations for any bespoke data types (<code>struct</code>s etc)</p> <p>For full 2-way binding, you'll need an eventing implementation - any of:</p> <ul> <li>a "publi...
HQL "Contains" statement howto? <p>I have an entity that has a string property called Tags. I would like to query this entity based upon if a certain string is located in Tags property.</p> <p>So for example, I would have a function IList GetEntityByTag(string tag), this would return all Entity's that have the value o...
<p>If you want to know if a tag is a substring in your Tags property, you might want to consider these tips:</p> <ul> <li>You might want to convert both the string you are searching in and searching for to lowercase first. Expression.ilike does this for you. Score.</li> <li>To find out if your search term is anywher...
JSP -- default value for EL functions arguments <p>Is there a way to have default values for EL functions arguments (e.g., optional arguments)?</p>
<p>you can make your own tags, which supply these values that will wrap the functions you are trying to call. JSP2.1 has .tag files that are basically jsp files, and it would be VERY easy to define default values using those.</p>
How to add background images to Delphi forms <p>How can I add a background image to my delphi form? I added a TImage, but now the labels aren't visible any more, and the texts of my checkboxes are in a blue "box" (blue is the background color i chose). This blue doesn't look very good on the background image, and the h...
<p>For the labels: make sure that they are transparent (Transparent property in the Object Inspector), and that they are on top of the TImage in the Z-order of controls. To correct this you can execute the "Send to back" command on the TImage component in design mode, it will make all other non-windowed controls appear...
Linq-to-entities: How to create objects (new Xyz() vs CreateXyz())? <p>What is the best way of adding a new object in the entity framework. The designer adds all these create methods, but to me it makes more sense to call new on an object. The generated CreateCustomer method e.g. could be called like this:</p> <pre><c...
<p>As Andrew says (up-voted), it's quite acceptable to use regular constructors. As for why the "Create" methods exist, I <em>believe</em> the intention is to make explicit which properties are required. If you use such methods, you can be assured that you have not forgotten to set any property which will throw an exce...
Byte order with a large array of characters in C <p>Hey guys, question from a C/Networking newbie...</p> <p>I'm doing some socket programming in C and trying to wrestle with byte order problems. My request (send) is fine but when I receive data my bytes are all out of order. I start with something like this...</p> <p...
<p>Ok, there seems to be problems with what you are doing on two different levels. Part of the confusion here seems to stem for your use of pointers, what type of objects they point to, and then the interpretation of the encoding of the values in the memory pointed to by the pointer(s).</p> <p>The encoding of multi-by...
Handling overflow when casting doubles to integers in C <p>Today, I noticed that when I cast a double that is greater than the maximum possible integer to an integer, I get -2147483648. Similarly, when I cast a double that is less than the minimum possible integer, I also get -2147483648. </p> <p>Is this behavior d...
<p><code>limits.h</code> has constants for max and min possible values for integer data types, you can check your double variable before casting, like</p> <pre><code>if (my_double &gt; nextafter(INT_MAX, 0) || my_double &lt; nextafter(INT_MIN, 0)) printf("Overflow!"); else my_int = (int)my_double; </code></pre...
Present tabular data on webpage so the user can directly copy it into Excel <p>On my webpage I want to able to present tabular data and give the user the possibility to copy it directly into excel. This however doesn't work, all of the data is pasted in one cell:</p> <pre><code>&lt;table&gt; &lt;tr&gt;&lt;td&gt;Column...
<p>I just thought of the solution while typing out the question. You need to specify the table body:</p> <pre><code>&lt;table&gt; &lt;tbody&gt; &lt;tr&gt;&lt;td&gt;Column 1&lt;/td&gt;&lt;td&gt;Column 2&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Data 1.1&lt;/td&gt;&lt;td&gt;Data 2.1&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;t...
@@DBTS in MySql <p>Hey guys, I want to ask if there is an equivalent to the @@DBTS TSQL global variable in MySql (I need to access the timestamp of the last row that has been accessed in the whole database, not just one table).</p> <p>I need this because I'm trying to use Microsoft Sync Framework and MySql for bi-dire...
<p>The closest you can get, as far as I know, is a query like this:</p> <pre><code>USE INFORMATION_SCHEMA; SELECT MAX(UPDATE_TIME) FROM TABLES WHERE UPDATE_TIME &lt; NOW(); </code></pre> <p>The <code>INFORMATION_SCHEMA</code> database holds several tables of attributes of all tables in the database. The reason for th...
Embed Flash Object by bypassing rules? <p>Hi there i want to embed a youtube video to a profile page, but the social system does not allow embedding flash objects</p> <p>now i wonder if theres a possibility to bypass this rule, the first thing i was thinking of was embedding an iframe to a page that links the object.<...
<p>Have you tried using javascript to generate the flash object?</p> <p>I use swfobject (<a href="http://blog.deconcept.com/swfobject/" rel="nofollow">http://blog.deconcept.com/swfobject/</a>)</p> <h2>Html</h2> <pre><code>&lt;div id="youTubVideo"&gt; Loading You Tube Video &lt;/div&gt; </code></pre> <h2>Script</h2>...
Tool for distributed HTTP benchmarking? <p>I would like to benchmark a website that our company is developing. It will consist of multiple web- and backend-servers. </p> <p>To be able to properly simulate a large amount of request, I was thinking about using our dev machines (approx 15 Xp/Vista) and a few spare Red Ha...
<p><a href="http://jmeter.apache.org/" rel="nofollow">Apache JMeter</a> is a reference in this domain. You will setup on JMeter as controller and as many slaves as you need for your load depending on available memory and cpu.</p> <p>In you case it's better to use non gui testing for better performances results.</p>
Standard behavior of tellp on empty ostringstream <p>I have a question on the standard behavior of calling <code>tellp</code> on an empty <code>ostringstream</code>. I have a function foo which calls <code>tellp</code> the first thing:</p> <pre><code>void foo(std::ostream&amp; os) { std::ostream::pos_type pos = os...
<p>27.6.2.4:</p> <pre><code>pos_type tellp(); </code></pre> <blockquote> <p>Returns: if fail() != false, returns pos_type(-1) to indicate failure. Otherwise, returns rdbuf()->pubseekoff(0, <em>cur</em>, <em>out</em>).</p> </blockquote> <p>And <em>pubseekoff</em> returns -1 on fail. But am not sure why this h...
Html.Checkbox does not preserve its state in ASP.net MVC <p>I have this annoying issue with the checkbox created using the <code>Html.Checkbox</code> extension method. Apparently the state of the checkbox is not saved in case of a postback (due to a form validation error). Delving into the MVC code itself (<code>System...
<p>This issue was posted on <a href="http://www.codeplex.com/aspnet/WorkItem/View.aspx?WorkItemId=3136" rel="nofollow">codeplex</a> and will be fixed/supported in the MVC RTM. In the meantime, this is a nice <a href="http://174.129.228.43/archive/2009/02/09/4.aspx" rel="nofollow">workaround</a>.</p>
How to calculate the number of operations that occur during the execution of a for loop? <p>I had an exam a couple of days ago and today the Instructor gave us the key answer of the exam.</p> <p>One of the questions was</p> <blockquote> <pre><code>for ( j = 9; j &gt;= 1; j-- ) </code></pre> <p>Count the Number o...
<p>20 operations:</p> <pre><code>set j = 9 check if j(9) &gt;= 1 set j to 8 check if j(8) &gt;= 1 set j to 7 check if j(7) &gt;= 1 set j to 6 check if j(6) &gt;= 1 set j to 5 check if j(5) &gt;= 1 set j to 4 check if j(4) &gt;= 1 set j to 3 check if j(3) &gt;= 1 set j to 2 check if j(2) &gt;= 1 set j to 1 check if j(1...
How to represent a call being made in a loop in a sequence diagram? <p>I'm creating a sequence diagram, and one of the classes is being observed by another class. The observed class is calling update in the observer every 5 seconds in a loop. I need to show this in the sequence diagram. Is there a way to show it loo...
<p>A box enclosing the message send arrow (and whatever else is inside the same repetitive construct).</p> <p>See <a href="http://www.ibm.com/developerworks/rational/library/3101.html">this tutorial</a> for an example.</p> <p><img src="http://i.stack.imgur.com/I3ZdK.jpg" alt="sequence diagram with loop"> <a href="htt...
What's the best way to implement a counter field in MySQL <p>I want to start counting the numbers of times a webpage is viewed and hence need some kind of simple counter. What is the best scalable method of doing this?</p> <p>Suppose I have a table Frobs where each row corresponds to a page - some obvious options are...
<p>Inserting into a Database is not something you want to do on page views. You are likely to run into problems with updating your slave databases with all of the inserts since replication is single threaded on MySQL.</p> <p>At my company we serve 25M page views a day and we have taken a tiered approach.</p> <p>The ...
C programming: How to program for Unicode? <p>What prerequisites are needed to do strict Unicode programming?</p> <p>Does this imply that my code should not use <code>char</code> types anywhere and that functions need to be used that can deal with <code>wint_t</code> and <code>wchar_t</code>?</p> <p>And what is the r...
<p>The C standard (C99) provides for wide characters and multi-byte characters, but since there is no guarantee about what those wide characters can hold, their value is somewhat limited. For a given implementation, they provide useful support, but if your code must be able to move between implementations, there is in...
AutoIncrement fields on databases without autoincrement field <p>In MS Sql Server is easy create autoincrement fields. In my systems I stopped to use autoincrement fields for primary keys, and now I use Guid's. It was awesome, I've got a lot of advantages with that change. But in another non-primary key fields, I reall...
<p>The mechanism to generate unique id values <strong>must not</strong> be subject to transaction isolation. This is required for the database to generate a distinct value for each client, better than the trick of <code>SELECT MAX(id)+1 FROM table</code>, which results in a race condition if two clients try to allocat...
How to create backBarButtomItem with custom view for a UINavigationController <p>I have a <code>UINavigationController</code> into which I push several views. Inside <code>viewDidLoad</code> for one of these views I want to set the <code>self.navigationItem.backBarButtonItem</code> to a custom view (based on a custom i...
<p>As of iOS5 we have an <em>excellent new way of customizing the appearance</em> of almost any control using the <a href="http://developer.apple.com/library/ios/#documentation/uikit/reference/UIAppearance_Protocol/Reference/Reference.html">UIAppearance protocol</a>, i.e. <code>[UIBarButtonItem appearance]</code>. The ...
Entity Framework: Loading Many to One entity <p>Say I have a role entity and a site entity. Now there are many roles to one site, so on the Role class there is a Site property that represents that relationship. If I wanted the roles for a site I would do this:</p> <pre><code>Site.Roles.Load() </code></pre> <p>Probl...
<p>Actually, accessing it will not automatically load it. You can include the related entity in a single query using the Include method, but you can also use a Load method with references just like you can with collections--it's just not on the CLR reference property but on an EntityReference property parallel to the ...
How do I find the position of a cursor in a text box? C# <p>I have a standard WinForms TextBox and I want to insert text at the cursor's position in the text. How can I get the cursor's position?</p> <p>Thanks</p>
<p>Regardless of whether any text is selected, the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.textboxbase.selectionstart.aspx">SelectionStart</a> property represents the index into the text where you caret sits. So you can use <a href="http://msdn.microsoft.com/en-us/library/system.string.ins...
Just started C++: Undefined Symbol error on Compile <p>Here's the situation:</p> <p>I just started my first C++ class. I know nothing about C++ and despite this being the an intro to C++ class, the teacher has taught pretty much NO syntax for the language, just logic that we already know.</p> <p>Now he gave us a prog...
<p>It's complaining about <code>main</code> being undefined, and it's right. C and C++ require a <em>standalone</em> function named <code>main</code> which returns <code>int</code>. It is not sufficient to have a <em>class</em> with a method named <code>main</code>; the compiler only cares about the standalone one.</p>...
VS2008 files and "start debugging" <p>This may sound like a newbie question - and it is. I'm relatively new to vs, we started using it a few months ago, and I still haven't "mentally" made the change from the command line. So, if you could help me with 2 things:</p> <ol> <li>I create a new project (not a solution). He...
<blockquote> <p>I have to change only a tiny bit of code and I don't feel like getting the whole VS up just for that. How can I do that Debug thing from the command line, with the assumption I didn't change anything else.</p> </blockquote> <p>I think what you want here is not debugging but a rebuild of your project....
Best OpenId API for ASP.NET MVC application <p>I am developing an ASP.NET MVC application and I want to use OpenId.</p> <p>What is the best option? </p> <ul> <li>DotNetOpenId</li> <li>RPX</li> <li>Other???</li> </ul> <p>Does anyone know what StackOverflow uses? Is the Login UI custom-developed, or provided by an API...
<p>We use the excellent DotNetOpenId library here on Stack Overflow:</p> <blockquote> <p><a href="http://code.google.com/p/dotnetopenid/">http://code.google.com/p/dotnetopenid/</a></p> </blockquote> <p>now moved to:</p> <blockquote> <p><a href="http://www.dotnetopenauth.net/">http://www.dotnetopenauth.net/</a></...
F# naming convention <p>Is there an "official" naming / casing convention for F#?</p> <p>I'm always in doubt of using C# style or not: </p> <pre><code>Class.MyFunctionName or Module.my_function_name </code></pre> <p>In F# you're meant to mix BCL classes and F# library ones: they have different casing and the code l...
<p>Yes, there is confusion, because F# has morphed from OCaml to .Net over the years. Basically, the naming conventions are a "breaking change" - old code is inconsistent with new code.</p> <p>However, the May 2009 CTP has settled the issue.</p> <p>The <a href="http://blogs.msdn.com/dsyme/archive/2009/05/20/detailed-...
XML Documentation: <see> tag with multiple generic type parameters <p>I'm trying to use XML documentation on the members of a class, and in a certain case I would like to reference a generic type using a tag. The problem here is that a warning is generated when multiple generic type parameters are specified. It was ea...
<p>Use the .NET names, not the C# aliases:</p> <pre><code>&lt;see cref="Func{Int32, Boolean}" /&gt; </code></pre>
Book recommendations: PHP/MySQL and Dreamweaver? <p>I need a book that discusses PHP, mySql and Dreamweaver as I have a project and i don't know either of these technologies, so i need something to give me a headstart.</p>
<p>I don't think any book on PHP and MySQL is restricted to any single IDE like Dreamweaver. For a quick introduction to both together I can recommend <a href="http://www.dmcinsights.com/phpmysql/" rel="nofollow">PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide</a>. You can search the book from that site, o...
How to Implement Closures Using SpiderMonkey API? <p>I've been working with the SpiderMonkey C API and would like to implement a closure in C using their API. The one I would like to implement is fairly complex, but I can't even figure out how to do a simple one such as:</p> <pre><code>function x() { var i = 0; ...
<p>I don't know if there's a pure C way of doing closures or not. I would reccomend though, if you can, to just implement the functionality you need in javascript, and simply evaluate the javascript text in JSAPI. From there, use JSAPI to grab whatever handles/variables you need to implement your host functionality. It...
Java POI - anyone been able to extract numbers from formula cells? <p>I've been using Java POI for some time now, but have encountered a new problem, and I'm wondering if anyone has found a solution.</p> <p>When you read a spreadsheet, you need to know the type of cell in order to use the proper read method.</p> <p>S...
<pre><code> FileInputStream fis = new FileInputStream("c:/temp/test.xls"); Workbook wb = new HSSFWorkbook(fis); //or new XSSFWorkbook("c:/temp/test.xls") Sheet sheet = wb.getSheetAt(0); FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); // suppose your formula is in B3 Ce...
Selecting a date on a mobile web site <p>I'm working on a web site that includes creating appointments on the mobile site. I have to make it work on IE Mobile.</p> <p>The biggest challenge is to come up with a way to do date selection on a mobile site that:</p> <ul> <li>Is compact enough to not take forever to load o...
<p>Have you thought about masking input? I'm not sure how well it will meet your needs, but it's worth a shot. Here's a jQuery implementation:</p> <p><a href="http://digitalbush.com/projects/masked-input-plugin/" rel="nofollow">http://digitalbush.com/projects/masked-input-plugin/</a></p> <p>Edit: After thinking abo...
help in reading nested xml using xmlreader in php <pre><code>&lt;root&gt; &lt;thing&gt; &lt;specs&gt; &lt;spec1 /&gt; &lt;spec3 /&gt; &lt;spec2 /&gt; &lt;/specs&gt; &lt;details /&gt; &lt;more_info&gt; &lt;info1 /&gt; &lt;info2 /&gt; &lt;/more_info&gt; &lt;/thing&gt;...
<p>It depends what you mean by "value". If you have something like </p> <pre><code>&lt;spec3 /&gt;Value&lt;/spec3&gt; </code></pre> <p>Then readInnerXML should be giving you your value. </p> <p>If your value is in an attribute, </p> <pre><code>&lt;spec1 foo="my attribute" /&gt; </code></pre> <p>You'll need to us...
How to call Inline Table Function with output parameter from scalar function? <p>I would like to know if it's possible to call a inline function with an output parameter from a scalar function?</p> <p>For example: My inline function is called test_1(input parameter format bigint), the following example works great:<br...
<p>I can interpret what you're trying to do in two different ways.</p> <h3>Scenario 1:</h3> <p>You want to get a <strong>single value</strong> out of your <strong>kp</strong> table first, then run it through the static function, then feed the result to the inline function and get a table.</p> <p>In this case, you ca...
Obtaining an IntialContext from Weblogic without using clear text password <p>I can obtain the Weblogic InitialContext from a JNDI Client using the following properties as the Environment parameters for InitialContext</p> <pre><code>Hashtable jndiProps = new Hashtable(); jndiProps.put("java.naming.factory.initial", "...
<p>You could use symmetric encryption, encrypt the password value and store this in the properties file. Then before creating the initial context read the property value, decrypt it and update the property before passing the jndiProps object to the InitialContext constructor.</p> <p>The encryption key would still be o...
input and thread problem, python <p>I am doing something like this in python</p> <pre><code>class MyThread ( threading.Thread ): def run (s): try: s.wantQuit = 0 while(not s.wantQuit): button = raw_input() if button == "q": s.wantQ...
<p>You mean the while loop runs before the thread? Well, you can't predict this unless you synchronize it. No one guarantees you that the thread will run before or after that while loop. But if it's being blocked for 5 seconds that's akward - the thread should have been pre-empted by then.</p> <p>Also, since you're fi...
Read Cookies Using xcode in iphone app <p>My application needs to be able to read cookies stored by a page loaded in the UIWebView. I need to be able to read the cookies using xcode so that I can store some values in application settings. Does anyone know if its possible to read cookies using xcode? Your help is much a...
<p>You can use <a href="http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSHTTPCookieStorage_Class/" rel="nofollow">NSHTTPCookieStorage</a> to read/modify cookies. <code>UIWebView</code> is using this storage.</p>
Open source Application demonstrating layer Architcture <p>Many of u will agree that learning from open source project is another way of improving programming skills .Can me make list of open source applications that best demonstrates the use of layer architecture. </p>
<p>I guess <a href="http://www.jboss.com/products/jbossas/architecture" rel="nofollow">JBoss</a> is a good example of multiple layers Architecture...</p> <p><img src="http://www.jboss.com/images/appInstrumentation.gif" alt="alt text" /></p>
Type exists in two libraries <p>I'm trying to incorporate <a href="http://www.codeplex.com/linqtolucene" rel="nofollow">Linq to Lucene</a> in my Asp.net-mvc project.<br /> As with most web projects, I use the <a href="http://www.squaredroot.com/post/2008/07/08/PagedList-Strikes-Back.aspx" rel="nofollow">PagedList</a> t...
<p>It's generally a bad idea to add types to .NET BCL namespaces since it gives you no benefits whatsoever and causes major troubles in the long run. So the advice might be to move your helper class out of <code>System.Collections.Generic</code> namespace.</p>
How to deploy a Python application with libraries as source with no further dependencies? <p><strong>Background</strong>: I have a small Python application that makes life for developers releasing software in our company a bit easier. I build an executable for Windows using py2exe. The application as well as the binary...
<p>Just use <a href="http://pypi.python.org/pypi/virtualenv">virtualenv</a> - it is a tool to create isolated Python environments. You can create a set-up script and distribute the whole bunch if you want.</p>
What's the best practice for developing a PHP data import framework? <p>During our work as web developer for a meteorological company, we are faced with the same task over and over again: Get some files from somewhere (FTP/Web/directory/mail) and import the contained data to a database.</p> <p>Of course the file forma...
<p>I suggest borrowing concepts from <a href="http://en.wikipedia.org/wiki/Data_Transformation_Services" rel="nofollow">Data Transformation Services</a> (DTS). You could have data sources and data sinks, import tasks, transformation tasks and so on.</p>
How can I create a PFX file from a Java Keystore? <p>I have a Java keystore (.jks file) holding a single certificate. How can I create a .pfx file from this keystore?</p>
<p>From Java 6 onwards, <code>keytool</code> has an <code>-importkeystore</code> option, which should be able to convert a JKS store into a PKCS#12 store (.p12/.pfx):</p> <pre><code>keytool -importkeystore -srckeystore thekeystore.jks \ -srcstoretype JKS \ -destkeystore thekeystore.pfx \ ...
What is a good desktop programming language to learn for a web developer? <p>I'm want to learn a desktop programming language, preferably C, C++ or C#. I'm a PHP/HTML/CSS programmer and I would like to get into desktop applications. I need something pretty powerful and I would like to be able to create applications wit...
<p>edit:</p> <p>A <strong>web programmer</strong> wants to create <strong>Windows applications</strong> and you recommend C? <h2>What's wrong with you people?!</h2></p> <p>/edit</p> <h3>Obviously C#.</h3> <p>C# will be easier to get into and will let you build Windows applications using WinForms or WPF and all the ...
Is .NET already the right way to go for small app development? <p>I am developing a small windows app, but have some trouble deciding whether to use .NET or not. As a coder I would like to make use of the .NET libraries. On the other hand, requiring my users to download the gargantuan .NET runtime seems like a horrible...
<p>.NET is shipped with any recent version of Windows, so I doubt that you will be severely limited by using .NET. </p> <p>Do you need to support Windows 2000? If you're happy with 2003 and Vista, you should have no problem. </p> <p>Keep in mind that not everyone will be on .NET 3.5 (SP1) tough, but if you're not usi...
Calculate a Ratio in C# <p>I thought this would be simple, but searching Google didn't seem to help.</p> <p>I'm basically trying to write a function which will return a ratio as a string (eg 4:3) when supplies with two integers (eg 800 and 600).</p> <pre><code>string GetRatio(Int A, Int B) { // Code I'm looking f...
<p>I don't have a ready made code but it should be fairly simple. Namely, determine the <a href="http://en.wikipedia.org/wiki/Greatest_common_divisor">GCD</a> and work with it:</p> <pre><code>var gcd = GCD(A, B); return string.Format("{0}:{1}", A / gcd, B / gcd) </code></pre> <p>And a very basic function for calculat...
Simply Div Opacity Fade on Focus using mootools <p>I've got a couple of divs in a page which hold simple HTML &amp; images. The divs each have unique ids.</p> <p>I'd like it so that when the page loads the contents of the div are say, 60% but on mouseover the fade in at 100%. On mouseout they would go back to 60%.</p>...
<p>You may be able to wrap the image into a div and use something like this to fade?</p> <pre><code>Fx.Style("div1", "opacity").start(1.0); </code></pre>
Using the Euro symbol in JavaScript and PHP <p>I using the price in <a href="http://en.wikipedia.org/wiki/Euro" rel="nofollow">Euro</a> in JavaScript:</p> <pre><code>var currency = '\u20AC'; Total Sum = Sum in Euro </code></pre> <p>When I try to use in PHP mail, the Euro symbol appears differently. I used the followi...
<p>You have to add encoding to the mail header, like described in <a href="http://www.php.net/manual/en/book.mail.php#86537" rel="nofollow">a comment to documentation for function mail()</a>.</p> <p>The right encoding is probably <a href="http://en.wikipedia.org/wiki/ISO/IEC_8859-15" rel="nofollow">ISO/IEC 8859-15</a>...
How to make 'always-on-bottom'-window <p>Does anybody know how to make a 'always-on-bottom'-windows, or a window pinned to the desktop? It should receive focus and mouseclicks, but should stay at the bottom of the Z-order. It would also be great if it could stay on the desktop even when user do a minimize all or show d...
<p><strong>Warning</strong> It was suggested that you can accomplish this by calling SetParent and setting the window to be a child of the Desktop. If you do this, you cause the Win32 Window Manager to combine the input queue of the Desktop to your child window, this is a <em>bad thing</em> - <a href="http://blogs.msdn...
Query question related to retrieving the most recent entry from a table? <p>Hi I'm not good in framing questions. I will try my best. I'm creating a website and my question is related to the queries related to the site.This is the current query that I have. </p> <pre><code>SELECT GPS_modem.vehicle_no, vehicle_log...
<p>You can use correlated sub-query:</p> <pre><code>SELECT m.vehicle_no, l.longitude, l.latitude, l.timestamp FROM vehicle_log AS l, GPS_modem AS m WHERE m.modem_ID = l.modem_ID AND l.timestamp = ( SELECT MAX(timestamp) FROM vehicle_log WHERE modem_ID = l.modem_ID ) </code></pre> <p><hr />...