input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
SQL Server best way to calculate datediff between current row and next row? <p>I've got the following rough structure:</p>
<pre><code>Object -> Object Revisions -> Data
</code></pre>
<p>The Data can be shared between several Objects.</p>
<p>What I'm trying to do is clean out old Object Revisions. I want to kee... | <p>Here is example SQL. If you have an Identity column, you can use this instead of "ActivityDate".</p>
<pre><code>SELECT DATEDIFF(HOUR, prev.ActivityDate, curr.ActivityDate)
FROM MyTable curr
JOIN MyTable prev
ON prev.ObjectID = curr.ObjectID
WHERE prev.ActivityDate =
(SELECT MAX(maxtbl.ActivityDate)
... |
How do I find and decouple entities from a certificate when upgrading MS-SQLServer editions? <p>While in the final throws of upgrading MS-SQL Server 2005 Express Edition to MS-SQL Server 2005 Enterprise Edition, I came across this error:</p>
<blockquote>
<p>The certificate cannot be dropped because one or more entit... | <p>The Microsoft forum has the following code snipit to delete the certificates:</p>
<pre><code>use msdb
BEGIN TRANSACTION
declare @sp sysname
declare @exec_str nvarchar(1024)
declare ms_crs_sps cursor global for select object_name(crypts.major_id) from sys.crypt_properties crypts, sys.certificates certs where ... |
Are off-the-cloud desktop applications dead? <p>Although somewhat related to <a href="http://stackoverflow.com/questions/4409/is-the-desktop-app-dead" rel="nofollow">this question</a>, I have what I think is a different take on it.</p>
<p>Is a desktop app that has no connections to the "cloud" dead? I believe that som... | <p>10 years or more ago this would have been, "Are non-internet applications dead?"</p>
<p>There's things the cloud does better than desktop applications, and in those places I'm sure non-cloud applications will become increasingly rare. But there's plenty of applications where you might not want to use the cloud, th... |
What does the comma operator , do in C? <p>What does the <code>,</code> operator do in C?</p>
| <p>The expression:</p>
<pre><code>(expression1, expression2)
</code></pre>
<p>First expression1 is evaluated, then expression2 is evaluated, and the value of expression2 is returned for the whole expression.</p>
|
What does the PDB get me while debugging and how do I know it's working? <p>I have to use a third-party component without source code. I have the release DLL and release PDB file. Let's call it 'CorporateComponent.dll'. My own code creates objects from this DLL and calls methods on these objects.</p>
<pre><code>CorpOb... | <p>To confirm if you're using the provided PDB, CorporateComponent.pdb, during debugging within the Visual Studio IDE review the output window and locate the line indicating that the CorporateComponent.dll is loaded and followed by the string <code>Symbols loaded</code>.</p>
<p>To illustrate from a project of mine:</p... |
Perform token replacements using VS post-build event command? <p>I would like to "post-process" my app.config file and perform some token replacements after the project builds.</p>
<p>Is there an <em>easy</em> way to do this using a <a href="http://msdn.microsoft.com/en-us/library/42x5kfw4(VS.80).aspx" rel="nofollow">... | <p>Take a look at <a href="http://xmlpreprocess.sourceforge.net/" rel="nofollow">XmlPreProcess</a>. We use it for producing different config files for our testing and live deployment packages.
We execute it from a nant script as part of a continuous build but, since it's a console app, I see no reason why you coudn't ... |
Inform potential clients about security vulnerabilities? <p>We have a lot of open discussions with potential clients, and they ask frequently about our level of technical expertise, including the scope of work for our current projects. The first thing I do in order to gauge the level of expertise on staff they have now... | <p>I would say that surprising people by suddenly penetration-testing their software may bother people if simply for the fact that they didn't know ahead of time. I would say if you're going to do this (and I believe it's a good thing to do), inform your clients ahead of time that you're going to do this. If they seem ... |
Google Reader API Unread Count <p>Does Google Reader have an API and if so, how can I get the count of the number of unread posts for a specific user knowing their username and password?</p>
| <p>This URL will give you a count of unread posts per feed. You can then iterate over the feeds and sum up the counts.</p>
<p><a href="http://www.google.com/reader/api/0/unread-count?all=true">http://www.google.com/reader/api/0/unread-count?all=true</a></p>
<p>Here is a minimalist example in Python...parsing the xml... |
How to make git ignore changes in case? <p>I'm not too sure what is going on here, but sometimes a particular file in my repository will change the case of it's name. e.g.,:</p>
<p>before: <code>File.h</code></p>
<p>after: <code>file.h</code></p>
<p>I don't really care why this is happening, but this causes git to t... | <p>Since version 1.5.6 there is an <code>ignorecase</code> option available in the <code>[core]</code> section of <code>.git/config</code></p>
<p>e.g. add <code>ignorecase = true</code></p>
<p>To change it for just one repo, from that folder run:</p>
<pre><code>git config core.ignorecase true
</code></pre>
<p>To ch... |
Examples for coding against the PayPal API in .NET 2.0+? <p>Can anyone point me to a good introduction to coding against the paypal API?</p>
| <p>Found this article by Rick Strahl recently <a href="http://www.west-wind.com/presentations/PayPalIntegration/PayPalIntegration.asp">http://www.west-wind.com/presentations/PayPalIntegration/PayPalIntegration.asp</a>. </p>
<p>Have not implemeted anything from it yet, Rick has quite a few articles around the web on e... |
Is there an ASP.NET pagination control (Not MVC)? <p>I've got a search results page that basically consists of a repeater with content in it. What I need is a way to paginate the results. Getting paginated results isn't the problem, what I'm after is a web control that will display a list of the available paged data,... | <p>Repeaters don't do this by default.</p>
<p>However, GridViews do.</p>
<p>Personally, I hate GridViews, so I wrote a Paging/Sorting Repeater control.</p>
<p>Basic Steps:</p>
<ul>
<li>Subclass the Repeater Control</li>
<li>Add a private PagedDataSource to it</li>
<li>Add a public PageSize property</li>
<li>Overrid... |
Retaining HTTP POST data when a request is interrupted by a login page <p>Say a user is browsing a website, and then performs some action which changes the database (let's say they add a comment). When the request to actually add the comment comes in, however, we find we need to force them to login before they can cont... | <p>This is one good place where Ajax techniques might be helpful. When the user clicks the submit button, show the login dialog on client side and validate with the server before you actually submit the page.</p>
<p>Another way I can think of is showing or hiding the login controls in a DIV tag dynamically in the main... |
How could I get my SVN-only host to pull from a git repository? <p>I'd really like to get our host to pull from our Git repository instead of uploading files manually, but it doesn't have Git installed.</p>
<p>So is there a way to trick Subversion (which they do have) into checking out a Git repository?</p>
<p>I thin... | <p>This page should provide a workaround for your problem. </p>
<p><a href="http://code.google.com/p/support/wiki/ImportingFromGit" rel="nofollow">http://code.google.com/p/support/wiki/ImportingFromGit</a></p>
<p>Basically, you create a read-only clone of your Git repository in the SVN repository format, exporting up... |
Where are people getting that rotaty loading image? <p>I keep running across this loading image</p>
<p><a href="http://georgia.ubuntuforums.com/images/misc/lightbox_progress.gif" rel="nofollow">http://georgia.ubuntuforums.com/images/misc/lightbox_progress.gif</a></p>
<p>which seems to have entered into existence in t... | <p>You can get many different AJAX loading animations in any colour you want here: <a href="http://www.ajaxload.info/">ajaxload.info</a></p>
|
When building a Handler, should it be .ashx or .axd? <p>Say I'm building an ASP.Net class that inherits from IHttpHandler, should I wire this up to a URL ending in .ashx, or should I use the .axd extension? </p>
<p>Does it matter as long as there's no naming conflict?</p>
| <p>Ahh.. ScottGu says it doesn't matter, but .ashx is slightly better because there's less chance of a conflict with things like trace.axd and others. That's why the flag went up in my head that .ashx might be better.</p>
<p><a href="http://forums.asp.net/t/964074.aspx" rel="nofollow">http://forums.asp.net/t/964074.as... |
Fuzzy text (sentences/titles) matching in C# <p>Hey, I'm using <a href="http://en.wikipedia.org/wiki/Levenshtein_distance">Levenshteins</a> algorithm to get distance between source and target string.</p>
<p>also I have method which returns value from 0 to 1:</p>
<pre><code>/// <summary>
/// Gets the similarity ... | <p>Kind of old, but It might be useful to future visitors. If you're already using the Levenshtein algorithm and you need to go a little better, I describe some very effective heuristics in this solution:</p>
<p><a href="http://stackoverflow.com/questions/5859561/getting-the-closest-string-match/5859823#5859823">Getti... |
How to properly link your a custom css file in sharepoint <p>I've created a custom list, and made some changes to the way the CQWP renders it on a page by modifying ItemStyle.xsl. However, I'd like to use some custom css classes and therefore I'd like to link to my own custom .css file from the head tag of the pages co... | <p>The microsoft official way is just to copy them into the relevant folders (as seen by downloading their template packs). However, you could also create your own site definition and add the items to the correct libraries and lists in the same way that the master pages are added.</p>
<p>If you are going to deploy CS... |
How to efficiently SQL select newest entries from a MySQL database? <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/49404/sql-query-to-get-latest-price">SQL Query to get latest price</a> </p>
</blockquote>
<p>I have a database containing stock price history. ... | <p>See <a href="http://stackoverflow.com/questions/49404/sql-query-to-get-latest-price" rel="nofollow">similar post</a></p>
|
Why does windows XP minimize my swing full screen window on my second screen? <p>In the application I'm developping (in Java/swing), I have to show a full screen window on the <em>second</em> screen of the user.
I did this using a code similar to the one you'll find below...
Be, as soon as I click in a window opened by... | <p>Usually when an application is in "full screen" mode it will take over the entire desktop. For a user to get to another window they would have to alt-tab to it. At that point windows would minimize the full screen app so that the other application could come to the front. </p>
<p>This sounds like it may be a bug ... |
Returning an element from a List in Scala <p>I've recently been working on a beginner's project in Scala, and have a beginner question about Scala's Lists.</p>
<p>Say I have a list of tuples ( <code>List[Tuple2[String, String]]</code>, for example). Is there a convenience method to return the first occurence of a spec... | <pre>
scala> val list = List(("A", "B", 1), ("C", "D", 1), ("E", "F", 1), ("C", "D", 2), ("G", "H", 1))
list: List[(java.lang.String, java.lang.String, Int)] = List((A,B,1), (C,D,1), (E,F,1), (C,D,2), (G,H,1))
scala> list find {e => e._1 == "C" && e._2 == "D"}
res0: Option[(java.lang.String, java.lang.String, Int)] = ... |
How do you get the logged in Windows domain account from an ASP.NET application? <p>We have an ASP.NET application that manages it's own User, Roles and Permission database and we have recently added a field to the User table to hold the Windows domain account. </p>
<p>I would like to make it so that the user doesn't... | <pre><code>using System.Security.Principal;
...
WindowsPrincipal wp = (WindowsPrincipal)HttpContext.Current.User;
</code></pre>
<p>to get the current domain user. Of course you have to make sure that the IIS is set up to handle Windows Authentication.</p>
|
Encrypting appSettings in web.config <p>I am developing a web app which requires a username and password to be stored in the web.Config, it also refers to some URLs which will be requested by the web app itself and never the client.</p>
<p>I know the .Net framework will not allow a web.config file to be served, howeve... | <ul>
<li><a href="http://msdn.microsoft.com/en-us/library/zhhddkxy.aspx">Encrypting and Decrypting Configuration Sections</a> (ASP.NET) on MSDN</li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2006/01/09/434893.aspx">Encrypting Web.Config Values in ASP.NET 2.0</a> on ScottGu's <a href="http://weblogs.asp.net/sc... |
CakePHP ACL Database Setup: ARO / ACO structure? <p>I'm struggling to implement ACL in CakePHP. After reading the documentation in the <a href="http://manual.cakephp.org/view/171/Access-Control-Lists">cake manual</a> as well as several other tutorials, blog posts etc, I found Aran Johnson's excellent tutorial which ha... | <p>CakePHP's built-in ACL system is really powerful, but poorly documented in terms of actual implementation details. A system that we've used with some success in a number of CakePHP-based projects is as follows.</p>
<p>It's a modification of some group-level access systems that have been <a href="http://realm3.com/a... |
Problem rolling out ADO.Net Data Service application to IIS <p>I am adding a ADO.Net Data Service lookup feature to an existing web page. Everything works great when running from visual studio, but when I roll it out to IIS, I get the following error:</p>
<blockquote>
<p><strong>Request Error</strong><br>The server... | <p>In order to verbosely display the errors resulting from your data service you can place the following tag above your dataservice definition:</p>
<pre><code>[System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)]
</code></pre>
<p>This will then display the error in your browser window as well a... |
Adding Items Using DataBinding from TreeView to ListBox WPF <p>I want to add the selected item from the <code>TreeView</code> to the <code>ListBox</code> control using <code>DataBinding</code> (If it can work with <code>DataBinding</code>). </p>
<pre><code><TreeView HorizontalAlignment="Left"
Margin="30,... | <p>You can bind to an element using ElementName, so if you wanted to bind the selected tree item to the ItemsSource of a ListBox:</p>
<pre><code>ItemsSource="{Binding SelectedItem, ElementName=treeView1}"
</code></pre>
|
Storing Images in PostgreSQL <p>Alright, so I'm working on an application which will use a Linux back-end running PostgreSQL to serve up images to a Windows box with the front end written in C#.NET, though the front-end should hardly matter. My question is:</p>
<ul>
<li><strong>What is the best way to deal with stori... | <p>Re jcoby's answer:</p>
<p>bytea being a "normal" column also means the value being read completely into memory when you fetch it. Blobs, in contrast, you can stream into stdout. That helps in reducing the server memory footprint. Especially, when you store 4-6 MPix images.</p>
<p>No problem with backing up blobs. ... |
Unfiltering NSPasteboard <p>Is there a way to unfilter an NSPasteboard for what the source application specifically declared it would provide?</p>
<p>I'm attempting to serialize pasteboard data in my application. When another application places an RTF file on a pasteboard and then I ask for the available types, I get... | <p><code>-[NSPasteboard types]</code> will return all the available types for the data on the clipboard, but it should return them <a href="http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSPasteboard_Class/Reference/Reference.html#//apple_ref/occ/instm/NSPasteboard/types" rel="nofollow"... |
ClickOnce Deployment, system update required Microsoft.mshtml <p>We have an application that works with MS Office and uses Microsoft.mshtml.dll. We use ClickOnce to deploy the application. The application deploys without issues on most machines, but sometimes we get errors saying "System Update Required, Microsoft.msht... | <p>Do you know which version of MS Office you are targeting? These PIAs are very specific to the version of Office. I remember when we were building a smart client application, we used to have Build VM machines, each one targeting a specific version of Outlook.</p>
<p>Another hurdle was not being able to specify these... |
Is it possible to build MSBuild files (visual studio sln) from the command line in Mono? <p>Is it possible to build Visual Studio solutions without having to fire up MonoDevelop?</p>
| <p>Current status (Mono 2.10, 2011): xbuild is now able to build all versions of Visual Studio / MSBuild projects, including .sln files. Simply run <code>xbuild</code> just as you would execute <code>msbuild</code> on Microsoft .Net Framework. You don't need Monodevelop installed, xbuild comes with the standard Mono in... |
How do prepared statements work? <p>I'm writing some DB routines and I'm using prepared statements. My environment is PDO with PHP5.</p>
<p>I understand prepared statements primarily provide a performance benefit, as well as some auxiliary bonuses such as not having to manually SQL-escape input data.</p>
<p>My quest... | <p>From what I understand, prepared statements will reuse the generated SQL plan if it is the same statement, so the database will see the same prepared statement and not have to do the work to figure out how to query the database. I would say the extra work of saving the prepared statement in <code>Product::getPrice_A... |
What's a clean/simple way to ensure the security of a page? <p>Supposing you have a form that collects and submits sensitive information and you want to ensure it is never accessed via insecure (non-HTTPS) means, how might you best go about enforcing that policy?</p>
| <p>If you're running Apache, you can put a <code>RewriteRule</code> in your <code>.htaccess</code>, like so:</p>
<pre><code>RewriteCond %{HTTPS} "off"
RewriteRule /mypage.html https://example.com/mypage.html
</code></pre>
|
Php function argument error suppression, empty() isset() emulation <p>I'm pretty sure the answer to this question is no, but in case there's some PHP guru</p>
<p>is it possible to write a function in a way where invalid arguments or non existent variables can be passed in and php will not error without the use of <cod... | <p>Summing up, the proper answer is <strong>no, you shouldn't</strong> (see caveat below). </p>
<p>There are workarounds already mentioned by many people in this thread, like using reference variables or isset() or empty() in conditions and suppressing notices in PHP configuration. That in addition to the obvious work... |
NullReferenceException on instanciated object? <p>This is a segment of code from an app I've inherited, a user got a Yellow screen of death:</p>
<blockquote>
<p>Object reference not set to an instance of an object</p>
</blockquote>
<p>on the line: </p>
<pre><code>bool l_Success ...
</code></pre>
<p>Now I'm 95% s... | <p>You sure that one of the properties trying to be accessed on the l_Monitor instance isn't null?</p>
|
Database engines Comparison - Windows Mobile <p>What are the different database options on Windows Mobile available?
I have used CEDB and EDB for linear dataset needs.</p>
<p>I have heard of SQL server 2005 Mobile edition. But what are the advantages over others (if there is any)</p>
| <p>Also take a look at <a href="http://sqlite-wince.sourceforge.net/" rel="nofollow">SQLite for Windows CE</a>. There are also .NET bindings available to use it from the Compact Framework.</p>
|
In Python, how can you easily retrieve sorted items from a dictionary? <p>Dictionaries unlike lists are not ordered (and do not have the 'sort' attribute). Therefore, you can not rely on getting the items in the same order when first added. </p>
<p>What is the easiest way to loop through a dictionary containing string... | <p>Do you mean that you need the values sorted by the value of the key?
In that case, this should do it:</p>
<pre><code>for key in sorted(d):
print d[key]
</code></pre>
<p><strong>EDIT:</strong> changed to use sorted(d) instead of sorted(d.keys()), thanks <a href="http://stackoverflow.com/users/1694/eli-courtwrig... |
Algorithm to generate anagrams <p>What would be the best strategy to generate anagrams.</p>
<blockquote>
<pre><code>An anagram is a type of word play, the result of rearranging the letters
of a word or phrase to produce a new word or phrase, using all the original
letters exactly once;
ex.
</code></pre>
<ul>
... | <p>Most of these answers are horribly inefficient and/or will only give one-word solutions (no spaces). My solution will handle any number of words and is very efficient.</p>
<p>What you want is a trie data structure. Here's a <strong>complete</strong> Python implementation. You just need a word list saved in a fil... |
Refresh all update panels on the page? <p>I have some code that modifies a value that several controls in other update panels are bound to. When this event handler fires, I'd like it to force the other update panels to refresh as well, so they can rebind.</p>
<p>Is this possible?</p>
<p>Edit: </p>
<p>To clarify, I h... | <p>What about registering a PostBackTrigger (instead of an AsyncPostBackTrigger) that will refresh every panel when a specific event fires. </p>
<p>Or add the trigger that already refreshes some UpdatePanels to the other UpdatePanels as well.</p>
|
How do I maintain position of a DragPanelExtender across postbacks? <p>I already found this article:</p>
<p><a href="http://www.dotnetcurry.com/ShowArticle.aspx?ID=181&AspxAutoDetectCookieSupport=1" rel="nofollow">http://www.dotnetcurry.com/ShowArticle.aspx?ID=181&AspxAutoDetectCookieSupport=1</a></p>
<p>But ... | <p>Rather than storing the position information in a hidden field, store it in a cookie. The information is small, so it will have minimal effect on the page load performance.</p>
|
Bespoke SQL Server 'encoding' sproc - is there a neater way of doing this? <p>I'm just wondering if there's a better way of doing this in SQL Server 2005.</p>
<p>Effectively, I'm taking an originator_id (a number between 0 and 99) and a 'next_element' (it's really just a sequential counter between 1 and 999,999).
We a... | <p>Seeing as it's SQL Server 2005, any reason not to use a CLR stored procedure? You could use your CLR language of choice then and it'd probably be a relatively direct port of your existing Delphi code.</p>
|
"Background" task in palm OS <p>I'm trying to create a Palm OS app to check a web site every X minutes or hours, and provide a notification when a piece of data is available. I know that this kind of thing can be done on the new Palm's - for example, my Centro can have email or web sites download when the application ... | <p>This is possible to do but very difficult. There are several steps you'll have to take.</p>
<p>First off, this only works on Palm OS 5 and is sketchy on some of the early Palm OS 5 devices. The latest devices are better but not perfect.</p>
<p>Next, you will need to create an alarm for your application using Alm... |
__doPostBack is not working in firefox <p>The __doPostBack is not working in firefox 3 (have not checked 2). Everything is working great in IE 6&7 and it even works in Chrome??</p>
<p>It's a simple asp:LinkButton with an OnClick event</p>
<pre><code><asp:LinkButton ID="DeleteAllPicturesLinkButton" Enabled="Fa... | <p>Check your User Agent string. This same thing happened to me one time and I realized it was because I was testing out some pages as "googlebot". The JavaScript that is generated depends on knowing what the user agent is.</p>
<p>From <a href="http://support.mozilla.com/tiki-view_forum_thread.php?locale=tr&commen... |
Checking Inheritance with templates in C++ <p>I've a class which is a wrapper class(serves as a common interface) around another class implementing the functionality required. So my code looks like this.</p>
<pre><code>template<typename ImplemenationClass> class WrapperClass {
// the code goes here
}
</code></pr... | <p>It's verbose, but you can do it like this:</p>
<pre><code>#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_base_of.hpp>
struct base {};
template <typename ImplementationClass, class Enable = void>
class WrapperClass;
template <typename ImplementationClass>
class Wrapp... |
What is the possible mimetype hierachy of an email message? <p>I'm working with a snippet of code that recursively calls itself and tries to pull out a MIME Type part of <code>text/html</code> from an email (if it exists) for further processing.</p>
<p>The "text/html" could exist inside other content such as <code>mul... | <p>Your question assumes that mail clients follow the RFC standards for MIME encoding, which they don't. I'd advise you collect a bunch of mail from sources and try and process it as-it-exists. The problem you are facing is extremely difficult (perhaps impossible) to solve 100%.</p>
|
When do function-level static variables get allocated/initialized? <p>I'm quite confident that globally declared variables get allocated (and initialized, if applicable) at program start time.</p>
<pre><code>int globalgarbage;
unsigned int anumber = 42;
</code></pre>
<p>But what about static ones defined within a fun... | <p>I was curious about this so I wrote the following test program and compiled it with g++ version 4.1.2.</p>
<pre><code>include <iostream>
#include <string>
using namespace std;
class test
{
public:
test(const char *name)
: _name(name)
{
cout << _nam... |
Service that provides DVD Covers art? <p>Are there any services that allow you to retrieve DVD cover information? I'm working on a small WPF application where this functionality would be handy. If a user inserts a DVD or types a title in, it'll automatically grab the cover art for that DVD.</p>
<p>Thanks.</p>
| <p>Not sure if they have an API, but you should check out <a href="http://albumart.org" rel="nofollow">http://albumart.org</a>. Also check out <a href="http://www.freecovers.net/api" rel="nofollow">http://www.freecovers.net/api</a>, a similar service.</p>
|
Find out where your PHP code is slowing down (Performance Issue) <p>Here's my first question at SO.</p>
<p>I have a internal application for my company which I've been recently ask to maintain. The applications is built in PHP and its fairly well coded (OO, DB Abstraction, Smarty) nothing WTF-ish. </p>
<p>The problem... | <p>I've used <a href="http://www.xdebug.org/docs/profiler">XDebug profiling</a> recently in a similiar situation. It outputs a full profile report that can be read with many common profiling apps ( Can't give you a list though, I just used the one that came with slackware ). </p>
|
Why can't I delete this cookie? <p>Okay, here is the 411 - I have the following event handler in my Global.asax.cs file:</p>
<pre><code>private void Global_PostRequestHandlerExecute(object sender, EventArgs e)
{
if (/* logic that determines that this is an ajax call */)
{
// we want to set a cookie
R... | <p>you have to delete your cookie at the same path where you created it.
so create your cookie with path=/ and delte it with path=/ as well..</p>
|
DELETE Statement hangs on SQL Server for no apparent reason <p><strong>Edit</strong>: Solved, there was a trigger with a loop on the table (read my own answer further below).</p>
<p><hr /></p>
<p>We have a simple delete statement that looks like this:</p>
<pre><code>DELETE FROM tablename WHERE pk = 12345
</code></pr... | <p>One piece of information missing is the number of indices on the table you are deleting the data from. As SQL Server uses the Primary Key as a pointer in every index, any change to the primary index requires updating every index. Though, unless we are talking a high number, this shouldn't be an issue.</p>
<p>I am g... |
Subversion merge history visualisation <p>Are there any utilities out there which can draw pictures of the merge history of a subversion repo - we always commit merges with a (fairly) consistent log message, and it would be handy to be able to automatically extract this info into a single picture that shows what branch... | <p>TortoiseSVN can show <a href="http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-revgraph.html" rel="nofollow">revision graph</a> - visual representation of branching \ merging history and more.</p>
|
Can I set a data breakpoint in runtime in System C (or in Plain Vanilla C++)? <p>I have a class in system-C with some data members as such: </p>
<pre><code>long double x[8];
</code></pre>
<p>I'm initializing it in the construction like this:</p>
<pre><code>for (i = 0; i < 8; ++i) {
x[i] = 0;
}
</code></pre>
... | <p>Sure, it will be garbage!</p>
<p>The code should have been as </p>
<pre><code>for (i = 0; i < 8; ++i) {
x[i] = 0;
}
</code></pre>
<p>EDIT: Oops, Sorry for underestimating ;)</p>
|
Foxpro App and removable drives problem <p>I have a foxpro app, that contains hard coded path for icons and bitmaps. That's how foxpro does it and there is no way around it. And this works fine, except that when a removable drive has been used but is not connected, and when is connected windows assigns the same letter ... | <p>Nelson:</p>
<p>"That's how foxpro does it and there is no way around it"?</p>
<p>I'm using FOX since FoxPro 2.5 to Visual FoxPro 9, and you are NEVER forced in any way to hard-code a path, you can use SET PATH TO (sYourPath), you can embed the icons and bitmaps in your EXE / APP file and therefore there's no need ... |
Can't access variable in C++ DLL from a C app <p>I'm stuck on a fix to a legacy Visual C++ 6 app. In the C++ DLL source I have put</p>
<pre><code>extern "C" _declspec(dllexport) char* MyNewVariable = 0;
</code></pre>
<p>which results in MyNewVariable showing up (nicely undecorated) in the export table (as shown by du... | <p>you must link against the lib generated after compiling the DLL. In the linker options of the project, you must add the <code>.lib</code> file. And yes, you should also declare the variable as:</p>
<pre><code>extern "C" { declspec(dllimport) char MyNewVariable; }
</code></pre>
|
How can I get a fixed-position menu like slashdot's comment filtration menu <p>Slashdot has a little widget that allows you to tweak your comment threshold to filter out down-modded comments. It will be in one place if you scroll to the top of the page, and as you scroll down, at some point, where its original home is... | <p>Okay, I figured it out. I will post it here in case it help anyone else. This solution uses prototype, and an internal library that gives me the registerEvent, getElementX and getElementY functions, which do what you would think.</p>
<pre><code>var MenuManager = Class.create({
initialize: function initialize(... |
Is a Flex debugger included in the sdk? <p>I have been writing Flex applications for a few months now and luckily have not needed a full debugger as of yet, so far I have just used a few Alert boxes...</p>
<p>Is there an available debugger that is included in the free Flex SDK? I am not using FlexBuilder (I have been ... | <p>A debugger called <code>fdb</code> is included in the Flex SDK. Here's some documentation on how to use it:</p>
<ul>
<li><a href="http://www.adobe.com/devnet/flex/articles/client_debug_08.html" rel="nofollow">Adobe DevCenter: Debugging Client-Side Code in Flex Applications</a></li>
<li><a href="http://livedocs.adob... |
How do I make dynamic content with dynamic navigation? <p>I'm creating an ASP.NET web site where all pages hang off a database-driven tree-hierarchy. Pages typically present HTML content. But, some will execute programming.</p>
<p>Examples: (1) a "contact us" form or (2) a report generator</p>
<p>How should I repre... | <p>You might consider inserting placeholders like <code><my:contact-us-form/></code> in the database on specific pages; that way the database can describe all the static text content instead of completely replacing that database-driven content with an <code>.ascx</code> control.</p>
|
How do I start threads in plain C? <p>I have used fork() in C to start another process. How do I start a new thread?</p>
| <p>Since you mentioned fork() I assume you're on a Unix-like system, in which case <a href="http://en.wikipedia.org/wiki/POSIX_Threads">POSIX threads</a> (usually referred to as pthreads) are what you want to use.</p>
<p>Specifically, pthread_create() is the function you need to create a new thread. Its arguments are:... |
round() in Python doesn't seem to be rounding properly <p>The documentation for the <a href="http://docs.python.org/lib/built-in-funcs.html">round()</a> function states that you pass it a number, and the positions past the decimal to round. Thus it <em>should</em> do this:</p>
<pre><code>n = 5.59
round(n, 1) # 5.6
</c... | <p>Formatting works correctly even without having to round:</p>
<pre><code>"%.1f" % n
</code></pre>
|
What is the Liskov Substitution Principle? <p>I have heard that the Liskov Substitution Principle (LSP) is a fundamental principle of object oriented design. What is it and what are some examples of its use?</p>
| <p>A great example illustrating LSP (given by Uncle Bob in a podcast I heard recently) was how sometimes something that sounds right in natural language doesn't quite work in code.</p>
<p>In mathematics, a <code>Square</code> is a <code>Rectangle</code>. Indeed it is a specialization of a rectangle. The "is a" makes y... |
Right Align text in SQL Server <p>We all know T-SQL's string manipulation capabilities sometimes leaves much to be desired...</p>
<p>I have a numeric field that needs to be output in T-SQL as a right-aligned text column. Example:</p>
<pre><code>Value
----------
143.55
3532.13
1.75
</code></pre>
<p>How woul... | <p>The <a href="http://msdn.microsoft.com/en-us/library/ms189527.aspx">STR function</a> has an optional length argument as well as a number-of-decimals one.</p>
<pre><code>SELECT STR(123.45, 6, 1)
------
123.5
(1 row(s) affected)
</code></pre>
|
Best way to reduce sequences in an array of strings <p>Please, now that I've re-written the question, and before it suffers from further <a href="http://stackoverflow.com/questions/56103/fastest-gun-in-the-west-problem" rel="nofollow">fast-gun answers</a> or premature closure by <a href="http://stackoverflow.com/users/... | <p><strong>EDIT: made some changes and new suggestions</strong></p>
<p>What about a sliding window...</p>
<pre><code>REMOVE LENGTH 2: (no other length has other matches)
//the lower case letters are the matches
ABCBAbabaBBCbcbcbVbvBCbcbcAB
__ABCBABABABBCBCBCBVBVBCBCBCAB
REMOVE LENGTH 1 (duplicate characters):
//* ... |
Which .Net collection for adding multiple objects at once and getting notified? <p>Was considering the <code>System.Collections.ObjectModel ObservableCollection<T></code> class. This one is strange because </p>
<ul>
<li>it has an Add Method which takes <strong>one</strong> item only. No AddRange or equivalent. ... | <p>It seems that the <code>INotifyCollectionChanged</code> interface allows for updating when multiple items were added, so I'm not sure why <code>ObservableCollection<T></code> doesn't have an <code>AddRange</code>. You could make an extension method for <code>AddRange</code>, but that would cause an event for ... |
Is there any disadvantage to returning this instead of void? <p>Say instead of returning void a method you returned a reference to the class even if it didn't make any particular semantic sense. It seems to me like it would give you more options on how the methods are called, allowing you to use it in a fluent-interfa... | <p>I think as a general policy, it simply doesn't make sense. Method chaining in this manner works with a properly defined interface but it's only appropriate if it makes semantic sense. </p>
<p>Your example is a prime one where it's not appropriate, because it makes no semantic sense.</p>
<p>Similarly, your syntacti... |
What collaboration tools are effective for working with non-technical people? <p>For programmers working in corporate environments and outside of the start up world, there are a wide variety of non-technical people that are important stakeholders in the development process. These include other functions within the com... | <p><a href="http://www.basecamphq.com/" rel="nofollow">Basecamp</a> is a joy to use, and its primary focus is project management through collaboration.</p>
|
How do I get the current user's Local Settings folder path in C#? <p>I want to point a file dialog at a particular folder in the current user's Local Settings folder on Windows. What is the shortcut to get this path?</p>
| <p>How about this, for example:</p>
<pre><code>String appData =
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
</code></pre>
<p>I don't see an enum for just the Local Settings folder.</p>
<p><a href="http://web.archive.org/web/20080303235606/http://dotnetjunkies.com/WebLog/nenoloje/a... |
web page cache setexpires <p>Will the code below work if the clock on the server is ahead of the clock on the client?</p>
<pre><code>Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1))
</code></pre>
<p>EDIT: the reason I ask is on one of our web apps some users are claiming they are seeing the pages ( account numb... | <p><a href="http://stackoverflow.com/questions/49547/making-sure-a-webpage-is-not-cached-across-all-browsers" rel="nofollow">This question</a> covers making sure a webpage is not cached. It seems you have to set several properties to ensure a web page is not cached across all browsers.</p>
|
Any tool to migrate repo from Vault to Subversion? <p>Are there any <strong>tools</strong> to facilitate a migration from <a href="http://www.sourcegear.com/vault/index.html">Sourcegear's Vault</a> to <a href="http://subversion.tigris.org/">Subversion</a>?</p>
<p>I'd really prefer an existing tool or project (I'll buy... | <p>We are thinking about migrating from vault to git. I wrote vault2git converter that takes care of history and removes vault bindings from *.sln, *.csproj files.</p>
<p>Once you have git repo, there is git2svn.</p>
<p>I know it sounds like going rounds, but it might be faster than writing vault2svn from scratch.</p... |
How do I check that a Windows QFE/patch has been installed from c#? <p>What's the best way in c# to determine is a given QFE/patch has been installed?</p>
| <p>Use WMI and inspect the <a href="http://msdn.microsoft.com/en-us/library/aa394391.aspx" rel="nofollow">Win32_QuickFixEngineering</a> enumeration.</p>
<p>From TechNet:</p>
<pre><code>strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer &... |
Continue Considered Harmful? <p>Should developers avoid using <a href="http://msdn.microsoft.com/en-us/library/923ahwt1.aspx">continue</a> in C# or its equivalent in other languages to force the next iteration of a loop? Would arguments for or against overlap with arguments about <a href="http://stackoverflow.com/quest... | <p>I think there should be more use of continue!</p>
<p>Too often I come across code like:</p>
<pre><code>for (...)
{
if (!cond1)
{
if (!cond2)
{
... highly indented lines ...
}
}
}
</code></pre>
<p>instead of </p>
<pre><code>for (...)
{
if (cond1 || cond2)
{
continu... |
Best build process solution to manage build versions <p>I run a rather complex project with several independent applications. These use however a couple of shared components. So I have a source tree looking something like the below.</p>
<ul>
<li>My Project
<ul>
<li>Application A</li>
<li>Shared1</li>
<li>Shared2 </li... | <p>Your scheme is sound and achievable in VSS (although I would suggest you consider an alternative, VSS is really an outdated product).</p>
<p>For your "CI" Build - you would do the Versioning take a look at <a href="http://msbuildtasks.tigris.org/" rel="nofollow">MSBuild Community Tasks Project</a> which has a "Vers... |
Visual Studio 2008 / Web site problem <p>I am using VS 2008 with SP1 and the IE 8 beta 2. Whenever I start a new Web site or when I double-click an ASPX in the solution explorer, VS insists on attempting to the display the ASPX page in a free-standing IE browser instance. The address is the local file path to the ASPX ... | <p>Right click on the file, select 'Open With' and choose "Web Form Editor" and click "Set as Default".</p>
|
What's the bare minimum permission set for Sql Server 2005 services? <p>Best practices recommend not installing Sql Server to run as SYSTEM. What is the bare minumum you need to give the user account you create for it?</p>
| <p>By default, SQL Server 2005 installation will create a security group called SQLServer2005MSSQLUser$ComputerName$MSSQLSERVER with the correct rights. You just need to create a domain user or local user and make it a member of that group. </p>
<p>More details are available in the SQL Server Books Online: <a href="ht... |
How to attach debugger to step into native (C++) code from a managed (C#) wrapper? <p>I have a wrapper around a C++ function call which I call from C# code. How do I attach a debugger in Visual Studio to step into the native C++ code?</p>
<p>This is the wrapper that I have which calls GetData() defined in a C++ file:<... | <p>Check the Debug tab on your project's properties page. There should be an "Enable unmanaged code debugging" checkbox. This worked for me when we developed a new .NET UI for our old c++ DLLs.</p>
<p>If your unmanaged DLL is being built from another project (for a while ours were being built using VS6) just make sur... |
How do I increase the number of default rows per page? <p>Grails scaffolding defaults to 10 rows per page. I would like to increase that number without generating the views and changing the 10 in every file. Where do I change the default?</p>
| <p>You have to install scaffold templates with:</p>
<p>grails install-templates</p>
<p>Now, edit in src/templates/scaffolding Controller.groovy and increase the value params.max as you want</p>
|
What is the overhead cost associated with IoC containers like StructureMap? <p>After attending a recent Alt.NET group on IoC, I got to thinking about the tools available and how they might work. <code>StructureMap</code> in particular uses both attributes and bootstrapper concepts to map requests for <code>IThing</cod... | <p>I can't say much for other IoC toolkits but I use Spring.Net and have found that there is a one off initial performance penalty at startup. Once the container has been configured the application runs unaffected.</p>
|
Building Flex projects in ant/nant <p>We have a recurring problem at my company with build breaks in our Flex projects. The problem primarily occurs because the build that the developers do on their local machines is fundamentally different from the build that occurs on the build machine. The devs are building the proj... | <p>I found that one of the undocumented requirements for using ant with Flexbuilder was to have the variable FLEX_HOME set within your ant script. Typically within build.xml have the following:</p>
<pre><code><!â Module properties â>
<property environment=âenvâ/>
<property name=âbuild.dirâ v... |
OOP class design, Is this design inherently 'anti' OOP? <p>I remember back when MS released a forum sample application, the design of the application was like this:</p>
<p>/Classes/User.cs
/Classes/Post.cs
...
/Users.cs
/Posts.cs</p>
<p>So the classes folder had just the class i.e. properties and getters/setters.
The... | <p>If every method is just a static call straight to the data source, then the "Posts" class is really a Factory. You could certainly put the static methods in "Posts" into the "Post" class (this is how CSLA works), but they are still factory methods.</p>
<p>I would say that a more modern and accurate name for the "P... |
Are CLR stored procedures preferred over TSQL stored procedures in SQL 2005+? <p>My current view is no, prefer Transact SQL stored procedures because they are a lighter weight and (possibly) higher performing option, while CLR procedures allow developers to get up to all sorts of mischief.</p>
<p>However recently I ha... | <p>There are places for both well-written, well-thought-out T-SQL and CLR. If some function is not called frequently and if it required extended procedures in SQL Server 2000, CLR may be an option. Also running things like calculation right next to the data may be appealing. But solving bad programmers by throwing in n... |
Rendering Graphics in C# <p>Are there any other way to render graphics in C# beyond GDI+ and XNA? (For the development of a tile map editor)</p>
| <p><a href="http://cs-sdl.sourceforge.net/index.php/Main_Page" rel="nofollow">http://cs-sdl.sourceforge.net/index.php/Main_Page</a> is the solution I've come to love. If you need 3d on top of it, you can use Tao.OpenGL to render inside it. It's fast, industry standard (SDL, that is), and cross-platform.</p>
|
UnhandledException handler in a .Net Windows Service <p>Is it possible to use an UnhandledException Handler in a Windows Service?</p>
<p>Normally I would use a custom built Exception Handling Component that does logging, phone home, etc. This component adds a handler to System.AppDomain.CurrentDomain.UnhandledExceptio... | <p>Ok, Iâve done a little more research into this now.
When you create a windows service in .Net, you create a class that inherits from System.ServiceProcess.ServiceBase (In VB this is hidden in the .Designer.vb file). You then override the OnStart and OnStop function, and OnPause and OnContinue if you choose to.
T... |
Tools for manipulating PowerPoint files <p>Do you know managed tools for manipulating PowerPoint files?
The tool should be 100% managed code and offer the option to
handle .ppt and .pptx files.</p>
| <p>@<a href="#58318" rel="nofollow">Chris</a>: There won't be a chance that Office 2007 will be available to manipulate the files. So far the only solution which comes close to what I am looking for is <a href="http://www.aspose.com/categories/file-format-components/aspose.slides-for-.net-and-java/default.aspx" rel="no... |
How to test a WPF user interface? <p>Using win forms with an <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC</a>/<a href="http://msdn.microsoft.com/en-us/magazine/cc188690.aspx">MVP</a> architecture, I would normally use a class to wrap a view to test the UI while using mocks for the model and controll... | <p>As for the testing itself, you're probably best off using the <a href="https://msdn.microsoft.com/library/ms747327.aspx">UI Automation</a> framework. Or if you want a more fluent and wpf/winforms/win32/swt-independent way of using the framework, you could download <a href="http://www.codeplex.com/white">White</a> fr... |
Avoiding first chance exception messages when the exception is safely handled <p>The following bit of code catches the EOS Exception</p>
<pre><code>using (var reader = new BinaryReader(httpRequestBodyStream)) {
try {
while (true) {
bodyByteList.Add(reader.ReadByte());
}
} catch (En... | <p>To avoid seeing the messages, right-click on the output window and uncheck "Exception Messages".</p>
<p>However, seeing them happen might be nice, if you're interested in knowing when exceptions are thrown without setting breakpoints and reconfiguring the debugger.</p>
|
Using .NET, how can you find the mime type of a file based on the file signature not the extension <p>I am looking for a simple way to get a mime type where the file extension is incorrect or not given, something similar to <a href="http://stackoverflow.com/questions/51438/getting-a-files-mime-type-in-java" rel="nofoll... | <p>I did use urlmon.dll in the end. I thought there would be an easier way but this works. I include the code to help anyone else and allow me to find it again if I need it.</p>
<pre><code>using System.Runtime.InteropServices;
</code></pre>
<p>...</p>
<pre><code> [DllImport(@"urlmon.dll", CharSet = CharSet.Auto)]... |
Version control of deliverables <p>We need to regularly synchronize many dozens of binary files (project executables and DLLs) between many developers at several different locations, so that every developer has an up to date environment to build and test at. Due to nature of the project, updates must be done often and ... | <p>I'd probably take a look at rsync.</p>
<p>Just create a .CMD file that contains the call to rsync with all the correct parameters and let people call that. rsync is very smart in deciding what part of files need to be transferred, so it'll be very fast even when large files are involved.</p>
<p>What rsync doesn't ... |
How to resolve SQL query parameters mapping issues while using Oracle OLE DB provider? <p>When trying to enter a SQL query with parameters using the Oracle OLE DB provider I get the following error:</p>
<blockquote>
<p>Parameters cannot be extracted from the SQL command. The provider might not help to parse paramete... | <p>To expand on the link given in the question:</p>
<ol>
<li>Create a package variable</li>
<li>Double click on the package variable name. (This allows you to access the properties of the variable)</li>
<li>Set the property 'EvaluateAsExpression' to true</li>
<li>Enter the query in the expression builder.</li>
<li>Set... |
Default button size? <p>How do I create a button control (with <code>CreateWindow</code> of a <code>BUTTON</code> window class) that has a standard system-wide size (especially height) that's consistent with the rest of Windows applications?
I should of course take DPI into account and probably other settings.</p>
<bl... | <p>This is what MSDN has to say: <a href="http://msdn.microsoft.com/en-us/library/ms997619.aspx">Design Specifications and Guidelines - Visual Design: Layout</a>.</p>
<p>The default size of a button is 50x14 DLUs, which can be calculated to pixels using the examples shown for <a href="http://msdn.microsoft.com/en-us/l... |
"Quoted-printable line longer than 76 chars" warning when sending HTML E-Mail <p>I have written some code in my VB.NET application to send an HTML e-mail (in this case, a lost password reminder).</p>
<p>When I test the e-mail, it gets eaten by my spam filter. One of the things that it's scoring badly on is because of... | <p>Quoted printable expands 8 bit characters to "={HEX-Code}", thus making the messages longer. Maybe you are just hitting this limit?</p>
<p>Have you tried to break the message at, say, 70 characters? That should provide space for a couple of characters per line.</p>
<p>Or you just encode the email with Base64 - all... |
Windows CDROM Eject <p>Does anyone know a method to programmatically close the CD tray on Windows 2000 or higher?
Open CD tray exists, but I can't seem to make it close especially under W2k. </p>
<p>I am especially looking for a method to do this from a batch file, if possible, but API calls would be OK.</p>
| <p>I kind of like to use DeviceIOControl as it gives me the possibility to eject any kind of removable drive (such as USB and flash-disks as well as CD trays). Da codez to properly eject a disk using DeviceIOControl is (just add proper error-handling):</p>
<pre><code>bool ejectDisk(TCHAR driveLetter)
{
TCHAR tmp[10]... |
Open source PDF library for C/C++ application? <p>I want to be able to generate PDF ouput from my (native) C++ Windows application. Are there any free/open source libraries available to do this?</p>
<p>I looked at the answers to <a href="http://stackoverflow.com/questions/177/how-do-i-programmatically-create-a-pdf-in-... | <p><a href="https://github.com/libharu/libharu" rel="nofollow">LibHaru</a></p>
<blockquote>
<p>Haru is a free, cross platform,
open-sourced software library for
generating PDF written in ANSI-C. It
can work as both a static-library (.a,
.lib) and a shared-library (.so,
.dll).</p>
</blockquote>
<p>Didn't t... |
How do I get raw logs from Google Analytics? <p>Is it possible to obtain raw logs from Google Analytic? Is there any tool that can generate the raw logs from GA?</p>
| <p>No you can't get the raw logs, but there's nothing stopping you from getting the exact same data logged to your own web server logs. Have a look at the <a href="https://ssl.google-analytics.com/urchin.js">Urchin code</a> and borrow that, changing the following two lines to point to your web server instead.</p>
<pr... |
Converting SVG to PNG using C# <p>I've been trying to convert SVG images to PNG using C#, without having to write too much code. Can anyone recommend a library or example code for doing this?</p>
| <p>You can call the command-line version of inkscape to do this:</p>
<p><a href="http://harriyott.com/2008/05/converting-svg-images-to-png-in-c.aspx">http://harriyott.com/2008/05/converting-svg-images-to-png-in-c.aspx</a></p>
<p>Also there is a C# SVG rendering engine, primarily designed to allow SVG files to be used... |
Access to Result sets from within Stored procedures Transact-SQL SQL Server <p>I'm using SQL Server 2005, and I would like to know how to access different result sets from within transact-sql. The following stored procedure returns two result sets, how do I access them from, for example, another stored procedure?</p>
... | <p>The short answer is: you can't do it.</p>
<p>From T-SQL there is no way to access multiple results of a nested stored procedure call, without changing the stored procedure as others have suggested.</p>
<p>To be complete, if the procedure were returning a single result, you could insert it into a temp table or tabl... |
Enforce SSL in code in an ashx handler <p>I have a site, which contains several ashx handlers, on a couple of the handlers I want to reject non-SSL requests. Is there a way that I can do this in code?</p>
| <p>If you must do it programmatically, a way I've done it in the past is to inspect the url and look for "https" in it. Redirect if you don't see that. Request.IsSecureConnection should be the preferred method, however. You may have to add additional logic to handle a loopback address.</p>
|
SqlServer Express slow performance <p>I am stress testing a .NET web application. I did this for 2 reasons: I wanted to see what performance was like under real world conditions and also to make sure we hadn't missed any problems during testing. We had 30 concurrent users in the application using it as they would duri... | <ol>
<li><p>You may be running into concurrency issues, depending on how your application runs. Try performing your reads with the "nolock" keyword. </p></li>
<li><p>Try adding in table aliases for your columns (and avoid the use of SELECT *), this helps out MSSQL, as it doesn't have to "guess" which table the columns ... |
VS 2005 Installer Project Version Number <p>I am getting this error now that I hit version number 1.256.0:
Error 4 Invalid product version '1.256.0'. Must be of format '##.##.####'</p>
<p>The installer was fine with 1.255.0 but something with 256 (2^8) it doesn't like. I found this stated on msdn.com:
The Version p... | <p>The link you reference says " This page is specific to Microsoft Visual Studio 2008/.NET Framework 3.5", but you're talking about vs2005.</p>
<p>My guess: a 0-based range of 256 numbers ends at 255, therefore trying to use 256 exceeds that and perhaps they changed it for VS2008</p>
<p>Edit: I looked again and see ... |
What do I need to know to globalize an asp.net application? <p>I'm writing an asp.net application that will need to be localized to several regions other than North America. What do I need to do to prepare for this globalization? What are your top 1 to 2 resources for learning how to write a world ready application.<... | <p>A couple of things that I've learned:</p>
<ul>
<li><p>Absolutely and brutally minimize the number of images you have that contain text. Doing so will make your life a billion percent easier since you won't have to get a new set of images for every friggin' language.</p></li>
<li><p>Be very wary of css positioning t... |
How do I disable validation in Web Data Administrator? <p>I'm trying to run some queries to get rid of XSS in our database using Web Data Administrator but I keep running into this Potentially Dangerous Request crap.</p>
<p>How do I disable validation of the query in Web Data Administrator?</p>
| <p>Go into the install directory of web data admin, usually:</p>
<p><code>C:\Program Files\Microsoft SQL Server Tools\Microsoft SQL Web Data Administrator</code></p>
<p>Then in the "Web" folder open the file "QueryDatabase.aspx" and edit the following line:</p>
<p><code><%@ Page language="c#" Codebehind="QueryDat... |
How Do I Load an Assembly and All of its Dependencies at Runtime in C# for Reflection? <p>I'm writing a utility for myself, partly as an exercise in learning C# Reflection and partly because I actually want the resulting tool for my own use.</p>
<p>What I'm after is basically pointing the application at an assembly an... | <p>Couple of options here:</p>
<ol>
<li>Attach to <code>AppDomain.AssemblyResolve</code> and do another <code>LoadFile</code> based on the requested assembly.</li>
<li>Spin up another <code>AppDomain</code> with the directory as its base and load the assemblies in that <code>AppDomain</code>.</li>
</ol>
<p>I'd highly... |
What is the best way to rollout web applications? <p>I'm trying to create a standard way of rolling out web applications for our company. Currently we do it with zip files, vbscript/javascript, and manual some steps. </p>
<p>For thick client installs we generate MSI installers using Wise/Wix. We don't create instal... | <p>I recently spent a few days working on automating deployments at my company. </p>
<p>We use a combination of CruiseControl, NAnt, MSBuild to generate a release version of the app. Then a separate script uses MSDeploy and XCopy to backup the live site and transfer the new files over. </p>
<p>Our solution is briefly... |
Programmatically change combobox <p>I need to update a <code>combobox</code> with a new value so it changes the reflected text in it. The cleanest way to do this is after the <code>combobox</code>has been initialised and with a message.</p>
<p>So I am trying to craft a <code>postmessage</code> to the hwnd that contain... | <p>You want <a href="http://msdn.microsoft.com/en-us/library/bb856484(VS.85).aspx" rel="nofollow">ComboBox_SetCurSel</a>:</p>
<pre><code>ComboBox_SetCurSel(hWndCombo, n);
</code></pre>
<p>or if it's an MFC CComboBox control you can probably do:</p>
<pre><code>m_combo.SetCurSel(2);
</code></pre>
<p>I would imagine i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.