input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Cannot execute program if using boost (C++) libraries in debug-version on WinXP <p>I'm using boost for several C++ projects. I recently made a upgrade (1.33.1 to 1.36, soon to 1.37), since then I cannot run any debug-builds anymore.</p>
<p>To be sure that no other project issues remain, I've created a minimum test-pr... | <p>It's a <a href="http://blogs.msdn.com/rchiodo/archive/2007/04/09/the-next-level-of-dll-hell-sxs.aspx" rel="nofollow">Side-by-Side</a> (SxS) issue â simply copying the DLLs is not enough anymore.</p>
<p>Regarding your specific problem concerning the Debug build, see: <a href="http://stackoverflow.com/questions/264... |
Why are primes important in cryptography? <p>One thing that always strikes me as a non-cryptographer: Why is it so important to use Prime numbers? What makes them so special in cryptography?</p>
<p>Does anyone have a <em>simple</em> short explanation? (I am aware that there are many primers and that Applied Cryptograp... | <p>Most basic and general explanation: cryptography is all about <a href="http://en.wikipedia.org/wiki/Number_theory">number theory</a>, and all integer numbers (except 0 and 1) are made up of primes, so you deal with primes a lot in number theory.</p>
<p>More specifically, some important cryptographic algorithms such... |
C# - Modifying a Data Table <p>I have a Data Table that is filled from a database connection. I would like to run checks on the Data Table like replacing the numbers with text and add my own data before binding it to the Data Grid for viewing. How do I access one piece of data in the Data Table? Thanks.</p>
| <p>Just look in the table's <code>.Rows</code> collection, and access fields in each row using normal array ( <code>[]</code> ) notation using either column index or field name for the subscript.</p>
|
Make the C preprocessor ignore certain #include directives <p>I use a parser generator here, that unfortunately insists on putting a</p>
<pre><code>#include <some/file.h>
</code></pre>
<p>at the top of every generated source file. The header has since long been renamed. While it is no problem forcing the compil... | <p>Replace <code>some/file.h</code> with an empty file.</p>
|
locale-independent way of getting standard windows registry security object <p>Is there a way to get the built-in "Everyone" registry security object in a locale-independent manner? I want to make a RegistryAccessRule without needing to translate "Everyone" to each language.</p>
| <p>Use the constructor for SecurityIdentifier that takes a WellKnownSidType and use WellKnownSidType.WorldSid.</p>
|
Server-side Push in Rails <p>I'd like to implement a scalable chatroom in rails using AJAX. I know from research that the only scalability happens with a server-side push.</p>
<p>My two questions are:</p>
<p>1) In a reasonably efficient chat server, at what point does polling become prohibitive?
2) I really don't wa... | <p>I'm attempting to do the same right now. Juggernaut works well, but not for Rails 3, and if that isn't a requirement then I suggest using it, because it is dead easy to make a chat.
My project uses Rails 3, and polls the server every 3 seconds(Campfire does 3 as well). I'm using Rails Metal to make the polling super... |
Detect version of Java using JavaScript <p>Is there a reliable way of detecting what version of Java is installed on the client's machine using JavaScript?</p>
| <p>Check out the code in the <a href="http://docs.oracle.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html#deplToolkit" rel="nofollow">Java Deployment Toolkit</a>.</p>
|
How do I create a strong password string in C++? <p>Would like to create a strong password in C++. Any suggestions?</p>
<ul>
<li><p>I assume it should use alpha (upper
and lower), numeric, special
characters.</p></li>
<li><p>It would be good to be able to
specify a minimum length.</p></li>
<li><p>It would be great to ... | <p>There's a few ways. The easy isn't necessarily the best</p>
<p>Create a string representing all the characters you want to define (meaning, no O's or 0s's, whatever), then fill a random-length string with random characters from that set.</p>
<p>The next step is to keep generating until you pass all assertions. T... |
Implementing a "LazyProperty" class - is this a good idea? <p>I often find myself writing a property that is evaluated lazily. Something like:</p>
<pre><code>if (backingField == null)
backingField = SomeOperation();
return backingField;
</code></pre>
<p>It is not much code, but it does get repeated a lot if you ha... | <p>Just to be overly pedantic: </p>
<p>Your proposed solution to avoid repeating code:</p>
<pre><code>private LazyProperty<HeavyObject> first =
new LazyProperty<HeavyObject>(() => new HeavyObject { MyProperty = Value });
public HeavyObject First {
get {
return first;
}
}
</code></pre>
<... |
unicode() vs. str.decode() for a utf8 encoded byte string (python 2.x) <p>Is there any reason to prefer <code>unicode(somestring, 'utf8')</code> as opposed to <code>somestring.decode('utf8')</code>?</p>
<p>My only thought is that <code>.decode()</code> is a bound method so python may be able to resolve it more efficie... | <p>It's easy to benchmark it:</p>
<pre><code>>>> from timeit import Timer
>>> ts = Timer("s.decode('utf-8')", "s = 'ééé'")
>>> ts.timeit()
8.9185450077056885
>>> tu = Timer("unicode(s, 'utf-8')", "s = 'ééé'")
>>> tu.timeit()
2.7656929492950439
>>>
</code></... |
How can Windows API calls to an application/service be monitored? <p>My company is looking at implementing a new VPN solution, but require that the connection be maintained programatically by our software. The VPN solution consists of a background service that seems to manage the physical connection and a command line/... | <p>Typically, communications between a front-end application and back-end service are done through some form of IPC (sockets, named pipes, etc.) or through custom messages sent through the Service Control Manager. You'll probably need to find out which method this solution uses, and work from there - though if it's enc... |
Reflection runtime performance - Java vs CLR <p>A related post <a href="http://stackoverflow.com/questions/435553/java-reflection-performance">here</a> pretty much established reflection in Java as a performance hog. Does that apply to the CLR as well? (C#, VB.NET, etc). </p>
<p><strong><em>EDIT</em></strong>: How doe... | <p>I wouldn't really care about the instantiation performance of the object using reflection itself but the actual performance of methods and such since those are after all what I'll be using from the class anyway.</p>
<p>Surely the instantiation takes a lot of time as can be seen in the linked post but since you're m... |
Java sort String array of file names by their extension <p>I have an array of filenames and need to sort that array by the extensions of the filename. Is there an easy way to do this?</p>
| <pre><code>Arrays.sort(filenames, new Comparator<String>() {
@Override
public int compare(String s1, String s2) {
// the +1 is to avoid including the '.' in the extension and to avoid exceptions
// EDIT:
// We first need to make sure that either both files or neither file
/... |
Silverlight Button Click Event <p>I have a silverlight page with a textblock and button on it. Like this:</p>
<pre><code><TextBlock x:Name="txbNote" Margin="50,50" Text="Hello"/>
<Button x:Name="btnCheck" Height="40" Click="btnCheck_Click" ClickMode="Press" Margin="50,50,50,50" Content="Check Service... | <p>You may need to post more code as this could be an issue with the surrounding tags, such as the container that these controls are in.</p>
<p>If you're unable to paste it all to StackOverflow, use <a href="http://www.dpaste.com" rel="nofollow">www.dpaste.com</a> or <a href="http://www.pastebin.com" rel="nofollow">ww... |
How do I build project files and packages for Borland C++ Builder 5 from the command line? <p>How do I build Borland C++ project files (bpr) and package files (bpk) from the command line? Project groups (bpg) are apparently make files and can be compile with make. But bpks and bprs are xml based and the Export to Mak... | <p>You don't need to directly compile a bpr. Just create a bpk which just includes that single bpr, and you can use make to compile it.</p>
<pre><code>"c:\program files\borland\cbuilder5\bin\make" -B -s -fabc.bpg
</code></pre>
<p>If you also have other borland compilers installed, do not call the make.exe from the ot... |
How do I detect if jQuery is in a document navigated to in the WinForm WebBrowser control? <p>I have a Windows Forms application in C#/Visual Studio 2008 with an IE WebBrowser control. In the DocumentCompleted event, I want to search the WebBrowser.Document or WebBrowser.DomDocument to see if jQuery is already present... | <p>Did you try:</p>
<pre><code>bool hasjQuery = webBrowser1.Document.InvokeScript("jQuery") != null;
</code></pre>
|
Flash Video Players: Do people really use the volume control? <p>Im wondering if anyone has any input on this subject? Im building a flash video player, and I have added a mute volume icon, but Im wondering what everyone's thoughts are on adding a volume control too?</p>
| <p>I consider a volume control to be an absolute requirement. Your idea of "normal levels" may be drastically different than mine. Besides, you may want to hear some of the moaning and squealing without sharing it with everyone else in your cube farm.</p>
|
How can i remove the sidebar in movable type? <p>im building a new side with movable type. And i want to remove the sidebar for a few pages, but not for all the pages.</p>
<p>Any idea?</p>
<p>Thanks.</p>
| <p>In the archive template -> page </p>
<p><code><mt:Var name="hide_sidebar" value="1"></code></p>
<p>Thanks</p>
|
Quick way to change a property on many forms in a Delphi project? <p>I thought there was something in GExperts to do this, but I can't see it if there is.</p>
<p>I have to change the SCALED property (from the default of TRUE to FALSE) in each form in a project that contains about 100 different forms. Because the defau... | <p>I would recommend changing all your forms to descend from a common ancestor. Then in the future you can just change the base class and it will fix it everywhere. </p>
<p>Generally I prefer to always use a custom descendant class over a stock one that I will be using frequently for this specific reason. </p>
|
Downloading files using Adobe AIR <p>When I download a file using URLStream and write to a file using FileStream, where else do the file gets cached? It definitely gets cached somewhere, as the second time I try to download the same file, it comes down like a lighting..</p>
| <p>AIR is using the operating systems networking stack for this, so the cache location will depend on where the OS caches files.</p>
<p>On Windows, check the Internet Explorer settings, on Mac check Safari. Im not sure about Linux.</p>
<p>mike chambers</p>
|
Why am I getting 'System.__ComObject' from my LDAP property? <p>I'll be the first to admit that this is cut and past programming. I've never looked at AD before, and really don't understand it. I suppose that's my next study...</p>
<p>Anyways, This is some test code, which should display the expiry date -- either as... | <p>It's because the property value is represented using the ADSI IADsLargeInteger COM interface and needs to be converted to a .NET date.
Although I haven't tried it, there is a sample that shows how here:
<a href="http://www.simple-talk.com/dotnet/.net-framework/building-active-directory-wrappers-in-.net/">http://www.... |
Using "with" statement for CSV files in Python <p>Is it possible to use the <code>with</code> statement directly with CSV files? It seems natural to be able to do something like this:</p>
<pre><code>import csv
with csv.reader(open("myfile.csv")) as reader:
# do things with reader
</code></pre>
<p>But csv.reader d... | <p>The primary use of <code>with</code> statement is an exception-safe cleanup of an object used in the statement. <code>with</code> makes sure that files are closed, locks are released, contexts are restored, etc.</p>
<p>Does <a href="http://docs.python.org/library/csv.html#csv.reader">csv.reader</a> have things to c... |
JavaBeans alternatives? <p>I hate the JavaBeans pattern with a passion that burns like the fire of a thousand suns. Why?</p>
<ul>
<li><strong>Verbose</strong>. It's 2009. I shouldn't have to write 7 LOC for a property. If they have event listeners then hold on to your hat.</li>
<li><strong>No type-safe references</str... | <p>I think you're pretty close with the declaration you have there (see below for a sketch). However, by using a non-beans approach, you'll probably lose support provided by most tools that assume the JavaBeans protocol is in effect. Please be kind. The code below is off the top of my head...</p>
<pre><code>public cla... |
Unable to parse a DateTime <p>I'm trying to parse a date/time string using <code>DateTime.ParseExact</code>. It works everywhere, except on one machine - it just will not parse on that machine. The question is: Why? What could be different on that machine so that it will cause this behaviour?</p>
<p>Here are some thin... | <p>I always find that regional settings can be tricky, and you can never assume that the users of your application will even have their machines setup correctly in the first place!</p>
<p>A catch-all that I've been using to parse dates in if they have to be strings is to parse it in the "dd/MMM/yyyy" format, e.g. "14/... |
Is a URL which uses a Rewrite URL still searchable by search engines? <p>My developer did the following:</p>
<p>If someone types public.sample.com/user/chumbawumba it redirects to stage.sample.com/profile.php?username=chumbawumba</p>
<p>I want to make sure that the content of the profile -- which contains company inf... | <p>You could go to google and type "site: public.sample.com" to see all pages searched with google on your site. Also see <a href="https://www.google.com/webmasters/tools/" rel="nofollow">Google Webmaster tools</a>.</p>
<p>Please tell is the rule redirets or rewrites request? So could you see in your browser "stage.sa... |
Seeking Example Delphi Prism ASP.Net Application using SQL Server <p>I'm an ASP.NET virgin and want to try creating an ASP.Net Application using SQL Server at the back end.</p>
<p>I can't locate a single example application or code for doing this. Anyone have any pointers?</p>
<p>TIA</p>
| <p>Delphi Prism is just the language and connecting to a SQL database is exactly the same way you would do so C#. I would look for a C# example on doing so and convert the syntax to Delphi (very easy to do). If you plan on using Delphi Prism you will spend a lot of time converting C# syntax examples to Delphi so you sh... |
About Memory Management in Java and C++ <p>Well, I've been given an assignment to basically figure out how memory allocation works for whatever language I'll be using. After some research, I have some questions and doubts which I'd like to get some insight in. For example:</p>
<p>I read <a href="http://en.citizendium.... | <blockquote>
<p>Looking at the JVM spec structure, it basically says the stack contains frames, and that the frames contain whatever is inside the class by properly allocating the variables and functions. Maybe I am missing something here, but I don't understand how this is any different than what C++ does. I ask bec... |
How much time it saves code generators? <p>My question seems easy but is little more theoretical than it looks. There are Code Generation software or application building software that gets done without the use of a programming language. Application like VE Server and VE Designer from <a href="http://www.intelliun.co... | <p>It depends on how we measure that time.</p>
<p>If you compare two control groups - one that types in all the code by hand, and another that uses the code generator - I have no doubt at all that the group that uses the code generator will require less time, hands down. It depends on how far you want to go with the ... |
Why does C# limit the set of types that can be declared as const? <p>Compiler error <a href="http://msdn.microsoft.com/en-us/library/ms228656(VS.80).aspx">CS0283</a> indicates that only the basic POD types (as well as strings, enums, and null references) can be declared as <code>const</code>. Does anyone have a theory ... | <p>From the <a href="http://msdn.microsoft.com/en-us/library/aa645749(VS.71%29.aspx" rel="nofollow">C# specification, chapter 10.4 - Constants</a>:<br>
<em>(10.4 in the C# 3.0 specification, 10.3 in the online version for 2.0)</em></p>
<blockquote>
<p>A constant is a class member that represents a constant value: a ... |
Is there an easy way to Spellcheck with TinyMCE in .NET <p>Is there any way to use TinyMCE in .NET and use the spellchecker without installing PHP as well?</p>
| <p>You can always use <a href="http://www.loresoft.com/Applications/NetSpell/default.aspx" rel="nofollow">Netspell</a> spellchecker for .NET. We use it in conjunction with TinyMCE. It works well.</p>
|
Write a number with two decimal places SQL server <p>How do you write a number with two decimal places for sql server?</p>
| <p>try this</p>
<pre><code>SELECT CONVERT(DECIMAL(10,2),YOURCOLUMN)
</code></pre>
|
How can I retrieve an assembly's qualified type name? <p>How can I generate a assembly qualified type name?</p>
<p>For an example, when configuring a membership provider, I would have to provide a assembly qualified type name for "SqlMembershipProvider" (in this example, i have copied the below configuration from some... | <p>This is a nice <a href="http://www.lennybacon.com/CommentView,guid,d571c376-42d0-427a-a7d0-ef9d22eab52c.aspx" rel="nofollow">handy tool</a> (shell extension with source code) for copying the fully qualified name to clipboard by right clicking on any assembly.</p>
<p><strong>Update</strong>: After seeing the comment... |
Django custom SQL to return QuerySet where each object has additional properties <p>Let's say I have the following objects: </p>
<pre><code>squirrel_table
- name
- country_of_origin
- id
nut_table
- id
- squirrel_who_owns_me[fk to squirrel]
</code></pre>
<p>I want to retrieve a list of all squirrels in a ... | <p>You probably want to read through <a href="http://docs.djangoproject.com/en/dev/ref/models/querysets/#extra-select-none-where-none-params-none-tables-none-order-by-none-select-params-none" rel="nofollow">the documentation for the "extra()" method</a>, which includes an example of a similar "select something else and... |
How to stop Ideablade DevForce writing to C:\Program Files\AppName\debuglog.xml in Vista <p>I have an application that uses Ideablade Devforce as it's OR mapper. When the application starts up it wants to write to the debuglog.xml file in C:\Program Files\Application Name\ This works fine in Windows XP, but due to Vist... | <p>I fixed it by setting the logging file option to a blank string within the IdeaBlade.ibconfig file.</p>
<p>It mentions in the help that if you don't supply a path it will save the file in the application's directory, but if you don't even supply the filename it will not save it anywhere.</p>
|
Equivalent? No, but why? <p>T-SQL:</p>
<p>1(ANSI): <code>convert(varchar(10),@DueDate, 102) < convert(varchar(10),getdate(), 102)</code></p>
<p>2(USA): <code>convert(varchar(10),@DueDate, 101) < convert(varchar(10),getdate(), 101)</code></p>
<p>Notice that these will return different results when year is... | <p>What are you trying to do? You're comparing varchars, there. Look at the output from these statements:</p>
<pre><code>print convert(varchar(10), getdate(), 101)
print convert(varchar(10), getdate(), 102)
</code></pre>
<p>That prints this:</p>
<pre><code>01/14/2009
2009.01.14
</code></pre>
<p>Comparing the first ... |
Firefox and IE rendering same image differently! <p>This is an exact duplicate of: <a href="http://stackoverflow.com/questions/130161/ie6-issues-with-transparent-pngs">http://stackoverflow.com/questions/130161/ie6-issues-with-transparent-pngs</a></p>
<p><hr></p>
<p>Firefox:<img src="http://i377.photobucket.com/albums... | <p>IE6 does not render transparent PNGs properly. There's a javascript fix, or <a href="http://24ways.org/2007/supersleight-transparent-png-in-ie6" rel="nofollow">some such</a>, but it's easier if you just don't use PNGs.</p>
|
Need help handling documents using dom4j <pre><code>import java.util.Iterator;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.io.XMLWriter;
public class Main {
public static void main(String[] args){
Company cp17 = new Company();
Person ps1 = new ... | <p>Use the standard DOM method Document.importNode to bring content from one document into another. <a href="http://www.dom4j.org/dom4j-1.6.1/apidocs/org/dom4j/dom/DOMDocument.html#importNode%28org.w3c.dom.Node,%20boolean%29" rel="nofollow">http://www.dom4j.org/dom4j-1.6.1/apidocs/org/dom4j/dom/DOMDocument.html#importN... |
Pre-populate an inline FormSet? <p>I'm working on an attendance entry form for a band. My idea is to have a section of the form to enter event information for a performance or rehearsal. Here's the model for the event table:</p>
<pre><code>class Event(models.Model):
event_id = models.AutoField(primary_key=True)
... | <p>So, you're not going to like the answer, partly because I'm not yet done writing the code and partly because it's a lot of work.</p>
<p>What you need to do, as I discovered when I ran into this myself, is:</p>
<ol>
<li>Spend a lot of time reading through the formset and model-formset code to get a feel for how it ... |
How to manually install an artifact in Maven 2? <p>I've encountered some errors when I tried to install an artifact manually with Maven 2. I wanted to install a jar from a local directory with the command</p>
<pre><code>mvn install:install-file -Dfile=jta-1.0.1B.jar
</code></pre>
<p>But Maven gave a build error which... | <p>You need to indicate the groupId, the artifactId and the version for your artifact:</p>
<pre><code>mvn install:install-file \
-DgroupId=javax.transaction \
-DartifactId=jta \
-Dpackaging=jar \
-Dversion=1.0.1B \
-Dfile=jta-1.0.1B.jar \
-DgeneratePom=true
</code></pre>
|
Datagridview custom vscrollbar <p>I would like disable vertical scroll bar in datagridview and managing the scrolling using separate vscroll control. I am using c# 2.0. Any one can help....????</p>
| <p>You can set DataGridView.ScrollBars property to ScrollBars.None or ScrollBars.Horizontal (to have just horizontal scrollbar). This way the vertical scrollbar will not be displayed and you can use yours</p>
|
CANopen PDOs and a communication profile <p>If the data contains more than one value, how do I know what these values represent? And how do I break up the data into individual values? Am I right to say that the relationship between the <a href="http://en.wikipedia.org/wiki/CANopen#Process_Data_Object_.28PDO.29_protocol... | <p>The relationship between PDOs and data is defined in the PDO mapping entries in the Object Dictionary. But that is probably not the easiest way to find out.</p>
<p>Since I don't know what device you are trying to communicate with, I cannot give you any information about its data output. You will have to consult the... |
mysql and check boxes <p>i have this table contains name and value, how can i convert the contents of</p>
<p>$row=mysql_fetch_array($result);</p>
<p>into check boxes</p>
| <p>Assuming $row is an associative array mapping column name onto a boolean 1 or 0 value, you could do something like this:</p>
<pre><code>foreach($row as $colname=>$boolean)
{
//create a name for the checkbox which will produce a nice
//PHP array of checked column names in $_POST['col']
$name="col[$co... |
Why the functions doesn't execute completely? <p>When I try to debug the following function segment, the execution brakes (jumps out of the function) at line pCellTower->m_pCellTowerInfo = pCellInfo:</p>
<pre><code>RILCELLTOWERINFO* pCellInfo = (RILCELLTOWERINFO*)lpData;
CCellTower *pCellTower = (CCellTower*)cbData;
... | <p>The most likely explanation is that pCellTower isn't set either. It could contain random bits, and end up pointing outside the memory allocated to your app. The OS cannot allow your program to write outside the space allocated to it, so it sends the program some kind of message (Windows:exception, Unix/Linux:signal)... |
Is mixing WPF, LinqToSql and multiple threads a bad idea? <p>My situation is roughly similar to <a href="http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3227644&SiteID=1" rel="nofollow">this guy</a> except that I don't need change notifications right now</p>
<p>I have a WPF App displaying a hierarchy. The ch... | <p>Your problem seems to come from using the same connection object for the reads. When you have syncronous data access one connection is usually enough if you remember to open/close between reads. Thy to change your GetChildren code to create new connections (and commands/data readers etc.) on each call so multiple th... |
Vim regular expression to remove all but last two digits of number <p>I have following text in a file</p>
<pre><code>23456789
</code></pre>
<p>When I tried to replace the above text using command </p>
<pre><code>1,$s/\(\d\)\(\d\d\d\)\(\d\d\)*\>/\3\g
</code></pre>
<p>I am getting <code>89</code>. Should... | <p>As written, your regex captures one digit, then three digits, then any number of groups of two digits each. The third match will, therefore, always be two digits if it exists. In your particular test case, the '89' is in \4, not \3.</p>
<p>Changing the regex to</p>
<pre><code> 1,$s/\(\d\)\(\d\d\d\)\(\d\d\+\)\>... |
Best way to interact with Command Line application <p>I need to write a component for an application that interacts tightly with a command line application. The command line application asks a series of questions, performs some computations, then terminates (which i need to detect). Essentially, i want to wrap up this ... | <p>You would need to redirect both the input and output streams, using <code>Process</code>; it is slightly trickier handling both, since you need to be careful that things aren't lost in the buffers (causing deadlock).</p>
<ul>
<li>MSDN : <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.processstar... |
How do I use a Perl package known only in runtime? <p>I have a Perl program, that needs to use packages (that I also write). Some of those packages are only chosen in Runtime (based on some environment variable). I don't want to put in my code a "use" line for all of those packages, of course, but only one "use" line, ... | <pre><code>eval "require $ENV{a}";
</code></pre>
<p>"<code>use</code>" doesn't work well here because it only imports in the context of the <code>eval</code>.</p>
<p>As @Manni said, actually, it's better to use require. Quoting from <code>man perlfunc</code>:</p>
<pre>
If EXPR is a bareword, the require assumes a "... |
Single web server and ETags <p>Does anyone know if it is worth disabling ETags on an web application that is hosted on a single web server? Currently we don't make use of ETags in our application.</p>
<p>If it is worth disabling them - why?</p>
<p>Many thanks.</p>
| <p>I don't know if this helps, but you can read about etags here:
<a href="http://developer.yahoo.net/blog/archives/2007/07/high_performanc_11.html">http://developer.yahoo.net/blog/archives/2007/07/high_performanc_11.html</a></p>
<p>and here is <a href="http://www.codinghorror.com/blog/archives/000932.html">what Jeff ... |
How/Where to host an UDP based component? <p>I´m working on a project that basically will show some data collected from hardware devices through <strong>UDP</strong> protocol.
the first idea of how to do this: implement a winService (to listen and persist the messages) and a wepApp to manage the data, based on .NET pl... | <p>A shared hosting setup will not allow you to have the permissions needed to run your service, look for a managed hosting service or a VPS on a cloud. Amazon EC2 or GoGrid currently have Microsoft Windows cloud offerings.</p>
|
Run script directly in 2 various browsers <p>I have created Ruby test script that use Selenium RC to test my web app directly in 2 browsers(IE, Firefox). My script runs - first on IE then continue on Firefox and then should be continued and finished in already opened IE browser. My problem is: I can't continue(reconne... | <p>Is there a particular reason you need to switch between browsers half way through?</p>
<p>I have no idea how you'd fix the problem, but it seems like it would be best solved by running the tests in one browser at a time.</p>
|
Howto get filename from which class was included in PHP <p>I understand that the question is rather hard to understand, I didn't know how to ask it better, so I'll use this code example to make things more clear:<br />
If I have the following files:</p>
<p>test.php:</p>
<pre><code><?php
include('include.php');
e... | <p>in case you need to get "test.php" see <code>$_SERVER['SCRIPT_NAME']</code></p>
|
From XML to object <p>I would like to define an asp.net page from xml, then parse/render it by calling a command name. Just like they do in Flex. Does someone has an idea how to do that?</p>
<p>Like for example, from XML:</p>
<pre><code><button onClick="DoJavascript()" text="Submit"/>
<gridview ......./>
... | <p>You could try XSLT, that's in general what is used to transform XML.</p>
|
How to do Unit Testing with Uncertainties? <p>We have several different optimization algorithms that produce a different result for each run. For example the goal of the optimization could be to find the minimum of a function, where 0 is the global minima. The optimization runs returns data like this:</p>
<pre><code>[... | <p>It sounds like your optimizer needs two kinds of testing: </p>
<ol>
<li>testing the overall effectiveness of the algorithm</li>
<li>testing the integrity of your implementation of the algorithm</li>
</ol>
<p>Since the algorithm involves randomization, (1) is difficult to unit-test. Any test of a random process wi... |
Where can I find a Java to C# converter? <p>I needed to convert a Java 1.5se app to C# 2.0.</p>
<p>Does anyone know of a tool (preferably free/open source) to do this?</p>
| <p>Even if there is such a tool, I'd highly recommend you to do the conversion by hand. Automatic converters will often faithfully reproduce the code, but ignore idioms - because they'd be really, really hard to get right.</p>
<p>Furthermore, the differences between generics in .NET and Java could lead to some very di... |
Custom SharePoint feature in multiple scopes in document library - shows up as duplicates <p>I have a custom feature which is an Edit Control Block (ECB) action in a document library that gets deployed as a solution package (WSP). When you pull down the dropdown next to a file, you see the feature and when the ECB acti... | <p>AFAIK, this behaviour is by design.
You will need to add or extend a FeatureReceiver
and override some of the methods, especially FeatureUninstalling
where you need to deactivate your feature on every place
where it is still activated.</p>
<p>You could log each activation e.g. using (top level) web properties.</p>
... |
What are the major differences between C and C++ and when would you choose one over the other? <p>For those of you with experience with both, what are the major differences? For a newcomer to either, which would be better to learn? Are there situations where you might choose C but then other situations where you woul... | <p>While C is a pure procedural language, C++ is a <em>multi-paradigm</em> language. It supports</p>
<ul>
<li>Generic programming: Allowing to write code once, and use it with different data-structures.</li>
<li>Meta programming: Allowing to utilize templates to generate efficient code at compile time.</li>
<li>Inspec... |
Insert row in table for each id in another table <p>I tried searching here for a similar solution but didn't see one so I was wondering what is the best way to accomplish the following.</p>
<p>I have a table with 17 million + rows all have a unique ID. We have recently created a new table that will be used in conjunc... | <p>If I understand correctly, you want one record in table2 for each record in table1.
Also I believe that apart from the reference to table1, table2 should initially contain blank rows.</p>
<p>So assuming</p>
<pre><code>table1 (ID, field1, field2, ...)
table2 (ID, table1_ID, fieldA, fieldB,...)
-- where table1_ID is... |
MethodInfo for EntityCollection instead of Queryable <p>I am manually creating the equivalent lambda:</p>
<pre><code>var function = p => p.Child.Any(c => c.Field == "value");
</code></pre>
<p>I have a MethodInfo reference to the "Any" method used with Expressions built in code.</p>
<pre><code>MethodInfo method... | <p><code>EntityCollection<T></code> doesn't implement <code>IQueryable<T></code> so it's not surprising that this doesn't work, IMO.</p>
<p>Could you give more explanation of what you're trying to do? If you're expecting the query to be run on the database, my guess is that it's really not going to support... |
Conversion between different units of measurement in SQL (in Access) <p>I'm trying to program an access database but I'm using SQL for all my querying. I've got the database almost complete but I have one query that has me stumped. It is a database which contains recipes. I have a table in which I have all the conve... | <p>I would think about this differently. You have different types of measures (volume, weight, count, etc.). Each of those measures has different, convertible units. Choosing a measure (ounces, for example), choose both a measure type and a particular unit. I'd have a way of converting between units of the same mea... |
How to provoke a timer trigger in glassfish? <p>We need some consistency in our functional test cases.
The best we can do currently is to wait for an estimated time before the Java EE timers in the product should have been triggered. It would be much more predictable if the test cases could trigger the timers programma... | <p>Its apparently impossible, since the question remain unanswered for almost three months.</p>
<p>However, I realized that for testing purposes it is enough to be notified when the triggering has actually occured. (Triggering it actively will only buy me time at the trade for quality)</p>
<p>I'm adding monitoring fo... |
Creating a specific XML document using namespaces in C# <p>We were given a sample document, and need to be able to reproduce the structure of the document exactly for a vendor. However, I'm a little lost with how C# handles namespaces. Here's a sample of the document:</p>
<pre><code><?xml version="1.0" encoding="... | <p>You should try it that way</p>
<pre><code> XmlDocument doc = new XmlDocument();
XmlSchema schema = new XmlSchema();
schema.Namespaces.Add("xmlns", "http://www.sample.com/file");
doc.Schemas.Add(schema);
</code></pre>
<p>Do not forget to include the following namespaces:</p>
<pre><code>using System.Xml.... |
Is there a way to name columns in an INSERT statement? <p>When I do SELECT statements in PHP code I always select named columns, like:</p>
<pre><code>SELECT id, name from users;
</code></pre>
<p>rather than using:</p>
<pre><code>SELECT * from users;
</code></pre>
<p>This has the advantage of being more informative ... | <pre><code>INSERT INTO table_name (column1, column2, column3,...)
VALUES (value1, value2, value3,...)
INSERT INTO people (id, name)
VALUES (1, 'Fred');
</code></pre>
|
Is it impossible to perform initialization before calling a superclass's constructor? <p>I'd like for a subclass of a certain superclass with certain constructor parameters to load an XML file containing information that I'd then like to pass to the superconstructor. Is this impossible to achieve?</p>
| <p>How about using a factory method instead? Maybe something like:</p>
<pre><code>private MyObject(ComplexData data)
{
super(data);
}
public static MyObject createMyObject(String someParameter)
{
ComplexData data = XMLParser.createData(someParameter);
return new MyObject(data);
}
</code></pre>
|
How can I get greasemonkey to call a function on a page after it loads <p>I have a very simple greasemonkey script that I want to call an already existing javascript function on the page. I've read the documentation and nothing seems to work</p>
<pre><code>window.setTimeout(function() {
alert('test') // This aler... | <p>Try using:
unsafeWindow.myFunction();</p>
<p>More details and info - <a href="http://wiki.greasespot.net/UnsafeWindow">http://wiki.greasespot.net/UnsafeWindow</a></p>
|
Are incrementers / decrementers (var++, var--) etc thread safe? <p>Inspired by this question: <a href="http://stackoverflow.com/questions/443423/in-complexity-analysis-why-is-considered-to-be-2-operations">http://stackoverflow.com/questions/443423/in-complexity-analysis-why-is-considered-to-be-2-operations</a></p>
<p>... | <p>No, incrementing is not thread-safe. Neither are the <code>INC</code> and <code>DEC</code> instructions. They all require a load and a store, and a thread running on another CPU could do its own load or store on the same memory location interleaved between those operations.</p>
<p>Some languages have built-in suppo... |
Decode/extract smime.p7m file contents (email with embedded files) with OpenSSL? <p>We have an old process (VBScript) that reads a common mailbox and processes certain emails into a database.</p>
<p>New regulations have all messages with attachments now being digitally signed.</p>
<p>The process now only extracts one... | <p>Did you try the "-noverify" option of openssl?</p>
<p>For a signed-only message, you can use
"openssl smime -verify -in -noverify -out /tmp/blob"</p>
<p>Then you can use a RFC822-like parser to get the body and attachment(s) out of that "blob". That means that your parser has to be capable of encodings like quo... |
HttpListener.Start() AccessDenied error on Vista <p>Running this code as a regular user throws HttpListenerException (access denied). Snippet runs ok as an administator</p>
<pre><code>class Program
{
static void Main(string[] args)
{
HttpListener listener = new HttpListener();
listener.Prefixe... | <p>I do not understand why but here it is. It seems that the cause is that my network card is configured with 2 IPs.</p>
<p>if in the code i specify one of the ips (like i did in question above)</p>
<pre><code>listener.Prefixes.Add("http://myip1:8080/app/");
</code></pre>
<p>then to avoid exception i need to regist... |
Django template ifequal comparison of decimals <p>So, I have a decimalfield that can be 3 different values. In my view,
I pass in a dictionary of values that contains the appropriate decimal
values as keys.</p>
<pre><code>{% for item in booklist %}
{% for key, value in numvec.items %}
{{item.number}} ... | <p>It is not a bug and <strong>it is possible</strong> to achieve what you're trying to do. </p>
<p>However, first of all few remarks about your code:</p>
<ul>
<li>There is no "ifequals/endifequals" operator. You either use <a href="http://docs.djangoproject.com/en/dev/ref/templates/builtins/#ifequal">"ifequal/endife... |
Div with horizontal scrolling only <p>I have a fixed width DIV containing a table with many columns, and need to allow the user to scroll the table horizontally within the DIV.</p>
<p>This needs to work on IE6 and IE7 only (internal client application).</p>
<p>The following works in IE7:</p>
<pre><code>overflow-x: s... | <p>I couldn't get the selected answer to work but after a bit of <a href="http://www.htmlhelpcentral.com/messageboard/showthread.php?13621-Horizontal-scrolling-div">research</a>, I found that the horizontal scrolling div must have <code>white-space: nowrap</code> in the css. </p>
<p>Here's complete working code:</p>
... |
Java toString() using reflection? <p>I was writing a toString() for a class in Java the other day by manually writing out each element of the class to a String and it occurred to me that using reflection it might be possible to create a generic toString() method that could work on ALL classes. I.E. it would figure out ... | <p>Apache commons-lang <a href="http://commons.apache.org/proper/commons-lang//apidocs/org/apache/commons/lang3/builder/ReflectionToStringBuilder.html">ReflectionToStringBuilder</a> does this for you. </p>
<pre><code>import org.apache.commons.lang3.builder.ReflectionToStringBuilder
// your code goes here
public Stri... |
error when trying to install MSMQ <p>Have VS-2003, VS-2005, VS-2008</p>
<p>Tried enabling MSMQ in Add/Remove Windows Components and get this</p>
<p>'A local user is authenticated as an anonymous user and cannot access active directory. You need to log on as a domain user to access Active directory.'</p>
<p>I am tryi... | <p>Uncheck the "active directory integration" option in the "add windows component" gui. It is not needed for private queues.</p>
|
How to host an asp.net mvc app on a domain that points to a subfolder? <p>I have the folowing scenario:</p>
<p>www.somedomain.com -> this points to a folder on a shared host, say /MyFolder1
www.otherdomain.com -> this points to another folder on the same shared host, say /MyFolder2</p>
<p>With asp.net mvc my urls get... | <p>The best way to handle this IMO is to use rewriting at the IIS level. I just did this on a site using IIS 7 URL Rewrite. If you don't have this module installed on your host provider, you can try to use one of the other URL rewriting tools. But, for example on DiscountASP you can use IIS 7 URL rewrite.</p>
<p>Fi... |
Download time remaning predictor <p>Are there any widgets for predicting when a download (or any other process) will finish based on percent done history?</p>
<p>The trivial version would just do a 2 point fit based on the start time, current time and percent done but better option are possible.</p>
<p>A GUI widgest ... | <p>For the theoretical algorithm that I would attempt, if I would write such a widget, would be something like:</p>
<ol>
<li>Record the amount of data transferred within a one second period (a literal <a href="http://en.wikipedia.org/wiki/Kibibyte" rel="nofollow">KiB</a>/s)</li>
<li>Remember the last 5 or 10 such peri... |
where should I save a complex MVC application UI state? <p>I've been having a look at several MVC frameworks (like rails, merb, cakephp, codeignitier, and similars...)</p>
<p>All the samples I've seen are basically plain and simple CRUD pages, carrying all the infr needed in the querystring and the posted field values... | <p>I use different strategies depending on the character of the actual data. Things that are preferences, like default page size, I keep in a Preferences object (table) that is associated with the current logged in user and retrieve from there when needed.</p>
<p>Persistent settings associated with the current logon,... |
Why don't Django admin "Today" and "Now" buttons show up in Safari? <p>I'm developing a Django application that contains a model with a date/time field. On my local copy of the application, the admin page for that particular model shows this for the date/time field:</p>
<p><img src="http://www.cs.wm.edu/~mpd/images/bu... | <p>I think you have to look at what is different between your firefox configuration and safary config</p>
<p>Off the top of my head:</p>
<ul>
<li><p>One could be configured to use a proxy (messing with the trafic) the other not. Make sure the configuration is the same in both.</p></li>
<li><p>Safari could have cached... |
Why can't enum's constructor access static fields? <p>Why can't enum's constructor access static fields and methods? This is perfectly valid with a class, but is not allowed with an enum.</p>
<p>What I'm trying to do is store my enum instances in a static Map. Consider this example code which allows lookup by abbreiva... | <p>The constructor is called before the static fields have all been initialized, because the static fields (including those representing the enum values) are initialized in textual order, and the enum values always come before the other fields. Note that in your class example you haven't shown where ABBREV_MAP is initi... |
What is the WCF equivalent of HttpContext.Current.Request.RawUrl? <p>I've got some RESTful services running in a pure WCF context (i.e. ASP.NET compatibility is not enabled, and thus there is no <code>HttpContext.Current</code> object available).</p>
<p>The URLs to the services are rewritten at the start of the reques... | <p>You can get the endpoint currently targeted and the Uri for it by doing:</p>
<pre><code>OperationContext.Current.RequestContext.RequestMessage.Headers.To
</code></pre>
<p>which I think is the same thing as:</p>
<pre><code>OperationContext.Current.IncomingMessageHeaders.To
</code></pre>
<p>This is a <code>System.... |
Do you recommend using semicolons after every statement in JavaScript? <p>In many situations, JavaScript parsers will insert semicolons for you if you leave them out. My question is, do you leave them out?</p>
<p>If you're unfamiliar with the rules, there's a description of semicolon insertion on the <a href="http://w... | <p>Yes, you should use semicolons after every statement in JavaScript.</p>
|
MS-SQL 2000: Turn off logging during stored procedure <p>Here's my scenario:</p>
<p>I have a simple stored procedure that removes a specific set of rows from a table (we'll say about 30k rows), and then inserts about the same amount of rows. This generally should only take a few seconds; however, the table has a trig... | <p>1) no, also you are not doing a minimally logged operation like TRUNCATE or BULK INSERT</p>
<p>2) No, how would you prevent corruption otherwise?</p>
|
Object Oriented questions in Javascript <p>I've been using javascript for a while, but have never learned the language past the basics. I am reading John Resig's "Pro Javascript Techniques" - I'm coming up with some questions, but I'm not finding the answers to them in the book or on google, etc.</p>
<p>John gives th... | <p>Every time a function() {} is evaluated, it creates a new function object. Therefore, in #1 all of the User objects are sharing the same getName and getAge functions, but in #2 and #3, each object has its own copy of getName and getAge. All of the different getName functions all behave exactly the same, so you can... |
How do I send emails outside my domain with Exchange 2007 and c# <p>I am able to send emails using the typical C# SMTP code across Exchange 2007 as long as both the from and to addresses are within my domain.</p>
<p>As soon as I try to send emails outside the domain I get:</p>
<p>Exception Details: System.Net.Mail.Sm... | <p>Try #2... How about using a <a href="http://www.msexchange.org/articles_tutorials/exchange-server-2007/management-administration/exchange-pickup-folder.html">Exchange Pickup Folder</a> instead? They are a faster way to send emails through Exchange because it just creates the email and drops it in the folder, no wait... |
Can you use the asp.net membership provider in a windows application? <p>The Asp.Net membership provider has some clear uses in a web app. I am thinking about trying to leverage some of the features in a windows application (more specifically WPF). Does anyone know if it is possible to use the core features in a wind... | <p>Yes. Membership, roles and profiles are all features of Visual Studio 2008 Client Application Services (Services tab of a project properties)</p>
<p><a href="http://msdn.microsoft.com/en-us/library/bb384297.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb384297.aspx</a></p>
<p><a href="http://chann... |
Is there an advantage to upgrade Binutils from 2.16.1 to 2.19? Why? <p>In the PSPSDK (Homebrew) we are using the Binutils 2.16.1 to assemble and link the code for the PlayStation Portable, however that release is getting quite outdated (3 versions have superseded it). The community and me have been updating the GCC and... | <p><code>binutils</code> 2.19 has a new ELF linker called <a href="http://sourceware.org/ml/binutils/2008-03/msg00162.html"><code>gold</code></a> which is multi-threaded, written in modern C++, and quite a bit faster than the usual <code>ld</code> linker. I'm not sure however about the work involved to adapt it. </p>
... |
Is there a streaming API for JSON? <p>Is DOM the only way to parse JSON?</p>
| <p>Some JSON parsers do offer incremental ("streaming") parser; for Java, at least following parsers from json.org page offer such an interface:</p>
<ul>
<li><a href="http://wiki.fasterxml.com/JacksonInFiveMinutes">Jackson</a> (pull interface)</li>
<li><a href="http://code.google.com/p/json-simple/">Json-simple</a> (S... |
How do I focus a foreign window? <p>I have an application which may only have one instance of itself open at a time. To enforce this, I use this code:</p>
<pre><code> System.Diagnostics.Process[] myProcesses = System.Diagnostics.Process.GetProcesses();
System.Diagnostics.Process me = System.Diagnostics... | <p>I had the same problem and <a href="http://msdn.microsoft.com/en-us/library/ms633553.aspx">SwitchToThisWindow()</a> worked the best for me. The only limitation is that you must have XP sp1 installed. I played with SetForegroundWindow, ShowWindow, and they both had problems pulling the window into view.</p>
|
Dynamically add multiple instances of the same user control type when button is clicked <p>Is it possible to add instances of the same user control when an "add" button is clicked and maintain ViewState?</p>
<p>The user interface here is similar to the Gmail file-attachment process, where the user can click "attach an... | <p>Adding multiple controls dynamically is easy in ASP.NET. Let's say you have a panel named Panel declared in your ASPX file and you have a custom control called MyControl.</p>
<p>In your Page_Load function (or indeed pretty much anywhere), add something like the following:</p>
<pre><code>for (int i = 0; i < Numb... |
What is a fractal? <p>Duplicate of <a href="http://stackoverflow.com/questions/425953/how-to-program-a-fractal">How to program a fractal</a></p>
<p><hr /></p>
<p>What are fractals? </p>
<p>Is this is one of the concepts that is brought over from Mathematics to programming to simplify or solve a particular set of pro... | <p>If you want to know about fractals in a general non-programming way, I would suggest looking at a general non-programming site. Wikipedia has <a href="http://en.wikipedia.org/wiki/Fractal" rel="nofollow">a good article on them</a>. If you want to know about programming fractals, I would suggest looking at this alrea... |
Custom dynamically created Menus producing some strange errors <p>The background is I have a custom control that is a asp:Menu that is linked to an xmldatasource. The xmldatasource is created dynamically depending on the user privies. Here is the load event for the custom control:</p>
<pre><code> protected void Pag... | <p>I found the answer and though I would leave it out here for others who might search for this:</p>
<p>But I had to set the "ENABLECACHING" to false on the xmldatasource.</p>
|
Javascript: Lazy Load Images In Horizontal Div? <p>I have a div that has a bunch of thumbnails showing horizontally (with a horizontal scrollbar). Is there a way to lazy load these thumbnails and only show them once the user horizontally scrolls to their position? All the examples I've seen check the browser window, no... | <p><del>I forked the <a href="http://plugins.jquery.com/project/lazyload" rel="nofollow">lazy load plugin</a> for jQuery and added support for lazy-loading images in a container div.</del> The <a href="http://plugins.jquery.com/project/lazyload" rel="nofollow">lazy load plugin</a> for jQuery now supports this directly.... |
Spring.net Drop all adotemplate connections? <p>I have an application which is connected to a database through a spring.net AdoTemplate. I am charged with creating a restore database method which keeps the app running but drops the network connections so as to drop the old database and bring up the new one. My questi... | <p>there is no physical "connection" between AdoTemplate and the SQL database. Leaving transactions aside, AdoTemplate creates a new SqlConnection object for each method that is executed from ADO.NET, executes a command and disposes the SqlConnection object after that.
Under the hoods, ADO.NET caches physical connectio... |
Can intellisense be exported or extracted from Visual Studio to a text file? <p>I'm trying to write some documentation for a webservice that has been provided by one of our vendors for an application we're integrating. A bunch of the interface is custom objects defined in the web service itself. The vendor has put up... | <p>If it is a web service that you are trying to document, couldnt you then parse out the WSDL?</p>
|
Left outer join on two columns performance issue <p>I'm using a SQL query that is similar to the following form:</p>
<pre><code>SELECT col1, col2
FROM table1
LEFT OUTER JOIN table2
ON table1.person_uid = table2.person_uid
AND table1.period = table2.period
</code></pre>
<p>And it's either way too slow or something's d... | <p>Bear in mind that statements 2 and 3 are different to the first one.</p>
<p>How? Well, you're doing a left outer join and your WHERE clause isn't taking that into account (like the ON clause does). At a minimum, try:</p>
<pre><code>SELECT col1, col2
FROM table1, table2
WHERE table1.person_uid = table2.person_uid... |
jQuery scope or race condition in AJAX/getJSON <p>I have a piece of jQuery code which invokes several <code>getJSON()</code> calls in quick succession:</p>
<pre><code>var table = $("table#output");
for (var i in items) {
var thisItem = items[i];
$.getJSON("myService", { "itemID": thisItem }, function(json) {
... | <p>Seems like a scoping issue due to the loop. Try this:</p>
<pre><code>var table = $("table#output");
for (var i in items) {
var thisItem = items[i];
$.getJSON("myService", { "itemID": thisItem }, (function(thisItem) {
return function(json) {
var str = "<tr>";
str += "<... |
How can I cache objects in ASP.NET MVC? <p>I'd like to cache objects in ASP.NET MVC. I have a <code>BaseController</code> that I want all Controllers to inherit from. In the BaseController there is a <code>User</code> property that will simply grab the User data from the database so that I can use it within the contro... | <p>You can still use the cache (shared among all responses) and session (unique per user) for storage. </p>
<p>I like the following "try get from cache/create and store" pattern (c#-like pseudocode):</p>
<pre><code>public static class CacheExtensions
{
public static T GetOrStore<T>(this Cache cache, string ... |
Pacman in Java questions <p>For my university assignment I have to make a networkable version of pacman. I thought I would best approach this problem with making a local copy of pacman first and then extend this functionality for network play. </p>
<p>I would have to say that I am relatively new to java GUI developmen... | <p>First off, I'd recommend that you use named constants rather than having random magic numbers in your code and consider using enums for your cell types. While it won't make your code run any faster, it certainly will make it easier to understand. Also, 'i' is normally used as a counter, not for a return value. Yo... |
Where can I find a good treeview control for Flex that supports checkboxes? <p>To my best knowledge the out-of-the-box Flex 3 treeview control does not support checkboxes. Where can I find a good treeview control that supports checkboxes on any and all nodes. I would prefer open source software but commercial componen... | <p>check out the following <a href="http://www.sephiroth.it/test/components/flex2/treecheckbox/test.swf" rel="nofollow">http://www.sephiroth.it/test/components/flex2/treecheckbox/test.swf</a></p>
<p><a href="http://www.sephiroth.it/index.php" rel="nofollow">http://www.sephiroth.it/index.php</a></p>
<p><a href="http:... |
Why do my Button send two postbacks when downloading zip file? <p>I've got a problem on a <em>WebForms</em> application where a user selects some criteria from drop downs on the page and hits a button on the page which calls this method:</p>
<pre><code>protected void btnSearch_Click(object sender, EventArgs e)
</code>... | <p>When they click the download button, do a Redirect to the ZIP file handler (page?) to download the file. i.e. use the Post-Redirect-Get pattern: <a href="http://en.wikipedia.org/wiki/Post/Redirect/Get" rel="nofollow">http://en.wikipedia.org/wiki/Post/Redirect/Get</a></p>
|
What is the equivalant of a 'friend' keyword in C Sharp? <p>What is the equivalant of a 'friend' keyword in C Sharp?</p>
<p>How do I use the 'internal' keyword?</p>
<p>I have read that 'internal' keyword is a replacement for 'friend' in C#.</p>
<p>I am using a dll in my C# project that I have the source code for and... | <ol>
<li><p>You can use the keyword access modifier <a href="http://msdn.microsoft.com/en-us/library/7c5ka91b.aspx"><code>internal</code></a> to declare a type or type member as accessible to code in the same assembly only.</p></li>
<li><p>You can use the <a href="http://msdn.microsoft.com/en-us/library/system.runtime.... |
Can you specify which svn branches with git svn? <p>I think my question is somewhat similar to <a href="http://stackoverflow.com/questions/258590/how-do-i-import-svn-branches-rooted-in-different-directories-into-git-using-git-s" rel="nofollow" title="How do I import svn branches rooted in different directories into git... | <p>In <code>git svn</code> commands, you can only use the asterisk wildcard to specify all members of a directory (<code>directoryname/*</code>) and not filename variations (<code>fileprefix*</code>). That may change in the future if <code>git svn</code> is revised to make use of SVN's new merge tracking.</p>
<p>Becau... |
How do I write a User Defined Function? <p>I would like to write this as a user defined function:</p>
<pre><code>private double Score(Story s){
DateTime now = DateTime.Now;
TimeSpan elapsed = now.Subtract(s.PostedOn);
double daysAgo = ela... | <p>You can, but if you're using SQL Server 2000, you'll have to pass in the value of "now"--UDFs can't generate any non-deterministic values themselves <a href="http://wardyit.com/blog/blog/archive/2006/02/15/84.aspx" rel="nofollow">in SQL Server 2000</a>.</p>
<p>This untested stab at it might be close:</p>
<pre><cod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.