input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
How well does F# perform compared to C#? <p>Of course both F# and C# compile to IL and the CLR JITter does most of the hard work, however I wanted to know whether there's anything implicit in the F# language or its core libraries which result in lesser performance compared to C#?</p>
<p>Additionally, is there anything... | <p>There is nothing intrinsic that makes one language faster than the other. They both run on the CLR and hence have roughly the same performance characteristics of any language that runs on the CLR. There are features of the respective languages though that do affect performance.</p>
<p>Tail recursion is a great ex... |
Add ADO.NET data tables to a blank MDB file <p>How can I add several data tables that I've built in code, to a blank MDB file that ships with my application?</p>
<p>I find it easy enough to connect to the MDB file via the OledbConnection object, but then I'm at a loss for an easy way to add my tables to it. There it s... | <p>DataSet intrinsically understands the XML storage, you might think of it (very loosely mind) as its native data store. In fact XML storage is meant for temporary or transistory storage so that a DataSet can be re-constituted between application re-starts or transference between machines.</p>
<p>On the other hand, ... |
Scenarios where automated testing is unhelpful <p>What are some situations where unit testing and TDD and the like are more trouble than they're worth?</p>
<p>Some things I've come up with are:</p>
<ul>
<li>When generating test data is tricky: Sometimes, being able to come up with valid, non trivial test data is a ch... | <p>I believe your first two points are not valid. </p>
<ul>
<li>Creating test data may be a challenge (in fact, it's <em>usually</em> a major part of writing unit tests), but that's simply something you have to accept, not a reason to give up on unit tests. And it can't be impossible, otherwise how would you ever know... |
beep in WinCE , it possible ? <p>is it possible to make beep in WinCE ?</p>
<p>i try and i get an error</p>
| <p>The .net framework methods for beeing are not available in the CF version of the framework. The best way to get a beep sound is to PInvoke into the MessageBeep function. The PInvoke signature for this method is pretty straight forward</p>
<pre><code>[DllImport("CoreDll.dll")]
public static extern void MessageBeep... |
Host files or stream data on a self-hosted WCF (non-IIS) service that uses HTTP? <p>Is it possible to host custom data on self-hosted HTTP-configured WCF services, such as custom HTML or XML files, without involving IIS? Iâm speaking of a ServiceHost instance that instantiates its own EndPoints/listeners.</p>
<p>I h... | <p>OK found my answer. The [OperationContract] has a WebGet property that you can assign a URL. The method this attribute is associated with can then return a Stream object.</p>
<p>Example here: <a href="http://blogs.msdn.com/carlosfigueira/archive/2008/03/07/enabling-cross-domain-calls-for-silverlight-apps-on-self-ho... |
Using gdb, display multiple vars in one line? <p>How can I ask to <em>display</em> multiple vars in one line? So I want to get output like:</p>
<pre><code>30 if(s[i] != '\0')
5: s[i] = 101 'e'
4: exp = 14
3: val = 123.45
2: sign = 1
1: i = 6
</code></pre>
<p>I've been typing in disp s[i] ENTER disp exp ENTER (et... | <p>To establish multiple active "variable displays" without re-typing each of <code>display i</code>, <code>display s[i]</code>, etc. every time you restart GDB, use a GDB "canned command sequence".</p>
<p>For example, add this to your <code>~/.gdbinit</code>:</p>
<pre><code>define disp_vars
disp i
disp sign
di... |
How to properly mock and unit test <p>I'm basically trying to teach myself how to code and I want to follow good practices. There are obvious benefits to unit testing. There is also much zealotry when it comes to unit-testing and I prefer a much more pragmatic approach to coding and life in general. As context, I'm cur... | <p>Essentially what you are testing here is that the methods are getting called, not whether or not they actually work. Which is what mocks are supposed to do. Instead of calling the method, they just check to see if the method got called, and return whatever is in the Return() statement. So in your assertion here:</... |
a simple regexp validator <p>How do a I create a validator, which has these simple rules. An expression is valid if </p>
<p>it must start with a letter<br />
it must end with a letter<br />
it can contain a dash (minus sign), but not at start or end of the expression </p>
| <pre><code>^[a-zA-Z]+-?[a-zA-Z]+$
</code></pre>
<p>E.g.</p>
<pre><code>def validate(whatever)
reg = /^[a-zA-Z]+-?[a-zA-Z]+$/
return (reg.match(whatever)) ? true : false;
end
</code></pre>
|
Adding scripting security to an application <p>Let's say I have an existing application written in Java which I wish to add scripting support to. This is fairly trivial with Groovy (and just as trivial in .Net with any of the Iron range of dynamic languages).</p>
<p>As trivial as adding the support is, it raises a who... | <blockquote>
<p>script signing</p>
</blockquote>
<p>Conceptually, that's just reaching into your cryptographic toolbox and using the tools that exist. Have people sign their code, validate the signatures on download, and check that the originator of the signature is trusted.</p>
<p>The hard(er) question is what ma... |
How to read inline styling of an element? <p>Howdy all. I'd like to know if it's possible to determine what <strong>inline styling</strong> has been attributed to an HTML element. I do not need to retrieve the value, but rather just detect if it's been set inline or not.</p>
<p>For instance, if the HTML were:</p>
<... | <p><strong>Updated to work with IE</strong></p>
<p>You could try something like this</p>
<pre><code>function hasInlineStyle(obj, style) {
var attrs = obj.getAttribute('style');
if(attrs === null) return false;
if(typeof attrs == 'object') attrs = attrs.cssText;
var styles = attrs.split(';');
for(v... |
Comparing two integers without any comparison <p>Is it possible to find the greatest of two integers without any comparison? I found some solutions: </p>
<pre><code>if(!(a/b)) // if a is less than b then division result will be zero.
{
cout << " b is greater than a";
}
else if (!(a-b)) // we know a is great... | <p>Subtract them and check the sign using nasty bit twiddling hacks<br />
<a href="http://graphics.stanford.edu/~seander/bithacks.html">http://graphics.stanford.edu/~seander/bithacks.html</a></p>
<p>Don't do this in production code if the other programmers know where you live.</p>
|
Problems with big query and subquery <p>I thought that I'll be clever and use subquery to get my <a href="http://stackoverflow.com/questions/470992/how-to-count-number-of-different-items-in-sql#471152">report</a> in one go. But after running into problems and reading documentation I saw that my approach does not work i... | <p>Try using an INNER JOIN (something like this):</p>
<pre><code>SELECT p1.surname ,p1.name,p1.id,r1.start_date,r1.end_date,c1.short_name
FROM ejl_players p1
INNER JOIN (
SELECT p.id
FROM ejl_players p
LEFT JOIN ejl_registration r ON (r.player_id = p.id)
LEFT JOIN ejl_teams t ON (r.team_id = t.id)
... |
iPhone Mic volume <p>Is there any way to poll the mic input volume with AVFoundation? I have seen the CoreAudio examples like SpeakHere but I really only need the current value. Is CA my only option?</p>
| <p>You should checkout SCListener. It's a simple way just to get the average or peak level of the mic.</p>
<p><a href="http://github.com/stephencelis/sc%5Flistener" rel="nofollow">http://github.com/stephencelis/sc_listener</a></p>
|
What are the File Permission Signs @ and + for? <p>My mac has folders Shared and Public folders. Their permissions are drwxr-xr-x+ for Public and drwxrwxrwt@ for Shared. What do the signs + and @ mean?</p>
| <p>@ means there are "extended attributes". Type</p>
<pre><code>ls -l@
</code></pre>
<p>to see what they are. With that command, everything with a @ after it will have some extra lines explaining why it has a @. In my experience, the @ usually means a file is going to be opened with an application other than the defa... |
Need help in refreshing the page after submit <p>I am developing an web application following the 3 tier architecture.When i am hitting on submit button data is storing in database but not showing response message like "Record submitted successfully" and fields are not refreshing. Here is my code:</p>
<pre><code>prote... | <p>Rather than using Response.Write, set a label such as labelResults to display the outcome. Response.Write is not going to show up in the proper place in your rendered HTML.</p>
|
Control camera via Firewire <p>Some SONY Cameras have a <a href="http://en.wikipedia.org/wiki/Firewire" rel="nofollow">FireWire</a> interface.</p>
<p>Is it possible to control any <strong>camera</strong> functions via FireWire using any <a href="http://www.unibrain.com/Products/DriverAPI/FireAPI.html" rel="nofollow">F... | <p>The open source video editor <a href="http://www.kinodv.org/" rel="nofollow">kinoDV</a> does this for all kinds of cameras, including sony. Maybe have a look at the source ?</p>
|
SQL Server column relationships <p>I've got two tables.</p>
<p>One is "Corporations" (e.g., one record is for Taco Bell). The index and PK for this table is named "Id".</p>
<p>I've got another table: "Branches" (e.g., one record is for Los Angeles). The Branch table has a column named "Corporation". This column shoul... | <p>Add a FOREIGN KEY to Branches that references Corporations.</p>
<p>i.e. in the CREATE TABLE for Branches:</p>
<pre><code>CREATE TABLE Branches
(
...
CorporationId int NOT NULL
CONSTRAINT FOREIGN KEY FK_Branches_Corporations REFERENCES Corporations(Id)
...
)
</code></pre>
|
Is there a way to access an iteration-counter in Java's for-each loop? <p>Is there a way in Java's for-each loop</p>
<pre><code>for(String s : stringArray) {
doSomethingWith(s);
}
</code></pre>
<p>to find out how often the loop has already been processed?</p>
<p>Aside from using using the old and well-known <code>... | <p>No, but you can provide your own counter.</p>
<p>The reason for this is that the for-each loop internally does not <em>have</em> a counter; it is based on the <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Iterable.html" rel="nofollow">Iterable</a> interface, i.e. it uses an <code>Iterator</code> to loo... |
Array functions in jQuery <p>I am using jQuery in my web application. I want to use arrays, but I am not able to find out functions for arrays (add, remove or append elements in array) in jQuery. Is there any link related to jQuery array functions which will explain the jQuery array functions?</p>
| <p>Have a look at
<a href="https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global_Objects/Array">https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global_Objects/Array</a>
for documentation on JavaScript Arrays.<br />
jQuery is a library which adds some magic to JavaScript which is a capabl... |
Primitive type 'short' - casting in Java <p>I have a question about the primitive type <code>short</code> in Java. I am using JDK 1.6. </p>
<p>If I have the following: </p>
<pre><code>short a = 2;
short b = 3;
short c = a + b;
</code></pre>
<p>the compiler does not want to compile - it says that it "cannot convert f... | <p>As explained in <a href="http://msdn.microsoft.com/en-us/library/ybs77ex4(VS.71).aspx">short C#</a> (but also for other language compilers as well, like Java)</p>
<p>There is a predefined implicit conversion from short to int, long, float, double, or decimal.</p>
<p>You cannot implicitly convert nonliteral numeric... |
What's the idiomatic Python equivalent to Django's 'regroup' template tag? <p><a href="http://docs.djangoproject.com/en/dev/ref/templates/builtins/#regroup">http://docs.djangoproject.com/en/dev/ref/templates/builtins/#regroup</a></p>
<p>I can think of a few ways of doing it with loops but I'd particularly like to know... | <p>Combine <a href="http://docs.python.org/library/itertools.html#itertools.groupby"><code>itertools.groupby</code></a> with <a href="http://docs.python.org/library/operator.html#operator.itemgetter"><code>operator.itemgetter</code></a> to get a pretty nice solution:</p>
<pre><code>from operator import itemgetter
from... |
Create temp dir that is globally known and that gets automagically removed (C++)? <p>In C++, I have a few functions that need to write to a temp directory. Ideally, only one temp directory gets created that they all write to (to minimize I/O overhead). That directory should be automagically removed when the program exi... | <p>Using popen() to execute things like "rm -r" or "mktemp -p /tmp" is a recipe for disaster. In my opinion it is extremely bad style.</p>
<p>UNIX Specific: If you want temporary files to disappear even if your application terminates abnormally then the best way to go is to immediately unlink temp files after opening... |
What to use? Digital signature? <p>Sorry I couldn't find the best heading for this question. Following is my requirement.</p>
<p>I a working on a project which deals which large amount of money transactions to different account. The system automatically transfers money to accounts of A,B, C etc etc,, But before this i... | <p>Digital Signatures is what you are looking for. Adobe PDF (since you mentioned pdf) allows you to sign the pdf in the free Adobe Reader version and verification is also done automatically, as soon as you open the pdf document.</p>
<p>The difference between DigSig and (H)MACs as posted by Noldorin is, that MACs use ... |
Friendly Form Validations (Rails) <p>I checked out <a href="http://stackoverflow.com/questions/361161/rails-form-validation">both </a> of <a href="http://stackoverflow.com/questions/423160/rails-form-validation-conditional-bypass">these</a> previously-asked questions, and they're a help but not a full solution for my c... | <p>FYI, you don't have to pass an array to <code>validates_format_of</code>. Ruby will do arrays automagically (Rails parses the output of <code>*args</code>).</p>
<p>So, for your question, I'd go for something like this:</p>
<pre><code>class Link < ActiveRecord::Base
validate :proper_link_format
private
d... |
Something like overloading in PHP? <p>I'd like to accomplish something like this: Call a method, say "turn", and then have "turn" applied differently to different data types, e.g., calling "turn" with a "screwdriver" object/param uses the "turnScrewdriver" method, calling "turn" with a "steeringWheel" object/param uses... | <p>I read davethegr8's solution but it seems one could do the same thing with stronger typing:</p>
<pre><code><?php
interface Turnable
{
public function turn();
}
class Screwdriver implements Turnable
{
public function turn() {
print "to turning sir!\n";
}
}
class SteeringWheel implements Turnable
{
... |
What's a reasonable version of Windows to support for a new .Net application? <p>If I develop a .Net application that's going to run on WinXP and Vista, as well as on a modern Mac or Linux under Mono, what are older versions of Windows where I will have to start thinking carefully if I want to support them? Does Window... | <p>Since <a href="http://www.go-mono.com/mono-downloads/download.html" rel="nofollow">Mono</a> runs on all your target platforms (Win 2000+, Linux and Mac OSX) you can develop your app with that instead of Microsoft .NET. Doing that will also reduce the pain of getting your app running on non-Windows platforms later (s... |
Why are there many JRE implementations? <p>I was wondering..There is Sun's JRE, IBM's JRE, BEA's JRE, Oracle's JRE and some more less know JREs in the market.
Why is there so many JRE implementations? Does the fact that Sun opened the Java platforms mean that there will be one open JRE / JDK? Or are we going towards w... | <p>Why is there more than one C compiler? Why is there more than one implementation of Ruby? Different implementations allow different teams to explore different possibilities for optimisation etc. For instance, I'm pretty sure that at one point the IBM JRE was much faster than the Sun one for floating point. Other imp... |
Getting user's group name in Windows <p>I'm using a Java program that has to gather info that can be derived from the user's group.</p>
<p>How can you get a user's group name from windows? Is it found in a file or is there some method/API for getting it?</p>
<p>Please help.</p>
<p>Thanks</p>
| <p>This forum post <a href="http://forums.sun.com/thread.jspa?threadID=581444&messageID=3313188" rel="nofollow">Naming and Directory (JNDI) - JNDI, Active Directory and Group Memberships</a> should put you on the right track.</p>
|
Clear file cache to repeat performance testing <p>What tools or techniques can I use to remove cached file contents to prevent my performance results from being skewed? I believe I need to either completely clear, or selectively remove cached information about file and directory contents.</p>
<p>The application that I... | <p>Use SysInternal's <a href="http://technet.microsoft.com/en-us/sysinternals/ff700229.aspx">RAMMap app</a>.</p>
<p><img src="http://i.stack.imgur.com/EuOmF.png" alt="rammap empty standby"></p>
<p>The Empty / Empty Standby List menu option will clear the Windows file cache.</p>
|
Efficient join with a "correlated" subquery <p>Given three tables Dates(date aDate, doUse boolean), Days(rangeId int, day int, qty int) and Range(rangeId int, startDate date) in Oracle</p>
<p>I want to join these so that Range is joined with Dates from aDate = startDate where doUse = 1 whith each day in Days.</p>
<p>... | <p>Try this:</p>
<pre><code>SELECT rt.rangeId, aDate, CASE WHEN doUse = 1 THEN qty ELSE 0 END AS qty
FROM (
SELECT *
FROM (
SELECT r.*, t.*, SUM(doUse) OVER (PARTITION BY rangeId ORDER BY aDate) AS span
FROM (
SELECT r.rangeId, startDate, MAX(day) AS dm
FROM Range r, Days d
WHER... |
Most bandwidth efficient unidirectional synchronise (server to multiple clients) <p><strong>What is the most bandwidth efficient way to <em>unidirectionally</em> synchronise a list of data from one server to many clients?</strong></p>
<p>I have sizeable chunk of data (perhaps 20,000, 50-byte records) which I need to p... | <p>Something similar to bittorrent? Or even using bittorrent. Or maybe invent a wrapper around bittorrent.</p>
<p>(Assuming you pay for bandwidth on your server and not the others ...)</p>
|
Recursion or iteration? <p>I love recursion. I think it simplifies things a lot. Another may disagree; I think it also makes the code a lot easier to read. However, I've noticed that recursion is not used as much in languages such C# as they are in LISP (which by the way is my favorite language because of the recursion... | <blockquote>
<p>Are they more expensive than
iterations?</p>
</blockquote>
<p>Yes they are. Many Lisp variants support the idea of a "tail-call optimisation" which allows many uses of a recursive function call to be converted into an iterative one (this is simplifying a bit). If tail-call is not supported, then a ... |
Copy MySQL structure across servers via PHP <p>I'm in need of help - I've got two mysql databases on different servers with a web host, and I need to copy a Joomla installation from one to the other. The problem I have is that the only way I can access the data is via php, as direct odbc connections to the database are... | <p>Can you install <a href="http://phpmyadmin.net/" rel="nofollow">phpMyAdmin</a>? If so, it has a database export/import functionality that would likely be perfect for this.</p>
|
How to select even or odd elements based on class name <p>if you create html layout like so</p>
<pre><code><ul>
<li class='a'></li>
<li class='b'></li>
<li class='a'></li>
<li class='b'></li>
<li class='a'></li>
<li clas... | <p>The problem is that :odd and :even (and their CSS cousins :nth-child(odd) and :nth-child(even)) refer to the order in which the elements appear as children of their parent, not as children with that particular selector.</p>
<p>This worked for me (Prototype, but it looks like MooTools has similar syntax):</p>
<pre>... |
ASP Error and IIS 7.0 <p>In IIS 6 ASP errors were displayed with the line number and a description of the problem. For example, </p>
<pre><code>{call dbo.spGetCommunityInfo(xx)}
Microsoft SQL Native Client error '80020005'
Invalid character value for cast specification
/communitydetail.asp, line 42
</code></pre>
<... | <p>You can use AppCmd to turn on ScriptErrorSentToBrowser (it's false in IIS7 defaults, it was true in IIS6). AppCmd live in %SystemRoot%\system32\inetsrv and you need to run it as admin:</p>
<blockquote>
<p>appcmd.exe set config
-section:system.webServer/asp -ScriptErrorSentToBrowser:true</p>
</blockquote>
|
Merging C Callergraphs with Doxygen or determining union of all calls <p>I have a collection of legacy C code which I'm refactoring to split the C computational code from the GUI. This is complicated by the heavily recursive mathematical core code being K&R style declarations. I've already abandoned an attempt to c... | <p>In your Doxyfile, set</p>
<pre><code>GENERATE_XML = YES
</code></pre>
<p>and then you can find your call graph in the XML files. For each function marked with the callergraph, you'll find <code><referencedby></code> elements in the output that you can use. Here's a sample from one of my C files:</p>
<pre><c... |
How do I get Visual Web Developer to use IIS, and not ASP.NET development server? <p>I want to make sure my local is matching the production environment closely and that means running IIS and not the ASP.NET development server that comes with Visual Web Developer express edition. What is the best way to do this?</p>
| <p>In Visual Studio you right-click the project, select Properties then Web and change it to use Local IIS. It seems the process is similar for VWD, but there there is a <a href="http://blogs.msdn.com/webdevelopertips/archive/2008/11/04/tip-20-did-you-know-how-to-change-wap-to-use-an-iis-web-server.aspx" rel="nofollow"... |
.NET MVC: How to create form from controller? <p>In .NET 3.5 winforms, I've created an MVC. I'd like to take the controller part and put it into a separate assembly, so that it has no knowledge of the view. My app uses five forms in its view. The controller takes care of initializing the forms at different times, wh... | <p>I use an IOC Container to resolve the view and inject the controller instance via the form constructor, like so.</p>
<pre><code>public class MainWindowController : WindowController<IMainWindowView>
{
}
public class WindowController<TView> where TView : IView
{
public WindowController( IViewFactory ... |
Find path where SQL Server is installed? <p>How can I get the path where SQL Server 2005 is installed in a system, through SQL command?</p>
| <p><code>select filename from master.sys.sysfiles where name = 'master'</code></p>
|
ASP.NET Forms auth - gettings user data <p>I'm using forms authentication on a very small ASP.NET web app (Web Forms) in which I want to store additional info about the user in a separate database table.</p>
<p>This is then linked back to the <code>aspnet_User</code> table and I was figuring the best column to link to... | <p>here's how you can get the userid</p>
<pre><code>MembershipUser myObject = Membership.GetUser();
string UserID = myObject.ProviderUserKey.ToString();
string Email = myObject.Email;
</code></pre>
|
WPF translation transform <p>How can i get the new bounds after applying a translation transform to a WPF mesh geometry 3D?</p>
| <p>What I found:</p>
<p>Rect3D newRec3D = modelVisual3D.Transform.TransformBounds(modelVisual3D.Geometry.Bounds);</p>
<p>If you have better way, please post it.</p>
|
trim is not part of the standard c/c++ library? <p>Is it me or are there no standard trim functions in the c or c++ library? is there any single function that acts as a trim? If not can anyone tell me Why trim is not part of the standard library? (i know trim is in boost)</p>
<p>My trim code is</p>
<pre><code>std::st... | <p>No, you have to write it yourself or use some other library like Boost and so forth.</p>
<p>In C++, you could do:</p>
<pre><code>#include <string>
const std::string whiteSpaces( " \f\n\r\t\v" );
void trimRight( std::string& str,
const std::string& trimChars = whiteSpaces )
{
std::string::... |
Who has the best metaphor for WPF dependency properties? <p>I'm reading WPF Recipes in C# 2008:</p>
<p><a href="http://www.apress.com/book/view/9781430210849" rel="nofollow">http://www.apress.com/book/view/9781430210849</a></p>
<p>and starting on the third recipe they asssume you know how dependency properties work. ... | <p>Dependency properties are just like normal properties except they have some special "hooks" that WPF uses.</p>
<p>One special thing is that sometimes if you don't set a property value it will receive its value from the control it is placed in (so if you set the font for a button the text block inside the button wil... |
Nested accordion menu in jQuery <p>I have a menu implemented using a set of nested accordions, <code>1</code> and <code>2</code>, each with elements, <code>a</code> and <code>b</code>.</p>
<p>I would like to implement the following logic:</p>
<ul>
<li><p>When I click <code>1a</code>, I will get the data of <code>1a</... | <p>Just a few changes to the order of the elements in your HTML and you get the behavior you are looking for. At the start now only 1a and 1b are open. Similarly when you click on 1b now it will close 1a which will hide any open 2a/2b section as well.</p>
<pre><code> $(document).ready(function() {
$("#acc1... |
detect os language from c# <p>Is there a way to detect the Language of the OS from within a c# class?</p>
| <p>Unfortunately, the previous answers are not 100% correct. </p>
<p>The <code>CurrentCulture</code> is the culture info of the running thread, and it is used for operations that need to know the current culture, but not do display anything. <code>CurrentUICulture</code> is used to format the display, such as correct ... |
Microsoft.Reporting.* vs XML/XSLT <p>I would like to add reporting capabilities to a .NET application. My data source is just the data model of the application, i.e. a bunch of objects that may have been generated or loaded from anything (not necessarily from a database).</p>
<p>The initial plan was to generate a repo... | <p>A couple of things to consider.</p>
<p>1) Reporting Services are part of Sql Server, so you may have an extra license issue if you go that route.</p>
<p>2) Reporting Services can serve up web pages, or be used in WinForms with full paging, sorting, sub reports, totals etc etc - that's really hard in XSL. It will a... |
One Cache for various Applications? <p>i have two applications - one is an asp.net website and the other is a windows service.</p>
<p>both applications are referencing my business layer (library project), which itself is referencing my data access layer (library project) that itself uses the enterprise library data ap... | <p>You should take a significant look at Microsoft's new free distributed cache "Velocity."</p>
<p>Here's a podcast I did on the subject:
<a href="http://www.hanselman.com/blog/HanselminutesPodcast116DistributedCachingWithMicrosoftsVelocity.aspx" rel="nofollow">http://www.hanselman.com/blog/HanselminutesPodcast116Dist... |
Enum ToString with user friendly strings <p>My enum consists of the following values:</p>
<pre><code>private enum PublishStatusses{
NotCompleted,
Completed,
Error
};
</code></pre>
<p>I want to be able to output these values in a user friendly way though.<br>
I don't need to be able to go from string to va... | <p>I do this with extension methods:</p>
<pre><code>public enum ErrorLevel
{
None,
Low,
High,
SoylentGreen
}
public static class ErrorLevelExtensions
{
public static string ToFriendlyString(this ErrorLevel me)
{
switch(me)
{
case ErrorLevel.None:
return "Everything is OK";
case... |
Can I make more then one request on a curl connection? <p>In PHP (v5), is there a way to make multiple requests on an open curl connection?</p>
<p>I'm noticing that my big bottleneck is the timeout/teardown of the connection its self (i'm making lots of small data requests that finish quickly), so I would like to be a... | <p>Probably the <a href="http://php.net/manual/en/function.curl-multi-init.php" rel="nofollow"><code>curl_multi_*</code></a> functions are what you are looking for.</p>
|
How do you get resin to serve index.html by default if you navigate to a directory? (equivalent of DirectoryIndex in Apache) <p>Is it possible to configure <a href="http://caucho.com/resin/" rel="nofollow">Resin</a> to serve static files such that navigating to e.g. <a href="http://localhost:8888/foo/bar/" rel="nofollo... | <p>Maybe I don't get the question, but <a href="http://caucho.com/resin/doc/webapp-tags.xtp#welcome-file-list" rel="nofollow">welcome-file-list</a> seems to do just that?</p>
|
How do I get the actual value of a DependancyProperty? <p>I have a small UserControl and it needs to know the Background Brush of the control on which it's being rendered.</p>
<p>However, if I look in the Background property of the UserControl it comes back null. </p>
<p>If I call GetValue(UserControl.BackgroundPrope... | <p>It seems to me that your UserControl does not have a background color defined - null means transparent, which is why the parent control's background is visible at all.</p>
<p>It is still the background color of the parent control - the fact that your control does not have its own background color does not mean that... |
File / Folder monitoring <p>What is the best way to monitor disks against file activities. I mean that getting the full file name (c:\temp\abc.txt), action(created/deleted/modified/renamed), and also the user (user1) and process name (notepad.exe) causing the file (multiple delete) activities.</p>
<p>I heard about Som... | <p>One of my favorite blogs answered this question (with full source and a demo application) quite a while ago. Checkout the <a href="http://delphi.about.com/od/kbwinshell/l/aa030403a.htm">Delphi About.com article here</a> which has a more in depth explanation. Code provided by Zarko Gajic at <a href="http://delphi.abo... |
IE6 Bullet Point Alignment Problem <p>I am currently having some problems with <code><li></code> in IE6 essentially my code looks like this,</p>
<pre><code><ul>
<li>some filler text some filler text</li>
<li>some filler text some filler text</li>
<li>some filler text som... | <p>You should decide whether you want to use background-image or list-style-image to add the bullet. I'd advise for the background-image solution as the other one has problems in IE6, as you saw already.</p>
|
.asmx web services with ssl <p>Are there any special configuration settings you have to do to make a web service work with SSL?</p>
<p>Is there a way to force the service methods to authenticate using a username/password like I can do with a WCF service?</p>
| <ol>
<li>No. SSL support provided by web server (IIS). </li>
<li>Yes. Just configure authentication through web.config</li>
</ol>
|
How to programmatically create a Quick Campaign in MS Dynamics CRM <p>I am trying to create a "quick campaign" in code, but I don't find a class to do that.</p>
<p>I found the way to create a list and add users to that list. But I can't continue, because I don't know the way.</p>
| <p>this is an old post but I thought I'd reply anyway.</p>
<p>The 'quick campaign' entity in CRM is called 'bulkoperation'. The Quick Campaign Wizard only creates activity records of other types, such as phone calls or tasks. The bulk operation is that which actually performs the action of distributing the campaign.... |
Com Object Exception <p>I wrote an application that loops through a set of records and prints two things. </p>
<p>One is a report from SSRS wich works correctly. </p>
<p>The other is a drawing that uses a COM object to print. The COM object randomly fails and causes the program to quit. </p>
<p>Is there a way to sto... | <p>Do you have the code of COM object that you are calling. If you have code then check whether there any exit command on failure. </p>
|
WCF Service Throttling <p>Lets assume that I'm dealing with a service that involves sending large amounts of data.</p>
<p>If I implement this with WCF, will WCF throttle the service based on how much memory each request takes to serve? Or will I be getting continuous out of memory exceptions each time I receive a larg... | <p>While using the binding attributes and readerQuotas like Andrew Hare suggests will allow for essentially an unlimited size for most practical uses, keep in mind that the you will run into other issues such as timeouts if you accept a long running command, no matter how that service is constructed (using WCF or not).... |
User variables - fighting syntax <p>Can anyone set my MySQL syntax straight please?
I am trying to set a user variable called "seconds" to equal the output of the query shown below (and it does work by it's self), but I am constantly geting "You have an error in your SQL syntax" errors.</p>
<pre><code>SET @seconds=AVG... | <p>If i remember correctly (and it works on MS SQL Server at work), this should do it:</p>
<pre><code>Select @seconds=AVG(t2.epoch-t1.epoch)
FROM tmp_4045_metrics AS t1, tmp_4045_metrics AS t2
WHERE t1.seq+1 = t2.seq
</code></pre>
|
Apache is listening on a different port, but how do I get it so I don't have to type in the port number? <p>I am running IIS and Apache HTTP Server side-by-side on my localhost machine, and Apache is listening on a different port (port 81). IIS is listening to port 80. However, I can only get to my virtual domains for ... | <p>It's not a matter of telling Apache, it's a matter of the browser knowing what to connect to. You're either going to have to have IIS redirect to Apache, or give up.</p>
|
ASP.NET - running a bat script on another machine <p>I would like to run a bat script on one of the machines on the domain, from my asp.net application. Machine with the batch script is a temporary storage machine, and script synchronizes it with the permanent storage machine. So, what is the optimal way of doing this?... | <p>You can use the <identity impersonate="true" /> setting in your Web.config to have the application run under the IUSR, or you can set a username/password on the identity tag to an account you'd like to use to run the BAT file.</p>
<p>I had previously found some details on Impersonate over at: <a href="http://... |
Calling WSE service from a .net 3.5 application <p>I am trying to call a .asmx (WSE) web service from a .net 3.5 application.</p>
<p>This is possible correct?
It seems when I add a web reference the API is completely different than when I add a reference in a .net 2.0 app.</p>
| <p>You can use the Add Web Reference button in the dialog displayed (Add service reference) to add a pre-3.0 style reference. </p>
<p>By default, when you add a service reference, VS will generate a class that uses WCF. It's not an issue but you might prefer to stick to the old style.</p>
<p>By the way, WCF is more f... |
Is the "_" prefix reserved for MovieClip names? <p>Is it possible to use the <strong>"_" underscore prefix</strong> for your own <strong>MovieClip names?</strong> (AS2)</p>
<p>i.e. Can you name a created/attached MovieClip "_feature" or "_bug" ?</p>
<p>Typically this is reserved for <strong>internal properties</stron... | <p>The "_" prefix has no technical significance - you can use it your own names for MovieClips, text fields, or any other variable or method you like.</p>
<p>As a convention, it used to be common for the names of "built in" properties (like <code>_x</code>, <code>_visible</code>, etc.) to begin with an underbar, but t... |
should i really use a relation table when tagging blog posts? <p>while trying to figure out how to tag a blog post with a single sql statement <a href="http://stackoverflow.com/questions/480065/nested-insert-in-mysql-for-tagging">here</a>, the following thought crossed my mind: using a relation table tag2post that refe... | <p>It works, but it is not normalized, because you have redundancy in the tags. You also lose the ability to use the "same" tags to tag things besides posts. For small N, optimization doesn't matter, so I have no problems if you run with it.</p>
<p>As a practical matter, your indexes will be larger (assuming you are... |
How do you convert LOGFONT.lfHeight to pixels? <p>I have a LOGFONT.lfHeight value of -11. However, I know that the font size is actually 8 so do I need to convert this number to a different unit of measurement? I found this formula in the MSDN docs:</p>
<p>int height = abs((pixels * DOTSY) / 72);</p>
<p>This takes pi... | <p>Yes. DOTSY will be 96, which is the default monitor resolution in DPI in Windows. You will need to ensure that this value is correct for the device you're writing to - printers will usually have a much higher resolution, and the monitor resolution can be changed. lfHeight is negative to indicate that the font mapper... |
Problem getting selected text when using a sprited button and selection.createRange() in Internet Explorer <p>I'm working on implementing sprited buttons in Stackoverflow's beloved WMD markdown editor and I've run into an odd bug. On all versions of IE, the selected text is lost upon button clicks, so, say, highlighti... | <p>I know what the answer to my own question is.</p>
<p>The sprited buttons are implemented using an HTML list and CSS, where all the list items have a background image. The background image is moved around using CSS to show different buttons and states (like mouseover highlights). Standard CSS button spriting stuff... |
Send message from one running console app to another <p>I have one console app that is doing some lengthy syncing to an ftp server.<br />
Another console app prepares a local filesystem with some needed updated files.<br />
Then the second one will wait for the first one to finish before swapping a final directory name... | <p>If all you need is to notify one application that the other has completed its task, the easiest way would be to use a named EventWaitHandle. The object is created in its unsignaled state. The first app waits on the handle, and the second app signals the handle when it's finished doing its job. For example:</p>
<... |
How to efficiently render and process video streams using GPU? <p>I plan to develop a tool for realtime video manipulation using C++, Qt and OpenGL. Video overlay isn't an option since shaders should be used for frame processing. At the moment I imagine a following sequence of steps:</p>
<ol>
<li>Decode video (CPU)</l... | <p>If you're linux, NVIDIA's recent drivers in the 180.xx series have added support for video decoding via the VDPAU api (Video Decoding and Presentation something). Many major projects have integrated with the api including mplayer, vlc, ffmpeg, and mythtv. I don't know all of the specifics, but they provide api for m... |
Is C# a superset of C? <p>Is C# a superset of C in anyway, like Objective-C or C++? Is there a way to compile C online with constructs such compiler flags?</p>
| <p>In a word, No.</p>
|
css inheritance <p>I've just added the Twitter script to my website, and cannot, despite inexpertly consulting firebug, determine how to alter the css to make the feed appear uniform with the other text on my page.</p>
<p>The page in question is
<a href="http://willworth.co.uk/latest.htm" rel="nofollow">http://willwo... | <p>You've applied your font styling etc to the <code><p></code> tag only.</p>
<p>The content of your twitter <code><div></code> contains no <code><p></code>, and doesn't descend from a <code><p></code>.</p>
<p>You need to change the markup to wrap with paragraph tags, or change the CSS to appl... |
What is the best way to sort a partially ordered list? <p>Probably best illustrated with a small example.<br />
Given the relations</p>
<pre><code>A < B < C
A < P < Q
</code></pre>
<p>Correct outputs would be</p>
<pre><code>ABCPQ or APQBC or APBCQ ... etc.
</code></pre>
<p>In other words, any ordering i... | <p>This is called <a href="http://en.wikipedia.org/wiki/Topological_sorting" rel="nofollow">topological sorting</a>.</p>
<p>The standard algorithm is to output a minimal element, then remove it and repeat until done.</p>
|
How do I set a field to null in Quest Toad "Browse Database Objects" view? <p>Simple question, would love a solution if there is one! I assume there has to be some keyboard shortcut that will insert a null but Google isn't helping.</p>
<p>Thanks in advance!</p>
| <p>I followed Brent's suggestion and got my answer: <kbd>ctrl</kbd>+<kbd>del</kbd>.</p>
|
How do I get a count of items in one column that match items in another column? <p>Assume I have two data tables and a linking table as such:</p>
<pre>
A B A_B_Link
----- ----- -----
ID ID A_ID
Name Name B_ID
</pre>
<p>2 Questions:</p>
<ol>
<li><p>I would l... | <p>For #1</p>
<pre><code>SELECT A.*,
(SELECT COUNT(*) FROM A_B_Link WHERE A_B_Link.A_ID = AOuter.A_ID)
FROM A as AOuter
</code></pre>
|
Code to calculate "median of five" in C# <p><strong>Note:</strong> Please don't interpret this as "homework question." This is just a thing I curious to know :)</p>
<p>The median of five is sometimes used as an exercise in algorithm design and is known to be computable <strong>using only 6 comparisons</strong>.</p>
<... | <p>I found this post interesting and as an exercise I created this which ONLY does 6 comparisons and NOTHING else:</p>
<pre><code>static double MedianOfFive(double a, double b, double c, double d, double e)
{
return b < a ? d < c ? b < d ? a < e ? a < d ? e < d ? e : d
... |
How to corretly load DataContext of Conditional Linq-to-SQL Stored Proc <p>I have a Stored Proc that do a validation on a parameter</p>
<p>ex.</p>
<pre><code>IF @SearchType = 'BNa'
BEGIN
... DO something
END
ELSE IF @SearchType = 'SNa'
BEGIN
... DO something
END
</code></pre>
<p>So by default the Stored Proc... | <p>I can't answer your question directly, but have you tried using SQL Profiler to work out how the designer retrieves the metadata for your stored procedure? </p>
<p>I'm thinking that in your situation it may not be possible for the designer to figure things out for you. SQL Profiler will let you figure this out for ... |
Stored procedure name tagging <p>Ever wonder what wikipedia's database schema looks like? I recently read this thread from <a href="http://www.reddit.com/r/programming/comments/7r3mg/ever_wonder_what_the_wikipedia_database_schema/" rel="nofollow">reddit</a>. </p>
<p>I like how their tables are tagged with a prefix so ... | <blockquote>
<p>I like how their tables are tagged with a prefix so you can sort of tell its functionality, purpose, and relationship with other tables right off the bat</p>
</blockquote>
<p>That is why you have Schemas in SQL Server, you create a schema to group several object together and then you can give the HR ... |
Limiting access to a WCF REST (webHttpBinding) Service using the ASP.NET Membership Provider? <p>I have found a lot of material on the web about using the ASP.NET Membership Provider with the wsHttpBindings, but I haven't seen any reference to using it with webHttpBindings.</p>
<p>I am looking for a system that will w... | <p>The best source I've found is here: <a href="http://www.leastprivilege.com/FinallyUsernamesOverTransportAuthenticationInWCF.aspx" rel="nofollow">http://www.leastprivilege.com/FinallyUsernamesOverTransportAuthenticationInWCF.aspx</a></p>
<p>The site also has tons of other information about setting up HTTP Modules to... |
How can I use Flex to access foreign-keyed fields in Django? <p>I have the following Django and Flex code:</p>
<p><strong>Django</strong></p>
<pre><code>class Author(models.Model):
name = models.CharField(max_length=30)
class Book(models.Model):
title = models.CharField(max_length=30)
author = models.ForeignKe... | <p>Ok, Here's an example...</p>
<p>Model: </p>
<pre><code>class Logger(models.Model):
lname = models.CharField(max_length=80)
def __unicode__(self):
return self.lname
#
#
class DataSource(models.Model):
dsname = models.CharField(max_length=80)
def __unicode__(self):
return self.d... |
Is BCrypt a good hashing algorithm to use in C#? Where can I find it? <p>I have read that when hashing a password, many programmers recommend using the BCrypt algorithm. </p>
<p>I am programming in C# and is wondering if anyone knows of a good implementation for BCrypt? I found <a href="http://derekslager.com/blog/pos... | <p>First, some terms that are important:</p>
<p><strong><a href="http://en.wikipedia.org/wiki/Cryptographic_hash_function">Hashing</a></strong> - The act of taking a string and producing a sequence of characters that cannot be reverted to the original string.</p>
<p><strong><a href="http://en.wikipedia.org/wiki/Symme... |
Why are request cookie poperties null or incorrect on ASP.NET postback? <p>I'm debugging the HttpContext.Current.Request.Cookie values in an ASP.NET web application, and finding the only property correctly populated is the Value. The Domain and Path are null, and the Expires value is set to DateTime.Min.</p>
| <p>Those values are not available in the Request.Cookies collecton. They are only used when you are "setting" the value. You can verify this with a network trace. In the request headers, the client browser only sends the name/value pairs in the "Cookie" header.</p>
|
Best way for users to import to a database? <p>I know this isn't a unique issue but I've not had much luck finding examples of how others have addressed this issue. I have an intranet asp.net application I have inherited and am building upon. One particular page is for data entry to submit a claim for approval and we h... | <p>Uncontrolled spreadsheet import processes are a bad thing. There are too many things that users can do to break the process. If you're going to bulk load from spreadsheets, the process should consist of the following components:</p>
<ul>
<li><p>A controlled template file,
downloaded by the user and generated
from... |
Cell Format Strings for Reporting Services/Dundas Charts <p>Reporting services use format strings to auto format cell data. For example "c2" formats a cell to be displayed as currency with a decimal precision of 2.</p>
<p>Does anyone know where I'd find a comprehensive list off all the different formats available?</p... | <p>Reporting Services uses the .Net formatting strings. So you can look them up on MSDN. Here is a link to the <a href="http://msdn.microsoft.com/en-us/library/dwhawy9k(VS.95).aspx" rel="nofollow">standard codes</a> and here is the reference for creating <a href="http://msdn.microsoft.com/en-us/library/0c899ak8(VS.95... |
Windows Service or Task Scheduler for maintenance tasks? <p>I have a C# Application that does some maintenance tasks. It needs to run roughly every hour, although it's not too important if it's a bit off. And it has to run on a Win2003 Server with no one logged in.</p>
<p>Basically I wonder if I should write a Windows... | <p>You may find this <a href="http://channel9.msdn.com/shows/Going+Deep/Chittur-Subbaraman-Inside-Windows-7-Service-Controller-and-Background-Processing/" rel="nofollow" title="Service Controller">video</a> interesting . Good interview with the engineer responsible for windows services and also goes into when to pick s... |
How to add a file selector/opener in cocoa with Interface Builder? <p>I'm wondering how to make a button or input field in Interface Builder react in such a way that on click it opens a file dialog and lets you select one or more files and puts them into a specified array/table...</p>
<p>Once the button is pushed and ... | <p>This must be done in Xcode. The code <a href="http://ekle.us/index.php/2006/12/displaying_a_file_open_dialog_in_cocoa_w">here</a> should work fine.</p>
<p>Just hook the button up with a method using IB and use that example as a guide of what to put in the method.</p>
<p>There's also all sorts of good help WRT NSOp... |
Setting up multiple development environments'm <p>I'm a solo developer working on a typical web project (Django + PostgresSQL) using Eclipse as my IDE and Subversion for source control. So far I've been working on a single development machine that I have setup myself. Recently, I've been asked to do some work at the cu... | <p>I'd say option number 1 is still the best. I'd assume you only have one computer at home and you can work off of that one, so the setup should hopefully just be a one time thing.</p>
<p>You're right though, the setup time is quite tedious, however it does in fact make up for the slow UI of using something like VNC ... |
What's the maximum number of threads in Windows Server 2003? <p>Does anyone know? And a bigger question is what happens when you encounter this maximum? Is this the same number with other Windows OSs such as Vista, XP etc.?</p>
| <p>First I would advise reading this:
<a href="http://blogs.msdn.com/oldnewthing/archive/2007/03/01/1775759.aspx">http://blogs.msdn.com/oldnewthing/archive/2007/03/01/1775759.aspx</a></p>
<p>then <a href="http://blogs.msdn.com/oldnewthing/archive/2005/07/29/444912.aspx">http://blogs.msdn.com/oldnewthing/archive/2005/0... |
How many threads is too many? <p>I am writing a server, and I branch each action of into a thread when the request is incoming. I do this because almost every request makes database query. I am using a threadpool library to cut down on construction/destruction of threads.</p>
<p>My question is though - what is a good ... | <p>Some people would say that <em>two</em> threads is too many - I'm not quite in that camp :-)</p>
<p>Here's my advice: <em>measure, don't guess.</em> One suggestion is to make it configurable and initially set it to 100, then release your software to the wild and monitor what happens.</p>
<p>If your thread usage pe... |
How make scrolling function with Interface builder on the iPhone? <p>I wonder how is possible to make a view scroll, like in a table view.</p>
<p>I have a form that have several fields on it. I don't wanna buil it as a traditional table that drill-down.</p>
<p>Is not very large but because the main windows is a tab-b... | <p>Select the main form view in Interface Builder and choose Layout > Embed Objects in > Scroll View from the menu. You may have to adjust some connections to make everything work.</p>
|
Castle ActiveRecord, Web Project, and the Bin folder <p>Which assemblies are necessary to add to the Bin folder for ASP.NET 3.5 project that is going to use Castle ActiveRecord? </p>
<p>Is it:<br />
Castle.ActiveRecord.dll<br />
Castle.Core.dll<br />
Iesi.Collections.dll<br />
NHibernate.dll<br />
log4net.dll </p>
... | <p>For Castle RC3, you're missing Castle.DynamicProxy.dll and Castle.Components.Validator.dll</p>
|
How to build a kind of firewall <p>Actually what i am trying to build is like a kind of firewall. It should be able to get to know all the requests going from my machine. It should be able to stop selected ones. I am not sure how to even start about with this. I am having VS 2008/2005 with framework 2.0. Please let me ... | <p>Firewalls really should be implemented fairly low in the networking stack; I'd strongly suggest NDIS. <a href="http://www.codeproject.com/KB/IP/drvfltip.aspx" rel="nofollow">This article</a> may be of interest.</p>
|
is there some dojo.fx.sleep function to use within a dojo.fx.chain animation? <p>I would like to <code>fadeIn</code> a node over one second. Then leave it on for 10 seconds. Then <code>fadeOut</code> for another 3 seconds. One way of chaining this would be as follows:</p>
<pre><code>dojo.fx.chain([
dojo.fadeIn({... | <p>Positive there isn't at this point in time; the only way to achieve the effect is to split your code into pre-sleep and post-sleep sections, which you've pretty much done here. The only thing I'd recommend is having Dojo do as little as possible during the 1o,ooo-millisecond duration; as you have it now, the <strong... |
How to add a TabBar to NavigationController based iPhone app <p>I have a simple NavigationController based app. The main window shows a TableView and selecting an item loads a sub-view. I used Interface Builder for UI views.</p>
<p>Now I want to add a TabBar to the app. Where do I put it? Do I need a TabBarController?... | <p>The <em>definitive</em> answer to this question is presented in the iPhone SDK documentation in the <em>View Controller Programming Guide for iPhone</em>.</p>
<p><a href="http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/CombiningViewControllers/CombiningViewControllers.html#//a... |
How can I send a NULL in Ruby Sockets? <p>I'm working on a socket app in Ruby Shoes, and want to send a message to the server. The server expects the XML message, and then a null (0) character.</p>
<p>How can I send that in TCP Sockets in Ruby?</p>
<p>Thanks.</p>
| <p>I found my own answer... The problem was not sending the NULL, it was a thread issue.</p>
<p>You can send a NULL as part of a string by just concatenating it on to the end of the string...</p>
<p>NULL = "\000"</p>
<p>...
tc = tc + "</endtag>"</p>
<p>tc = tc + NULL</p>
<p>Socket.send(tc, 0)</p>
|
preg_match works in regexbuddy, not in php <p>Ok so I have this regex that I created and it works fine in RegexBuddy but not when I load it into php. Below is an example of it.</p>
<p>Using RegexBuddy I can get it to works with this:</p>
<pre><code>\[code\](.*)\[/code\]
</code></pre>
<p>And checking the dot matches ... | <p>You're including the forward slash in the middle of your pattern (/code). Either escape it or delimit your pattern with something else (I prefer !).</p>
|
PhysX NxActor Question <p>As far as I know, using the PhysX API, the only way to obtain an NxActor is from an instance of NxScene using the createActor method. This is really bugging me. I want to keep my code clean, but I feel like there is no choice but to go around passing this scene from constructor to constructo... | <p>If you don't want you're objects directly coupled with the Actors I would suggest a different approach. You could come up with a way of registering an object to have physics update it. Then the module that those objects registered with would assign each object to an Actor that would be use to set the information o... |
How to customize wordpress "comment error" page <p>If you enter incorrect information into the comment forms (missing name, email etc), wordpress returns an empty page with the relevant error message. I googled, but couldn't find a way to customize this response.</p>
<p>Does anyone know how to do it?</p>
| <p>For this particular problem, I ended up modifying \wp-comments-post.php directly - the theme engine doesn't allow you to customize it.</p>
<p>The short description of what I did is to bypass the usage of "wp_die()" and instead have the script execute "my_wp_die()" in scenarios when the blog comment post does not va... |
TFS: Hundreds of separate applications/projects - what's the best approach? <p>Let's say that the company has a large number of separate small to medium applications which can be logically divided into a small number of groups.</p>
<p>For example, I can have BMW, Mazda, Honda, Ford .... , Kawasaki, Harley, .... altoge... | <p>I would go with point 2. You can use the 'Areas' section of TFS to assign work items to a particular sub-project. </p>
<p>There is way too much overhead in creating full Team Projects for all those small apps. Does each of those apps need a completely independent life cycle, collaboration tool (WSS site) and set of... |
iPhone development - memory release issue <p>I am running into this issue of releasing an already released object but can't for the life of me find out where the error is taking place. I have added NSZombieEnabled flag and this is the log I get in gdb. Can someone please tell me how to go about resolving this issue or ... | <p>The autorelease pool is trying to release an object which already released. </p>
<p>This can happen if you manually release an object registered for autorelease</p>
<pre><code>NSString* foo = [NSString stringWithFormat:@"foo:%d",42];
[foo release]; /* this release is bad, as this object is already
registered f... |
How do I convert a string to a double in Python? <p>I would like to know how to convert a string containing digits to a double.</p>
| <pre><code>>>> x = "2342.34"
>>> float(x)
2342.3400000000001
</code></pre>
<p>There you go. Use float (which is almost always a C double).</p>
|
HttpWebRequest not returning response stream when cache hit, and AllowAutoRedirect == false <p>I have an HttpWebRequest that I've set the CachePolicy to CacheIfAvailable, and I've set AllowAutoRedirect to false.
Now when there is a cache hit, the HttpWebResponse.Status == NotModified, and there is no response stream. ... | <p>It turns out that the problem is that I was setting HttpWebRequest.IfModifiedSince (to itself). Yes, the getter for that property is set to always return DateTime.Now, until it is explicitly set. So:
request.IfModifiedSince = request.IfModifiedSince;
is not a safe no-op. It actually sets a flag saying to actually... |
Generate a C# delegate method stub <p>Anyone know how to automatically create a delegate stub method?</p>
<p>In WPF it seems im constantly having to pass delegates around. i would like to be able to type a method name that doesnt exist and have a method stub automatically generated...currently i'am having to constantl... | <p>Use an IDE plugin like Refactor Pro! It also allows you to convert your delegates to instance methods, or if its a one-liner, into a lambda. I tend to start typing using a lambda and then hovering my cursor over the parms gives you the types available.</p>
<p>Or. Wait till Visual Studio 10 which would have this all... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.