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
16,199
16,304
Web App - Dashboard Type GUI - Interface
I'm looking to create a dashboard type gui for a web application. I'm looking for the user to be able to drag and drop different elements (probably either image buttons, anchor tags, or maybe just divs) to different (defined) places and be able to save their setup (in a cookie or on the server). I'm working with c# in ...
I have been looking at this kind of functionality myself recently and have decided on using jQuery with the help of jQuery UI. I came across a large amount of information that also suggested Yahoo UI (YUI), I had already started learning jQuery due to the AJAX support that it offers, so I stuck with it. jQuery UI Site ...
Web App - Dashboard Type GUI - Interface I'm looking to create a dashboard type gui for a web application. I'm looking for the user to be able to drag and drop different elements (probably either image buttons, anchor tags, or maybe just divs) to different (defined) places and be able to save their setup (in a cookie o...
TITLE: Web App - Dashboard Type GUI - Interface QUESTION: I'm looking to create a dashboard type gui for a web application. I'm looking for the user to be able to drag and drop different elements (probably either image buttons, anchor tags, or maybe just divs) to different (defined) places and be able to save their se...
[ "c#", "asp.net", "javascript", "user-interface" ]
4
4
3,990
5
0
2008-08-19T13:57:33.820000
2008-08-19T14:44:28.747000
16,209
16,238
Displaying Version Information in a Web Service
Can anyone suggest a way of getting version information into a Web Service? (VB.NET) I would like to dynamically use the assembly version in the title or description, but the attributes require constants. Is manually writing the version info as a string the only way of displaying the information on the.asmx page?
Yeah, attributes cannot have anything but constants in them, so you cannot use reflection to get the version number. The WebServiceAttribute class is sealed too, so you cannot inherit it and do what you want from there. A solution might be to use some kind of placeholder text as the Name, and set up an MsBuild task to ...
Displaying Version Information in a Web Service Can anyone suggest a way of getting version information into a Web Service? (VB.NET) I would like to dynamically use the assembly version in the title or description, but the attributes require constants. Is manually writing the version info as a string the only way of di...
TITLE: Displaying Version Information in a Web Service QUESTION: Can anyone suggest a way of getting version information into a Web Service? (VB.NET) I would like to dynamically use the assembly version in the title or description, but the attributes require constants. Is manually writing the version info as a string ...
[ "vb.net", "web-services", "versions" ]
2
1
1,696
3
0
2008-08-19T14:02:01.237000
2008-08-19T14:15:36.373000
16,233
16,255
Fonts on the Web
The collection of fonts available to a web developer is depressingly limited. I remember reading long ago about TrueDoc, as a way of shipping fonts alongside a website - but it seems to have languished. Has anybody used this, or something similar? Is it supported by enough browsers? Am I missing a good solution? Note t...
Safari, and to a lesser extent, Firefox 3 have support for @font-face in CSS, which lets you use custom fonts. You need to have the appropriate licence to distribute the font files though. These articles explain it in more detail: http://www.css3.info/preview/web-fonts-with-font-face/ http://www.alistapart.com/articles...
Fonts on the Web The collection of fonts available to a web developer is depressingly limited. I remember reading long ago about TrueDoc, as a way of shipping fonts alongside a website - but it seems to have languished. Has anybody used this, or something similar? Is it supported by enough browsers? Am I missing a good...
TITLE: Fonts on the Web QUESTION: The collection of fonts available to a web developer is depressingly limited. I remember reading long ago about TrueDoc, as a way of shipping fonts alongside a website - but it seems to have languished. Has anybody used this, or something similar? Is it supported by enough browsers? A...
[ "html", "css", "fonts" ]
26
20
9,338
10
0
2008-08-19T14:13:18.560000
2008-08-19T14:22:04.720000
16,248
35,683
Getting the subversion repository number into code
I'd like to implement a way of recording the version of a project within code, so that it can be used when testing and to help track bugs. It seems the best version number to use would just be the current revision number from Subversion. Is there an easy way to hook this number into a (C++ in my case) header file or so...
While nifty, the revision keyword trick only updates the file when it's changed in that revision - if you don't change the file, then it will continue to reflect the old revision. If you want the software to always reflect the overall revision number, then you'll have to delve into the relevant SVN entries file and ext...
Getting the subversion repository number into code I'd like to implement a way of recording the version of a project within code, so that it can be used when testing and to help track bugs. It seems the best version number to use would just be the current revision number from Subversion. Is there an easy way to hook th...
TITLE: Getting the subversion repository number into code QUESTION: I'd like to implement a way of recording the version of a project within code, so that it can be used when testing and to help track bugs. It seems the best version number to use would just be the current revision number from Subversion. Is there an e...
[ "svn", "debugging", "testing", "revision", "versions" ]
41
14
49,244
7
0
2008-08-19T14:19:06.227000
2008-08-30T04:23:00.737000
16,265
16,335
LINQ to SQL Mapping From Money to Double
I'm working with LINQ for the first time and wanted to get the Mapping to work when I have a money type in SQL, but my domain object property is of type double. How can I express this in the XML file, or in code so that the mapping does not throw the usual "invalid cast" exception?
In the DBML XML file, you can set the Expression attribute of a Column element to something like this:
LINQ to SQL Mapping From Money to Double I'm working with LINQ for the first time and wanted to get the Mapping to work when I have a money type in SQL, but my domain object property is of type double. How can I express this in the XML file, or in code so that the mapping does not throw the usual "invalid cast" excepti...
TITLE: LINQ to SQL Mapping From Money to Double QUESTION: I'm working with LINQ for the first time and wanted to get the Mapping to work when I have a money type in SQL, but my domain object property is of type double. How can I express this in the XML file, or in code so that the mapping does not throw the usual "inv...
[ "linq", "linq-to-sql", "orm" ]
1
1
1,983
3
0
2008-08-19T14:27:08.737000
2008-08-19T14:53:49.383000
16,298
16,311
How to redirect siteA to siteB with A or CNAME records
I have 2 hosts and I would like to point a subdomain on host one to a subdomain on host two: subdomain.hostone.com --> subdomain.hosttwo.com I added a CNAME record to host one that points to subdomain.hosttwo.com but all I get is a ' 400 Bad Request ' Error. Can anyone see what I'm doing wrong?
Try changing it to "subdomain -> subdomain.hosttwo.com" The CNAME is an alias for a certain domain, so when you go to the control panel for hostone.com, you shouldn't have to enter the whole name into the CNAME alias. As far as the error you are getting, can you log onto subdomain.hostwo.com and check the logs?
How to redirect siteA to siteB with A or CNAME records I have 2 hosts and I would like to point a subdomain on host one to a subdomain on host two: subdomain.hostone.com --> subdomain.hosttwo.com I added a CNAME record to host one that points to subdomain.hosttwo.com but all I get is a ' 400 Bad Request ' Error. Can an...
TITLE: How to redirect siteA to siteB with A or CNAME records QUESTION: I have 2 hosts and I would like to point a subdomain on host one to a subdomain on host two: subdomain.hostone.com --> subdomain.hosttwo.com I added a CNAME record to host one that points to subdomain.hosttwo.com but all I get is a ' 400 Bad Reque...
[ "dns", "web-hosting", "cname" ]
46
14
209,742
7
0
2008-08-19T14:42:29.440000
2008-08-19T14:46:12.677000
16,306
16,318
How to get only directory name from SaveFileDialog.FileName
What would be the easiest way to separate the directory name from the file name when dealing with SaveFileDialog.FileName in C#?
Use: System.IO.Path.GetDirectoryName(saveDialog.FileName) (and the corresponding System.IO.Path.GetFileName ). The Path class is really rather useful.
How to get only directory name from SaveFileDialog.FileName What would be the easiest way to separate the directory name from the file name when dealing with SaveFileDialog.FileName in C#?
TITLE: How to get only directory name from SaveFileDialog.FileName QUESTION: What would be the easiest way to separate the directory name from the file name when dealing with SaveFileDialog.FileName in C#? ANSWER: Use: System.IO.Path.GetDirectoryName(saveDialog.FileName) (and the corresponding System.IO.Path.GetFileN...
[ "c#", "string", "parsing" ]
7
15
5,217
4
0
2008-08-19T14:44:59.667000
2008-08-19T14:49:07.553000
16,330
33,604
How do I handle page flow in MVC (particularly asp.net)
If you had to provide a wizard like form entry experience in mvc how would you abstract the page flow?
Investigate the post-redirect-get pattern. http://weblogs.asp.net/mhawley/archive/tags/MVC/default.aspx http://devlicio.us/blogs/tim_barcz/archive/2008/08/22/prg-pattern-in-the-asp-net-mvc-framework.aspx Use that along with a robust domain model (for tracking steps or form completion state or whatever you call it) and ...
How do I handle page flow in MVC (particularly asp.net) If you had to provide a wizard like form entry experience in mvc how would you abstract the page flow?
TITLE: How do I handle page flow in MVC (particularly asp.net) QUESTION: If you had to provide a wizard like form entry experience in mvc how would you abstract the page flow? ANSWER: Investigate the post-redirect-get pattern. http://weblogs.asp.net/mhawley/archive/tags/MVC/default.aspx http://devlicio.us/blogs/tim_b...
[ "asp.net-mvc" ]
5
9
4,426
5
0
2008-08-19T14:53:06.593000
2008-08-28T23:07:28.550000
16,363
16,390
How do you configure VS2008 to only open one webserver in a solution with multiple projects?
Starting with 2005, VS started this behavior of when starting debugging session it spawns up a webserver for every project in a solution. I have a solution with 15 projects so it takes a while and is a waste of resources. Is there a way to configure it differently besides just using IIS?
Some details here on why it does it and how you can overcome it: http://vishaljoshi.blogspot.com/2007/12/tips-tricks-start-up-options-and.html There are instances when you might have many web applications or web sites in the same solution and you may be actually debugging only one of them... In such scenario it might n...
How do you configure VS2008 to only open one webserver in a solution with multiple projects? Starting with 2005, VS started this behavior of when starting debugging session it spawns up a webserver for every project in a solution. I have a solution with 15 projects so it takes a while and is a waste of resources. Is th...
TITLE: How do you configure VS2008 to only open one webserver in a solution with multiple projects? QUESTION: Starting with 2005, VS started this behavior of when starting debugging session it spawns up a webserver for every project in a solution. I have a solution with 15 projects so it takes a while and is a waste o...
[ "visual-studio", "debugging" ]
13
23
3,925
5
0
2008-08-19T15:09:30.663000
2008-08-19T15:20:20.720000
16,396
20,786
Easy way for Crystal Reports to MS SQL Server Reporting Services conversion
Is there a way to easily convert Crystal Reports reports to Reporting Services RDL format? We have quite a few reports that will be needing conversion soon. I know about the manual process (which is basically rebuilding all your reports from scratch in SSRS), but my searches pointed to a few possibilities with automati...
I have searched previously for this, with no luck. There does not seem to be any tools available for this conversion, the manual method thereby becomes the only method. And yes, there are consulting firms who will do the manual work for you, but they still do it manually. Crystal Reports and Reporting Services have dif...
Easy way for Crystal Reports to MS SQL Server Reporting Services conversion Is there a way to easily convert Crystal Reports reports to Reporting Services RDL format? We have quite a few reports that will be needing conversion soon. I know about the manual process (which is basically rebuilding all your reports from sc...
TITLE: Easy way for Crystal Reports to MS SQL Server Reporting Services conversion QUESTION: Is there a way to easily convert Crystal Reports reports to Reporting Services RDL format? We have quite a few reports that will be needing conversion soon. I know about the manual process (which is basically rebuilding all yo...
[ "sql-server", "reporting-services", "crystal-reports", "migration" ]
32
17
56,340
7
0
2008-08-19T15:23:17.983000
2008-08-21T18:57:49.067000
16,402
16,416
Easy installation method for windows/ Batch Reference needed?
I have a bunch of files that I need to be able to transport and install quickly. My current method for doing so is moving a flash drive with a readme file of where stuff goes whenever I need to move stuff, which is rather inelegant and cumbersome. My idea for a solution would be to write up a quick script to move files...
Sounds like robocopy tool is exactly what you need. Very powerful replication command-line tool. MS TechNet reference, Wikipedia article about robocopy, Full command switch guide, Batch scripting guide.
Easy installation method for windows/ Batch Reference needed? I have a bunch of files that I need to be able to transport and install quickly. My current method for doing so is moving a flash drive with a readme file of where stuff goes whenever I need to move stuff, which is rather inelegant and cumbersome. My idea fo...
TITLE: Easy installation method for windows/ Batch Reference needed? QUESTION: I have a bunch of files that I need to be able to transport and install quickly. My current method for doing so is moving a flash drive with a readme file of where stuff goes whenever I need to move stuff, which is rather inelegant and cumb...
[ "windows", "batch-file", "installation" ]
0
2
355
2
0
2008-08-19T15:26:40.287000
2008-08-19T15:35:27.163000
16,403
16,546
How do you handle white space in your HTML
One of my biggest typographical frustrations about HTML is the way that it mangles conjoined whitespace. For example if I have: Following punctuation rules. With two spaces after the period. One of the two spaces following the period will be considered to be insignificant whitespace and be removed. I can of course, for...
For your specific example, there is no need to worry about it. Web browsers perform typographical rendering and place the correct amount of space between periods and whatever character follows (and it's different depending on the next character, according to kerning rules.) If you want line breaks, isn't really a big d...
How do you handle white space in your HTML One of my biggest typographical frustrations about HTML is the way that it mangles conjoined whitespace. For example if I have: Following punctuation rules. With two spaces after the period. One of the two spaces following the period will be considered to be insignificant whit...
TITLE: How do you handle white space in your HTML QUESTION: One of my biggest typographical frustrations about HTML is the way that it mangles conjoined whitespace. For example if I have: Following punctuation rules. With two spaces after the period. One of the two spaces following the period will be considered to be ...
[ "html", "whitespace" ]
7
6
3,991
8
0
2008-08-19T15:27:31.470000
2008-08-19T16:59:53.047000
16,413
16,444
Parse usable Street Address, City, State, Zip from a string
Problem: I have an address field from an Access database which has been converted to SQL Server 2005. This field has everything all in one field. I need to parse out the address's individual sections into their appropriate fields in a normalized table. I need to do this for approximately 4,000 records, and it needs to ...
I've done a lot of work on this kind of parsing. Because there are errors you won't get 100% accuracy, but there are a few things you can do to get most of the way there, and then do a visual BS test. Here's the general way to go about it. It's not code, because it's pretty academic to write it, there's no weirdness, j...
Parse usable Street Address, City, State, Zip from a string Problem: I have an address field from an Access database which has been converted to SQL Server 2005. This field has everything all in one field. I need to parse out the address's individual sections into their appropriate fields in a normalized table. I need ...
TITLE: Parse usable Street Address, City, State, Zip from a string QUESTION: Problem: I have an address field from an Access database which has been converted to SQL Server 2005. This field has everything all in one field. I need to parse out the address's individual sections into their appropriate fields in a normali...
[ "string", "parsing", "sql-server-2005", "street-address" ]
133
121
163,624
24
0
2008-08-19T15:34:41.703000
2008-08-19T15:52:05.397000
16,432
18,342
String output: format or concat in C#?
Let's say that you want to output or concat strings. Which of the following styles do you prefer? var p = new { FirstName = "Bill", LastName = "Gates" }; Console.WriteLine("{0} {1}", p.FirstName, p.LastName); Console.WriteLine(p.FirstName + " " + p.LastName); Do you rather use format or do you simply concat strings? Wh...
Try this code. It's a slightly modified version of your code. I removed Console.WriteLine as it's probably a few orders of magnitude slower than what I'm trying to measure. I'm starting the Stopwatch before the loop and stopping it right after, this way I'm not losing precision if the function takes for example 26.4 ti...
String output: format or concat in C#? Let's say that you want to output or concat strings. Which of the following styles do you prefer? var p = new { FirstName = "Bill", LastName = "Gates" }; Console.WriteLine("{0} {1}", p.FirstName, p.LastName); Console.WriteLine(p.FirstName + " " + p.LastName); Do you rather use for...
TITLE: String output: format or concat in C#? QUESTION: Let's say that you want to output or concat strings. Which of the following styles do you prefer? var p = new { FirstName = "Bill", LastName = "Gates" }; Console.WriteLine("{0} {1}", p.FirstName, p.LastName); Console.WriteLine(p.FirstName + " " + p.LastName); Do ...
[ "c#", "string", "coding-style", "string.format" ]
184
89
101,454
32
0
2008-08-19T15:46:53.863000
2008-08-20T16:40:14.973000
16,434
129,435
How to test numerical analysis routines?
Are there any good online resources for how to create, maintain and think about writing test routines for numerical analysis code? One of the limitations I can see for something like testing matrix multiplication is that the obvious tests (like having one matrix being the identity) may not fully test the functionality ...
It sounds as if you need to think about testing in at least two different ways: Some numerical methods allow for some meta-thinking. For example, invertible operations allow you to set up test cases to see if the result is within acceptable error bounds of the original. For example, matrix M-inverse times the matrix M ...
How to test numerical analysis routines? Are there any good online resources for how to create, maintain and think about writing test routines for numerical analysis code? One of the limitations I can see for something like testing matrix multiplication is that the obvious tests (like having one matrix being the identi...
TITLE: How to test numerical analysis routines? QUESTION: Are there any good online resources for how to create, maintain and think about writing test routines for numerical analysis code? One of the limitations I can see for something like testing matrix multiplication is that the obvious tests (like having one matri...
[ "testing", "numerical" ]
8
3
1,779
3
0
2008-08-19T15:48:07.857000
2008-09-24T19:47:54.393000
16,447
16,465
Select Query on 2 tables, on different database servers
I am trying to generate a report by querying 2 databases (Sybase) in classic ASP. I have created 2 connection strings: connA for databaseA connB for databaseB Both databases are present on the same server (don't know if this matters) Queries: q1 = SELECT column1 INTO #temp FROM databaseA..table1 WHERE xyz="A" q2 = SELE...
With both queries, it looks like you are trying to insert into #temp. #temp is located on one of the databases (for arguments sake, databaseA). So when you try to insert into #temp from databaseB, it reports that it does not exist. Try changing it from Into #temp From to Into databaseA.dbo.#temp From in both statements...
Select Query on 2 tables, on different database servers I am trying to generate a report by querying 2 databases (Sybase) in classic ASP. I have created 2 connection strings: connA for databaseA connB for databaseB Both databases are present on the same server (don't know if this matters) Queries: q1 = SELECT column1 I...
TITLE: Select Query on 2 tables, on different database servers QUESTION: I am trying to generate a report by querying 2 databases (Sybase) in classic ASP. I have created 2 connection strings: connA for databaseA connB for databaseB Both databases are present on the same server (don't know if this matters) Queries: q1 ...
[ "sql", "asp-classic", "vbscript", "sybase" ]
4
4
19,266
3
0
2008-08-19T15:53:19.373000
2008-08-19T15:59:47.833000
16,451
711,398
Calling .NET Web Service (WSE 2/3, WS-Security) from Java
I need to call a web service written in.NET from Java. The web service implements the WS-Security stack (either WSE 2 or WSE 3, it's not clear from the information I have). The information that I received from the service provider included WSDL, a policyCache.config file, some sample C# code, and a sample application t...
This seems to be a popular question so I'll provide an overview of what we did in our situation. It seems that services built in.NET are following an older ws-addressing standard ( http://schemas.xmlsoap.org/ws/2004/03/addressing/ ) and axis2 only understands the newer standard ( http://schemas.xmlsoap.org/ws/2004/08/a...
Calling .NET Web Service (WSE 2/3, WS-Security) from Java I need to call a web service written in.NET from Java. The web service implements the WS-Security stack (either WSE 2 or WSE 3, it's not clear from the information I have). The information that I received from the service provider included WSDL, a policyCache.co...
TITLE: Calling .NET Web Service (WSE 2/3, WS-Security) from Java QUESTION: I need to call a web service written in.NET from Java. The web service implements the WS-Security stack (either WSE 2 or WSE 3, it's not clear from the information I have). The information that I received from the service provider included WSDL...
[ "java", ".net", "apache-axis", "ws-security", "wse" ]
23
10
14,127
5
0
2008-08-19T15:54:59.153000
2009-04-02T20:08:38.633000
16,458
137,090
Dynamic Alphabetical Navigation
I'm using ColdFusion to return a result set from a SQL database and turn it into a list. I need some way to generate an alphabetical navigation bar for that list. I have ColdFusion and the jQuery library available. I'm looking to generate something like this: A | B | C |... - A - A - B - B - B - C - D Where clicking on...
So, there were plenty of good suggestions, but none did exactly what I wanted. Fortunately I was able to use them to figure out what I really wanted to do. The only thing the following doesn't do is print the last few unused letters (if there are any). That's why I have that cfif statement checking for 'W' as that's th...
Dynamic Alphabetical Navigation I'm using ColdFusion to return a result set from a SQL database and turn it into a list. I need some way to generate an alphabetical navigation bar for that list. I have ColdFusion and the jQuery library available. I'm looking to generate something like this: A | B | C |... - A - A - B -...
TITLE: Dynamic Alphabetical Navigation QUESTION: I'm using ColdFusion to return a result set from a SQL database and turn it into a list. I need some way to generate an alphabetical navigation bar for that list. I have ColdFusion and the jQuery library available. I'm looking to generate something like this: A | B | C ...
[ "javascript", "jquery", "sql", "html", "coldfusion" ]
9
0
3,444
5
0
2008-08-19T15:57:33.827000
2008-09-26T00:25:36.013000
16,460
16,500
Removing N items from a list conditionally
I was writing some ASP.NET control when I came to the scenario where I needed to remove items from a list, only when they matched a certain condition. The RemoveAll method of the generic List class does a good job, but removes all items that match the condition, specified by the predicate. What if I want to only remove...
If you want to specify both a limit for number of items to remove and a condition to select the items to remove, you can use this approach: int limit = 30; // Suppose you want to remove 30 items at most list.RemoveAll(item => ShouldIRemoveThis(item) && limit-- > 0);
Removing N items from a list conditionally I was writing some ASP.NET control when I came to the scenario where I needed to remove items from a list, only when they matched a certain condition. The RemoveAll method of the generic List class does a good job, but removes all items that match the condition, specified by t...
TITLE: Removing N items from a list conditionally QUESTION: I was writing some ASP.NET control when I came to the scenario where I needed to remove items from a list, only when they matched a certain condition. The RemoveAll method of the generic List class does a good job, but removes all items that match the conditi...
[ ".net" ]
2
8
817
6
0
2008-08-19T15:57:51.300000
2008-08-19T16:19:51.397000
16,473
16,484
Can using lambdas as event handlers cause a memory leak?
Say we have the following method: private MyObject foo = new MyObject(); // and later in the class public void PotentialMemoryLeaker(){ int firedCount = 0; foo.AnEvent += (o,e) => { firedCount++;Console.Write(firedCount);}; foo.MethodThatFiresAnEvent(); } If the class with this method is instantiated and the Potentia...
Yes, save it to a variable and unhook it. DelegateType evt = (o, e) => { firedCount++; Console.Write(firedCount); }; foo.AnEvent += evt; foo.MethodThatFiresAnEvent(); foo.AnEvent -= evt; And yes, if you don't, you'll leak memory, as you'll hook up a new delegate object each time. You'll also notice this because each ti...
Can using lambdas as event handlers cause a memory leak? Say we have the following method: private MyObject foo = new MyObject(); // and later in the class public void PotentialMemoryLeaker(){ int firedCount = 0; foo.AnEvent += (o,e) => { firedCount++;Console.Write(firedCount);}; foo.MethodThatFiresAnEvent(); } If th...
TITLE: Can using lambdas as event handlers cause a memory leak? QUESTION: Say we have the following method: private MyObject foo = new MyObject(); // and later in the class public void PotentialMemoryLeaker(){ int firedCount = 0; foo.AnEvent += (o,e) => { firedCount++;Console.Write(firedCount);}; foo.MethodThatFires...
[ "memory-leaks", "lambda", "event-handling" ]
20
16
7,241
5
0
2008-08-19T16:03:46.187000
2008-08-19T16:08:24.663000
16,483
16,534
Convince Firefox to send an If-Modified-Since header over HTTPS
How can I convince Firefox (3.0.1, if it matters) to send an If-Modified-Since header in an HTTPS request? It sends the header if the request uses plain HTTP and my server dutifully honors it. But when I request the same resource from the same server using HTTPS instead (i.e., simply changing the http:// in the URL to ...
HTTPS requests are not cached so sending an If-Modified-Since doesn't make any sense. The not caching is a security precaution. The not caching on disk is a security pre-caution, but it seems it indeed affects the If-Modified-Since behavior (glancing over the code). Try setting the Firefox preference (in about:config) ...
Convince Firefox to send an If-Modified-Since header over HTTPS How can I convince Firefox (3.0.1, if it matters) to send an If-Modified-Since header in an HTTPS request? It sends the header if the request uses plain HTTP and my server dutifully honors it. But when I request the same resource from the same server using...
TITLE: Convince Firefox to send an If-Modified-Since header over HTTPS QUESTION: How can I convince Firefox (3.0.1, if it matters) to send an If-Modified-Since header in an HTTPS request? It sends the header if the request uses plain HTTP and my server dutifully honors it. But when I request the same resource from the...
[ "firefox", "https" ]
14
14
5,405
2
0
2008-08-19T16:07:50.593000
2008-08-19T16:51:42.157000
16,487
1,449,595
How can I deploy artifacts from a Maven build to the SourceForge File Release System?
I am using SourceForge for some Open Source projects and I want to automate the deployment of releases to the SourceForge File Release System. I use Maven for my builds and the standard SFTP deployment mechanism doesn't seem to work unless you do some manual preparation work. I have come across some old postings on oth...
I'm not able to test this to confirm, but I believe it is possible without writing any plugins. You can deploy to SourceForge using SCP, and the maven-deploy-plugin can be configured to use SCP so it should work. You can also deploy your site to SourceForge via SCP. You would configure the SourceForge server in your se...
How can I deploy artifacts from a Maven build to the SourceForge File Release System? I am using SourceForge for some Open Source projects and I want to automate the deployment of releases to the SourceForge File Release System. I use Maven for my builds and the standard SFTP deployment mechanism doesn't seem to work u...
TITLE: How can I deploy artifacts from a Maven build to the SourceForge File Release System? QUESTION: I am using SourceForge for some Open Source projects and I want to automate the deployment of releases to the SourceForge File Release System. I use Maven for my builds and the standard SFTP deployment mechanism does...
[ "java", "maven-2", "sourceforge" ]
12
10
8,725
9
0
2008-08-19T16:11:16.297000
2009-09-19T21:33:10.380000
16,491
16,502
Restore database backup over the network
How do you restore a database backup using SQL Server 2005 over the network? I recall doing this before but there was something odd about the way you had to do it.
The database is often running as a service under an account with no network access. If this is the case, then you wouldn't be able to restore directly over the network. Either the backup needs to be copied to the local machine or the database service needs to run as a user with the proper network access.
Restore database backup over the network How do you restore a database backup using SQL Server 2005 over the network? I recall doing this before but there was something odd about the way you had to do it.
TITLE: Restore database backup over the network QUESTION: How do you restore a database backup using SQL Server 2005 over the network? I recall doing this before but there was something odd about the way you had to do it. ANSWER: The database is often running as a service under an account with no network access. If t...
[ "sql-server", "database", "sql-server-2005", "backup", "restore" ]
51
23
93,054
10
0
2008-08-19T16:13:31.813000
2008-08-19T16:20:53.687000
16,501
16,509
What is a lambda (function)?
For a person without a comp-sci background, what is a lambda in the world of Computer Science?
Lambda comes from the Lambda Calculus and refers to anonymous functions in programming. Why is this cool? It allows you to write quick throw away functions without naming them. It also provides a nice way to write closures. With that power you can do things like this. Python def adder(x): return lambda y: x + y add5 = ...
What is a lambda (function)? For a person without a comp-sci background, what is a lambda in the world of Computer Science?
TITLE: What is a lambda (function)? QUESTION: For a person without a comp-sci background, what is a lambda in the world of Computer Science? ANSWER: Lambda comes from the Lambda Calculus and refers to anonymous functions in programming. Why is this cool? It allows you to write quick throw away functions without namin...
[ "lambda", "language-agnostic", "computer-science", "terminology", "theory" ]
849
1,206
394,608
24
0
2008-08-19T16:20:37.650000
2008-08-19T16:27:22.643000
16,517
16,519
Image size for BannerBitmap property in Windows Installer
I'm working on a quick setup program in Visual Studio and wanted to change the banner bitmap. Anyone know off-hand what the ideal (or the required) dimensions are for the new banner image? Thanks.
Found it on MSDN docs for BannerBitmap Property: For best results, you should use a bitmap with dimensions of 500 pixels wide by 70 pixels high.
Image size for BannerBitmap property in Windows Installer I'm working on a quick setup program in Visual Studio and wanted to change the banner bitmap. Anyone know off-hand what the ideal (or the required) dimensions are for the new banner image? Thanks.
TITLE: Image size for BannerBitmap property in Windows Installer QUESTION: I'm working on a quick setup program in Visual Studio and wanted to change the banner bitmap. Anyone know off-hand what the ideal (or the required) dimensions are for the new banner image? Thanks. ANSWER: Found it on MSDN docs for BannerBitmap...
[ "windows-installer" ]
46
77
25,012
1
0
2008-08-19T16:32:01.417000
2008-08-19T16:33:47.560000
16,529
16,549
Communication between Javascript and the server
I've been developing a "Form Builder" in Javascript, and coming up to the part where I'll be sending the spec for the form back to the server to be stored. The builder maintains an internal data structure that represents the fields, label, options (for select/checkbox/radio), mandatory status, and the general sorting o...
Best practice on this dictates that if you are not planning to use the stored data for anything other than recreating the form then the best method is to send it back in some sort of native format (As mentioned above) With this then you can just load the data back in and requires the least processing of any method.
Communication between Javascript and the server I've been developing a "Form Builder" in Javascript, and coming up to the part where I'll be sending the spec for the form back to the server to be stored. The builder maintains an internal data structure that represents the fields, label, options (for select/checkbox/rad...
TITLE: Communication between Javascript and the server QUESTION: I've been developing a "Form Builder" in Javascript, and coming up to the part where I'll be sending the spec for the form back to the server to be stored. The builder maintains an internal data structure that represents the fields, label, options (for s...
[ "javascript", "server" ]
3
1
1,296
5
0
2008-08-19T16:49:30.913000
2008-08-19T17:01:52.060000
16,550
16,564
Best .NET build tool
Possible Duplicate: NAnt or MSBuild, which one to choose and when? What is the best build tool for.NET? I currently use NAnt but only because I have experience with Ant. Is MSBuild preferred?
We actually use a combination of NAnt and MSBuild with CruiseControl. NAnt is used for script flow control and calls MSBuild to compile projects. After the physical build is triggered, NAnt is used to publish the individual project build outputs to a shared location. I am not sure this is the best process. I think many...
Best .NET build tool Possible Duplicate: NAnt or MSBuild, which one to choose and when? What is the best build tool for.NET? I currently use NAnt but only because I have experience with Ant. Is MSBuild preferred?
TITLE: Best .NET build tool QUESTION: Possible Duplicate: NAnt or MSBuild, which one to choose and when? What is the best build tool for.NET? I currently use NAnt but only because I have experience with Ant. Is MSBuild preferred? ANSWER: We actually use a combination of NAnt and MSBuild with CruiseControl. NAnt is us...
[ ".net", "build-process", "nant" ]
43
28
53,475
14
0
2008-08-19T17:02:48.377000
2008-08-19T17:11:37.063000
16,556
23,837
VS.NET Application Diagrams
Have you used VS.NET Architect Edition's Application and System diagrams to start designing a solution? If so, did you find it useful? Did the "automatic implementation" feature work ok?
I used to use it a lot. This designer worked good for stubbing out prototype projects, but ultimately I found myself wasting a lot of time moving the mouse around when I could be typing. It seemed like an awesome idea to be able to print out the class diagrams to show APIs to other developers while I was prototyping, b...
VS.NET Application Diagrams Have you used VS.NET Architect Edition's Application and System diagrams to start designing a solution? If so, did you find it useful? Did the "automatic implementation" feature work ok?
TITLE: VS.NET Application Diagrams QUESTION: Have you used VS.NET Architect Edition's Application and System diagrams to start designing a solution? If so, did you find it useful? Did the "automatic implementation" feature work ok? ANSWER: I used to use it a lot. This designer worked good for stubbing out prototype p...
[ "c#", ".net", "visual-studio", "architecture", "diagram" ]
5
2
412
3
0
2008-08-19T17:05:21.927000
2008-08-23T01:51:04.743000
16,557
16,573
Overriding the equals method vs creating a new method
I have always thought that the.equals() method in java should be overridden to be made specific to the class you have created. In other words to look for equivalence of two different instances rather than two references to the same instance. However I have encountered other programmers who seem to think that the defaul...
Overriding the equals method is necessary if you want to test equivalence in standard library classes (for example, ensuring a java.util.Set contains unique elements or using objects as keys in java.util.Map objects). Note, if you override equals, ensure you honour the API contract as described in the documentation. Fo...
Overriding the equals method vs creating a new method I have always thought that the.equals() method in java should be overridden to be made specific to the class you have created. In other words to look for equivalence of two different instances rather than two references to the same instance. However I have encounter...
TITLE: Overriding the equals method vs creating a new method QUESTION: I have always thought that the.equals() method in java should be overridden to be made specific to the class you have created. In other words to look for equivalence of two different instances rather than two references to the same instance. Howeve...
[ "java", "oop" ]
21
19
1,606
7
0
2008-08-19T17:05:26.937000
2008-08-19T17:14:47.760000
16,568
16,777
How to select the nth row in a SQL database table?
I'm interested in learning some (ideally) database agnostic ways of selecting the n th row from a database table. It would also be interesting to see how this can be achieved using the native functionality of the following databases: SQL Server MySQL PostgreSQL SQLite Oracle I am currently doing something like the foll...
There are ways of doing this in optional parts of the standard, but a lot of databases support their own way of doing it. A really good site that talks about this and other things is http://troels.arvin.dk/db/rdbms/#select-limit. Basically, PostgreSQL and MySQL supports the non-standard: SELECT... LIMIT y OFFSET x Orac...
How to select the nth row in a SQL database table? I'm interested in learning some (ideally) database agnostic ways of selecting the n th row from a database table. It would also be interesting to see how this can be achieved using the native functionality of the following databases: SQL Server MySQL PostgreSQL SQLite ...
TITLE: How to select the nth row in a SQL database table? QUESTION: I'm interested in learning some (ideally) database agnostic ways of selecting the n th row from a database table. It would also be interesting to see how this can be achieved using the native functionality of the following databases: SQL Server MySQL ...
[ "mysql", "sql", "database", "oracle", "postgresql" ]
494
407
1,072,263
34
0
2008-08-19T17:13:11.023000
2008-08-19T19:22:15.100000
16,615
22,910
Is FindFirstChangeNotification the best API to use for file system change notification on windows?
I'm new to windows programming and I'm trying to get notified of all changes to the file system (similar to the information that FileMon from SysInternals displays, but via an API). Is a FindFirstChangeNotification for each (non-network, non-substed) drive my best bet or are there other more suitable C/C++ APIs?
FindFirstChangeNotification is fine, but for slightly more ultimate power you should be using ReadDirectoryChangesW. (In fact, it's even recommended in the documentation!) It doesn't require a function pointer, it does require you to manually decode a raw buffer, it uses Unicode file names, but it is generally better a...
Is FindFirstChangeNotification the best API to use for file system change notification on windows? I'm new to windows programming and I'm trying to get notified of all changes to the file system (similar to the information that FileMon from SysInternals displays, but via an API). Is a FindFirstChangeNotification for ea...
TITLE: Is FindFirstChangeNotification the best API to use for file system change notification on windows? QUESTION: I'm new to windows programming and I'm trying to get notified of all changes to the file system (similar to the information that FileMon from SysInternals displays, but via an API). Is a FindFirstChangeN...
[ "c", "windows", "winapi", "file", "notifications" ]
18
22
8,066
4
0
2008-08-19T17:44:27.153000
2008-08-22T17:11:16.007000
16,616
16,622
ArgumentNullException for Integer
In.NET, is it more appropriate to throw an argument null exception for an Integer if the value is Integer.MinValue or Integer = 0 (assuming that 0 is not a valid value)?
Throwing an ArgumentNullException isn't appropriate unless the argument is actually null. Throw an ArgumentOutOfRangeException instead (preferably with a message informing the user what values of int are actually acceptable). ArgumentOutOfRangeException is thrown when a method is invoked and at least one of the argumen...
ArgumentNullException for Integer In.NET, is it more appropriate to throw an argument null exception for an Integer if the value is Integer.MinValue or Integer = 0 (assuming that 0 is not a valid value)?
TITLE: ArgumentNullException for Integer QUESTION: In.NET, is it more appropriate to throw an argument null exception for an Integer if the value is Integer.MinValue or Integer = 0 (assuming that 0 is not a valid value)? ANSWER: Throwing an ArgumentNullException isn't appropriate unless the argument is actually null....
[ ".net" ]
1
8
751
3
0
2008-08-19T17:47:23.230000
2008-08-19T17:50:47.843000
16,634
16,655
What is the best method for checking if a file exists from a SQL Server 2005 stored procedure?
We used the "undocumented" xp_fileexist stored procedure for years in SQL Server 2000 and had no trouble with it. In 2005, it seems that they modified the behavior slightly to always return a 0 if the executing user account is not a sysadmin. It also seems to return a zero if the SQL Server service is running under the...
Maybe a CLR stored procedure is what you are looking for. These are generally used when you need to interact with the system in some way.
What is the best method for checking if a file exists from a SQL Server 2005 stored procedure? We used the "undocumented" xp_fileexist stored procedure for years in SQL Server 2000 and had no trouble with it. In 2005, it seems that they modified the behavior slightly to always return a 0 if the executing user account i...
TITLE: What is the best method for checking if a file exists from a SQL Server 2005 stored procedure? QUESTION: We used the "undocumented" xp_fileexist stored procedure for years in SQL Server 2000 and had no trouble with it. In 2005, it seems that they modified the behavior slightly to always return a 0 if the execut...
[ "sql-server", "sql-server-2005" ]
4
4
9,789
3
0
2008-08-19T18:01:43.653000
2008-08-19T18:13:13.040000
16,638
16,720
Google Maps API - Problems with class GLatLngBounds
I am having some trouble with the Google Maps API. I have an array which holds a ojbect I created to store points. My array and class: var tPoints = []; function tPoint(name) { var id = name; var points = []; var pointsCount = 0;... this.getHeadPoint = function() { return points[pointsCount-1]; } } tPoint holds an arra...
The google maps sample is using this code... var bounds = map.getBounds(); var southWest = bounds.getSouthWest(); var northEast = bounds.getNorthEast(); var lngSpan = northEast.lng() - southWest.lng(); var latSpan = northEast.lat() - southWest.lat();...which is putting the SouthWest/NorthEast bounds into a variable bef...
Google Maps API - Problems with class GLatLngBounds I am having some trouble with the Google Maps API. I have an array which holds a ojbect I created to store points. My array and class: var tPoints = []; function tPoint(name) { var id = name; var points = []; var pointsCount = 0;... this.getHeadPoint = function() { re...
TITLE: Google Maps API - Problems with class GLatLngBounds QUESTION: I am having some trouble with the Google Maps API. I have an array which holds a ojbect I created to store points. My array and class: var tPoints = []; function tPoint(name) { var id = name; var points = []; var pointsCount = 0;... this.getHeadPoint...
[ "javascript", "google-maps" ]
3
1
4,622
2
0
2008-08-19T18:04:16.160000
2008-08-19T18:46:25.670000
16,656
16,787
Creating temporary folders
I am working on a program that needs to create a multiple temporary folders for the application. These will not be seen by the user. The app is written in VB.net. I can think of a few ways to do it such as incremental folder name or random numbered folder names, but I was wondering, how other people solve this problem?
Update: Added File.Exists check per comment (2012-Jun-19) Here's what I've used in VB.NET. Essentially the same as presented, except I usually didn't want to create the folder immediately. The advantage to use GetRandomFilename is that it doesn't create a file, so you don't have to clean up if your using the name for s...
Creating temporary folders I am working on a program that needs to create a multiple temporary folders for the application. These will not be seen by the user. The app is written in VB.net. I can think of a few ways to do it such as incremental folder name or random numbered folder names, but I was wondering, how other...
TITLE: Creating temporary folders QUESTION: I am working on a program that needs to create a multiple temporary folders for the application. These will not be seen by the user. The app is written in VB.net. I can think of a few ways to do it such as incremental folder name or random numbered folder names, but I was wo...
[ ".net", "io" ]
30
28
30,655
13
0
2008-08-19T18:14:14.317000
2008-08-19T19:30:17.737000
16,657
16,679
How to affordably release a Web App
I am a broke college student. I have built a small web app in PHP5 and MySQL, and I already have a domain. What is an affordable way to get it online? A few people have suggested amazon's cloud services, but that seems equivalent to slitting my wrists and watching money slowly trickle out. So suggestions? Hosting compa...
I say pay the 50-80 bucks for a real host. The classic "you get what you pay for" is very true for hosting. This will save you time, time you can spend getting those $80.
How to affordably release a Web App I am a broke college student. I have built a small web app in PHP5 and MySQL, and I already have a domain. What is an affordable way to get it online? A few people have suggested amazon's cloud services, but that seems equivalent to slitting my wrists and watching money slowly trickl...
TITLE: How to affordably release a Web App QUESTION: I am a broke college student. I have built a small web app in PHP5 and MySQL, and I already have a domain. What is an affordable way to get it online? A few people have suggested amazon's cloud services, but that seems equivalent to slitting my wrists and watching m...
[ "hosting", "web-applications" ]
4
5
468
8
0
2008-08-19T18:14:23.317000
2008-08-19T18:25:03.560000
16,660
16,761
Internationalization in SSRS
What's the best way to handle translations for stock text in a SSRS. For instance - if I have a report that shows a grid of contents what's the best way to have the correct translation for the header of that grid show up, assuming the culture of the report is set correctly. Put another way - is it possible to do resour...
AS far as I know, there is no way to localize a report (meaning automating the translation of string litterals)... Like you said,you basically have to use the User!Language global variable to catch the user's settings and then use that to retrieve the appropriate strings from the DB... However, you can adapt the displa...
Internationalization in SSRS What's the best way to handle translations for stock text in a SSRS. For instance - if I have a report that shows a grid of contents what's the best way to have the correct translation for the header of that grid show up, assuming the culture of the report is set correctly. Put another way ...
TITLE: Internationalization in SSRS QUESTION: What's the best way to handle translations for stock text in a SSRS. For instance - if I have a report that shows a grid of contents what's the best way to have the correct translation for the header of that grid show up, assuming the culture of the report is set correctly...
[ "reporting-services", "internationalization" ]
6
5
3,691
1
0
2008-08-19T18:15:29.617000
2008-08-19T19:14:04.303000
16,716
16,730
OpenID authentication in ASP.NET?
I am starting to build a new web application that will require user accounts. Now that I have an OpenID that I am using for this site I thought it would be cool if I could use OpenID for authentication in my application. Are there any good tutorials on how to integrate OpenID with an ASP.NET site?
See Scott Hanselman's post on using DotNetOpenID in ASP.NET. Andrew Arnott's blog is full of samples on using DotNetOpenID with ASP.NET, including ASP.NET MVC. I recently hooked up DotNetOpenID for the Subtext 2.0 release. It went really smoothly - the code samples included with the DotNetOpenID download are pretty hel...
OpenID authentication in ASP.NET? I am starting to build a new web application that will require user accounts. Now that I have an OpenID that I am using for this site I thought it would be cool if I could use OpenID for authentication in my application. Are there any good tutorials on how to integrate OpenID with an A...
TITLE: OpenID authentication in ASP.NET? QUESTION: I am starting to build a new web application that will require user accounts. Now that I have an OpenID that I am using for this site I thought it would be cool if I could use OpenID for authentication in my application. Are there any good tutorials on how to integrat...
[ "asp.net", "openid", "dotnetopenauth" ]
29
25
8,665
6
0
2008-08-19T18:44:32.633000
2008-08-19T18:49:27.537000
16,747
25,606
What's the best way to implement field validation using ASP.NET MVC?
I am building a public website using ASP.NET, as part of the deliverable I need to do an Admin Site for data entry of the stuff shown in the public site, I was wondering what techniques or procedures are people using to validate entries using ASP.NET MVC.
Take a look at the JQuery Validation plugin this plugin is amazing,it's clean to implement and has all the features you could ever need, including remote validation via AJAX. Also a sample MVC controller method can be found here which basically uses the JsonResult action type like: public JsonResult CheckUserName(strin...
What's the best way to implement field validation using ASP.NET MVC? I am building a public website using ASP.NET, as part of the deliverable I need to do an Admin Site for data entry of the stuff shown in the public site, I was wondering what techniques or procedures are people using to validate entries using ASP.NET ...
TITLE: What's the best way to implement field validation using ASP.NET MVC? QUESTION: I am building a public website using ASP.NET, as part of the deliverable I need to do an Admin Site for data entry of the stuff shown in the public site, I was wondering what techniques or procedures are people using to validate entr...
[ "c#", "asp.net-mvc", "validation" ]
45
26
6,276
3
0
2008-08-19T19:02:55.637000
2008-08-25T03:04:28.937000
16,759
16,785
How do you use back-references to PCREs in PHP?
I read this PHP RegEx page, but either I'm missing something, misreading something, or it doesn't work the way they say. I'm guessing it's one of the first two. $str = preg_replace("([|]\d*)", "\1;", $str);
Your regular expression should follow Perl syntax, meaning it has to start and end with the same character (with some exceptions). Also, the back reference should start with a double slash, to get around PHPs double escaping. This should work (with a quick test): $str = "asdfasdf |123123 asdf iakds |302 asdf |11"; $str...
How do you use back-references to PCREs in PHP? I read this PHP RegEx page, but either I'm missing something, misreading something, or it doesn't work the way they say. I'm guessing it's one of the first two. $str = preg_replace("([|]\d*)", "\1;", $str);
TITLE: How do you use back-references to PCREs in PHP? QUESTION: I read this PHP RegEx page, but either I'm missing something, misreading something, or it doesn't work the way they say. I'm guessing it's one of the first two. $str = preg_replace("([|]\d*)", "\1;", $str); ANSWER: Your regular expression should follow ...
[ "php", "regex" ]
3
4
1,396
1
0
2008-08-19T19:11:32.860000
2008-08-19T19:29:00.513000
16,770
16,810
Haskell's algebraic data types
I'm trying to fully understand all of Haskell's concepts. In what ways are algebraic data types similar to generic types, e.g., in C# and Java? And how are they different? What's so algebraic about them anyway? I'm familiar with universal algebra and its rings and fields, but I only have a vague idea of how Haskell's t...
"Algebraic Data Types" in Haskell support full parametric polymorphism, which is the more technically correct name for generics, as a simple example the list data type: data List a = Cons a (List a) | Nil Is equivalent (as much as is possible, and ignoring non-strict evaluation, etc) to class List { class Cons: List { ...
Haskell's algebraic data types I'm trying to fully understand all of Haskell's concepts. In what ways are algebraic data types similar to generic types, e.g., in C# and Java? And how are they different? What's so algebraic about them anyway? I'm familiar with universal algebra and its rings and fields, but I only have ...
TITLE: Haskell's algebraic data types QUESTION: I'm trying to fully understand all of Haskell's concepts. In what ways are algebraic data types similar to generic types, e.g., in C# and Java? And how are they different? What's so algebraic about them anyway? I'm familiar with universal algebra and its rings and fields...
[ "data-structures", "haskell", "types", "functional-programming", "algebraic-data-types" ]
63
23
17,716
8
0
2008-08-19T19:18:41.720000
2008-08-19T19:46:24.647000
16,792
16,806
SQL Server Maximum row size
Came across this error today. Wondering if anyone can tell me what it means: Cannot sort a row of size 9522, which is greater than the allowable maximum of 8094. Is that 8094 bytes? Characters? Fields? Is this a problem joining multiple tables that are exceeding some limit?
In SQL 2000, the row limit is 8K bytes, which is the same size as a page in memory. [Edit] In 2005, the page size is the same (8K), but the database uses pointers on the row in the page to point to other pages that contain larger fields. This allows 2005 to overcome the 8K row size limitation.
SQL Server Maximum row size Came across this error today. Wondering if anyone can tell me what it means: Cannot sort a row of size 9522, which is greater than the allowable maximum of 8094. Is that 8094 bytes? Characters? Fields? Is this a problem joining multiple tables that are exceeding some limit?
TITLE: SQL Server Maximum row size QUESTION: Came across this error today. Wondering if anyone can tell me what it means: Cannot sort a row of size 9522, which is greater than the allowable maximum of 8094. Is that 8094 bytes? Characters? Fields? Is this a problem joining multiple tables that are exceeding some limit?...
[ "sql-server" ]
11
10
15,004
5
0
2008-08-19T19:32:38.823000
2008-08-19T19:39:20.510000
16,795
16,802
PHPs htmlspecialcharacters equivalent in .NET?
PHP has a great function called htmlspecialcharacters() where you pass it a string and it replaces all of HTML's special characters with their safe equivalents, it's almost a one stop shop for sanitizing input. Very nice right? Well is there an equivalent in any of the.NET libraries? If not, can anyone link to any code...
Try this. var encodedHtml = HttpContext.Current.Server.HtmlEncode(...);
PHPs htmlspecialcharacters equivalent in .NET? PHP has a great function called htmlspecialcharacters() where you pass it a string and it replaces all of HTML's special characters with their safe equivalents, it's almost a one stop shop for sanitizing input. Very nice right? Well is there an equivalent in any of the.NET...
TITLE: PHPs htmlspecialcharacters equivalent in .NET? QUESTION: PHP has a great function called htmlspecialcharacters() where you pass it a string and it replaces all of HTML's special characters with their safe equivalents, it's almost a one stop shop for sanitizing input. Very nice right? Well is there an equivalent...
[ "c#", ".net", "php", "asp.net" ]
18
11
12,479
5
0
2008-08-19T19:35:30.080000
2008-08-19T19:37:48.577000
16,804
297,256
Enterprise Reporting Solutions
What options are there in the industry for enterprise reporting? I'm currently using SSRS 2005, and know that there is another version coming out with the new release of MSSQL. But, it seems like it might also be a good time to investigate the market to see what else is out there. What have you encountered? Do you like...
I've used Cognos Series 7, Cognos Series 8, Crystal Reports, Business Objects XI R2 WebIntelligence, Reporting Services 2000, Reporting Services 2005, and Reporting Services 2008. Here's my feedback on what I've learned: Reporting Services 2008/2005/2000 PROS Cost: Cheapest enterprise business intelligence solution if ...
Enterprise Reporting Solutions What options are there in the industry for enterprise reporting? I'm currently using SSRS 2005, and know that there is another version coming out with the new release of MSSQL. But, it seems like it might also be a good time to investigate the market to see what else is out there. What ha...
TITLE: Enterprise Reporting Solutions QUESTION: What options are there in the industry for enterprise reporting? I'm currently using SSRS 2005, and know that there is another version coming out with the new release of MSSQL. But, it seems like it might also be a good time to investigate the market to see what else is ...
[ "sql", "reporting-services", "reporting" ]
38
42
7,644
14
0
2008-08-19T19:38:38.640000
2008-11-17T22:50:31.287000
16,808
16,811
Error viewing csproj property pages in VisualStudio2005
When I goto view the property page for my CSharp test application I get the following error. "An error occurred trying to load the page. COM object that has been seperated from its underlying RCW cannot be used." The only thing that seems to fix it is rebooting my PC!
This is usually caused by a 'rogue' add-in. Try disabling them all, and then re-enabling them checking for the error - so that you can narrow down the culprit.
Error viewing csproj property pages in VisualStudio2005 When I goto view the property page for my CSharp test application I get the following error. "An error occurred trying to load the page. COM object that has been seperated from its underlying RCW cannot be used." The only thing that seems to fix it is rebooting my...
TITLE: Error viewing csproj property pages in VisualStudio2005 QUESTION: When I goto view the property page for my CSharp test application I get the following error. "An error occurred trying to load the page. COM object that has been seperated from its underlying RCW cannot be used." The only thing that seems to fix ...
[ "visual-studio" ]
1
1
676
2
0
2008-08-19T19:42:15.777000
2008-08-19T19:46:58.153000
16,815
16,818
Accessing html parameter in PHP
I'm trying to do a simple test php script for sessions. Basically it increments a counter (stored in $_SESSION ) every time you refresh that page. That works, but I'm trying to have a link to destroy the session which reloads the page with the?destroy=1 parameter. I've tried a couple of if statements to see if that par...
I think you put $_POST['destroy'] Instead of $_GET['destroy'] You need to use a form if you'd like to use a $_POST variable. $_GET variables are stored in the URL.
Accessing html parameter in PHP I'm trying to do a simple test php script for sessions. Basically it increments a counter (stored in $_SESSION ) every time you refresh that page. That works, but I'm trying to have a link to destroy the session which reloads the page with the?destroy=1 parameter. I've tried a couple of ...
TITLE: Accessing html parameter in PHP QUESTION: I'm trying to do a simple test php script for sessions. Basically it increments a counter (stored in $_SESSION ) every time you refresh that page. That works, but I'm trying to have a link to destroy the session which reloads the page with the?destroy=1 parameter. I've ...
[ "php", "session" ]
1
6
1,235
5
0
2008-08-19T19:49:54.577000
2008-08-19T19:52:03.930000
16,828
16,837
How do you do a case insensitive search using a pattern modifier using less?
It seems like the only way to do this is to pass the -i parameter in when you initially run less. Does anyone know of some secret hack to make something like this work /something to search for/i
You can also type command -I while less is running. It toggles case sensitivity for searches.
How do you do a case insensitive search using a pattern modifier using less? It seems like the only way to do this is to pass the -i parameter in when you initially run less. Does anyone know of some secret hack to make something like this work /something to search for/i
TITLE: How do you do a case insensitive search using a pattern modifier using less? QUESTION: It seems like the only way to do this is to pass the -i parameter in when you initially run less. Does anyone know of some secret hack to make something like this work /something to search for/i ANSWER: You can also type com...
[ "unix", "search", "case-insensitive", "less-unix" ]
355
517
98,027
5
0
2008-08-19T20:00:33.900000
2008-08-19T20:09:09.483000
16,832
16,870
Lightweight source control
I am looking for a lightweight source control system for use on "hobby" projects with only one person (myself) working on the project. Does anyone have any suggestions? Ideally it should interface with Visual Studio either naively or through another plug-in, outside of that, anything that works would be nice to be repl...
You can use assembla.com to host your project. They offer subversion, git and mercurial hosting. I personally use their subversion hosting for a free and private one-man project. As an added bonus, you also get a wiki and a ticketing system. Which can help you manage your stuff. And the best thing is that you don't hav...
Lightweight source control I am looking for a lightweight source control system for use on "hobby" projects with only one person (myself) working on the project. Does anyone have any suggestions? Ideally it should interface with Visual Studio either naively or through another plug-in, outside of that, anything that wor...
TITLE: Lightweight source control QUESTION: I am looking for a lightweight source control system for use on "hobby" projects with only one person (myself) working on the project. Does anyone have any suggestions? Ideally it should interface with Visual Studio either naively or through another plug-in, outside of that,...
[ "version-control" ]
18
14
6,458
16
0
2008-08-19T20:06:55.803000
2008-08-19T20:22:49.097000
16,833
16,856
How do you download and extract a gzipped file with C#?
I need to periodically download, extract and save the contents of http://data.dot.state.mn.us/dds/det_sample.xml.gz to disk. Anyone have experience downloading gzipped files with C#?
To compress: using (FileStream fStream = new FileStream(@"C:\test.docx.gzip", FileMode.Create, FileAccess.Write)) { using (GZipStream zipStream = new GZipStream(fStream, CompressionMode.Compress)) { byte[] inputfile = File.ReadAllBytes(@"c:\test.docx"); zipStream.Write(inputfile, 0, inputfile.Length); } } To Decompress...
How do you download and extract a gzipped file with C#? I need to periodically download, extract and save the contents of http://data.dot.state.mn.us/dds/det_sample.xml.gz to disk. Anyone have experience downloading gzipped files with C#?
TITLE: How do you download and extract a gzipped file with C#? QUESTION: I need to periodically download, extract and save the contents of http://data.dot.state.mn.us/dds/det_sample.xml.gz to disk. Anyone have experience downloading gzipped files with C#? ANSWER: To compress: using (FileStream fStream = new FileStrea...
[ "c#", ".net", "gzip" ]
23
29
24,403
6
0
2008-08-19T20:07:43.230000
2008-08-19T20:15:07.007000
16,860
16,894
Getting Started with Unit Testing
Unit testing is, roughly speaking, testing bits of your code in isolation with test code. The immediate advantages that come to mind are: Running the tests becomes automate-able and repeatable You can test at a much more granular level than point-and-click testing via a GUI Rytmis My question is, what are the current "...
Ok here's some best practices from some one who doesn't unit test as much as he should...cough. Make sure your tests test one thing and one thing only. Write unit tests as you go. Preferably before you write the code you are testing against. Do not unit test the GUI. Separate your concerns. Minimise the dependencies of...
Getting Started with Unit Testing Unit testing is, roughly speaking, testing bits of your code in isolation with test code. The immediate advantages that come to mind are: Running the tests becomes automate-able and repeatable You can test at a much more granular level than point-and-click testing via a GUI Rytmis My q...
TITLE: Getting Started with Unit Testing QUESTION: Unit testing is, roughly speaking, testing bits of your code in isolation with test code. The immediate advantages that come to mind are: Running the tests becomes automate-able and repeatable You can test at a much more granular level than point-and-click testing via...
[ "unit-testing" ]
25
22
6,586
7
0
2008-08-19T20:18:09.993000
2008-08-19T20:33:28.263000
16,873
16,903
Choosing a multiplier for a (string) hash function
Do you have any advice/rules on selecting a multiplier to use in a (multiplicative) hash function. The function is computing the hash value of a string.
You want to use something that is relatively prime to the size of your set. That way, when you loop around, you won't end up on the same numbers you just tried.
Choosing a multiplier for a (string) hash function Do you have any advice/rules on selecting a multiplier to use in a (multiplicative) hash function. The function is computing the hash value of a string.
TITLE: Choosing a multiplier for a (string) hash function QUESTION: Do you have any advice/rules on selecting a multiplier to use in a (multiplicative) hash function. The function is computing the hash value of a string. ANSWER: You want to use something that is relatively prime to the size of your set. That way, whe...
[ "performance", "algorithm" ]
16
3
2,321
3
0
2008-08-19T20:23:25.723000
2008-08-19T20:36:07.493000
16,891
17,187
VS 2008 - ctrl-tab behavior
As you may know, in VS 2008 ctrl + tab brings up a nifty navigator window with a thumbnail of each file. I love it, but there is one tiny thing that is annoying to me about this feature: the window stays around after releasing the ctrl key. When doing an alt + tab in windows, you can hit tab to get to the item you want...
You probably have the text-to-speech narrator enabled. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2467648&SiteID=1&mode=1 Just uncheck all checkboxes under "Text-To-Speech" narrator software. --> To open Narrator using the keyboard, press CTRL + ESC, press R, type narrator, and then press Enter. This one dro...
VS 2008 - ctrl-tab behavior As you may know, in VS 2008 ctrl + tab brings up a nifty navigator window with a thumbnail of each file. I love it, but there is one tiny thing that is annoying to me about this feature: the window stays around after releasing the ctrl key. When doing an alt + tab in windows, you can hit tab...
TITLE: VS 2008 - ctrl-tab behavior QUESTION: As you may know, in VS 2008 ctrl + tab brings up a nifty navigator window with a thumbnail of each file. I love it, but there is one tiny thing that is annoying to me about this feature: the window stays around after releasing the ctrl key. When doing an alt + tab in window...
[ "visual-studio-2008", "ide", "keyboard-shortcuts" ]
9
13
2,158
10
0
2008-08-19T20:32:42.413000
2008-08-19T23:21:07.110000
16,897
17,642
Delphi and COM: TLB and maintenance issues
In the company that i work, we develop all the GUI in C#, but the application kernel is mainly developed in Delphi 5 (for historical reasons), with a lot of components made in COM+. Related to this very specific sort of application a I two questions: Experienced guys in Delphi and/or COM, do you have any workrounds to ...
I think you should have a good look at Delphi 2009. Delphi 2009 has changes to the COM support, including a text-based replacement for the binary TLB files. You can read more on Chris Bensen's blog.
Delphi and COM: TLB and maintenance issues In the company that i work, we develop all the GUI in C#, but the application kernel is mainly developed in Delphi 5 (for historical reasons), with a lot of components made in COM+. Related to this very specific sort of application a I two questions: Experienced guys in Delphi...
TITLE: Delphi and COM: TLB and maintenance issues QUESTION: In the company that i work, we develop all the GUI in C#, but the application kernel is mainly developed in Delphi 5 (for historical reasons), with a lot of components made in COM+. Related to this very specific sort of application a I two questions: Experien...
[ "delphi", "com", "typelib", "com-hell" ]
9
11
5,929
5
0
2008-08-19T20:34:13.177000
2008-08-20T09:16:37.427000
16,918
16,951
Beginners Guide to Haskell?
I've been looking for a decent guide to Haskell for some time, but haven't been able to find one that seems interesting enough to read through and/or makes sense. I've had prior exposure to Haskell a few years back, but I can't remember much about it. I remember the "Aha!"-feeling was incredible when I finally got it, ...
Some good places to start are: The Gentle Introduction To Haskell Problem Solving in Haskell Happy Learn Haskell Tutorial Other resources: Interesting blog entry on a Study plan for Haskell via the Wayback Machine HaskellWiki Generic Haskell User Guide (PDF)
Beginners Guide to Haskell? I've been looking for a decent guide to Haskell for some time, but haven't been able to find one that seems interesting enough to read through and/or makes sense. I've had prior exposure to Haskell a few years back, but I can't remember much about it. I remember the "Aha!"-feeling was incred...
TITLE: Beginners Guide to Haskell? QUESTION: I've been looking for a decent guide to Haskell for some time, but haven't been able to find one that seems interesting enough to read through and/or makes sense. I've had prior exposure to Haskell a few years back, but I can't remember much about it. I remember the "Aha!"-...
[ "haskell", "functional-programming" ]
122
49
22,234
16
0
2008-08-19T20:44:48.897000
2008-08-19T21:04:10.603000
16,926
330,236
Tool for generating CSS skeleton?
My HTML is all marked up, ready to make it rain CSS. The problem is that I have to go back and find out what all my id and class names are so I can get started. What I need is a tool that parses my HTML and spits out a stylesheet with all the possible elements ready to be styled (maybe even with some defaults). Does su...
http://lab.xms.pl/css-generator/ seems to fit the description.
Tool for generating CSS skeleton? My HTML is all marked up, ready to make it rain CSS. The problem is that I have to go back and find out what all my id and class names are so I can get started. What I need is a tool that parses my HTML and spits out a stylesheet with all the possible elements ready to be styled (maybe...
TITLE: Tool for generating CSS skeleton? QUESTION: My HTML is all marked up, ready to make it rain CSS. The problem is that I have to go back and find out what all my id and class names are so I can get started. What I need is a tool that parses my HTML and spits out a stylesheet with all the possible elements ready t...
[ "css", "markup" ]
20
3
2,407
9
0
2008-08-19T20:49:47.967000
2008-12-01T07:44:43.330000
16,935
19,782
Ant's <javac> tasks throws StackOverflowException
I'm trying to compile over 100 java classes from different packages from a clean directory (no incremental compiles) using the following ant tasks: Compiling However, the first time I run the compile task I always get a StackOverflowException. If I run the task again the compiler does an incremental build and everythin...
It will be nice to know; what can cause or causes a StackOverflowError during compilation of Java code? It is probable that evaluating the long expression in your java file consumes lots of memory and because this is being done in conjunction with the compilation of other classes, the VM just runs out of stack space. Y...
Ant's <javac> tasks throws StackOverflowException I'm trying to compile over 100 java classes from different packages from a clean directory (no incremental compiles) using the following ant tasks: Compiling However, the first time I run the compile task I always get a StackOverflowException. If I run the task again th...
TITLE: Ant's <javac> tasks throws StackOverflowException QUESTION: I'm trying to compile over 100 java classes from different packages from a clean directory (no incremental compiles) using the following ant tasks: Compiling However, the first time I run the compile task I always get a StackOverflowException. If I run...
[ "java", "ant" ]
6
5
9,362
7
0
2008-08-19T20:53:53.417000
2008-08-21T12:58:37.930000
16,939
16,967
Difference between a byte array and MemoryStream
I am reading a binary file into a parsing program. I will need to iterate through the file and look for certain markers so I can split the file up and pass those parts into their respective object’s constructors. Is there an advantage to holding the file as a stream, either MemoryStream or FileStream, or should it be c...
A byte[] or MemoryStream will both require bringing the entire file into memory. A MemoryStream is really a wrapper around an underlying byte array. The best approach is to have two FileStream (one for input and one for output). Read from the input stream looking for the pattern used to indicate the file should be sepa...
Difference between a byte array and MemoryStream I am reading a binary file into a parsing program. I will need to iterate through the file and look for certain markers so I can split the file up and pass those parts into their respective object’s constructors. Is there an advantage to holding the file as a stream, eit...
TITLE: Difference between a byte array and MemoryStream QUESTION: I am reading a binary file into a parsing program. I will need to iterate through the file and look for certain markers so I can split the file up and pass those parts into their respective object’s constructors. Is there an advantage to holding the fil...
[ "performance", "comparison" ]
22
30
15,952
2
0
2008-08-19T20:57:24.783000
2008-08-19T21:12:20.040000
16,964
17,024
Creating your own table with CommandArgument buttons in ASP.NET MVC
I'm trying to implement something like this: Port name Current port version New port version Update <% foreach (var ip in Ports) { %> <%= ip.PortName %> <%= ip.CurrentVersion %> <%= ip.NewVersion %> <% } %> The button's CommandArgument property is where my code complains about not being able to resolve symbol ip. Is th...
You don't want to use a Webforms button in ASP.NET MVC. MVC is a completely different way of working, and you no longer have the WebForms abstraction. You have 2 different options you can either replace your asp:Button with an input tag or use a standard hyperlink instead. If you use the input option then you will need...
Creating your own table with CommandArgument buttons in ASP.NET MVC I'm trying to implement something like this: Port name Current port version New port version Update <% foreach (var ip in Ports) { %> <%= ip.PortName %> <%= ip.CurrentVersion %> <%= ip.NewVersion %> <% } %> The button's CommandArgument property is wher...
TITLE: Creating your own table with CommandArgument buttons in ASP.NET MVC QUESTION: I'm trying to implement something like this: Port name Current port version New port version Update <% foreach (var ip in Ports) { %> <%= ip.PortName %> <%= ip.CurrentVersion %> <%= ip.NewVersion %> <% } %> The button's CommandArgumen...
[ "asp.net-mvc" ]
0
3
2,169
4
0
2008-08-19T21:10:47.890000
2008-08-19T21:43:38.137000
16,991
17,010
What Ruby IDE do you prefer?
I've been using Eclipse with RDT (not RadRails) a lot lately, and I'm quite happy with it, but I'm wondering if you guys know any decent alternatives. I know NetBeans also supports Ruby these days, but I'm not sure what it has to offer over Eclipse. Please, list any features you think are brilliant or useful when sugge...
Have you tried Aptana? It's based on Eclipse and they have a sweet Rails plugin.
What Ruby IDE do you prefer? I've been using Eclipse with RDT (not RadRails) a lot lately, and I'm quite happy with it, but I'm wondering if you guys know any decent alternatives. I know NetBeans also supports Ruby these days, but I'm not sure what it has to offer over Eclipse. Please, list any features you think are b...
TITLE: What Ruby IDE do you prefer? QUESTION: I've been using Eclipse with RDT (not RadRails) a lot lately, and I'm quite happy with it, but I'm wondering if you guys know any decent alternatives. I know NetBeans also supports Ruby these days, but I'm not sure what it has to offer over Eclipse. Please, list any featur...
[ "ruby", "ide", "editor" ]
141
27
426,567
25
0
2008-08-19T21:26:22.150000
2008-08-19T21:35:46.593000
16,998
17,236
Reading "chunked" response with HttpWebResponse
I'm having trouble reading a "chunked" response when using a StreamReader to read the stream returned by GetResponseStream() of a HttpWebResponse: // response is an HttpWebResponse StreamReader reader = new StreamReader(response.GetResponseStream()); string output = reader.ReadToEnd(); // throws exception... When the r...
Haven't tried it this with a "chunked" response but would something like this work? StringBuilder sb = new StringBuilder(); Byte[] buf = new byte[8192]; Stream resStream = response.GetResponseStream(); string tmpString = null; int count = 0; do { count = resStream.Read(buf, 0, buf.Length); if(count!= 0) { tmpString = E...
Reading "chunked" response with HttpWebResponse I'm having trouble reading a "chunked" response when using a StreamReader to read the stream returned by GetResponseStream() of a HttpWebResponse: // response is an HttpWebResponse StreamReader reader = new StreamReader(response.GetResponseStream()); string output = reade...
TITLE: Reading "chunked" response with HttpWebResponse QUESTION: I'm having trouble reading a "chunked" response when using a StreamReader to read the stream returned by GetResponseStream() of a HttpWebResponse: // response is an HttpWebResponse StreamReader reader = new StreamReader(response.GetResponseStream()); str...
[ "c#", "http", ".net-3.5", ".net-2.0" ]
14
2
24,760
5
0
2008-08-19T21:28:53.097000
2008-08-19T23:54:37.670000
17,017
17,021
How do I parse and convert a DateTime to the RFC 3339 date-time format?
How do I convert a DateTime structure to its equivalent RFC 3339 formatted string representation and/or parse this string representation back to a DateTime structure? The RFC-3339 date-time format is used in a number of specifications such as the Atom Syndication Format.
This is an implementation in C# of how to parse and convert a DateTime to and from its RFC-3339 representation. The only restriction it has is that the DateTime is in Coordinated Universal Time (UTC). using System; using System.Globalization; namespace DateTimeConsoleApplication { /// /// Provides methods for converti...
How do I parse and convert a DateTime to the RFC 3339 date-time format? How do I convert a DateTime structure to its equivalent RFC 3339 formatted string representation and/or parse this string representation back to a DateTime structure? The RFC-3339 date-time format is used in a number of specifications such as the A...
TITLE: How do I parse and convert a DateTime to the RFC 3339 date-time format? QUESTION: How do I convert a DateTime structure to its equivalent RFC 3339 formatted string representation and/or parse this string representation back to a DateTime structure? The RFC-3339 date-time format is used in a number of specificat...
[ ".net", "datetime", "rfc3339", "atom-feed" ]
57
22
57,113
8
0
2008-08-19T21:40:11.780000
2008-08-19T21:42:45.113000
17,020
17,048
What is the best way to partition terabyte drive in a linux development machine?
I have a new 1 TB drive coming in tomorrow. What is the best way to divide this space for a development workstation? The biggest problem I think I'm going to have is that some partitions (probably /usr) will become to small after a bit of use. Other partitions are probably to huge. The swap drive for example is current...
My standard strategy for normal "utility" boxes is to give them a swap partition twice the size of their RAM, a 1GB /boot partition and leave the rest as one vast partition. Whilst I see why some people want a separate /var, separate /home, etc., if I only have trusted users and I'm not running some production service,...
What is the best way to partition terabyte drive in a linux development machine? I have a new 1 TB drive coming in tomorrow. What is the best way to divide this space for a development workstation? The biggest problem I think I'm going to have is that some partitions (probably /usr) will become to small after a bit of ...
TITLE: What is the best way to partition terabyte drive in a linux development machine? QUESTION: I have a new 1 TB drive coming in tomorrow. What is the best way to divide this space for a development workstation? The biggest problem I think I'm going to have is that some partitions (probably /usr) will become to sma...
[ "linux", "storage", "disk-partitioning" ]
3
4
5,202
10
0
2008-08-19T21:42:30.667000
2008-08-19T21:58:12.990000
17,032
17,042
Should I *always* favour implictly typed local variables in C# 3.0?
Resharper certainly thinks so, and out of the box it will nag you to convert Dooberry dooberry = new Dooberry(); to var dooberry = new Dooberry(); Is that really considered the best style?
It's of course a matter of style, but I agree with Dare: C# 3.0 Implicit Type Declarations: To var or not to var?. I think using var instead of an explicit type makes your code less readable.In the following code: var result = GetUserID(); What is result? An int, a string, a GUID? Yes, it matters, and no, I shouldn't h...
Should I *always* favour implictly typed local variables in C# 3.0? Resharper certainly thinks so, and out of the box it will nag you to convert Dooberry dooberry = new Dooberry(); to var dooberry = new Dooberry(); Is that really considered the best style?
TITLE: Should I *always* favour implictly typed local variables in C# 3.0? QUESTION: Resharper certainly thinks so, and out of the box it will nag you to convert Dooberry dooberry = new Dooberry(); to var dooberry = new Dooberry(); Is that really considered the best style? ANSWER: It's of course a matter of style, bu...
[ "c#", "styles", "resharper" ]
30
40
4,304
13
0
2008-08-19T21:49:07.347000
2008-08-19T21:53:38.443000
17,054
17,062
Sockets in Pascal
How do you use network sockets in Pascal? ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
Here's an example taken from http://www.bastisoft.de/programmierung/pascal/pasinet.html program daytime; { Simple client program } uses sockets, inetaux, myerror; const RemotePort: Word = 13; var Sock: LongInt; sAddr: TInetSockAddr; sin, sout: Text; Line: String; begin if ParamCount = 0 then GenError('Supply IP ad...
Sockets in Pascal How do you use network sockets in Pascal? ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
TITLE: Sockets in Pascal QUESTION: How do you use network sockets in Pascal? ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ ANSWER: Here's an example taken from http://www.bastisoft.de/programmierung/pascal/pasinet.html program daytime; { Simple client program } uses sockets, inetaux, myerror; const RemotePort...
[ "sockets", "pascal" ]
3
5
7,930
4
0
2008-08-19T22:02:21.360000
2008-08-19T22:09:15.207000
17,056
18,226
SQL Server Full Text Searching
I'm currently working on an application where we have a SQL-Server database and I need to get a full text search working that allows us to search people's names. Currently the user can enter a into a name field that searches 3 different varchar cols. First, Last, Middle names So say I have 3 rows with the following inf...
Thanks for the responses guys I finally was able to get it to work. With part of both Biri, and Kibbee's answers. I needed to add * to the string and break it up on spaces in order to work. So in the end I got.... @Name nvarchar(100),.... --""s added to prevent crash if searching on more then one word. DECLARE @SearchS...
SQL Server Full Text Searching I'm currently working on an application where we have a SQL-Server database and I need to get a full text search working that allows us to search people's names. Currently the user can enter a into a name field that searches 3 different varchar cols. First, Last, Middle names So say I hav...
TITLE: SQL Server Full Text Searching QUESTION: I'm currently working on an application where we have a SQL-Server database and I need to get a full text search working that allows us to search people's names. Currently the user can enter a into a name field that searches 3 different varchar cols. First, Last, Middle ...
[ "sql-server", "search", "full-text-search" ]
13
4
3,926
5
0
2008-08-19T22:04:13.627000
2008-08-20T15:28:21.450000
17,057
17,068
What is the best way to gzip and cache static images in Asp.net mvc
I'm trying to find the best way to speed up the delivery of the static images that compose the design of an mvc site. The images are not gzipped, nor cached in the server or on the client (with content expire). Options are: Find why images are not cached and gzipped direcly from IIS6 Write a specialized http handler Re...
Best solution is to let IIS do it. IIS6 Compression - most likely you need to specify file types to be compressed like.jpg,.png,.gif types, etc. Caching will come from making sure that the correct headers are being sent to the client from code, and i believe there is a setting you can set in IIS that enables it for sta...
What is the best way to gzip and cache static images in Asp.net mvc I'm trying to find the best way to speed up the delivery of the static images that compose the design of an mvc site. The images are not gzipped, nor cached in the server or on the client (with content expire). Options are: Find why images are not cach...
TITLE: What is the best way to gzip and cache static images in Asp.net mvc QUESTION: I'm trying to find the best way to speed up the delivery of the static images that compose the design of an mvc site. The images are not gzipped, nor cached in the server or on the client (with content expire). Options are: Find why i...
[ "asp.net", "asp.net-mvc", ".net-2.0", "gzip" ]
4
3
2,313
3
0
2008-08-19T22:05:00.130000
2008-08-19T22:11:31.707000
17,106
28,121
How to generate sample XML documents from their DTD or XSD?
We are developing an application that involves a substantial amount of XML transformations. We do not have any proper input test data per se, only DTD or XSD files. We'd like to generate our test data ourselves from these files. Is there an easy/free way to do that? Edit There are apparently no free tools for this, and...
I think Oxygen ( http://www.oxygenxml.com/ ) does it as well, but that's another commerical product. It's a nice one, though... I'd strongly recommend it for anyone doing a lot of XML work. It comes in a nice Eclipse plugin, too. I do believe there is a free, fully-featured 30 day trial.
How to generate sample XML documents from their DTD or XSD? We are developing an application that involves a substantial amount of XML transformations. We do not have any proper input test data per se, only DTD or XSD files. We'd like to generate our test data ourselves from these files. Is there an easy/free way to do...
TITLE: How to generate sample XML documents from their DTD or XSD? QUESTION: We are developing an application that involves a substantial amount of XML transformations. We do not have any proper input test data per se, only DTD or XSD files. We'd like to generate our test data ourselves from these files. Is there an e...
[ "xml", "xsd", "dtd", "test-data" ]
205
31
276,254
19
0
2008-08-19T22:29:47.840000
2008-08-26T14:05:46.763000
17,108
17,120
Where to start with CruiseControl.NET
I'm setting up my team's source control + build/integration process from scratch. We were using VSS and a tool we created in-house to perform the build process. We decided to move on to a more modern environment. I have the SVN running, and I would like to set a continuous integration process with CruiseControl.NET. Is...
Before leveraging CruiseControl to it's fullest extent, you need to create an automated build script that can be run by msbuild or nant. After you get your project building in one step, then you can start integrating CruiseControl into the mix. Here are some resources to help get you started: CruiseControl.net Wiki - A...
Where to start with CruiseControl.NET I'm setting up my team's source control + build/integration process from scratch. We were using VSS and a tool we created in-house to perform the build process. We decided to move on to a more modern environment. I have the SVN running, and I would like to set a continuous integrat...
TITLE: Where to start with CruiseControl.NET QUESTION: I'm setting up my team's source control + build/integration process from scratch. We were using VSS and a tool we created in-house to perform the build process. We decided to move on to a more modern environment. I have the SVN running, and I would like to set a c...
[ "continuous-integration", "cruisecontrol.net" ]
4
6
701
6
0
2008-08-19T22:31:40.443000
2008-08-19T22:40:00.187000
17,117
19,609
C++ std::tr2 for VS2005
Is Boost the only way for VS2005 users experience TR2? Also is there a idiot proof way of downloading only the TR2 related packages? I was looking at the boost installer provided by BoostPro Consulting. If I select the options for all the threading options with all the packages for MSVC8 it requires 1.1GB. While I am n...
I believe you're actually referring to TR1, rather than TR2. The call for proposals for TR2 is open, but don't expect to see much movement until the new C++ standard is out. Also, although boost is a provider of an implementation of TR1, dinkumware and the GNU FSF are other providers - on VC2005 boost is probably the e...
C++ std::tr2 for VS2005 Is Boost the only way for VS2005 users experience TR2? Also is there a idiot proof way of downloading only the TR2 related packages? I was looking at the boost installer provided by BoostPro Consulting. If I select the options for all the threading options with all the packages for MSVC8 it requ...
TITLE: C++ std::tr2 for VS2005 QUESTION: Is Boost the only way for VS2005 users experience TR2? Also is there a idiot proof way of downloading only the TR2 related packages? I was looking at the boost installer provided by BoostPro Consulting. If I select the options for all the threading options with all the packages...
[ "c++", "boost", "visual-studio-2005", "c++-tr2" ]
6
4
1,607
4
0
2008-08-19T22:35:25.830000
2008-08-21T10:55:26.947000
17,125
1,692,705
What are real life applications of yield?
I know what yield does, and I've seen a few examples, but I can't think of real life applications, have you used it to solve some specific problem? (Ideally some problem that cannot be solved some other way)
I realise this is an old question (pre Jon Skeet?) but I have been considering this question myself just lately. Unfortunately the current answers here (in my opinion) don't mention the most obvious advantage of the yield statement. The biggest benefit of the yield statement is that it allows you to iterate over very l...
What are real life applications of yield? I know what yield does, and I've seen a few examples, but I can't think of real life applications, have you used it to solve some specific problem? (Ideally some problem that cannot be solved some other way)
TITLE: What are real life applications of yield? QUESTION: I know what yield does, and I've seen a few examples, but I can't think of real life applications, have you used it to solve some specific problem? (Ideally some problem that cannot be solved some other way) ANSWER: I realise this is an old question (pre Jon ...
[ "c#", ".net", "yield" ]
15
13
3,267
7
0
2008-08-19T22:45:19.300000
2009-11-07T11:05:37.280000
17,127
67,969
Can you link 68K code compiled with CodeWarrior for Palm OS with code compiled with PRC-Tools (GCC)?
I've got a Palm OS/Garnet 68K application that uses a third-party static library built with CodeWarrior. Can I rebuilt the application using PRC-Tools, the port of GCC for the Palm OS platform and still link with the third-party library?
(Expanding on Ben's original answer... not sure of the exact etiquette for that but I can't edit yet so I'll re-post) No, CodeWarrior uses a different object file format than PRC-Tools. Also, the compiler support libraries are different, so even if the code could be statically linked together, it may use symbols in a d...
Can you link 68K code compiled with CodeWarrior for Palm OS with code compiled with PRC-Tools (GCC)? I've got a Palm OS/Garnet 68K application that uses a third-party static library built with CodeWarrior. Can I rebuilt the application using PRC-Tools, the port of GCC for the Palm OS platform and still link with the th...
TITLE: Can you link 68K code compiled with CodeWarrior for Palm OS with code compiled with PRC-Tools (GCC)? QUESTION: I've got a Palm OS/Garnet 68K application that uses a third-party static library built with CodeWarrior. Can I rebuilt the application using PRC-Tools, the port of GCC for the Palm OS platform and stil...
[ "palm-os", "garnet-os", "codewarrior", "prc-tools" ]
3
4
464
2
0
2008-08-19T22:46:21.157000
2008-09-15T23:37:00.607000
17,170
17,295
When to use IList and when to use List
I know that IList is the interface and List is the concrete type but I still don't know when to use each one. What I'm doing now is if I don't need the Sort or FindAll methods I use the interface. Am I right? Is there a better way to decide when to use the interface or the concrete type?
There are two rules I follow: Accept the most basic type that will work Return the richest type your user will need So when writing a function or method that takes a collection, write it not to take a List, but an IList, an ICollection, or IEnumerable. The generic interfaces will still work even for heterogenous lists ...
When to use IList and when to use List I know that IList is the interface and List is the concrete type but I still don't know when to use each one. What I'm doing now is if I don't need the Sort or FindAll methods I use the interface. Am I right? Is there a better way to decide when to use the interface or the concret...
TITLE: When to use IList and when to use List QUESTION: I know that IList is the interface and List is the concrete type but I still don't know when to use each one. What I'm doing now is if I don't need the Sort or FindAll methods I use the interface. Am I right? Is there a better way to decide when to use the interf...
[ "c#", ".net" ]
211
209
182,582
12
0
2008-08-19T23:09:54.720000
2008-08-20T01:33:16.293000
17,172
17,178
Implementing permissions in PHP
I've tried to do this several times with no luck. After reading this post, it made me interested in doing this again. So can anyone tell me why the following doesn't work?
Use the bitwise OR operator (|) to set bits, use the AND operator (&) to check bits. Your code should look like this: If you don't understand binary and exactly what the bitwise operators do, you should go learn it. You'll understand how to do this much better.
Implementing permissions in PHP I've tried to do this several times with no luck. After reading this post, it made me interested in doing this again. So can anyone tell me why the following doesn't work?
TITLE: Implementing permissions in PHP QUESTION: I've tried to do this several times with no luck. After reading this post, it made me interested in doing this again. So can anyone tell me why the following doesn't work? ANSWER: Use the bitwise OR operator (|) to set bits, use the AND operator (&) to check bits. Your...
[ "php", "permissions" ]
8
11
1,304
10
0
2008-08-19T23:11:49.613000
2008-08-19T23:17:43.110000
17,175
17,218
What's your top feature request for Silverlight?
I'll take away the obvious one here: mic and webcam support. Other than that, if you ran the Silverlight team, what would your highest priority be for Silverlight v.Next? Disclaimer: If we get some good responses, I'll pass them along to folks I know on the Silverlight team. UPDATE: The best place to report Silverlight...
SQL Compact Edition running on the Silverlight CLR Support for Triggers Support for resource dictionaries Also, since you brought up Webcam I have to plug my Silverlight 2 Webcam Support POC. It's using Flash interop and allows you to capture PNG stills from Silverlight. I guess it's more a fun example of Silverlight, ...
What's your top feature request for Silverlight? I'll take away the obvious one here: mic and webcam support. Other than that, if you ran the Silverlight team, what would your highest priority be for Silverlight v.Next? Disclaimer: If we get some good responses, I'll pass them along to folks I know on the Silverlight t...
TITLE: What's your top feature request for Silverlight? QUESTION: I'll take away the obvious one here: mic and webcam support. Other than that, if you ran the Silverlight team, what would your highest priority be for Silverlight v.Next? Disclaimer: If we get some good responses, I'll pass them along to folks I know on...
[ ".net", "silverlight", "silverlight-3.0" ]
12
8
1,900
25
0
2008-08-19T23:16:20.723000
2008-08-19T23:41:34.503000
17,194
17,290
SQL query to compare product sales by month
I have a Monthly Status database view I need to build a report based on. The data in the view looks something like this: Category | Revenue | Yearh | Month Bikes 10 000 2008 1 Bikes 12 000 2008 2 Bikes 12 000 2008 3 Bikes 15 000 2008 1 Bikes 11 000 2007 2 Bikes 11 500 2007 3 Bikes 15 400 2007 4... And so forth The view...
The Case Statement is my best sql friend. You also need a table for time to generate your 0 rev in both months. Assumptions are based on the availability of following tables: sales: Category | Revenue | Yearh | Month and tm: Year | Month (populated with all dates required for reporting) Example 1 without empty rows: se...
SQL query to compare product sales by month I have a Monthly Status database view I need to build a report based on. The data in the view looks something like this: Category | Revenue | Yearh | Month Bikes 10 000 2008 1 Bikes 12 000 2008 2 Bikes 12 000 2008 3 Bikes 15 000 2008 1 Bikes 11 000 2007 2 Bikes 11 500 2007 3 ...
TITLE: SQL query to compare product sales by month QUESTION: I have a Monthly Status database view I need to build a report based on. The data in the view looks something like this: Category | Revenue | Yearh | Month Bikes 10 000 2008 1 Bikes 12 000 2008 2 Bikes 12 000 2008 3 Bikes 15 000 2008 1 Bikes 11 000 2007 2 Bi...
[ "sql", "sql-server", "sql-server-2005", "reporting" ]
5
5
71,710
6
0
2008-08-19T23:24:47.460000
2008-08-20T01:28:08.567000
17,225
17,293
How can Perl's system() print the command that it's running?
In Perl, you can execute system commands using system() or `` (backticks). You can even capture the output of the command into a variable. However, this hides the program execution in the background so that the person executing your script can't see it. Normally this is useful but sometimes I want to see what is going ...
As I understand, system() will print the result of the command, but not assign it. Eg. [daniel@tux /]$ perl -e '$ls = system("ls"); print "Result: $ls\n"' bin dev home lost+found misc net proc sbin srv System tools var boot etc lib media mnt opt root selinux sys tmp usr Result: 0 Backticks will capture the output of th...
How can Perl's system() print the command that it's running? In Perl, you can execute system commands using system() or `` (backticks). You can even capture the output of the command into a variable. However, this hides the program execution in the background so that the person executing your script can't see it. Norma...
TITLE: How can Perl's system() print the command that it's running? QUESTION: In Perl, you can execute system commands using system() or `` (backticks). You can even capture the output of the command into a variable. However, this hides the program execution in the background so that the person executing your script c...
[ "perl", "system" ]
12
10
35,833
6
0
2008-08-19T23:47:00.947000
2008-08-20T01:30:36.597000
17,231
17,367
Why shouldn't I "bet the future of the company" on shell scripts?
I was looking at http://tldp.org/LDP/abs/html/why-shell.html and was struck by: When not to use shell scripts... Mission-critical applications upon which you are betting the future of the company Why not?
Using shell scripts is fine when you're using their strengths. My company has some class 5 soft switches and the call processing code and the provisioning interface is written in java. Everything else is written in KSH - DB dumps for backups, pruning, log file rotation, and all the automated reporting. I would argue th...
Why shouldn't I "bet the future of the company" on shell scripts? I was looking at http://tldp.org/LDP/abs/html/why-shell.html and was struck by: When not to use shell scripts... Mission-critical applications upon which you are betting the future of the company Why not?
TITLE: Why shouldn't I "bet the future of the company" on shell scripts? QUESTION: I was looking at http://tldp.org/LDP/abs/html/why-shell.html and was struck by: When not to use shell scripts... Mission-critical applications upon which you are betting the future of the company Why not? ANSWER: Using shell scripts is...
[ "bash", "shell", "ksh" ]
5
15
4,325
9
0
2008-08-19T23:50:47.040000
2008-08-20T03:12:01.313000
17,289
17,323
iFrame Best Practices
I have a large, hi-def JavaScript-intensive image banner for a site I'm designing. What is everyone's opinion of using iframes so that you incur the load time only once? Is there a CSS alternative to the iframe? Feel free to preview the site. It is very much a work in progress. ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
I should also have mentioned that I would like the banner rotation to keep moving. When the visitor clicks on a link, the banner rotation starts over. It would be nice if the "animation" kept rotating, regardless of the page the user visits.Blockquote Well, in that case I would strongly recommend not doing that. The on...
iFrame Best Practices I have a large, hi-def JavaScript-intensive image banner for a site I'm designing. What is everyone's opinion of using iframes so that you incur the load time only once? Is there a CSS alternative to the iframe? Feel free to preview the site. It is very much a work in progress. ­­­­­­­­­­­­­­­­­­­...
TITLE: iFrame Best Practices QUESTION: I have a large, hi-def JavaScript-intensive image banner for a site I'm designing. What is everyone's opinion of using iframes so that you incur the load time only once? Is there a CSS alternative to the iframe? Feel free to preview the site. It is very much a work in progress. ­...
[ "html", "css", "iframe" ]
8
1
5,156
6
0
2008-08-20T01:28:00.907000
2008-08-20T02:00:59.470000
17,299
17,312
How can I sort an array of double pointers based on the values they point to?
I am trying to build a function in C/C++ to sort an array and replace each value with its "score" or rank. It takes in a double pointer array to an array of ints, and sorts the double pointers based on the dereferenced value of the integers. I have tried quite a few times to make it work, but can't get it down. Once ag...
You're close. You're referencing the address of the array items when you swap, which isn't necessary. The items in the array are pointers, and that's what needs to be swapped. See below: void SortArray( int ** pArray, int ArrayLength ) { int i, j, flag = 1; // set flag to 1 to begin initial pass int * temp; // holding ...
How can I sort an array of double pointers based on the values they point to? I am trying to build a function in C/C++ to sort an array and replace each value with its "score" or rank. It takes in a double pointer array to an array of ints, and sorts the double pointers based on the dereferenced value of the integers. ...
TITLE: How can I sort an array of double pointers based on the values they point to? QUESTION: I am trying to build a function in C/C++ to sort an array and replace each value with its "score" or rank. It takes in a double pointer array to an array of ints, and sorts the double pointers based on the dereferenced value...
[ "c++", "c", "arrays", "pointers", "reference" ]
1
5
4,401
5
0
2008-08-20T01:44:58.323000
2008-08-20T01:53:47.837000
17,320
17,345
What areas of specialization within programming would you recommend to a beginner
I am a student studying software development, and I feel programming, in general, is too broad of a subject to try to know everything. To be proficient, you have to decide which areas to focus your learning and understanding. Certain skill sets synergize with each other, like data-driven web development and SQL experie...
Ben, Almost all seasoned programmers are still students in programming. You never stops learning anything when you are a developer. But if you are really starting off on your career then you should be least worried about the specialization thing. All APIs, frameworks and skills that you expect that gives you a long ter...
What areas of specialization within programming would you recommend to a beginner I am a student studying software development, and I feel programming, in general, is too broad of a subject to try to know everything. To be proficient, you have to decide which areas to focus your learning and understanding. Certain skil...
TITLE: What areas of specialization within programming would you recommend to a beginner QUESTION: I am a student studying software development, and I feel programming, in general, is too broad of a subject to try to know everything. To be proficient, you have to decide which areas to focus your learning and understan...
[ "language-agnostic" ]
8
21
8,788
6
0
2008-08-20T01:59:08.710000
2008-08-20T02:20:32.873000
17,352
17,390
What are OpenGL extensions, and what are the benefits/tradeoffs of using them?
In relation to this question on Using OpenGL extensions, what's the purpose of these extension functions? Why would I want to use them? Further, are there any tradeoffs or gotchas associated with using them?
The OpenGL standard allows individual vendors to provide additional functionality through extensions as new technology is created. Extensions may introduce new functions and new constants, and may relax or remove restrictions on existing OpenGL functions. Each vendor has an alphabetic abbreviation that is used in namin...
What are OpenGL extensions, and what are the benefits/tradeoffs of using them? In relation to this question on Using OpenGL extensions, what's the purpose of these extension functions? Why would I want to use them? Further, are there any tradeoffs or gotchas associated with using them?
TITLE: What are OpenGL extensions, and what are the benefits/tradeoffs of using them? QUESTION: In relation to this question on Using OpenGL extensions, what's the purpose of these extension functions? Why would I want to use them? Further, are there any tradeoffs or gotchas associated with using them? ANSWER: The Op...
[ "opengl" ]
17
24
5,077
3
0
2008-08-20T02:40:40.953000
2008-08-20T03:43:32.627000
17,370
17,371
Using GLEW to use OpenGL extensions under Windows
I've been using OpenGL extensions on Windows the painful way. Is GLEW the easier way to go? How do I get started with it?
Yes, the OpenGL Extension Wrangler Library (GLEW) is a painless way to use OpenGL extensions on Windows. Here's how to get started on it: Identify the OpenGL extension and the extension APIs you wish to use. OpenGL extensions are listed in the OpenGL Extension Registry. Check if your graphic card supports the extension...
Using GLEW to use OpenGL extensions under Windows I've been using OpenGL extensions on Windows the painful way. Is GLEW the easier way to go? How do I get started with it?
TITLE: Using GLEW to use OpenGL extensions under Windows QUESTION: I've been using OpenGL extensions on Windows the painful way. Is GLEW the easier way to go? How do I get started with it? ANSWER: Yes, the OpenGL Extension Wrangler Library (GLEW) is a painless way to use OpenGL extensions on Windows. Here's how to ge...
[ "opengl", "glew" ]
24
40
46,425
3
0
2008-08-20T03:19:34.400000
2008-08-20T03:19:50.827000
17,373
27,791
How do I open the default mail program with a Subject and Body in a cross-platform way?
How do I open the default mail program with a Subject and Body in a cross-platform way? Unfortunately, this is for a a client app written in Java, not a website. I would like this to work in a cross-platform way (which means Windows and Mac, sorry Linux). I am happy to execute a VBScript in Windows, or AppleScript in O...
In Java 1.6 you have a stardard way to open the default mailer of the platform: the Desktop.mail(URI) method.The URI can be used to set all the fields of the mail (sender, recipients, body, subject). You can check a full example of desktop integration in Java 1.6 on Using the Desktop API in Java SE 6
How do I open the default mail program with a Subject and Body in a cross-platform way? How do I open the default mail program with a Subject and Body in a cross-platform way? Unfortunately, this is for a a client app written in Java, not a website. I would like this to work in a cross-platform way (which means Windows...
TITLE: How do I open the default mail program with a Subject and Body in a cross-platform way? QUESTION: How do I open the default mail program with a Subject and Body in a cross-platform way? Unfortunately, this is for a a client app written in Java, not a website. I would like this to work in a cross-platform way (w...
[ "java", "windows", "macos", "email" ]
13
10
18,952
9
0
2008-08-20T03:20:02.090000
2008-08-26T11:38:21.250000
17,376
17,414
How would you implement FORM based authentication without a backing database?
I have a PHP script that runs as a CGI program and the HTTP Authenticate header gets eaten and spit out. So I would like to implement some kind of FORM based authentication. As an added constraint, there is no database so no session data can be stored. I am very open to having a master username and password. I just nee...
A few ways you could do this. htaccess -- have your webserver handle securing the pages in question (not exactly cgi form based though). Use cookies and some sort of hashing algorithm (md5 is good enough) to store the passwords in a flat file where each line in the file is username:passwordhash. Make sure to salt your ...
How would you implement FORM based authentication without a backing database? I have a PHP script that runs as a CGI program and the HTTP Authenticate header gets eaten and spit out. So I would like to implement some kind of FORM based authentication. As an added constraint, there is no database so no session data can ...
TITLE: How would you implement FORM based authentication without a backing database? QUESTION: I have a PHP script that runs as a CGI program and the HTTP Authenticate header gets eaten and spit out. So I would like to implement some kind of FORM based authentication. As an added constraint, there is no database so no...
[ "php", "http", "authentication", "cookies", "cgi" ]
6
5
3,557
4
0
2008-08-20T03:27:08.343000
2008-08-20T04:37:35.243000
17,387
222,016
Privatizing a BlogEngine.Net Installation
I have a blogengine.net install that requires privatization. I'm doing research work at the moment, but I have to keep my blog/journal private until certain conditions are met. How can I privatize my blogEngine.net install so that readers must log in to read my posts?
I use this extension. Just save the file as RequireLogin.cs in your App_Code\Extensions folder and make sure the extension is activated. using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.We...
Privatizing a BlogEngine.Net Installation I have a blogengine.net install that requires privatization. I'm doing research work at the moment, but I have to keep my blog/journal private until certain conditions are met. How can I privatize my blogEngine.net install so that readers must log in to read my posts?
TITLE: Privatizing a BlogEngine.Net Installation QUESTION: I have a blogengine.net install that requires privatization. I'm doing research work at the moment, but I have to keep my blog/journal private until certain conditions are met. How can I privatize my blogEngine.net install so that readers must log in to read m...
[ "c#", ".net", "asp.net", "blogs" ]
4
1
1,384
5
0
2008-08-20T03:39:30.857000
2008-10-21T14:10:39.260000
17,434
17,443
When should you use 'friend' in C++?
I have been reading through the C++ FAQ and was curious about the friend declaration. I personally have never used it, however I am interested in exploring the language. What is a good example of using friend? Reading the FAQ a bit longer I like the idea of the << >> operator overloading and adding as a friend of those...
Firstly (IMO) don't listen to people who say friend is not useful. It IS useful. In many situations you will have objects with data or functionality that are not intended to be publicly available. This is particularly true of large codebases with many authors who may only be superficially familiar with different areas....
When should you use 'friend' in C++? I have been reading through the C++ FAQ and was curious about the friend declaration. I personally have never used it, however I am interested in exploring the language. What is a good example of using friend? Reading the FAQ a bit longer I like the idea of the << >> operator overlo...
TITLE: When should you use 'friend' in C++? QUESTION: I have been reading through the C++ FAQ and was curious about the friend declaration. I personally have never used it, however I am interested in exploring the language. What is a good example of using friend? Reading the FAQ a bit longer I like the idea of the << ...
[ "c++", "oop", "encapsulation", "friend" ]
399
372
193,185
31
0
2008-08-20T05:29:32.793000
2008-08-20T05:48:22.717000
17,469
17,589
IE6 - can't load a normal JPG
Try loading this normal.jpg file in Internet Explorer 6.0. I get an error saying the picture won't load. Try it in any other browser and it works fine. What's wrong? The.jpg file is just a normal picture sitting on the web server. I can even create a simple web page: blah and use right click + save target as with IE6 t...
The JPG you uploaded is in CMYK, IE and Firefox versions before 3 can't read these. Open it using Photoshop (or anything similar, I'm sure GIMP would work too) and resave it in RGB. edit: Further Googling makes me suspect that CMYK isn't really a part of the jpeg standard, but can be shoehorned in there. That's why som...
IE6 - can't load a normal JPG Try loading this normal.jpg file in Internet Explorer 6.0. I get an error saying the picture won't load. Try it in any other browser and it works fine. What's wrong? The.jpg file is just a normal picture sitting on the web server. I can even create a simple web page: blah and use right cli...
TITLE: IE6 - can't load a normal JPG QUESTION: Try loading this normal.jpg file in Internet Explorer 6.0. I get an error saying the picture won't load. Try it in any other browser and it works fine. What's wrong? The.jpg file is just a normal picture sitting on the web server. I can even create a simple web page: blah...
[ "internet-explorer", "image", "rgb", "jpeg", "cmyk" ]
10
29
6,559
6
0
2008-08-20T06:34:31.640000
2008-08-20T08:24:28.270000
17,483
17,486
Is there a way to prevent a method from being overridden in subclasses?
Is anyone aware of a language feature or technique in C++ to prevent a child class from over riding a particular method in the parent class? class Base { public: bool someGuaranteedResult() { return true; } }; class Child: public Base { public: bool someGuaranteedResult() { return false; /* Haha I broke things! */ } }...
A couple of ideas: Make your function private. Do not make your function virtual. This doesn't actually prevent the function from being shadowed by another definition though. Other than that, I'm not aware of a language feature that will lock away your function in such a way which prevents it from being overloaded and ...
Is there a way to prevent a method from being overridden in subclasses? Is anyone aware of a language feature or technique in C++ to prevent a child class from over riding a particular method in the parent class? class Base { public: bool someGuaranteedResult() { return true; } }; class Child: public Base { public: bo...
TITLE: Is there a way to prevent a method from being overridden in subclasses? QUESTION: Is anyone aware of a language feature or technique in C++ to prevent a child class from over riding a particular method in the parent class? class Base { public: bool someGuaranteedResult() { return true; } }; class Child: public...
[ "c++", "overriding", "metrowerks" ]
41
15
23,307
14
0
2008-08-20T06:50:32.910000
2008-08-20T06:53:40.533000
17,500
158,065
Why are DispatcherObject.CheckAccess() and VerifyAccess() hidden from Intellisense?
The System.Windows.Threading.DispatcherObject class (which DependencyObject is based on) contains a useful function, called CheckAccess(), that determines whether or not the code is running on the UI thread. When I wanted to use it yesterday, I was puzzled to find out that Intellisense didn't show the function (nor Ver...
A Microsoft employee recently stated CheckAccess is used only for "advanced scenarios", so they hid it from Intellisense. "CheckAccess and VerifyAccess have always been marked to be not visible, maybe IntelliSense wasn't respecting it. You can use Reflector to confirm. The idea here is that CheckAccess and VerifyAccess...
Why are DispatcherObject.CheckAccess() and VerifyAccess() hidden from Intellisense? The System.Windows.Threading.DispatcherObject class (which DependencyObject is based on) contains a useful function, called CheckAccess(), that determines whether or not the code is running on the UI thread. When I wanted to use it yest...
TITLE: Why are DispatcherObject.CheckAccess() and VerifyAccess() hidden from Intellisense? QUESTION: The System.Windows.Threading.DispatcherObject class (which DependencyObject is based on) contains a useful function, called CheckAccess(), that determines whether or not the code is running on the UI thread. When I wan...
[ ".net-3.5", "intellisense" ]
22
9
2,448
2
0
2008-08-20T07:07:30.030000
2008-10-01T14:59:31.647000
17,532
17,542
ASP.NET Custom Controls - Composites
Summary Hi All, OK, further into my adventures with custom controls... In summary, here is that I have learned of three main "classes" of custom controls. Please feel free to correct me if any of this is wrong! UserControls - Which inherit from UserControl and are contained within an ASCX file. These are pretty limited...
I say go ahead with the custom rendered control. I find that in most cases the composite can be easier done and used in a UserControl, but anything beyond that and you'd need to have a finer degree of control (pun unintended) to merit your own rendering strategy. There maybe controls that are simple enough to merit a c...
ASP.NET Custom Controls - Composites Summary Hi All, OK, further into my adventures with custom controls... In summary, here is that I have learned of three main "classes" of custom controls. Please feel free to correct me if any of this is wrong! UserControls - Which inherit from UserControl and are contained within a...
TITLE: ASP.NET Custom Controls - Composites QUESTION: Summary Hi All, OK, further into my adventures with custom controls... In summary, here is that I have learned of three main "classes" of custom controls. Please feel free to correct me if any of this is wrong! UserControls - Which inherit from UserControl and are ...
[ "c#", ".net", "asp.net", "user-controls", "controls" ]
19
5
4,239
6
0
2008-08-20T07:49:06.967000
2008-08-20T07:53:32.230000
17,533
90,442
Request Windows Vista UAC elevation if path is protected?
For my C# app, I don't want to always prompt for elevation on application start, but if they choose an output path that is UAC protected then I need to request elevation. So, how do I check if a path is UAC protected and then how do I request elevation mid-execution?
The best way to detect if they are unable to perform an action is to attempt it and catch the UnauthorizedAccessException. However as @ DannySmurf correctly points out you can only elevate a COM object or separate process. There is a demonstration application within the Windows SDK Cross Technology Samples called UAC D...
Request Windows Vista UAC elevation if path is protected? For my C# app, I don't want to always prompt for elevation on application start, but if they choose an output path that is UAC protected then I need to request elevation. So, how do I check if a path is UAC protected and then how do I request elevation mid-execu...
TITLE: Request Windows Vista UAC elevation if path is protected? QUESTION: For my C# app, I don't want to always prompt for elevation on application start, but if they choose an output path that is UAC protected then I need to request elevation. So, how do I check if a path is UAC protected and then how do I request e...
[ "c#", ".net", "windows-vista", "uac", "elevated-privileges" ]
27
25
15,180
6
0
2008-08-20T07:50:29.350000
2008-09-18T06:10:20.783000
17,561
17,616
Recommendations for browser add-on tools to help with development
Can anyone suggest some good browser add-on tools/extensions to help with development? I have firebug installed in Firefox which is great for dealing with CSS, HTML and javascript; any other suggestions? Firebug
Firefox: Inspect This if you use the DOM Inspector at all Measure It for telling you pixel distances (if you need that) IE View or Safari View for ease of testing in other browsers HTML Validator if you care about validation Console 2 to improve your js error console The Javascript Shell bookmarklet is also handy (and ...
Recommendations for browser add-on tools to help with development Can anyone suggest some good browser add-on tools/extensions to help with development? I have firebug installed in Firefox which is great for dealing with CSS, HTML and javascript; any other suggestions? Firebug
TITLE: Recommendations for browser add-on tools to help with development QUESTION: Can anyone suggest some good browser add-on tools/extensions to help with development? I have firebug installed in Firefox which is great for dealing with CSS, HTML and javascript; any other suggestions? Firebug ANSWER: Firefox: Inspec...
[ "browser" ]
7
5
838
12
0
2008-08-20T08:09:38.010000
2008-08-20T08:46:13.537000
17,609
17,617
Email queueing in php
What is the most proper way to sending email of minimal 1000 or more in PHP? Any reliable email queuing technique that is capable to handle that? ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
You could just insert your emails into a Mail Queue database table, and have a separate process check the queue and batch send a certain number at once.
Email queueing in php What is the most proper way to sending email of minimal 1000 or more in PHP? Any reliable email queuing technique that is capable to handle that? ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
TITLE: Email queueing in php QUESTION: What is the most proper way to sending email of minimal 1000 or more in PHP? Any reliable email queuing technique that is capable to handle that? ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ ANSWER: You could just insert your emails into a Mail Queue database table, and have a separate pr...
[ "php", "email", "queue" ]
5
6
7,164
7
0
2008-08-20T08:38:24.803000
2008-08-20T08:46:49.933000
17,612
17,620
How do you place a file in recycle bin instead of delete?
Programmatic solution of course...
http://www.daveamenta.com/2008-05/c-delete-a-file-to-the-recycle-bin/ From above: using Microsoft.VisualBasic; string path = @"c:\myfile.txt"; FileIO.FileSystem.DeleteDirectory(path, FileIO.UIOption.OnlyErrorDialogs, RecycleOption.SendToRecycleBin);
How do you place a file in recycle bin instead of delete? Programmatic solution of course...
TITLE: How do you place a file in recycle bin instead of delete? QUESTION: Programmatic solution of course... ANSWER: http://www.daveamenta.com/2008-05/c-delete-a-file-to-the-recycle-bin/ From above: using Microsoft.VisualBasic; string path = @"c:\myfile.txt"; FileIO.FileSystem.DeleteDirectory(path, FileIO.UIOption....
[ "c#", ".net", "c++", "windows", "io" ]
29
38
11,640
3
0
2008-08-20T08:43:00.393000
2008-08-20T08:48:07.073000
17,624
17,627
What is the easiest way using T-SQL / MS-SQL to append a string to existing table cells?
I have a table with a 'filename' column. I recently performed an insert into this column but in my haste forgot to append the file extension to all the filenames entered. Fortunately they are all '.jpg' images. How can I easily update the 'filename' column of these inserted fields (assuming I can select the recent rows...
The solution is: UPDATE tablename SET [filename] = RTRIM([filename]) + '.jpg' WHERE id > 50 RTRIM is required because otherwise the [filename] column in its entirety will be selected for the string concatenation i.e. if it is a varchar(20) column and filename is only 10 letters long then it will still select those 10 l...
What is the easiest way using T-SQL / MS-SQL to append a string to existing table cells? I have a table with a 'filename' column. I recently performed an insert into this column but in my haste forgot to append the file extension to all the filenames entered. Fortunately they are all '.jpg' images. How can I easily upd...
TITLE: What is the easiest way using T-SQL / MS-SQL to append a string to existing table cells? QUESTION: I have a table with a 'filename' column. I recently performed an insert into this column but in my haste forgot to append the file extension to all the filenames entered. Fortunately they are all '.jpg' images. Ho...
[ "sql", "sql-server", "t-sql" ]
11
27
25,754
6
0
2008-08-20T08:52:00.497000
2008-08-20T08:54:43.220000
17,645
17,649
Differences between unix and windows files
Am I correct in assuming that the only difference between "windows files" and "unix files" is the linebreak? We have a system that has been moved from a windows machine to a unix machine and are having troubles with the format. I need to automate the translation between unix/windows before the files get delivered to th...
This is only a difference in text files, where UNIX uses a single Line Feed (LF) to signify a new line, Windows uses a Carriage Return/Line Feed (CRLF) and Mac uses just a CR. Binary files there should be no difference (i.e. a JPEG on a windows machine will be byte for byte the same as the same JPEG on a unix box.)
Differences between unix and windows files Am I correct in assuming that the only difference between "windows files" and "unix files" is the linebreak? We have a system that has been moved from a windows machine to a unix machine and are having troubles with the format. I need to automate the translation between unix/w...
TITLE: Differences between unix and windows files QUESTION: Am I correct in assuming that the only difference between "windows files" and "unix files" is the linebreak? We have a system that has been moved from a windows machine to a unix machine and are having troubles with the format. I need to automate the translat...
[ "java", "windows", "unix", "file" ]
20
13
17,897
6
0
2008-08-20T09:18:44.707000
2008-08-20T09:22:07.477000
17,664
17,698
Retrieving the PC Name of a Client? (Windows Auth)
I have an ASP.net Application that runs on the internal network (well, actually it's running on Sharepoint 2007). I just wonder: Can I somehow retrieve the name of the PC the Client is using? I would have access to Active Directory if that helps. The thing is, people use multiple PCs. So, I cannot use any manual/static...
System.Web.HttpRequest.UserHostname as suggested in this answer just returns the IP:-( But I just found this: System.Net.Dns.GetHostEntry(Page.Request.UserHostAddress).HostName That only works if there is actually a DNS Server to resolve the name, which is the case for my network.
Retrieving the PC Name of a Client? (Windows Auth) I have an ASP.net Application that runs on the internal network (well, actually it's running on Sharepoint 2007). I just wonder: Can I somehow retrieve the name of the PC the Client is using? I would have access to Active Directory if that helps. The thing is, people u...
TITLE: Retrieving the PC Name of a Client? (Windows Auth) QUESTION: I have an ASP.net Application that runs on the internal network (well, actually it's running on Sharepoint 2007). I just wonder: Can I somehow retrieve the name of the PC the Client is using? I would have access to Active Directory if that helps. The ...
[ "asp.net", "sharepoint", "authentication" ]
3
4
1,173
2
0
2008-08-20T09:34:54.887000
2008-08-20T10:05:54.830000
17,670
17,683
Suitable alternative to CryptEncrypt
We have a situation in our product where for a long time some data has been stored in the application's database as SQL string (choice of MS SQL server or sybase SQL anywhere) which was encrypted via the Windows API function CryptEncrypt. (direct and de-cryptable) The problem is that CryptEncrypt can produce NULL's in ...
Any semi-decent algorithm will end up with a strong chance of generating a NULL value somewhere in the resulting ciphertext. Why not do something like base-64 encode your resulting binary blob before persisting to the DB? ( sample implementation in C++ ).
Suitable alternative to CryptEncrypt We have a situation in our product where for a long time some data has been stored in the application's database as SQL string (choice of MS SQL server or sybase SQL anywhere) which was encrypted via the Windows API function CryptEncrypt. (direct and de-cryptable) The problem is tha...
TITLE: Suitable alternative to CryptEncrypt QUESTION: We have a situation in our product where for a long time some data has been stored in the application's database as SQL string (choice of MS SQL server or sybase SQL anywhere) which was encrypted via the Windows API function CryptEncrypt. (direct and de-cryptable) ...
[ "c++", "encryption", "winapi" ]
2
3
832
4
0
2008-08-20T09:37:02.603000
2008-08-20T09:49:56.333000
17,679
17,859
Why does Guid.ToString() reverse the byte order?
We're storing some Guid's in a MS SQL database. There's some legacy code that does Guid.ToString() and then passes them in to a varchar(64) and there's some newer code that passes them in using a unique identifier parameter. When you look at the results using MS SQL Management studio they look different. The byte order...
Uniqueidentifier fields in Sql server can be indexed, and so are 'backwards'. Guids can be generated from both machine specific info and 'event-time' information. The default Guid in.Net is random, but you can get sequential Guids from it with an extern call: [DllImport( "rpcrt4.dll", SetLastError = true )] static exte...
Why does Guid.ToString() reverse the byte order? We're storing some Guid's in a MS SQL database. There's some legacy code that does Guid.ToString() and then passes them in to a varchar(64) and there's some newer code that passes them in using a unique identifier parameter. When you look at the results using MS SQL Mana...
TITLE: Why does Guid.ToString() reverse the byte order? QUESTION: We're storing some Guid's in a MS SQL database. There's some legacy code that does Guid.ToString() and then passes them in to a varchar(64) and there's some newer code that passes them in using a unique identifier parameter. When you look at the results...
[ ".net", "sql-server" ]
9
9
2,625
1
0
2008-08-20T09:44:02.947000
2008-08-20T12:55:52.877000
17,704
17,709
Unix subsystem for windows
One of the bullet point features for Windows Vista Enterprize and Ultimate is the Unix subsystem for windows, which allows you to write posix... stuff? Anyway I'm outa my league talking about it... Anyone use this feature? Or explain it... I know next to nothing about Unix programming.
It's probably best not to try to use the Posix subsystem for Windows. It was never really complete and is just a useless marketing tick box. If you're truly interested in programming stuff for Unix, download one of the many Linux distributions (ie. Ubuntu ) and VirtualBox. Install and start playing.
Unix subsystem for windows One of the bullet point features for Windows Vista Enterprize and Ultimate is the Unix subsystem for windows, which allows you to write posix... stuff? Anyway I'm outa my league talking about it... Anyone use this feature? Or explain it... I know next to nothing about Unix programming.
TITLE: Unix subsystem for windows QUESTION: One of the bullet point features for Windows Vista Enterprize and Ultimate is the Unix subsystem for windows, which allows you to write posix... stuff? Anyway I'm outa my league talking about it... Anyone use this feature? Or explain it... I know next to nothing about Unix p...
[ "windows", "posix" ]
2
4
1,666
5
0
2008-08-20T10:18:36.123000
2008-08-20T10:26:27.573000