input
stringlengths
51
42.3k
output
stringlengths
18
55k
Keeping track of an item in List Box <p>I'm .net newbie starting one project for fun. I'm using list box filled with some city names so user can pick one. Every city class has name and UID. How do I know which city user clicked on? Obviously, I can get text of selected item, run through city list and find one by name b...
<p>Assuming that you are referring to a WinForms <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.aspx" rel="nofollow"><code>ListBox</code></a>, this can be done in the following way.</p> <p>Instead of setting the <code>Items</code> of the <code>ListBox</code> to an array/collection of str...
How to add optional-components to Visual Studio Setup and Deployment projects? <p>I'm trying to create a very basic "Setup and Deployment" project using Visual Studio. What I would like is the ability to choose which <em>components</em> to install. Let's say that each component consists in the primary output of a singl...
<p>VDP (Visual studio Deployment Project) is not cut out for this kind of stuff (read: use Wix instead):</p> <ol> <li>(I'm guessing you want this at runtime) You can use <a href="http://msdn.microsoft.com/en-us/library/aa370360%28VS.85%29.aspx" rel="nofollow">MsiQueryComponentState</a> but for that you will need to pa...
Swing: Creating a draggable component...? <p>I searched the web for examples of draggable Swing components, but I found either incomplete or non-working examples.</p> <p>What I need is a <strong>Swing component</strong> that can be <strong>dragged</strong> by the mouse inside an other component. While being dragged, i...
<p>I propose a simple, but well-working solution, found out by myself ;)</p> <p>What do I do?</p> <ul> <li>When mouse is pressed, I record the <strong>cursor's</strong> position <strong>on screen</strong>, and the <strong>component's</strong> position.</li> <li>When mouse is dragged, I calculate the <strong>differenc...
WPF: How do I loop through the all controls in a window? <p>How do I loop through the all controls in a window in WPF?</p>
<p>I found this in the <a href="http://msdn.microsoft.com/en-us/library/system.windows.media.visualtreehelper.aspx" rel="nofollow">MSDN documenation</a> so it helps.</p> <pre><code>// Enumerate all the descendants of the visual object. static public void EnumVisual(Visual myVisual) { for (int i = 0; i &lt; VisualT...
A technology for reading pdfs online with annotations? <p>is there an open source solution that displays PDFs for online reading? It has to be searchable much like google books and if possible has the ability to display annotations?</p>
<p>By "online reading" I'll assume you mean without a PDF reader plugin on the client. In that case you'll need to convert to HTML</p> <p><a href="http://pdftohtml.sourceforge.net/" rel="nofollow">http://pdftohtml.sourceforge.net/</a></p> <p>If you don't mind losing the ability to copy text then converting to PNG may...
Only load HTML into an IFRAME <p>How can I only load the HTML of a page into an IFRAME, without automatically triggering the download of all the css,scripts,images,videos on the page?</p> <p>Or can you get an event the moment the DOM is "ready".. when the initial HTML has loaded and nothing much more.</p>
<p>There is no cross-browser way to do this. Some browsers provide events that fire when the DOM loads, like <a href="https://developer.mozilla.org/en/Gecko-Specific%5FDOM%5FEvents" rel="nofollow">DOMContentLoaded</a> for Gecko.</p> <p><a href="http://docs.jquery.com/Events/ready" rel="nofollow">jQuery implements this...
Testing and Debugging on the device: How can I stop iTunes to make me crazy every time I connect my device? <p>It's so harrying: Every time when I connect my iPod touch to my mac, iTunes launches and starts synchronizing. This causes collisions with Xcode when it tries to install the app on the device in this time. And...
<p>in the ipod section you can disable automatic synching.</p>
Edit Xml Node <p>I have an xml document where an xml node with a particular name, say 'Data' can appear anywhere in the xml document i.e anywhere in the hierarchy. I need to read these nodes with their node name alone and edit the node attributes. What is the easiest way to do it?</p>
<pre><code>XmlDocument doc = new XmlDocument(); doc.Load(@"Test.xml"); XmlNodeList elem = doc.GetElementsByTagName("Data"); foreach (XmlNode tag in elem) { //do whatever you want to the attribute using SetAttribute method } </code></pre> <p><a href="http://msdn.microsoft.com/en-us/library/system.xml.xmlelement.getele...
Most specific subclass for a Java object? <p>I have two classes A and B, where B is subclass of A and A is not abstract. Therefore I can have objects that are instance of A and objects that are instance of B (and therefore of A). </p> <p>How can I distinguish objects that are only instance of A?</p> <p>Sure, I can wr...
<pre><code>object.getClass() == A.class </code></pre>
Is Objective-C only used for development on Mac OS/iPhone? <p>I don't know Objective-C but to me it appears a nice language. But the only context I know it from is everything Apple. But Objective-C is even in the GNU Compiler Collection. </p> <p>Is there something missing in the open ones? Or is there already a broade...
<p>I think ObjC has been isolated to the Apple world through a quirk of history and the nature of proprietary systems.</p> <p>First, you need to separate ObjC from Cocoa. ObjC is a very primitive language. I think it is a very elegant language, but it is extremely basic. You can implement ObjCv1 in a C pre-processor. ...
Creating SubDomains to Absolute Paths with .htaccess <p>Hey, My host is absolutely terrible. For some odd reason creating a subdomain in cPanel simply does not work, and their support lines are always busy. I thought I could get around this by using .htaccess. I'm sure it's not that hard, but I'm kind of new to mod...
<p>I doubt you'll be able to get your subdomain to function outside of your public_html folder (although I'm no server admin). Typically that requires DNS modifications or tweaking the server's configuration. Have you tried making a sub-directory and rewriting calls to the subdomain? For example this placed in the ....
Best SQLite practices on the iPhone <p>What are some best practices to keep in mind when working extensively with SQLite on the iPhone? Tips/tricks/convenience factors all appreciated.</p>
<p>I can recommend using <a href="https://github.com/ccgus/fmdb" rel="nofollow">FMDB</a> as a nice Cocoa SQLite wrapper.</p>
How to copy a byte[] into a char*? <p>All I need this for is strcpy().</p> <p>I want to see whether the first three bytes of a buffer(byte array) are "JMX" as string.</p> <p>This is what I did so far:</p> <pre><code>char * ddj; strcpy( ddj, buffer ); //buffer is BYTE[] if ( strcmp( "JMX", ddj ) == 0 ) //check first ...
<p>Tho things go wrong here:</p> <ol> <li><code>ddj</code> does not point to any actual memory. Hence the copy will have undefined behavior</li> <li>The copying is not necessary in the first place.</li> </ol> <p>This is what you can do:</p> <pre><code>if(strncmp("JMX", buffer, 3) == 0) { buffer += 20; size -= 20...
Regex for tree structures? <p>Are there regular expression equivalents for searching and modifying tree structures? Concise mini-languages (like perl regex) are what I am looking for.</p> <p>Here is an example that might clarify what I am looking for.</p> <pre><code>&lt;root&gt; &lt;node name="1"&gt; subtrees ....
<p>TSurgeon and Tregex from Stanford is capable of doing that. You can download the library from <a href="http://nlp.stanford.edu/software/tregex.shtml">http://nlp.stanford.edu/software/tregex.shtml</a></p>
setNeedsDisplay doesn't always call drawRect <p>I have a custom view in a custom table cell. Every time a specific property on the custom view is changed I call <code>[self setNeedsDisplay]</code> which redraws the view in <code>- (void)drawRect:(CGRect)rect</code>. That property is set in the table view delegate's <co...
<p>I think I struggled with this issue for almost a week before I found the problem. Here it is, and I kid you not:</p> <p>The pointer to this custom view was defined in the .m file instead of the .h file, making it a class variable instead of an instance variable.</p> <p>And yes I am very, very embarrassed.</p>
How do you abstract out your persistence code when using LINQ to SQL? <p>I love LINQ to SQL but it has been bugging me that in using it, my repository code becomes generated by the LINQ to SQL framework and hence tightly coupled to an SQL Server database.</p> <p>Are any of you using LINQ to SQL in an abstracted, loose...
<p>For myself; I'm content to re-use the object model that LINQ/dbml generates, since in reality the attributes don't hurt me, and any other implementation could provide a similar-enough model - but I don't use my data-context outside the DAL. So I have something like:</p> <ul> <li><code>IFooRepository</code> - define...
NSURL URLWithString: raises exception <p>In short, <code>[NSURL URLWithString:]</code> appears to be raising an exception. According to the documentation "If the string was malformed, returns nil." There is no mention of an exception being raised under any circumstance. In addition to this, I am both encoding the URL a...
<p>I have encountered some occasions where API throws exceptions that shouldn't according to documentation. My suggestion would be to be to make sure (in your actual code) that tmpText really isn't nil (in that case an exception is thrown, as most apis that expect NSStrings are not nil save there). After that, just add...
Daemon python wrapper "subprocess I/O timed out", need some directions <p>I am not very familiar with the way of creating a daemon in Python, therefore wheb trying to install and run a third party open source TeX Python Wrapper i got bite by an error i do nor really understand.</p> <p>I added some print to help debugg...
<p>The timeout is based on the <code>select</code> call </p> <pre><code>readable, writable = select(output_fds, input_fds, [], 0.1)[0:2] </code></pre> <p>The timeout is 0.1 seconds. Is this appropriate? </p> <p>The variable names are murky ("pointer" makes little sense in Python). However, it appears that if noth...
Correctly Rotating a UITableView with Transform without messing around with Interface Builder <p>UiTableView does not provide Horizontal Scrolling in landscape mode.</p> <p>My UiTableView is not full screen (So I cannot just use it horizontal mode while rotating my content, which are pictures) </p> <p>I found that to...
<p>Ok, the problem was that since the width of the tableview was flexible, after the rotation the width of the cells (which is actual the height) were increased too. I overcame the problem by subclassing the UITableView and overriding the layoutSubviews method, so it looks like this now:</p> <pre><code>- (void)layoutS...
Color generation function <p>Let's consider the following scenario: a function which can generate code colors from white to red, from white to blue, from white to pink, from white to orange, etc.</p> <p>The colors code is in RGB format with values from 0 to 255.</p> <p>Any ideas? Can you give me the pseudocode or lin...
<p>It sounds like you're after <a href="http://en.wikipedia.org/wiki/Linear%5Finterpolation">linear interpolation</a> - in your case, interpolating from white to the specified colour. For example, in C#:</p> <pre><code>public IEnumerable&lt;Color&gt; Interpolate(Color from, Color to, int steps) { int range = steps...
How to tell the difference between a page refresh and closing a page <p>I have a web app game and while in the game I want to have it so if a user closes the page or their browser, it will automatically log them out. I tried using the onbeforeunload event attached to the window:</p> <pre><code>window.onbeforeunload = ...
<p>There is not a detectable difference. To automatically logout a user, you should set an expiration on your cookie storing the login or session information. So if you set it for 1 hour, the user would essentially be logged out after that time since the cookie would be destroyed. If you wanted to postpone this auto lo...
rails: how to not include some db attributes in model <p>My DB table has a column that can contain a very big amount of data. I do not want this data to be part of the corresponding rails object (model).</p> <p>How do I tell in the model that I do not want to store this field in memory ?</p> <p>Initially this comes ...
<p>When loading your model you could explicitly set the columns you want to select and skip large columns:</p> <pre><code>MyModel.find(id, :select =&gt; 'column1, column2, column3') </code></pre>
Naming convention for Django views? <p>I'm building a website (in Django) and am confused about the right naming convention to use for my functions. Trivial example: let's say I have a page that lets the user decide whether they want to see image A or image B. Once the user submits the decision, the site displays the i...
<p>Typically the convention is some kind of CRUD (create, retrieve, update, delete). I personally use index, detail, create, update, delete for my actions. However, I don't think this applies to your custom functions.</p> <p>Really it sounds like your functions should be merged into the same "choose" function. You ...
Best practice for hierarchical MySQL asset tracking <p>I'm writing an online project asset tracker but I'm new to MySQL. What would be the best way of tracking projects, users, and assets for something like this? I have 3 tables for assets, users, and projects. Users should own projects and assets. Assets could be memb...
<p>Quote:</p> <blockquote> <p>have a mediumtext field on each project with the id for every asset that it's linked to</p> </blockquote> <p>This is the worst design... maybe ever! Read up on <a href="http://www.agiledata.org/essays/relationalDatabases.html" rel="nofollow">database relations</a>. Take an emergen...
Allow the user to pick a named scope via GET params <p>In my posts model, I have a named scope:</p> <pre><code>named_scope :random, :order =&gt; "Random()" </code></pre> <p>I'd like to give users the ability to get posts in a random order by sending a GET request with <code>params[:scope] = 'random'</code>.</p> <p>S...
<p>I would suggest my very awesome acts_as_filter plugin designed for user-driven filtering of results via named_scopes.</p> <p><a href="http://github.com/tobyhede/acts_as_filter/tree/master" rel="nofollow">http://github.com/tobyhede/acts_as_filter/tree/master</a></p> <p>Eval is fine to use - but make sure you valida...
Uses for Wolfram Alpha in programming <p>Now that <a href="http://www.wolframalpha.com/" rel="nofollow">Wolfram Alpha</a> is released, I am interested in finding out if it can be used as a time-saver in daily programming.</p> <p>What would you use Wolfram Alpha to do, that earlier took you more time to do manually?</p...
<p>I might 'save time' by not playing around with it and doing real work instead. :)</p>
Greasemonkey and Gmail - parsing message contents <p>I want to read the contents of Gmail messages and add some fancyness on links. Here's some code:</p> <pre><code>unsafeWindow.gmonkey.load("1.0", function(gmail){ gmail.registerViewChangeCallback(function(){ if (gmail.getActiveViewType &amp;&amp; gmail.getActiv...
<p>As you say, the <a href="http://code.google.com/p/gmail-greasemonkey/wiki/GmailGreasemonkey10API" rel="nofollow">registerViewChangeCallback()</a> function only fires when the user changes their view from e.g. threads to archives, etc.</p> <p>What you really need is to add a function that intercepts gmail's post-bac...
How do you copy an inline style element in IE? <p>IE does not allow writing to the innerHTML property of style or head elements. So how do you copy a style element from the head of one document to another?</p>
<pre><code>function copy_style(src_style_tag) { var tmp_div = document.createElement('div'); var innerHTML = src_style_tag.innerHTML; tmp_div.innerHTML = '&lt;p&gt;x&lt;/p&gt;&lt;style type="text/css"&gt;' + innerHTML + '&lt;/style&gt;'; return tmp_div.getElementsByTagName('style')[0]; } </code></p...
Should my delete stored procedure account for cascading to FK tables? <p>Say I have a Employees table (PK is employeeID) and a sales table, where the sales table has a FK column for employeeID.</p> <p>Now when designing my deleteEmployee stored procedure, should I first delete rows in the Sales table or should I creat...
<p>No, no, no.</p> <p>Add a field to the Employee table called "OutServiceDt" and store the date they left your company.</p> <p>That way you keep the records of the sales they made, their address information, and whatever else you've got :)</p> <p>If you're looking for employes who are in service, filter on "OutServ...
Getting json on Ajax response callback <p>I am trying to create a little ajax chat system (just for the heck of it) and I am using prototype.js to handle the ajax part.</p> <p>One thing I have read in the help is that if you return json data, the callback function will fill that json data in the second parameter.</p> ...
<p>This is the correct syntax for retrieving <a href="http://www.prototypejs.org/learn/json">JSON with Prototype</a></p> <pre><code>onSuccess: function(response){ var json = response.responseText.evalJSON(); } </code></pre>
Why does Internet Explorer open form submission in a new window and not in a dynamically inserted iframe? <p>I am trying to get post a form to a hidden, dynamically inserted iframe, but in Internet Explorer the form submission opens in a new window.</p> <pre><code>var iframe = document.createElement('iframe'); iframe....
<p>Apparently you need to include the name in the call to createElement. This works in IE and causes an exception in standards compliant browsers. We get:</p> <pre><code>var iframe; try { iframe = document.createElement('&lt;iframe name="hidden_iframe"&gt;'); } catch (ex) { iframe = document.createElement('ifr...
Castle Windsor Fluent Registration - What does Pick() do? <p>When using auto-registration with castle windsor I see people doing things like </p> <pre><code>_container.Register( AllTypes.Pick().FromAssembly(Assembly.GetExecutingAssembly()) .WithService.FirstInterface()); </code></pre> <p>For the life of me I ca...
<p><code>Pick(IEnumerable&lt;Type&gt;)</code> <a href="http://fisheye2.atlassian.com/browse/castleproject/trunk/InversionOfControl/Castle.MicroKernel/Registration/Strategies/AllTypes.cs?r=5688#l128" rel="nofollow">is a synonym for</a> <code>From(IEnumerable&lt;Type&gt;)</code>, i.e. it selects the specified types as re...
Run code on creation of a PHP class instance? <p>I want code to run whenever I create a new object. For example, see this:</p> <pre><code>&lt;?php class Test { echo 'Hello, World!'; } $test = new Test; ?&gt; </code></pre> <p>I want it to echo "Hello, World!" whenever I create a new instance of this object, without...
<p>You should read about <a href="http://www.php.net/manual/en/language.oop5.decon.php" rel="nofollow">constructor</a></p> <pre><code>&lt;?php class MyClass { public function __construct() { echo "This code is executed when class in instanciated."; } } ?&gt; </code></pre>
Executing Java 5 Code With Java 6 <p>Is there <em>any</em> way I can run class files (i.e. with main as the entry point) on JDK 6 that were compiled with Java 5?</p>
<p>Yes. Old java code can be executed on newer JVMs, but not the other way around.</p> <p>You'll be fine.</p>
passing value to eventListener functions <pre><code>for ( var i=0; i&lt;thumbs.length; i++) { var num = i; Core.addEventListener(thumbs[i], "click", Slide.thumbClick); } </code></pre> <p>in the above code, i want to pass the value of <code>var num</code> to the <code>thumbClick</code> eventliste...
<p>Don't remember for sure, but you should be able to do something like this:</p> <pre><code>Core.addEventListener(thumbs[i], "click", function() { //...do stuff here }); </code></pre> <p>var <em>num</em> should still be available to this anonymous function.</p>
Determining application issue, database issue, or hardware issue? <p>I have a web application, backed by a SQL Server database, which was working fine till yesterday. Now I have performance issues with that application. How do I know whether it is an application issue or database issue or hardware issue?</p> <p>Can an...
<p>This question is going to require additional questions before you can get close to diagnosing the problem:</p> <p>Do you have the source code? Do you know what SQL statements are being executed during the time that the app is having performance problems? If so, you can run the SQL statements against the DB directly...
What convention in Concordion allows for automated generation of Breadcrumbs? <p>I am starting to play with <a href="http://www.concordion.org/" rel="nofollow">Concordion</a> to create some tests for a small piece of code I am developing. In the example, it states <a href="http://www.concordion.org/Example.html" rel="n...
<p>Beside the <a href="http://www.concordion.org/dist/1.4.1/test-output/concordion/spec/concordion/results/breadcrumbs/Breadcrumbs.html" rel="nofollow">link</a> above, also read <a href="http://www.concordion.org/dist/1.4.1/test-output/concordion/spec/concordion/results/breadcrumbs/DeterminingBreadcrumbs.html" rel="nof...
Move sub nodes into parent attributes with XSLT <p>I have some XML which contains records and sub records, like this:</p> <pre><code>&lt;data&gt; &lt;record jsxid="id0x0b60fec0" ID="12429070" Created="2008-10-21T03:00:00.0000000-07:00"&gt; &lt;record jsxid="id0x0b60ff10" string="101"/&gt; &lt;record jsxid="id0x0e...
<p>Here's a complete solution:</p> <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;!-- By default, recursively copy all nodes unchanged --&gt; &lt;xsl:template match="@* | node()"&gt; &lt;xsl:copy&gt; &lt;xsl:apply-templates select="@* | node()"/&gt...
Filtering Windows Messages in a Hook Filter Function <p>I am trying to retrieve messages for another application with a Windows hook. I have setup a WH_GETMESSAGE hook with SetWindowsHookEx. This is done via a DLL. In my GetMsgProc function (that should be called whenever the target application receives a message) I...
<p>Are you sure that you're hooking the correct window or the correct message, respectively? Under some circumstances <code>WM_SYSCOMMAND</code> or <code>WM_MENUCOMMAND</code> is generated instead of <code>WM_COMMAND</code>.</p> <p>Your code looks fine, have you also tried dumping the incoming messages into console?</...
red5 actionscript <p>How to get a parameter encode in the url ? for exemple, if we have an html file containning : how to get the value of a from application.java class ?</p> <p>Thanks </p>
<p>Since Red5 is based on RTMP, there is no http request to get parameters from. Instead, you need to send the parameter from the client swf to Red5 over RTMP. Depending on what data you are passing you could either send this data as a connection parameter to the NetConnection or you could define a method on the Applic...
How to display Duration only Hours:Minutes:Second in Gridview Asp.Net by using LINQ to SQL? <p>I want to display the duration only Hour, Minutes, and Second in data Gridview by Subtract TimeCheckOut from TimeCheckIn in ASP.NET using LINQ to SQL</p> <p>Here is code behind:</p> <pre><code>Dim db = new MyDataContext Dim...
<p>It is possible to just subtract the date and time to get the Timespan so you should be able to use </p> <pre><code> Text='&lt;%# FieldDisplayDuration(Eval("TimeCheckIn"), Eval("TimeCheckOut")) %&gt;' </code></pre> <p>and something like this function:</p> <pre><code>Protected Function FieldDisplayDuration(ByVal Ch...
What are good, freely available SSA/SCCP resources? <p>This is what I could come up with so far:</p> <p>gcc related:</p> <ul> <li><a href="http://gcc.gnu.org/projects/tree-ssa/" rel="nofollow">SSA for Trees</a></li> <li><a href="http://www.airs.com/dnovillo/Papers/tree-ssa-gccs03-slides.pdf" rel="nofollow">Tree SSA â...
<p>You should be aware that GCC no longer uses the SSA described in those papers (Chow's HSSA). Rather it uses an "alias oracle" to disambiguate between memory addresses. It still uses SSA for scalar variables.</p> <p>Resources:</p> <ul> <li>I'm surprised you missed: "<a href="http://www.airs.com/dnovillo/Papers/gcc2...
XPath can't find a table by id <p>I'm doing some screen scraping using WATIJ, but it can't read HTML tables (throws NullPointerExceptions or UnknownObjectExceptions). To overcome this I read the HTML and run it through JTidy to get well-formed XML.</p> <p>I want to parse it with XPath, but it can't find a <code>&lt;t...
<p>I don't know anything about JTidy, but I for WATIJ, I believe the reason you are getting the NullPointer and UnknownObject Exceptions is because your XPATH is using lower cased nodes. So say you are using "//table[@id='searchResult']" as the xpath to lookup the table in WATIJ. That won't actually work because "table...
How to send information Google Checkout through an API? <p>Has any one integrated Google Checkout? I have already tried with example provided on Google Checkout help and it working fine but I want to send credit card information and other informations like address, name, etc from my web site through an API. I am not f...
<p>Here is some information on the Google Checkout SDK.</p> <p><a href="http://code.google.com/apis/checkout/index.html" rel="nofollow">http://code.google.com/apis/checkout/index.html</a></p>
Reliable cross browser way of setting Status bar text <p>I've heard of <strong>window.status</strong> and that it can be used to control the browser's status bar text, but I would like to know if there are better or newer methods that can do the same, with most modern browsers. Also, is it possible to change the status...
<p>The feature you are looking for as been disabled for security reason.</p> <p>Here is another solution to your problem.</p> <p>You could create a DIV and put the position:fixed; at the bottom of the page, so people will always see it.</p>
How to move from windows applications programming (WinForms using C#.NET) to web applications programming (ASP.NET)? <p>I have been working on winforms using C# in my company for quite a long time, and I have a fair experience implementing those. However, I need to change my job and work somewhere else. The market in h...
<p>Some of the stumbling blocks you'll run into that aren't covered under WinForms development are:</p> <ul> <li>The ASP.NET Page Life Cycle</li> <li>IIS Configuration</li> <li>Security</li> <li>Performance</li> <li>Search Engine Optimization</li> <li>The HTTP protocol</li> <li>HTML/XML/CSS/Javascript</li> <li>Databas...
How do i run adobe air application without Adobe air player? <p>i dowload some animation from <a href="http://www.3dfreeair.com" rel="nofollow">http://www.3dfreeair.com</a> . so how can i run without Adobe AIR ?. How can i install in linux os ?.</p> <p>I am beginner so don't mistake me . i dont know anything about air...
<p>You can't run them without Adobe AIR...</p> <p>You need to install it from here: <a href="http://get.adobe.com/air/" rel="nofollow">http://get.adobe.com/air/</a></p>
Black status bar turns white when quitting iPhone app <p>I gave my iPhone app a black status bar by adding the UIStatusBarStyleOpaqueBlack / UIStatusBarStyle to the Info.plist file. It works great most of the time. The black status bar shows when the app is running and when the Default.png is being shown. </p> <p>The ...
<p>Set the background color of your window to black.</p> <pre><code>[self.view.window setBackgroundColor:[UIColor blackColor]]; </code></pre>
Interview qns...Do the below without any conditional or comparison operator <p>Do the below without any conditional or comparison operator.</p> <pre><code>if (Number &lt;= 0) { Print '0'; } else { print Number; } </code></pre> <p>thanks..</p>
<p>My original simple solution:</p> <pre><code>1. print( (abs(Number)+Number) / 2 ) </code></pre> <p>That solution would work in most cases, unless Number is very large (more than half the maximum e.g. Number >= MAX_INT/2) in which case the addition may cause overflow.</p> <p>The following solution solves the overfl...
How to insert a string in an empty font tag? <p>how can I add a string in an empty font tag? Like if in the second font tag there is no value, I will just insert a <code>&lt;br /&gt;</code> tag. How can I do that?</p> <p>I have this HTML code:</p> <pre><code>&lt;P ALIGN="LEFT"&gt; &lt;FONT FACE="Verdana" style="f...
<p>You shouldn't be using a font tag.</p> <p>You can </p> <pre><code>str_replace("&gt;&lt;/FONT&gt;", "&gt;$myinserttext&lt;/FONT&gt;", $myhtml); </code></pre> <p>in PHP or</p> <pre><code>$("font:empty").html("Sample Content"); </code></pre> <p>in jQuery.</p>
Why does SQL choose an incorrect index in my case? <p>I have a table with two indices; one is a multi-column clustered index, on a 3 columns:</p> <pre><code>( symbolid int16, bartime int32, typeid int8 ) </code></pre> <p>The second is non clustered on </p> <pre><code>( bartime int16 ) </code></pre> <p>T...
<pre><code>SELECT symbolID, vTrdBuy FROM mvTrdHidUhd WHERE typeID = 1 AND barDateTime = 44991 AND symbolid IN (1010,1020,1030,1040,1050,1060) </code></pre> <p>This condition is not covered by a single contiguous range of your clustered index.</p> <p>These rows:</p> <pre><code>1010, 44991, 1 ...
ASP.NET with jQueryUI: text box value is getting as null in Button click event <p>I have an ASP.NET page where I have a button When a user clicks on the button,I will check whether the user has logged in or not.If not logged in I will show a modal popup to login (using jQueryUI). I have placed one textbox(txtPassword) ...
<p>Try to get txtPassword value like this</p> <pre><code>string val=txtPassword.Attributes["value"].ToString(); </code></pre>
How to use ASP.NET MVC Html Helpers from a custom helper? <p>I have several pages listing search results, for each result I would like to display I want to create a custom View Helper in order to avoid duplicating the display code.</p> <p>How do I access the convenient existing view helpers from my custom view helper?...
<p>This example should help you. This helper renders different link text depending on whether the user is logged in or not. It demonstrates the use of ActionLink inside my custom helper:</p> <pre><code> public static string FooterEditLink(this HtmlHelper helper, System.Security.Principal.IIdentity user, str...
GNU screen and less: overwriting previous output <p>I'm in the process of switching from multiple tabs in iTerm to one GNU <code>screen</code> session. In iTerm, I can look at a file with <code>less</code> and the content of the terminal is restored when I quit <code>less</code>. In GNU <code>screen</code>, the previou...
<p>Try adding</p> <pre><code>altscreen on </code></pre> <p>to your .screenrc.</p>
problem issue in using checkbox in datatable <p>Hi all I want to use as a column in datateble and I my code is </p> <pre><code>&lt;/ice:checkbox&gt; &lt;/ice:column&gt; </code></pre> <p></p> <p>but I got this error: "java.lang.IllegalStateException: Could not find UISelectMany component for ch...
<p>have you tried using something like</p> <pre><code>&lt;ice:column&gt; &lt;/ice:checkbox value="#{BEAN.ATTRIBUTE}"&gt;&lt;/ice:checkbox&gt; &lt;/ice:column&gt; </code></pre> <p>Make sure to define BEAN in Faces-config.xml as managed bean and Attribute should be a member of that bean of type boolean.</p>
Linux iNotify one shot and event mask problem <p>I'm trying to use iNotify in linux rhel5, kernel 2.6.18, glibc 2.5-18. I did not define the event as one shot but for some some reason it behaves as if I did. The impact is that I have to re-add a watch after each event. Any one ever used iNotify? Another problem is that...
<p>Write the smallest example you can and test that. If it demonstrates the behaviour you are talking about then add it to your question. If it behaves normally then add a little more of your code and test again. Keep repeating until you have reproduced the error or you have your code working. Often I find that bui...
The cons and pros of smartGWT <p>I'm starting work on a smartGWT project in a few days and I'd like to know what kind of experiences you had. To avoid making this a bashing of smartGWT or GWT or a freestyle discussion, I'm going to provide some pointers for the discussion:</p> <ul> <li>Do you feel that the provided wi...
<p>I guess you already have your answers, but I would like to add a few more comments that may affect your decision:</p> <p>Pros:</p> <ul> <li>SmartGWT is <strong>the</strong> most compreensive LGPL GWT-based widgetery library you can find. So if you care for GPL pain, this is your thing</li> <li>Comprehensive Showca...
How to add a 2-column combobox to XtraGrid <p>Hi all How can add a 2-column combobox to Xtragrid which has one col is stored to database and the other is used to display in the xtragrid. Thank so much</p>
<p>You need to create a RepositoryItemLookUpEdit then set it as your column.ColumnEdit property: </p> <pre><code>//Set the dropdown values for the cell RepositoryItemLookUpEdit colCombo = new RepositoryItemLookUpEdit(); colCombo.ShowHeader = true; colCombo.ShowFooter = false; colCombo.DataSource = dsRules.YOURT...
Continuous sequences in SQL <p>Having a table with the following fields:</p> <p>Order,Group,Sequence</p> <p>it is required that all orders in a given group form a continuous sequence. For example: 1,2,3,4 or 4,5,6,7. How can I check using a single SQL query what orders do not comply with this rule? Thank you.</p> <p...
<p>Assuming that the sequences are generated and therefore cannot be duplicated:</p> <pre> <code> SELECT group FROM theTable GROUP BY group HAVING MAX(Sequence) - MIN(Sequence) &lt> (COUNT(*) - 1); </code> </pre>
Javascript clear all cookies <p>I am attempting to clear all of my cookies, some of which are set on a server and some of which are browser cookies.</p> <p>I have tried using document.cookie = "" however this did not satisfy my needs so I wrote some Javascript code, which can be seen below</p> <p>The pauseClearAllCoo...
<p>have you tried to set all the cookie time formats to "a millisecond ago"? that ought to clear it up.</p>
Ant loadproperties failed (bcel error?) <p>I'm working on a simple build script that should get some constants from a java class file and use them as the version numbers in my file names. I use Eclipse and its own Ant, but put <em>bcel-5.2.jar</em> in my libs folder and into the classpath for the Ant call.</p> <pre><c...
<p>The <a href="http://ant.apache.org/manual/Tasks/loadproperties.html" rel="nofollow">documentation for <em>loadproperties</em></a> says that the nested <em>classpath</em> element is for use with the <em>resource</em> attribute - an alternative to using <em>srcfile</em>.</p> <p>Add the BCEL jar to your global classpa...
WebDAV vs. SDK for accessing the Exchange 2003 calendar <p>I'm trying to figure out how to access the calendar of Exchange 2003 from a remotely hosted ASP.NET/C# page (I only need to read and display calendar appointments/meetings etc.). As I understand it, I'm mainly down to two options - using WebDAV or the Exchange ...
<p>As you say there are a number of ways to do this, but webdav is the best bet, as it is supported by MS from managed code where as CDO tend to have greyer shades of support depending on what you are doing. If you are new to webdav it may be an idea a looking at some of the wrapper classes around as that could speed ...
How to reuse a string variable in c++ <p>Is this correct, it works OK </p> <pre><code>string str("in.dat"); ifstream fin(str.c_str(), ios::binary | ios::ate ); . . . //Do I need to clear the string before assigning new name??? str = "out.dat"; ofstream fout(str.c_str(), ios::binary); //seems to work </code></pre> <p>...
<p>What everyone else has said is true. However, in the code you posted you could just as well have said:</p> <pre><code>ifstream fin( "in.dat", ios::binary | ios::ate ); ofstream fout( "out.dat", ios::binary ); </code></pre>
Any Migration tool AS2 to AS3 <p>HI All,</p> <p>I have a AS2 code. I want to change AS3.</p> <p>Any Migration tool AS2 to AS3.</p> <p>Please help me. thanks</p> <p>WIth regards Viswa</p>
<p><a href="http://www.electrotank.com/junk/jobe/AS2_to_AS3.zip" rel="nofollow">http://www.electrotank.com/junk/jobe/AS2_to_AS3.zip</a></p> <p>Instructions and everything inside. This might help you for small bits of code but for a proper conversion i am afraid there is no magic tool.</p> <p>Good luck :)</p> <p>PS: ...
Automatically create event handler from markup view (c#) <p>Is it possible to let Visual Studio automatically create an event handler method for an UI component within the markup view?</p> <p>Let's say I have</p> <pre><code>&lt;asp:label runat="server" /&gt; </code></pre> <p>and would like to handle the OnPreRender ...
<p>You can automatically create a handler method by going to your page's OnLoad or Page_Load method, and adding a handler for the event. For example, for this Label:</p> <pre><code>&lt;asp:label ID="MyLabel" runat="server" /&gt; </code></pre> <p>You would do this:</p> <pre><code>protected void OnLoad(object sender, ...
Prime divisors of a number in ML <p>In ML i want to get the prime divisors of a number. How can I do this, I am beginner.</p>
<p>There are several general algorithms for finding the prime divisors of an integer: see <a href="http://en.wikipedia.org/wiki/Integer%5Ffactorization" rel="nofollow">wikipedia</a>. <a href="http://en.wikipedia.org/wiki/Trial%5Fdivision" rel="nofollow">Trial division</a> with a simple primality test is simplest to und...
DWR 2 to DWR 3 comet <p>I currently develop with DWR 2, but I now want to try DWR 3. I don't understand how is possible to make comet with DWR 3. I've searched on Google many many times but I've not found any good examples. Could anyone help me?</p>
<p>You need to <a href="http://directwebremoting.org/dwr/reverse-ajax/getting-started" rel="nofollow">configure DWR</a> to enable Reverse AJAX. To start the Comet cycle, you need to request Reverse AJAX on page load: <code>dwr.engine.setActiveReverseAjax(true);</code>. To enable full streaming, set the <code>init-par...
Is it possible to develop a web browser using Python? <p>Developing a web browser in Python - is it possible?</p>
<p>Sure, it's possible. Why should it be any different to other languages? Python is still a complete and proper programming language, even if it is rather high-level. Now I'm not sure it would produce great <em>performance</em>, which is somewhat desirable for the rendering and JavaScript engines of a browser, in part...
html(val), text(val), append(content) and the others <p>This question might sound subjective but I really do need to make a choise and in order for me to do that, I need some experienced voices.</p> <p>Is there a resource, link or opinion that describes when and considering what issues to use the jquery's html(val), t...
<p>Well, <a href="http://docs.jquery.com/Attributes/html#val">html(val)</a> replaces the <strong>html</strong> content, <a href="http://docs.jquery.com/Manipulation/append#content">text(val)</a> inserts text (not tags) always while <a href="http://docs.jquery.com/Manipulation/append#content">append(val)</a> appends htm...
Any T4 Editor for VS 2010 Beta 1? <p>VS2010 Beta 1 was released today, and I see lots of T4 usage in Entity Framework and modelling. Is there already a T4 Editor available?</p>
<p>tangible T4 editor is available for VS2010 Beta 1 - includes intelli-sense and highlighting. <a href="http://tangibleengineering.blogspot.com/2009/05/tangible-t4-editor-for-visual-studio.html" rel="nofollow">http://tangibleengineering.blogspot.com/2009/05/tangible-t4-editor-for-visual-studio.html</a></p>
Would nhibernate be used in large scale projects like say facebook? (for arguments sake) <p>For those who know the inner workings of nhibernate, do you think a large scale web application like say facebook/myspace would use nhibernate?</p> <p>Or is nhibernate well suited for more low traffic sites like company sites e...
<p>NHibernate is not chatty at all. About scalability, there was already a <a href="http://groups.google.com.ar/group/nhusers/browse%5Fthread/thread/1de495362e5b15ba/c43ccb138be737be">question on NH's groups</a>, which was more about the complexity of the database then traffic, but might still be interesting for you.</...
Deploying multiple Java web apps to Glassfish in one go <p>I have multiple (8) WAR files and 1 EAR file that I want to deploy to Glassfish without having to redeploy each application through the Admin Console.</p> <p>Previously in Tomcat the WAR files could just be dropped into the webapps directory, is there somethin...
<p>Yep - take a look at /domains/domain1/autodeply - you can drop things straight in there.</p> <p>(substitute domain1 with your domain if you're working in a custom environment)</p> <p>(sorry if the folder is off - it's coming from memory at this point)</p>
try... except... except... : how to avoid repeating code <ul> <li>I'd like to avoid writting <code>errorCount += 1</code> in more than one place.</li> <li>I'm looking for a better way than</li> </ul> <pre> success = False try: ... else: success = True finally: if success: ...
<p>This look like a possible application of Python's new <code>with</code> statement. It allows to to unwind operations and release resources securely no matter what outcome a block of code had.</p> <p>Read about it in <a href="http://www.python.org/dev/peps/pep-0343/" rel="nofollow">PEP 343</a></p>
How can I strip multiline C comments from a file using Perl? <p>Can anyone get me with the regular expression to strip multiline comments and single line comments in a file?</p> <p><em>eg:</em></p> <pre><code> " WHOLE "/*...*/" HAS TO BE STRIPED OFF....." 1. /* comment */ 2. /* comment1 */ code...
<p>From <a href="http://faq.perl.org/perlfaq6.html#How%5Fdo%5FI%5Fuse%5Fa%5Fregul">perlfaq6</a> "How do I use a regular expression to strip C style comments from a file?":</p> <p><hr></p> <p>While this actually can be done, it's much harder than you'd think. For example, this one-liner</p> <pre><code>perl -0777 -pe ...
MSbuild Publish to a specific directory using batch file <p>Following is the batch file for doing a publish to a publish directory</p> <pre><code>@echo off start /b C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe /target:publish /p:SolutionDir="C:\cc\ttr\code\Com.IT.sln" /p:PublishDir="C:\cc\tt...
<p>When <code>start</code> gets multiple arguments the first one is the title for the new window. Try</p> <pre><code>start /B "" start /b C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe ^ /target:publish ^ /p:SolutionDir="C:\cc\ttr\code\Com.IT.sln" ^ /p:PublishDir="C:\cc\ttr\code\deploy\" ^ /p:Configuration=Debug ...
JavaScript range slider / dual slider exist withOUT using a framework <p>I'm looking for a JavaScript control that is a Range Slider (dual knob) that:</p> <ul> <li>does NOT use an existing JS framework (e.g. dojo, jquery, etc) - <em>unless you can roll/create your own sub framework where I can compile in just the comp...
<p>jQuery UI has a nice one:</p> <p><a href="http://jqueryui.com/demos/slider/">http://jqueryui.com/demos/slider/</a></p>
Java: Getting resolutions of one/all available monitors (instead of the whole desktop)? <p>I have two different-sized monitors, connected together using (I believe) TwinView.</p> <p>I tried</p> <pre><code>System.out.println(Toolkit.getDefaultToolkit().getScreenSize()); </code></pre> <p>and get</p> <pre><code>java.a...
<p>you'll want to use the <a href="http://docs.oracle.com/javase/8/docs/api/java/awt/GraphicsEnvironment.html" rel="nofollow">GraphicsEnvironment</a>.</p> <p>In particular, getScreenDevices() returns an array of <a href="http://docs.oracle.com/javase/8/docs/api/java/awt/GraphicsDevice.html" rel="nofollow">GraphicsDevi...
Is it good to store images in database or file system? <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay">Storing Images in DB - Yea or Nay?</a> </p> </blockquote> <p>What you recommend for storing images in:-</p> <ul> <li>...
<p>Which is better depends on your situation (of course). Keeping them in a database means that the system is pretty much completely portable. Everything is tightly linked and "travels" together.</p> <p>The downside is that everything is tightly linked and you need to hit the database to retrieve the image. This inclu...
3d model to fit in viewport <p>How does a 3D model handled unit wise ?<br> When i have a random model that i want to fit in my view port i dunno if it is too big or not, if i need to translate it to be in the middle...<br> I think a 3d object might have it's own origine.</p>
<p>You need to find a bounding volume, a shape that encloses all the object's vertices, for your object that is easier to work with than the object itself. Spheres are often used for this. Either the artist can define the sphere as part of the model information or you can work it out at run time. Calculating the optima...
AS3 URLLoader throwing URL not found, but is connecting successfully <p>Okay getting some weirdness. I have a simple URLLoader in AS3 that loads an external XML document. It's loading just fine, I get a correct 302 Not Modified response in <a href="http://www.charlesproxy.com/" rel="nofollow">Charles</a>, however flash...
<p>I'm finding your code's structure a little odd - why do you have functions inside of a function?</p> <p>I rewrote your code like this and it works perfectly fine (i just ran it on the timeline in flash cause i'm too lazy to set up a new project):</p> <pre><code>var xmlLoader:URLLoader = new URLLoader(); var xmlDat...
CRSAPKCS1v15Encryptor class not found when compiling a Symbian C++ application <p>I have written code in symbian c++ but i faced one problem</p> <blockquote> <p>CRSAPKCS1v15Encryptor class was not found for aes algo</p> </blockquote> <p>and for rsa algo in symbian</p> <blockquote> <p>cryptosymmetric.h cryptop...
<p>Make sure you have some SDK installed that provides the header files and the CRSAPKCS1v15Encryptor class. Perhaps you'll need to tell your compiler the path to search for these files. Also a look at the examples and comments <a href="http://wiki.forum.nokia.com/index.php/Asymmetric%5Fcrypto" rel="nofollow">here</a> ...
Is it safe to use a subversion feature branch after reintegrate-merged to trunk? <p>Must a feature branch be deleted after it's merged (reintegrated) back to trunk?</p> <p>I prefer to constantly merge changes back and forth from my feature branch - I believe this keeps the conflicts to a minimum. Yet I understand that...
<p><strong>edit</strong>: <strong>This problem appears to have been fixed in SVN 1.8.</strong> The <a href="http://svnbook.red-bean.com/en/1.8/svn.branchmerge.basicmerging.html#idp11104528">section on basic merging from the SVN 1.8 book</a> has been updated to say that it is OK to reuse a feature branch. The answer bel...
HTTP version performance over firewalls <p>We have a system that makes calls to a web service across a proxy. This is coded in C#, using HttpWebRequest. We've had problems with the speed of these calls for a long time, and I'd been trying to track it down. An unrelated conversation led to one of the operations guys to ...
<p>All performance related questions have a single answer: Measure.</p> <p>Guesswork is always wrong when it comes to performance (usually since the performance is bad <em>despite</em> the design of the system which means that you <em>think</em> it shouldn't be slow but it <em>is</em>).</p>
Running MSTest with tests against different databases <p>I would like to ask what is the best way to execute a setup like the following: We have tests suite that is compiled, and in the app.config file I have 6-7 different connection strings to different databases. I would like to run the tests suite against every conn...
<p>I have had a similar issue. This is what I did:</p> <p>My app.config looks like this:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;configuration&gt; &lt;appSettings&gt; &lt;add key="ConenctToInputDB" value="InputDev" /&gt; &lt;add key="ConnectToOutputDB" value ="OutputDev"/&gt; &l...
VB Syntax to declare a single model in MVC (to leverage strongly typed views) <p>I'm trying to avoid the use of magic strings as much as I can, but I can't find the correct syntax for VB to bind a single model like is shown in this <a href="http://stackoverflow.com/questions/750543/mvc-using-ajax-to-render-partial-view...
<p>What you're trying to port is a cast operator. Try the following code.</p> <pre><code>&lt;% Dim FormObject As Form = DirectCast(Model, Form) %&gt; </code></pre>
extjs for application (with embedded http server as well) <p>Is there a framework which allows easy adding of ExtJS to a normal .Net application. This way I only have to create a GUI once, which is then accessible through an embedded webserver. This is great since I then can remote access the server/service/application...
<p>I would recommend you to use <a href="http://liveui.net" rel="nofollow">http://liveui.net</a> framework. It provides ASP.net based controls which are translated to Extjs controls automatically. I also contains usefull tools for rapid application development and ... it is free.</p>
Programatically install Certificate Revocation List (CRL) <p>I need to download and install about 50 CRLs once a week and install them on several Windows servers. Downloading is the easy part, is there a way I could script the CRL import process?</p>
<p>Here is my final source (slightly scrubbed for the public) - but should work. I won't change the accepted answer, but I do hope this helps (as does upvoting the question and answers!). </p> <p><b>Note:</b> This will import both a CRL or a regular certificate into the LOCAL MACHINE Trusted Root store. Swapping the b...
regular expression (javascript) How to match anything beween two tags any number of times <p>I'm trying to find all occurrences of items in HTML page that are in between <code>&lt;nobr&gt;</code> and <code>&lt;/nobr&gt;</code> tags. EDIT:(nobr is an example. I need to find content between random strings, not always ta...
<p>use the DOM</p> <pre><code>var nobrs = document.getElementsByTagName("nobr") </code></pre> <p>and you can then loop through all nobrs and extract the innerHTML or apply any other action on them.</p>
Java curve fitting library <p>I'm hoping to find a simple library that can take a series of 2 dimensional points and give me back a larger series of points that model the curve. Basically, I want to get the effect of curve fitting like this sample from JFreeChart:</p> <p><img src="http://www.jfree.org/jfreechart/image...
<p><a href="http://curvefitting.sourceforge.net/" rel="nofollow">curvefitting.sourceforge.net</a> looks like it may be suitable. It offers a variety of methods (cubic spline, polynomial etc).</p>
How to pass in ID with Html.BeginForm()? <p>In <a href="http://en.wikipedia.org/wiki/ASP.NET_MVC_Framework">ASP.NET MVC</a> I'm using the HTML helper </p> <pre><code>Html.BeginForm("ActionName", "Controller", FormMethod.Post); </code></pre> <p>But I need to post to: /controller/action/23434</p> <p>How do I pass in t...
<p>Matt's should work fine. If you are still passing in <code>FormMethod.Post</code>, though, you need to do it like this:</p> <pre><code>Html.BeginForm("action","controller", new { Id = 12345 }, FormMethod.Post); </code></pre> <p>Reversing the third and fourth parameters will result in the <code>Id</code> being tre...
Can an Apache-served pure-HTML website be hacked? <p>Assume you are running a pure-HTML website on Apache. Just serving static files, nothing dynamic, nothing fancy.</p> <p>Also assume all passwords are safe, and no social-hacking (i.e. phishing attacks, etc...)</p> <p>Can a website of this nature basically be hacked...
<p>Yes, such a server can become compromised. A very common vector, sadly, is FTPing to the server over an insecure wifi connection. Anyone listening closely can pick your password out of the air. (It's fun to be at a tech conference and have your password displayed on a screen for all to see, along with the other fool...
WMS authentication plugin <p>I'm trying to create a custom authentication plugin for WMS 2009 in C#.</p> <p>I managed to implement something that for some reason blocks all requests...</p> <pre><code>[ComVisible(true)] [Guid("C0A0B38C-C4FE-43B5-BE9E-C100A83BBCEE")] public class AuthenticationPlugin : IWMSBasicPlugin,...
<p>I ran into the same issue. It isn't enough to return success status from the Authenticate method.</p> <p>Your implemented method must retrieve a handle to a valid Windows Login. Search the net for C# examples of how to call this method: <a href="http://msdn.microsoft.com/en-us/library/aa378184%28VS.85%29.aspx" re...
Why would This Fix the Dual Monitor Issue in Flash? <h1>The Problem:</h1> <p>You have dual monitors set up and view a Flash video (Let's say any YouTube video) in full screen mode in one of the monitors. If you work on the other monitor, the video would exit the full screen mode. Therefore, you cannot work while wat...
<p>I bet it changes <code>if(someting) {...}</code> to <code>if(0) {...}</code>.</p> <p>I guess it prevents code that would exit the full screen if there's a switch to another window from working, ever.</p>
.netCART Credit Card Decryption - IIS 7 App Pool and Decryption issue <p>I've got a site using <a href="http://www.dotnetcart.com/" rel="nofollow">.netCART</a>. It's running fine in production with Windows Server 2003 and .NET 2.0. On the new server (Windows Server 2008) everything is working except for credit card dec...
<p>Don't know where your specific problem is, but that code snippet is equivalent to this:</p> <pre><code>Dim CCEncrypt As String = tools.Decrypt(DataRow("CreditCard").ToString().Trim()) </code></pre> <p>To explain the changes:</p> <ul> <li>You can skip the <code>.Item</code> part because it's an indexer for DataRow...
change the DCB structure of a boost::asio::serial_port <p>I'd like to disable RTSControl using <code>boost::asio::serial_port::set_option</code> function. and also be able to raise or lower the <code>DTR</code> line?</p> <pre><code>boost::asio::serial_port_base::baud_rate baud_option(115200); serialPort.set_op...
<p><a href="http://www.boost.org/doc/libs/1%5F39%5F0/doc/html/boost%5Fasio/reference/SettableSerialPortOption.html" rel="nofollow">Settable serial port option requirements</a> (emphasis mine): </p> <blockquote> <p>In the table below, X denotes a serial port option class, a denotes a value of X, ec denotes a valu...
Going Without SSL Certificates? <p>I'm working on a small website for a local church. The site needs to allow administrators to edit content and post new events/updates. The only "secure" information managed by the site will be the admins' login info and a church directory with phone numbers and addresses.</p> <p>Ho...
<p>Since only your admins will be using the secure session, just use a self-signed certificate. It's not the best user experience, but it's better to keep that information secure.</p>
How to create cronjob using bash <p>Does crontab have an argument for creating cronjobs without using the editor (crontab -e). If so, What would be the code create a cronjob from a bash script?</p>
<p>You can add to the crontab as follows:</p> <pre><code>#write out current crontab crontab -l &gt; mycron #echo new cron into cron file echo "00 09 * * 1-5 echo hello" &gt;&gt; mycron #install new cron file crontab mycron rm mycron </code></pre> <hr> <h2>Cron line explaination</h2> <pre><code>* * * * * "command to...
Explanation of Func <p>I was wondering if someone could explain what <code>Func&lt;int, string&gt;</code> is and how it is used with some clear examples.</p>
<p>Are you familiar with delegates in general? I have a page about <a href="http://csharpindepth.com/Articles/Chapter2/Events.aspx">delegates and events</a> which may help if not, although it's more geared towards explaining the differences between the two.</p> <p><a href="http://msdn.microsoft.com/en-us/library/bb549...
Is a Modal Confirm Box Using JQuery Possible? <p>Looked around quite a bit, and can't seem to find a JQuery solution (<em>maybe its just a limitation of JavaScript</em>) for this:</p> <pre><code>&lt;a href="somelink.php" onclick="return confirm('Go to somelink.php?');"&gt;Click Here&lt;/a&gt; </code></pre> <p>In ...
<p>I just had to solve the same problem. I wound up using the <a href="http://jqueryui.com/demos/dialog/"><code>dialog</code></a> widget from <a href="http://jqueryui.com/home">JQuery UI</a>. I was able to implement this without using callbacks with the caveat that the <code>dialog</code> must be partially initialize...
Assembly compilation error (gcc4.2.4=win, gcc4.3.3=fail) <p>We recently upgraded the code to <code>gcc4.3.3</code> from <code>gcc4.2.4</code>. </p> <pre><code>void testAndSet( volatile int* s, int* val ) { __asm__ __volatile__ ( "btsl $0, %0\n " "jc bitSet\n " "movl $0, %1\n " ...
<p>Probably the optimizer has changed and is now inlining your testAndSet() function into 2 places. Because you are using global names for your labels, this does not work. You should use local names instead. E.g:</p> <pre><code> __asm__ __volatile__ ( "btsl $0, %0\n " "jc 0f\n " "mov...