input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Arithmetic Operators vs Methods in Class Design Guidelines <p>I have many math types like Point3, and I am running into the dilemma of implementing operators, instance and static methods for arithmetic.</p>
<p>So say the type is <code>Point3</code>. Where a, b, c is a <code>Point3</code>, I sure wanna be able to say:<... | <p>In general, I think Microsoft seems to have kind of done A+B in most of their classes similar to this.</p>
<p>For samples, see the entire System.Windows.Media.Media3D namespace, as well as the XNA math classes. Both have point/vector/quaternion/matrices/etc, and use Class.Operator(a,b), and occasionally do c = a +... |
Project Settings and Not set to an instance error <p>I am hoping someone can help point me in the right direction. I was having a StackOverFlow error with my Settings.Designer.cs file. I manually regenerated the file according to this post <a href="http://stackoverflow.com/questions/911573/settings-designer-file-and-... | <p>All of the properties in the settings class are instance properties. In order to use them, you need an instance of the Settings class. The standard way to do this is to access the static Default property on the Settings class, which returns an instance of Settings. From there you can access the individual properties... |
ASP.NET MVC: Should Controllers called by AJAX return JSON or rendered html? <p>I am having trouble deciding if a controller action, which is called by AJAX, should return a partial view, or the "raw" JSON.</p>
<p>Returning a partial view, with rendered HTML makes it easier for the javascript to simply update the curr... | <p>In my opinion, returning JSON and then letting the client side view sort it out can be messy because of the following limitations:</p>
<ol>
<li>No standard templating language for JavaScript. In the worst case scenario, you'll be tempted to concatenate strings to form the HTML that you require.</li>
<li>No easy way... |
Automatic stubbing in java word. What to use? <p>I have huge class that I need to build stub for. </p>
<p>To give you picture it is Messages class of the GWT. Often this is class with dozens of methods that return String.</p>
<p>With JMock I can do stubbing, but I will end with allowing each method... This is not som... | <p>In JMock you can allow the methods you care about with explicit results and then allow any other method of the messages object with an allowing statement that does not include a method. E.g.:</p>
<pre><code>allowing(m).getBlah("something");
will(returnValue("foo"));
allowing(m); // matches anything else, will r... |
Can ${var} parameter expansion expressions be nested in bash? <p>What I have is this:</p>
<pre><code>progname=${0%.*}
progname=${progname##*/}
</code></pre>
<p>Can this be nested (or not) into one line, i.e. a single expression?</p>
<p>I'm trying to strip the path and extension off of a script name so that only the ... | <p>If by nest, you mean something like this:</p>
<pre><code>#!/bin/bash
export HELLO="HELLO"
export HELLOWORLD="Hello, world!"
echo ${${HELLO}WORLD}</code></pre>
<p>Then no, you can't nest <code>${var}</code> expressions. The bash syntax expander won't understand it.</p>
<p>However, if I understand your problem ri... |
Is it feasible to learn Perl and Catalyst at the same time? <p>Is it feasible to learn Perl and Catalyst at the same time? If so, what would be the typical path?</p>
<p>I am experienced .Net/C#/C++ developer but fairly new to Perl</p>
| <p>Catalyst is a web framework in Perl which does use some advanced concepts in Perl like attributes, references, et cetera. Perl should be learnt first. When you are comfortable with Perl, you can dive into Catalyst.</p>
<p>For learning Perl, you can check out <a href="http://learn.perl.org/" rel="nofollow">http://le... |
Implement thread-safe collection for data-binding in .NET <p>I have a Windows Forms application that displays a form with a DataGridView bound to a custom collection that inherits BindingList. I'm using the BindingSource / DataSource mechanism for data-binding. The form is a monitor that displays status information c... | <p>You can just wrap it with your own implimentation of whatever interface you want. Take a look at <a href="http://stackoverflow.com/questions/148587/has-anyone-written-a-thread-safe-bindinglistt">this answer to the same question</a>...</p>
|
How can I persist a session in an iframe? <p>Suppose I have a web app that I want to embed into any other site using an iframe. The iframe references my site and operates independently of the hosting web page.</p>
<p>Well, the browser considers the iframe to be a third party site, therefore its session cookie is cons... | <p>I have faced a similar problem you have here. There is a workaround (Will not work if your intention is to track user behavior across sites).</p>
<p>i. Place a first party persistent cookie on the domain where your iframe is to be hosted. (This can be done using JavaScript).</p>
<p>ii. Dynamically inject the ifram... |
Put icon inside input element in a form <p>How do I put an icon inside a form's input element?</p>
<p><img src="http://i.stack.imgur.com/V0Tjp.png" alt="Screenshot of a web form with three inputs which have icons in them"></p>
<p>Live version at: <a href="http://www.elegantthemes.com/preview/TidalForce/?p=9">Tidal Fo... | <p>The site you linked uses a combination of CSS tricks to pull this off. First, it uses a background-image for the <code><input></code> element. Then, in order to push the cursor over, it uses <code>padding-left</code>.</p>
<p>In other words, they have these two CSS rules:</p>
<pre><code>background: url(imag... |
Any way to select without causing locking in MySQL? <p>Query:</p>
<pre><code>SELECT COUNT(online.account_id) cnt from online;
</code></pre>
<p>But online table is also modified by an event, so frequently I can see lock by running <code>show processlist</code>.</p>
<p>Is there any grammar in MySQL that can make selec... | <p>Found an article titled "MYSQL WITH NOLOCK"</p>
<p><a href="https://web.archive.org/web/20100814144042/http://sqldba.org/articles/22-mysql-with-nolock.aspx">https://web.archive.org/web/20100814144042/http://sqldba.org/articles/22-mysql-with-nolock.aspx</a></p>
<p>in MSSQL you would do the following:</p>
<pre><cod... |
PHP clean urls without access to apache configurations <p>I'm aware of all the canonical ways of getting clean URLs (www.mysite.com/getarticle?a=123 vs www.mysite.com/getarticle/123).</p>
<p>Those solutions include mod_rewrite, force_type and various configurations of apache, mostly.</p>
<p>Since I don't have access ... | <p>Yes.</p>
<p>If you call the script via a, <code>www.example.com/index.php/my/path/here</code> you can get the request path pretty easily from <code>$_SERVER</code>. I personally use <code>$_SERVER['PHP_SELF']</code> but there are several to choose from depending on the version of PHP that you use.</p>
|
when i follow the standard practices of web programming, is my app automatically RESTful? <p>when i use GET to retrieve and show information only, and Create, Update, Delete using POST, will my web app be automatically RESTful?</p>
| <p>No, as the REST idea gives the following mappings:</p>
<pre><code>GET - Retrieve
POST - Create
PUT - Update
DELETE - Destroy
</code></pre>
<p>2 of these html actions (PUT and DELETE) aren't normally supported by browsers so REST frameworks tend to use some fudging to allow them through browsers.</p>
<p>There's al... |
NSTextFieldCell Delegate? <p>I have a text field cell in a table view, from which I need to be made aware when it ends editing. I thought I would set my Controller class as the text field cell's delegate, and then use NSTextField's delegate method textDidEndEditing:, but realized that the text field cell doesn't seem ... | <p><code>NSTextFieldCell</code> inherits from <code>NSCell</code> (well, technically from <code>NSActionCell</code> which inherits from <code>NSCell</code>). The <code>NSCell</code> class is used to (from the <a href="http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSCell_Class/Reference... |
How can I conditionally group items in Crystal Reports? <p>I have a report that is currently separated into two reports, and I'd like to merge them.</p>
<p>Basically it boils down to this:</p>
<p>I ask the user if they want to have a page break for each Property, if they answer yes, I sort/group by Property and then ... | <p>Instead of suppressing the grouping field, try setting it to an empty string <code>""</code>. I was just working on a report last week that was very similar. Even if 'no grouping' was selected, the report was still being grouped by some unknown default. In the formula grouping field, I found that if 'no grouping' wa... |
How To Debug VB.Net Crystal Reports Application That Causes VS2008 to Hang <p>I have encountered an error while debugging a VB.Net application in Visual Studio 2008. While debugging the console application in Visual Studio, when the application instantiates a Crystal Reports 'ReportDocument' object, VS2008 hangs. Ev... | <p>I had a problem a couple of weeks ago with visual studio crashing at a certain point. I opened a second instance of VS with break on all errors switched on then attached to process of first instance of VS and hit the problem again. The exception was caught and this gave me an idea as to what was wrong.</p>
<p>It m... |
How to find a list of wireless networks (SSID's) in Java, C#, and/or C? <p>Is there a toolkit/package that is available that I could use to find a list of wireless networks (SSID's) that are available in either Java, C#, or C for Windows XP+? Any sample code would be appreciated. </p>
| <p>For C#, take a look at the <a href="http://www.codeplex.com/managedwifi">Managed Wifi API</a>, which is a wrapper for the <a href="http://msdn.microsoft.com/en-us/library/ms705969.aspx">Native Wifi API</a> provided with Windows XP SP2 and later.</p>
<p>I have not tested this code, but looking at the Managed Wifi AP... |
what's the most easy-to-parse format for PHP? <p>In my PHP file,I'm reading out bulk of information using query like below:</p>
<pre><code>SELECT GROUP_CONCAT(CONCAT('<comment><body><![CDATA[',body,']]></body>','<replier>',if(screen_name is not null and !anonymous,screen_name,''),'</r... | <p>If you're getting data from a SQL database, it's much easier not to use SQL to clobber it into some text format, but to instead perform a regular query and use the SQL functions to work with the results that you're given.</p>
<p>If you end up needing to serialize data to other PHP clients, I would recommend <a href... |
Is it even possible to do a JSON call in WCF (.NET 3.0)? <p>Looking over the web, I am finding no answer to this question. I see it being asked and a lot of people being referred to .Net 3.5; however, I am not seeing anything resembling an answer with in the restricted environment of WCF 3.0 (VS2005).</p>
<p>Is it po... | <p>Microsoft's <a href="http://www.asp.net/ajax/downloads/archive/" rel="nofollow">ASP.NET 2.0 AJAX Extensions 1.0</a> contains classes to serialize and deserialize JSON for .NET 2.0 and newer.</p>
<p>The class that does it is <a href="http://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascripts... |
Passing the current mouse position to a ViewModel? <p>In my MVVM application, I have a Direct3d render window that shows a bunch of 3d meshes in a scene. In that render window, I want to be able to click on one of those 3d meshes in the scene and move it around, having it follow the mouse cursor. This is typical 3d edi... | <p><a href="http://msdn.microsoft.com/en-us/library/system.windows.input.mousedevice_members.aspx" rel="nofollow">InputManager.Current.PrimaryMouseDevice is probably your best bet.</a></p>
<p>Wrap it up in an interface that exposes the info you need and inject it using your favorite IoC framework.</p>
|
Asp.net sql server 2005 timeout issue <p>HI
We am getting time outs in our asp.net application. We are using sql server 2005 as the DB.
The queries run very fast in the query analyser . However when we check the time through the profiler it shows a time that is many times more than what we get in query analyser.
(param... | <p>If I was to take a guess, I would assume that the background database load from the webserver is elevating locks and causing the whole thing to slow down. Then you take a large-ish query and run it and that causes lock (and resource) contension. </p>
<p>I see this <em>ALL THE TIME</em> with companies complaining ... |
Can autoplay and WIA be programatically reset to the default of "Ask me?"? <p>I have code that ads both Autoplay and WIA handlers for reading images files from memory cards and digital cameras, respectively, and it works fine.</p>
<p>However, I'd like to reset the Autoplay and WIA handlers to the default of "Ask me wh... | <p>It looks like the per-user autoplay preferences (what corresponds to the Autoplay control panel in Windows Vista and 7) are kept under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\UserChosenExecuteHandlers. There's a subkey for each category of autoplay device or media type;... |
Swig / Python memory leak detected <p>I have a very complicated class for which I'm attempting to make Python wrappers in SWIG. When I create an instance of the item in Python, however, I'm unable to initialize certain data members without receiving the message:</p>
<pre><code>>>> myVar = myModule.myDataType(... | <p>SWIG always generates destructor wrappers (unless <code>%nodefaultdtor</code> directive is used). However, in case where it doesn't know anything about a type, it will generate an opaque pointer wrapper, which will cause leaks (and the above message).</p>
<p>Please check that <code>myDataType</code> is a type that ... |
SharePoint Datasheet view read-only custom field <p>Is there any way to add validation (ie SSN) to a SharePoint field and still have it editable in datasheet view?</p>
| <p>Probably not.. you would have to create your own datasheet ActiveX-control. It lives on the client, not the server. </p>
<p>You could make your SSN a standard column type and validate its format in an EventHandler on the list. This would make the row in the datasheet view error if the exact template is not followed... |
Vista gadget/javascript passing variables question <p>I've been struggling with this and can't find a single tutorial on what seems to be a very simple idea.</p>
<p>I've written to the settings in the settings.html file using:</p>
<pre><code>System.Gadget.Settings.writeString("Date1", month + "-" + day + "-" + year);... | <p>Write it to an xml file and use ajax to read it.
Alternatively, write it to a .js file and import it with a <code><script src=...></script></code> construct.</p>
|
php as apache input filter <p>Can the php5apache_filter be used as an <a href="http://httpd.apache.org/docs/2.2/mod/core.html#setinputfilter" rel="nofollow">input filter</a>?<br />
Haven't found much documentation for php's filter sapi.</p>
| <p>The filter module does register an input filter <i>static int php_input_filter()...</i>. But it doesn't do much except fetching all available post data. So I <i>guess</i> the answer is: no, you can't use it as input filter the way you want.</p>
|
How to compile Qt 4.5.1 on Windows XP for WinCE? <p>I'm trying to compile Qt 4.5.1 on Windows XP targeting wince50.</p>
<p>I have the prerequisites installed (VS2008, WinCE50SDK, ActivePerl 5.10) and have downloaded the qt-embedded-wince-opensource-src-4.5.1.zip which has been installed in c:\Qt\4.5.1 and c:\Qt\4.5.1\... | <p>Have you set up the environment variables correctly? I.e. it's often nice to have a .bat with the respective INCLUDE and LIB definitions. If you've installed Qt, there's a Qt command shell installed that can serve as a nice template, giving you command prompt that has the correct environment variables depending on ... |
How can I get another report to be the last page in reporting services? <p>I have 2 reports that need to be printed together.</p>
<ul>
<li>The first report has a <strong>header and footer that will repeat</strong> (if necessary) on data overflow.</li>
<li>The last page, which is a form to be sent back.</li>
</ul>
<p>... | <p>There is a property for the Header and Footers, called PrintOnLastPage</p>
<p>If you set that to False, it will not print the header and footer on the very last page of the report.</p>
|
Abstract classes vs. interfaces vs. mixins <p>Could someone please explain to me the differences between <strong>abstract classes</strong>, <strong>interfaces</strong>, and <strong>mixins</strong>? I've used each before in my code but I don't know the technical differences.</p>
| <p>Most of these answers don't describe all three, so I will add my own.</p>
<h2>Abstract Class</h2>
<p>An abstract class is a class that is not designed to be instantiated. Abstract classes can have no implementation, some implementation, or all implementation. Abstract classes are designed to allow its subclasses s... |
IE error when trying for( var i in window.external ) <p>I am building an object/property dump using JavaScript. This code breaks under Internet Explorer 8 (assuming subject = window.external)</p>
<pre><code>// Gather the property names into the keys array.
var keys = Array(); for( var i in subject ){ keys.push(i); }
... | <p>Do you mean this?</p>
<pre><code>var keys = Array(); for( var i in subject ){ keys.push(subject[i]); }
</code></pre>
<p>You can access object properties with array like syntax in JavaScript</p>
<p><strong>EDIT</strong></p>
<p>Thanks for the edit. I am not sure why that would not work for the <code>window.externa... |
MediaWiki recursiveTagParse returns false <p>I am writing an extension for internal use in my group. It takes some parameters and should return a table of DRs for the release we are working on. It queries our ClearQuest, and its all working great. However, when more than 606 (a common occurrence) rows are in the tab... | <p>To fix my problem I just used regular html and did not run it through recursiveTagParse before returning it.</p>
|
Difference between PCDATA and CDATA in DTD <p>What is the difference between <code>#PCDATA</code> and <code>#CDATA</code> in <strong>DTD</strong>?</p>
| <p>PCDATA - Parsed Character Data</p>
<p>XML parsers normally parse all the text in an XML document.</p>
<p>CDATA - (Unparsed) Character Data</p>
<p>The term CDATA is used about text data that should not be parsed by the XML parser.</p>
<p>Characters like "<" and "&" are illegal in XML elements.</p>
|
Do you write your algorithm out in pseudocode before coding? <p>So I know of a few people that actually write their algorithms out in plain English (pseudocode) before coding. I'd never done this before, but now that I think about it, it kind of makes sense for organizing complicated algorithms. Do you do this? Does it... | <p><a href="http://stackoverflow.com/questions/852724/writing-pseudocode-best-practices/852928#852928">I've mentioned it before</a>:</p>
<blockquote>
<p>I tend to find myself writing small use cases in notepad using indentation... and after half a dozen lines or so I suddenly realise I'm writing in a style which is ... |
Is this a bad way to structure my Sql Server database? <p>I have a table that contains a few columns and then 2 final (nullable) columns which are varbinary (actually, they are SQL 2008 geography types, but I want to keep this post database agnostic).</p>
<p>I've hit around 500mb with around 200K rows. The varbinary i... | <p>Instead of creating a second table, joining, and creating a view, a better solution that is possible with SQL Server 2005/2008 is to use table partitioning. To my recollection, you can vertically partition a table, and place some columns (i.e. your geospatial columns) in one file group, while putting the rest in ano... |
What does a single apostrophe mean in Scala? <p>In this slide show on <a href="http://lamp.epfl.ch/~phaller/doc/ScalaActors.pdf">ScalaActors.pdf</a> what does the single quote indicate when the message is sent to the pong actor? </p>
<pre><code>class Ping(count: int, pong: Pong) extends Actor {
def act() {
pong ! '... | <p>This defines a literal <a href="http://www.scala-lang.org/docu/files/api/scala/Symbol.html">Symbol</a>. See also <a href="http://stackoverflow.com/questions/780287/what-are-some-example-use-cases-for-symbol-literals-in-scala">this question</a>.</p>
|
How can I make this jQuery "shrink text" function more efficient? With binary Search? <p>I've built jQuery function that takes a text string and a width as inputs, then shrinks that piece of text until it's no larger than the width, like so:</p>
<pre><code>function constrain(text, ideal_width){
var temp = $('.temp_it... | <p>The problem with your script is probably that the <code>while</code> condition <code>(item_width != ideal)</code> possibly will never abort the loop. It might not be possible to trim the input text to the exact width <code>ideal</code>. In this case your function will loop forever, which will trigger the slow script... |
Is there a reliable way to position content off to the sides of a div, and have it only appear if the user's resolution allows it? <p>I have my markup like this (for argument's sake)</p>
<pre><code><div id="content"></div>
<div id="layout"></div>
<div id="layout2"></<div>
</code>... | <p>It is possible, because I've done it.</p>
<p>The trick was using negative margins on absolutely positioned divs. For some reason the browser does not attempt to provide scrolling for objects pulled out of the page in this manner.</p>
<p>You can also use overflow:hidden. This will begin cropping your divs contents ... |
Regex for extracting Movie name from filename <p>imagine if you will the following string:</p>
<p>"A Great Movie (1999) DVDRip.avi"</p>
<p>I am looking to extract the string "A Great Movie" from this via regex, but struggling to get the correct regex for this.</p>
<p>I would be using this too parse file names of var... | <p>This syntax is designed around the .NET regex parser (may be different in other regex engines):</p>
<pre><code>^(?<MovieName>.+)\((?<Year>\d+)\)(?<AdditionalText>[^\.]*)\.(?<Extension>[^\.]*)$
</code></pre>
<p>You can use this syntax to get out the data you want:</p>
<pre><code>string line... |
Demonstrate C# Convoy Lock <p>A Couple of years back due to a improperly implemented "Try Catch Finally" block the development team struggled with a runtime freeze which was later discovered as a case of Convoy Lock Issue.</p>
<p>I am looking for a simple C# code to demonstrate a Convoy Locking to my fellow team mates... | <p>Concurrent Programming on Windows has some great content on this subject which you could take to the team.</p>
<p><a href="http://rads.stackoverflow.com/amzn/click/032143482X" rel="nofollow">http://www.amazon.com/gp/product/032143482X/ref=ox_ya_oh_product</a></p>
|
Check status of a production ASP.NET process <p>Is there a way to check what a asp.net process is doing in production environment? In Linux, one can run a strace on a process id and know exactly what the process is doing. Can one do something similar on a asp.net process? Googling around tells me that you need to cr... | <p>You can see most of the information in your question by using PerfMon. </p>
<p>This provides an overview of ASP.Net monitoring with perfmon <a href="http://msdn.microsoft.com/en-us/library/3xxk09t8" rel="nofollow">http://msdn.microsoft.com/en-us/library/3xxk09t8</a>(VS.71).aspx</p>
<p>To see managed memory usage c... |
Editing links inline with jquery - preventing them from being clicked while editing <p>I am attempting to edit sections of a site inline with jQuery, everything is working fine so far, expect that some of the editable items are links. When attempting to edit the fields, it's clicking through on the href.</p>
<p>here i... | <pre><code>$('.edit > a').bind("click", function(e){
e.preventDefault();
return false;
});
</code></pre>
|
Using Web Services in SQL Server Integration Services (SSIS) <p>hello guys can any one tell me the Real Time Usage of a Web Service?</p>
<p>After calling a web service using the <strong>Web Service Task</strong> in <strong>SSIS</strong>, how can we use that web service?</p>
| <p>The web service could provide data you are bringing into your database (a stream for import), or it could provide a complex calculation (shipping costs), or it could provide parameter information (today's exchange rate).</p>
<p>Can you give more information about what your usage scenario is?</p>
|
C# - Capturing the Mouse cursor image <h2>BACKGROUND</h2>
<ul>
<li>I am writing a screen capture application</li>
<li>My code is based derived from this project: <a href="http://www.codeproject.com/KB/cs/DesktopCaptureWithMouse.aspx?display=Print">http://www.codeproject.com/KB/cs/DesktopCaptureWithMouse.aspx?display=P... | <p>While I can't explain exactly why this happens, I think I can show how to get around it.</p>
<p>The ICONINFO struct contains two members, hbmMask and hbmColor, that contain the mask and color bitmaps, respectively, for the cursor (see the MSDN page for <a href="http://msdn.microsoft.com/en-us/library/ms929934.aspx"... |
Execute a Groovy class in a package from the command line <p>Is there a way to execute a Groovy class by specifying the package with dots, as with java?</p>
<p>Example: File ./my/package/MyClass.groovy:</p>
<pre><code>package my.package
class MyClass {
static void main(String[] args) {
println "ok"
}
}
</cod... | <p>First of all, <em>package</em> is a reserved keyword, so you can't use it as a a package name.</p>
<p>Second of all, you can't do that in Groovy, since the dot notation is used for classes, not for scripts, so you need a compiled class file to use it.</p>
<p>Still, you can replace the groovy command with java + cl... |
How to make a splash screen with a progress bar on Turbo Delphi? <p>(Unit1.pas)</p>
<pre><code> unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls,unit2;
type
TForm1 = class(TForm)
Button1: TButto... | <p>In your *.dpr, try something like this:</p>
<pre><code>begin
Application.Initialize;
FormSplash := TFormSplash.Create( Application );
FormSplash.OpenSplash;
// Do the rest of your initialisation...
// MAKE SURE THERE'S NO CreateForm FOR FormSplash!
FormSplash.ShowProgress( "Creating a form..." );
Appl... |
Flex Giving user ability to change TabNavigator Labels, and send to database <p>I am wondering how i would enable a user to change the label on a tab navigator, eg double click the tabs and let the user rename the tab.</p>
| <p><a href="http://code.google.com/p/flexlib/" rel="nofollow">http://code.google.com/p/flexlib/</a></p>
<p>SuperTabBar</p>
<p>-Nick</p>
|
JPA Entity Mapped as OneToOne as well as OneToMany <p>Consider the following JPA entity. My application instance class must always have a OneToOne reference to 4 special instances of Envelope but it also has a set of 0-infinite user defined envelopes. Is this even possible? Is it possible with both Unidirectional an... | <p>You could do this with a join table mapping:</p>
<pre><code>@OneToMany
@JoinTable( name = "USER_ENVELOPE",
joinColumns = { @JoinColumn( name = "APP_ID" ) },
inverseJoinColumns { @JoinColumn( name = "ENVELOP_ID" ) } )
protected Set<Envelope> userEnvelopes = new HashSet<Envelo... |
Oracle Associative Array TYPE is not able to use in USING statement (If TYPE is declared within Package) <p>If 'Associative Array variable' is <strong><em>declared globally</em></strong>, able to use that in <code>OPEN CURSOR USING</code> statement. <br></p>
<p>If 'Associative Array variable' is <strong><em>declared w... | <p>You should be aware that in Oracle, the SQL engine and the PL/SQL engine are two seperate things, though they can call each other. To use arrays in SQL statements, they have to be visible to the SQL engine, i.e. they have to be declared as SQL types using the CREATE TYPE statement. Types created within a package are... |
how to know visitors is actually looking at the webpage and for how long? <p>when the visitor goes to a webpage, how do we know the visitor is actually showing the page on top (instead of going to another tab or app already).</p>
<p>also how do we know how long the user has read the page or how long the page stayed op... | <p><a href="http://www.google.com/analytics/" rel="nofollow">Google analytics</a> is the best free analytics AFAIK. It shows you all you need.</p>
|
Help needed in Visual studio project properties <p>i hav a main project(ex: applicationsolution explorer (10projects)) which depend on 10 other </p>
<p>projects. in those in one project i need to use /clr(Common Language Runtime) option.As i know</p>
<p>/clr doesnot compatable with /mtd(in code genration property of ... | <p>No not at all needed.</p>
|
onCheckedChanged event of checkbox within a gridview <p>I have a checkbox control in the gridview with Autopost back = true </p>
<p>Code:
' runat="server" AutoPostBack="True" OnCheckedChanged="chkJobID_CheckedChanged" />
</p>
<p>Now, when i check the checkbox the 'OnCheckedChanged' fires and a... | <p>Could you replace the code in your chkJobID_CheckedChanged event handler with this:</p>
<pre><code>Response.Write(DateTime.Now.ToLongTimeString());
</code></pre>
<p>Then view the page and try checking and unchecking the checkbox. This will tell us if the event handler is firing for both check and uncheck actions, ... |
detect suspect <p>How To detect the suspect database in SQL server2000 With Script Or Program ?</p>
| <p>the status column in master.dbo.sysdatabases will have the suspect bit set which is 256 for the database. in which case this will return a result:</p>
<pre><code>select * from sysdatabases where status&256 = 256
</code></pre>
|
Optimum query delay for autocomplete <p>In a <a href="http://developer.yahoo.com/yui/autocomplete">yui AutoComplete</a> or similar how many milliseconds are you using as <a href="http://developer.yahoo.com/yui/autocomplete/#delay">query delay</a> (time between the last key input and the request to the server)?</p>
<p>... | <p>It really depends on your purpose, I think. In my scenario I wanted them to not be intrued on if they knew exactly what they wanted. If they hesitate at all, help is there. For that, I used .3 or .5. </p>
<p>If you want to make their life easier by suggesting completions you can set it to 0 like Google does.</p>
|
Can a variable number of arguments be passed to a function? <p>In a similar way to using varargs in C or C++:</p>
<pre><code>fn(a, b)
fn(a, b, c, d, ...)
</code></pre>
| <p>Yes.</p>
<p>This is simple and works if you disregard keyword arguments:</p>
<pre><code>def manyArgs(*arg):
print "I was called with", len(arg), "arguments:", arg
>>> manyArgs(1)
I was called with 1 arguments: (1,)
>>> manyArgs(1, 2,3)
I was called with 3 arguments: (1, 2, 3)
</code></pre>
<p... |
make your Jar not to be decompiled <p>How can I package my Java application into an executable jar that cannot be decompiled (for example , by Jadclipse)?</p>
| <p>You can't. If the JRE can run it, an application can de-compile it.</p>
<p>The best you can hope for is to make it very hard to read (replace all symbols with combinations of 'l' and '1' and 'O' and '0', put in lots of useless code and so on). You'd be surprised how unreadable you can make code, even with a relativ... |
running 2 websites with mono <p>I have 2 websites : myDomain1.com & myDomain2.com</p>
<p>Both run on the same apache server with Mono. However my issue is that i cannot get them working at the same time. When i go to myDomain2.com it shows the aspx content of myDomain1.com. Occassiononly this is inversed. So that... | <p>Since your config file contains a lot of stuff I wouldn't necessarily use, I would suggest starting from the basics and adding stuff until it breaks again. </p>
<p>I'm successfully running multiple sites on my Mono server, and my config is done as follows:</p>
<p>Create a file in your apache2 sites-enabled folder ... |
c# [NonSerialized] field with inline initialization isn't initialized after deserialization <p>I have a [Nonserialized] field in my class that is initialized inline:</p>
<pre><code>[NonSerialized]
private bool running = true;
</code></pre>
<p>However, after deserializing an object I have running == false. This is not... | <p><del>You could set it in the default constructor.</del></p>
<p>Implement the System.Runtime.Serialization.IDeserializationCallback </p>
<p>It is called afther the object is deserialized so you can perform your extra initialization there .</p>
|
pthread-based event waking up only waiting threads <p>In my C++ program I have a class CEvent with trigger and wait member functions based on pthreads (running on Linux). Implementation is quite obvious (i.e. many examples online) if there is one waiting process. However now I need to satisfy the requirement that multi... | <p>Please disregard my previous bogus answer. There is a race between the time that the trigger thread unlocks the mutex (and thus frees the waiting threads), and then sets the wakeUp value. This means that another (not waiting) thread can come in, grab the mutex, and see a true value in <code>wakeUp</code> and exit wi... |
Code-First or Database-First, how to choose? <p>Let us suppose we are going to start new project - application that contains some business logic, user interface on ASP.NET, WPF or both of them. We'd like to use ORM or DAL code generator and implement our business logic in .NET classes. There are several fundamental way... | <p>I think the appropriate approach to system analysis and design is to start by modeling your objects and the relations between them first. If you're creating a library system you should think of the phrases Book, Author, Publisher, ISBN as objects not as database tables or attributes. I believe this is the way it sho... |
Get Last Value in table <p>I want get the last value for determine column
for example in this table
id name
1 Samer
2 Fahd
3 Hames
4 fuad</p>
<p></p>
<p>I want get only last name "fuad" in sqlserver</p>
<p>all thanks</p>
| <p>Order by <code>ID</code> descending and <code>select top 1 name</code>:</p>
<pre><code>select top 1 Name from MyTable order by ID desc
</code></pre>
|
Most appropriate platform independent development language <p>A project is looming whereby some code that I will be writing may be deployed on any hardware that potential clients happen to have. Its a business application that will be running 24/7 so I envisage that most of the host machines will be server type boxes b... | <p>I'd go with a decent scripting language such as Python, Perl or Ruby personally. All of those have decent library support, can communicate easily with both local and remote MySQL databases and are pretty platform independent.</p>
|
Different behavior of python logging module when using mod_python <p>We have a nasty problem where we see that the python logging module is behaving differently when running with mod_python on our servers. When executing the same code in the shell, or in django with the runserver command or with mod_wsgi, the behavior ... | <p>It may be better if you do not configure logging in <code>settings.py</code>.</p>
<p>We configure your logging in our root <code>urls.py</code>. This seems to work out better. I haven't read enough Django source to know why, precisely, it's better, but it's working out well for us. I would add custom handlers he... |
Remove unnessesary spaces from Swings Components <p>i have 3 JPanel, the first is the base panel and the other two are added to the first. I have realised that there is a lot of space that is not used, shown by the black color and the white color around components.</p>
<p>How do you remove this space?</p>
<p><img src... | <p>If you are using either GridLayout or BorderLayout they both have methods to change the space between components.</p>
<p>In GridLayout this can be done in the 4 int parameter consturctor and in BorderLayout the 2 int parameter constructor. Both LayoutManagers have the methods setHgap and setVgap.</p>
<p>If you are... |
Bash condition of the form - [ -n "${VAR:-x}" ] gets evaluated even though VAR is set <p>I have written an if statement of the form:</p>
<pre><code>if [ -n "${VAR:-x}" ]; then
#do something
export VAR=#something
fi
</code></pre>
<p>My shell script calls this statement twice and <strong>surprisingly</strong> pas... | <p><code>${VAR:-x}</code> says if <code>VAR</code> is not set substitute the string <code>x</code> otherwise substitute the value of <code>VAR</code>.</p>
<p>Similarly, <code>${FOO:-bar}</code> says substitute the value of <code>FOO</code> or the string <code>bar</code> if <code>FOO</code> is not set <a href="http://w... |
php script can't send headers because headers have already been sent, but are characters outside the script <p>This are my first two lines:</p>
<pre><code><?php
header('Content-Type: application/x-javascript');
</code></pre>
<p>And it gives me the headers already sent in line 1.</p>
<p>It is intended to generate ... | <p>You have most probably saved the file as UTF-8 with <a href="http://en.wikipedia.org/wiki/Byte-order%5Fmark">BOM</a> (Byte-order mark), resave it as UTF-8 without said thingy.</p>
|
What is the purpose of __cxa_pure_virtual? <p>Whilst compiling with avr-gcc I have encountered linker errors such as the following:</p>
<pre><code>undefined reference to `__cxa_pure_virtual'
</code></pre>
<p>I've found <a href="http://ccgi.rowley.co.uk/support/faq.php?do=article&articleid=127">this document</a> w... | <p>If anywhere in the runtime of your program an object is created with a virtual function pointer not filled in, and when the corresponding function is called, you will be calling a 'pure virtual function'. </p>
<p>The handler you describe should be defined in the default libraries that come with your development en... |
In SharePoint 2007, how can I include some common items in a list, and some unique ones for each instance of the list? <p>I've created a series of meetings in SharePoint 2007. All meetings have a common "base" agenda, but each meeting will have its own unique agenda items.</p>
<p>Is there a way to implement that in S... | <p>Yes, use a list that includes multiple content types. You can define custom content types at a site level and they will be available within that site and all sub sites. You can enable content types on a list or library and include multiple content types for that list or library. You can also have a content types ... |
Delphi: How to organize source code to increase compiler performance? <p>I'm working on a large delphi 6 project with quite a lot of dependancies. It takes several minutes to compile the whole project. The recompilation after a few changes is sometimes much more longer so that it is quicker to terminate Delphi, erase a... | <p>Some things that could slow down the compiler</p>
<ul>
<li><strong>Redundant units</strong> in your <code>uses</code> clause. See <a href="http://stackoverflow.com/questions/881778/how-can-i-identify-and-get-rid-of-unused-units-in-the-uses-clause-in-delphi-7">this question</a> for a link to <code>CnPack</code>.</li... |
Read Session Id using Javascript <p>Is it by any means possible to read the browser session id using javascript?</p>
| <p>Yes. As the session ID is either transported over the URL (<code>document.location.href</code>) or via a cookie (<code>document.cookie</code>), you could check both for the presence of a session ID.</p>
|
App Verifier reporting "Thread cannot own a critical section." <p>So App Verifier is throwing this exception. From what I gather, the text of this message is a little misleading. The problem appears to be that the the critical section was created by a thread that is being destroyed before the critical section is dest... | <p>I believe you are correct on the interpretation of the message. The only reference I can find is as follows. The stack trace is a good clue as the author suggests</p>
<ul>
<li><a href="http://jpassing.wordpress.com/2008/02/18/application-verifier-thread-cannot-own-a-critical-section/" rel="nofollow">http://jpassi... |
TRY CATCH on a CONVERT in a Select Statement <p>Is it possible to use TRY CATCH blocks in SQL Selects?</p>
<p>For stuff similar to this for example:</p>
<pre><code>select
order,
CONVERT(DATETIME, orderDate)
from orders
</code></pre>
<p>What's the best way of handling this scenario?</p>
| <p>I don't know about try-catch, but in SQL Server you have the ISDATE function and can there for do something like</p>
<pre><code>CASE WHEN ISDATE(orderDate) = 1 THEN CONVERT(DateTime, orderDate) ELSE GETDATE() END
</code></pre>
|
C# regex with line breaks <p>Hello I have the following code</p>
<pre><code>namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
string searchText = "find this text, and some other text";
string replaceText = "replace with this text";
... | <p>To search for any whitespace (spaces, line breaks, tabs, ...), you should use \s in your regular expression:</p>
<pre><code>string searchText = @"find\s+this\s+text,\s+and\s+some\s+other\s+text";
</code></pre>
<p>Of course, this is a very limited example, but you get the idea...</p>
|
UIImage Picker autorotation feature disappeared suddenly <p>I was using <code>UIImagePickerController</code> without any problem.</p>
<p>Before when I was taking a picture in the landscape mode, the picture in the <em>Preview</em> (when the buttons Retake and Use Photo were present) was always automatically rotated so... | <p>one possibility is that you need to call</p>
<pre><code>[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
</code></pre>
|
What Happened to BufferedImage class in Java ME 6? <p>from my small knowlegde from java se i want to try a tutorial on Java ME.I have Netbeans 6.5.1(with mobility package) and have Java 6 update 13 installed on my windows xp sp2.I've arrived on a stage of the tutorials where they are using BufferedImage that seems not ... | <p>I assume you're talking about <a href="http://www.netbeans.org/kb/60/mobility/mobile-dilbert.html" rel="nofollow">this</a> tutorial: </p>
<p>The code you've pasted above does not run on the Java ME device. It is deployed on Glassfish (the application server) in the web service implementation that is consumed by th... |
Sending Multipart html emails which contain embedded images <p>I've been playing around with the email module in python but I want to be able to know how to embed images which are included in the html.</p>
<p>So for example if the body is something like</p>
<pre><code><img src="../path/image.png"></img>
<... | <p>Here is an example I found.</p>
<blockquote>
<p><a href="http://code.activestate.com/recipes/473810/"><strong>Recipe 473810: Send an HTML email with embedded image and plain text alternate</strong></a>: </p>
<p>HTML is the method of choice for those
wishing to send emails with rich text,
layout and grap... |
Nested UL/LI not shown <pre><code><ul id="nav">
<div id="navspacer" />
<li class="button" style="width: 109px;"></li>
<li class="button" style="width: 86px;">
<img alt="Webdesign" src="images/digifolio_10.jpg"/>
<ul>
<li>a</li>
<... | <p>Keep in mind that z-index does not apply to elements without the <code>position</code>-property, so it has no effect on your code.</p>
<p>And DIV is not allowed within UL. Use margins or paddings instead.</p>
|
How to create json by javascript for loop? <p>I have <strong>array</strong> of select tag.</p>
<pre><code><select id='uniqueID' name="status">
<option value="1">Present</option>
<option value="2">Absent</option>
</select>
</code></pre>
<p>and I want to create a json ob... | <p>From what I understand of your request, this should work:</p>
<pre><code><script>
// var status = document.getElementsByID("uniqueID"); // this works too
var status = document.getElementsByName("status")[0];
var jsonArr = [];
for (var i = 0; i < status.options.length; i++) {
jsonArr.push({
... |
Index out of range error; Here but not There? <p>I have a winform app that fills a lot of its dropdomn fields fram a maintenance table at runtime. Each Form has a <code>Private void FillMaintFields()</code>
I have run into a strange error where setting the column visibility on 1 form works but on another gives me an ... | <p>Is the error happening on the "lkuReleaseInfoUpdateAnnually" or the "lkuMinContactSchedule"? Which control is that exactly? It seems the error is on the control side of things, seems like your control in the second form doesn't have all the columns you're expecting it to have.</p>
<p>EDIT: You seem to be confusing ... |
Best Practice for comments in Java source files? <p>This doesn't <em>have</em> to be Java, but it's what I'm dealing with. <em>Also, not so much concerned with the methods and details of those, I'm wondering about the overall class file.</em></p>
<p>What are some of the things I really need to have in my comments for ... | <blockquote>
<p>One logical thing I've heard is to keep authors out of the header because it's redundant
with the information already being provided via source control.</p>
</blockquote>
<p>also last modified date is <strong>redundant</strong></p>
<p>I use a small set of <em>documentation patterns</em>:</p>
<ul... |
Unable to bind in asp.net grid Template Column <p>I am having trouble accessing the data field. I receive the error: Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.</p>
<p>I can get the value but using <%# getOpenJobs((string)Eval("ParentPart")) %> but... | <p>In these cases, I usually create a method in the code-behind to send back the final generated HTML. E.g. </p>
<pre><code><ItemTemplate>
<%# GetJobImageHtml((string)Eval("ParentPart")) %>
</ItemTemplate>
</code></pre>
<p>Then do whatever logic you need in the <code>GetJobImageHtml()</code> method ... |
jQuery on iPhone/Android/BlackBerry <p>I don't have any of the devices to test at the moment. I guess I'll start using the emulators later on.</p>
<p>We're looking to offer mobile support. I was wondering how jQuery or even javascript renders in their respective browsers. </p>
<p>What works? What doesn't? Any tips? A... | <p>I've used jQuery on iPhone. Remember that Mobile Safari is not an officially supported browser for jQuery. But it's close enough to Safari that most things work.</p>
<p>If I recall correctly, mousedown event doesn't happen until the mouseup happens, at which point both fire. My guess is that most things will work, ... |
How can I ensure that a division of integers is always rounded up? <p>I want to ensure that a division of integers is always rounded up if necessary. Is there a better way than this? There is a lot of casting going on. :-)</p>
<pre><code>(int)Math.Ceiling((double)myInt1 / myInt2)
</code></pre>
| <p>UPDATE: This question was <a href="http://ericlippert.com/2013/01/28/integer-division-that-rounds-up">the subject of my blog in January 2013</a>. Thanks for the great question!</p>
<hr>
<p>Getting integer arithmetic correct is hard. As has been demonstrated amply thus far, the moment you try to do a "clever" trick... |
How can I join on a stored procedure? <p>I have a stored procedure that takes no parameters, and it returns two fields. The stored procedure sums up all transactions that are applied to a tenant, and it returns the balance and the id of the tenant.</p>
<p>I want to use the record set it returns with a query, and I nee... | <p>insert the result of the SP into a temp table, then join:</p>
<pre><code>CREATE TABLE #Temp (
TenantID int,
TenantBalance int
)
INSERT INTO #Temp
EXEC TheStoredProc
SELECT t.TenantName, t.CarPlateNumber, t.CarColor, t.Sex, t.SSNO, t.Phone, t.Memo,
u.UnitNumber, p.PropertyName
FROM tblTenant t
INNER J... |
can i know abt the exit status of the scp command in unix <p><br>
while doing the programing in perl with scp command
i am stucked with facing the exit status of scp command
<br>
if you tell which exit value(other then 0-success,1-error) is for what my life will be simple<br />
<br></p>
| <p>From <a href="http://support.attachmate.com/techdocs/2116.html">here</a>:</p>
<pre><code>0 Operation was successful
1 General error in file copy
2 Destination is not directory, but it should be
3 Maximum symlink level exceeded
4 Connecting to host failed.
5 Connection broken
6 File does not exist
7 ... |
Javascript error with undefined variable <p>I have a problem where a method is getting an undefined variable error, even though I check for the variable being undefined before calling.</p>
<pre><code>// Sets focus and text-select to the passed in element.
idNav.prototype.setFocusFromVar = function(r) {
document.ac... | <p>Based on your description of the problem, it seems to me that it is sometimes getting called without the sanity check. I'd put the sanity check inside the function rather than outside of it.</p>
<p>However, you also probably want to know how you're getting around it in the first place. I'd modify the function as ... |
Is it possible to clone html element objects in JavaScript / JQuery? <p>I am looking for some tips on how to solve my problem. </p>
<p>I have a html element (like select box input field) in a table. Now I want to copy the object and generate a new one out of the copy, and that with JavaScript or jQuery. I think this s... | <p>With native javascript:</p>
<pre><code>newelement = element.cloneNode(bool)
</code></pre>
<p>where the boolean indicates whether to clone child nodes or not</p>
|
iPhone Memory Management didReceiveMemoryWarning <p>Ok......</p>
<p>I'm implementing a simple OpenGL ES application on the iPhone and I recently added in Pinch Media Analytics. Doing this helped uncover a memory management problem, and I'm not entirely sure how to deal with it.</p>
<p>In a perfect world, my applicat... | <p>Welcome to the shared memory pool with no VM.... There's not a lot you can do here, but there are a few things (and it's possible it's actually your fault and you can completely fix it). Game developers often recommend their customers reboot before running them for this reason, so you may need to be in the same boat... |
How to find information in a file using regular expressions on Linux <p>I have a file with many lines in it. One of them look like : </p>
<pre><code>set auto_upgrade {1 2 3 4}
</code></pre>
<p>The list can contain more numbers.</p>
<p>Now, in a shell script I want to look into this file and find out what is the last... | <p>First, start sed in quiet mode: it should not print anything unless told to do so (that's the flag <code>-n</code>). Then print only if a substitution has been made (that's the pattern modifier <code>p</code>)</p>
<pre><code>sed -n 's/set auto_upgrade {\([0-9] \)*\([0-9]\{1,\}\)}/\2/p'
</code></pre>
|
How to run a Maven Project In Tomcat From Eclipse <p>I am running a multi level maven project. It has webapps packaged as WAR, which depend on components packaged as JAR files</p>
<p>Most of the code changes that i do belong to those JAR files.</p>
<p>To test the changes, i need to repackage the JAR and the WAR and d... | <p><strong>Using the Maven Eclipse Integration plugin</strong></p>
<p>I you are experiencing problems I've found it helpful to try the command line tool <em>mvn</em> for debugging. As a rule of thumb, if it builds without errors command line, then you can run it in Eclipse (but tomcat has problems also, so you might n... |
Proper use of quotes for output of JavaScript in a variable <p>I am creating a chunk of HTML/JavaScript with the below code:</p>
<pre><code>$result = mysql_query("SELECT * FROM posts WHERE userid = '$user_id' ORDER BY DATE desc LIMIT 5")or die (mysql_error());
while ($row = mysql_fetch_array($result))
{
$source ... | <p>If possible you should use <a href="http://docs.php.net/json%5Fencode" rel="nofollow"><code>json_encode</code></a> to build a JavaScript string declaration and <code>htmlspialchars</code> to use it as a HTML attribute value:</p>
<pre><code>$onclick = 'playsong('.json_encode($row['source']).'); return false';
$p .= ... |
Create MSBuild task that recursively copies a folder to several projects in my solution <p>I'm new to MSBuild and I tried reading up on several sources on the net but I'm missing somet things..</p>
<p>Here's what I want: </p>
<ul>
<li>A build task that on execution recursively copies a directory structure from a (ha... | <p>Look at the <a href="http://msdn.microsoft.com/en-us/library/3e54c37h.aspx" rel="nofollow">Copy Task</a> examples on how to copy a file structure recursively.</p>
|
Sharing login-system between classic ASP and ASP.Net <p>A client uses classic ASP to log in to their web based backoffice.</p>
<p>I have written a new ASP.Net app to be included in the backoffice, and I need to utilize the already existing login-system, so that when they are logged in there, they don't need to log in ... | <p>I think your idea is on the right path.</p>
<p>As you probably already know, classic asp and asp.net cannot share the same session state, so you do need to have a mechanism to log from one into the other.</p>
<p>What I would do is: when someone logs in, create a unique GUID that you save in the database for that u... |
Programmatically open a new tab in ie7 <p>I am developing web applications with c#, Aspnet 3.5, and Ajax 2.0. </p>
<p>Question - I run Application_1 in ie7. I would like to programmatically start running Application_2 from Application_1 in a new tab, no matter what the client settings are. </p>
<p>Until now I have ... | <p>Unfortunately there is no way to control whether the window opens in a new tab or new window. This is a user setting that can't be overridden in code.</p>
|
Generate random player strengths in a pyramid structure (PHP) <p>For an online game (MMORPG) I want to create characters (players) with random strength values. The stronger the characters are, the less should exist of this sort.</p>
<p>Example:</p>
<ul>
<li>12,000 strength 1 players</li>
<li>10,500 strength 2 players... | <p>You can simulate a distribution such as the one you described using a logarithmic function. The following will return a random strength value between 1.1 and 9.9:</p>
<pre><code>function getRandomStrength()
{
$rand = mt_rand() / mt_getrandmax();
return round(pow(M_E, ($rand - 1.033) / -0.45), 1);
}
</code>... |
Are elements cached or not? <p>When I check with Privoxy what my browser downloads from one site, it seems like all the elements that make up the page (CSS, JS, icons, etc.) are redownloaded every time, ie. the browser doesn't cache them (Sorry, new uses aren't allowed to include URLs):</p>
<pre><code><html xmlns="... | <p>Short version: Don't change the browser, send the right cache related HTTP header* info.</p>
<p>Long version: If you don't explicitly tell the browser what and how to cache you leave it free to choose for itself. Such settings are configurable and vary enormously from user to user and browser to browser but typical... |
Ruby experts: can you help/suggest with improving this line of ruby code? <p>After spliting a tab delimited file I have my required values in a string variable. Unfortunately the source of this file is out of my control. </p>
<p>Here are three exact example of what the value might hold:</p>
<ol>
<li>" 5.344"</li>
<li... | <pre><code>def round(s)
s.to_f.round
end
round("5.344") # 5
round("-2.345") # -2
round("-.977") # -1
</code></pre>
|
Browser dependent problem rendering WMD with Showdown.js? <p>This should be easy (at least no one else seems to be having a similar problem), but I can't see where it is breaking.</p>
<p>I'm storing Markdown'ed text in a database that is entered on a page in my app. The text is entered using WMD and the live preview l... | <p>It was the Internet Explorer innerHTML/innerText "quirk" that was causing the problem. For all elements that weren't marked as <code><pre></code>, IE strips whitespace for them before handing them off to Javascript.</p>
<p>I couldn't just leave the element with the markdown text in <code><pre></code> ta... |
How to password protect a checkbox? <p>Hi Guys
I have a question on checkboxes in acess 2003</p>
<p>I have 4 checkboxes on my form and one of these boxes, i want to restrict so only users supplied with the correct password eg (report1) can check that box. I have a small textbox to the side of the checkbox labelled man... | <p>Have you considered locking or disabling this particular checkbox? For example:</p>
<pre><code>Private Sub Form_Current()
Me.closedsftleader.Enabled = (Me.txtpassword = "Report1")
End Sub
Private Sub txtpassword_AfterUpdate()
Me.closedsftleader.Enabled = (Me.txtpassword = "Report1")
End Sub
</code></pre>
... |
Form_Load event is not firing on a form that inherits from another form class <p>I have a winforms form which is inherited from another form.</p>
<p>e.g.</p>
<pre><code>class StartForm : aSyncDialog
</code></pre>
<p>aSyncDialog has an onload event</p>
<pre><code>protected override void OnLoad(EventArgs e)
</code></... | <p>Make sure you call base.OnLoad(e) from your override of OnLoad in aSyncDialog</p>
<p>The reason for this is that the OnLoad method in the Form class raises the Load event.</p>
<p>When you override the OnLoad method in aSyncDialog and don't call base.OnLoad, then the event isn't raised, so the subclass of aSyncDial... |
How to install ImageMagick on MAMP? <p>I'm running OSX Leopard with MAMP (a sandbox consisting of Apache/MySQL/PHP).
I installed ImageMagick using MacPorts by following this tutorial:
<a href="http://www.brybot.ca/archives/getting-imagemagick-and-more-to-work-with-mamp-on-os-x/" rel="nofollow">http://www.brybot.ca/arc... | <p>Watch out: <em>Imagemagick</em> and <em>Imagick</em> are <strong>not</strong> the same! While Imagemagick is a CLI suite/lib to manipulate images, <a href="http://pecl.php.net/package/imagick" rel="nofollow">Imagick</a> is a PHP Wrapper class to use Imagemagick in PHP natively (read as without using exec() or alike.... |
type safe and nhibernate <p>Is it possible to create 100% type safe compile time checking code?</p>
<p>Even criteria seems to reference column names with a string reference "Username", but if you put "Usernnameaa" it will fail at runtime right?</p>
| <p>Out of the box, no. It looks like there is a project called <a href="http://code.google.com/p/nhlambdaextensions/" rel="nofollow">nhlambdaextensions</a> which might be what you're wanting.</p>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.