question_id
int64
4
6.31M
answer_id
int64
7
6.31M
title
stringlengths
9
150
question_body
stringlengths
0
28.8k
answer_body
stringlengths
60
27.2k
question_text
stringlengths
40
28.9k
combined_text
stringlengths
124
39.6k
tags
listlengths
1
6
question_score
int64
0
26.3k
answer_score
int64
0
28.8k
view_count
int64
15
14M
answer_count
int64
0
182
favorite_count
int64
0
32
question_creation_date
stringdate
2008-07-31 21:42:52
2011-06-10 18:12:18
answer_creation_date
stringdate
2008-07-31 22:17:57
2011-06-10 18:14:17
4,752
97,256
MOSS SSP Issue - Failed database logons from deleted SSP
We've been having some issues with a SharePoint instance in a test environment. Thankfully this is not production;) The problems started when the disk with the SQL Server databases and search index ran out of space. Following this, the search service would not run and search settings in the SSP were not accessible. Rec...
As Daniel McPherson said, this is caused when SSPs are deleted but the associated job are not and attempt to communicate with the deleted database. If the SSP database has been deleted or a problem occurred when deleting an SSP, the job may not be deleted. When the job attempts to run, it will fail since the database n...
MOSS SSP Issue - Failed database logons from deleted SSP We've been having some issues with a SharePoint instance in a test environment. Thankfully this is not production;) The problems started when the disk with the SQL Server databases and search index ran out of space. Following this, the search service would not ru...
TITLE: MOSS SSP Issue - Failed database logons from deleted SSP QUESTION: We've been having some issues with a SharePoint instance in a test environment. Thankfully this is not production;) The problems started when the disk with the SQL Server databases and search index ran out of space. Following this, the search se...
[ "sql-server", "database", "sharepoint", "search", "ssp" ]
16
5
3,445
3
0
2008-08-07T14:21:10.087000
2008-09-18T21:37:19.153000
4,782
70,009
How much database performance overhead when using LINQ?
How much database performance overhead is involved with using C# and LINQ compared to custom optimized queries loaded with mostly low-level C, both with a SQL Server 2008 backend? I'm specifically thinking here of a case where you have a fairly data-intensive program and will be doing a data refresh or update at least ...
In my experience the overhead is minimal, provided that the person writing the queries knows what he/she is doing, and take the usual precautions to ensure the generated queries are optimal, that the necessary indexes are in place etc etc. In other words, the database impact should be the same; there is a minimal but u...
How much database performance overhead when using LINQ? How much database performance overhead is involved with using C# and LINQ compared to custom optimized queries loaded with mostly low-level C, both with a SQL Server 2008 backend? I'm specifically thinking here of a case where you have a fairly data-intensive prog...
TITLE: How much database performance overhead when using LINQ? QUESTION: How much database performance overhead is involved with using C# and LINQ compared to custom optimized queries loaded with mostly low-level C, both with a SQL Server 2008 backend? I'm specifically thinking here of a case where you have a fairly d...
[ "sql-server", "linq", "performance", "linq-to-sql" ]
21
2
1,767
2
0
2008-08-07T14:38:59.723000
2008-09-16T07:14:18.153000
4,794
4,919
Flex / Air obfuscation
I've written (most of) an application in Flex and I am concerned with protecting the source code. I fired up a demo of Trillix swf decompiler and opened up the swf file that was installed to my Program Files directory. I saw that all of the actionscript packages I wrote were there. I'm not too concerned with the packag...
Here's what I would do. Compile your application to a SWF file. Then encrypt the SWF using AES. Make a "wrapper" application that loads the encrypted SWF into a ByteArray using URLLoader Use the as3crypto library to decrypt the swf at runtime. Once decrypted, use Loader.loadBytes to load the decrypted swf into the wrap...
Flex / Air obfuscation I've written (most of) an application in Flex and I am concerned with protecting the source code. I fired up a demo of Trillix swf decompiler and opened up the swf file that was installed to my Program Files directory. I saw that all of the actionscript packages I wrote were there. I'm not too co...
TITLE: Flex / Air obfuscation QUESTION: I've written (most of) an application in Flex and I am concerned with protecting the source code. I fired up a demo of Trillix swf decompiler and opened up the swf file that was installed to my Program Files directory. I saw that all of the actionscript packages I wrote were the...
[ "apache-flex", "actionscript-3", "air", "obfuscation" ]
20
12
8,483
4
0
2008-08-07T14:41:42.883000
2008-08-07T16:28:34.337000
4,816
4,821
How do you resolve a domain name to an IP address with .NET/C#?
How do you resolve a domain name to an IP address with.NET/C#?
using System.Net; foreach (IPAddress address in Dns.GetHostAddresses("www.google.com")) { Console.WriteLine(address.ToString()); }
How do you resolve a domain name to an IP address with .NET/C#? How do you resolve a domain name to an IP address with.NET/C#?
TITLE: How do you resolve a domain name to an IP address with .NET/C#? QUESTION: How do you resolve a domain name to an IP address with.NET/C#? ANSWER: using System.Net; foreach (IPAddress address in Dns.GetHostAddresses("www.google.com")) { Console.WriteLine(address.ToString()); }
[ "c#", ".net", "dns", "reverse-dns" ]
30
20
6,512
2
0
2008-08-07T14:56:59.797000
2008-08-07T14:59:15.517000
4,824
4,838
String.indexOf function in C
Is there a C library function that will return the index of a character in a string? So far, all I've found are functions like strstr that will return the found char *, not it's location in the original string.
I think that size_t strcspn ( const char * str1, const char * str2 ); is what you want. Here is an example pulled from here: /* strcspn example */ #include #include int main () { char str[] = "fcba73"; char keys[] = "1234567890"; int i; i = strcspn (str,keys); printf ("The first number in str is at position %d.\n",i+1)...
String.indexOf function in C Is there a C library function that will return the index of a character in a string? So far, all I've found are functions like strstr that will return the found char *, not it's location in the original string.
TITLE: String.indexOf function in C QUESTION: Is there a C library function that will return the index of a character in a string? So far, all I've found are functions like strstr that will return the found char *, not it's location in the original string. ANSWER: I think that size_t strcspn ( const char * str1, cons...
[ "c", "string" ]
47
16
107,506
7
0
2008-08-07T15:00:34.530000
2008-08-07T15:09:30.973000
4,839
4,877
How do I configure eclipse (zend studio 6) to hint and code complete several languages?
My dream IDE does full code hints, explains and completes PHP, Javascript, HTML and CSS. I know it exists! so far, Zend studio 6, under the Eclipse IDE does a great job at hinting PHP, some Javascript and HTML, any way I can expand this? edit: a bit more information: right now, using zend-6 under eclipse, i type in and...
I think the JavaScript and CSS need to be in separate files for this to work. Example of CSS autocomplete in Eclipse: Starting to type border Then setting thickness Then choosing the color Chose red, and it added the; for me Works pretty good IMHO.
How do I configure eclipse (zend studio 6) to hint and code complete several languages? My dream IDE does full code hints, explains and completes PHP, Javascript, HTML and CSS. I know it exists! so far, Zend studio 6, under the Eclipse IDE does a great job at hinting PHP, some Javascript and HTML, any way I can expand ...
TITLE: How do I configure eclipse (zend studio 6) to hint and code complete several languages? QUESTION: My dream IDE does full code hints, explains and completes PHP, Javascript, HTML and CSS. I know it exists! so far, Zend studio 6, under the Eclipse IDE does a great job at hinting PHP, some Javascript and HTML, any...
[ "zend-studio", "code-completion" ]
8
2
3,529
2
0
2008-08-07T15:12:10.530000
2008-08-07T15:47:35.420000
4,850
5,026
C# and Arrow Keys
I am new to C# and am doing some work in an existing application. I have a DirectX viewport that has components in it that I want to be able to position using arrow keys. Currently I am overriding ProcessCmdKey and catching arrow input and send an OnKeyPress event. This works, but I want to be able to use modifiers( AL...
Within your overridden ProcessCmdKey how are you determining which key has been pressed? The value of keyData (the second parameter) will change dependant on the key pressed and any modifier keys, so, for example, pressing the left arrow will return code 37, shift-left will return 65573, ctrl-left 131109 and alt-left 2...
C# and Arrow Keys I am new to C# and am doing some work in an existing application. I have a DirectX viewport that has components in it that I want to be able to position using arrow keys. Currently I am overriding ProcessCmdKey and catching arrow input and send an OnKeyPress event. This works, but I want to be able to...
TITLE: C# and Arrow Keys QUESTION: I am new to C# and am doing some work in an existing application. I have a DirectX viewport that has components in it that I want to be able to position using arrow keys. Currently I am overriding ProcessCmdKey and catching arrow input and send an OnKeyPress event. This works, but I ...
[ "c#", "user-interface", "directx" ]
26
13
9,629
2
0
2008-08-07T15:23:28.883000
2008-08-07T17:38:05.510000
4,860
17,014
Authoritative source on XML-sig
We have a question with regards to XML-sig and need detail about the optional elements as well as some of the canonicalization and transform stuff. We're writing a spec for a very small XML-syntax payload that will go into the metadata of media files and it needs to by cryptographically signed. Rather than re-invent th...
If the option exists to not do an XML signature and instead just to treat the XML as a byte stream and to sign that, do it. It will be easier to implement, easier to understand, more stable (no canonicalization, transform, policy,...) and faster. If you absolutely must have XML DSIG (sadly, some of us must), it is cert...
Authoritative source on XML-sig We have a question with regards to XML-sig and need detail about the optional elements as well as some of the canonicalization and transform stuff. We're writing a spec for a very small XML-syntax payload that will go into the metadata of media files and it needs to by cryptographically ...
TITLE: Authoritative source on XML-sig QUESTION: We have a question with regards to XML-sig and need detail about the optional elements as well as some of the canonicalization and transform stuff. We're writing a spec for a very small XML-syntax payload that will go into the metadata of media files and it needs to by ...
[ "xml", "xml-signature" ]
12
0
577
3
0
2008-08-07T15:33:59.223000
2008-08-19T21:37:21.100000
4,884
13,918
How to keyboard down or up between dropdown "options"?
I have a custom built ajax [div] based dynamic dropdown. I have an [input] box which; onkeyup, runs an Ajax search which returns results in div s and are drawn back in using innerHTML. These div s all have highlights onmouseover so, a typical successful search yields the following structure (pardon the semi-code): [inp...
What you need to do is attach event listeners to the div with id="results". You can do this by adding onkeyup, onkeydown, etc. attributes to the div when you create it or you can attach these using JavaScript. My recommendation would be that you use an AJAX library like YUI, jQuery, Prototype, etc. for two reasons: It ...
How to keyboard down or up between dropdown "options"? I have a custom built ajax [div] based dynamic dropdown. I have an [input] box which; onkeyup, runs an Ajax search which returns results in div s and are drawn back in using innerHTML. These div s all have highlights onmouseover so, a typical successful search yiel...
TITLE: How to keyboard down or up between dropdown "options"? QUESTION: I have a custom built ajax [div] based dynamic dropdown. I have an [input] box which; onkeyup, runs an Ajax search which returns results in div s and are drawn back in using innerHTML. These div s all have highlights onmouseover so, a typical succ...
[ "javascript", "events", "dom", "keyboard" ]
20
8
2,047
2
0
2008-08-07T15:58:10.313000
2008-08-17T20:48:41.760000
4,891
4,908
What point should someone decide to switch Database Systems
When developing whether its Web or Desktop at which point should a developer switch from SQLite, MySQL, MS SQL, etc
It depends on what you are doing. You might switch if: You need more scalability or better performance - say from SQLite to SQL Server or Oracle. You need access to more specific datatypes. You need to support a customer that only runs a particular database. You need better DBA tools. Your application is using a differ...
What point should someone decide to switch Database Systems When developing whether its Web or Desktop at which point should a developer switch from SQLite, MySQL, MS SQL, etc
TITLE: What point should someone decide to switch Database Systems QUESTION: When developing whether its Web or Desktop at which point should a developer switch from SQLite, MySQL, MS SQL, etc ANSWER: It depends on what you are doing. You might switch if: You need more scalability or better performance - say from SQL...
[ "sql", "database" ]
11
4
1,158
3
0
2008-08-07T16:06:33.947000
2008-08-07T16:19:10.753000
4,911
5,057
Should I use the username, or the user's ID to reference authenticated users in ASP.NET
So in my simple learning website, I use the built in ASP.NET authentication system. I am adding now a user table to save stuff like his zip, DOB etc. My question is: In the new table, should the key be the user name (the string) or the user ID which is that GUID looking number they use in the asp_ tables. If the best p...
I would suggest using the username as the primary key in the table if the username is going to be unique, there are a few good reasons to do this: The primary key will be a clustered index and thus search for a users details via their username will be very quick. It will stop duplicate usernames from appearing You don'...
Should I use the username, or the user's ID to reference authenticated users in ASP.NET So in my simple learning website, I use the built in ASP.NET authentication system. I am adding now a user table to save stuff like his zip, DOB etc. My question is: In the new table, should the key be the user name (the string) or ...
TITLE: Should I use the username, or the user's ID to reference authenticated users in ASP.NET QUESTION: So in my simple learning website, I use the built in ASP.NET authentication system. I am adding now a user table to save stuff like his zip, DOB etc. My question is: In the new table, should the key be the user nam...
[ "asp.net", "authentication" ]
34
14
33,473
12
0
2008-08-07T16:19:40.487000
2008-08-07T17:56:36.657000
4,913
4,924
How to make a button appear as if it is pressed?
Using VS2008, C#,.Net 2 and Winforms how can I make a regular Button look "pressed"? Imagine this button is an on/off switch. ToolStripButton has the Checked property, but the regular Button does not.
One method you can used to obtain this option is by placing a "CheckBox" object and changing its "Appearance" from "Normal" to "Button" this will give you the same functionality that I believe you are looking for.
How to make a button appear as if it is pressed? Using VS2008, C#,.Net 2 and Winforms how can I make a regular Button look "pressed"? Imagine this button is an on/off switch. ToolStripButton has the Checked property, but the regular Button does not.
TITLE: How to make a button appear as if it is pressed? QUESTION: Using VS2008, C#,.Net 2 and Winforms how can I make a regular Button look "pressed"? Imagine this button is an on/off switch. ToolStripButton has the Checked property, but the regular Button does not. ANSWER: One method you can used to obtain this opti...
[ "c#", ".net", "winforms", "user-interface", "button" ]
49
97
34,821
3
0
2008-08-07T16:21:59.280000
2008-08-07T16:30:46.953000
4,922
5,091
Is this really widening vs autoboxing?
I saw this in an answer to another question, in reference to shortcomings of the Java spec: There are more shortcomings and this is a subtle topic. Check this out: public class methodOverloading{ public static void hello(Integer x){ System.out.println("Integer"); } public static void hello(long x){ System.out.println(...
In the first case, you have a widening conversion happening. This can be see when runinng the "javap" utility program (included w/ the JDK), on the compiled class: public static void main(java.lang.String[]); Code: 0: iconst_ 5 1: istore_ 1 2: iload_ 1 3: i2l 4: invokestatic #6; //Method hello:(J)V 7: return } Clearly...
Is this really widening vs autoboxing? I saw this in an answer to another question, in reference to shortcomings of the Java spec: There are more shortcomings and this is a subtle topic. Check this out: public class methodOverloading{ public static void hello(Integer x){ System.out.println("Integer"); } public static ...
TITLE: Is this really widening vs autoboxing? QUESTION: I saw this in an answer to another question, in reference to shortcomings of the Java spec: There are more shortcomings and this is a subtle topic. Check this out: public class methodOverloading{ public static void hello(Integer x){ System.out.println("Integer");...
[ "java", "primitive", "autoboxing" ]
31
16
4,609
3
0
2008-08-07T16:30:32.180000
2008-08-07T18:18:34.897000
4,923
5,156
Wrapping lists into columns
I'm using ColdFusion to populate a template that includes HTML unordered lists ( s). Most of these aren't that long, but a few have ridiculously long lengths and could really stand to be in 2-3 columns. Is there an HTML, ColdFusion or perhaps JavaScript (I'm accepting jQuery solutions) way to do this easily? It's not w...
So I dug up this article from A List Apart CSS Swag: Multi-Column Lists. I ended up using the first solution, it's not the best but the others require either using complex HTML that can't be generated dynamically, or creating a lot of custom classes, which could be done but would require loads of in-line styling and po...
Wrapping lists into columns I'm using ColdFusion to populate a template that includes HTML unordered lists ( s). Most of these aren't that long, but a few have ridiculously long lengths and could really stand to be in 2-3 columns. Is there an HTML, ColdFusion or perhaps JavaScript (I'm accepting jQuery solutions) way t...
TITLE: Wrapping lists into columns QUESTION: I'm using ColdFusion to populate a template that includes HTML unordered lists ( s). Most of these aren't that long, but a few have ridiculously long lengths and could really stand to be in 2-3 columns. Is there an HTML, ColdFusion or perhaps JavaScript (I'm accepting jQuer...
[ "javascript", "jquery", "html", "css", "cfml" ]
68
30
24,498
13
0
2008-08-07T16:30:45.613000
2008-08-07T18:59:58.167000
4,939
5,098
LINQ to SQL strings to enums
LINQ to SQL allows table mappings to automatically convert back and forth to Enums by specifying the type for the column - this works for strings or integers. Is there a way to make the conversion case insensitive or add a custom mapping class or extenstion method into the mix so that I can specify what the string shou...
You can always add a partial class with the same name as your LinqToSql class, and then define your own parameters and functions. These will then be accessible as object parameters and methods for this object, the same way as the auto-generated LinqToSql methods are accessible. Example: You have a LinqToSql class named...
LINQ to SQL strings to enums LINQ to SQL allows table mappings to automatically convert back and forth to Enums by specifying the type for the column - this works for strings or integers. Is there a way to make the conversion case insensitive or add a custom mapping class or extenstion method into the mix so that I can...
TITLE: LINQ to SQL strings to enums QUESTION: LINQ to SQL allows table mappings to automatically convert back and forth to Enums by specifying the type for the column - this works for strings or integers. Is there a way to make the conversion case insensitive or add a custom mapping class or extenstion method into the...
[ "linq-to-sql" ]
18
3
2,592
1
0
2008-08-07T16:38:51.820000
2008-08-07T18:23:10.923000
4,942
4,978
How to sell Python to a client/boss/person
When asked to create system XYZ and you ask to do it in Python over PHP or Ruby, what are the main features you can mention when they require you to explain it?
This is one of those cases that really boil down to personal preference or situational details. If you're more comfortable and experienced with Python, then say so. Are they asking you to justify it because they're more comfortable with one of the other environments? After you're done, will the system be passed off to ...
How to sell Python to a client/boss/person When asked to create system XYZ and you ask to do it in Python over PHP or Ruby, what are the main features you can mention when they require you to explain it?
TITLE: How to sell Python to a client/boss/person QUESTION: When asked to create system XYZ and you ask to do it in Python over PHP or Ruby, what are the main features you can mention when they require you to explain it? ANSWER: This is one of those cases that really boil down to personal preference or situational de...
[ "php", "python", "ruby-on-rails", "ruby" ]
14
13
1,477
8
0
2008-08-07T16:43:21.937000
2008-08-07T17:04:25.810000
4,949
4,965
Version control PHP Web Project
We have a PHP project that we would like to version control. Right now there are three of us working on a development version of the project which resides in an external folder to which all of our Eclipse IDEs are linked, and thus no version control. What is the right way and the best way to version control this? We ha...
We were in a similar situation, and here's what we ended up doing: Set up two branches -- the release and development branch. For the development branch, include a post-commit hook that deploys the repository to the dev server, so you can test. Once you're ready, you merge your changes into the release branch. I'd also...
Version control PHP Web Project We have a PHP project that we would like to version control. Right now there are three of us working on a development version of the project which resides in an external folder to which all of our Eclipse IDEs are linked, and thus no version control. What is the right way and the best wa...
TITLE: Version control PHP Web Project QUESTION: We have a PHP project that we would like to version control. Right now there are three of us working on a development version of the project which resides in an external folder to which all of our Eclipse IDEs are linked, and thus no version control. What is the right w...
[ "php", "svn", "version-control", "cvs" ]
36
27
8,653
8
0
2008-08-07T16:46:32.507000
2008-08-07T16:56:03.330000
4,954
4,972
What are good regular expressions?
I have worked for 5 years mainly in java desktop applications accessing Oracle databases and I have never used regular expressions. Now I enter Stack Overflow and I see a lot of questions about them; I feel like I missed something. For what do you use regular expressions? P.S. sorry for my bad english
Consider an example in Ruby: puts "Matched!" unless /\d{3}-\d{4}/.match("555-1234").nil? puts "Didn't match!" if /\d{3}-\d{4}/.match("Not phone number").nil? The "/\d{3}-\d{4}/" is the regular expression, and as you can see it is a VERY concise way of finding a match in a string. Furthermore, using groups you can extra...
What are good regular expressions? I have worked for 5 years mainly in java desktop applications accessing Oracle databases and I have never used regular expressions. Now I enter Stack Overflow and I see a lot of questions about them; I feel like I missed something. For what do you use regular expressions? P.S. sorry f...
TITLE: What are good regular expressions? QUESTION: I have worked for 5 years mainly in java desktop applications accessing Oracle databases and I have never used regular expressions. Now I enter Stack Overflow and I see a lot of questions about them; I feel like I missed something. For what do you use regular express...
[ "regex" ]
11
7
3,337
9
0
2008-08-07T16:48:42.270000
2008-08-07T17:02:10.353000
4,973
5,103
Setting a div's height in HTML with CSS
I am trying to lay out a table-like page with two columns. I want the rightmost column to dock to the right of the page, and this column should have a distinct background color. The content in the right side is almost always going to be smaller than that on the left. I would like the div on the right to always be tall ...
Ahem... The short answer to your question is that you must set the height of 100% to the body and html tag, then set the height to 100% on each div element you want to make 100% the height of the page. Actually, 100% height will not work in most design situations - this may be short but it is not a good answer. Google ...
Setting a div's height in HTML with CSS I am trying to lay out a table-like page with two columns. I want the rightmost column to dock to the right of the page, and this column should have a distinct background color. The content in the right side is almost always going to be smaller than that on the left. I would like...
TITLE: Setting a div's height in HTML with CSS QUESTION: I am trying to lay out a table-like page with two columns. I want the rightmost column to dock to the right of the page, and this column should have a distinct background color. The content in the right side is almost always going to be smaller than that on the ...
[ "html", "css" ]
40
22
180,205
14
0
2008-08-07T17:02:23.413000
2008-08-07T18:24:16.803000
5,017
5,266
Open local file with AIR / Flex
I have written an AIR Application that downloads videos and documents from a server. The videos play inside of the application, but I would like the user to be able to open the documents in their native applications. I am looking for a way to prompt the user to Open / Save As on a local file stored in the Application S...
Only way I could figure out how to do it without just moving the file and telling the user was to pass it off to the browser. navigateToURL(new URLRequest(File.applicationStorageDirectory.nativePath + "/courses/" + fileName));
Open local file with AIR / Flex I have written an AIR Application that downloads videos and documents from a server. The videos play inside of the application, but I would like the user to be able to open the documents in their native applications. I am looking for a way to prompt the user to Open / Save As on a local ...
TITLE: Open local file with AIR / Flex QUESTION: I have written an AIR Application that downloads videos and documents from a server. The videos play inside of the application, but I would like the user to be able to open the documents in their native applications. I am looking for a way to prompt the user to Open / S...
[ "apache-flex", "actionscript-3", "air" ]
12
3
19,663
5
0
2008-08-07T17:31:12.167000
2008-08-07T20:25:47.293000
5,024
5,041
Is The Perl Journal available online?
Does anyone know where online copies of the old The Perl Journal articles can be found? I know they are now owned by Dr. Dobb's, just the main page for it says they are part of whatever section the subject matter is relevant too, rather than being indexed together. That said, I have never been able to find any of them ...
Volumes 1-5 (1996 -> 2000) can be found at http://www.foo.be/docs/tpj/ Hmm, looks like that was the entire run? I though it was longer than that for some reason.
Is The Perl Journal available online? Does anyone know where online copies of the old The Perl Journal articles can be found? I know they are now owned by Dr. Dobb's, just the main page for it says they are part of whatever section the subject matter is relevant too, rather than being indexed together. That said, I hav...
TITLE: Is The Perl Journal available online? QUESTION: Does anyone know where online copies of the old The Perl Journal articles can be found? I know they are now owned by Dr. Dobb's, just the main page for it says they are part of whatever section the subject matter is relevant too, rather than being indexed together...
[ "perl" ]
23
17
6,660
3
0
2008-08-07T17:34:27.857000
2008-08-07T17:52:19.177000
5,025
5,031
Locking a SQL Server Database with PHP
I'm wanting extra security for a particular point in my web app. So I want to lock the database (SQL Server 2005). Any suggestions or is this even necessary with SQL Server? Edit on question: The query is failing silently with no errors messages logged, and does not occur inside of a transaction. Final Solution: I neve...
I suppose you have three options. Set user permissions so that user x can only read from the database. Set the database into single user mode so only one connection can access it sp_dboption 'myDataBaseName', single, true Set the database to readonly sp_dboption 'myDataBaseName', read only, true
Locking a SQL Server Database with PHP I'm wanting extra security for a particular point in my web app. So I want to lock the database (SQL Server 2005). Any suggestions or is this even necessary with SQL Server? Edit on question: The query is failing silently with no errors messages logged, and does not occur inside o...
TITLE: Locking a SQL Server Database with PHP QUESTION: I'm wanting extra security for a particular point in my web app. So I want to lock the database (SQL Server 2005). Any suggestions or is this even necessary with SQL Server? Edit on question: The query is failing silently with no errors messages logged, and does ...
[ "php", "sql-server", "database", "sql-server-2005" ]
16
7
1,247
2
0
2008-08-07T17:36:23.873000
2008-08-07T17:43:01.787000
5,027
5,029
Reduce ASP.NET menu control size (without 3rd party libraries)
I have a fairly simple ASP.NET 2.0 menu control using a sitemap file and security trimmings. There are only 21 menu options, but the results HTML of the menu is a whopping 14k. The site is hosted on our company's intranet and must be serverd to people worldwide on limited bandwidth, so I'd like to reduce the size of th...
Take a look at: http://www.asp.net/CSSAdapters/Menu.aspx The default Menu control is rendering far too much HTML.
Reduce ASP.NET menu control size (without 3rd party libraries) I have a fairly simple ASP.NET 2.0 menu control using a sitemap file and security trimmings. There are only 21 menu options, but the results HTML of the menu is a whopping 14k. The site is hosted on our company's intranet and must be serverd to people world...
TITLE: Reduce ASP.NET menu control size (without 3rd party libraries) QUESTION: I have a fairly simple ASP.NET 2.0 menu control using a sitemap file and security trimmings. There are only 21 menu options, but the results HTML of the menu is a whopping 14k. The site is hosted on our company's intranet and must be serve...
[ "asp.net", "size", "menu" ]
10
3
1,764
2
0
2008-08-07T17:38:09.143000
2008-08-07T17:42:00.150000
5,071
5,262
How to add CVS directories recursively
I've played with CVS a little bit and am not the most familiar with all of its capabilities, but a huge annoyance for me is trying to add new directories that contain more directories in them. Running " cvs add " only adds the contents of the current directory, and using " cvs import " didn't look like the right thing ...
Ah, spaces. This will work with spaces: find. -type f -print0| xargs -0 cvs add
How to add CVS directories recursively I've played with CVS a little bit and am not the most familiar with all of its capabilities, but a huge annoyance for me is trying to add new directories that contain more directories in them. Running " cvs add " only adds the contents of the current directory, and using " cvs imp...
TITLE: How to add CVS directories recursively QUESTION: I've played with CVS a little bit and am not the most familiar with all of its capabilities, but a huge annoyance for me is trying to add new directories that contain more directories in them. Running " cvs add " only adds the contents of the current directory, a...
[ "cvs" ]
40
11
71,701
14
0
2008-08-07T18:05:28.183000
2008-08-07T20:22:32.807000
5,075
5,079
Bigger than a char but smaller than a blob
Char's are great because they are fixed size and thus make for a faster table. They are however limited to 255 characters. I want to hold 500 characters but a blob is variable length and that's not what I want. Is there some way to have a fixed length field of 500 characters in MySQL or am I going to have to use 2 char...
I would suggest using a varchar(500). Even though varchar isn't a fixed length, the database should reserve the correct amount of space. You shouldn't notice any performance difference using varchar(500) over 2xchar(255). You're also probably going to cause extra overhead by joining two char fields together.
Bigger than a char but smaller than a blob Char's are great because they are fixed size and thus make for a faster table. They are however limited to 255 characters. I want to hold 500 characters but a blob is variable length and that's not what I want. Is there some way to have a fixed length field of 500 characters i...
TITLE: Bigger than a char but smaller than a blob QUESTION: Char's are great because they are fixed size and thus make for a faster table. They are however limited to 255 characters. I want to hold 500 characters but a blob is variable length and that's not what I want. Is there some way to have a fixed length field o...
[ "mysql", "database" ]
6
7
729
3
0
2008-08-07T18:07:48.460000
2008-08-07T18:12:03.350000
5,078
5,108
Securing a linux webserver for public access
I'd like to set up a cheap Linux box as a web server to host a variety of web technologies (PHP & Java EE come to mind, but I'd like to experiment with Ruby or Python in the future as well). I'm fairly versed in setting up Tomcat to run on Linux for serving up Java EE applications, but I'd like to be able to open this ...
This article has some of the best ways to lock things down: http://www.petefreitag.com/item/505.cfm Some highlights: Make sure no one can browse the directories Make sure only root has write privileges to everything, and only root has read privileges to certain config files Run mod_security The article also takes some ...
Securing a linux webserver for public access I'd like to set up a cheap Linux box as a web server to host a variety of web technologies (PHP & Java EE come to mind, but I'd like to experiment with Ruby or Python in the future as well). I'm fairly versed in setting up Tomcat to run on Linux for serving up Java EE applic...
TITLE: Securing a linux webserver for public access QUESTION: I'd like to set up a cheap Linux box as a web server to host a variety of web technologies (PHP & Java EE come to mind, but I'd like to experiment with Ruby or Python in the future as well). I'm fairly versed in setting up Tomcat to run on Linux for serving...
[ "linux", "security", "webserver" ]
21
5
4,133
12
0
2008-08-07T18:10:17.033000
2008-08-07T18:26:07.207000
5,084
5,089
Upload form does not work in Firefox 3 with Mac OS X?
Today, I ran into this weird problem with a user using Mac OS X. This user always had a failed upload. The form uses a regular "input type=file". The user could upload using any browser except Firefox 3 on his Mac. Only this particular user was seeing this error. Obviously, the problem is only with this one particular ...
User corrected this weird problem by recreating their FireFox profile. How to manage FireFox profiles I imagine a re-install of FireFox would have corrected the problem as well.
Upload form does not work in Firefox 3 with Mac OS X? Today, I ran into this weird problem with a user using Mac OS X. This user always had a failed upload. The form uses a regular "input type=file". The user could upload using any browser except Firefox 3 on his Mac. Only this particular user was seeing this error. Ob...
TITLE: Upload form does not work in Firefox 3 with Mac OS X? QUESTION: Today, I ran into this weird problem with a user using Mac OS X. This user always had a failed upload. The form uses a regular "input type=file". The user could upload using any browser except Firefox 3 on his Mac. Only this particular user was see...
[ "macos", "firefox", "upload" ]
5
2
1,389
2
0
2008-08-07T18:16:00.033000
2008-08-07T18:17:56.833000
5,087
1,158,483
Learning Ruby on Rails any good for Grails?
My company is in the process of starting down the Grails path. The reason for that is that the current developers are heavy on Java but felt the need for a MVC-style language for some future web development projects. Personally, I'm coming from the design/usability world, but as I take more "front-end" responsibilities...
Mmh, I don't know how to say this. Some people might bash me over this. Language (Groovy and Ruby) As a language I reckon Ruby is more funky compared to Groovy. Groovy only exists to ease Java programmer as you don't need to learn too much new syntax. But overall I reckon is not as funky as Ruby. Groovy wouldn't be the...
Learning Ruby on Rails any good for Grails? My company is in the process of starting down the Grails path. The reason for that is that the current developers are heavy on Java but felt the need for a MVC-style language for some future web development projects. Personally, I'm coming from the design/usability world, but...
TITLE: Learning Ruby on Rails any good for Grails? QUESTION: My company is in the process of starting down the Grails path. The reason for that is that the current developers are heavy on Java but felt the need for a MVC-style language for some future web development projects. Personally, I'm coming from the design/us...
[ "ruby-on-rails", "ruby", "grails", "groovy" ]
21
16
9,205
15
0
2008-08-07T18:17:22.323000
2009-07-21T10:52:45.673000
5,118
5,160
How to set up a CSS switcher
I'm working on a website that will switch to a new style on a set date. The site's built-in semantic HTML and CSS, so the change should just require a CSS reference change. I'm working with a designer who will need to be able to see how it's looking, as well as a client who will need to be able to review content update...
In Asp.net 3.5, you should be able to set up the Link tag in the header as a server tag. Then in the codebehind you can set the href property for the link element, based on a cookie value, querystring, date, etc. In your aspx file: And in the Code behind: protected void Page_Load(object sender, EventArgs e) { string st...
How to set up a CSS switcher I'm working on a website that will switch to a new style on a set date. The site's built-in semantic HTML and CSS, so the change should just require a CSS reference change. I'm working with a designer who will need to be able to see how it's looking, as well as a client who will need to be ...
TITLE: How to set up a CSS switcher QUESTION: I'm working on a website that will switch to a new style on a set date. The site's built-in semantic HTML and CSS, so the change should just require a CSS reference change. I'm working with a designer who will need to be able to see how it's looking, as well as a client wh...
[ "javascript", "html", "asp.net", "css" ]
37
22
3,916
4
0
2008-08-07T18:31:22.780000
2008-08-07T19:00:58.757000
5,134
1,198,468
Best strategy to write hooks for subversion in Windows
What is the best approach to write hooks for Subversion in Windows? As far as I know, only executable files can be used. So what is the best choice? Plain batch files (very limited but perhaps OK for very simple solutions) Dedicated compiled executable applications (sledgehammer to crack a nutshell?) Some other hybrid ...
I’ve just spent several days procrastinating about exactly this question. There are third party products available and plenty of PERL and Python scripts but I wanted something simple and a language I was familiar with so ended up just writing hooks in a C# console app. It’s very straight forward: public void Main(strin...
Best strategy to write hooks for subversion in Windows What is the best approach to write hooks for Subversion in Windows? As far as I know, only executable files can be used. So what is the best choice? Plain batch files (very limited but perhaps OK for very simple solutions) Dedicated compiled executable applications...
TITLE: Best strategy to write hooks for subversion in Windows QUESTION: What is the best approach to write hooks for Subversion in Windows? As far as I know, only executable files can be used. So what is the best choice? Plain batch files (very limited but perhaps OK for very simple solutions) Dedicated compiled execu...
[ "svn", "hook", "svn-hooks" ]
20
7
6,407
6
0
2008-08-07T18:47:50.580000
2009-07-29T07:03:06.380000
5,136
5,302
Creating a shared library in MATLAB
A researcher has created a small simulation in MATLAB and we want to make it accessible to others. My plan is to take the simulation, clean up a few things and turn it into a set of functions. Then I plan to compile it into a C library and use SWIG to create a Python wrapper. At that point, I should be able to call the...
I remember that I was able to wrap a MATLAB simulation into a DLL file and then call it from a Delphi application. It worked really well.
Creating a shared library in MATLAB A researcher has created a small simulation in MATLAB and we want to make it accessible to others. My plan is to take the simulation, clean up a few things and turn it into a set of functions. Then I plan to compile it into a C library and use SWIG to create a Python wrapper. At that...
TITLE: Creating a shared library in MATLAB QUESTION: A researcher has created a small simulation in MATLAB and we want to make it accessible to others. My plan is to take the simulation, clean up a few things and turn it into a set of functions. Then I plan to compile it into a C library and use SWIG to create a Pytho...
[ "python", "c", "matlab" ]
15
4
2,470
4
0
2008-08-07T18:47:58.487000
2008-08-07T20:57:20.303000
5,170
5,270
SQL Server Management Studio alternatives to browse/edit tables and run queries
I was wondering if there are any alternatives to Microsoft's SQL Server Management Studio? Not there's anything wrong with SSMS, but sometimes it just seem too big an application where all I want todo is browse/edit tables and run queries.
I've started using LinqPad. In addition to being more lightweight than SSMS, you can also practice writing LINQ queries- way more fun than boring old TSQL!
SQL Server Management Studio alternatives to browse/edit tables and run queries I was wondering if there are any alternatives to Microsoft's SQL Server Management Studio? Not there's anything wrong with SSMS, but sometimes it just seem too big an application where all I want todo is browse/edit tables and run queries.
TITLE: SQL Server Management Studio alternatives to browse/edit tables and run queries QUESTION: I was wondering if there are any alternatives to Microsoft's SQL Server Management Studio? Not there's anything wrong with SSMS, but sometimes it just seem too big an application where all I want todo is browse/edit tables...
[ "sql-server" ]
132
52
112,888
12
0
2008-08-07T19:06:03.600000
2008-08-07T20:31:12.413000
5,179
5,219
How Do I Post and then redirect to an external URL from ASP.Net?
ASP.NET server-side controls postback to their own page. This makes cases where you want to redirect a user to an external page, but need to post to that page for some reason (for authentication, for instance) a pain. An HttpWebRequest works great if you don't want to redirect, and JavaScript is fine in some cases, but...
Here's how I solved this problem today. I started from this article on C# Corner, but found the example - while technically sound - a little incomplete. Everything he said was right, but I needed to hit a few external sites to piece this together to work exactly as I wanted. It didn't help that the user was not technic...
How Do I Post and then redirect to an external URL from ASP.Net? ASP.NET server-side controls postback to their own page. This makes cases where you want to redirect a user to an external page, but need to post to that page for some reason (for authentication, for instance) a pain. An HttpWebRequest works great if you ...
TITLE: How Do I Post and then redirect to an external URL from ASP.Net? QUESTION: ASP.NET server-side controls postback to their own page. This makes cases where you want to redirect a user to an external page, but need to post to that page for some reason (for authentication, for instance) a pain. An HttpWebRequest w...
[ "javascript", "c#", "asp.net", "forms", "postback" ]
38
15
22,053
6
0
2008-08-07T19:13:04.583000
2008-08-07T19:36:56.580000
5,188
5,192
How do you pull the URL for an ASP.NET web reference from a configuration file in Visual Studio 2008?
I have a web reference for our report server embedded in our application. The server that the reports live on could change though, and I'd like to be able to change it "on the fly" if necessary. I know I've done this before, but can't seem to remember how. Thanks for your help. I've manually driven around this for the ...
In the properties window change the "behavior" to Dynamic. See: http://www.codeproject.com/KB/XML/wsdldynamicurl.aspx
How do you pull the URL for an ASP.NET web reference from a configuration file in Visual Studio 2008? I have a web reference for our report server embedded in our application. The server that the reports live on could change though, and I'd like to be able to change it "on the fly" if necessary. I know I've done this b...
TITLE: How do you pull the URL for an ASP.NET web reference from a configuration file in Visual Studio 2008? QUESTION: I have a web reference for our report server embedded in our application. The server that the reports live on could change though, and I'd like to be able to change it "on the fly" if necessary. I kno...
[ "asmx" ]
8
3
2,965
2
0
2008-08-07T19:20:27.097000
2008-08-07T19:22:25.983000
5,194
5,199
When to use an extension method with lambda over LINQtoObjects to filter a collection?
I am prototyping some C# 3 collection filters and came across this. I have a collection of products: public class MyProduct { public string Name { get; set; } public Double Price { get; set; } public string Description { get; set; } } var MyProducts = new List { new MyProduct { Name = "Surfboard", Price = 144.99, Desc...
LINQ turns into method calls like the code you have. In other words, there should be no difference. However, in your two pieces of code you are not calling.ToList in the first, so the first piece of code will produce an enumerable data source, but if you call.ToList on it, the two should be the same.
When to use an extension method with lambda over LINQtoObjects to filter a collection? I am prototyping some C# 3 collection filters and came across this. I have a collection of products: public class MyProduct { public string Name { get; set; } public Double Price { get; set; } public string Description { get; set; } ...
TITLE: When to use an extension method with lambda over LINQtoObjects to filter a collection? QUESTION: I am prototyping some C# 3 collection filters and came across this. I have a collection of products: public class MyProduct { public string Name { get; set; } public Double Price { get; set; } public string Descript...
[ "c#", "linq", ".net-3.5", "lambda" ]
16
6
3,956
4
0
2008-08-07T19:23:13.127000
2008-08-07T19:25:49.487000
5,222
5,224
Accessing post variables using Java Servlets
What is the Java equivalent of PHP's $_POST? After searching the web for an hour, I'm still nowhere closer.
Your HttpServletRequest object has a getParameter(String paramName) method that can be used to get parameter values. http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getParameter(java.lang.String)
Accessing post variables using Java Servlets What is the Java equivalent of PHP's $_POST? After searching the web for an hour, I'm still nowhere closer.
TITLE: Accessing post variables using Java Servlets QUESTION: What is the Java equivalent of PHP's $_POST? After searching the web for an hour, I'm still nowhere closer. ANSWER: Your HttpServletRequest object has a getParameter(String paramName) method that can be used to get parameter values. http://java.sun.com/jav...
[ "java", "http", "servlets" ]
66
54
145,898
5
0
2008-08-07T19:39:31.240000
2008-08-07T19:43:36.113000
5,223
6,700
Length of a JavaScript object
I have a JavaScript object. Is there a built-in or accepted best practice way to get the length of this object? const myObject = new Object(); myObject["firstname"] = "Gareth"; myObject["lastname"] = "Simpson"; myObject["age"] = 21;
Updated answer Here's an update as of 2016 and widespread deployment of ES5 and beyond. For IE9+ and all other modern ES5+ capable browsers, you can use Object.keys() so the above code just becomes: var size = Object.keys(myObj).length; This doesn't have to modify any existing prototype since Object.keys() is now built...
Length of a JavaScript object I have a JavaScript object. Is there a built-in or accepted best practice way to get the length of this object? const myObject = new Object(); myObject["firstname"] = "Gareth"; myObject["lastname"] = "Simpson"; myObject["age"] = 21;
TITLE: Length of a JavaScript object QUESTION: I have a JavaScript object. Is there a built-in or accepted best practice way to get the length of this object? const myObject = new Object(); myObject["firstname"] = "Gareth"; myObject["lastname"] = "Simpson"; myObject["age"] = 21; ANSWER: Updated answer Here's an updat...
[ "javascript", "object", "javascript-objects" ]
3,026
3,391
2,940,325
44
0
2008-08-07T19:42:21.060000
2008-08-09T08:31:04.577000
5,226
5,293
HTML Comments Markup
I am currently in the process of creating my own blog and I have got to marking up the comments, but what is the best way to mark it up? The information I need to present is: Persons Name Gravatar Icon Comment Date The Comment PS: I'm only interested in semantic HTML markup.
I think that your version with the cite, blockquote, etc. would definitely work, but if semantics is your main concern then I personally wouldn't use cite and blockquote as they have specific things that they are supposed to represent. The blockquote tag is meant to represent a quotation taken from another source and t...
HTML Comments Markup I am currently in the process of creating my own blog and I have got to marking up the comments, but what is the best way to mark it up? The information I need to present is: Persons Name Gravatar Icon Comment Date The Comment PS: I'm only interested in semantic HTML markup.
TITLE: HTML Comments Markup QUESTION: I am currently in the process of creating my own blog and I have got to marking up the comments, but what is the best way to mark it up? The information I need to present is: Persons Name Gravatar Icon Comment Date The Comment PS: I'm only interested in semantic HTML markup. ANSW...
[ "html", "semantic-markup" ]
16
6
2,470
5
0
2008-08-07T19:46:47.417000
2008-08-07T20:46:19.840000
5,242
5,246
User Interfaces - Colors and Layout
Although I'm specifically interested in web application information, I would also be somewhat curious about desktop application development as well. This question is driven by my work on my personal website as well as my job, where I have developed a few features, but left it to others to integrate into the look and fe...
Usually, each operating System has user Interface Guidelines. For Windows, have a look here. (Edit: The links in that post are broken. But a Search for " User Interface Guidelines " on MSDN has articles about everything) Apple has it's own as well. Also, you may want to keep accessibility in mind.
User Interfaces - Colors and Layout Although I'm specifically interested in web application information, I would also be somewhat curious about desktop application development as well. This question is driven by my work on my personal website as well as my job, where I have developed a few features, but left it to othe...
TITLE: User Interfaces - Colors and Layout QUESTION: Although I'm specifically interested in web application information, I would also be somewhat curious about desktop application development as well. This question is driven by my work on my personal website as well as my job, where I have developed a few features, b...
[ "user-interface", "usability" ]
10
5
1,413
8
0
2008-08-07T20:01:13.520000
2008-08-07T20:04:55.197000
5,263
24,472
How do you persist a tree structure to a database table with auto incrementing IDs using an ADO.NET DataSet and a DataAdapter
I have a self-referential Role table that represents a tree structure ID [INT] AUTO INCREMENT Name [VARCHAR] ParentID [INT] I am using an ADO.NET DataTable and DataAdapter to load and save values to this table. This works if I only create children of existing rows. If I make a child row, then make a child of that child...
I don't know ADO.net in particular, but most ORMs won't automatically insert the ID of a new record in a relationship. You'll have to resort to the 2-step process: build and save parent build and save child with relationship to parent The reason that this is difficult for ORMs is because you might have circular depende...
How do you persist a tree structure to a database table with auto incrementing IDs using an ADO.NET DataSet and a DataAdapter I have a self-referential Role table that represents a tree structure ID [INT] AUTO INCREMENT Name [VARCHAR] ParentID [INT] I am using an ADO.NET DataTable and DataAdapter to load and save value...
TITLE: How do you persist a tree structure to a database table with auto incrementing IDs using an ADO.NET DataSet and a DataAdapter QUESTION: I have a self-referential Role table that represents a tree structure ID [INT] AUTO INCREMENT Name [VARCHAR] ParentID [INT] I am using an ADO.NET DataTable and DataAdapter to l...
[ ".net", "database", "ado.net" ]
8
2
1,572
3
0
2008-08-07T20:23:51.057000
2008-08-23T18:37:59.287000
5,264
5,273
How can I dynamically center an image in a MS Reporting Services report?
Out of the box, in MS Reporting Services, the image element does not allow for the centering of the image itself, when the dimensions are unknown at design time. In other words, the image (if smaller than the dimensions allotted on the design surface) will be anchored to the top left corner, not in the center. My repor...
Here is how I was able to accomplish this. With help from Chris Hays Size the image to be as big as you would want it on the report, change "Sizing" property to "Clip". Dynamically set the image's left padding using an expression: =CStr(Round((4.625-System.Drawing.Image.FromStream(System.Net.WebRequest.Create(Parameter...
How can I dynamically center an image in a MS Reporting Services report? Out of the box, in MS Reporting Services, the image element does not allow for the centering of the image itself, when the dimensions are unknown at design time. In other words, the image (if smaller than the dimensions allotted on the design surf...
TITLE: How can I dynamically center an image in a MS Reporting Services report? QUESTION: Out of the box, in MS Reporting Services, the image element does not allow for the centering of the image itself, when the dimensions are unknown at design time. In other words, the image (if smaller than the dimensions allotted ...
[ "reporting-services" ]
17
8
12,417
1
0
2008-08-07T20:24:34.003000
2008-08-07T20:31:41.010000
5,269
5,276
C# logic order and compiler behavior
In C#, (and feel free to answer for other languages), what order does the runtime evaluate a logic statement? Example: DataTable myDt = new DataTable(); if (myDt!= null && myDt.Rows.Count > 0) { //do some stuff with myDt } Which statement does the runtime evaluate first - myDt!= null or: myDt.Rows.Count > 0? Is there a...
C#: Left to right, and processing stops if a non-match (evaluates to false) is found.
C# logic order and compiler behavior In C#, (and feel free to answer for other languages), what order does the runtime evaluate a logic statement? Example: DataTable myDt = new DataTable(); if (myDt!= null && myDt.Rows.Count > 0) { //do some stuff with myDt } Which statement does the runtime evaluate first - myDt!= nul...
TITLE: C# logic order and compiler behavior QUESTION: In C#, (and feel free to answer for other languages), what order does the runtime evaluate a logic statement? Example: DataTable myDt = new DataTable(); if (myDt!= null && myDt.Rows.Count > 0) { //do some stuff with myDt } Which statement does the runtime evaluate ...
[ "c#", "language-agnostic", "compiler-construction", "logic" ]
18
16
4,081
18
0
2008-08-07T20:30:00.683000
2008-08-07T20:33:22.847000
5,307
5,317
Print a Winform/visual element
All the articles I've found via google are either obsolete or contradict one another. What's the easiest way to print a form or, say, a richtextbox in c#? I think it's using the PrintDiaglog class by setting the Document, but how does this get converted?
At least in VS 2008, its very easy. It took me about a couple of minutes to code the answer after reading your question. Here's where I borrowed it from: http://msdn.microsoft.com/en-us/library/6he9hz8c.aspx I tested this, and it works.
Print a Winform/visual element All the articles I've found via google are either obsolete or contradict one another. What's the easiest way to print a form or, say, a richtextbox in c#? I think it's using the PrintDiaglog class by setting the Document, but how does this get converted?
TITLE: Print a Winform/visual element QUESTION: All the articles I've found via google are either obsolete or contradict one another. What's the easiest way to print a form or, say, a richtextbox in c#? I think it's using the PrintDiaglog class by setting the Document, but how does this get converted? ANSWER: At leas...
[ "c#", "winforms" ]
12
6
1,722
2
0
2008-08-07T20:58:14.060000
2008-08-07T21:09:17.423000
5,328
5,351
Why can't I use a try block around my super() call?
So, in Java, the first line of your constructor HAS to be a call to super... be it implicitly calling super(), or explicitly calling another constructor. What I want to know is, why can't I put a try block around that? My specific case is that I have a mock class for a test. There is no default constructor, but I want ...
Unfortunately, compilers can't work on theoretical principles, and even though you may know that it is safe in your case, if they allowed it, it would have to be safe for all cases. In other words, the compiler isn't stopping just you, it's stopping everyone, including all those that don't know that it is unsafe and ne...
Why can't I use a try block around my super() call? So, in Java, the first line of your constructor HAS to be a call to super... be it implicitly calling super(), or explicitly calling another constructor. What I want to know is, why can't I put a try block around that? My specific case is that I have a mock class for ...
TITLE: Why can't I use a try block around my super() call? QUESTION: So, in Java, the first line of your constructor HAS to be a call to super... be it implicitly calling super(), or explicitly calling another constructor. What I want to know is, why can't I put a try block around that? My specific case is that I have...
[ "java", "exception", "mocking", "try-catch" ]
47
18
12,206
7
0
2008-08-07T21:17:56.813000
2008-08-07T21:32:34.367000
5,329
5,403
What is the difference between a bug and a change request in MSF for CMMI?
I'm currently evaluating the MSF for CMMI process template under TFS for use on my development team, and I'm having trouble understanding the need for separate bug and change request work item types. I understand that it is beneficial to be able to differentiate between bugs (errors) and change requests (changing requi...
@Luke I don't disagree with you, but this difference is typically the explanation given for why there is two different processes available for handling the two types of issues. I'd say that if the color of the home page was originally designed to be red, and for some reason it is blue, that's easily a quick fix and doe...
What is the difference between a bug and a change request in MSF for CMMI? I'm currently evaluating the MSF for CMMI process template under TFS for use on my development team, and I'm having trouble understanding the need for separate bug and change request work item types. I understand that it is beneficial to be able...
TITLE: What is the difference between a bug and a change request in MSF for CMMI? QUESTION: I'm currently evaluating the MSF for CMMI process template under TFS for use on my development team, and I'm having trouble understanding the need for separate bug and change request work item types. I understand that it is ben...
[ "tfs", "workflow", "lifecycle", "cmmi", "ms-solution-framework" ]
11
13
17,807
6
0
2008-08-07T21:17:58.170000
2008-08-07T22:17:29.877000
5,349
6,192
Memcached chunk limit
Why is there a hardcoded chunk limit (.5 meg after compression) in memcached? Has anyone recompiled theirs to up it? I know I should not be sending big chunks like that around, but these extra heavy chunks happen for me from time to time and wreak havoc.
This question used to be in the official FAQ What are some limits in memcached I might hit? (Wayback Machine) To quote: The simple limits you will probably see with memcache are the key and item size limits. Keys are restricted to 250 characters. Stored data cannot exceed 1 megabyte in size, since that is the largest t...
Memcached chunk limit Why is there a hardcoded chunk limit (.5 meg after compression) in memcached? Has anyone recompiled theirs to up it? I know I should not be sending big chunks like that around, but these extra heavy chunks happen for me from time to time and wreak havoc.
TITLE: Memcached chunk limit QUESTION: Why is there a hardcoded chunk limit (.5 meg after compression) in memcached? Has anyone recompiled theirs to up it? I know I should not be sending big chunks like that around, but these extra heavy chunks happen for me from time to time and wreak havoc. ANSWER: This question us...
[ "membership" ]
8
4
3,019
1
0
2008-08-07T21:31:59.187000
2008-08-08T17:37:02.743000
5,374
5,469
How do you use a variable in xsl when trying to select a node?
I would have thought this would be an easy one to Google, but I've been unsuccessful. I want to assign a variable the value out of an attribute (easy so far) then use that variable to select another node based on the value of that attribute. Example:
Ok, I finally figured it out. Silly problem really, I simply needed to leave out the quotes and the braces. One of those times when I thought that I'd already tried that.:D Oh, and I mistyped @myId in the first example, the code was actually $myId.
How do you use a variable in xsl when trying to select a node? I would have thought this would be an easy one to Google, but I've been unsuccessful. I want to assign a variable the value out of an attribute (easy so far) then use that variable to select another node based on the value of that attribute. Example:
TITLE: How do you use a variable in xsl when trying to select a node? QUESTION: I would have thought this would be an easy one to Google, but I've been unsuccessful. I want to assign a variable the value out of an attribute (easy so far) then use that variable to select another node based on the value of that attribut...
[ "xslt" ]
16
17
20,204
2
0
2008-08-07T21:53:58.440000
2008-08-07T23:16:07.947000
5,396
5,481
SQL Server 2008 FileStream on a Web Server
I've been developing a site using ASP.NET MVC, and have decided to use the new SQL Server 2008 FILESTREAM facility to store files 'within' the database rather than as separate entities. While initially working within VS2008 (using a trusted connection to the database), everything was fine and dandy. Issues arose, howev...
Take a look at this article. I don't know a whole lot about FileStreaming and security, but there are a couple of interesting options in the FileStreaming setup such as allowing remote connections and allow remote clients to access FileStreaming
SQL Server 2008 FileStream on a Web Server I've been developing a site using ASP.NET MVC, and have decided to use the new SQL Server 2008 FILESTREAM facility to store files 'within' the database rather than as separate entities. While initially working within VS2008 (using a trusted connection to the database), everyth...
TITLE: SQL Server 2008 FileStream on a Web Server QUESTION: I've been developing a site using ASP.NET MVC, and have decided to use the new SQL Server 2008 FILESTREAM facility to store files 'within' the database rather than as separate entities. While initially working within VS2008 (using a trusted connection to the ...
[ "sql-server", "sql-server-2008", "iis" ]
8
2
1,422
1
0
2008-08-07T22:10:05.663000
2008-08-07T23:36:46.673000
5,415
73,281
Convert Bytes to Floating Point Numbers?
I have a binary file that I have to parse and I'm using Python. Is there a way to take 4 bytes and convert it to a single precision floating point number?
>>> import struct >>> struct.pack('f', 3.141592654) b'\xdb\x0fI@' >>> struct.unpack('f', b'\xdb\x0fI@') (3.1415927410125732,) >>> struct.pack('4f', 1.0, 2.0, 3.0, 4.0) '\x00\x00\x80?\x00\x00\x00@\x00\x00@@\x00\x00\x80@'
Convert Bytes to Floating Point Numbers? I have a binary file that I have to parse and I'm using Python. Is there a way to take 4 bytes and convert it to a single precision floating point number?
TITLE: Convert Bytes to Floating Point Numbers? QUESTION: I have a binary file that I have to parse and I'm using Python. Is there a way to take 4 bytes and convert it to a single precision floating point number? ANSWER: >>> import struct >>> struct.pack('f', 3.141592654) b'\xdb\x0fI@' >>> struct.unpack('f', b'\xdb\x...
[ "python", "floating-point" ]
97
130
160,210
4
0
2008-08-07T22:24:27.740000
2008-09-16T14:59:37.253000
5,419
5,430
Python, Unicode, and the Windows console
When I try to print a string in a Windows console, sometimes I get an error that says UnicodeEncodeError: 'charmap' codec can't encode character..... I assume this is because the Windows console cannot handle all Unicode characters. How can I work around this? For example, how can I make the program display a replaceme...
Note: This answer is sort of outdated (from 2008). Please use the solution below with care!! Here is a page that details the problem and a solution (search the page for the text Wrapping sys.stdout into an instance ): PrintFails - Python Wiki Here's a code excerpt from that page: $ python -c 'import sys, codecs, locale...
Python, Unicode, and the Windows console When I try to print a string in a Windows console, sometimes I get an error that says UnicodeEncodeError: 'charmap' codec can't encode character..... I assume this is because the Windows console cannot handle all Unicode characters. How can I work around this? For example, how c...
TITLE: Python, Unicode, and the Windows console QUESTION: When I try to print a string in a Windows console, sometimes I get an error that says UnicodeEncodeError: 'charmap' codec can't encode character..... I assume this is because the Windows console cannot handle all Unicode characters. How can I work around this? ...
[ "python", "unicode" ]
177
38
135,664
15
0
2008-08-07T22:26:58.063000
2008-08-07T22:32:23.510000
5,425
5,441
HTML comments break down
I have a page that is generated which inserts an HTML comment near the top of the page. Inside the comment is a *nix-style command. This comment breaks the page completely. What is wrong with the comment to cause this to happen, and why is this the case?
Comments in the XML Spec from the w3.org: For compatibility, the string "--" (double-hyphen) MUST NOT occur within comments.
HTML comments break down I have a page that is generated which inserts an HTML comment near the top of the page. Inside the comment is a *nix-style command. This comment breaks the page completely. What is wrong with the comment to cause this to happen, and why is this the case?
TITLE: HTML comments break down QUESTION: I have a page that is generated which inserts an HTML comment near the top of the page. Inside the comment is a *nix-style command. This comment breaks the page completely. What is wrong with the comment to cause this to happen, and why is this the case? ANSWER: Comments in t...
[ "html", "xml", "comments", "sgml" ]
24
27
1,093
3
0
2008-08-07T22:30:25.357000
2008-08-07T22:39:12.983000
5,428
5,439
Do people use the Hungarian Naming Conventions in the real world?
Is it worth learning the convention or is it a bane to readability and maintainability?
Considering that most people that use Hungarian Notation is following the misunderstood version of it, I'd say it's pretty pointless. If you want to use the original definition of it, it might make more sense, but other than that it is mostly syntactic sugar. If you read the Wikipedia article on the subject, you'll fin...
Do people use the Hungarian Naming Conventions in the real world? Is it worth learning the convention or is it a bane to readability and maintainability?
TITLE: Do people use the Hungarian Naming Conventions in the real world? QUESTION: Is it worth learning the convention or is it a bane to readability and maintainability? ANSWER: Considering that most people that use Hungarian Notation is following the misunderstood version of it, I'd say it's pretty pointless. If yo...
[ "conventions", "hungarian-notation", "self-documenting-code" ]
34
59
12,784
20
0
2008-08-07T22:31:13.653000
2008-08-07T22:39:00.533000
5,459
19,601
Accessing a CONST attribute of series of Classes
This is how I wanted to do it which would work in PHP 5.3.0+ But I'm restricted to using PHP 5.2.6. Can anyone think of a simple way to simulate this behavior without instantiating the class?
You can accomplish this without using eval in pre-5.3 code. Just use the constant function:
Accessing a CONST attribute of series of Classes This is how I wanted to do it which would work in PHP 5.3.0+ But I'm restricted to using PHP 5.2.6. Can anyone think of a simple way to simulate this behavior without instantiating the class?
TITLE: Accessing a CONST attribute of series of Classes QUESTION: This is how I wanted to do it which would work in PHP 5.3.0+ But I'm restricted to using PHP 5.2.6. Can anyone think of a simple way to simulate this behavior without instantiating the class? ANSWER: You can accomplish this without using eval in pre-5....
[ "php", "oop" ]
11
10
792
2
0
2008-08-07T22:58:42.617000
2008-08-21T10:48:23.407000
5,460
5,462
Telligent's Community Server
The company I work for is wanting to add blog functionality to our website and they were looking to spend an awful amount of money to have some crap being built on top of a CMS they purchased (sitecore). I pointed them to Telligent's Community Server and we had a sales like meeting today to get the Marketing folks on b...
I've done quite a few projects using Community Server. If you're okay with the out-of-the-box functionality, or you don't mind sticking to the version you start with, I think you'll be very happy. The times I've run into headaches using CS is when the client wants functionality CS does not provide, but also insists on ...
Telligent's Community Server The company I work for is wanting to add blog functionality to our website and they were looking to spend an awful amount of money to have some crap being built on top of a CMS they purchased (sitecore). I pointed them to Telligent's Community Server and we had a sales like meeting today to...
TITLE: Telligent's Community Server QUESTION: The company I work for is wanting to add blog functionality to our website and they were looking to spend an awful amount of money to have some crap being built on top of a CMS they purchased (sitecore). I pointed them to Telligent's Community Server and we had a sales lik...
[ "community-server" ]
5
9
2,909
8
0
2008-08-07T23:00:30.053000
2008-08-07T23:08:54.110000
5,473
21,778
How can I undo git reset --hard HEAD~1?
Is it possible to undo the changes caused by the following command? If so, how? git reset --hard HEAD~1
Pat Notz is correct. You can get the commit back so long as it's been within a few days. git only garbage collects after about a month or so unless you explicitly tell it to remove newer blobs. $ git init Initialized empty Git repository in.git/ $ echo "testing reset" > file1 $ git add file1 $ git commit -m 'added fil...
How can I undo git reset --hard HEAD~1? Is it possible to undo the changes caused by the following command? If so, how? git reset --hard HEAD~1
TITLE: How can I undo git reset --hard HEAD~1? QUESTION: Is it possible to undo the changes caused by the following command? If so, how? git reset --hard HEAD~1 ANSWER: Pat Notz is correct. You can get the commit back so long as it's been within a few days. git only garbage collects after about a month or so unless y...
[ "git", "version-control", "git-reset" ]
1,637
2,420
856,927
20
0
2008-08-07T23:22:51.273000
2008-08-22T04:36:02.187000
5,482
5,500
How to specify javascript to run when ModalPopupExtender is shown
The ASP.NET AJAX ModalPopupExtender has OnCancelScript and OnOkScript properties, but it doesn't seem to have an OnShowScript property. I'd like to specify a javascript function to run each time the popup is shown. In past situations, I set the TargetControlID to a dummy control and provide my own control that first do...
hmmm... I'm pretty sure that there's a shown event for the MPE... this is off the top of my head, but I think you can add an event handler to the shown event on page_load function pageLoad() { var popup = $find('ModalPopupClientID'); popup.add_shown(SetFocus); } function SetFocus() { $get('TriggerClientId').focus(); }...
How to specify javascript to run when ModalPopupExtender is shown The ASP.NET AJAX ModalPopupExtender has OnCancelScript and OnOkScript properties, but it doesn't seem to have an OnShowScript property. I'd like to specify a javascript function to run each time the popup is shown. In past situations, I set the TargetCon...
TITLE: How to specify javascript to run when ModalPopupExtender is shown QUESTION: The ASP.NET AJAX ModalPopupExtender has OnCancelScript and OnOkScript properties, but it doesn't seem to have an OnShowScript property. I'd like to specify a javascript function to run each time the popup is shown. In past situations, I...
[ "asp.net", "javascript", "asp.net-ajax" ]
39
30
31,759
8
0
2008-08-07T23:37:30.807000
2008-08-08T00:03:41.067000
5,494
12,519
Alternative Hostname for an IIS web site for internal access only
I'm using IIS in Windows 2003 Server for a SharePoint intranet. External incoming requests will be using the host header portal.mycompany.com and be forced to use SSL. I was wondering if there's a way to set up an alternate host header such as http://internalportal/ which only accepts requests from the internal network...
Daniel, keep in mind that just because something is possbile in IIS, and via any number of off box solutions (like hardware load balancers and SSL) doesn't mean that it is supported by SharePoint, or that it is implemented in the same way. You can do what you are asking for, however you should do it via SharePoint Cent...
Alternative Hostname for an IIS web site for internal access only I'm using IIS in Windows 2003 Server for a SharePoint intranet. External incoming requests will be using the host header portal.mycompany.com and be forced to use SSL. I was wondering if there's a way to set up an alternate host header such as http://int...
TITLE: Alternative Hostname for an IIS web site for internal access only QUESTION: I'm using IIS in Windows 2003 Server for a SharePoint intranet. External incoming requests will be using the host header portal.mycompany.com and be forced to use SSL. I was wondering if there's a way to set up an alternate host header ...
[ "sharepoint", "iis", "moss", "wss" ]
3
3
6,303
3
0
2008-08-07T23:53:55.717000
2008-08-15T17:34:38.593000
5,507
5,524
Does it still make sense to learn low level WinAPI programming?
Does it make sense, having all of the C#-managed-bliss, to go back to Petzold's Programming Windows and try to produce code w/ pure WinAPI? What can be learn from it? Isn't it just too outdated to be useful?
This question is bordering on religious:) But I'll give my thoughts anyway. I do see value in learing the Win32 API. Most, if not all, GUI libraries (managed or unmanaged) result in calls to the Win32 API. Even the most thorough libraries don't cover 100% of the API, and hence there are always gaps which need to be plu...
Does it still make sense to learn low level WinAPI programming? Does it make sense, having all of the C#-managed-bliss, to go back to Petzold's Programming Windows and try to produce code w/ pure WinAPI? What can be learn from it? Isn't it just too outdated to be useful?
TITLE: Does it still make sense to learn low level WinAPI programming? QUESTION: Does it make sense, having all of the C#-managed-bliss, to go back to Petzold's Programming Windows and try to produce code w/ pure WinAPI? What can be learn from it? Isn't it just too outdated to be useful? ANSWER: This question is bord...
[ "windows", "winapi" ]
55
66
12,771
22
0
2008-08-08T00:29:13.963000
2008-08-08T01:00:49.203000
5,509
81,892
Rational Purify failing to jump to memory leaks
So my company uses a delightfully buggy program called Rational Purify (as a plugin to Microsoft Visual Developer Studio) to manage memory leaks. The program is deigned to let you click on a memory leak after you have encountered it, and then jump to the line that the leak occurs on. Unfortunately Purify is malfunction...
Generally you have two options, one exclude modules DLL's from instrumentation in Purify, it helps some times. Second is get BoundsChecker, this does compile time instrumentation much slower but the level of detail is an order of magnitude better. We generally use Purify on check-in, sanity checking, and BoundsChecker ...
Rational Purify failing to jump to memory leaks So my company uses a delightfully buggy program called Rational Purify (as a plugin to Microsoft Visual Developer Studio) to manage memory leaks. The program is deigned to let you click on a memory leak after you have encountered it, and then jump to the line that the lea...
TITLE: Rational Purify failing to jump to memory leaks QUESTION: So my company uses a delightfully buggy program called Rational Purify (as a plugin to Microsoft Visual Developer Studio) to manage memory leaks. The program is deigned to let you click on a memory leak after you have encountered it, and then jump to the...
[ "memory-leaks", "purify" ]
0
3
2,082
5
0
2008-08-08T00:31:19.823000
2008-09-17T10:39:03.347000
5,511
7,794
Numeric Data Entry in WPF
How are you handling the entry of numeric values in WPF applications? Without a NumericUpDown control, I've been using a TextBox and handling its PreviewKeyDown event with the code below, but it's pretty ugly. Has anyone found a more graceful way to get numeric data from the user without relying on a third-party contro...
How about: protected override void OnPreviewTextInput(System.Windows.Input.TextCompositionEventArgs e) { e.Handled =!AreAllValidNumericChars(e.Text); base.OnPreviewTextInput(e); } private bool AreAllValidNumericChars(string str) { foreach(char c in str) { if(!Char.IsNumber(c)) return false; } return true; }
Numeric Data Entry in WPF How are you handling the entry of numeric values in WPF applications? Without a NumericUpDown control, I've been using a TextBox and handling its PreviewKeyDown event with the code below, but it's pretty ugly. Has anyone found a more graceful way to get numeric data from the user without relyi...
TITLE: Numeric Data Entry in WPF QUESTION: How are you handling the entry of numeric values in WPF applications? Without a NumericUpDown control, I've been using a TextBox and handling its PreviewKeyDown event with the code below, but it's pretty ugly. Has anyone found a more graceful way to get numeric data from the ...
[ "c#", "wpf" ]
66
57
61,585
17
0
2008-08-08T00:37:55.020000
2008-08-11T13:47:12.253000
5,527
5,532
Is there a real benefit of using J#?
I just saw a comment of suggesting J#, and it made me wonder... is there a real, beneficial use of J# over Java? So, my feeling is that the only reason you would even consider using J# is that management has decreed that the company should jump on the Java bandwagon... and the.NET bandwagon. If you use J#, you are effe...
J# is no longer included in VS2008. Unless you already have J# code, you should probably stay away. From j# product page: Since customers have told us that the existing J# feature set largely meets their needs and usage of J# is declining, Microsoft is retiring the Visual J# product and Java Language Conversion Assista...
Is there a real benefit of using J#? I just saw a comment of suggesting J#, and it made me wonder... is there a real, beneficial use of J# over Java? So, my feeling is that the only reason you would even consider using J# is that management has decreed that the company should jump on the Java bandwagon... and the.NET b...
TITLE: Is there a real benefit of using J#? QUESTION: I just saw a comment of suggesting J#, and it made me wonder... is there a real, beneficial use of J# over Java? So, my feeling is that the only reason you would even consider using J# is that management has decreed that the company should jump on the Java bandwago...
[ "java", "j#" ]
26
22
4,299
8
0
2008-08-08T01:04:02.300000
2008-08-08T01:11:58.680000
5,544
14,474
In ASP.NET MVC I encounter an incorrect type error when rendering a user control with the correct typed object
I encounter an error of the form: "The model item passed into the dictionary is of type FooViewData but this dictionary requires a model item of type bar" even though I am passing in an object of the correct type (bar) for the typed user control.
What @MattMitchell said is probably the reason you're seeing this error. If you want to know why; it is because when you pass null as the controlData parameter when using RenderUserControl(), the framework will try to pass the view data from the current view context onto the user control instead (see UserControlExtensi...
In ASP.NET MVC I encounter an incorrect type error when rendering a user control with the correct typed object I encounter an error of the form: "The model item passed into the dictionary is of type FooViewData but this dictionary requires a model item of type bar" even though I am passing in an object of the correct t...
TITLE: In ASP.NET MVC I encounter an incorrect type error when rendering a user control with the correct typed object QUESTION: I encounter an error of the form: "The model item passed into the dictionary is of type FooViewData but this dictionary requires a model item of type bar" even though I am passing in an objec...
[ "asp.net-mvc" ]
4
4
464
2
0
2008-08-08T01:31:21.963000
2008-08-18T11:31:39.730000
5,598
6,100
Document or RPC based web services
My gut feel is that document based web services are preferred in practice - is this other peoples experience? Are they easier to support? (I noted that SharePoint uses Any for the "document type" in its WSDL interface, I guess that makes it Document based). Also - are people offering both WSDL and Rest type services no...
Document versus RPC is only a question if you are using SOAP Web Services which require a service description ( WSDL ). RESTful web services do not not use WSDL because the service can't be described by it, and the feeling is that REST is simpler and easier to understand. Some people have proposed WADL as a way to desc...
Document or RPC based web services My gut feel is that document based web services are preferred in practice - is this other peoples experience? Are they easier to support? (I noted that SharePoint uses Any for the "document type" in its WSDL interface, I guess that makes it Document based). Also - are people offering ...
TITLE: Document or RPC based web services QUESTION: My gut feel is that document based web services are preferred in practice - is this other peoples experience? Are they easier to support? (I noted that SharePoint uses Any for the "document type" in its WSDL interface, I guess that makes it Document based). Also - ar...
[ "web-services", "rest", "wsdl" ]
19
30
9,287
3
0
2008-08-08T02:42:48.887000
2008-08-08T15:55:58.517000
5,600
5,607
Tables with no Primary Key
I have several tables whose only unique data is a uniqueidentifier (a Guid) column. Because guids are non-sequential (and they're client-side generated so I can't use newsequentialid()), I have made a non-primary, non-clustered index on this ID field rather than giving the tables a clustered primary key. I'm wondering ...
When dealing with indexes, you have to determine what your table is going to be used for. If you are primarily inserting 1000 rows a second and not doing any querying, then a clustered index is a hit to performance. If you are doing 1000 queries a second, then not having an index will lead to very bad performance. The ...
Tables with no Primary Key I have several tables whose only unique data is a uniqueidentifier (a Guid) column. Because guids are non-sequential (and they're client-side generated so I can't use newsequentialid()), I have made a non-primary, non-clustered index on this ID field rather than giving the tables a clustered ...
TITLE: Tables with no Primary Key QUESTION: I have several tables whose only unique data is a uniqueidentifier (a Guid) column. Because guids are non-sequential (and they're client-side generated so I can't use newsequentialid()), I have made a non-primary, non-clustered index on this ID field rather than giving the t...
[ "sql-server", "indexing" ]
42
34
38,173
7
0
2008-08-08T02:47:15.620000
2008-08-08T03:04:29.047000
5,611
5,820
Better Random Generating PHP
I know that just using rand() is predictable, if you know what you're doing, and have access to the server. I have a project that is highly dependent upon choosing a random number that is as unpredictable as possible. So I'm looking for suggestions, either other built-in functions or user functions, that can generate a...
Adding, multiplying, or truncating a poor random source will give you a poor random result. See Introduction to Randomness and Random Numbers for an explanation. You're right about PHP rand() function. See the second figure on Statistical Analysis for a striking illustration. (The first figure is striking, but it's bee...
Better Random Generating PHP I know that just using rand() is predictable, if you know what you're doing, and have access to the server. I have a project that is highly dependent upon choosing a random number that is as unpredictable as possible. So I'm looking for suggestions, either other built-in functions or user f...
TITLE: Better Random Generating PHP QUESTION: I know that just using rand() is predictable, if you know what you're doing, and have access to the server. I have a project that is highly dependent upon choosing a random number that is as unpredictable as possible. So I'm looking for suggestions, either other built-in f...
[ "php", "security", "random" ]
22
22
8,416
6
0
2008-08-08T03:18:56.397000
2008-08-08T11:48:42.400000
5,619
5,626
Debugging: IE6 + SSL + AJAX + post form = 404 error
The Setting: The program in question tries to post form data via an AJAX call to a target procedure contained in the same package as the caller. This is done for a site that uses a secure connection (HTTPS). The technology used here is PLSQL and the DOJO JavaScript library. The development tool is basically a text edit...
First port of call would be to fire up Fiddler and analyze the data going to and from the browser. Take a look at the headers, the url actually being called and the params (if any) being passed to the AJAX method and see if it all looks good before getting to the server. If that all looks ok, is there any way you can v...
Debugging: IE6 + SSL + AJAX + post form = 404 error The Setting: The program in question tries to post form data via an AJAX call to a target procedure contained in the same package as the caller. This is done for a site that uses a secure connection (HTTPS). The technology used here is PLSQL and the DOJO JavaScript li...
TITLE: Debugging: IE6 + SSL + AJAX + post form = 404 error QUESTION: The Setting: The program in question tries to post form data via an AJAX call to a target procedure contained in the same package as the caller. This is done for a site that uses a secure connection (HTTPS). The technology used here is PLSQL and the ...
[ "ajax", "debugging", "internet-explorer", "ssl", "internet-explorer-6" ]
6
4
3,695
1
0
2008-08-08T03:38:57.747000
2008-08-08T03:47:22.703000
5,628
30,573
Is there a way to include a fragment identifier when using Asp.Net MVC ActionLink, RedirectToAction, etc.?
I want some links to include a fragment identifier. Like some of the URLs on this site: Debugging: IE6 + SSL + AJAX + post form = 404 error #5626 Is there a way to do this with any of the built-in methods in MVC? Or would I have to roll my own HTML helpers?
We're looking at including support for this in our next release.
Is there a way to include a fragment identifier when using Asp.Net MVC ActionLink, RedirectToAction, etc.? I want some links to include a fragment identifier. Like some of the URLs on this site: Debugging: IE6 + SSL + AJAX + post form = 404 error #5626 Is there a way to do this with any of the built-in methods in MVC? ...
TITLE: Is there a way to include a fragment identifier when using Asp.Net MVC ActionLink, RedirectToAction, etc.? QUESTION: I want some links to include a fragment identifier. Like some of the URLs on this site: Debugging: IE6 + SSL + AJAX + post form = 404 error #5626 Is there a way to do this with any of the built-i...
[ "asp.net-mvc" ]
22
6
4,975
7
0
2008-08-08T03:54:08.090000
2008-08-27T16:18:45.187000
5,629
14,192
Any reason not to start using the HTML 5 doctype?
It is supposed to be backwards compatible with HTML4 and XHTML. John Resig posted about some of the benefits. As long as we don't use any of the new and not supported yet features, would there be any downside to start building sites with this doctype?
Well consider this: When serving as text/html, all you need a doctype for is to trigger standards mode. Beyond that, the doctype does nothing as far as browsers are concerned. When serving as text/html, whether you use XHTML markup or HTML markup, it's treated by browsers as HTML. So, really it comes down to using the ...
Any reason not to start using the HTML 5 doctype? It is supposed to be backwards compatible with HTML4 and XHTML. John Resig posted about some of the benefits. As long as we don't use any of the new and not supported yet features, would there be any downside to start building sites with this doctype?
TITLE: Any reason not to start using the HTML 5 doctype? QUESTION: It is supposed to be backwards compatible with HTML4 and XHTML. John Resig posted about some of the benefits. As long as we don't use any of the new and not supported yet features, would there be any downside to start building sites with this doctype? ...
[ "html", "doctype" ]
132
143
72,132
10
0
2008-08-08T04:03:10.583000
2008-08-18T04:42:59.413000
5,649
5,756
x86 Assembly on a Mac
Does anyone know of any good tools (I'm looking for IDEs) to write assembly on the Mac. Xcode is a little cumbersome to me. Also, on the Intel Macs, can I use generic x86 asm? Or is there a modified instruction set? Any information about post Intel. Also: I know that on windows, asm can run in an emulated environment c...
After installing any version of Xcode targeting Intel-based Macs, you should be able to write assembly code. Xcode is a suite of tools, only one of which is the IDE, so you don't have to use it if you don't want to. (That said, if there are specific things you find clunky, please file a bug at Apple's bug reporter - ev...
x86 Assembly on a Mac Does anyone know of any good tools (I'm looking for IDEs) to write assembly on the Mac. Xcode is a little cumbersome to me. Also, on the Intel Macs, can I use generic x86 asm? Or is there a modified instruction set? Any information about post Intel. Also: I know that on windows, asm can run in an ...
TITLE: x86 Assembly on a Mac QUESTION: Does anyone know of any good tools (I'm looking for IDEs) to write assembly on the Mac. Xcode is a little cumbersome to me. Also, on the Intel Macs, can I use generic x86 asm? Or is there a modified instruction set? Any information about post Intel. Also: I know that on windows, ...
[ "xcode", "macos", "x86", "assembly" ]
71
86
125,783
7
0
2008-08-08T04:25:11.630000
2008-08-08T07:07:10.540000
5,667
80,353
Sleep from within an Informix SPL procedure
What's the best way to do the semantic equivalent of the traditional sleep() system call from within an Informix SPL routine? In other words, simply "pause" for N seconds (or milliseconds or whatever, but seconds are fine). I'm looking for a solution that does not involve linking some new (perhaps written by me) C code...
There must be some good reason you're not wanting the obvious answer: SYSTEM "sleep 5". If all you're wanting is for the SPL to pause while you check various values etc, here are a couple of thoughts (all of which are utter hacks, of course): Make the TRACE FILE a named pipe (assuming Unix back-end), so it blocks until...
Sleep from within an Informix SPL procedure What's the best way to do the semantic equivalent of the traditional sleep() system call from within an Informix SPL routine? In other words, simply "pause" for N seconds (or milliseconds or whatever, but seconds are fine). I'm looking for a solution that does not involve lin...
TITLE: Sleep from within an Informix SPL procedure QUESTION: What's the best way to do the semantic equivalent of the traditional sleep() system call from within an Informix SPL routine? In other words, simply "pause" for N seconds (or milliseconds or whatever, but seconds are fine). I'm looking for a solution that do...
[ "informix", "spl" ]
4
2
5,318
4
0
2008-08-08T04:36:30.593000
2008-09-17T05:45:52.350000
5,682
5,693
Is it just me, or are characters being rendered incorrectly more lately?
I'm not sure if it's my system, although I haven't done anything unusual with it, but I've started noticing incorrectly rendered characters popping up in web pages, text-files, like this: http://www.kbssource.com/strange-characters.gif I have a hunch it's a related to the fairly recent trend to use unicode for everythi...
It appears that for this particular author, the text was edited in some editor that assumed it wasn't UTF8, and then re-wrote it out in UTF8. I'm basing this off the fact that if I tell my browser to interpret the page as different common encodings, none make it display correctly. This tells me that some conversion was...
Is it just me, or are characters being rendered incorrectly more lately? I'm not sure if it's my system, although I haven't done anything unusual with it, but I've started noticing incorrectly rendered characters popping up in web pages, text-files, like this: http://www.kbssource.com/strange-characters.gif I have a hu...
TITLE: Is it just me, or are characters being rendered incorrectly more lately? QUESTION: I'm not sure if it's my system, although I haven't done anything unusual with it, but I've started noticing incorrectly rendered characters popping up in web pages, text-files, like this: http://www.kbssource.com/strange-characte...
[ "unicode", "utf-8", "fonts" ]
2
2
699
3
0
2008-08-08T04:51:27.973000
2008-08-08T05:08:02.807000
5,690
5,699
MVC Preview 4 - No route in the route table matches the supplied values
I have a route that I am calling through a RedirectToRoute like this: return this.RedirectToRoute("Super-SuperRoute", new { year = selectedYear }); I have also tried: return this.RedirectToRoute("Super-SuperRoute", new { controller = "Super", action = "SuperRoute", id = "RouteTopic", year = selectedYear }); The route i...
What type is selectedYear? A DateTime? If so then you might need to convert to a string.
MVC Preview 4 - No route in the route table matches the supplied values I have a route that I am calling through a RedirectToRoute like this: return this.RedirectToRoute("Super-SuperRoute", new { year = selectedYear }); I have also tried: return this.RedirectToRoute("Super-SuperRoute", new { controller = "Super", actio...
TITLE: MVC Preview 4 - No route in the route table matches the supplied values QUESTION: I have a route that I am calling through a RedirectToRoute like this: return this.RedirectToRoute("Super-SuperRoute", new { year = selectedYear }); I have also tried: return this.RedirectToRoute("Super-SuperRoute", new { controlle...
[ "asp.net-mvc", "asp.net-mvc-routing" ]
4
5
3,280
1
0
2008-08-08T05:03:42.783000
2008-08-08T05:21:07.477000
5,694
5,695
The imported project "C:\Microsoft.CSharp.targets" was not found
I got this error today when trying to open a Visual Studio 2008 project in Visual Studio 2005: The imported project "C:\Microsoft.CSharp.targets" was not found.
Open your csproj file in notepad (or notepad++) Find the line: and change it to
The imported project "C:\Microsoft.CSharp.targets" was not found I got this error today when trying to open a Visual Studio 2008 project in Visual Studio 2005: The imported project "C:\Microsoft.CSharp.targets" was not found.
TITLE: The imported project "C:\Microsoft.CSharp.targets" was not found QUESTION: I got this error today when trying to open a Visual Studio 2008 project in Visual Studio 2005: The imported project "C:\Microsoft.CSharp.targets" was not found. ANSWER: Open your csproj file in notepad (or notepad++) Find the line: and ...
[ "c#", "visual-studio" ]
142
117
187,980
20
0
2008-08-08T05:08:45.020000
2008-08-08T05:10:20.760000
5,706
5,709
When do Request.Params and Request.Form differ?
I recently encountered a problem where a value was null if accessed with Request.Form but fine if retrieved with Request.Params. What are the differences between these methods that could cause this?
Request.Form only includes variables posted through a form, while Request.Params includes both posted form variables and get variables specified as URL parameters.
When do Request.Params and Request.Form differ? I recently encountered a problem where a value was null if accessed with Request.Form but fine if retrieved with Request.Params. What are the differences between these methods that could cause this?
TITLE: When do Request.Params and Request.Form differ? QUESTION: I recently encountered a problem where a value was null if accessed with Request.Form but fine if retrieved with Request.Params. What are the differences between these methods that could cause this? ANSWER: Request.Form only includes variables posted th...
[ "c#", "asp.net", "request" ]
36
32
29,058
3
0
2008-08-08T05:40:49.713000
2008-08-08T05:51:54.420000
5,724
5,823
Better windows command line shells
Is there a better windows command line shell other than cmd which has better copy paste between Windows' windows and console windows?
Take Command does support Copy/Cut/Paste from the keyboard and the mouse. It's pretty handy if you do a lot of work from a command prompt. It also supports: Command and folder history, with popup windows to select prior commands or folders. Screen scroll back buffer Enhanced batch commands Built in FTP/HTTP file access...
Better windows command line shells Is there a better windows command line shell other than cmd which has better copy paste between Windows' windows and console windows?
TITLE: Better windows command line shells QUESTION: Is there a better windows command line shell other than cmd which has better copy paste between Windows' windows and console windows? ANSWER: Take Command does support Copy/Cut/Paste from the keyboard and the mouse. It's pretty handy if you do a lot of work from a c...
[ "windows", "shell", "cmd" ]
66
11
47,687
14
0
2008-08-08T06:15:11.033000
2008-08-08T11:59:40.503000
5,727
5,754
What are the barriers to understanding pointers and what can be done to overcome them?
Why are pointers such a leading factor of confusion for many new, and even old, college-level students in C or C++? Are there any tools or thought processes that helped you understand how pointers work at the variable, function, and beyond level? What are some good practice things that can be done to bring somebody to ...
Pointers is a concept that for many can be confusing at first, in particular when it comes to copying pointer values around and still referencing the same memory block. I've found that the best analogy is to consider the pointer as a piece of paper with a house address on it, and the memory block it references as the a...
What are the barriers to understanding pointers and what can be done to overcome them? Why are pointers such a leading factor of confusion for many new, and even old, college-level students in C or C++? Are there any tools or thought processes that helped you understand how pointers work at the variable, function, and ...
TITLE: What are the barriers to understanding pointers and what can be done to overcome them? QUESTION: Why are pointers such a leading factor of confusion for many new, and even old, college-level students in C or C++? Are there any tools or thought processes that helped you understand how pointers work at the variab...
[ "c++", "c", "pointers" ]
470
757
91,470
28
0
2008-08-08T06:17:51.543000
2008-08-08T06:58:48.700000
5,743
5,771
What is a good plotting library for .Net?
I'm writing some data acquisition software and need a gui plotting library that is fast enough to do realtime updated graphs. I've been using Nplot which is pretty good for a free library, but I'm wondering if there are any better libraries (preferably free or cheap).
There's a good post about this here and here. I have also used NPlot in our last project since it's easier to use.
What is a good plotting library for .Net? I'm writing some data acquisition software and need a gui plotting library that is fast enough to do realtime updated graphs. I've been using Nplot which is pretty good for a free library, but I'm wondering if there are any better libraries (preferably free or cheap).
TITLE: What is a good plotting library for .Net? QUESTION: I'm writing some data acquisition software and need a gui plotting library that is fast enough to do realtime updated graphs. I've been using Nplot which is pretty good for a free library, but I'm wondering if there are any better libraries (preferably free or...
[ ".net", "windows", "graphing" ]
19
4
4,393
7
0
2008-08-08T06:40:46.553000
2008-08-08T07:49:30.297000
5,759
5,761
Equivalent VB keyword for 'break'
I just moved over to the Visual Basic team here at work. What is the equivalent keyword to break in Visual Basic, that is, to exit a loop early but not the method?
In both Visual Basic 6.0 and VB.NET you would use: Exit For to break from For loop Wend to break from While loop Exit Do to break from Do loop depending on the loop type. See Exit Statements for more details.
Equivalent VB keyword for 'break' I just moved over to the Visual Basic team here at work. What is the equivalent keyword to break in Visual Basic, that is, to exit a loop early but not the method?
TITLE: Equivalent VB keyword for 'break' QUESTION: I just moved over to the Visual Basic team here at work. What is the equivalent keyword to break in Visual Basic, that is, to exit a loop early but not the method? ANSWER: In both Visual Basic 6.0 and VB.NET you would use: Exit For to break from For loop Wend to brea...
[ "vb.net", "loops", "vb6", "exit" ]
113
199
145,095
3
0
2008-08-08T07:11:40.560000
2008-08-08T07:13:56.237000
5,787
5,788
Tab Escape Character?
I'm just in the process of parsing some text and can't remember what the escape character is for a tab in C#?
Easy one! "\t" Edit: In fact, here's something official: Escape Sequences
Tab Escape Character? I'm just in the process of parsing some text and can't remember what the escape character is for a tab in C#?
TITLE: Tab Escape Character? QUESTION: I'm just in the process of parsing some text and can't remember what the escape character is for a tab in C#? ANSWER: Easy one! "\t" Edit: In fact, here's something official: Escape Sequences
[ "c#" ]
74
117
114,994
2
0
2008-08-08T09:28:41.423000
2008-08-08T09:30:40.860000
5,791
5,837
IsNothing versus Is Nothing
Does anyone here use VB.NET and have a strong preference for or against using IsNothing as opposed to Is Nothing (for example, If IsNothing(anObject) or If anObject Is Nothing... )? If so, why? EDIT: If you think they're both equally acceptable, do you think it's best to pick one and stick with it, or is it OK to mix t...
If you take a look at the MSIL as it's being executed you'll see that it doesn't compile down to the exact same code. When you use IsNothing() it actually makes a call to that method as opposed to just evaluating the expression. The reason I would tend to lean towards using "Is Nothing" is when I'm negating it becomes ...
IsNothing versus Is Nothing Does anyone here use VB.NET and have a strong preference for or against using IsNothing as opposed to Is Nothing (for example, If IsNothing(anObject) or If anObject Is Nothing... )? If so, why? EDIT: If you think they're both equally acceptable, do you think it's best to pick one and stick w...
TITLE: IsNothing versus Is Nothing QUESTION: Does anyone here use VB.NET and have a strong preference for or against using IsNothing as opposed to Is Nothing (for example, If IsNothing(anObject) or If anObject Is Nothing... )? If so, why? EDIT: If you think they're both equally acceptable, do you think it's best to pi...
[ "vb.net" ]
137
128
213,285
8
0
2008-08-08T09:45:29.067000
2008-08-08T12:28:37.483000
5,802
5,812
Inheritance in database?
Is there any way to use inheritance in database (Specifically in SQL Server 2005)? Suppose I have few field like CreatedOn, CreatedBy which I want to add on all of my entities. I looking for an alternative way instead of adding these fields to every table.
There is no such thing as inheritance between tables in SQL Server 2005, and as noted by the others, you can get as far as getting help adding the necessary columns to the tables when you create them, but it won't be inheritance as you know it. Think of it more like a template for your source code files. As GateKiller ...
Inheritance in database? Is there any way to use inheritance in database (Specifically in SQL Server 2005)? Suppose I have few field like CreatedOn, CreatedBy which I want to add on all of my entities. I looking for an alternative way instead of adding these fields to every table.
TITLE: Inheritance in database? QUESTION: Is there any way to use inheritance in database (Specifically in SQL Server 2005)? Suppose I have few field like CreatedOn, CreatedBy which I want to add on all of my entities. I looking for an alternative way instead of adding these fields to every table. ANSWER: There is no...
[ "sql", "database", "inheritance", "sql-server-2005" ]
9
3
4,984
9
0
2008-08-08T10:41:00.950000
2008-08-08T11:08:22.923000
5,821
5,822
SQL Server Escape an Underscore
How do I escape the underscore character? I am writing something like the following where clause and want to be able to find actual entries with _d at the end. Where Username Like '%_d'
T-SQL Reference for LIKE: You can use the wildcard pattern matching characters as literal characters. To use a wildcard character as a literal character, enclose the wildcard character in brackets. The following table shows several examples of using the LIKE keyword and the [ ] wildcard characters. For your case:... LI...
SQL Server Escape an Underscore How do I escape the underscore character? I am writing something like the following where clause and want to be able to find actual entries with _d at the end. Where Username Like '%_d'
TITLE: SQL Server Escape an Underscore QUESTION: How do I escape the underscore character? I am writing something like the following where clause and want to be able to find actual entries with _d at the end. Where Username Like '%_d' ANSWER: T-SQL Reference for LIKE: You can use the wildcard pattern matching charact...
[ "sql-server" ]
467
724
281,438
8
0
2008-08-08T11:56:36.207000
2008-08-08T11:59:36.340000
5,831
5,878
Binary patch-generation in C#
Does anyone have, or know of, a binary patch generation algorithm implementation in C#? Basically, compare two files (designated old and new ), and produce a patch file that can be used to upgrade the old file to have the same contents as the new file. The implementation would have to be relatively fast, and work with ...
Sorry I couldn't be more help. I would definately keep looking at xdelta because I have used it a number of times to produce quality diffs on 600MB+ ISO files we have generated for distributing our products and it performs very well.
Binary patch-generation in C# Does anyone have, or know of, a binary patch generation algorithm implementation in C#? Basically, compare two files (designated old and new ), and produce a patch file that can be used to upgrade the old file to have the same contents as the new file. The implementation would have to be r...
TITLE: Binary patch-generation in C# QUESTION: Does anyone have, or know of, a binary patch generation algorithm implementation in C#? Basically, compare two files (designated old and new ), and produce a patch file that can be used to upgrade the old file to have the same contents as the new file. The implementation ...
[ "c#", "file", "patch" ]
20
5
11,717
6
0
2008-08-08T12:22:07.713000
2008-08-08T13:03:06.197000
5,842
9,200
Issues using MS Access as a front-end to a MySQL database back-end?
Two users wanted to share the same database, originally written in MS Access, without conflicting with one another over a single MDB file. I moved the tables from a simple MS Access database to MySQL using its Migration Toolkit (which works well, by the way) and set up Access to link to those tables via ODBC. So far, I...
I had an application that worked likewise: an MS Access frontend to a MySQL backend. It was such a huge pain that I ended up writing a Win32 frontend instead. From the top of my head, I encountered the following problems: Development of the ODBC link seems to have ceased long ago. There are various different versions f...
Issues using MS Access as a front-end to a MySQL database back-end? Two users wanted to share the same database, originally written in MS Access, without conflicting with one another over a single MDB file. I moved the tables from a simple MS Access database to MySQL using its Migration Toolkit (which works well, by th...
TITLE: Issues using MS Access as a front-end to a MySQL database back-end? QUESTION: Two users wanted to share the same database, originally written in MS Access, without conflicting with one another over a single MDB file. I moved the tables from a simple MS Access database to MySQL using its Migration Toolkit (which...
[ "mysql", "database", "ms-access" ]
14
15
32,411
7
0
2008-08-08T12:30:48.633000
2008-08-12T20:02:41.557000
5,846
5,848
Add 1 to a field
How do I turn the following 2 queries into 1 query $sql = "SELECT level FROM skills WHERE id = $id LIMIT 1;"; $result = $db->sql_query($sql); $level = (int) $db->sql_fetchfield('level'); $db->sql_freeresult($result); ++$level; $sql = "UPDATE skills SET level = $level WHERE id = $id;"; $result = $db->sql_query($sql); ...
I get downmodded for this? $sql = "UPDATE skills SET level = level+1 WHERE id = $id"; $result = $db->sql_query($sql); $db->sql_freeresult($result); In Teifion's specific case, the phpBB DDL lists that particular field as NOT NULL, so there's no danger of incrementing NULL. In the general case, you should not use NULL t...
Add 1 to a field How do I turn the following 2 queries into 1 query $sql = "SELECT level FROM skills WHERE id = $id LIMIT 1;"; $result = $db->sql_query($sql); $level = (int) $db->sql_fetchfield('level'); $db->sql_freeresult($result); ++$level; $sql = "UPDATE skills SET level = $level WHERE id = $id;"; $result = $db->...
TITLE: Add 1 to a field QUESTION: How do I turn the following 2 queries into 1 query $sql = "SELECT level FROM skills WHERE id = $id LIMIT 1;"; $result = $db->sql_query($sql); $level = (int) $db->sql_fetchfield('level'); $db->sql_freeresult($result); ++$level; $sql = "UPDATE skills SET level = $level WHERE id = $id;...
[ "php", "mysql" ]
24
31
23,151
7
0
2008-08-08T12:34:20.887000
2008-08-08T12:35:53.007000
5,855
6,687
Automate builds for Java RCP for deployment with JNLP
I've found many sources that talk about the automated Eclipse PDE process. I feel these sources don't do a good job explaining what's going on. I can create the deployable package, in a semi-manual process via the Feature Export. The automated process requires knowledge of how the org.eclipse.pde.build scripts work. I ...
I haven't done this before, but I found this site on the web giving an explanation.
Automate builds for Java RCP for deployment with JNLP I've found many sources that talk about the automated Eclipse PDE process. I feel these sources don't do a good job explaining what's going on. I can create the deployable package, in a semi-manual process via the Feature Export. The automated process requires knowl...
TITLE: Automate builds for Java RCP for deployment with JNLP QUESTION: I've found many sources that talk about the automated Eclipse PDE process. I feel these sources don't do a good job explaining what's going on. I can create the deployable package, in a semi-manual process via the Feature Export. The automated proc...
[ "java", "build-automation", "rcp", "jnlp" ]
9
5
1,148
1
0
2008-08-08T12:40:02.793000
2008-08-09T07:50:31.647000
5,857
5,860
mailto link for large bodies
I have a page upon which a user can choose up to many different paragraphs. When the link is clicked (or button), an email will open up and put all those paragraphs into the body of the email, address it, and fill in the subject. However, the text can be too long for a mailto link. Any way around this? We were thinking...
By putting the data into a form, I was able to make the body around 1800 characters long before the form stopped working. The code looked like this: Edit: The best way to send emails from a web application is of course to do just that, send it directly from the web application, instead of relying on the users mailprogr...
mailto link for large bodies I have a page upon which a user can choose up to many different paragraphs. When the link is clicked (or button), an email will open up and put all those paragraphs into the body of the email, address it, and fill in the subject. However, the text can be too long for a mailto link. Any way ...
TITLE: mailto link for large bodies QUESTION: I have a page upon which a user can choose up to many different paragraphs. When the link is clicked (or button), an email will open up and put all those paragraphs into the body of the email, address it, and fill in the subject. However, the text can be too long for a mai...
[ "mailto" ]
13
15
12,574
2
0
2008-08-08T12:40:48.627000
2008-08-08T12:47:13.653000
5,863
15,966
WCF Service - Backward compatibility issue
I'm just getting into creating some WCF services, but I have a requirement to make them backward compatible for legacy (.NET 1.1 and 2.0) client applications. I've managed to get the services to run correctly for 3.0 and greater clients, but when I publish the services using a basicHttpBinding endpoint (which I believe...
OK, we needed to resolve this issue in the short term, and so we came up with the idea of a "interop", or compatibility layer. Baiscally, all we did was added a traditional ASMX web service to the project, and called the WCF service from that using native WCF calls. We were then able to return the appropriate types bac...
WCF Service - Backward compatibility issue I'm just getting into creating some WCF services, but I have a requirement to make them backward compatible for legacy (.NET 1.1 and 2.0) client applications. I've managed to get the services to run correctly for 3.0 and greater clients, but when I publish the services using a...
TITLE: WCF Service - Backward compatibility issue QUESTION: I'm just getting into creating some WCF services, but I have a requirement to make them backward compatible for legacy (.NET 1.1 and 2.0) client applications. I've managed to get the services to run correctly for 3.0 and greater clients, but when I publish th...
[ "c#", ".net", "wcf", "web-services", "backwards-compatibility" ]
10
3
2,822
3
0
2008-08-08T12:48:25.197000
2008-08-19T10:45:19.497000
5,872
5,887
Making a production build of a PHP project with Subversion
If you are working in PHP (or I guess any programming language) and using subversion as your source control, is there a way to take your project (for example): C:\Projects\test\.svn C:\Projects\test\docs\ C:\Projects\test\faq.php C:\Projects\test\guestbook.php C:\Projects\test\index.php C:\Projects\test\test.php and bu...
If you use TortoiseSVN, you can use the export feature to automatically strip out all of the.svn files. I think other svn things have the same feature. Right click the root project folder, then select TortoiseSVN > Export, and tell it where you want the.svn free directory.
Making a production build of a PHP project with Subversion If you are working in PHP (or I guess any programming language) and using subversion as your source control, is there a way to take your project (for example): C:\Projects\test\.svn C:\Projects\test\docs\ C:\Projects\test\faq.php C:\Projects\test\guestbook.php ...
TITLE: Making a production build of a PHP project with Subversion QUESTION: If you are working in PHP (or I guess any programming language) and using subversion as your source control, is there a way to take your project (for example): C:\Projects\test\.svn C:\Projects\test\docs\ C:\Projects\test\faq.php C:\Projects\t...
[ "php", "svn", "scripting", "tortoisesvn", "build-process" ]
6
6
2,313
3
0
2008-08-08T12:57:55.880000
2008-08-08T13:10:13.250000
5,880
5,885
Are there any negative reasons to use an N-Tier solution?
I'm pretty new to my company (2 weeks) and we're starting a new platform for our system using.NET 3.5 Team Foundation from DotNetNuke. Our "architect" is suggesting we use one class project. Of course, I chime back with a "3-tier" architecture (Business, Data, Web class projects). Is there any disadvantages to using th...
I guess a fairly big downside is that the extra volume of code that you have to write, manage and maintain for a small project may just be overkill. It's all down to what's appropriate for the size of the project, the expected life of the final project and the budget! Sometimes, whilst doing things 'properly' is appeal...
Are there any negative reasons to use an N-Tier solution? I'm pretty new to my company (2 weeks) and we're starting a new platform for our system using.NET 3.5 Team Foundation from DotNetNuke. Our "architect" is suggesting we use one class project. Of course, I chime back with a "3-tier" architecture (Business, Data, W...
TITLE: Are there any negative reasons to use an N-Tier solution? QUESTION: I'm pretty new to my company (2 weeks) and we're starting a new platform for our system using.NET 3.5 Team Foundation from DotNetNuke. Our "architect" is suggesting we use one class project. Of course, I chime back with a "3-tier" architecture ...
[ "architecture", "n-tier-architecture" ]
10
9
2,201
6
0
2008-08-08T13:04:02.980000
2008-08-08T13:08:40.927000
5,892
5,903
Link issues (VC6)
I've opened an old workspace that is a library and its test harness. It used to work fine but now doesn't and older versions of the code don't work either with the same errors. I've tried recreating the project and that causes the same errors too. Nothing seems out of order in project settings and the code generated wo...
One possibility lies with Win32 ANSI/Unicode "name-mangling", which turns the symbol GetMessage into either GetMessageA or GetMessageW. There are three possibilities: Windows.h hasn't been loaded, so GetMessage stays GetMessage Windows.h was loaded with symbols set for ANSI, so GetMessage becomes GetMessageA Windows.h ...
Link issues (VC6) I've opened an old workspace that is a library and its test harness. It used to work fine but now doesn't and older versions of the code don't work either with the same errors. I've tried recreating the project and that causes the same errors too. Nothing seems out of order in project settings and the...
TITLE: Link issues (VC6) QUESTION: I've opened an old workspace that is a library and its test harness. It used to work fine but now doesn't and older versions of the code don't work either with the same errors. I've tried recreating the project and that causes the same errors too. Nothing seems out of order in projec...
[ "c++", "visual-c++", "linker", "visual-c++-6" ]
11
6
1,355
5
0
2008-08-08T13:13:08.920000
2008-08-08T13:30:03.507000
5,908
5,914
User access log to SQL Server
I need to get a log of user access to our SQL Server so I can track average and peak concurrency usage. Is there a hidden table or something I'm missing that has this information for me? To my knowledge the application I'm looking at does not track this at the application level. I'm currently working on SQL Server 2000...
In SQL Server 2005, go to tree view on the left and select Server (name of the actual server) > Management > Activity Monitor. Hope this helps.
User access log to SQL Server I need to get a log of user access to our SQL Server so I can track average and peak concurrency usage. Is there a hidden table or something I'm missing that has this information for me? To my knowledge the application I'm looking at does not track this at the application level. I'm curren...
TITLE: User access log to SQL Server QUESTION: I need to get a log of user access to our SQL Server so I can track average and peak concurrency usage. Is there a hidden table or something I'm missing that has this information for me? To my knowledge the application I'm looking at does not track this at the application...
[ "sql-server", "logging", "statistics" ]
7
7
20,952
2
0
2008-08-08T13:34:38.770000
2008-08-08T13:36:47.923000
5,909
5,985
Get size of a file before downloading in Python
I'm downloading an entire directory from a web server. It works OK, but I can't figure how to get the file size before download to compare if it was updated on the server or not. Can this be done as if I was downloading the file from a FTP server? import urllib import re url = "http://www.someurl.com" # Download the ...
I have reproduced what you are seeing: import urllib, os link = "http://python.org" print "opening url:", link site = urllib.urlopen(link) meta = site.info() print "Content-Length:", meta.getheaders("Content-Length")[0] f = open("out.txt", "r") print "File on disk:",len(f.read()) f.close() f = open("out.txt", "w") f....
Get size of a file before downloading in Python I'm downloading an entire directory from a web server. It works OK, but I can't figure how to get the file size before download to compare if it was updated on the server or not. Can this be done as if I was downloading the file from a FTP server? import urllib import re ...
TITLE: Get size of a file before downloading in Python QUESTION: I'm downloading an entire directory from a web server. It works OK, but I can't figure how to get the file size before download to compare if it was updated on the server or not. Can this be done as if I was downloading the file from a FTP server? import...
[ "python", "urllib" ]
57
40
58,368
12
0
2008-08-08T13:35:19.970000
2008-08-08T14:21:51.107000
5,913
5,947
Getting the text from a drop-down box
This gets the value of whatever is selected in my dropdown menu. document.getElementById('newSkill').value I cannot however find out what property to go after for the text that's currently displayed by the drop down menu. I tried "text" then looked at W3Schools but that didn't have the answer, does anybody here know? F...
Based on your example HTML code, here's one way to get the displayed text of the currently selected option: var skillsSelect = document.getElementById("newSkill"); var selectedText = skillsSelect.options[skillsSelect.selectedIndex].text;
Getting the text from a drop-down box This gets the value of whatever is selected in my dropdown menu. document.getElementById('newSkill').value I cannot however find out what property to go after for the text that's currently displayed by the drop down menu. I tried "text" then looked at W3Schools but that didn't have...
TITLE: Getting the text from a drop-down box QUESTION: This gets the value of whatever is selected in my dropdown menu. document.getElementById('newSkill').value I cannot however find out what property to go after for the text that's currently displayed by the drop down menu. I tried "text" then looked at W3Schools bu...
[ "javascript", "dom", "browser", "client-side" ]
89
154
263,322
14
0
2008-08-08T13:36:16.877000
2008-08-08T13:54:55.983000
5,916
7,767
How do you feel about code folding?
For those of you in the Visual Studio environment, how do you feel about wrapping any of your code in #regions? (or if any other IDE has something similar...)
9 out of 10 times, code folding means that you have failed to use the SoC principle for what its worth. I more or less feel the same thing about partial classes. If you have a piece of code you think is too big you need to chop it up in manageable (and reusable) parts, not hide or split it up. It will bite you the next...
How do you feel about code folding? For those of you in the Visual Studio environment, how do you feel about wrapping any of your code in #regions? (or if any other IDE has something similar...)
TITLE: How do you feel about code folding? QUESTION: For those of you in the Visual Studio environment, how do you feel about wrapping any of your code in #regions? (or if any other IDE has something similar...) ANSWER: 9 out of 10 times, code folding means that you have failed to use the SoC principle for what its w...
[ "visual-studio", "folding" ]
26
37
7,321
24
0
2008-08-08T13:38:30.260000
2008-08-11T13:17:40.453000
5,918
5,984
API Yahoo India Maps
Yahoo has separate map for India ( which has more details than the regular maps.yahoo.com) at http://in.maps.yahoo.com/. But when I use the API it goes to default map. How do I get API access to YMaps India?
I don't know about yahoo, but there is another mapping website that provides an API for India. http://biz.mapmyindia.com/APIs.html
API Yahoo India Maps Yahoo has separate map for India ( which has more details than the regular maps.yahoo.com) at http://in.maps.yahoo.com/. But when I use the API it goes to default map. How do I get API access to YMaps India?
TITLE: API Yahoo India Maps QUESTION: Yahoo has separate map for India ( which has more details than the regular maps.yahoo.com) at http://in.maps.yahoo.com/. But when I use the API it goes to default map. How do I get API access to YMaps India? ANSWER: I don't know about yahoo, but there is another mapping website t...
[ "yahoo-api", "yahoo-maps" ]
5
1
1,302
1
0
2008-08-08T13:39:03.487000
2008-08-08T14:21:09.830000
5,948
587,244
Always Commit the same file with SVN
In my web application I have a file which hold the current revision number via $Rev$. This work fine except, if I don't make any changes to that file, it doesn't get committed. Is there anyway I can force a single file to always get committed to the SVN server? I'm using TortoiseSVN for Windows so any code or step-by-s...
If you have TortoiseSVN installed, you also have the SubWCRev tool available. Use that tool to get the revision instead of misusing the $REV$ keyword. create a template file which contains your defines, maybe something like const long WC_REV = $WCREV$; in a file named version.h.tmpl on every build, call SubWCRev to cre...
Always Commit the same file with SVN In my web application I have a file which hold the current revision number via $Rev$. This work fine except, if I don't make any changes to that file, it doesn't get committed. Is there anyway I can force a single file to always get committed to the SVN server? I'm using TortoiseSVN...
TITLE: Always Commit the same file with SVN QUESTION: In my web application I have a file which hold the current revision number via $Rev$. This work fine except, if I don't make any changes to that file, it doesn't get committed. Is there anyway I can force a single file to always get committed to the SVN server? I'm...
[ "svn" ]
10
9
4,411
13
0
2008-08-08T13:55:04.453000
2009-02-25T18:32:54.177000
5,949
5,963
What's your opinion on using UUIDs as database row identifiers, particularly in web apps?
I've always preferred to use long integers as primary keys in databases, for simplicity and (assumed) speed. But when using a REST or Rails-like URL scheme for object instances, I'd then end up with URLs like this: http://example.com/user/783 And then the assumption is that there are also users with IDs of 782, 781,......
I can't say about the web side of your question. But uuids are great for n-tier applications. PK generation can be decentralized: each client generates it's own pk without risk of collision. And the speed difference is generally small. Make sure your database supports an efficient storage datatype (16 bytes, 128 bits)....
What's your opinion on using UUIDs as database row identifiers, particularly in web apps? I've always preferred to use long integers as primary keys in databases, for simplicity and (assumed) speed. But when using a REST or Rails-like URL scheme for object instances, I'd then end up with URLs like this: http://example....
TITLE: What's your opinion on using UUIDs as database row identifiers, particularly in web apps? QUESTION: I've always preferred to use long integers as primary keys in databases, for simplicity and (assumed) speed. But when using a REST or Rails-like URL scheme for object instances, I'd then end up with URLs like thi...
[ "database", "web-applications", "uuid" ]
83
34
28,087
16
0
2008-08-08T13:55:48.773000
2008-08-08T14:03:00.833000
5,966
10,778
Best way to abstract season/show/episode data
Basically, I've written an API to www.thetvdb.com in Python. The current code can be found here. It grabs data from the API as requested, and has to store the data somehow, and make it available by doing: print tvdbinstance[1][23]['episodename'] # get the name of episode 23 of season 1 What is the "best" way to abstrac...
OK, what you need is classobj from new module. That would allow you to construct exception classes dynamically ( classobj takes a string as an argument for the class name). import new myexc=new.classobj("ExcName",(Exception,),{}) i=myexc("This is the exc msg!") raise i this gives you: Traceback (most recent call last):...
Best way to abstract season/show/episode data Basically, I've written an API to www.thetvdb.com in Python. The current code can be found here. It grabs data from the API as requested, and has to store the data somehow, and make it available by doing: print tvdbinstance[1][23]['episodename'] # get the name of episode 23...
TITLE: Best way to abstract season/show/episode data QUESTION: Basically, I've written an API to www.thetvdb.com in Python. The current code can be found here. It grabs data from the API as requested, and has to store the data somehow, and make it available by doing: print tvdbinstance[1][23]['episodename'] # get the ...
[ "python", "data-structures" ]
17
7
1,806
5
0
2008-08-08T14:05:45.290000
2008-08-14T07:08:19.280000
5,997
6,018
Should I provide accessor methods / Getter Setters for public/protected components on a form?
If I have.Net Form with a component/object such as a textbox that I need to access from a parent or other form I obviously need to "upgrade" the modifier to this component to an Internal or Public level variable. Now, if I were providing a public variable of an int or string type etc. in my form class I wouldn't think ...
" However, the VS designer doesn't seem to implement such Getters/Setters for those public objects that are components on a form (and therefore does not comply with good programming practice). " If you mean the controls you're dragging and dropping onto the form, these are marked as private instance members and are add...
Should I provide accessor methods / Getter Setters for public/protected components on a form? If I have.Net Form with a component/object such as a textbox that I need to access from a parent or other form I obviously need to "upgrade" the modifier to this component to an Internal or Public level variable. Now, if I wer...
TITLE: Should I provide accessor methods / Getter Setters for public/protected components on a form? QUESTION: If I have.Net Form with a component/object such as a textbox that I need to access from a parent or other form I obviously need to "upgrade" the modifier to this component to an Internal or Public level varia...
[ ".net", "winforms" ]
6
5
1,492
4
0
2008-08-08T14:35:25.353000
2008-08-08T14:50:30.130000