content
stringlengths
86
88.9k
title
stringlengths
0
150
question
stringlengths
1
35.8k
answers
list
answers_scores
list
non_answers
list
non_answers_scores
list
tags
list
name
stringlengths
30
130
Q: C# Corrupt Memory Error I cant post the code (proprietary issues) but does anyone know what types of things would cause the following error in C#. It is being thrown by a VOIP client that I wrote (using counterpath api) when the call is ended by the other client. The error is: System.AccessViolationException was u...
C# Corrupt Memory Error
I cant post the code (proprietary issues) but does anyone know what types of things would cause the following error in C#. It is being thrown by a VOIP client that I wrote (using counterpath api) when the call is ended by the other client. The error is: System.AccessViolationException was unhandled Message="Attempted...
[ "List of some possibilities:\n\nAn object is being used after it has been disposed. This can happen a lot if you are disposing managed object in a finalizer (you should not do that).\nAn unmannaged implementation of one of the object you are using is bugged and it corrupted the process memory heap. Happens a lot wi...
[ 3, 1, 0 ]
[]
[]
[ "c#", "voip" ]
stackoverflow_0000017947_c#_voip.txt
Q: What is the best method for checking if a file exists from a SQL Server 2005 stored procedure? We used the "undocumented" xp_fileexist stored procedure for years in SQL Server 2000 and had no trouble with it. In 2005, it seems that they modified the behavior slightly to always return a 0 if the executing user acco...
What is the best method for checking if a file exists from a SQL Server 2005 stored procedure?
We used the "undocumented" xp_fileexist stored procedure for years in SQL Server 2000 and had no trouble with it. In 2005, it seems that they modified the behavior slightly to always return a 0 if the executing user account is not a sysadmin. It also seems to return a zero if the SQL Server service is running under the...
[ "You will have to mark the CLR as EXTERNAL_ACCESS in order to get access to the System.IO namespace, however as things go that is not a bad way to go about it. \n\nSAFE is the default permission set, but it’s highly restrictive. With the SAFE setting, you can access only data from a local database to perform comput...
[ 5, 4, 3 ]
[]
[]
[ "sql_server", "sql_server_2005" ]
stackoverflow_0000016634_sql_server_sql_server_2005.txt
Q: How do I track down performance problems with page rendering? I've been tasked with improving the performance of an ASP.NET 2.0 application. The page I'm currently focused on has many problems but one that I'm having trouble digging into is the render time of the page. Using Trace.axd the duration between Begin ...
How do I track down performance problems with page rendering?
I've been tasked with improving the performance of an ASP.NET 2.0 application. The page I'm currently focused on has many problems but one that I'm having trouble digging into is the render time of the page. Using Trace.axd the duration between Begin Render and End Render is 1.4 seconds. From MSDN I see that All AS...
[ "<%@Page Trace=\"true\" %>\n\nSee http://www.asp101.com/articles/robert/tracing/default.asp.\n", "Download ANTS PROFILER, this will give you a perfect overview of the lines causing the slowdown.\nAlso when it's about rendering make sure you don't use to much string concats (like string += \"value\") but use Strin...
[ 3, 2, 0 ]
[]
[]
[ "asp.net", "performance" ]
stackoverflow_0000015513_asp.net_performance.txt
Q: How would a sdbm hash function be implemented in C#? How can a sdbm hash function (such as this) be implemented in C# ? A: You can take the C code almost without changes: uint sdbm( string str ) { uint hash = 0; foreach( char ch in str ) { hash = ch + (hash << 6) + (hash << 16) - hash; } ...
How would a sdbm hash function be implemented in C#?
How can a sdbm hash function (such as this) be implemented in C# ?
[ "You can take the C code almost without changes:\nuint sdbm( string str )\n{\n uint hash = 0;\n foreach( char ch in str )\n {\n hash = ch + (hash << 6) + (hash << 16) - hash;\n }\n return hash;\n}\n\nOr did you think of something more sophisticated?\n", "I don't have a C compiler set up so I...
[ 3, 1, 0 ]
[]
[]
[ "c#", "hash" ]
stackoverflow_0000015954_c#_hash.txt
Q: Error viewing csproj property pages in VisualStudio2005 When I goto view the property page for my CSharp test application I get the following error. "An error occurred trying to load the page. COM object that has been seperated from its underlying RCW cannot be used." The only thing that seems to fix it is rebooti...
Error viewing csproj property pages in VisualStudio2005
When I goto view the property page for my CSharp test application I get the following error. "An error occurred trying to load the page. COM object that has been seperated from its underlying RCW cannot be used." The only thing that seems to fix it is rebooting my PC!
[ "This is usually caused by a 'rogue' add-in.\nTry disabling them all, and then re-enabling them checking for the error - so that you can narrow down the culprit.\n", "It seems Microsoft Style Cop was causing the issue.\nIt was not registered as an Add-in, but was integrated into VS2005 on some deeper level.\n" ]
[ 1, 0 ]
[]
[]
[ "visual_studio" ]
stackoverflow_0000016808_visual_studio.txt
Q: In C#, do you need to call the base constructor? In C#, if I have an inherited class with a default constructor, do I have to explicitly call the base class' constructor or will it be implicitly called? class BaseClass { public BaseClass() { // ... some code } } class MyClass : BaseClass { ...
In C#, do you need to call the base constructor?
In C#, if I have an inherited class with a default constructor, do I have to explicitly call the base class' constructor or will it be implicitly called? class BaseClass { public BaseClass() { // ... some code } } class MyClass : BaseClass { public MyClass() // Do I need to put ": base()" here o...
[ "You do not need to explicitly call the base constructor, it will be implicitly called.\nExtend your example a little and create a Console Application and you can verify this behaviour for yourself:\nusing System;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)...
[ 63, 30, 9, 7, 5, 0 ]
[ "You don’t need call the base constructor explicitly it will be implicitly called, but sometimes you need pass parameters to the constructor in that case you can do something like:\nusing System;\nnamespace StackOverflow.Examples\n{\n class Program\n {\n static void Main(string[] args)\n {\n ...
[ -3 ]
[ "c#", "constructor", "inheritance" ]
stackoverflow_0000018097_c#_constructor_inheritance.txt
Q: Creating a custom JButton in Java Is there a way to create a JButton with your own button graphic and not just with an image inside the button? If not, is there another way to create a custom JButton in java? A: When I was first learning Java we had to make Yahtzee and I thought it would be cool to create custo...
Creating a custom JButton in Java
Is there a way to create a JButton with your own button graphic and not just with an image inside the button? If not, is there another way to create a custom JButton in java?
[ "When I was first learning Java we had to make Yahtzee and I thought it would be cool to create custom Swing components and containers instead of just drawing everything on one JPanel. The benefit of extending Swing components, of course, is to have the ability to add support for keyboard shortcuts and other acces...
[ 98, 35, 15, 9, 8 ]
[]
[]
[ "java", "jbutton", "swing" ]
stackoverflow_0000002158_java_jbutton_swing.txt
Q: cURL adding whitespace to post content? I am attempting to POST against a vendor's server using PHP 5.2 with cURL. I'm reading in an XML document to post against their server and then reading in a response: $request = trim(file_get_contents('test.xml')); $curlHandle = curl_init($servletURL); curl_setopt($curlHandl...
cURL adding whitespace to post content?
I am attempting to POST against a vendor's server using PHP 5.2 with cURL. I'm reading in an XML document to post against their server and then reading in a response: $request = trim(file_get_contents('test.xml')); $curlHandle = curl_init($servletURL); curl_setopt($curlHandle, CURLOPT_POST, TRUE); curl_setopt($curlHand...
[ "Not an answer, but I find the whole fopen/fread/fclose thing very dull to peruse when looking at code.\nYou can replace:\n$file = 'test.xml';\n$fileHandle = fopen($file, 'r');\n$request = fread($fileHandle, filesize($file));\nfclose($fileHandle);\n$request = trim($request);\n\nWith:\n$request = trim(file_get_conte...
[ 3, 2, 0 ]
[]
[]
[ "curl", "php", "xml" ]
stackoverflow_0000018166_curl_php_xml.txt
Q: Best Way to Begin Learning Web Application Design I'm a long time hobbyist programmer interested in getting into web application development. I have a fair amount of personal experience with various non-web languages, but have never really branched over to web applications. I don't usually have any issues learning...
Best Way to Begin Learning Web Application Design
I'm a long time hobbyist programmer interested in getting into web application development. I have a fair amount of personal experience with various non-web languages, but have never really branched over to web applications. I don't usually have any issues learning new languages or technologies, so I'm not worried abou...
[ "There is a wide variety of web application languages you could get into. The ones I have most experience with (and therefore will be talking about here) are PHP, eRuby and Ruby on Rails. All of these have good tutorials available on the internet - I'll link to some of them below.\nWhich to choose depends on exactl...
[ 10, 2, 1 ]
[]
[]
[ "language_agnostic", "resources", "web_applications" ]
stackoverflow_0000018284_language_agnostic_resources_web_applications.txt
Q: SQL Server Full Text Searching I'm currently working on an application where we have a SQL-Server database and I need to get a full text search working that allows us to search people's names. Currently the user can enter a into a name field that searches 3 different varchar cols. First, Last, Middle names So say ...
SQL Server Full Text Searching
I'm currently working on an application where we have a SQL-Server database and I need to get a full text search working that allows us to search people's names. Currently the user can enter a into a name field that searches 3 different varchar cols. First, Last, Middle names So say I have 3 rows with the following inf...
[ "If you're just searching people's names, it might be in your best interest to not even use the full text index. Full text index makes sense when you have large text fields, but if you're mostly dealing with one word per field, I'm not sure how much extra you would get out of full text indexes. Waiting for the fu...
[ 5, 4, 4, 2, 2 ]
[]
[]
[ "full_text_search", "search", "sql_server" ]
stackoverflow_0000017056_full_text_search_search_sql_server.txt
Q: How can Perl's system() print the command that it's running? In Perl, you can execute system commands using system() or `` (backticks). You can even capture the output of the command into a variable. However, this hides the program execution in the background so that the person executing your script can't see it. ...
How can Perl's system() print the command that it's running?
In Perl, you can execute system commands using system() or `` (backticks). You can even capture the output of the command into a variable. However, this hides the program execution in the background so that the person executing your script can't see it. Normally this is useful but sometimes I want to see what is going...
[ "I don't know of any default way to do this, but you can define a subroutine to do it for you:\nsub execute {\n my $cmd = shift;\n print \"$cmd\\n\";\n system($cmd);\n}\n\nmy $cmd = $ARGV[0];\nexecute($cmd);\n\nAnd then see it in action:\npbook:~/foo rudd$ perl foo.pl ls\nls\nfile1 file2 foo.pl\n\n", ...
[ 19, 10, 5, 5, 2, 2 ]
[]
[]
[ "perl", "system" ]
stackoverflow_0000017225_perl_system.txt
Q: How do I change the title bar icon in Adobe AIR? I cannot figure out how to change the title bar icon (the icon in the furthest top left corner of the application) in Adobe AIR. It is currently displaying the default 'Adobe AIR' red icon. I have been able to change it in the system tray, however. A: Does the fo...
How do I change the title bar icon in Adobe AIR?
I cannot figure out how to change the title bar icon (the icon in the furthest top left corner of the application) in Adobe AIR. It is currently displaying the default 'Adobe AIR' red icon. I have been able to change it in the system tray, however.
[ "Does the following help?\nhttp://groups.google.com/group/chennai-flex-user-group/browse_thread/thread/cffb9ab56450c28e\n", "The first link shows how to change the Taskbar Icon, the second shows the application icon I believe used on the desktop. I am going to recompile and install the application and see if it w...
[ 2, 1 ]
[]
[]
[ "air", "apache_flex" ]
stackoverflow_0000018298_air_apache_flex.txt
Q: I would like some tips for debugging WCF Web Service exceptions I've created a WCF service and when I browse to the endpoint I get the following fault: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <s:Fault> <faultcode xmlns:a="http://schemas.microsoft.com/ws/20...
I would like some tips for debugging WCF Web Service exceptions
I've created a WCF service and when I browse to the endpoint I get the following fault: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <s:Fault> <faultcode xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none"> a:ActionNotSupported </faul...
[ "I've found SvcTraceViewer.exe to be the most valuable tool when it comes to diagnosing WCF errors.\n" ]
[ 9 ]
[]
[]
[ ".net", "wcf", "web_services" ]
stackoverflow_0000018348_.net_wcf_web_services.txt
Q: Query a union table with fields as columns I'm not quite sure if this is possible, or falls into the category of pivot tables, but I figured I'd go to the pros to see. I have three basic tables: Card, Property, and CardProperty. Since cards do not have the same properties, and often multiple values for the same pr...
Query a union table with fields as columns
I'm not quite sure if this is possible, or falls into the category of pivot tables, but I figured I'd go to the pros to see. I have three basic tables: Card, Property, and CardProperty. Since cards do not have the same properties, and often multiple values for the same property, I decided to use the union table approac...
[ "Is this for SQL server?\nIf yes then\nConcatenate Values From Multiple Rows Into One Column (2000)\nConcatenate Values From Multiple Rows Into One Column Ordered (2005+)\n", "Related but values are values are kept in separate columns and you have know your \"special types\" a head of time: SQL query to compare p...
[ 1, 1, 0, 0, 0 ]
[]
[]
[ "database_design", "sql", "stored_procedures" ]
stackoverflow_0000018216_database_design_sql_stored_procedures.txt
Q: How do I update my UI from within HttpWebRequest.BeginGetRequestStream in Silverlight I am uploading multiple files using the BeginGetRequestStream of HttpWebRequest but I want to update the progress control I have written whilst I post up the data stream. How should this be done, I have tried calling Dispatch.B...
How do I update my UI from within HttpWebRequest.BeginGetRequestStream in Silverlight
I am uploading multiple files using the BeginGetRequestStream of HttpWebRequest but I want to update the progress control I have written whilst I post up the data stream. How should this be done, I have tried calling Dispatch.BeginInvoke (as below) from within the loop that pushes the data into the stream but it lock...
[ "I was going to say that, I didn't think that Silverlight 2's HttpWebRequest supported streaming, because the request data gets buffered into memory entirely. It had been a while since the last time I looked at it though, therefore I went back to see if Beta 2 supported it. Well turns out it does. I am glad I we...
[ 1, 0 ]
[]
[]
[ "c#", "silverlight" ]
stackoverflow_0000013217_c#_silverlight.txt
Q: Best way to bind Windows Forms properties to ApplicationSettings in C#? In a desktop application needing some serious re-factoring, I have several chunks of code that look like this: private void LoadSettings() { WindowState = Properties.Settings.Default.WindowState; Location = Properties.Settings.Default....
Best way to bind Windows Forms properties to ApplicationSettings in C#?
In a desktop application needing some serious re-factoring, I have several chunks of code that look like this: private void LoadSettings() { WindowState = Properties.Settings.Default.WindowState; Location = Properties.Settings.Default.WindowLocation; ... } private void SaveSettings() { Properties.Setti...
[ "If you open your windows form in the designer, look in the properties box. The first item should be \"(ApplicationSetting)\". Under that is \"(PropertyBinding)\". That's where you'll find the option to do exactly what you want. \n" ]
[ 12 ]
[]
[]
[ ".net", "c#" ]
stackoverflow_0000018421_.net_c#.txt
Q: Best practise to authorize all users for just one page What is the best way to authorize all users to one single page in a asp.net website. For except the login page and one other page, I deny all users from viewing pages in the website. How do you make this page accessible to all users? A: I've been using form...
Best practise to authorize all users for just one page
What is the best way to authorize all users to one single page in a asp.net website. For except the login page and one other page, I deny all users from viewing pages in the website. How do you make this page accessible to all users?
[ "I've been using forms authentication and creating the necessary GenericIdentity and CustomPrincipal objects that allows me to leverage the User.IsInRole type functions you typically only get with Windows authentication.\nThat way in my web.config file, I can do stuff like...\n<location path=\"Login.aspx\">\n <sy...
[ 5 ]
[ "I created a base \"page\" class that handles that sort of thing. All my pages can then be decorated with the RequiresLogin attribute if a login is required to view them. If the attribute is not present, the page is accessible to all.\nExample:\n<RequiresLogin()> _ \n<RequiresPermission(\"process\")> _\nPartial Cla...
[ -1 ]
[ "asp.net", "authorization" ]
stackoverflow_0000018460_asp.net_authorization.txt
Q: Get a number from a sql string range I have a column of data that contains a percentage range as a string that I'd like to convert to a number so I can do easy comparisons. Possible values in the string: '<5%' '5-10%' '10-15%' ... '95-100%' I'd like to convert this in my select where clause to just the first numb...
Get a number from a sql string range
I have a column of data that contains a percentage range as a string that I'd like to convert to a number so I can do easy comparisons. Possible values in the string: '<5%' '5-10%' '10-15%' ... '95-100%' I'd like to convert this in my select where clause to just the first number, 5, 10, 15, etc. so that I can compare ...
[ "Try this,\nSELECT substring(replace(interest , '<',''), patindex('%[0-9]%',replace(interest , '<','')), patindex('%[^0-9]%',replace(interest, '<',''))-1) FROM table1 \n\nTested at my end and it works, it's only my first try so you might be able to optimise it.\n", "@Martin: Your solution works.\nHere is another ...
[ 5, 2, 0, 0, 0, 0, 0, 0 ]
[]
[]
[ "sql_server" ]
stackoverflow_0000018413_sql_server.txt
Q: .Net Parse versus Convert In .Net you can read a string value into another data type using either <datatype>.parse or Convert.To<DataType>. I'm not familiar with the fundamentals of parse versus convert so I am always at a loss when asked which one is better/faster/more appropriate. So - which way is best in wha...
.Net Parse versus Convert
In .Net you can read a string value into another data type using either <datatype>.parse or Convert.To<DataType>. I'm not familiar with the fundamentals of parse versus convert so I am always at a loss when asked which one is better/faster/more appropriate. So - which way is best in what type of circumstances?
[ "The Convert.ToXXX() methods are for objects that might be of the correct or similar type, while .Parse() and .TryParse() are specifically for strings:\n//o is actually a boxed int\nobject o = 12345;\n\n//unboxes it\nint castVal = (int) 12345;\n\n//o is a boxed enum\nobject o = MyEnum.ValueA;\n\n//this will get the...
[ 15, 5, 3, 1, 1 ]
[]
[]
[ ".net", "parsing" ]
stackoverflow_0000018465_.net_parsing.txt
Q: Why go 64 bit OS? On these questions: Which Vista edition is best for a developer machine? Vista or XP for Dev Machine People are recommending 64 bit, can you explain why? Is it just so you can have more then 3GB of addressable RAM that 32 bit gives you? And how does Visual Studio benefit from all this extra RAM...
Why go 64 bit OS?
On these questions: Which Vista edition is best for a developer machine? Vista or XP for Dev Machine People are recommending 64 bit, can you explain why? Is it just so you can have more then 3GB of addressable RAM that 32 bit gives you? And how does Visual Studio benefit from all this extra RAM? I went from 64 bit XP...
[ "Vista, as far as I know, has much better 64 bit support than XP. It is more well advertised than 64 bit XP, and more popular. Driver and software support should be much better for 64-bit Vista.\nThe 64-bit switch is in progress right now in the computing industry. You might as well switch. Microsoft made the serio...
[ 8, 5, 4, 3, 2, 2, 2, 1, 1, 1, 1, 1 ]
[]
[]
[ "64_bit", "operating_system", "windows_vista", "windows_xp" ]
stackoverflow_0000018035_64_bit_operating_system_windows_vista_windows_xp.txt
Q: What is the best way to write a form in ASP.NET MVC? What is the the best way to write a form to submit some data in ASP.NET MVC? Is it as Scott Guthrie demonstrates here? Are there better approaches? Perhaps with less using of strings? A: I don't really like strings in my code, as it isn't possible to refactor....
What is the best way to write a form in ASP.NET MVC?
What is the the best way to write a form to submit some data in ASP.NET MVC? Is it as Scott Guthrie demonstrates here? Are there better approaches? Perhaps with less using of strings?
[ "I don't really like strings in my code, as it isn't possible to refactor. A nice way is to use Linq Expressions. If you get passed a model as ViewData you can use the following statement:\n<%= ShowDropDownBox(viewData => viewData.Name); %>\n...\n\npublic static string ShowDropDownList<T>(this HtmlHelper html, Expr...
[ 2 ]
[]
[]
[ "asp.net_mvc", "forms" ]
stackoverflow_0000018614_asp.net_mvc_forms.txt
Q: Webservice alive forever I often use webservice this way public void CallWebservice() { mywebservice web = new mywebservice(); web.call(); } but sometimes I do this private mywebservice web; public Constructor() { web = new mywebservice(); } public void CallWebservice() { web.call(); } The seco...
Webservice alive forever
I often use webservice this way public void CallWebservice() { mywebservice web = new mywebservice(); web.call(); } but sometimes I do this private mywebservice web; public Constructor() { web = new mywebservice(); } public void CallWebservice() { web.call(); } The second approach likes me very much...
[ "The classes generated by Visual Studio for webservices are just proxies with little state so creating them is pretty cheap. I wouldn't worry about memory consumption for them.\nIf what you are looking for is a way to call the webmethod in one line you can simply do this:\nnew mywebservice().call()\n\nCheers\n" ]
[ 1 ]
[]
[]
[ "web_services" ]
stackoverflow_0000018702_web_services.txt
Q: Sending a mouse click to a button in the taskbar using C# In an application that I am currently working on, a requirement is to bring a window of an external application to the foreground. Making Win32 API calls such as BringWindowToTop and SetForeground window do not work all the time. This is due to some restr...
Sending a mouse click to a button in the taskbar using C#
In an application that I am currently working on, a requirement is to bring a window of an external application to the foreground. Making Win32 API calls such as BringWindowToTop and SetForeground window do not work all the time. This is due to some restrictions within Windows XP. What I would like to do instead is ...
[ "Check out the section \"How to steal focus on 2K/XP\" at http://www.codeproject.com/KB/dialog/dlgboxtricks.aspx, as this is exactly what you need. I wouldn't go the taskbar route as the taskbar could be hidden or simply not there.\n", "It's possible. But it's extremely sketchy. Your application may also break wi...
[ 4, 2, 1, 1 ]
[]
[]
[ ".net", "c#", "winapi", "windows" ]
stackoverflow_0000018505_.net_c#_winapi_windows.txt
Q: How to create a new instance of Sql Server 2005 I forgot my password for Sql Server 2005. Windows Authentication is not enabled so I cannot login. How can I remove the current instance and create a new db instance? Or is there a better solution exists? A: Assuming you are a member of the Windows Admininstrator g...
How to create a new instance of Sql Server 2005
I forgot my password for Sql Server 2005. Windows Authentication is not enabled so I cannot login. How can I remove the current instance and create a new db instance? Or is there a better solution exists?
[ "Assuming you are a member of the Windows Admininstrator group, you can put the server in Single User mode, you could try this -\nhttp://blogs.msdn.com/raulga/archive/2007/07/12/disaster-recovery-what-to-do-when-the-sa-account-password-is-lost-in-sql-server-2005.aspx\n", "My read of the question was that the serv...
[ 2, 2, 0 ]
[]
[]
[ "sql_server", "sql_server_2005" ]
stackoverflow_0000018772_sql_server_sql_server_2005.txt
Q: Batch code indenters and beautifiers Does anyone here know of good batch file code indenters or beautifiers? Specifically for PHP, JS and SGML-languages. Preferably with options as to style. A: The following page has code on it to tidy Javascript (written in javascript as well): http://www.howtocreate.co.uk/tuto...
Batch code indenters and beautifiers
Does anyone here know of good batch file code indenters or beautifiers? Specifically for PHP, JS and SGML-languages. Preferably with options as to style.
[ "The following page has code on it to tidy Javascript (written in javascript as well):\nhttp://www.howtocreate.co.uk/tutorials/jsexamples/JSTidy.html\nThere are various ways to tidy SGML based files (i.e. XML) - HTMLTidy will often do the trick, and there are various 'pretty print' implementations in various langua...
[ 1, 1 ]
[]
[]
[ "coding_style", "html", "javascript", "php" ]
stackoverflow_0000018858_coding_style_html_javascript_php.txt
Q: What's the difference between a Table Scan and a Clustered Index Scan? Since both a Table Scan and a Clustered Index Scan essentially scan all records in the table, why is a Clustered Index Scan supposedly better? As an example - what's the performance difference between the following when there are many records?:...
What's the difference between a Table Scan and a Clustered Index Scan?
Since both a Table Scan and a Clustered Index Scan essentially scan all records in the table, why is a Clustered Index Scan supposedly better? As an example - what's the performance difference between the following when there are many records?: declare @temp table( SomeColumn varchar(50) ) insert into @temp select...
[ "In a table without a clustered index (a heap table), data pages are not linked together - so traversing pages requires a lookup into the Index Allocation Map.\nA clustered table, however, has it's data pages linked in a doubly linked list - making sequential scans a bit faster. Of course, in exchange, you have the...
[ 86, 5 ]
[ "A table scan has to examine every single row of the table. The clustered index scan only needs to scan the index. It doesn't scan every record in the table. That's the point, really, of indices.\n" ]
[ -3 ]
[ "indexing", "sql", "sql_server" ]
stackoverflow_0000018764_indexing_sql_sql_server.txt
Q: Modifying Cruise Control.NET We are investigating using CruiseControl.NET as both a Continues Integration build provider, as well as automating the first part of our deployment process. Has anyone modified CruiseControl.NET's dashboard to add custom login and user roles (IE, Separate out access to forcing a build ...
Modifying Cruise Control.NET
We are investigating using CruiseControl.NET as both a Continues Integration build provider, as well as automating the first part of our deployment process. Has anyone modified CruiseControl.NET's dashboard to add custom login and user roles (IE, Separate out access to forcing a build to only certain individuals on a p...
[ "@Keith:\nWe are leveraging CC.NET to both run a CI build, as well as being able to use the Force Build feature to do a Build + Deploy. That is why we want hands off the dashboard.\nI found this morning that I was able to place CCNET in a virtual directory within another web app, This allowed me to setup Forms Auth...
[ 3, 2 ]
[]
[]
[ "cruisecontrol.net", "nvelocity" ]
stackoverflow_0000018093_cruisecontrol.net_nvelocity.txt
Q: .NET VirtualPathProviders and Pre-Compilation We've been working on an application that quite heavily relies on VirtualPathProviders in ASP.NET. We've just come to put the thing on a live server to demonstrate it and it appears that the VirtualPathProviders simply don't work when the site is pre-compiled!! I've be...
.NET VirtualPathProviders and Pre-Compilation
We've been working on an application that quite heavily relies on VirtualPathProviders in ASP.NET. We've just come to put the thing on a live server to demonstrate it and it appears that the VirtualPathProviders simply don't work when the site is pre-compiled!! I've been looking at the workaround which has been posted ...
[ "Unfortunately that is not officially supported. See the following MSDN article.\n\nIf a Web site is precompiled for deployment, content provided by a VirtualPathProvider instance is not compiled, and no VirtualPathProvider instances are used by the precompiled site. \n\nThe site you referred to is an unofficial wo...
[ 4 ]
[]
[]
[ "asp.net", "virtualpathprovider" ]
stackoverflow_0000012397_asp.net_virtualpathprovider.txt
Q: Warning C4341 - 'XX': signed value is out of range for enum constant When compiling my C++ .Net application I get 104 warnings of the type: Warning C4341 - 'XX': signed value is out of range for enum constant Where XX can be WCHAR LONG BIT BINARY GUID ... I can't seem to remove these warnings whatever I do. Whe...
Warning C4341 - 'XX': signed value is out of range for enum constant
When compiling my C++ .Net application I get 104 warnings of the type: Warning C4341 - 'XX': signed value is out of range for enum constant Where XX can be WCHAR LONG BIT BINARY GUID ... I can't seem to remove these warnings whatever I do. When I double click on them it takes me to a part of my code that uses OdbcPa...
[ "This is a compiler bug. Here's another post confirming it's a known issue. I've got the same issue in one of my projects and there's no way to prevent it from being triggered unless you have some way of avoiding the use of OdbcParameter. The most conservative way to suppress only the buggy warnings is to use\n#pr...
[ 4, 3, 0 ]
[]
[]
[ ".net", "c++", "visual_c++" ]
stackoverflow_0000017786_.net_c++_visual_c++.txt
Q: .NET 3.5 SP1 and aspnet_client Crystal Reports I recently (a few days ago) installed .NET 3.5 SP1 and subsequently an aspnet_client folder with a bunch of Crystal Reports support code has been injected into my .net web apps. Anybody else experienced this? Am I correct in saying that this is a side effect of SP1? W...
.NET 3.5 SP1 and aspnet_client Crystal Reports
I recently (a few days ago) installed .NET 3.5 SP1 and subsequently an aspnet_client folder with a bunch of Crystal Reports support code has been injected into my .net web apps. Anybody else experienced this? Am I correct in saying that this is a side effect of SP1? What is this?
[ "No it is a side effect of Crystal Reports. If you don't need it, remove it from your computer it is nothing but a headache. It is safe to delete the aspnet_client folder.\n", "What do you need to remove? It keeps on adding that folder back to the project that I'm working on...\n" ]
[ 1, 0 ]
[]
[]
[ ".net", ".net_3.5", "asp.net", "crystal_reports" ]
stackoverflow_0000013545_.net_.net_3.5_asp.net_crystal_reports.txt
Q: Should menu items always be enabled? And how do you tell the user? One of the things that has been talked about a few times on the podcast is whether menu items should always be enabled to prevent "WHY ISN'T THIS AVAILABLE!" frustration for the end user. This strikes me as a good idea, but then there's the issue o...
Should menu items always be enabled? And how do you tell the user?
One of the things that has been talked about a few times on the podcast is whether menu items should always be enabled to prevent "WHY ISN'T THIS AVAILABLE!" frustration for the end user. This strikes me as a good idea, but then there's the issue of communicating the lack of availability (and the reason why) to the use...
[ "One thing I've seen a printer manufacturer do with their printer properties dialog is to have a little help baloon icon beside disabled items that display a tooltip when hovered over.\nAnother thing you can do with disabled items is to add in parenthesis why it's disabled or what the user would have to do to enabl...
[ 4, 2, 0, 0 ]
[]
[]
[ "menu_items", "usability", "user_interface" ]
stackoverflow_0000019113_menu_items_usability_user_interface.txt
Q: Programming Glossary As I browse through the site, I find a lot of terms that many developers just starting out (and even some advanced developers) may be unfamiliar with. It would be great if people could post here with a term and definition that might be unknown to beginners or those from different programming b...
Programming Glossary
As I browse through the site, I find a lot of terms that many developers just starting out (and even some advanced developers) may be unfamiliar with. It would be great if people could post here with a term and definition that might be unknown to beginners or those from different programming backgrounds. Some not-so-c...
[ "\nhttp://en.wikipedia.org/wiki/Boxing_(Computer_science)#Boxing\nhttp://en.wikipedia.org/wiki/Tuples\nhttp://en.wikipedia.org/wiki/Orthogonal#Computer_science\nhttp://en.wikipedia.org/wiki/Domain_driven_design\nhttp://en.wikipedia.org/wiki/Test_driven_development\n\nSomeone may have beat us to it ;)\n", "http://...
[ 1, 1, 1, 1, 1 ]
[]
[]
[ "glossary", "language_agnostic" ]
stackoverflow_0000015729_glossary_language_agnostic.txt
Q: PHP Script to populate MySQL tables Is anyone aware of a script/class (preferably in PHP) that would parse a given MySQL table's structure and then fill it with x number of rows of random test data based on the field types? I have never seen or heard of something like this and thought I would check before writing...
PHP Script to populate MySQL tables
Is anyone aware of a script/class (preferably in PHP) that would parse a given MySQL table's structure and then fill it with x number of rows of random test data based on the field types? I have never seen or heard of something like this and thought I would check before writing one myself.
[ "What you are after would be a data generator.\nThere is one available here which i had bookmarked but i haven't got around to trying it yet.\n" ]
[ 21 ]
[]
[]
[ "dataset", "mysql", "php", "test_data", "testing" ]
stackoverflow_0000019162_dataset_mysql_php_test_data_testing.txt
Q: How do I do an Upsert Into Table? I have a view that has a list of jobs in it, with data like who they're assigned to and the stage they are in. I need to write a stored procedure that returns how many jobs each person has at each stage. So far I have this (simplified): DECLARE @ResultTable table ( StaffName nv...
How do I do an Upsert Into Table?
I have a view that has a list of jobs in it, with data like who they're assigned to and the stage they are in. I need to write a stored procedure that returns how many jobs each person has at each stage. So far I have this (simplified): DECLARE @ResultTable table ( StaffName nvarchar(100), Stage1Count int, Stage...
[ "Actually, I think you're making it much harder than it is. Won't this code work for what you're trying to do?\nSELECT StaffName, SUM(InStage1) AS 'JobsAtStage1', SUM(InStage2) AS 'JobsAtStage2'\n FROM ViewJob\nGROUP BY StaffName\n\n", "You could just check for existence and use the appropriate command. I belie...
[ 3, 2, 1, 1, 0, 0 ]
[]
[]
[ "sql", "sql_server", "tsql" ]
stackoverflow_0000019089_sql_sql_server_tsql.txt
Q: How to make a tree in C++? How do I make a tree data structure in C++ that uses iterators instead of pointers? I couldn't find anything in the STL that can do this. What I would like to do is to be able to create and manipulate trees like this: #include <iostream> #include <tree> using namespace std; int main()...
How to make a tree in C++?
How do I make a tree data structure in C++ that uses iterators instead of pointers? I couldn't find anything in the STL that can do this. What I would like to do is to be able to create and manipulate trees like this: #include <iostream> #include <tree> using namespace std; int main() { tree<int> myTree; tr...
[ "Here is tree.hh which is a bit close to what you want to do, though a bit\ndifferent.\nHere is a piece of code extracted from its website.\nint main(int, char **)\n {\n tree<string> tr;\n tree<string>::iterator top, one, two, loc, banana;\n\n top=tr.begin();\n one=tr.insert(top, \"one\");\n two=tr.app...
[ 5, 3 ]
[]
[]
[ "c++", "iterator", "tree" ]
stackoverflow_0000019193_c++_iterator_tree.txt
Q: Calling base Methods When Overriding Page Level Events In my code behind I wire up my events like so: protected override void OnInit(EventArgs e) { base.OnInit(e); btnUpdateUser.Click += btnUpateUserClick; } I've done it this way because that's what I've seen in examples. Does the base.OnInit() method n...
Calling base Methods When Overriding Page Level Events
In my code behind I wire up my events like so: protected override void OnInit(EventArgs e) { base.OnInit(e); btnUpdateUser.Click += btnUpateUserClick; } I've done it this way because that's what I've seen in examples. Does the base.OnInit() method need to be called? Will it be implicitly be called? Is it b...
[ "I should clarify:\nThe guidelines recommend that firing an event should involve calling a virtual \"OnEventName\" method, but they also say that if a derived class overrides that method and forgets to call the base method, the event should still fire.\nSee the \"Important Note\" about halfway down this page:\n\nDe...
[ 3, 0, 0, 0, 0, 0 ]
[]
[]
[ "asp.net", "events", "webforms" ]
stackoverflow_0000019294_asp.net_events_webforms.txt
Q: What did I do wrong here? [Javascript Regex] So I am writing a registration form and I need the display name to be only numbers, letters and underscores. Have a look at my code and tell me what I'm doing wrong. <form method="post" action="/" onsubmit="return check_form()"> <input type="text" id="display-name"...
What did I do wrong here? [Javascript Regex]
So I am writing a registration form and I need the display name to be only numbers, letters and underscores. Have a look at my code and tell me what I'm doing wrong. <form method="post" action="/" onsubmit="return check_form()"> <input type="text" id="display-name" name="display-name" maxlength="255" /> <input...
[ "Your regex\n/^([a-zA-Z0-9_])+/\n\nLooks for \n\nStart of string(check), followed by\n1 or more letters, numbers, or underscore (check)\n\nAnd then whatever comes after it doesn't matter. This regex will match anything at all so long as it begins with a letter, number, or underscore\nIf you put a $ at the end, then...
[ 14, 6, 0, 0, 0, 0, 0, 0 ]
[]
[]
[ "javascript", "regex" ]
stackoverflow_0000018861_javascript_regex.txt
Q: Calling ASP.NET web service from ASP using SOAPClient I have an ASP.NET webservice with along the lines of: [WebService(Namespace = "http://internalservice.net/messageprocessing")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ToolboxItem(false)] public class ProvisioningService : WebService { ...
Calling ASP.NET web service from ASP using SOAPClient
I have an ASP.NET webservice with along the lines of: [WebService(Namespace = "http://internalservice.net/messageprocessing")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ToolboxItem(false)] public class ProvisioningService : WebService { [WebMethod] public XmlDocument ProcessMessage(XmlDocum...
[ "Kev,\nI found the solution, but its not trivial.\nYou need to create a custom implementation of IHeaderHandler that creates the proper headers.\nThere is a good step by step here:\nhttp://msdn.microsoft.com/en-us/library/ms980699.aspx\nEDIT: I saw your update. Nice workaround, you might want to bookmark this link ...
[ 1, 0, 0 ]
[]
[]
[ ".net", "asp.net", "asp_classic", "soap", "web_services" ]
stackoverflow_0000019318_.net_asp.net_asp_classic_soap_web_services.txt
Q: How to manage Configuration Settings for each Developer In a .NET project, say you have a configuration setting - like a connection string - stored in a app.config file, which is different for each developer on your team (they may be using a local SQL Server, or a specific server instance, or using a remote server...
How to manage Configuration Settings for each Developer
In a .NET project, say you have a configuration setting - like a connection string - stored in a app.config file, which is different for each developer on your team (they may be using a local SQL Server, or a specific server instance, or using a remote server, etc). How can you structure your solution so that each dev...
[ "AppSettings can be overridden with a local file:\n<appSettings file=\"localoveride.config\"/>\n\nThis allows for each developer to keep their own local settings.\nAs far as the connection string, in a perfect world all developers should connect to a test DB, not run SQL Server each.\nHowever, I've found it best to...
[ 4, 3, 0, 0, 0 ]
[]
[]
[ ".net", "configuration_files" ]
stackoverflow_0000019355_.net_configuration_files.txt
Q: Bash Pipe Handling Does anyone know how bash handles sending data through pipes? cat file.txt | tail -20 Does this command print all the contents of file.txt into a buffer, which is then read by tail? Or does this command, say, print the contents of file.txt line by line, and then pause at each line for tail to p...
Bash Pipe Handling
Does anyone know how bash handles sending data through pipes? cat file.txt | tail -20 Does this command print all the contents of file.txt into a buffer, which is then read by tail? Or does this command, say, print the contents of file.txt line by line, and then pause at each line for tail to process, and then ask for...
[ "I decided to write a slightly more detailed explanation.\nThe \"magic\" here lies in the operating system. Both programs do start up at roughly the same time, and run at the same time (the operating system assigns them slices of time on the processor to run) as every other simultaneously running process on your co...
[ 55, 1, 0 ]
[]
[]
[ "bash", "device", "linux", "pipe" ]
stackoverflow_0000019122_bash_device_linux_pipe.txt
Q: IIS 6/COM+ hangs I have a web application that sometimes just hangs over heavy load. To make it come back I have to kill the "dllhost.exe" process. Does someone know what to do? This is an Classic ASP (VBScript) app with lots of COM+ objects. The server has the following configuration: Intel Core 2 Duo 2.2 GHz / ...
IIS 6/COM+ hangs
I have a web application that sometimes just hangs over heavy load. To make it come back I have to kill the "dllhost.exe" process. Does someone know what to do? This is an Classic ASP (VBScript) app with lots of COM+ objects. The server has the following configuration: Intel Core 2 Duo 2.2 GHz / 4 GB RAM Windows Serve...
[ "You have a memory leak :)\nThis blog entry is my bible for IIS troubleshooting:\nhttp://blogs.msdn.com/david.wang/archive/2005/12/31/HOWTO_Basics_of_IIS6_Troubleshooting.aspx\nIf you can't audit your code and find where the reference leaks are, an alternative is to recycle the application by restarting IIS every 2...
[ 2, 2, 1 ]
[]
[]
[ "asp_classic", "crash", "dll", "iis" ]
stackoverflow_0000019245_asp_classic_crash_dll_iis.txt
Q: Anyway to stop Windows bringing app to front when displaying a context menu on tray icon? We are experiencing this annoying problem where we have a context menu on our tray icon, if we display this context menu we have to SetForegroundWindow and bring it to the front. This is really annoying and not at all what we...
Anyway to stop Windows bringing app to front when displaying a context menu on tray icon?
We are experiencing this annoying problem where we have a context menu on our tray icon, if we display this context menu we have to SetForegroundWindow and bring it to the front. This is really annoying and not at all what we want. Is there a workaround, I notice that Outlook MS Messenger and other MS apps do not suffe...
[ "Are you using ContextMenu or ContextMenuStrip?\nYour saying that opening the ContextMenu on a trayicon focuses all app forms?\nI have not experienced that, though I use the newer ContextMenuStrip class, not ContextMenu for my trayicons.\nEDIT: Would be nice to know if you are using Windows.Forms or WIN32, or MFC o...
[ 2 ]
[]
[]
[ "menu", "trayicon", "windows" ]
stackoverflow_0000019401_menu_trayicon_windows.txt
Q: What is a good free library for editing MP3s/FLACs? What is a good free library for editing MP3s/FLACs. By editing I mean: Cutting audio file into multiple parts Joining multiple audio files together Increase playback speed of file without affecting the pitch (eg. podcasts up to 1.3x) Re-encoding audio file from...
What is a good free library for editing MP3s/FLACs?
What is a good free library for editing MP3s/FLACs. By editing I mean: Cutting audio file into multiple parts Joining multiple audio files together Increase playback speed of file without affecting the pitch (eg. podcasts up to 1.3x) Re-encoding audio file from Flac -> MP3 or vice versa I don't mean software, I mean...
[ "Just about every language has bindings to C, so you'll probably want to get the applicable C libraries for encoding/decoding mp3's and FLAC files. This list might include\nlibFLAC http://flac.sourceforge.net/api/index.html FLAC encoding/decoding\nLAME http://lame.sourceforge.net/index.php MP3 encoding\nMAD http:/...
[ 5, 1, 1 ]
[]
[]
[ "audio" ]
stackoverflow_0000019433_audio.txt
Q: how to allow files starting with period and no extension in windows 2003 server? How can I create this file in a directory in windows 2003 SP2: .hgignore I get error: You must type a file name. A: That's a "feature" of Windows Explorer. Try to create your files from a command line (or from a batch/program you w...
how to allow files starting with period and no extension in windows 2003 server?
How can I create this file in a directory in windows 2003 SP2: .hgignore I get error: You must type a file name.
[ "That's a \"feature\" of Windows Explorer. Try to create your files from a command line (or from a batch/program you wrote) and it should work fine. Try this from a dos prompt:\necho Hello there! > .hgignore\n\n", "By the way Raymond Chen had a blog post about this topic a while back:\nWhy doesn't Explorer let yo...
[ 27, 5 ]
[]
[]
[ "hgignore", "mercurial", "windows_server_2003" ]
stackoverflow_0000019442_hgignore_mercurial_windows_server_2003.txt
Q: Weird yellow bar pops-up: 'Microsoft Data Access - Remote Data Services When I access my site from any computer, I see this warning popping up: "This web site wants to run the following add-on: 'Microsoft Data Access - Remote Data Services Dat...' from 'Microsoft Corporation'. If you trust the web site and t...
Weird yellow bar pops-up: 'Microsoft Data Access - Remote Data Services
When I access my site from any computer, I see this warning popping up: "This web site wants to run the following add-on: 'Microsoft Data Access - Remote Data Services Dat...' from 'Microsoft Corporation'. If you trust the web site and the add-on and want to allow it to run, click here..." I am guessing this i...
[ "Id be very concerned if this is on your own server.\nI found the following blog post that warns on the issue: http://msmvps.com/blogs/hostsnews/archive/2007/09/13/can-you-spot-the-fake.aspx but doesn't provide any way of removing it.\nI'd recommend making sure both the server and the client are up to date on Windo...
[ 3 ]
[]
[]
[ "internet_explorer_7", "security" ]
stackoverflow_0000019471_internet_explorer_7_security.txt
Q: Delete Datalist row with multiple primary keys I have a datalist with a OnDeleteCommand="Delete_Command". I want the delete a record with multiple primary Keys but I do not know how to access it from the Delete_Command event. If I use DataKeyField I'm limited to only one key. Any workarounds for this? A: You can...
Delete Datalist row with multiple primary keys
I have a datalist with a OnDeleteCommand="Delete_Command". I want the delete a record with multiple primary Keys but I do not know how to access it from the Delete_Command event. If I use DataKeyField I'm limited to only one key. Any workarounds for this?
[ "You can access all of the keys:\ngridView.DataKeys[rowNum][dataKeyName]\n\nwhere rowNum is e.RowIndex from the gridView_RowDeleting event handler, and dataKeyName is the key you want to get:\n<asp:GridView ID=\"gridView\" runat=\"server\" DataKeyNames=\"userid, id1, id2, id3\" OnRowDeleting=\"gridView_RowDeleting\...
[ 1, 0 ]
[]
[]
[ "asp.net" ]
stackoverflow_0000019436_asp.net.txt
Q: AnkhSVN Cannot Connect Due to Proxy Alright, this might be a bit of a long shot, but I have having problems getting AnkhSVN to connect from Visual Studio 2005 to an external SVN server. There is a network proxy in the way, but I can't seem to find a way in AnkhSVN to configure the proxy and doesn't seem to be dete...
AnkhSVN Cannot Connect Due to Proxy
Alright, this might be a bit of a long shot, but I have having problems getting AnkhSVN to connect from Visual Studio 2005 to an external SVN server. There is a network proxy in the way, but I can't seem to find a way in AnkhSVN to configure the proxy and doesn't seem to be detecting the Internet Explorer proxy configu...
[ "Current version of AnkhSVN does not provide a GUI for proxy settings, but you can hand-edit the servers file (which is a simple .ini) and it should work. \nServers file resides in: C:\\Documents and Settings\\YOU\\Application Data\\Subversion (or wherever your APP_DATA is)\n", "You can also use TortoiseSVN for e...
[ 5, 5 ]
[]
[]
[ "ankhsvn", "proxy", "svn", "visual_studio", "visual_studio_2005" ]
stackoverflow_0000017984_ankhsvn_proxy_svn_visual_studio_visual_studio_2005.txt
Q: Best way to structure a repository in Subversion for Visual Studio projects? I have a few C# .dll projects which are common to many applications. Currently, I have one big repository. I have each DLL stored as a separate project within the repository and every application project stored as a project within the sa...
Best way to structure a repository in Subversion for Visual Studio projects?
I have a few C# .dll projects which are common to many applications. Currently, I have one big repository. I have each DLL stored as a separate project within the repository and every application project stored as a project within the same repository. I recently switched to Subversion for source control and I fear tha...
[ "Subversion repositories are typical sub-divided into:\nbranch/\ntags/\ntrunk/\n\nYou would either place all of your DLL and application projects into the trunk and then use branch and tags for all of them as necessary too:\nbranch/\ntags/\ntrunk/\n project1/\n project2/\n\nAlternatively, you could create fol...
[ 9, 4, 0, 0, 0, 0 ]
[]
[]
[ "svn" ]
stackoverflow_0000015621_svn.txt
Q: Which RDBMS should I use? I have developed a high speed transactional server for transfering data over the internet so I do not need to rely upon a database implementation like MySQL to provide this. That opens up the question of which SQL version to use? I really like SQLite, but I am not convinced it is industri...
Which RDBMS should I use?
I have developed a high speed transactional server for transfering data over the internet so I do not need to rely upon a database implementation like MySQL to provide this. That opens up the question of which SQL version to use? I really like SQLite, but I am not convinced it is industrial strength yet What I do like ...
[ "SQLite is used in more applications than any other DB. (Citation required).\nThere are some issues with MySQL, like that it doesn't respect foreign integrity constraints.\nI'm currently a fan of PostgreSQL, which is also freely available (and, I think if you read the licensing of MySQL, actually turns out to have...
[ 3, 1 ]
[]
[]
[ "sql" ]
stackoverflow_0000019458_sql.txt
Q: mod_rewrite rule to redirect all requests except for one specific path I'm trying to redirect all requests to my domain to another domain using mod_rewrite in an Apache 2.2 VirtualHost declaration. There is one exception to this -- I'd like all requests to the /audio path not to be redirected. I've written a Rewr...
mod_rewrite rule to redirect all requests except for one specific path
I'm trying to redirect all requests to my domain to another domain using mod_rewrite in an Apache 2.2 VirtualHost declaration. There is one exception to this -- I'd like all requests to the /audio path not to be redirected. I've written a RewriteCond and RewriteRule to do this but it's not quite right and I can't figu...
[ "The HTTP_HOST only contains the host name, not the path of the URL requested.\nRewriteCond %{REQUEST_URI} !^/audio\n\nShould be all you need.\nFurther, you can get debug info from the rewrite engine with the following, which is really useful to see how your conditions and rules are being matched:\nRewriteLog /path...
[ 48 ]
[]
[]
[ "apache", "mod_rewrite" ]
stackoverflow_0000019493_apache_mod_rewrite.txt
Q: Accessing a CONST attribute of series of Classes This is how I wanted to do it which would work in PHP 5.3.0+ <?php class MyClass { const CONSTANT = 'Const var'; } $classname = 'MyClass'; echo $classname::CONSTANT; // As of PHP 5.3.0 ?> But I'm restricted to using PHP 5.2.6. C...
Accessing a CONST attribute of series of Classes
This is how I wanted to do it which would work in PHP 5.3.0+ <?php class MyClass { const CONSTANT = 'Const var'; } $classname = 'MyClass'; echo $classname::CONSTANT; // As of PHP 5.3.0 ?> But I'm restricted to using PHP 5.2.6. Can anyone think of a simple way to simulate this behav...
[ "You can accomplish this without using eval in pre-5.3 code. Just use the constant function:\n<?php\n\nclass MyClass\n{\n const CONSTANT = 'Const var';\n}\n\n$classname = 'MyClass';\necho constant(\"$classname::CONSTANT\");\n\n?>\n\n" ]
[ 10 ]
[ "If you absolutly need to access a constant like that, you can do this:\n<?php\nclass MyClass\n{\n const CONSTANT = 'Const var';\n}\n\n$classname = 'MyClass';\necho eval( 'return '.$classname.'::CONSTANT;' );\n?>\n\nBut, if i were you, I'd try not to use eval.\n" ]
[ -1 ]
[ "oop", "php" ]
stackoverflow_0000005459_oop_php.txt
Q: How to find an implementation of a C# interface in the current assembly with a specific name? I have an Interface called IStep that can do some computation (See "Execution in the Kingdom of Nouns"). At runtime, I want to select the appropriate implementation by class name. // use like this: IStep step = GetStep(s...
How to find an implementation of a C# interface in the current assembly with a specific name?
I have an Interface called IStep that can do some computation (See "Execution in the Kingdom of Nouns"). At runtime, I want to select the appropriate implementation by class name. // use like this: IStep step = GetStep(sName);
[ "Your question is very confusing...\nIf you want to find types that implement IStep, then do this:\nforeach (Type t in Assembly.GetCallingAssembly().GetTypes())\n{\n if (!typeof(IStep).IsAssignableFrom(t)) continue;\n Console.WriteLine(t.FullName + \" implements \" + typeof(IStep).FullName);\n}\n\nIf you know alr...
[ 8, 2, 1, 0 ]
[]
[]
[ "c#", "linq", "linq_to_objects", "reflection" ]
stackoverflow_0000019656_c#_linq_linq_to_objects_reflection.txt
Q: Different solutions/project files for Local vs Build environments As part of improvements to our build process, we are currently debating whether we should have separate project/solution files on our CI production environment from our local development environments. The reason this has come about is because of ref...
Different solutions/project files for Local vs Build environments
As part of improvements to our build process, we are currently debating whether we should have separate project/solution files on our CI production environment from our local development environments. The reason this has come about is because of reference problems we experienced in our previous project. On a frequent ...
[ "In our largest project (a system comprising of many applications) we have the following structure\n\n/3rdPartyAssemblies /App1 /App2 /App3 /.....\n\nAll external assemblies are added to 3rdPartyAssemblies/Vendor/Version/...\nWe have a CoreBuild.sln file which acts as an MSBuild script for all of the assemblies tha...
[ 1, 1, 0, 0, 0, 0 ]
[]
[]
[ "build_process" ]
stackoverflow_0000014674_build_process.txt
Q: What is your preferred method of sending complex data over a web service? It's 2008, and I'm still torn on this one. So I'm developing a web method that needs a complex type passed into it and returned from it. The two options I'm toying with are: Pass and return actual business objects with both data and behav...
What is your preferred method of sending complex data over a web service?
It's 2008, and I'm still torn on this one. So I'm developing a web method that needs a complex type passed into it and returned from it. The two options I'm toying with are: Pass and return actual business objects with both data and behavior. When wsdl.exe is run, it will automatically create proxy classes that con...
[ "I'd do a hybrid. I would use an object like this\npublic class TransferObject\n{\n public string Type { get; set; }\n public byte[] Data { get; set; }\n}\n\nthen i have a nice little utility that serializes an object then compresses it.\npublic static class CompressedSerializer\n{\n /// <summary>\n ///...
[ 4, 1, 1, 1 ]
[]
[]
[ ".net", "soap", "web_services", "wsdl" ]
stackoverflow_0000012982_.net_soap_web_services_wsdl.txt
Q: Interlocked.Exchange, but not for booleans? Is there an equivalent for Interlocked.Exchange for boolean? Such as an atomic exchange of values that returns the previous value and doesn't require locks? A: No; use integers instead of booleans. In principle such a thing could be written (cmpxchg, the underlying p...
Interlocked.Exchange, but not for booleans?
Is there an equivalent for Interlocked.Exchange for boolean? Such as an atomic exchange of values that returns the previous value and doesn't require locks?
[ "No; use integers instead of booleans.\nIn principle such a thing could be written (cmpxchg, the underlying processor instruction, can operate on 8, 16, 32, and 64-bit operands on x86, 8, 16, 32, 64, and 128-bit operands on x64), but in practice most APIs stick to pointer and double pointer (32 and 64-bit on x86, 6...
[ 8 ]
[]
[]
[ ".net", "multithreading" ]
stackoverflow_0000019713_.net_multithreading.txt
Q: Is Visual C++ memory managed by the Dot Net framework Recently, I've been dealing with an error with accessing MAPI via the .NET framework (as described in this article). I am now left with a series of memory access violation errors. To get past the issues, I have been trying to use this 3rd party component, which...
Is Visual C++ memory managed by the Dot Net framework
Recently, I've been dealing with an error with accessing MAPI via the .NET framework (as described in this article). I am now left with a series of memory access violation errors. To get past the issues, I have been trying to use this 3rd party component, which has a Visual C++ core. Unfortunately - we are still having...
[ "The two previous answers have mentioned \"Managed C++\", this is an old bolt-on that they did to allow you to use managed C++ in a .NET environment. It wasn't a first class citizen - unlike C++/CLI (link text. But to answer your original question, no, Visual C++ is not managed by the .NET runtime. Managed C++ & C+...
[ 1, 0, 0 ]
[]
[]
[ ".net", "memory", "visual_c++" ]
stackoverflow_0000019653_.net_memory_visual_c++.txt
Q: How do I unregister COM dlls initially added with RegSvr32 when the /u arg doesn't work? Right, initially ran: c:\regsvr32 Amazing.dll then, (accidentally - I might add) I must have run it again, and (indeed) again when new versions of 'Amazing.dll' were released. Yes - I know now I should've run: c:\regsvr32 /u ...
How do I unregister COM dlls initially added with RegSvr32 when the /u arg doesn't work?
Right, initially ran: c:\regsvr32 Amazing.dll then, (accidentally - I might add) I must have run it again, and (indeed) again when new versions of 'Amazing.dll' were released. Yes - I know now I should've run: c:\regsvr32 /u Amazing.dll beforehand - but hey! I forgot. To cut to the chase, when add the COM reference i...
[ "Your object's GUID's should not be changing. In other words, once you register the COM object, re-registering shouldn't be adding anything additional to the registry.\nUnless you added additional COM interfaces or objects to the project.\nIn any case, if this is a one time deal (and it sounds like it is), open reg...
[ 14, 4, 0 ]
[]
[]
[ "com", "dllregistration", "regsvr32", "visual_studio" ]
stackoverflow_0000019725_com_dllregistration_regsvr32_visual_studio.txt
Q: Local Currency String conversion I am maintaining an app for a client that is used in two locations. One in England and one in Poland. The database is stored in England and uses the format £1000.00 for currency, but the information is being gathered locally in Poland where 1000,00 is the format. My question is, in...
Local Currency String conversion
I am maintaining an app for a client that is used in two locations. One in England and one in Poland. The database is stored in England and uses the format £1000.00 for currency, but the information is being gathered locally in Poland where 1000,00 is the format. My question is, in VB6 is there a function that takes a ...
[ "The data is not actually stored as the string \"£1000.00\"; it's stored in some numeric format.\n\nSidebar: Usually databases are set up to store money amounts using either the decimal data type (also called money in some DBs), or as a floating point number (also called double).\nThe difference is that when it's s...
[ 8, 0, 0, 0 ]
[]
[]
[ "internationalization", "localization", "vb6" ]
stackoverflow_0000019786_internationalization_localization_vb6.txt
Q: What is the best strategy for retainment of large data sets? I'm leading a project where we'll be recording metrics data. I'd like to retain the data for years. However, I'd also like to keep the primary table from becoming bloated with data that, while necessary for long term trending, isn't required for short te...
What is the best strategy for retainment of large data sets?
I'm leading a project where we'll be recording metrics data. I'd like to retain the data for years. However, I'd also like to keep the primary table from becoming bloated with data that, while necessary for long term trending, isn't required for short term reporting. What is the best strategy for handling this situatio...
[ "We use both methods at my work, but slightly different, we keep all sales data in the primary table for 30 days, then at night (part of the nightly jobs) the days sales are rolled up into summaries (n qty of x product sold today ect) in a separate table for reporting reasons, and sales over 30 days are archived in...
[ 4, 4, 2, 2, 1 ]
[]
[]
[ "database_design", "dataset" ]
stackoverflow_0000019728_database_design_dataset.txt
Q: How do I redirect a user to a custom 404 page in ASP.NET MVC instead of throwing an exception? I want to be able to capture the exception that is thrown when a user requests a non-existent controller and re-direct it to a 404 page. How can I do this? For example, the user requests http://www.nosite.com/paeges/1 (s...
How do I redirect a user to a custom 404 page in ASP.NET MVC instead of throwing an exception?
I want to be able to capture the exception that is thrown when a user requests a non-existent controller and re-direct it to a 404 page. How can I do this? For example, the user requests http://www.nosite.com/paeges/1 (should be /pages/). How do I make it so they get re-directed to the 404 rather than the exception scr...
[ "Just use a route:\n// We couldn't find a route to handle the request. Show the 404 page.\nroutes.MapRoute(\"Error\", \"{*url}\",\n new { controller = \"Error\", action = \"404\" }\n);\n\nSince this will be a global handler, put it all the way at the bottom under the Default route.\n", "Take a look at this pa...
[ 16, 6, 1 ]
[]
[]
[ "asp.net_mvc", "exception", "routes" ]
stackoverflow_0000019941_asp.net_mvc_exception_routes.txt
Q: Introducing Python The company I used to work with has two developers working fulltime, and a handful of freelancers. They're in the process of hiring a new lead developer to try to bring order and management to the development. But, currently, one of the developers has seen the light of Django (the company has on...
Introducing Python
The company I used to work with has two developers working fulltime, and a handful of freelancers. They're in the process of hiring a new lead developer to try to bring order and management to the development. But, currently, one of the developers has seen the light of Django (the company has only developed in PHP to d...
[ "I recently introduced Python to my company, which does consulting work for the Post Office. I did this by waiting until there was a project for which I would be the only programmer, then getting permission to do this new project in Python. I then did another small project in Python with similarly impressive resu...
[ 15, 4, 2, 1, 1, 0, 0, 0 ]
[]
[]
[ "php", "python" ]
stackoverflow_0000019654_php_python.txt
Q: How do I stop MS Graph component popping up during Interop? When using Office Interop in C#, if you insert a chart object into a MS Word document, the Grap application loads up very briefly and then goes away. Is there a way to prevent this from happening? I have tried setting the Visible property of the applicati...
How do I stop MS Graph component popping up during Interop?
When using Office Interop in C#, if you insert a chart object into a MS Word document, the Grap application loads up very briefly and then goes away. Is there a way to prevent this from happening? I have tried setting the Visible property of the application instance to false to no effect. EDIT: The Visible property doe...
[ "This is common behaviour for a lot of component hosted in an executable binary. The host application will startup and then do the job. I don't know if there is a surefire way to prevent that since you have no control over the component nor over the process until the application is started and is responding.\nA hac...
[ 1 ]
[]
[]
[ "c#", "interop", "ms_office" ]
stackoverflow_0000019953_c#_interop_ms_office.txt
Q: Algorithm to perform RFC calculation in Java The RFC for a Java class is set of all methods that can be invoked in response to a message to an object of the class or by some method in the class. RFC = M + R where M = Number of methods in the class. R = Total number of other methods directly invoked from the M. T...
Algorithm to perform RFC calculation in Java
The RFC for a Java class is set of all methods that can be invoked in response to a message to an object of the class or by some method in the class. RFC = M + R where M = Number of methods in the class. R = Total number of other methods directly invoked from the M. Thinking C is the .class and J is the .java file of...
[ "You could use the Byte Code Engineering Library with binaries. You can use a DescendingVisitor to visit a class' members and references. I've used it to find class dependencies.\nAlternatively, you could reuse some model of the source files. I'm pretty sure the Java editor in the Eclipse JDT is backed by some form...
[ 2, 0, 0, 0 ]
[]
[]
[ "algorithm", "java", "reflection", "regex" ]
stackoverflow_0000019952_algorithm_java_reflection_regex.txt
Q: Is there a way to check to see if the user is currently idle? There is some documentation on the internet that shows that Windows changes the behavior of the NotifyIcon.BalloonTipShown command if the user is currently idle and this is detected by checking for keyboard and mouse events. I am currently working on an...
Is there a way to check to see if the user is currently idle?
There is some documentation on the internet that shows that Windows changes the behavior of the NotifyIcon.BalloonTipShown command if the user is currently idle and this is detected by checking for keyboard and mouse events. I am currently working on an application that spends most of its time in the system tray, but p...
[ "How about the Win32 LASTINPUTINFO function?\nusing System.Runtime.InteropServices;\n\n[DllImport(\"User32.dll\")] \nstatic extern bool GetLastInputInfo(ref LASTINPUTINFO plii);\n\nstruct LASTINPUTINFO \n{\n public uint cbSize;\n public uint dwTime;\n}\n\n", "Managed code\nCheck position of the mouse every ...
[ 4, 1, 0 ]
[]
[]
[ ".net", "tray", "user_interface", "windows" ]
stackoverflow_0000019185_.net_tray_user_interface_windows.txt
Q: Mixing 32 bit and 16 bit code with nasm This is a low-level systems question. I need to mix 32 bit and 16 bit code because I'm trying to return to real-mode from protected mode. As a bit of background information, my code is doing this just after GRUB boots so I don't have any pesky operating system to tell me wha...
Mixing 32 bit and 16 bit code with nasm
This is a low-level systems question. I need to mix 32 bit and 16 bit code because I'm trying to return to real-mode from protected mode. As a bit of background information, my code is doing this just after GRUB boots so I don't have any pesky operating system to tell me what I can and can't do. Anyway, I use [BITS 32]...
[ "The problem turned out to be that I wasn't setting up my descriptor tables correctly. I had one bit flipped wrong so instead of going to 16-bit mode I was going to 32-bit mode (with segments that happened to have a limit of one meg). \nThanks for the suggestions!\nTerry\n", "The 0x66 and 0x67 are opcodes that ar...
[ 6, 4, 0, 0 ]
[]
[]
[ "assembly", "nasm", "operating_system", "osdev" ]
stackoverflow_0000018324_assembly_nasm_operating_system_osdev.txt
Q: WinForms ComboBox data binding gotcha Assume you are doing something like the following List<string> myitems = new List<string> { "Item 1", "Item 2", "Item 3" }; ComboBox box = new ComboBox(); box.DataSource = myitems; ComboBox box2 = new ComboBox(); box2.DataSource = myitems So now we have 2 combo ...
WinForms ComboBox data binding gotcha
Assume you are doing something like the following List<string> myitems = new List<string> { "Item 1", "Item 2", "Item 3" }; ComboBox box = new ComboBox(); box.DataSource = myitems; ComboBox box2 = new ComboBox(); box2.DataSource = myitems So now we have 2 combo boxes bound to that array, and everything w...
[ "This has to do with how data bindings are set up in the dotnet framework, especially the BindingContext. On a high level it means that if you haven't specified otherwise each form and all the controls of the form share the same BindingContext. When you are setting the DataSource property the ComboBox will use the ...
[ 39, 22 ]
[]
[]
[ "c#", "data_binding", "winforms" ]
stackoverflow_0000000482_c#_data_binding_winforms.txt
Q: "Data Execution Prevention" kills (VS2008) local ASP.Net Development Server (aka Cassini) on Vista 64 Occasionally, I find that while debugging an ASP.Net application (written in visual studio 2008, running on Vista 64-bit) the local ASP.Net development server (i.e. 'Cassini') stops responding. A message often com...
"Data Execution Prevention" kills (VS2008) local ASP.Net Development Server (aka Cassini) on Vista 64
Occasionally, I find that while debugging an ASP.Net application (written in visual studio 2008, running on Vista 64-bit) the local ASP.Net development server (i.e. 'Cassini') stops responding. A message often comes up telling me that "Data Execution Prevention (DEP)" has killed WebDev.WebServer.exe The event logs simp...
[ "The only way to know for sure would be to dig through the Cassini source and see if there are any areas where it generates code on the heap and then executes it without clearing the NX flag.\nHowever, instead of doing that, why not use IIS?\nEDIT:\nThe danger of disabling DEP is that you open up security holes. DE...
[ 3, 2, 1, 1, 0 ]
[]
[]
[ "asp.net", "cassini", "dep" ]
stackoverflow_0000019349_asp.net_cassini_dep.txt
Q: Store data from a C# application I've recently taken up learning some C# and wrote a Yahtzee clone. My next step (now that the game logic is in place and functioning correctly) is to integrate some method of keeping stats across all the games played. My question is this, how should I go about storing this informa...
Store data from a C# application
I've recently taken up learning some C# and wrote a Yahtzee clone. My next step (now that the game logic is in place and functioning correctly) is to integrate some method of keeping stats across all the games played. My question is this, how should I go about storing this information? My first thought would be to us...
[ "Here is one idea: use Xml Serialization. Design your GameStats data structure and optionally use Xml attributes to influence the schema as you like. I like to use this method for small data sets because its quick and easy and all I need to do is design and manipulate the data structure.\n\nusing (FileStream fs =...
[ 17, 13, 7, 4, 3, 2, 1, 1, 1 ]
[]
[]
[ ".net", "c#" ]
stackoverflow_0000020061_.net_c#.txt
Q: Check for hung Office process when using Office Automation Is there a way to check to see if an Microsoft Office process (i.e. Word, Excel) has hung when using Office Automation? Additionally, if the process is hung, is there a way to terminate it? A: Let me start off saying that I don't recommend doing this in ...
Check for hung Office process when using Office Automation
Is there a way to check to see if an Microsoft Office process (i.e. Word, Excel) has hung when using Office Automation? Additionally, if the process is hung, is there a way to terminate it?
[ "Let me start off saying that I don't recommend doing this in a service on a server, but I'll do my best to answer the questions.\nRunning as a service makes it difficult to clean up. For example with what you have running as a service survive killing a hung word or excel. You may be in a position to have to kill...
[ 2, 1, 0 ]
[]
[]
[ "language_agnostic", "ms_office", "office_automation" ]
stackoverflow_0000009905_language_agnostic_ms_office_office_automation.txt
Q: C# application detected as a virus Regarding the same program as my question a few minutes ago... I added a setup project and built an MSI for the program (just to see if I could figure it out) and it works great except for one thing. When I tried to install it on my parent's laptop, their antivirus (the free Ava...
C# application detected as a virus
Regarding the same program as my question a few minutes ago... I added a setup project and built an MSI for the program (just to see if I could figure it out) and it works great except for one thing. When I tried to install it on my parent's laptop, their antivirus (the free Avast Home Edition) set off an alarm and ac...
[ "Indeed, boot from a clean CD (use a known good machine to build BartPE or something similar) and scan your machine thoroughly. Another good thing to check, though, would be exactly which virus Avast! thinks your program is. Once you know that, you should be able to look it up in one of the virus databases and in...
[ 3, 1, 0, 0 ]
[ "The very first thing to do would be to scan your build PC for viruses.\n" ]
[ -1 ]
[ ".net", "antivirus", "c#" ]
stackoverflow_0000020168_.net_antivirus_c#.txt
Q: Associating source and search keywords with account creation As a part of the signup process for my online application, I'm thinking of tracking the source and/or search keywords used to get to my site. This would allow me to see what advertising is working and from where with a somewhat finer grain than Google An...
Associating source and search keywords with account creation
As a part of the signup process for my online application, I'm thinking of tracking the source and/or search keywords used to get to my site. This would allow me to see what advertising is working and from where with a somewhat finer grain than Google Analytics would. I assume I could set some kind of cookie with this ...
[ "Your best bet IMO would be to use javascript to look for a cookie named \"origReferrer\" or something like that and if that cookie doesn't exist you should create one (with an expiry of ~24hours) and fill it with the current referrer.\nThat way you'll have preserved the original referrer all the way from your user...
[ 3 ]
[]
[]
[ "cookies", "ruby_on_rails", "seo" ]
stackoverflow_0000020286_cookies_ruby_on_rails_seo.txt
Q: How does the ASP.NET "Yellow Screen of Death" display code? I thought .Net code gets compiled into MSIL, so I always wondered how do Yellow Screens produce the faulty code. If it's executing the compiled code, how is the compiler able to produce code from the source files in the error message? Feel free to edit t...
How does the ASP.NET "Yellow Screen of Death" display code?
I thought .Net code gets compiled into MSIL, so I always wondered how do Yellow Screens produce the faulty code. If it's executing the compiled code, how is the compiler able to produce code from the source files in the error message? Feel free to edit this question/title, I know it doesn't really make sense.
[ "A .Net assembly is compiled with metadata about the bytecode included that allows easy decompilation of the code - that's how tools like .Net Reflector work. The PDB files are debug symbols only - the difference in the Yellow Screen Of Death is that you'll get line numbers in the stack trace.\nIn other words, you...
[ 9, 5, 3, 0, 0 ]
[]
[]
[ ".net", "asp.net", "yellow_screen_of_death" ]
stackoverflow_0000020198_.net_asp.net_yellow_screen_of_death.txt
Q: Is it possible to return objects from a WebService? Instead of returning a common string, is there a way to return classic objects? If not: what are the best practices? Do you transpose your object to xml and rebuild the object on the other side? What are the other possibilities? A: As mentioned, you can do thi...
Is it possible to return objects from a WebService?
Instead of returning a common string, is there a way to return classic objects? If not: what are the best practices? Do you transpose your object to xml and rebuild the object on the other side? What are the other possibilities?
[ "As mentioned, you can do this in .net via serialization. By default all native types are serializable so this happens automagically for you.\nHowever if you have complex types, you need to mark the object with the [Serializable] attribute. The same goes with complex types as properties.\nSo for example you need to...
[ 7, 5, 3, 2, 2, 1, 1, 1, 1, 0, 0 ]
[]
[]
[ "web_services" ]
stackoverflow_0000011879_web_services.txt
Q: Best way to keep an ordered list of windows (from most-recently created to oldest)? What is the best way to manage a list of windows (keeping them in order) to be able to promote the next window to the top-level when the current top-level window is closed. This is for a web application, so we're using jQuery Javas...
Best way to keep an ordered list of windows (from most-recently created to oldest)?
What is the best way to manage a list of windows (keeping them in order) to be able to promote the next window to the top-level when the current top-level window is closed. This is for a web application, so we're using jQuery Javascript. We'd talked through a few simplistic solutions, such as using an array and just tr...
[ "I don't really know javascript, but couldn't you create a stack of windows?\n", "A stack if you want to just close the window on top.\nA queue if you also need to open windows at the end.\n", "Stack/queue in JS is a simple array, which can be manipulated with .push(val), .pop(), .shift(val) and .unshift().\n" ...
[ 1, 1, 1 ]
[]
[]
[ "javascript" ]
stackoverflow_0000019970_javascript.txt
Q: PHP4 to PHP5 Migration What are some good steps to follow for a smooth migration from PHP4 to PHP5. What are some types of code that are likely to break? A: I also once worked on an app which used PHP4's XML support quite heavily, and would have required quite a bit of work to move to PHP5. One of the other sign...
PHP4 to PHP5 Migration
What are some good steps to follow for a smooth migration from PHP4 to PHP5. What are some types of code that are likely to break?
[ "I also once worked on an app which used PHP4's XML support quite heavily, and would have required quite a bit of work to move to PHP5.\nOne of the other significant changes I was looking at at the time was the change of the default handling of function parameters. In PHP4 if I remember, they were pass-by-copy unle...
[ 8, 2, 1, 1 ]
[]
[]
[ "migration", "php" ]
stackoverflow_0000006594_migration_php.txt
Q: PHP with SQL Server 2005+ Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database. But all the query work is done on the client side, I'd like to move some of this to PHP. What driver and/or connection string is needed to connect to Sql Svr and what is the syntax to use in PHP? Update: ...
PHP with SQL Server 2005+
Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database. But all the query work is done on the client side, I'd like to move some of this to PHP. What driver and/or connection string is needed to connect to Sql Svr and what is the syntax to use in PHP? Update: OK so I was definitely trying t...
[ "You have two options:\n1) php_mssql extension : If you'd like something that has the same API mysql and mysqli has, then use the php_mssql extension. But there is a catch, the bundled ntwdblib.dll file with PHP is not working. You have to find this file from a SQL Server 2000 installation or you can find it on the...
[ 5, 2, 0 ]
[]
[]
[ "php", "sql_server" ]
stackoverflow_0000019837_php_sql_server.txt
Q: Script to backup svn repository to network share I have a svn repo on my machine (Windows). Anyone have a script to back it up to a network share? I'm using the repo locally since I'm disconnected a lot. The network share is on a server with a backup strategy. I'm a perfect candidate for git/hg but I don't want to...
Script to backup svn repository to network share
I have a svn repo on my machine (Windows). Anyone have a script to back it up to a network share? I'm using the repo locally since I'm disconnected a lot. The network share is on a server with a backup strategy. I'm a perfect candidate for git/hg but I don't want to give up my VS integration just yet.
[ "\nsvnadmin dump C:\\SVNRepositorio\\Repositorio > \\Backups\\BkTmpSubversion\\subversiontemp.dump\n\nditto Spooky's reply ^^\nOn linux you might try adding \"| gzip\" in the middle\nalso take a look at the --incremental & --deltas flags\n\nsparkes: For some values of \"My machine\" that won't be local.\nAlso If yo...
[ 4, 3, 3 ]
[]
[]
[ "svn" ]
stackoverflow_0000020391_svn.txt
Q: Is it OK to drop sql statistics? We've been trying to alter a lot of columns from nullable to not nullable, which involves dropping all the associated objects, making the change, and recreating the associated objects. We've been using SQL Compare to generate the scripts, but I noticed that SQL Compare doesn't scri...
Is it OK to drop sql statistics?
We've been trying to alter a lot of columns from nullable to not nullable, which involves dropping all the associated objects, making the change, and recreating the associated objects. We've been using SQL Compare to generate the scripts, but I noticed that SQL Compare doesn't script statistic objects. Does this mean i...
[ "If you have update stats and auto create stats on then it should works as before\nYou can also run sp_updatestats or UPDATE STATISTICS WITH FULLSCAN after you make the changes\n", "It is considered best practice to auto create and auto update statistics. Sql Server will create them if it needs them. You will o...
[ 2, 2, 1, 0 ]
[]
[]
[ "scripting", "sql", "sql_server", "statistics" ]
stackoverflow_0000020392_scripting_sql_sql_server_statistics.txt
Q: How do you unit test web apps hosted remotely? I'm familiar with TDD and use it in both my workplace and my home-brewed web applications. However, every time I have used TDD in a web application, I have had the luxury of having full access to the web server. That means that I can update the server then run my un...
How do you unit test web apps hosted remotely?
I'm familiar with TDD and use it in both my workplace and my home-brewed web applications. However, every time I have used TDD in a web application, I have had the luxury of having full access to the web server. That means that I can update the server then run my unit tests directly from the server. My question is, ...
[ "I think I probably would have to argue that running unit tests on your production server isn't really part of TDD because by the time you deploy to your production environment technically speaking, you're past \"development\".\nI'm quite a stickler for TDD, and when I'm preaching the benefits to clients I often fi...
[ 3, 1, 1, 1, 0 ]
[]
[]
[ "tdd", "unit_testing", "web_applications" ]
stackoverflow_0000020511_tdd_unit_testing_web_applications.txt
Q: Path Display in Label Are there any automatic methods for trimming a path string in .NET? For example: C:\Documents and Settings\nick\My Documents\Tests\demo data\demo data.emx becomes C:\Documents...\demo data.emx It would be particularly cool if this were built into the Label class, and I seem to recall it is-...
Path Display in Label
Are there any automatic methods for trimming a path string in .NET? For example: C:\Documents and Settings\nick\My Documents\Tests\demo data\demo data.emx becomes C:\Documents...\demo data.emx It would be particularly cool if this were built into the Label class, and I seem to recall it is--can't find it though!
[ "Use TextRenderer.DrawText with TextFormatFlags.PathEllipsis flag\nvoid label_Paint(object sender, PaintEventArgs e)\n{\n Label label = (Label)sender;\n TextRenderer.DrawText(e.Graphics, label.Text, label.Font, label.ClientRectangle, label.ForeColor, TextFormatFlags.PathEllipsis);\n}\n\n\nYour code is 95% there. ...
[ 9, 4, 3, 0, 0 ]
[]
[]
[ ".net", "c#", "path", "winforms" ]
stackoverflow_0000020467_.net_c#_path_winforms.txt
Q: State of Registers After Bootup I'm working on a boot loader on an x86 machine. When the BIOS copies the contents of the MBR to 0x7c00 and jumps to that address, is there a standard meaning to the contents of the registers? Do the registers have standard values? I know that the segment registers are typically set ...
State of Registers After Bootup
I'm working on a boot loader on an x86 machine. When the BIOS copies the contents of the MBR to 0x7c00 and jumps to that address, is there a standard meaning to the contents of the registers? Do the registers have standard values? I know that the segment registers are typically set to 0, but will sometimes be 0x7c0. Wh...
[ "\nThis early execution environment is highly implementation defined, meaning the implementation of your particular BIOS. Never make any assumptions on the contents of registers. They might be initialized to 0, but they might contain a random value just as well. \n\nfrom the OS dev Wiki, which is where I get inform...
[ 8, 1, 1, 1, 1, 1, 1 ]
[]
[]
[ "bios", "boot" ]
stackoverflow_0000020336_bios_boot.txt
Q: Broken chart images in Crystal Reports in web application I have a collection of crystal reports that contains charts. They look fine locally and when printed, but when viewing them through a web application using a CrystalReportViewer the charts dispay as broken images. Viewing the properties of the broken ima...
Broken chart images in Crystal Reports in web application
I have a collection of crystal reports that contains charts. They look fine locally and when printed, but when viewing them through a web application using a CrystalReportViewer the charts dispay as broken images. Viewing the properties of the broken image show the url as ...CrystalImageHandler.aspx?dynamicimage=cr_...
[ "Maybe a permissions issue on the Crystal libraries?? I've run into that before with Crystal, not specfically the ImageHandler though.\n" ]
[ 1 ]
[]
[]
[ "crystal_reports", "web_applications" ]
stackoverflow_0000020201_crystal_reports_web_applications.txt
Q: why are downloads sometimes tagged md5, sha1 and other hash indicators? I've seen this all over the place: Download here! SHA1 = 8e1ed2ce9e7e473d38a9dc7824a384a9ac34d7d0 What does it mean? How does a hash come into play as far as downloads and... What use can I make of it? Is this a legacy item where you use...
why are downloads sometimes tagged md5, sha1 and other hash indicators?
I've seen this all over the place: Download here! SHA1 = 8e1ed2ce9e7e473d38a9dc7824a384a9ac34d7d0 What does it mean? How does a hash come into play as far as downloads and... What use can I make of it? Is this a legacy item where you used to have to verify some checksum after you downloaded the whole file?
[ "It's a security measure. It allows you to verify that the file you just downloaded is the one that the author posted to the site. Note that using hashes from the same website you're getting the files from is not especially secure. Often a good place to get them from is a mailing list announcement where a PGP-si...
[ 21, 6, 3, 2, 2, 2, 0 ]
[]
[]
[ "checksum", "download", "hash" ]
stackoverflow_0000020627_checksum_download_hash.txt
Q: Repository layout for large Maven projects I have a large application (~50 modules) using a structure similar to the following: Application Communication modules Color communication module SSN communication module etc. communication module Router module Service modules Voting service module Web interface s...
Repository layout for large Maven projects
I have a large application (~50 modules) using a structure similar to the following: Application Communication modules Color communication module SSN communication module etc. communication module Router module Service modules Voting service module Web interface submodule for voting Vote collector submodule...
[ "We have a largish application (160+ OSGi bundles where each bundle is a Maven module) and the lesson we learned, and continue to learn, is that flat is better. The problem with encoding semantics in your hierarchy is that you lose flexibility. A module that is 100% say \"communication\" today may be partly \"servi...
[ 16, 3 ]
[]
[]
[ "java", "maven_2", "svn" ]
stackoverflow_0000020003_java_maven_2_svn.txt
Q: YUI Reset CSS Makes this not work This line in YUI's Reset CSS is causing trouble for me: address,caption,cite,code,dfn,em,strong,th,var { font-style: normal; font-weight: normal; } It makes my em not italic and my strong not bold. Which is okay. I know how to override that in my own stylesheet. strong, b...
YUI Reset CSS Makes this not work
This line in YUI's Reset CSS is causing trouble for me: address,caption,cite,code,dfn,em,strong,th,var { font-style: normal; font-weight: normal; } It makes my em not italic and my strong not bold. Which is okay. I know how to override that in my own stylesheet. strong, b { font-weight: bold; } em, i { ...
[ "If your strong declaration comes after YUI's yours should override it. You can force it like this:\nstrong, b, strong *, b * { font-weight: bold; }\nem, i, em *, i * { font-style: italic; }\n\nIf you still support IE7 you'll need to add !important.\nstrong, b, strong *, b * { font-weight: bold !important; }\nem, i...
[ 19, 7, 6, 3, 2, 2, 2, 1, 0, 0 ]
[]
[]
[ "css", "yui" ]
stackoverflow_0000020107_css_yui.txt
Q: XRef Relationships in dbml So I have a database schema like this: Users UserId RoleUserXRef RoleUserId RoleId UserId Roles RoleId Name With foreign keys defined between User & RoleUserXRef and RoleUserXRef & Role. Basically, I have a one to many relationship between users and roles. How would I m...
XRef Relationships in dbml
So I have a database schema like this: Users UserId RoleUserXRef RoleUserId RoleId UserId Roles RoleId Name With foreign keys defined between User & RoleUserXRef and RoleUserXRef & Role. Basically, I have a one to many relationship between users and roles. How would I model this in dbml, such that the...
[ "Creating a many-to-many releationship via simple DBML manipulation is not supported currently. You can extend the partial class to manually create properties, if you really want that sort of functionality \"built in\".\n" ]
[ 1 ]
[]
[]
[ "linq_to_sql", "many_to_many", "oop" ]
stackoverflow_0000020765_linq_to_sql_many_to_many_oop.txt
Q: What's the best way to create ClickOnce deployments Our team develops distributed winform apps. We use ClickOnce for deployment and are very pleased with it. However, we've found the pain point with ClickOnce is in creating the deployments. We have the standard dev/test/production environments and need to be able ...
What's the best way to create ClickOnce deployments
Our team develops distributed winform apps. We use ClickOnce for deployment and are very pleased with it. However, we've found the pain point with ClickOnce is in creating the deployments. We have the standard dev/test/production environments and need to be able to create deployments for each of these that install and ...
[ "I would look at using msbuild. It has built in tasks for handling clickonce deployments. I included some references which will help you get started, if you want to go down this path. It is what I use and I have found it to fit my needs. With a good build process using msbuild, you should be able to accomplish ...
[ 14, 5 ]
[]
[]
[ "clickonce", "deployment", "winforms" ]
stackoverflow_0000020728_clickonce_deployment_winforms.txt
Q: How do you convert binary data to Strings and back in Java? I have binary data in a file that I can read into a byte array and process with no problem. Now I need to send parts of the data over a network connection as elements in an XML document. My problem is that when I convert the data from an array of bytes ...
How do you convert binary data to Strings and back in Java?
I have binary data in a file that I can read into a byte array and process with no problem. Now I need to send parts of the data over a network connection as elements in an XML document. My problem is that when I convert the data from an array of bytes to a String and back to an array of bytes, the data is getting co...
[ "String(byte[]) treats the data as the default character encoding. So, how bytes get converted from 8-bit values to 16-bit Java Unicode chars will vary not only between operating systems, but can even vary between different users using different codepages on the same machine! This constructor is only good for decod...
[ 36, 21, 2, 0 ]
[]
[]
[ "java", "serialization" ]
stackoverflow_0000020778_java_serialization.txt
Q: How do I move an item from one menu to another? In the Visual Studio designer, how do you move a menu item from one menu to another? I would assume drag and drop would work, but it seems to only work within a menu for me. I usually resort to editing the .Designer.cs files by hand. A: Right-click, cut, and paste ...
How do I move an item from one menu to another?
In the Visual Studio designer, how do you move a menu item from one menu to another? I would assume drag and drop would work, but it seems to only work within a menu for me. I usually resort to editing the .Designer.cs files by hand.
[ "Right-click, cut, and paste works just fine for me.\n" ]
[ 10 ]
[]
[]
[ "c#", "visual_studio_2005", "winforms" ]
stackoverflow_0000020814_c#_visual_studio_2005_winforms.txt
Q: Java JPanel redraw issues I have a Java swing application with a panel that contains three JComboBoxes that do not draw properly. The combox boxes just show up as the down arrow on the right side, but without the label of the currently selected value. The boxes will redraw correctly if the window is resized either...
Java JPanel redraw issues
I have a Java swing application with a panel that contains three JComboBoxes that do not draw properly. The combox boxes just show up as the down arrow on the right side, but without the label of the currently selected value. The boxes will redraw correctly if the window is resized either bigger or smaller by even one ...
[ "Can you give us some more information on how you add the combo boxes to the JPanel? This is a pretty common thing to do in Swing so I doubt that it's a JVM issue but I guess anything is possible.\nSpecifically, I would double check to make sure you're not accessing the GUI from any background threads. In this ca...
[ 6 ]
[]
[]
[ "java", "jpanel", "swing" ]
stackoverflow_0000020880_java_jpanel_swing.txt
Q: SQL2005: Linking a table to multiple tables and retaining Ref Integrity? Here is a simplification of my database: Table: Property Fields: ID, Address Table: Quote Fields: ID, PropertyID, BespokeQuoteFields... Table: Job Fields: ID, PropertyID, BespokeJobFields... Then we have other tables that relate to the Quot...
SQL2005: Linking a table to multiple tables and retaining Ref Integrity?
Here is a simplification of my database: Table: Property Fields: ID, Address Table: Quote Fields: ID, PropertyID, BespokeQuoteFields... Table: Job Fields: ID, PropertyID, BespokeJobFields... Then we have other tables that relate to the Quote and Job tables individually. I now need to add a Message table where users c...
[ "Create one Message table, containing a unique MessageId and the various properties you need to store for a message.\nTable: Message\nFields: Id, TimeReceived, MessageDetails, WhateverElse...\n\nCreate two link tables - QuoteMessage and JobMessage. These will just contain two fields each, foreign keys to the Quote/...
[ 4, 1, 1, 0 ]
[]
[]
[ "database", "referential_integrity", "sql_server_2005" ]
stackoverflow_0000019516_database_referential_integrity_sql_server_2005.txt
Q: VBScript/IIS - How do I automatically set ASP.NET version for a particular website I need to script the creation of app pools and websites on IIS 6.0. I have been able to create these using adsutil.vbs and iisweb.vbs, but don't know how to set the version of ASP.NET for the sites I have just created to 2.0.50727.0...
VBScript/IIS - How do I automatically set ASP.NET version for a particular website
I need to script the creation of app pools and websites on IIS 6.0. I have been able to create these using adsutil.vbs and iisweb.vbs, but don't know how to set the version of ASP.NET for the sites I have just created to 2.0.50727.0. Ideally I would like to adsutil.vbs to update the metabase. How do I do this?
[ "@Chris beat me to the punch on the ADSI way\nYou can do this using the aspnet_regiis.exe tool. There is one of these tools per version of ASP.NET installed on the machine. You could shell out to -\nThis configures ASP.NET 1.1\n%windir%\\microsoft.net\\framework\\v1.1.4322\\aspnet_regiis -s W3SVC/[iisnumber]/ROOT\n...
[ 6, 2 ]
[]
[]
[ "administration", "asp.net", "iis", "sysadmin", "vbscript" ]
stackoverflow_0000020923_administration_asp.net_iis_sysadmin_vbscript.txt
Q: How to encrypt connection string in WinForms 1.1 app.config? Just looking for the first step basic solution here that keeps the honest people out. Thanks, Mike A: This might help you along the way: http://msdn.microsoft.com/en-us/library/aa302403.aspx http://msdn.microsoft.com/en-us/library/aa302406.aspx The art...
How to encrypt connection string in WinForms 1.1 app.config?
Just looking for the first step basic solution here that keeps the honest people out. Thanks, Mike
[ "This might help you along the way:\nhttp://msdn.microsoft.com/en-us/library/aa302403.aspx\nhttp://msdn.microsoft.com/en-us/library/aa302406.aspx\nThe articles are aimed at ASP.NET but the principles are the same.\n", "The second piece of the puzzle is detecting an unencrypted connection string, encrypting it, an...
[ 0, 0 ]
[]
[]
[ "database", "winforms" ]
stackoverflow_0000017877_database_winforms.txt
Q: Best way to perform dynamic subquery in MS Reporting Services? I'm new to SQL Server Reporting Services, and was wondering the best way to do the following: Query to get a list of popular IDs Subquery on each item to get properties from another table Ideally, the final report columns would look like this: [ID] [...
Best way to perform dynamic subquery in MS Reporting Services?
I'm new to SQL Server Reporting Services, and was wondering the best way to do the following: Query to get a list of popular IDs Subquery on each item to get properties from another table Ideally, the final report columns would look like this: [ID] [property1] [property2] [SELECT COUNT(*) ...
[ "I would recommend using a SubReport. You would place the SubReport in a table cell.\n", "Simplest method is this:\nselect *,\n (select count(*) from tbl2 t2 where t2.tbl1ID = t1.tbl1ID) as cnt\nfrom tbl1 t1\n\nhere is a workable version (using table variables):\ndeclare @tbl1 table\n(\n tbl1ID int,\n prop1 varc...
[ 2, 0, 0 ]
[]
[]
[ "reporting", "reporting_services", "service", "sql", "sql_server" ]
stackoverflow_0000020876_reporting_reporting_services_service_sql_sql_server.txt
Q: Compact Framework/Threading - MessageBox displays over other controls after option is chosen I'm working on an app that grabs and installs a bunch of updates off an an external server, and need some help with threading. The user follows this process: Clicks button Method checks for updates, count is returned. If ...
Compact Framework/Threading - MessageBox displays over other controls after option is chosen
I'm working on an app that grabs and installs a bunch of updates off an an external server, and need some help with threading. The user follows this process: Clicks button Method checks for updates, count is returned. If greater than 0, then ask the user if they want to install using MessageBox.Show(). If yes, it runs...
[ "Your UI isn't updating because all the work is happening in the user interface thread.\nYour call to: \nthis.BeginInvoke((MethodInvoker)delegate() {update.Action.Run(); }) \n\nis saying invoke update.Action.Run() on the thread that created \"this\" (your form), which is the user interface thread.\nApplication.DoEv...
[ 6, 1, 1 ]
[]
[]
[ "c#", "compact_framework", "multithreading", "winforms" ]
stackoverflow_0000010071_c#_compact_framework_multithreading_winforms.txt
Q: "using" namespace equivalent in ASP.NET markup When I'm working with DataBound controls in ASP.NET 2.0 such as a Repeater, I know the fastest way to retrieve a property of a bound object (instead of using Reflection with the Eval() function) is to cast the DataItem object to the type it is and then use that object...
"using" namespace equivalent in ASP.NET markup
When I'm working with DataBound controls in ASP.NET 2.0 such as a Repeater, I know the fastest way to retrieve a property of a bound object (instead of using Reflection with the Eval() function) is to cast the DataItem object to the type it is and then use that object natively, like the following: <%#((MyType)Container...
[ "I believe you can add something like:\n<%@ Import Namespace=\"RootNamespace.SubNamespace1\" %> \n\nAt the top of the page.\n", "What you're looking for is the @Import page directive.\n" ]
[ 64, 7 ]
[]
[]
[ "asp.net" ]
stackoverflow_0000021052_asp.net.txt
Q: How to tab focus onto a dropdown field in Mac OSX In Windows, in any windows form or web browser, you can use the tab button to switch focus through all of the form fields. It will stop on textboxes, radiobuttons, checkboxes, dropdown menus, etc. However, in Mac OSX, tab skips dropdown menus. Is there anyway to ...
How to tab focus onto a dropdown field in Mac OSX
In Windows, in any windows form or web browser, you can use the tab button to switch focus through all of the form fields. It will stop on textboxes, radiobuttons, checkboxes, dropdown menus, etc. However, in Mac OSX, tab skips dropdown menus. Is there anyway to change this behavior, or access the above items mention...
[ "Go to System Preferences > Keyboard and Mouse, then choose Keyboard Shortcuts. At the bottom, ensure Full Keyboard Access is set to \"All controls\". It's a long time since I turned it on but I think that's all you need to do\n", "Apple Menu > System Preferences > Keyboard & Mouse > Keyboard Shortcuts:\nChange t...
[ 27, 4, 1 ]
[ "It's in the System Preferences - this blog post shows where the setting is.\n" ]
[ -2 ]
[ "keyboard_shortcuts", "macos", "mouse" ]
stackoverflow_0000002349_keyboard_shortcuts_macos_mouse.txt
Q: Page a Generic Collection Without Linq I've got a System.Generic.Collections.List(Of MyCustomClass) type object. Given integer varaibles pagesize and pagenumber, how can I collect only any single page of MyCustomClass objects? This is what I've got. How can I improve it? 'my given collection and paging parameters...
Page a Generic Collection Without Linq
I've got a System.Generic.Collections.List(Of MyCustomClass) type object. Given integer varaibles pagesize and pagenumber, how can I collect only any single page of MyCustomClass objects? This is what I've got. How can I improve it? 'my given collection and paging parameters Dim AllOfMyCustomClassObjects As System.Col...
[ "Generic.List should provide the Skip() and Take() methods, so you could do this:\nDim PageObjects As New System.Collections.Generic.List(Of MyCustomClass)\nPageObjects = AllOfMyCustomClassObjects.Skip(pagenumber * pagesize).Take(pagesize)\n\n\nIf by \"without Linq\" you meant on the 2.0 Framework, I don't believe ...
[ 2, 1 ]
[]
[]
[ "collections", "paging", "vb.net" ]
stackoverflow_0000021232_collections_paging_vb.net.txt
Q: How do I create a mapping table in SQL Server Management Studio? I'm learning about table design in SQL and I'm wonder how to create a mapping table in order to establish a many-to-many relationship between two other tables? I think the mapping table needs two primary keys - but I can't see how to create that as i...
How do I create a mapping table in SQL Server Management Studio?
I'm learning about table design in SQL and I'm wonder how to create a mapping table in order to establish a many-to-many relationship between two other tables? I think the mapping table needs two primary keys - but I can't see how to create that as it appears there can only be 1 primary key column? I'm using the Databa...
[ "The easiest way is to simply select both fields by selecting the first field, and then while holding down the Ctrl key selecting the second field. Then clicking the key icon to set them both as the primary key.\n" ]
[ 6 ]
[]
[]
[ "entity_relationship", "sql_server", "sql_server_2005" ]
stackoverflow_0000021262_entity_relationship_sql_server_sql_server_2005.txt
Q: How to check set of files conform to a naming scheme I have a bunch of files (TV episodes, although that is fairly arbitrary) that I want to check match a specific naming/organisation scheme.. Currently: I have three arrays of regex, one for valid filenames, one for files missing an episode name, and one for valid...
How to check set of files conform to a naming scheme
I have a bunch of files (TV episodes, although that is fairly arbitrary) that I want to check match a specific naming/organisation scheme.. Currently: I have three arrays of regex, one for valid filenames, one for files missing an episode name, and one for valid paths. Then, I loop though each valid-filename regex, if ...
[ "\nI want to add a rule that checks for\n the presence of a folder.jpg file in\n each directory, but to add this would\n make the code substantially more messy\n in it's current state..\n\nThis doesn't look bad. In fact your current code does it very nicely, and Sven mentioned a good way to do it as well:\n\nG...
[ 2, 0 ]
[]
[]
[ "naming", "python", "validation" ]
stackoverflow_0000019030_naming_python_validation.txt