input
stringlengths
51
42.3k
output
stringlengths
18
55k
UITableView Looping Out Data From NSMutableArray / NSDictionary <p>I'm currently building an iPhone app that will display data from an NSMutableArray called "stories". The array structure looks like so (via NSLog):</p> <pre><code> 2009-07-20 12:38:30.541 testapp[4797:20b] ( { link = "http://www.testing.com...
<p>You're misunderstanding how the cellForRowAtIndexPath: method works.</p> <p>The way you have it, you're creating a single cell, and then repeatedly resetting its text, textColor, and font properties, then returning a single cell.</p> <p>The key to understanding your issue is understanding that cellForRowAtIndexPat...
C# Serial Wedge <p>C#, WinForms, .Net 2.0</p> <p>I'd like to create my own software serial wedge in C#. I have all the code for the serial I/O, and can get the data converted from Hex to ASCII and into a database or listbox. But am unsure how to translate the data into key presses that will go into the active applic...
<p>This <a href="http://msdn.microsoft.com/en-us/library/ms171548.aspx" rel="nofollow">MSDN article</a> has instructions about how to use SendKeys to do just what you want.</p>
Span/Grow bug in MigLayout? <p>The following is close to what I want, and does what I expect:</p> <pre><code>import javax.swing.JComboBox; import javax.swing.JPanel; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import net.miginfocom.swing.MigLayout; public class MigBug extends...
<p>Found a workaround, though not entirely satisfactory. According to <a href="http://migcalendar.com/forum/viewtopic.php?f=8&amp;t=2407" rel="nofollow">this forum post</a> and <a href="http://migcalendar.com/forum/viewtopic.php?f=8&amp;t=2405" rel="nofollow">this forum post</a>, MigLayout switches from calculating com...
How can I do an complex chained animation the right way? <p>Example:</p> <p>1) fade an uiview from alpha 0.0 to 0.2 2) fade back to 0.15 3) fade to 0.25 4) fade to 0.2 5) fade to 0.35 6) fade to 0.3 7) fade to 0.45 8) fade to 0.4 ... and so on. each with a duration of 0.05 sec. The effect is a flashy appearing view. J...
<p>I've written up a fairly complete illustration of how to use CAKeyFrameAnimation on <a href="http://stackoverflow.com/questions/1149635/how-can-i-enforce-an-specific-direction-i-e-clockwise-of-rotation-in-core-anim/1149933#1149933">another SO question</a>.</p>
Fiddler 2 Wipes My Internet Explorer Proxy Settings <p>I just started using Fiddler 2 to create request objects for REST,JSON, and SOAP based services that I have been creating. It has worked great so far.</p> <p>The problem came when I attempted to use some of my company resources through Internet Explorer. I was ge...
<p>Fiddler changes your proxy settings on startup and reverts them back to what they were before you started when Fiddler is closed.</p> <p>However, that doesn't really explain your problem, because when Fiddler is running it will use your old proxy server as an upstream proxy, and when you shut it down, it reverts th...
WinForms Combox - Adding item to a databound list and then setting that to be the selecteditem <p>I have this:</p> <pre><code>cmbConnections.DisplayMember = "Name"; cmbConnections.ValueMember = "Index"; cmbConnections.DataSource = DBConnectionSettings.ConnectionList; </code></pre> <p>All Ok!</p> <p>Now add new item ...
<p>Try putting a <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.bindingsource.aspx" rel="nofollow">BindingSource</a> between your DataSource and the ComboBox. After you've added your new item, call myBindingSource.ResetBindings(false); and then you will either set the Position property of myBind...
Is there an efficiency penalty when using Scala inner functions within non-tail recursive functions? <p>I am fairly new to to Scala and am still trying to develop a feel for which approaches are efficient and which might contain hidden performance costs.</p> <p>If I define a (non-tail) recursive function which contain...
<p>At the bytecode level</p> <pre><code>def sumDoubles(n: Int): Int = { def dbl(a: Int) = 2 * a; if(n &gt; 0) dbl(n) + sumDoubles(n - 1) else 0 } </code></pre> <p>is exactly the same as</p> <pre><code>private[this] def dbl(a: Int) = 2 * a; def sumDoubles(n: Int): Int = { if(n &gt; 0) ...
How to use a custom site-package using pth-files for Python 2.6? <p>I'm trying to setup a custom site-package directory (Python 2.6 on Windows Vista). For example the directory should be '~\lib\python2.6' ( C:\Users\wierob\lib\python2.6). Hence calling 'setup.py install' should copy packages to C:\Users\wierob\lib\pyth...
<p>The pth-file seems to be ignored if encoded in UTF-8 with BOM.</p> <p>Saving the pth-file in ANSI or UTF-8 without BOM works.</p>
Regex for keyboard mashing <p>When signing up for new accounts, web apps often ask for the answer to a 'security question', i.e. Dog's name, etc.</p> <p>I'd like to go through our database and look for instances where users just mashed the keyboard instead of providing a legitimate answer - this is a high indicator of...
<p>I would not do this - in my opinion these questions weaken the security, so as a user I always try to provide another semi-password as an answer - for you it would like mashed. Well, it is mashed, but that is exactly what I want to do.</p> <p>Btw. I am not sure about the fact, that you can query the answers. Since ...
rewrite mysite/city/citiname.html to mysite/citiname.html <p>I want to rewrite these so that the text in the adress bar should be </p> <p>mysite.com/citiname.html</p>
<p>First, make sure you have mod_rewrite enabled in Apache. Also make sure that</p> <pre><code> AllowOverride All </code></pre> <p>is enabled in the conf file. Then create a .htaccess file with the following contents:</p> <pre><code>RewriteEngine On RewriteRule ^city/([A-Za-z]+)\.html$ $1.html [L] </code></pre> <p>...
Reading or loading images from file synchronously in MATLAB <p>I have bitmap images file in my computer.And I numbered images form 1 to 100.</p> <p>I want to read image synchronously.</p> <p>Something like:</p> <pre><code>for i=1:100 % read images s = sprintf('C:\\images\\%d.bmp', i); A[i] = imread(s)...
<p>You can use cell matrices</p> <pre><code>A = cell(100,1); for i=1:100 % read images s = sprintf('C:\\images\\%d.bmp', i); A{i} = imread(s); A{i} = double(A{i}); end </code></pre>
Websphere 6.1 - Precompile jsp files <p>What is the best way to precompile JSP files in Websphere (6.1)?</p> <p>I have looked at other questions related to JSP precompilations, but as each AppServer has specific settings, I would like to know specifically a solution for Websphere.</p> <p>I found some references in th...
<p>From the console, you can choose the option as described here: <a href="http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/topic/com.ibm.websphere.base.doc/info/aes/ae/trun_app_instwiz.html" rel="nofollow">http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/topic/com.ibm.websphere.base.doc/info/aes/ae/trun_app_...
How do I marshal an array of bytes to a struct? <p><a href="http://stackoverflow.com/questions/878073/whats-the-most-efficient-way-to-marshal-c-structs-to-c">Related Question</a></p> <p>In the related question, I was trying to figure out the fastest way. The method I chose in that question has become a bottle neck for...
<p>I have a method like this:</p> <pre><code>static public T ReadStructure&lt;T&gt;(byte[] bytes) where T : struct { int len = Marshal.SizeOf(typeof(T)); IntPtr i = Marshal.AllocHGlobal(len); try { Marshal.Copy(bytes, 0, i, len); return (T)Marshal.PtrToStructure(i, typeof(T)); ...
Silverlight - Support For Dynamic Code? <p>I'm trying to understand a little about the relationship of server-side code to client side code in Silverlight.</p> <p>I would anticipate that you can't simply 'eval' a string and have new code, but <strong>could you load an assembly on the server side and include it with th...
<p>This guy has a working downloadable sample doing exactly what you want:</p> <p><a href="http://www.nokola.com/trycsharp/HowToBuild.aspx" rel="nofollow">http://www.nokola.com/trycsharp/HowToBuild.aspx</a></p> <p>It basically uses the Microsoft.CSharp.CSharpCodeProvider to compile the code, but uses the Sivlerlight ...
IsolatedStorage: Delete preferences in uninstaller? <p>Our application saves user preferences in isolated storage.</p> <p>However,it's proving tricky to remove these files from our uninstaller!</p> <p>I can enumerate all of the files in IsolatedStorage (using the MSDN example code), locate the ones that are related t...
<p>In case anybody else ever wants to know the answer...</p> <p>It appears the best solutions might be:</p> <ul> <li><p>Move the Isolated Storage code into a separate Assembly which can be called from both the main application and the uninstaller, so that they can both access the data.</p></li> <li><p>Add a means for...
How to automaticly copy & paste fields from excel into a website form <p>I have about 50 excel sheets to input on a website everyday, but unfortunately I can only submit 8 of these sheets per hour. Therefore, I'm looking for a tool, or comnbination of tools, that will allow me to automaticly copy &amp; paste fields fr...
<p>You can use <a href="http://www.autoitscript.com/autoit3/" rel="nofollow">AutoIt</a> or <a href="http://powerpro.webeddie.com/" rel="nofollow">PowerPro</a> to do this kind of scripting.</p> <p>More efficient, however, if the data is in a consistent table layout, is to use the Excel ODBC driver, and write a program ...
Opening a MS Access database from VB that is being used by another user <p>Is there a way to open a MS Access database from VB 6.0 that is being used by another user.</p> <p>I have a service that is updating a .mdb file. I want to monitor this DB by reading some parameters from it periodically.</p> <p>If I try to sim...
<p>Try:</p> <pre><code>Set BaseDB = OpenDatabase("gui_db.mdb", false) </code></pre> <p>To open the database in shared mode. Note that all clients must open the database in shared mode.</p>
Make Animations <p>I have to make some animated design with lots of pretty effects and color gradients in a SWT compliant way ...</p> <p>I assume what I try to mean is not clear as water so I'll try to explain more... I have an RCP application in which I need to have a special page whose content is fed by a class that...
<p>You can use <a href="https://timingframework.dev.java.net/" rel="nofollow">Timing Framework</a> or <a href="http://kenai.com/projects/trident" rel="nofollow">Trident</a>. Both of them based on the notion of changing bean property values, which would work for SWT or Swing. </p> <p>You'd have to read about them to se...
How to make email field unique in model User from contrib.auth in Django <p>I need to patch the standard User model of <code>contrib.auth</code> by ensuring the email field entry is unique:</p> <pre><code>User._meta.fields[4].unique = True </code></pre> <p>Where is best place in code to do that?</p> <p>I want to avo...
<p>Your code won't work, as the attributes of field instances are read-only. I fear it might be a wee bit more complicated than you're thinking.</p> <p>If you'll only ever create User instances with a form, you can define a custom ModelForm that enforces this behavior:</p> <pre><code>from django import forms from dja...
Java I/O streams; what are the differences? <p><code>java.io</code> has many different <a href="http://en.wikipedia.org/wiki/Input/output">I/O</a> streams, (FileInputStream, FileOutputStream, FileReader, FileWriter, BufferedStreams... etc.) and I am confused in determining the differences between them. What are some ex...
<p><strong>Streams:</strong> one byte at a time. Good for binary data.</p> <p><strong>Readers/Writers:</strong> one character at a time. Good for text data.</p> <p><strong>Anything "Buffered":</strong> many bytes/characters at a time. Good almost all the time.</p>
Mylyn equivalent for Netbeans? <p>A co-worker has been going on about how cool Mylyn is for Eclipse. I want to give a task management tool a try but I use Netbeans. <strong>Is there a Mylyn like plugin for Netbeans? Preferable with integration to Redmine or Trac?</strong></p>
<p>I switched over from Eclipse to Netbeans a year ago and during that time I have not found a good alternative to Mylyn. Even the latest dev builds of Cubeon do not come close. Despite Netbeans being a very good IDE, having Mylyn context management is essential to me. I have just posted a topic on the Netbeans forum d...
Advice on using hypervisor to run a Real Time OS in parallel with Windows/Linux <p>What are your advice/experience of using a hypervisor (e.g. <a href="http://www.real-time-systems.com/real-time%5Fhypervisor/" rel="nofollow">RTS Real-Time Hypervisor</a>) to run an RTOS in parallel with a non real time OS. Are there any...
<ol> <li>no, it doesn't need dual core or hyperthreading.</li> <li>no, the non-RT tasks doesn't interfere with RT ones.</li> </ol> <p>The main idea is to have one RTOS, which executes tasks written specifically for this OS, using it's own API. These tasks are set in string priority levels, where a higher priority tas...
How can I implement a build pipeline with TFS <p>I try to implement a build pipeline using TFS. </p> <p>We already have TFS building our projects after each commit. But the build take too long so we would like to split the build into two stages. Continuous integration literature suggest this technique.</p> <p>So what...
<p>1) Write a service that listens for the BuildCompleted event. <a href="http://howardvanrooijen.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=25327" rel="nofollow">IIS webservice sample code</a>. <a href="http://codeplex.com/TFSEventHandler" rel="nofollow">Self-hosted WCF sample code</a>. In your event handl...
Generating all possible trees of depth N? <p>I have several different types of tree nodes, each of which may have anywhere from 0 to 5 children. I'm trying to figure out an algorithm to generate all possible trees of depth &lt;= N. Any help here? I'm having trouble figuring out how to recursively walk the tree given...
<p>Here's a Python program I wrote up that I think does what you're asking. It'll return all of the possible trees given a starting node. Essentially, it boils down to a trick with bit manipulation: if a node has 5 children, then there are 2<sup>5</sup> = 32 different possible subtrees as each child can independently b...
First week date to be added in VBA <p>I need to add automatically current weeks first date into a table and a text box of a vba form. could anyone help if any functions are available ??</p>
<pre><code>monday = DateAdd("d", 1 - Weekday(Date, vbMonday), Date) </code></pre>
TFS: Create a new project from an existing one in TFS <p>What is the best way to create a completely new project in TFS by copying an existing one?</p> <p>I have an ASP.NET project that will have 50+ "releases" per year. Each release is a distinct entity that needs to remain independent of all others. Once created, ...
<p>There are really two questions here:</p> <p>1) Is it better to copy/paste or branch?</p> <p>I'd venture to say that copy/paste is never appropriate. Unless you are very careful (at minimum, run 'tfpt treeclean' immediately before copying), it's likely you'll end up checking in some inappropriate files to the new ...
SSRS 2005 - Capturing RAISERROR message <p>I am checking whether a user has a permission to view the report through dataset stored procedure and if the user doesn't, raiserror is called.</p> <p>Is there a way to display a different message from SQL Server Reports 2005 when a stored procedure (that populates report dat...
<p>Why would you allow the user fire to the report if they don't have permission to view it?</p> <p>To display a custom message in the SSRS report itself: </p> <ol> <li>Add a text field</li> <li>Customize the text displayed on it to your satisfaction</li> <li><p>Provide an expression for the Visibility > Hidden value...
Need assistance with wxPython (newbie) <p>I need to create what I <em>think</em> should be a simple GUI. I have very little experience with building GUI's. I'm a visual learner and 'wxPython In Action' isn't helping me out. I don't learn well by books written by Ph.D.'s. I'm using Python 2.6. Many of the examples o...
<p>You should take a look at <a href="http://wxglade.sourceforge.net/" rel="nofollow">wxGlade</a>. It's a handy little GUI builder you can use to create your UI. After that, you can also look at the code it generates and go from there.</p> <p><strong>Edit:</strong> Okay, here goes:</p> <p>In wxGlade, create a new fra...
Trackback implementation: rel="trackback" vs RDF <p>I want my Rails App to parse external websites for a trackback URL but I'm not really sure if I should just look for a </p> <pre><code>&lt;a href="url" rel="trackback"&gt;Text&lt;/a&gt; </code></pre> <p>or follow the RDF specifications described by sixapart. Or both...
<p>I'm checking for both now (first RDF, then link if not successfull). I was refering to the sixapart specifications. Thanks for your help!</p>
Update panel and usercontrols <p>I have two web user controls nested inside of an update panel. The events inside the user controls do not appear to trigger the panel. For testing, I have set the method the fires to sleep for 3 seconds, and added an update progress panel to the page. The update progress panel never c...
<p>You should not have to setup anything specific. However, without a code sample it will be hard for us to diagnose.</p> <p>The one thing you will want to ensure is that you do not have the ChildrenAsTriggers set to false.</p>
How do I group data in an ASP.NET MVC View? <p>In reporting tools like Crystal Reports, there are ways to take denormalized data and group it by a particular column in the data, creating row headings for each unique item in the specified column.</p> <p>If I have this:</p> <pre><code>Category1 Data1 Category1 Da...
<p>If your view is strongly typed, you can use the LINQ GroupBy extension method with nested foreach:</p> <pre><code>&lt;ul&gt; &lt;% foreach (var group in Model.GroupBy(item =&gt; item.Category)) { %&gt; &lt;li&gt;&lt;%= Html.Encode(group.Key) %&gt; &lt;ul&gt; &lt;% foreach (var item in group) { %&gt; ...
Visual studio asp.net markup formatting <p>Our coding standards have us putting each attribute within a tag on a separate line. However, when I have VS (2008) format the markup is lumps all the attributes together. Is there a way to change this behavior??</p> <p>Thanks</p>
<p>I have not found any options within Visual Studio itself that would allow you to <i>force</i> your attribute to format this way. It seems that you have two options:</p> <p>1) Go into Tools->Options->Text Editor->HTML and remove all the formating stuff (or as much as you need).</p> <p>2) Find a coding-style plugin ...
how do I detect the iPhone orientation before rotating <p>In my program I'm moving things based on rotation, but I'm not rotating the entire view. I'm Using :</p> <pre><code> static UIDeviceOrientation previousOrientation = UIDeviceOrientationPortrait; - (void)applicationDidFinishLaunching:(UIApplication *)applica...
<p>Depending on your circumstances, a simpler option may be the interfaceOrientation property of the UIViewController class. This is correct before a rotation. </p>
How do I check programmatically if any document properties of a MS Word 2007 document has changed? <p>For example, I want the Title fields in the body and the page headers of the document to be updated automatically whenever the Title field in the document properties panel is changed. I know how to update the fields, b...
<p>You can certainly check for these kinds of things in some of the events, such as <code>DocumentBeforeClose</code> or <code>WindowSelectionChange</code>, but this may be overkill. Instead, you could just use fields - they will update automatically. For example, go to <strong>Insert</strong> and then click on <strong>...
web.config auto caching <p>I have custom configuration section within web.config file. I'm lingering between:</p> <ol> <li>Reading it into static class every time when I need any configuration value (because I guess that system already caches files when I open them (for instance when I run Word it takes longer the fir...
<p>Write a custom configuration section and use ConfigurationManager.GetSection</p> <p>.NET Takes care of caching this and invalidates whenever the web.config file is changed.</p>
Hidden features/tricks of Flash development, Flash language (AS2/3), and Flash IDE <p>Guys, I am thoroughly surprised that there is no Flash <em>Hidden Features</em> post yet in the <a href="http://beerpla.net/2009/06/21/hidden-features-of-perl-php-javascript-c-c-c-java-ruby-python-and-others-collection-of-incredibly-u...
<p>[AS3] Tips for working with arrays or Vectors</p> <p>Fastest way through an array, always from the back</p> <pre><code>var i:int = array.length; var item:Object; while(i--) { item = array[i]; } </code></pre> <p>Clearing an array,</p> <pre><code>//faster than array = [] array.length = 0; //garbage friendly wh...
Log to database instead of log files <p>I'm interested in sending all Rails application logging to a database (MySQL or MongoDB) either in addition to or instead of to a log file. There are a few reasons, most of which are concerned about log file analysis. We already use Google Analytics, but there are a variety of th...
<p>My company have been logging some structured traffic info straight into a MySQL log database. This database is replicated downstream to another database. All analytics run off the final database replication. Our site sustain quite a bit of traffic. So far, it doesn't seem to have any major problems. However, our...
WPF vs XBAP vs Silverlight... which suits business applications? <p>I'm pretty familiar with a lot of the ins and outs of full fledged WPF client applications. I know that WPF client applications supports the full .NET Framework 3.5, allows for hardware acceleration of 2D and 3D graphics, theming, templating, styling, ...
<p>Wintellect wrote a good comparison between Silverlight and WPF published here: <a href="http://wpfslguidance.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=28278">http://wpfslguidance.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=28278</a></p> <p>From personal experience in WPF and Silverlight I've found...
Templating system scoping issue <p>I'm trying to whip up a skeleton View system in PHP, but I can't figure out how to get embedded views to receive their parent's variables. For example:</p> <p><strong>View Class</strong></p> <pre><code>class View { private $_vars=array(); private $_file; public function...
<p>So, I'm not exactly answering your question, but here's my super-simple hand-grown template system. It supports what you're trying to do, although the interface is different. </p> <pre><code>// Usage $main = new SimpleTemplate("templating/html.php"); $main-&gt;extract($someObject); $main-&gt;extract($someArray); $m...
How do I get NumberFormatter to print negative currency values with a minus sign? <p>I'm using the PHP <a href="http://us.php.net/manual/en/class.numberformatter.php" rel="nofollow">NumberFormatter</a> class to print currency values.</p> <p>Eg:</p> <pre><code> $cFormatter = new NumberFormatter('en_US', NumberFormatt...
<p>I've found a slightly less hacky way to bend the en_US locale behaviour to what I'm looking for - the <a href="http://us2.php.net/manual/en/numberformatter.getpattern.php">getPattern()</a> / <a href="http://us2.php.net/manual/en/numberformatter.setpattern.php">setPattern()</a> functions.</p> <pre><code>$cFormatter ...
Detect click outside element? <p>Similar to <a href="http://stackoverflow.com/questions/152975/how-to-detect-a-click-outside-an-element">this question</a>, but taking it a step further. I would like to detect clicks outside of a set of items, which I am handling in the following way:</p> <pre><code>$('#menu div').liv...
<p>Just move the body click handler outside and do something like this:</p> <pre><code>$('body').bind('click', function(e) { if($(e.target).closest('#menu').length == 0) { // click happened outside of menu, hide any visible menu items } }); </code></pre> <p>It was incorrectly pointed out in the commen...
MySQL: Database Design that is scalable and flexible? <p>Soon I'm going to build an application that needs to be <strong>scalable and flexible</strong>. Since I'm not a "MySQL" Guru I'm wondering if someone with experience could give me a couple of recommendations for achieving this application I'm going to build.</p> ...
<p>With such a concrete question, I'm going to have to say "Relational". Can't go wrong with that.</p>
Iphone Binary submitting tutorial? <p>Alright I got my iphone application completly done and have done all the steps to get it submitted except for uploading the binary. Is there a step by step tutorial out therefor getting the binary all ready for uploading cause I'm completly lost. I just signed up for the developers...
<p>I think it's a late response to this question; but after you've figured out the provisioning profile, and code signings, you must do the following:</p> <ol> <li><p>Create the app in <a href="http://itunesconnect.apple.com" rel="nofollow">http://itunesconnect.apple.com</a> > Manage Your Applications > Add New App Yo...
jquery Label Insertion Problem in Safari <p>I am inserting a label after a field to show the user an error message. The problem is after it is first inserted, it's top half is cut off then when you tab out of the field it fixes itself. There is no problem at all in FireFox.</p> <p>I have deployed the form to: <a hre...
<p>Looks like the problem is that you are spelling position wrong in your css file.</p> <p>line 69, 76,92... </p> <p><code>poisition:relative;</code></p> <p>You have one to many i's in there.</p> <p>Try:</p> <p><code>position:relative;</code></p>
How do I get URL query parameters into an object literal? <p>When looking at location.search, what's the best way to take the query parameters and turn them into an object literal? Say I've got a URL that looks like this:</p> <blockquote> <p><a href="http://foo.com?nodeId=2&amp;userId=3&amp;sortOrder=name&amp;sequen...
<p>You should use</p> <pre><code>params[ param[0] ] = param[1] </code></pre> <p>FYI, you could use a <a href="http://www.onlineaspect.com/2009/06/10/reading-get-variables-with-javascript/" rel="nofollow">regex approach</a> too.</p>
Modal Dialog with secondary form shown in taskbar <p>I have two forms for my application, that are visible in the Windows taskbar. When a modal dialog is popped up on the main form, the secondary form is locked. However, when the user clicks on the secondary form on the taskbar, it appears over the modal dialog box, ...
<p>Your problem may be that you haven't specified an owner for the dialog:</p> <blockquote> <p>Owned windows typically don’t need their own representation on the Windows taskbar because they are subordinate to their owners. Because activating an owned window implicitly activates the owner and vice versa, it would ...
ASP.NET on a linux webserver <p>Can I host a asp.net application on a linux based webserver?</p> <p>Do they allow .net framework to be installed on linux?</p>
<p><a href="http://mono-project.com/ASP.NET" rel="nofollow">Mono</a> might work for you. It's an open source implementation of .NET that runs on Linux. It requires installation.</p> <p>You can test your ASP.NET application with <a href="http://mono-project.com/MoMA" rel="nofollow">MOMA (Mono Migration Analyzer)</a> fi...
SQLite + Core Data Vs. File system on Iphone App that shows photos. What's more performant? <p>I have an application where the user will navigate around a set of photographs. What's best in terms of performance for this scenario, SQLite + Core DATA for persisting the photos as NSData objects or having the photos as png...
<p>It really depends on the size of images. I would certainly put small things (like thumbnails) right in the DB. If your images are large you will either want to put them into separate files, or be very careful that those columns are not faulted in unless you actually need them.</p> <p>With CoreData you can just use ...
Why does Ruby's BigDecimal represent numbers oddly sometimes? <p>I am seeing very, VERY strange behavior when I run certain reports:</p> <pre><code>&gt;&gt; p = BigDecimal.new('0.1785990254E5') =&gt; #&lt;BigDecimal:b649b978,'0.1785990254E5',16(16)&gt; &gt;&gt; q = BigDecimal.new('0.76149149E4') =&gt; #&lt;BigDecimal:...
<p>After looking at the versions, it appears I am running Ruby 1.8.5 on the RHEL box and Ruby 1.8.6 on my local box. I assume this would account for the problems? Strange problems indeed.</p> <p>Update: Confirmed - Upgrade to 1.8.6 resolved the issues.</p>
In eclipse, reveal current file in filesystem <p>In eclipse, is there a way, to reveal the currently selected file in the filesystem. I currently need it to open in explorer, but it could also be in finder or nautilus.</p> <p>Basically, I do not need the "Open with System Editor" option. I would like a right-click men...
<p>Note: You can also <a href="http://www.eclipsezone.com/eclipse/forums/t77655.html">develop your own external tool</a> to open the file in a Windows explorer</p> <p><img src="http://i.stack.imgur.com/UR65j.gif" alt="alt text"></p> <p>Or you can use an eclipse plugin like <strong><a href="http://startexplorer.source...
Parent Control Mouse Enter/Leave Events With Child Controls <p>I have a C# .NET 2.0 WinForms app. My app has a control that is a container for two child controls: a label, and some kind of edit control. You can think of it like this, where the outer box is the parent control:</p> <pre> +-----------------------------...
<p>After more research, I discovered the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.application.addmessagefilter.aspx">Application.AddMessageFilter method</a>. Using this, I created a .NET version of a mouse hook:</p> <pre><code>class MouseMessageFilter : IMessageFilter, IDisposable { publ...
Centralized Authentication and Authorization for several Web Services <p>There are several different web services -- various technologies used, such as Java, .NET, Python, Perl, and possibly more in the future -- belonging to different organizations, and the access to those web services has to be restricted.</p> <p>Th...
<p>We did a big research on the subject and couldn't find a suitable solution too. (One nearly good solution, but not so much for webservices is <a href="http://www.atlassian.com/software/crowd/" rel="nofollow">http://www.atlassian.com/software/crowd/</a>)</p> <p>So we developed a sso and central user management syste...
How do I build a user control into a self-contained assembly in VS2008? <p>More specifically, what do I need to know about doing this in Visual Studio 2008 that's different from VS2005? I have found a decent number of references for doing this kind of thing in VS2005, such as</p> <ul> <li><a href="http://webproject.sc...
<p>All someone needs to do to use your UserControl is to add a reference to the .dll in their project, whether it's a web application or a web site. </p> <p>Usually the best idea is to add it to a folder relative to your project (I usually use "_Libraries"), as you'll need to deploy it to its final destination. </p>...
Get the unix timestamp of midnight on the previous Wednesday <p>How would I go about finding the unix timestamp of midnight of the previous Wednesday? My only approach would be to get the day index and day number of today, and subtract the difference, but I can think of several scenarios where this would fail, for exam...
<p>What about <a href="http://php.net/strtotime"><code>strtotime</code></a> ?</p> <pre><code>$timestamp = strtotime("last Wednesday"); var_dump($timestamp); var_dump(date('Y-m-d H:i:s', $timestamp)); // to verify </code></pre> <p>And you get this output :</p> <pre><code>int 1247608800 string '2009-07-15 00:00:00' (...
.NET RegEx help <p>I am very inexperienced when it comes to regular expressions. What I'm trying to do is iterate through a list of strings and try to locate strings that are of a certain pattern. The strings I am interested in will be in the form of <code>"some text ***{some text}***"</code> How do I write a RegEx to ...
<p>You need to escape the asterisk, as it's a valid metacharacter in RegExp.</p> <pre><code>Regex expression = new Regex(@"\*\*\*"); </code></pre>
how do I read everything currently in a subprocess.stdout pipe and then return? <p>I'm using python's subprocess module to interact with a program via the stdin and stdout pipes. If I call the subprocesses readline() on stdout, it hangs because it is waiting for a newline.</p> <p>How can I do a read of all the charac...
<p>Someone else appears to have had the same problem, you can see the related discussion <a href="http://stackoverflow.com/questions/375427/non-blocking-read-on-a-stream-in-python">here</a>. </p> <p>If you are running on Linux you can use select to wait for input on the process' stdout. Alternatively you change the mo...
Hand-code HTML for email? Or are there any reasonable tools or converters? <p><a href="http://www.sitepoint.com/article/code-html-email-newsletters/" rel="nofollow">HTML Email is a whole different ballgame from Websites</a>, which have moved away from tables and toward CSS.</p> <p>I'm looking for recommendations for H...
<p>I just hard code my HTML for e-mails. I do make sure I keep the HTML for e-mails extremely simple. </p> <p>Depending on the e-mail I typically use xslt and convert it to HTML from another document. That depends on the implementation. Many times I just build the string. Again it just depends.</p>
Why can't my coldfusion cfc access a udf included in application.cfm? <p>I've got a logging function (can't use cflog) included in application.cfm and my .cfm pages can access this, but any components I use give me a "Variable LOGGER is undefined." error.</p> <p>application.cfm</p> <pre><code>&lt;cfinclude template="...
<p>because the way components work is that a component can't see the "<code>variables</code>" scope outside of itself, and when you <code>&lt;cfinclude&gt;</code> your <code>logging.cfm</code>, it's including those functions into the page's variable scope. in order for your component to call those functions, you might ...
Compiler for Windows Mobile OS <p>I am looking for compilers ( command line / IDE ) that runs on Windows Mobile OS v6 for the following languages:</p> <ol> <li>C/C++</li> <li>Java</li> </ol>
<p>If you are looking for a way of writing working code for the platform, then I think for Java, this is the link you want:</p> <p><a href="http://java.sun.com/javame/downloads/sdk30.jsp" rel="nofollow">http://java.sun.com/javame/downloads/sdk30.jsp</a></p> <p>If you are looking for a Java SDK that will run ON that p...
Google Wave Sandbox <p>Is anyone developing robots and/or gadgets for <a href="http://wave.google.com/" rel="nofollow">Google Wave</a>? </p> <p>I have been a part of the sandbox development for a few days and I was interested in seeing what others have thought about the <a href="http://code.google.com/apis/wave/" rel=...
<p>Go to <a href="http://code.google.com/apis/wave/" rel="nofollow">Google Wave developers</a> and read the blogs, forums and all your questions will be answered including a recent post for a gallery of Wave apps. You will also find other developers to play in the sandbox with.</p>
Why can't I import this Zope component in a Python 2.4 virtualenv? <p>I'm trying to install Plone 3.3rc4 with plone.app.blob and repoze but nothing I've tried has worked so far. For one attempt I've pip-installed repoze.zope2, Plone, and plone.app.blob into a virtualenv. I have <a href="http://svn.zope.org/Zope/trunk/l...
<p>I must say I doubt DocumentTemplate from Zope will work standalone. You are welcome to try though. :-)</p> <p>Note that <a href="https://github.com/zopefoundation/DocumentTemplate/blob/master/src/DocumentTemplate/DT_Util.py#L32-L34" rel="nofollow">DT_Util imports C extensions</a>:</p> <pre><code>from DocumentTempl...
Photoshop Mock Up Font isn't same as in HTML <p>(Beginner to HTML)</p> <p>I have made a Photoshop mock-up of the website I want to make, but the text I have used in the mock-up looks different when viewed in Firefox. The text is Arial font, size 18pt and regular weight, and I have implemented this into HTML code, but ...
<p>The short answer is "no". Photoshop has a <em>lot</em> more font functionality than a web browser. It applies all kinds of smoothing algorithms, and you can control kerning, tracking and spacing much better.</p> <p>Each browser and OS has a distinct rendering engine as well, so even if you could get it the same in...
python docstrings <p>ok so I decided to learn python (perl, c, c++, java, objective-c, ruby and a bit of erlang and scala under my belt). and I keep on getting the following error when I try executing this:</p> <pre><code>Tue Jul 21{stevenhirsch@steven-hirschs-macbook-pro-2}/projects/python:--&gt;./apache_logs.py ...
<p>What version of Python do you have? In Python 3, <a href="http://docs.python.org/3.1/whatsnew/3.0.html#print-is-a-function"><code>print</code> was changed to work like a function</a> rather than a statement, i.e. <code>print('Hello World')</code> instead of <code>print 'Hello World'</code></p> <p>I can recommend yo...
Simple mysql query only returning one row <p>I have the following table:</p> <pre><code>CREATE TABLE IF NOT EXISTS `notes` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `uid` int(10) unsigned NOT NULL DEFAULT '0', `note` text, PRIMARY KEY (`id`) ) INSERT INTO `notes` (`id`, `uid`, `note`) VALUES (1, 1, 'noteteeext...
<p>Not seeing anything obvious, so I'll go with the simple stuff:</p> <p>Have you:</p> <ul> <li>Looked in the db directly to determine that you do actually have two rows?</li> <li>Verified that those two rows have the data you expect, in the columns you expect?</li> <li>Could it be that the first record is automatica...
Why should I use an CATransaction in an animation? <p>I've found this code snippet:</p> <pre><code>[self setValue:direction forKey:@"currentDirection"]; CAKeyframeAnimation * animation = [CAKeyframeAnimation animationWithKeyPath:@"position"]; animation.path = path; animation.duration = grids * gridWidth / [self speed...
<p>To set the duration of the two implicit animations within the transaction to a value different from the duration of the keyframe animation above. The animations inside the transaction will run over <code>_turn_duration</code> seconds, while the keyframe animation will run over <code>grids * gridWidth / [self speed]<...
Is OOP abused in universities? <p>I started my college two years ago, and since then I keep hearing "design your classes first". I really ask myself sometimes, should my solution to be a bunch of objects in the first place! Some say that you don't see its benefits because your codebase is very small - university projec...
<p>The professors have the disadvantage that they can't put you on huge, nasty programs that go on for years, being worked on by many different programmers. They have to use rather unconvincing toy examples and try to trick you into seeing the bigger picture.</p> <p>Essentially, they have to scare you into believing t...
Copying part of one XML DOM to another for XSL transformation (.NET) <p>The scope of XML and DOM in .NET 3.5 is so large that I'm having trouble coming up with a simple solution to my problem without using too many lines of messy code. Since people here always come up with some elegant solutions, I thought it would be ...
<pre><code>foreach (XmlElement xmlUnit in xmlMain.SelectNodes("/report/unit")) { var xmlDest = new XmlDocument(); xmlDest.AppendChild(xmlDest.CreateElement("report")); // Add the report properties... foreach ( XmlElement xmlValue in xmlMain.SelectNodes( "/report/report_name | /report/report_date" ) ) ...
Why my VS 2008 will be closed down when try to edit some ASPX file from Nerddinner Project <p>Why my VS 2008 will be closed down when try to open or edit the .ASPX files from Nerddinner Project?</p> <p>I'm using VS 2008 Professional SP1 version. </p>
<p>I have found out the reason. I changed the name of the controller.</p>
Git-svn refuses to create branch on svn repository error: "not in the same repository" <p>I am attempting to create a <a href="http://stackoverflow.com/questions/266395/git-svn-how-do-i-create-a-new-svn-branch-via-git">svn branch using git-svn</a>. The repository was created with <code>--stdlayout</code>. Unfortunately...
<p>I think this is a bug in git-svn, if you observe the source repository in the error it is missing the svnuser@ portion of the url. This is because git-svn uses the svn repo from the commit messsage? Im not sure. I was able to make it work by modifying git-svn perl script to include the hardcoded url on line 60...
CreateRemoteThread, LoadLibrary, and PostThreadMessage. What's the proper IPC method? <p>Alright, I'm injecting some code into another process using the <a href="http://www.codeproject.com/KB/threads/winspy.aspx#section%5F2" rel="nofollow">CreateRemoteThread/LoadLibrary</a> "trick".</p> <p>I end up with a thread id, a...
<p>Step zero; the injected DLL should have an entry point, lets call it <code>Init()</code> that takes a <code>LPCWSTR</code> as its single parameter and returns an <code>int</code>; i.e. the same signature as <code>LoadLibrary()</code> and therefore equally valid as a thread start function address...</p> <p>Step one;...
ASP.NET, OpenID and registration confusion <p>I have managed to get all the authentication parts working, however i am confused about setting up registration.</p> <p>By registration i mean that if the OpenID is not attached to an existing account, then a new account must be created.</p> <p>Should i simply have it ret...
<p>Ideally, no registration is required at all beyond simply an OpenID. Does your site <em>require</em> to know more than a user identifier to provide any functionality at all? </p> <p>If your site can offer any services to users (even just informational) without asking for more than their identifier, which OpenID s...
Prompting and Delegate question <p>I have a class that needs to ask the user a question and wait for the users response to determine the next action. What would be the best way to do this? Using a delegate? How? I have a UITextField and a UITextField in the class.</p> <p>Thanks</p>
<p>It all depends upon how you wish for the user to submit the data. The most user friendly way is to do as TahoeWolverine explained and implement <code>- (BOOL)textFieldShouldReturn:(UITextField *)textField</code> from <code>UITextFieldDelegate</code>. In order to use this, the class that implements <code>textFieldSho...
Null Object Problem <p>I am using this JS script for multiple country selection and I get an error from firebug.</p> <pre><code>selObj is null [Break on this error] selObj.options[0] = new Option('Select Country',''); </code></pre> <p>The relevant code is this:</p> <pre><code>function populateCountry(idName) { var ...
<p>From a cursory glance it appears that in</p> <p>" var selObj = document.getElementById(idName);"</p> <p>"document.getElementById(idName);" is not returning anything (or more precisely returning null).</p> <p>My <i>guess</i> is that the value of idName is not matching. I would start by ensuring exactly what is th...
Count the number of nodes in an XML snippet using Javascript/E4X <p>Consider this problem:</p> <p>Using Javascript/E4X, in a non-browser usage scenario (a Javascript HL7 integration engine), there is a variable holding an XML snippet that could have multiple repeating nodes. </p> <pre><code>&lt;pets&gt; &lt;p...
<p>Use an E4X XML object to build an XMLList of your 'pet' nodes. You can then call the length method on the XMLList.</p> <pre><code>//&lt;pets&gt; // &lt;pet type="dog"&gt;Barney&lt;/pet&gt; // &lt;pet type="cat"&gt;Socks&lt;/pet&gt; //&lt;/pets&gt; // initialized to some XML resembling your example var pets...
Open Source Grammar Checker <p>For an online project I'm working on, I am looking for a open source grammar checker. I have searched Google, with some good results (<a href="http://www.link.cs.cmu.edu/link/">http://www.link.cs.cmu.edu/link/</a>, etc), but I am wondering what all of you think about this topic.</p> <p>...
<p>LanguageTool should fit the bill:</p> <p><a href="http://www.languagetool.org/">http://www.languagetool.org/</a></p>
How can I get DNS records for a domain in python? <p>How do I get the DNS records for a zone in python? I'm looking for data similar to the output of <code>dig</code>.</p>
<p>Try the <code>dnspython</code> library:</p> <ul> <li><a href="http://www.dnspython.org/">http://www.dnspython.org/</a></li> </ul> <p>You can see some examples here:</p> <ul> <li><a href="http://www.dnspython.org/examples.html">http://www.dnspython.org/examples.html</a></li> </ul>
Regular Expressions and GWT <p>My questions is: Is there a good solution to use regular expression in GWT?</p> <p>I'm not satisfied with the use of String.split(regex) for example. GWT translates the Code to JS and then uses the regex as a JS regex. But I cannot use something like the Java Matcher or Java Pattern. But...
<p>The same code using RegExp could be:</p> <pre><code>// Compile and use regular expression RegExp regExp = RegExp.compile(patternStr); MatchResult matcher = regExp.exec(inputStr); boolean matchFound = matcher != null; // equivalent to regExp.test(inputStr); if (matchFound) { // Get all groups for this match ...
How to work with an image using url in android? <p>Given a Url for an image, I want to downoload it and paste it onto my canvas in android. How do I retrieve the image into my app ?</p> <p>Please help.</p> <p>Thanks, de costo.</p>
<p>Dont forget to give the app the permission to connect to the Web,</p> <p>in the AndroidManifest.xml:</p> <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt; </code></pre>
Cloning background image with parenthesis in file name <p>I have a background image with a parenthesis in the filename:</p> <pre><code>&lt;DIV style="BACKGROUND: url('http://site.com/image(8).png');"&gt;&lt;/DIV&gt; </code></pre> <p>This is fine normally, and there is no confusion because there are quotes around the ...
<p>Don't escape the parentheses with HTML entities (the browser is correct to treat entities in attributes as their literal character equivalent), escape them with URL entities:</p> <p>( = %28<br /> ) = %29</p>
ADO CommandText syntax <p>Does anyone know why sometimes an <code>@</code> is used preceding a commandText string?</p> <p>both seem to work fine.</p> <pre><code>command.CommandText = @"SELECT id FROM users"; </code></pre> <p>or</p> <pre><code>command.CommandText = "SELECT id FROM users"; </code></pre>
<p>That is C#'s verbatim string literal notation.</p> <p>A verbatim string literal is preceded by a leading <strong><code>@</code></strong> and anything between the quotes that follow that <strong><code>@</code></strong> will be considered part of the string literal without any need for escaping.</p> <p>Please see <a...
Adding additional dependency using Castle Windsor <p>I am tying to register a component into the IWindsorContainer i.e.</p> <pre><code>_container.Register(Component.For&lt;IView&gt;().ImplementedBy&lt;View&gt;()); _container.Register(Component.For&lt;Presenter&gt;()); </code></pre> <p>When i resolve the view i want t...
<p>Usually I do this differently:</p> <ol> <li>View gets the Presenter injected in the constructor. This way you ensure both are created at the same time (when you resolve IView from the container)</li> <li>The presenter does not receive the view in the constructor. Rather, I add the code to assign it in the View's co...
document.getElementById fails for single-tag DIV <p>I have 2 DIVs on an HTML page:</p> <pre><code>&lt;div id="divDebug" /&gt; &lt;div id="divResult" /&gt; </code></pre> <p>I have a script that hits a web service and fills them up with data:</p> <pre><code>document.getElementById("divDebug").innerHtml = rawResult; do...
<p><code>&lt;div/&gt;</code> is the XML way of closing tags, basically. <code>&lt;div&gt;&lt;/div&gt;</code> is HTML (and XML).</p> <p>What DOCTYPE are you using?</p> <p>From <a href="http://www.w3.org/TR/xhtml1/guidelines.html#C%5F3" rel="nofollow">C. HTML Compatibility Guidelines</a> in <a href="http://www.w3.org/T...
Multiple users accessing certificate file at a time <p>This is kind of not a question, but need a clarification. Here is the code. All this code is doing is sending sending a cer file to server in httpwebrequest which is placed on a local drive. My question is, what happens if multiple users try to access the applicat...
<p>Reads don't lock files in Windows....</p>
mysqli_real_escape_string AND prepared statements? <p>Should be a simple enough question:</p> <p>If I am using mysqli prepared statements, do I still need to use <code>mysqli_real_escape_string()</code> as well?</p> <p>Is this necessary, or a good idea?</p> <p>Thanks, Nico</p>
<p>No. If you use prepared statements, escaping is done for you.</p>
PHP - moving forwards and backwards through mysql rows <p>I have a page that displays a row depending on the id given in the browser bar (page.php?id=1). I am trying to use forward and back buttons to display the corresponding next or previous row on the page. So essentially the prev and next buttons will just be links...
<p>$backresult is PHP's connection to the result of your query. If you want to check that $backresult contains no rows, you need something like </p> <pre><code>if(mysql_num_rows($backresult)==0) { //inactive link } else { //active link } </code></pre>
lxml retrieving odd items with cssselector <p>In my test document I have a few classes labeled "item", currently I'm using the following to parse everything in the html file with this class with</p> <pre><code>Selection = html.cssselect(".item") </code></pre> <p>I'd like it to select all the odd items, like this in j...
<p>The "odd" and "even" features are part of a selector named "nth-child()"; take a look at the CSS selector specification for more details:</p> <pre><code>http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#nth-child-pseudo </code></pre> <p>Therefore, you should be able to get exactly the behavior you want (and it...
ViewState, div tags <p>I have several Div tags on a page which are dynamic, i.e. depending on certain criteria they are either visible to the user or not. I want to add them to the page's view state so that upon postback they are not hidden again, how do I do this?</p>
<p>I would just use <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.panel.aspx" rel="nofollow">ASP.NET panels</a> instead of divs if you are going the viewstate route. They render as div's so they would be exactly what you want.</p>
Need some help with simple JavaScript <p>I am very new to the JavaScript, and making only my first attempts to learn. As a small exercise I am trying to so something simple.</p> <p>Pretty much I am trying to reposition button that i have on page load. What do i do wrong?</p> <p>I would appreciate some help.</p> <p>M...
<p>When setting position with CSS you need to specify what measurement you are using... try this:</p> <pre><code>mytestbutton.style.right = x + "px"; mytestbutton.style.top = y + "px"; </code></pre> <p>EDIT:</p> <p>Also you have ".mybutton" when it should be "#mybutton" . refers to classes and # refers to ID's</p> ...
detect geode, fire eagle, or google gear installed on browser <p>is there any demo on how to detect geode ,fire eagle, google gear installed on user browsers and get user location?</p>
<p>I've written a brief <a href="http://npdoty.name/location/#developer" rel="nofollow">page explaining different ways for a developer to obtain a user's location</a>, including IP geolocation, the W3C Geolocation API and reverse geocoding.</p> <p>It's possible that you might want to detect <a href="http://labs.mozill...
how to consume a rest web service from SQL Server <p>I have the following scenario</p> <ul> <li><p>some real basic rest web service mainly, I'm just checking the existence of a single record, it's just a single validation, I'm not moving around hundreds of rows...</p></li> <li><p>that should be called from sql 2005, ...
<p>hey, what do you think of this solution that just came to my mind</p> <p>I create a table in sql with the following fields:</p> <p>id, url, request, response, http_status, domain_user, domain_password, result, begin_time, end_time</p> <p>and I create a visual basic exe, or just a vbscript, to be run from the shel...
SQL Insert rows from two corresponding comma delimited sets of strings <p>I would like to take two separate strings of value pairs delimited by commas and insert each pair into a row in the database.</p> <p>For example:</p> <pre><code>X = "1,2,3" Y = "A,B,C" =&gt; X | Y ...
<p>In SQL Server parse the lists using a method like this: <a href="http://www.sommarskog.se/arrays-in-sql-2005.html" rel="nofollow">http://www.sommarskog.se/arrays-in-sql-2005.html</a>. Tried and true, works great.</p>
Compiling MySQL custom engine in Visual Studio 2008 <p>I have compilation errors while compiling MySQL sample of storage engine from MySQL 5.1.36 sources. Looks to me that I set all paths to include subdirectories but that seems not enough.</p> <p>Here are the errors:</p> <p>1>c:\users\roman\desktop\mysql-5.1.36\sql...
<p>I had to include mysql_version.h.in library that contain all appropriate variables like FRM_VER, etc. That resolved the errors metioned above.</p>
Getting started with socket programming in C# - Best practices <p>I have seen many resources here on SO about Sockets. I believe none of them covered the details which I wanted to know. In my application, server does all the processing and send periodic updates to the clients. </p> <p>Intention of this post is to cove...
<p>Since this is 'getting started' my answer will stick with a simple implementation rather than a highly scalable one. It's best to first feel comfortable with the simple approach before making things more complicated.</p> <p><strong>1 - Binding and listening</strong><br /> Your code seems fine to me, personally I us...
How do I compile and build the taf2-curb Ruby gem on Windows XP with MinGW? <p>How do I compile and build the taf2-curb Ruby gem on Windows XP with MinGW?</p> <p>I tried this, but I'm kinda fishing, unsuccessfully.</p> <pre>C:\Documents and Settings\Me>gem install taf2-curb -- --with-curl-include=C:/curl-7.19.5-devel...
<p>Here's my solution:</p> <ol> <li><p>first of all you need this guy:<br> <a href="https://github.com/oneclick/rubyinstaller/wiki/Development-Kit" rel="nofollow">https://github.com/oneclick/rubyinstaller/wiki/Development-Kit</a><br> hope you can read, and instal-reinstall your ruby with rubyinstaller. </p></li> <li>...
Qt QTableView and horizontalHeader()->restoreState() <p>I can't narrow down this bug, <em>however</em> I seem to have the following problem: - saveState() of a horizontalHeader() - restart app - Modify model so that it has one less column - restoreState() - Now, for some reason, the state of the headerview is tota...
<p>For QMainWindow, the <a href="http://doc.trolltech.com/4.5/qmainwindow.html#restoreState" rel="nofollow"><code>save/restoreState</code></a> takes a version number. <a href="http://doc.qt.digia.com/qt/qheaderview.html#restoreState" rel="nofollow">QTableView's restoreState()</a> does not, so you need to manage this c...
Custom Control and DependencyProperty <p>I created a custom control that internally is using BindingList to keep track of Account objects that are displayed in some custom grid. I want to add a DependencyProperty to my control that will expose set/get for List that will allow me TwoWay binding between my control and da...
<p>How come BindingList is not the same? That's not how C# works:</p> <pre><code>myControl1.List = list1; </code></pre> <p>The meaning of above by definition is set property to value, it is supposed to be the same after set.</p> <p>While you can create a funny logic in the setter of general plain C# class, Dependenc...
what is difference between allocating pointer object by the following 2 ways? <p>I have created a COM componenet named as Test.dll in that I have created an interface IDiscover.</p> <p>Now i came to 2 ways of allocating the memory as</p> <pre><code> IDiscoverPtr id(__uuid(TestClass)); and Test::IDiscover *id=NULL; <...
<p>First one is a Smart Pointer and the Second one is a normal pointer.</p> <p>You don't need to worry about <code>Releasing</code> a Smart Pointer whereas you have to explicitly <code>Release()</code> a normal COM Interface Pointer. </p> <p>For more details on Smart Pointers, <a href="http://en.wikipedia.org/wiki/Sm...
Linq Evaluating a method as a lambda expression <p>I am attempting to select from a List using a linq expression where the range variable is evaluated in a static method that returns boolean. I would like to select the range variable that returns true when the range variable is evaluated using the method.</p> <pre><co...
<p>You don't need the lambda expression in the "where" clause - the query expression translation does that for you. Just use:</p> <pre><code>var result = from rangeVariable in DataSource where Foo.MethodReturnsBoolean(rangeVariable) == true select rangeVariable; </code></pre> <p>I would pers...
Z order and event handling wpf <p>This is a follow up to my question <a href="http://stackoverflow.com/questions/1162963/z-order-in-between-image-and-inkpresenter">here</a>. It seems that even though the <code>InkPresenter</code> is closest to the user, the <code>MouseDown</code>/<code>MouseMove</code>/<code>MouseUp</c...
<p>Because they aren't being handled by anything else? If no one handles the event (sets <code>e.Handled</code> to <code>true</code>) they will continue to traverse through the WPF visual tree. That is what routed events are supposed to do.</p> <p>You haven't really given enough information to know whether something s...
asp.net-mvc shared menu code in table <p>i have a page where the left hand side is a list of bulleted items and the right hand side the actual page of the selected item on the left.</p> <p>right now i am using a table to split the two sections.</p> <p>i have a seperate page for each link but i want to avoid repeating...
<p>Use a m<a href="http://www.asp.net/learn/mvc/tutorial-12-cs.aspx" rel="nofollow">aster view page</a> and put all repeating codes (ie menu) in the master.</p>