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
8,612
8,616
Code crash in MS Visual Studio 2005 in RELEASE configuration
I have a workspace for running an H.263 Video Encoder in a loop for 31 times i.e. the main is executed 31 times to generate 31 different encoded bit streams. This MS Visual Studio 2005 Workspace has all C source files. When i create a "DEBUG" configuration for the workspace and build and execute it, it runs fine, i.e. ...
It's hard to say what the problem might be without carefully inspecting the code. However... One of the differences between debug and release builds is how the function call stack frame is set up. There are certain classes of bad things you can do (like calling a function with the wrong number of arguments) that are no...
Code crash in MS Visual Studio 2005 in RELEASE configuration I have a workspace for running an H.263 Video Encoder in a loop for 31 times i.e. the main is executed 31 times to generate 31 different encoded bit streams. This MS Visual Studio 2005 Workspace has all C source files. When i create a "DEBUG" configuration fo...
TITLE: Code crash in MS Visual Studio 2005 in RELEASE configuration QUESTION: I have a workspace for running an H.263 Video Encoder in a loop for 31 times i.e. the main is executed 31 times to generate 31 different encoded bit streams. This MS Visual Studio 2005 Workspace has all C source files. When i create a "DEBUG...
[ "visual-studio-2005" ]
2
2
1,491
8
0
2008-08-12T08:44:09.600000
2008-08-12T08:51:01.053000
8,624
8,654
Best format for displaying rendered time on a webpage
I've started to add the time taken to render a page to the footer of our internal web applications. Currently it appears like this Rendered in 0.062 seconds Occasionally I get rendered times like this Rendered in 0.000 seconds Currently it's only meant to be a guide for users to judge whether a page is quick to load or...
I'm not sure there's any value in telling users how long it took for the server to render the page. It could well be worth you logging that sort of information, but they don't care. If it takes the server 0.001 of a second to draw the page but it takes 17 seconds for them to load it (due to network, javascript, page si...
Best format for displaying rendered time on a webpage I've started to add the time taken to render a page to the footer of our internal web applications. Currently it appears like this Rendered in 0.062 seconds Occasionally I get rendered times like this Rendered in 0.000 seconds Currently it's only meant to be a guide...
TITLE: Best format for displaying rendered time on a webpage QUESTION: I've started to add the time taken to render a page to the footer of our internal web applications. Currently it appears like this Rendered in 0.062 seconds Occasionally I get rendered times like this Rendered in 0.000 seconds Currently it's only m...
[ "render" ]
2
1
777
4
0
2008-08-12T09:08:05.217000
2008-08-12T10:40:26.590000
8,625
8,633
Generic type conversion FROM string
I have a class that I want to use to store "properties" for another class. These properties simply have a name and a value. Ideally, what I would like is to be able to add typed properties, so that the "value" returned is always of the type that I want it to be. The type should always be a primitive. This class subclas...
I am not sure whether I understood your intentions correctly, but let's see if this one helps. public class TypedProperty: Property where T: IConvertible { public T TypedValue { get { return (T)Convert.ChangeType(base.Value, typeof(T)); } set { base.Value = value.ToString();} } }
Generic type conversion FROM string I have a class that I want to use to store "properties" for another class. These properties simply have a name and a value. Ideally, what I would like is to be able to add typed properties, so that the "value" returned is always of the type that I want it to be. The type should alway...
TITLE: Generic type conversion FROM string QUESTION: I have a class that I want to use to store "properties" for another class. These properties simply have a name and a value. Ideally, what I would like is to be able to add typed properties, so that the "value" returned is always of the type that I want it to be. The...
[ "c#", "generics", "primitive", "type-safety" ]
280
448
179,212
11
0
2008-08-12T09:13:23.520000
2008-08-12T09:24:33.203000
8,626
4,068,900
Globus Toolkit virtual machine
Is there anyplace where one can download a virtual machine containing a working install of some Linux distro with Globus Toolkit and some development tools (Java) for testing purposes? A real deployment of a grid is more complicated but I just need something portable, for development.
The link to http://workspace.globus.org/vm/marketplace.html appears to be broken now. I think the new location is http://scienceclouds.org/marketplace/.
Globus Toolkit virtual machine Is there anyplace where one can download a virtual machine containing a working install of some Linux distro with Globus Toolkit and some development tools (Java) for testing purposes? A real deployment of a grid is more complicated but I just need something portable, for development.
TITLE: Globus Toolkit virtual machine QUESTION: Is there anyplace where one can download a virtual machine containing a working install of some Linux distro with Globus Toolkit and some development tools (Java) for testing purposes? A real deployment of a grid is more complicated but I just need something portable, fo...
[ "linux", "virtual-machine", "globus-toolkit" ]
2
1
1,165
2
0
2008-08-12T09:13:40.773000
2010-11-01T12:36:12.553000
8,651
8,687
Import Namespace System.Query
I am trying to load Linq on my.Net 3.5 enabled web server by adding the following to my.aspx page: <%@ Import Namespace="System.Query" %> However, this fails and tells me it cannot find the namespace. The type or namespace name 'Query' does not exist in the namespace 'System' I have also tried with no luck: System.Data...
I have version 2 selected in IIS and I Well, surely that's your problem? Select 3.5. Actually, here's the real info: http://www.hanselman.com/blog/HowToSetAnIISApplicationOrAppPoolToUseASPNET35RatherThan20.aspx
Import Namespace System.Query I am trying to load Linq on my.Net 3.5 enabled web server by adding the following to my.aspx page: <%@ Import Namespace="System.Query" %> However, this fails and tells me it cannot find the namespace. The type or namespace name 'Query' does not exist in the namespace 'System' I have also t...
TITLE: Import Namespace System.Query QUESTION: I am trying to load Linq on my.Net 3.5 enabled web server by adding the following to my.aspx page: <%@ Import Namespace="System.Query" %> However, this fails and tells me it cannot find the namespace. The type or namespace name 'Query' does not exist in the namespace 'Sys...
[ "asp.net", "linq" ]
4
5
6,784
6
0
2008-08-12T10:37:50.107000
2008-08-12T11:15:29.797000
8,653
8,656
Numerical formatting using String.Format
Are there any codes that allow for numerical formatting of data when using string.format?
Loads, stick string.Format into Google:-) A quite good tutorial is at iduno
Numerical formatting using String.Format Are there any codes that allow for numerical formatting of data when using string.format?
TITLE: Numerical formatting using String.Format QUESTION: Are there any codes that allow for numerical formatting of data when using string.format? ANSWER: Loads, stick string.Format into Google:-) A quite good tutorial is at iduno
[ ".net", "formatting", "numeric" ]
2
6
1,446
5
0
2008-08-12T10:40:05.030000
2008-08-12T10:42:59.953000
8,669
9,319
Is there some way of recycling a Crystal Reports dataset?
I'm trying to write a Crystal Report which has totals grouped in a different way to the main report. The only way I've been able to do this so far is to use a subreport for the totals, but it means having to hit the data source again to retrieve the same data, which seems like nonsense. Here's a simplified example: dat...
Hmm... as nice as it is to call the stored proc from the report and have it all contained in one location, however we found (like you) that you eventually hit a point where you can't get crystal to do what you want even tho the data is right there. We ended up introducing a business layer which sits under the report an...
Is there some way of recycling a Crystal Reports dataset? I'm trying to write a Crystal Report which has totals grouped in a different way to the main report. The only way I've been able to do this so far is to use a subreport for the totals, but it means having to hit the data source again to retrieve the same data, w...
TITLE: Is there some way of recycling a Crystal Reports dataset? QUESTION: I'm trying to write a Crystal Report which has totals grouped in a different way to the main report. The only way I've been able to do this so far is to use a subreport for the totals, but it means having to hit the data source again to retriev...
[ "asp.net", "crystal-reports", "dataset" ]
3
2
1,000
2
0
2008-08-12T10:54:54.330000
2008-08-12T23:29:57.007000
8,676
110,153
Entity Framework vs LINQ to SQL
Now that.NET v3.5 SP1 has been released (along with VS2008 SP1), we now have access to the.NET entity framework. My question is this. When trying to decide between using the Entity Framework and LINQ to SQL as an ORM, what's the difference? The way I understand it, the Entity Framework (when used with LINQ to Entities)...
LINQ to SQL only supports 1 to 1 mapping of database tables, views, sprocs and functions available in Microsoft SQL Server. It's a great API to use for quick data access construction to relatively well designed SQL Server databases. LINQ2SQL was first released with C# 3.0 and.Net Framework 3.5. LINQ to Entities (ADO.Ne...
Entity Framework vs LINQ to SQL Now that.NET v3.5 SP1 has been released (along with VS2008 SP1), we now have access to the.NET entity framework. My question is this. When trying to decide between using the Entity Framework and LINQ to SQL as an ORM, what's the difference? The way I understand it, the Entity Framework (...
TITLE: Entity Framework vs LINQ to SQL QUESTION: Now that.NET v3.5 SP1 has been released (along with VS2008 SP1), we now have access to the.NET entity framework. My question is this. When trying to decide between using the Entity Framework and LINQ to SQL as an ORM, what's the difference? The way I understand it, the ...
[ ".net", "entity-framework", "linq-to-sql" ]
868
495
292,932
17
0
2008-08-12T11:04:11.677000
2008-09-21T03:22:59.403000
8,681
9,269
JQuery.Validate failure in Opera
If you're using Opera 9.5x you may notice that our client-side JQuery.Validate code is disabled here at Stack Overflow. function initValidation() { if (navigator.userAgent.indexOf("Opera")!= -1) return; $("#post-text").rules("add", { required: true, minlength: 5 }); } That's because it generates an exception in Opera! ...
turns out the problem was in the { debug: true } option for the JQuery.Validate initializer. With this removed, things work fine in Opera. Thanks to Jörn Zaefferer for helping us figure this out! Oh, and the $50 will be donated to the JQuery project.:)
JQuery.Validate failure in Opera If you're using Opera 9.5x you may notice that our client-side JQuery.Validate code is disabled here at Stack Overflow. function initValidation() { if (navigator.userAgent.indexOf("Opera")!= -1) return; $("#post-text").rules("add", { required: true, minlength: 5 }); } That's because it ...
TITLE: JQuery.Validate failure in Opera QUESTION: If you're using Opera 9.5x you may notice that our client-side JQuery.Validate code is disabled here at Stack Overflow. function initValidation() { if (navigator.userAgent.indexOf("Opera")!= -1) return; $("#post-text").rules("add", { required: true, minlength: 5 }); } ...
[ "jquery", "validation", "opera" ]
13
11
1,837
3
0
2008-08-12T11:11:29.680000
2008-08-12T21:41:17.363000
8,685
113,115
Advancing through relative dates using strtotime()
I'm trying to use strtotime() to respond to a button click to advance -1 and +1 days (two buttons) relative to the day advanced to on the previous click. Example: It's the 10th of the month, I click "-1 day" button, and now the date reads as the 9th. I click the "-1 day" button again and now the readout states the 8th ...
Working from previous calls to the same script isn't really a good idea for this type of thing. What you want to do is always pass two values to your script, the date, and the movement. (the below example is simplified so that you only pass the date, and it will always add one day to it) Example http://www.site.com/add...
Advancing through relative dates using strtotime() I'm trying to use strtotime() to respond to a button click to advance -1 and +1 days (two buttons) relative to the day advanced to on the previous click. Example: It's the 10th of the month, I click "-1 day" button, and now the date reads as the 9th. I click the "-1 da...
TITLE: Advancing through relative dates using strtotime() QUESTION: I'm trying to use strtotime() to respond to a button click to advance -1 and +1 days (two buttons) relative to the day advanced to on the previous click. Example: It's the 10th of the month, I click "-1 day" button, and now the date reads as the 9th. ...
[ "php", "date", "strtotime" ]
7
6
2,827
3
0
2008-08-12T11:14:27.660000
2008-09-22T04:02:03.170000
8,688
12,447
Install Visual Studio 2008 Sp1 on "D" Drive
I am trying to install VS2008 sp1 to my work machine - it has a pathetic 10Gb C drive. The SP1 bootstrapper doesn't give the option to install items to D, only C. It needs 3Gb free and the machine only has about 700Mb. VS allowed me to install to D originally why not the SP. The only thing I can think of that it requir...
Worth a read: http://blogs.msdn.com/heaths/archive/2008/07/24/why-windows-installer-may-require-so-much-disk-space.aspx
Install Visual Studio 2008 Sp1 on "D" Drive I am trying to install VS2008 sp1 to my work machine - it has a pathetic 10Gb C drive. The SP1 bootstrapper doesn't give the option to install items to D, only C. It needs 3Gb free and the machine only has about 700Mb. VS allowed me to install to D originally why not the SP. ...
TITLE: Install Visual Studio 2008 Sp1 on "D" Drive QUESTION: I am trying to install VS2008 sp1 to my work machine - it has a pathetic 10Gb C drive. The SP1 bootstrapper doesn't give the option to install items to D, only C. It needs 3Gb free and the machine only has about 700Mb. VS allowed me to install to D originall...
[ "visual-studio", "visual-studio-2008", "visual-studio-2008-sp1" ]
4
4
11,849
9
0
2008-08-12T11:20:43.887000
2008-08-15T16:27:40.600000
8,691
8,706
User Control Property Designer Properties
For a C# UserControl on Windows Mobile (though please answer if you know it for full Windows...it might work) how do you change what shows up in the Designer Properties window for one of the Control's public Properties. For example: private Color blah = Color.Black; public Color Blah { get { return this.blah; } set { ...
Is this of use to you? I am not into CF development, but it looks like you need to add some XML metadata to enable it: http://blogs.msdn.com/bluecollar/archive/2007/02/08/adding-compact-framework-design-time-attributes-or-more-fun-with-textboxes.aspx Interesting read.. Looks like a lot of design time support was stripp...
User Control Property Designer Properties For a C# UserControl on Windows Mobile (though please answer if you know it for full Windows...it might work) how do you change what shows up in the Designer Properties window for one of the Control's public Properties. For example: private Color blah = Color.Black; public Col...
TITLE: User Control Property Designer Properties QUESTION: For a C# UserControl on Windows Mobile (though please answer if you know it for full Windows...it might work) how do you change what shows up in the Designer Properties window for one of the Control's public Properties. For example: private Color blah = Color....
[ "c#", "user-controls", "windows-mobile" ]
10
4
15,351
3
0
2008-08-12T11:25:41.227000
2008-08-12T11:51:49.753000
8,704
192,733
Final managed exception handler in a mixed native/managed executable?
I have an MFC application compiled with /clr and I'm trying to implement a final handler for otherwise un-caught managed exceptions. For native exceptions, overriding CWinApp::ProcessWndProcException works. The two events suggested in Jeff's CodeProject article, Application.ThreadException and AppDomain.CurrentDomain.U...
Taking a look around the internets, you'll find that you need to install a filter to get the unmanaged exceptions passing the filters on their way to your AppDomain. From CLR and Unhandled Exception Filters: The CLR relies on the SEH unhandled exception filter mechanism to catch unhandled exceptions.
Final managed exception handler in a mixed native/managed executable? I have an MFC application compiled with /clr and I'm trying to implement a final handler for otherwise un-caught managed exceptions. For native exceptions, overriding CWinApp::ProcessWndProcException works. The two events suggested in Jeff's CodeProj...
TITLE: Final managed exception handler in a mixed native/managed executable? QUESTION: I have an MFC application compiled with /clr and I'm trying to implement a final handler for otherwise un-caught managed exceptions. For native exceptions, overriding CWinApp::ProcessWndProcException works. The two events suggested ...
[ "exception", "executable", "mixed", "unhandled" ]
7
2
2,007
3
0
2008-08-12T11:48:52.850000
2008-10-10T19:25:41.983000
8,726
8,794
Checking FTP status codes with a PHP script
I have a script that checks responses from HTTP servers using the PEAR HTTP classes. However, I've recently found that the script fails on FTP servers (and probably anything that's not HTTP or HTTPS). I tried Google, but didn't see any scripts or code that returned the server status code from servers other than HTTP se...
HTTP works slightly differently than FTP though unfortunately. Although both may look the same in your browser, HTTP works off the basis of URI (i.e. to access resource A, you have an identifier which tells you how to access that). FTP is very old school server driven. Even anonymous FTP is a bit of a hack, since you s...
Checking FTP status codes with a PHP script I have a script that checks responses from HTTP servers using the PEAR HTTP classes. However, I've recently found that the script fails on FTP servers (and probably anything that's not HTTP or HTTPS). I tried Google, but didn't see any scripts or code that returned the server...
TITLE: Checking FTP status codes with a PHP script QUESTION: I have a script that checks responses from HTTP servers using the PEAR HTTP classes. However, I've recently found that the script fails on FTP servers (and probably anything that's not HTTP or HTTPS). I tried Google, but didn't see any scripts or code that r...
[ "php", "http", "ftp", "pear", "server-response" ]
7
4
2,999
3
0
2008-08-12T12:07:15.557000
2008-08-12T13:07:00.117000
8,728
161,214
Delphi MDI Application and the titlebar of the MDI Children
I've got an MDI application written in Delphi 2006 which runs XP with the default theme. Is there a way of controlling the appearance of the MDI Children to avoid the large XP-style title bar on each window? I've tried setting the BorderStyle of the MDIChildren to bsSizeToolWin but they are still rendered as normal For...
All your need - overload procedure CreateWindowHandle, like this: unit CHILDWIN; interface uses Windows, Classes, Graphics, Forms, Controls, StdCtrls; type TMDIChild = class(TForm) private { Private declarations } public { Public declarations } procedure CreateWindowHandle(const Params: TCreateParams); override; end; ...
Delphi MDI Application and the titlebar of the MDI Children I've got an MDI application written in Delphi 2006 which runs XP with the default theme. Is there a way of controlling the appearance of the MDI Children to avoid the large XP-style title bar on each window? I've tried setting the BorderStyle of the MDIChildre...
TITLE: Delphi MDI Application and the titlebar of the MDI Children QUESTION: I've got an MDI application written in Delphi 2006 which runs XP with the default theme. Is there a way of controlling the appearance of the MDI Children to avoid the large XP-style title bar on each window? I've tried setting the BorderStyle...
[ "delphi", "forms", "mdi" ]
4
6
5,718
4
0
2008-08-12T12:10:14.663000
2008-10-02T07:33:43.147000
8,742
8,764
Getting accurate ticks from a timer in C#
I'm trying to rebuild an old metronome application that was originally written using MFC in C++ to be written in.NET using C#. One of the issues I'm running into is getting the timer to "tick" accurately enough. For example, assuming an easy BPM (beats per minute) of 120, the timer should tick every.5 seconds (or 500 m...
There are three timer classes called 'Timer' in.NET. It sounds like you're using the Windows Forms one, but actually you might find the System.Threading.Timer class more useful - but be careful because it calls back on a pool thread, so you can't directly interact with your form from the callback. Another approach migh...
Getting accurate ticks from a timer in C# I'm trying to rebuild an old metronome application that was originally written using MFC in C++ to be written in.NET using C#. One of the issues I'm running into is getting the timer to "tick" accurately enough. For example, assuming an easy BPM (beats per minute) of 120, the t...
TITLE: Getting accurate ticks from a timer in C# QUESTION: I'm trying to rebuild an old metronome application that was originally written using MFC in C++ to be written in.NET using C#. One of the issues I'm running into is getting the timer to "tick" accurately enough. For example, assuming an easy BPM (beats per min...
[ ".net", "timer" ]
16
11
17,262
6
0
2008-08-12T12:20:29.853000
2008-08-12T12:34:43.443000
8,747
8,767
Learning Version Control, and learning it well
Where should I start learning about version control systems? I've used SVN, Team Foundation, and Sourcesafe in the past but I don't really feel like I grasp it completely, and my team doesn't seem to grasp it either. Which points are the most important to master? I realise this differs from VCS to VCS, but for the sake...
The wikipedia article on Revision Control is a great place to start Revision control When trying to teach my colleagues, I found getting him to understand the vocabulary at the end was a great way to start to introduce him to source code control techniques. Don't know what a branch is? Go find out and how they work:) T...
Learning Version Control, and learning it well Where should I start learning about version control systems? I've used SVN, Team Foundation, and Sourcesafe in the past but I don't really feel like I grasp it completely, and my team doesn't seem to grasp it either. Which points are the most important to master? I realise...
TITLE: Learning Version Control, and learning it well QUESTION: Where should I start learning about version control systems? I've used SVN, Team Foundation, and Sourcesafe in the past but I don't really feel like I grasp it completely, and my team doesn't seem to grasp it either. Which points are the most important to...
[ "svn", "version-control" ]
19
10
4,964
13
0
2008-08-12T12:24:11.733000
2008-08-12T12:35:51.740000
8,756
8,776
iPhone web applications, templates, frameworks?
Does anyone have any good starting points for me when looking at making web pages/sites/applications specifically for viewing on the iPhone? I've looked at templates like the one Joe Hewitt has made, and also seen some templates I can purchase, which I haven't done yet. I figured someone else had already started on thi...
I found iphone-universal on Google Code the other day. Haven't had a chance to try it out but it looks promising.
iPhone web applications, templates, frameworks? Does anyone have any good starting points for me when looking at making web pages/sites/applications specifically for viewing on the iPhone? I've looked at templates like the one Joe Hewitt has made, and also seen some templates I can purchase, which I haven't done yet. I...
TITLE: iPhone web applications, templates, frameworks? QUESTION: Does anyone have any good starting points for me when looking at making web pages/sites/applications specifically for viewing on the iPhone? I've looked at templates like the one Joe Hewitt has made, and also seen some templates I can purchase, which I h...
[ "iphone", "web-applications", "dashcode" ]
22
5
20,890
9
0
2008-08-12T12:29:32.017000
2008-08-12T12:45:01.550000
8,761
8,804
Find out which colours are in use when using the MFC Feature pack in Office 2007 style
I'm updating some of our legacy C++ code to use the "MFC feature pack" that Microsoft released for Visual Studio 2008. We've used the new classes to derive our application from CFrameWndEx, and are applying the Office 2007 styles to give our application a more modern appearance. This gives us gradient filled window tit...
Have you looked in the MFC source code, which you'll find in something like C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfc
Find out which colours are in use when using the MFC Feature pack in Office 2007 style I'm updating some of our legacy C++ code to use the "MFC feature pack" that Microsoft released for Visual Studio 2008. We've used the new classes to derive our application from CFrameWndEx, and are applying the Office 2007 styles to ...
TITLE: Find out which colours are in use when using the MFC Feature pack in Office 2007 style QUESTION: I'm updating some of our legacy C++ code to use the "MFC feature pack" that Microsoft released for Visual Studio 2008. We've used the new classes to derive our application from CFrameWndEx, and are applying the Offi...
[ "colors", "mfc-feature-pack" ]
4
1
4,580
9
0
2008-08-12T12:33:10.857000
2008-08-12T13:14:00.273000
8,763
8,777
Best way to play MIDI sounds using C#
I'm trying to rebuild an old metronome application that was originally written using MFC in C++ to be written in.NET using C#. One of the issues I'm running into is playing the midi files that are used to represent the metronome "clicks". I've found a few articles online about playing MIDI in.NET, but most of them seem...
I think you'll need to p/invoke out to the windows api to be able to play midi files from.net. This codeproject article does a good job on explaining how to do this: vb.net article to play midi files To rewrite this is c# you'd need the following import statement for mciSendString: [DllImport("winmm.dll")] static exter...
Best way to play MIDI sounds using C# I'm trying to rebuild an old metronome application that was originally written using MFC in C++ to be written in.NET using C#. One of the issues I'm running into is playing the midi files that are used to represent the metronome "clicks". I've found a few articles online about play...
TITLE: Best way to play MIDI sounds using C# QUESTION: I'm trying to rebuild an old metronome application that was originally written using MFC in C++ to be written in.NET using C#. One of the issues I'm running into is playing the midi files that are used to represent the metronome "clicks". I've found a few articles...
[ "c#", ".net", "midi" ]
20
10
38,845
11
0
2008-08-12T12:34:07.733000
2008-08-12T12:46:31.750000
8,790
8,805
Ant build scripts, antcall, dependencies, etc
I have a build script and as part of that script it copies a jar file to a directory, for ease lets call it the utils jar. the utils jar is built by another build script sitting in another directory. What im trying to do have my build script run the utils build script so that I can ensure the utils jar is up to date. S...
I've got something similar set up: I have a main Ant build.xml which calls a separate build.xml that takes care of building my tests. This is how I do it: The trick is to use subant instead of antcall. You don't have to import the other build file.
Ant build scripts, antcall, dependencies, etc I have a build script and as part of that script it copies a jar file to a directory, for ease lets call it the utils jar. the utils jar is built by another build script sitting in another directory. What im trying to do have my build script run the utils build script so th...
TITLE: Ant build scripts, antcall, dependencies, etc QUESTION: I have a build script and as part of that script it copies a jar file to a directory, for ease lets call it the utils jar. the utils jar is built by another build script sitting in another directory. What im trying to do have my build script run the utils ...
[ "ant", "build-process" ]
27
33
23,719
3
0
2008-08-12T13:04:28.890000
2008-08-12T13:14:50.273000
8,795
8,859
Is there any list datatype in MySQL stored procedures, or a way to emulate them?
I would like to create a stored procedure in MySQL that took a list as argument. For example, say that I would like to be able to set multiple tags for an item in one call, then what I want to do is to define a procedure that takes the ID of the item and a list of tags to set. However, I can't seem to find any way to d...
This article has some good discussion on the problem of parsing an array to a stored procedure since stored procedures only allow valid table column data-types as parameters. There are some neat things you can do with the csv table type in mysql - that is if you are loading a flat file into the db. You could create a t...
Is there any list datatype in MySQL stored procedures, or a way to emulate them? I would like to create a stored procedure in MySQL that took a list as argument. For example, say that I would like to be able to set multiple tags for an item in one call, then what I want to do is to define a procedure that takes the ID ...
TITLE: Is there any list datatype in MySQL stored procedures, or a way to emulate them? QUESTION: I would like to create a stored procedure in MySQL that took a list as argument. For example, say that I would like to be able to set multiple tags for an item in one call, then what I want to do is to define a procedure ...
[ "mysql", "stored-procedures" ]
13
9
21,752
4
0
2008-08-12T13:09:22.220000
2008-08-12T14:02:46.697000
8,800
8,811
Best implementation for Key Value Pair Data Structure?
So I've been poking around with C# a bit lately, and all the Generic Collections have me a little confused. Say I wanted to represent a data structure where the head of a tree was a key value pair, and then there is one optional list of key value pairs below that (but no more levels than these). Would this be suitable?...
There is an actual Data Type called KeyValuePair, use like this KeyValuePair myKeyValuePair = new KeyValuePair ("defaultkey", "defaultvalue");
Best implementation for Key Value Pair Data Structure? So I've been poking around with C# a bit lately, and all the Generic Collections have me a little confused. Say I wanted to represent a data structure where the head of a tree was a key value pair, and then there is one optional list of key value pairs below that (...
TITLE: Best implementation for Key Value Pair Data Structure? QUESTION: So I've been poking around with C# a bit lately, and all the Generic Collections have me a little confused. Say I wanted to represent a data structure where the head of a tree was a key value pair, and then there is one optional list of key value ...
[ "c#", "data-structures", "collections" ]
79
143
207,295
9
0
2008-08-12T13:12:50.887000
2008-08-12T13:20:55.127000
8,807
8,899
Cannot add WebViewer of ActiveReports to an ASP.NET page
I installed ActiveReports from their site. The version was labeled as.NET 2.0 build 5.2.1013.2 (for Visual Studio 2005 and 2008). I have an ASP.NET project in VS 2008 which has 2.0 as target framework. I added all the tools in the DataDynamics namespace to the toolbox, created a new project, added a new report. When I ...
I think I found the reason. While trying to get this work, I think I installed another version of the package that removed or deactivated my current version. The control I was dropping on the form belonged to the older version that had no assemblies referenced. I removed all installations of ActiveReports, installed th...
Cannot add WebViewer of ActiveReports to an ASP.NET page I installed ActiveReports from their site. The version was labeled as.NET 2.0 build 5.2.1013.2 (for Visual Studio 2005 and 2008). I have an ASP.NET project in VS 2008 which has 2.0 as target framework. I added all the tools in the DataDynamics namespace to the to...
TITLE: Cannot add WebViewer of ActiveReports to an ASP.NET page QUESTION: I installed ActiveReports from their site. The version was labeled as.NET 2.0 build 5.2.1013.2 (for Visual Studio 2005 and 2008). I have an ASP.NET project in VS 2008 which has 2.0 as target framework. I added all the tools in the DataDynamics n...
[ "activereports" ]
2
2
1,341
1
0
2008-08-12T13:15:46.543000
2008-08-12T14:39:20.040000
8,832
12,062
mod_rewrite to alias one file suffix type to another
I hope I can explain this clearly enough, but if not let me know and I'll try to clarify. I'm currently developing a site using ColdFusion and have a mod_rewrite rule in place to make it look like the site is using PHP. Any requests for index.php get processed by index.cfm (the rule maps *.php to *.cfm). This works gre...
You can use the S flag to skip the 404 rule, like this: RewriteEngine on # Do not separate these two rules so long as the first has S=1 RewriteRule (.*)\.php$ $1.cfm [S=1] RewriteRule \.cfm$ - [R=404] If you are also using the Alias option then you should also add the PT flag. See the mod_rewrite documentation for det...
mod_rewrite to alias one file suffix type to another I hope I can explain this clearly enough, but if not let me know and I'll try to clarify. I'm currently developing a site using ColdFusion and have a mod_rewrite rule in place to make it look like the site is using PHP. Any requests for index.php get processed by ind...
TITLE: mod_rewrite to alias one file suffix type to another QUESTION: I hope I can explain this clearly enough, but if not let me know and I'll try to clarify. I'm currently developing a site using ColdFusion and have a mod_rewrite rule in place to make it look like the site is using PHP. Any requests for index.php ge...
[ "apache", "mod-rewrite", "seo" ]
3
1
1,601
3
0
2008-08-12T13:44:06.580000
2008-08-15T08:02:25.513000
8,849
9,730
SharePoint - Connection String dialog box during FeatureActivated event
Does anyone know if it is possible to display a prompt to a user/administrator when activating or installing a sharepoint feature? I am writing a custom webpart and it is connecting to a separate database, I would like to allow the administrator to select or type in a connection string when installing the.wsp file or a...
Unfortunately there is no way to swap to a screen where you can get user via the feature activation process. Couple of comments for you: I'm assuming the connection string is going to be different for every installation, so there is no way you can include it directly in the Solution. I'm assuming that you couldn't prog...
SharePoint - Connection String dialog box during FeatureActivated event Does anyone know if it is possible to display a prompt to a user/administrator when activating or installing a sharepoint feature? I am writing a custom webpart and it is connecting to a separate database, I would like to allow the administrator to...
TITLE: SharePoint - Connection String dialog box during FeatureActivated event QUESTION: Does anyone know if it is possible to display a prompt to a user/administrator when activating or installing a sharepoint feature? I am writing a custom webpart and it is connecting to a separate database, I would like to allow th...
[ "sharepoint", "connection-string" ]
2
1
2,273
2
0
2008-08-12T13:57:04.353000
2008-08-13T12:50:32.333000
8,864
8,869
Difference between NULL and null in PHP
Is there a difference between NULL and null in PHP? Sometimes they seem to be interchangeable and sometimes not. edit: for some reason when I read the documentation linked to in the answer (before posting this question) I read it as "case sensitive" instead of "case insensitive" which was the whole reason I posted this...
Null is case insensitive. From the documentation: There is only one value of type null, and that is the case-insensitive keyword NULL.
Difference between NULL and null in PHP Is there a difference between NULL and null in PHP? Sometimes they seem to be interchangeable and sometimes not. edit: for some reason when I read the documentation linked to in the answer (before posting this question) I read it as "case sensitive" instead of "case insensitive" ...
TITLE: Difference between NULL and null in PHP QUESTION: Is there a difference between NULL and null in PHP? Sometimes they seem to be interchangeable and sometimes not. edit: for some reason when I read the documentation linked to in the answer (before posting this question) I read it as "case sensitive" instead of "...
[ "php", "null" ]
106
140
39,477
4
0
2008-08-12T14:08:23.363000
2008-08-12T14:11:11.393000
8,876
8,882
Evidence Based Scheduling Tool
Are there any free tools that implement evidence-based scheduling like Joel talks about? There is FogBugz, of course, but I am looking for a simple and free tool that can apply EBS on some tasks that I give estimates (and actual times which are complete) for.
FogBugz is free for up to 2 users by the way. As far I know this is the only tool that does EBS. See here http://www.workhappy.net/2008/06/get-fogbugz-for.html
Evidence Based Scheduling Tool Are there any free tools that implement evidence-based scheduling like Joel talks about? There is FogBugz, of course, but I am looking for a simple and free tool that can apply EBS on some tasks that I give estimates (and actual times which are complete) for.
TITLE: Evidence Based Scheduling Tool QUESTION: Are there any free tools that implement evidence-based scheduling like Joel talks about? There is FogBugz, of course, but I am looking for a simple and free tool that can apply EBS on some tasks that I give estimates (and actual times which are complete) for. ANSWER: Fo...
[ "fogbugz" ]
30
14
3,170
2
0
2008-08-12T14:16:41.757000
2008-08-12T14:28:52.497000
8,880
8,888
Get list of domains on the network
Using the Windows API, how can I get a list of domains on my network?
You will need to use some LDAP queries Here is some code I have used in a previous script (it was taken off the net somewhere, and I've left in the copyright notices) ' This VBScript code gets the list of the domains contained in the ' forest that the user running the script is logged into ' --------------------------...
Get list of domains on the network Using the Windows API, how can I get a list of domains on my network?
TITLE: Get list of domains on the network QUESTION: Using the Windows API, how can I get a list of domains on my network? ANSWER: You will need to use some LDAP queries Here is some code I have used in a previous script (it was taken off the net somewhere, and I've left in the copyright notices) ' This VBScript code ...
[ "winapi" ]
1
1
3,261
2
0
2008-08-12T14:20:31.153000
2008-08-12T14:33:20.303000
8,893
8,906
Anyone know of an on-line free database?
I wrote an application that currently runs against a local instance of MySql. I would like to centralize the DB somewhere on the Net, and share my application. But, I'm cheap, and don't want to pay for it. Does anyone know of a free on-line relational DB service that I could connect to via C#?
What about http://www.freesql.org? Seems like you can't be too picky when you're asking for free, and this seems to offer something.
Anyone know of an on-line free database? I wrote an application that currently runs against a local instance of MySql. I would like to centralize the DB somewhere on the Net, and share my application. But, I'm cheap, and don't want to pay for it. Does anyone know of a free on-line relational DB service that I could con...
TITLE: Anyone know of an on-line free database? QUESTION: I wrote an application that currently runs against a local instance of MySql. I would like to centralize the DB somewhere on the Net, and share my application. But, I'm cheap, and don't want to pay for it. Does anyone know of a free on-line relational DB servic...
[ "c#", "database" ]
11
6
1,050
6
0
2008-08-12T14:35:39.643000
2008-08-12T14:43:31.077000
8,894
10,140
Use for the phppgadmin Reports Database?
Phppgadmin comes with instructions for creating a reports database on the system for use with phppgadmin. The instructions describe how to set it up, but do not really give any indication of what its purpose is, and the phppgadmin site was not very helpful either. It seems to allow you to store SQL queries, so is it fo...
This is just a standard location to store frequently used SQL scripts. The reports-pgsql.sql script creates a table for storing these queries, the database they are intended to be run on, a title and some descriptive text about what they do. PhpPgAdmin has functionality to browse and execute these reports. It's a prett...
Use for the phppgadmin Reports Database? Phppgadmin comes with instructions for creating a reports database on the system for use with phppgadmin. The instructions describe how to set it up, but do not really give any indication of what its purpose is, and the phppgadmin site was not very helpful either. It seems to al...
TITLE: Use for the phppgadmin Reports Database? QUESTION: Phppgadmin comes with instructions for creating a reports database on the system for use with phppgadmin. The instructions describe how to set it up, but do not really give any indication of what its purpose is, and the phppgadmin site was not very helpful eith...
[ "php", "database", "postgresql", "phppgadmin" ]
7
6
1,897
1
0
2008-08-12T14:35:46.803000
2008-08-13T18:08:47.947000
8,896
2,356,710
Can I get Memcached running on a Windows (x64) 64bit environment?
Does anyone know IF, WHEN or HOW I can get Memcached running on a Windows 64bit environment? I'm setting up a new hosting solution and would much prefer to run a 64bit OS, and since it's an ASP.Net MVC solution with SQL Server DB, the OS is either going to be Windows Server 2003 or (hopefully!) 2008. I know that this c...
North Scale labs have released a build of memcached 1.4.4 for Windows x64: http://blog.couchbase.com/memcached-windows-64-bit-pre-release-available http://labs.northscale.com/memcached-packages/ UPDATE: they have recently released Memcached Server - still FREE but enhanced distro with clustering, web-based admin/stats ...
Can I get Memcached running on a Windows (x64) 64bit environment? Does anyone know IF, WHEN or HOW I can get Memcached running on a Windows 64bit environment? I'm setting up a new hosting solution and would much prefer to run a 64bit OS, and since it's an ASP.Net MVC solution with SQL Server DB, the OS is either going ...
TITLE: Can I get Memcached running on a Windows (x64) 64bit environment? QUESTION: Does anyone know IF, WHEN or HOW I can get Memcached running on a Windows 64bit environment? I'm setting up a new hosting solution and would much prefer to run a 64bit OS, and since it's an ASP.Net MVC solution with SQL Server DB, the O...
[ "c#", "c++", "windows", "64-bit", "memcached" ]
90
54
61,555
11
0
2008-08-12T14:37:28.703000
2010-03-01T15:12:00.593000
8,919
8,928
Looking for best practice for doing a "Net Use" in C#
I'd rather not have to resort to calling the command line. I'm looking for code that can map/disconnect a drive, while also having exception handling. Any ideas?
Use P/Invoke and WNetAddConnection2 There should also be some wrappers out there to do some of the grunt work for you. Google is your friend, as always.
Looking for best practice for doing a "Net Use" in C# I'd rather not have to resort to calling the command line. I'm looking for code that can map/disconnect a drive, while also having exception handling. Any ideas?
TITLE: Looking for best practice for doing a "Net Use" in C# QUESTION: I'd rather not have to resort to calling the command line. I'm looking for code that can map/disconnect a drive, while also having exception handling. Any ideas? ANSWER: Use P/Invoke and WNetAddConnection2 There should also be some wrappers out th...
[ "c#", ".net-1.1" ]
9
9
17,135
1
0
2008-08-12T14:53:58.233000
2008-08-12T14:58:40.330000
8,939
205,936
ActionScript 3.0 sockets can't reconnect
I'm having trouble connecting (via the Socket and XMLSocket classes) to a TCP listener after a connect timeout. I have a flash applet that needs to maintain a TCP connection to a server. I have implemented timeouts using Timers, a ping-pong system, etc. However, there's a problem. Upon calling Socket.connect(), the fla...
This could be related to the unresolved bug FP-269 which in turn may have the same root cause as FP-67. This build should be fixed in the current public beta release found on labs.adobe.com Edwin Wong - [09/23/08 04:49 PM ] I'd recommend you give the latest public beta a shot...
ActionScript 3.0 sockets can't reconnect I'm having trouble connecting (via the Socket and XMLSocket classes) to a TCP listener after a connect timeout. I have a flash applet that needs to maintain a TCP connection to a server. I have implemented timeouts using Timers, a ping-pong system, etc. However, there's a proble...
TITLE: ActionScript 3.0 sockets can't reconnect QUESTION: I'm having trouble connecting (via the Socket and XMLSocket classes) to a TCP listener after a connect timeout. I have a flash applet that needs to maintain a TCP connection to a server. I have implemented timeouts using Timers, a ping-pong system, etc. However...
[ "flash", "actionscript-3", "sockets", "xmlsocket" ]
5
3
2,290
1
0
2008-08-12T15:03:40.833000
2008-10-15T18:51:14.127000
8,940
8,996
VMWare Server Under Linux Secondary NIC connection
With VMWare Server running under Linux (Debain), I would like to have the following setup: 1st: NIC being used by many of the images running under VMWare, as well as being used by the Linux OS 2nd: NIC being used by only 1 image and to be unused by the Linux OS (as its part of a DMZ) Although the second NIC won't be us...
I believe you can set the desired solution up by rerunning the vmware configuration script. And doing a custom network setup, so that both NIC's are mapped to your vmware instance. I would recommend making eth0 the 2nd NIC since it will be easier for Linux to use by default. Then make eth1 the 1st NIC.
VMWare Server Under Linux Secondary NIC connection With VMWare Server running under Linux (Debain), I would like to have the following setup: 1st: NIC being used by many of the images running under VMWare, as well as being used by the Linux OS 2nd: NIC being used by only 1 image and to be unused by the Linux OS (as its...
TITLE: VMWare Server Under Linux Secondary NIC connection QUESTION: With VMWare Server running under Linux (Debain), I would like to have the following setup: 1st: NIC being used by many of the images running under VMWare, as well as being used by the Linux OS 2nd: NIC being used by only 1 image and to be unused by th...
[ "linux", "vmware", "system-administration", "nic" ]
0
2
1,343
1
0
2008-08-12T15:04:29.397000
2008-08-12T15:56:13.660000
8,941
8,956
Generic type checking
Is there a way to enforce/limit the types that are passed to primitives? (bool, int, string, etc.) Now, I know you can limit the generic type parameter to a type or interface implementation via the where clause. However, this doesn't fit the bill for primitives (AFAIK) because they do not all have a common ground (apar...
Primitives appear to be specified in the TypeCode enumeration: Perhaps there is a way to find out if an object contains the TypeCode enum without having to cast it to an specific object or call GetType() or typeof()? Update It was right under my nose. The code sample there shows this: static void WriteObjectInfo(object...
Generic type checking Is there a way to enforce/limit the types that are passed to primitives? (bool, int, string, etc.) Now, I know you can limit the generic type parameter to a type or interface implementation via the where clause. However, this doesn't fit the bill for primitives (AFAIK) because they do not all have...
TITLE: Generic type checking QUESTION: Is there a way to enforce/limit the types that are passed to primitives? (bool, int, string, etc.) Now, I know you can limit the generic type parameter to a type or interface implementation via the where clause. However, this doesn't fit the bill for primitives (AFAIK) because th...
[ "c#", "generics", "primitive", "type-safety" ]
72
41
30,114
9
0
2008-08-12T15:07:40.887000
2008-08-12T15:21:44.010000
8,952
8,960
Storing a file in a database as opposed to the file system?
Generally, how bad of a performance hit is storing a file in a database (specifically mssql) as opposed to the file system? I can't come up with a reason outside of application portability that I would want to store my files as varbinaries in SQL Server.
Have a look at this answer: Storing Images in DB - Yea or Nay? Essentially, the space and performance hit can be quite big, depending on the number of users. Also, keep in mind that Web servers are cheap and you can easily add more to balance the load, whereas the database is the most expensive and hardest to scale par...
Storing a file in a database as opposed to the file system? Generally, how bad of a performance hit is storing a file in a database (specifically mssql) as opposed to the file system? I can't come up with a reason outside of application portability that I would want to store my files as varbinaries in SQL Server.
TITLE: Storing a file in a database as opposed to the file system? QUESTION: Generally, how bad of a performance hit is storing a file in a database (specifically mssql) as opposed to the file system? I can't come up with a reason outside of application portability that I would want to store my files as varbinaries in...
[ "sql-server", "database", "filesystems", "storage" ]
95
86
151,517
11
0
2008-08-12T15:20:25.637000
2008-08-12T15:23:54.460000
8,966
107,940
Using C#/WIA version 2.0 on Vista to Scan
I want to implement a paperless filing system and was looking to use WIA with C# for the image acquisition. There are quite a few sample projects on CodeProject, etc. However, after downloading every one of them that I can find, I have run into a problem. In each and every one of them, the reference to WIALib is broken...
To access WIA, you'll need to add a reference to the COM library, "Microsoft Windows Image Acquisition Library v2.0" (wiaaut.dll). add a "using WIA;" const string wiaFormatJPEG = "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}"; CommonDialogClass wiaDiag = new CommonDialogClass(); WIA.ImageFile wiaImage = null; wiaImage = wia...
Using C#/WIA version 2.0 on Vista to Scan I want to implement a paperless filing system and was looking to use WIA with C# for the image acquisition. There are quite a few sample projects on CodeProject, etc. However, after downloading every one of them that I can find, I have run into a problem. In each and every one ...
TITLE: Using C#/WIA version 2.0 on Vista to Scan QUESTION: I want to implement a paperless filing system and was looking to use WIA with C# for the image acquisition. There are quite a few sample projects on CodeProject, etc. However, after downloading every one of them that I can find, I have run into a problem. In e...
[ "c#", ".net", ".net-3.5", "wia", "image-scanner" ]
23
22
40,799
5
0
2008-08-12T15:28:34.573000
2008-09-20T11:28:57.827000
8,968
9,404
What OSS project should I look at if I need to do Spring friendly WorkFlow?
We need to add WorkFlow to our Spring managed application. Does anyone have any useful experience in using any of the myriad of OSS Work Flow solutions? Which one is best? Which one integrates with Spring best? Which ones should we avoid?
If you only need some simple process orchestration, Spring's own Web Flow, despite its name can serve as a orchestration task manager. If you need to preserve state for several days then you will need to become an 'early adopter' of one of the open-source projects. You may want to look at Eclipse's BPEL project. My hun...
What OSS project should I look at if I need to do Spring friendly WorkFlow? We need to add WorkFlow to our Spring managed application. Does anyone have any useful experience in using any of the myriad of OSS Work Flow solutions? Which one is best? Which one integrates with Spring best? Which ones should we avoid?
TITLE: What OSS project should I look at if I need to do Spring friendly WorkFlow? QUESTION: We need to add WorkFlow to our Spring managed application. Does anyone have any useful experience in using any of the myriad of OSS Work Flow solutions? Which one is best? Which one integrates with Spring best? Which ones shou...
[ "java", "spring", "workflow" ]
12
3
935
5
0
2008-08-12T15:29:18.067000
2008-08-13T02:02:38.537000
8,987
8,993
Calling Table-Valued SQL Functions From .NET
Scalar-valued functions can be called from.NET as follows: SqlCommand cmd = new SqlCommand("testFunction", sqlConn); //testFunction is scalar cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("retVal", SqlDbType.Int); cmd.Parameters["retVal"].Direction = ParameterDirection.ReturnValue; cmd.ExecuteScalar...
No because you need to select them. However you can create a stored proc wrapper, which may defeat the point of having a table function.
Calling Table-Valued SQL Functions From .NET Scalar-valued functions can be called from.NET as follows: SqlCommand cmd = new SqlCommand("testFunction", sqlConn); //testFunction is scalar cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("retVal", SqlDbType.Int); cmd.Parameters["retVal"].Direction = Para...
TITLE: Calling Table-Valued SQL Functions From .NET QUESTION: Scalar-valued functions can be called from.NET as follows: SqlCommand cmd = new SqlCommand("testFunction", sqlConn); //testFunction is scalar cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("retVal", SqlDbType.Int); cmd.Parameters["retVal"...
[ "c#", ".net", "sql" ]
32
19
19,258
1
0
2008-08-12T15:50:49.460000
2008-08-12T15:53:26.193000
9,002
9,875
How do I get dbmail to process items from the queue for SQL Server 2005?
When I use the sp_send_dbmail stored procedure, I get a message saying that my mail was queued. However, it never seems to get delivered. I can see them in the queue if I run this SQL: SELECT * FROM msdb..sysmail_allitems WHERE sent_status = 'unsent' This SQL returns a 1: SELECT is_broker_enabled FROM sys.databases WHE...
Could be oodles of things. For example, I've seen (yes, actually seen) this happen after: Domain controller reboot Exchange server reboot Router outage Service account changes SQL Server running out of disk space So until it happens again, I wouldn't freak out over it.
How do I get dbmail to process items from the queue for SQL Server 2005? When I use the sp_send_dbmail stored procedure, I get a message saying that my mail was queued. However, it never seems to get delivered. I can see them in the queue if I run this SQL: SELECT * FROM msdb..sysmail_allitems WHERE sent_status = 'unse...
TITLE: How do I get dbmail to process items from the queue for SQL Server 2005? QUESTION: When I use the sp_send_dbmail stored procedure, I get a message saying that my mail was queued. However, it never seems to get delivered. I can see them in the queue if I run this SQL: SELECT * FROM msdb..sysmail_allitems WHERE s...
[ "sql-server" ]
4
1
4,509
3
0
2008-08-12T15:58:30.723000
2008-08-13T14:20:56.643000
9,009
9,011
Assignment inside Perl ternary conditional operator problems
This snippet of Perl code in my program is giving the wrong result. $condition? $a = 2: $a = 3; print $a; No matter what the value of $condition is, the output is always 3, how come?
This is explained in the Perl documentation. Because of Perl operator precedence the statement is being parsed as ($condition? $a= 2: $a ) = 3; Because the?: operator produces an assignable result, 3 is assigned to the result of the condition. When $condition is true this means ($a=2)=3 giving $a=3 When $condition is f...
Assignment inside Perl ternary conditional operator problems This snippet of Perl code in my program is giving the wrong result. $condition? $a = 2: $a = 3; print $a; No matter what the value of $condition is, the output is always 3, how come?
TITLE: Assignment inside Perl ternary conditional operator problems QUESTION: This snippet of Perl code in my program is giving the wrong result. $condition? $a = 2: $a = 3; print $a; No matter what the value of $condition is, the output is always 3, how come? ANSWER: This is explained in the Perl documentation. Beca...
[ "perl", "conditional-operator", "operator-precedence" ]
41
80
7,748
5
0
2008-08-12T16:03:54.893000
2008-08-12T16:05:34.390000
9,018
9,403
Windows Mobile Device Emulator - how to save config permanently?
I am working at a client site where there is a proxy server ( HTTP ) in place. If I do a hard reset of the emulator it forgets network connection settings for the emulator and settings in the hosted Windows Mobile OS. If I 'save state and exit' it will lose all of these settings. I need to do hard resets regularly whic...
There is a way you can programmatically provision your devices. If you're using managed code, you can use Microsoft.WindowsMobile.Configuration.dll to do most of the work for you. If you're using unmanaged code, you have to use DMProcessConfigXML native function. There's more details in this blog post by Andrew Arnott.
Windows Mobile Device Emulator - how to save config permanently? I am working at a client site where there is a proxy server ( HTTP ) in place. If I do a hard reset of the emulator it forgets network connection settings for the emulator and settings in the hosted Windows Mobile OS. If I 'save state and exit' it will lo...
TITLE: Windows Mobile Device Emulator - how to save config permanently? QUESTION: I am working at a client site where there is a proxy server ( HTTP ) in place. If I do a hard reset of the emulator it forgets network connection settings for the emulator and settings in the hosted Windows Mobile OS. If I 'save state an...
[ "visual-studio", "windows-mobile", "windows-mobile-emulator" ]
1
0
2,377
2
0
2008-08-12T16:20:58.040000
2008-08-13T02:02:27.727000
9,019
941,940
Best method for varchar date validation in Sybase (T-SQL)?
I have a stored procedure which takes as its parameter a varchar which needs to be cast as a datetime for later use: SET @the_date = CAST(@date_string AS DATETIME) I'm expecting the date string to be supplied in the format "DD-MON-YYYY", but in an effort to code defensively, if for some reason it can't be cast successf...
I'm having a similar issue. You might be able to do something like this: SET arithabort arith_overflow off SET @the_date = CAST(@date_string AS DATETIME) IF @the_date is NULL set @the_date = getdate() SET arithabort arith_overflow on However, this doesn't work well in a select. It will work well in a cursor (boo) or in...
Best method for varchar date validation in Sybase (T-SQL)? I have a stored procedure which takes as its parameter a varchar which needs to be cast as a datetime for later use: SET @the_date = CAST(@date_string AS DATETIME) I'm expecting the date string to be supplied in the format "DD-MON-YYYY", but in an effort to cod...
TITLE: Best method for varchar date validation in Sybase (T-SQL)? QUESTION: I have a stored procedure which takes as its parameter a varchar which needs to be cast as a datetime for later use: SET @the_date = CAST(@date_string AS DATETIME) I'm expecting the date string to be supplied in the format "DD-MON-YYYY", but i...
[ "t-sql", "validation", "datetime", "varchar", "sap-ase" ]
2
1
10,073
6
0
2008-08-12T16:22:14.793000
2009-06-02T21:10:00.147000
9,022
9,356
How have Html entities inside asp.net page?
Inside an asp.net page, should I use My page's title from México Or My page’s title from México Both examples have the same output. Since asp.net encodes all my pages to utf-8, there is no need to use html entities, is that right?
The ASCII table is set of characters, arguable the first standardized set of characters back in the days when you could only spare 1 byte per character. http://asciitable.com/ But I did some looking around at the extended character set of ASCII and it appears that the character you are referencing is an ASCII character...
How have Html entities inside asp.net page? Inside an asp.net page, should I use My page's title from México Or My page’s title from México Both examples have the same output. Since asp.net encodes all my pages to utf-8, there is no need to use html entities, is that right?
TITLE: How have Html entities inside asp.net page? QUESTION: Inside an asp.net page, should I use My page's title from México Or My page’s title from México Both examples have the same output. Since asp.net encodes all my pages to utf-8, there is no need to use html entities, is that right? ANSWER: The ASCII table is...
[ "asp.net", "html", "encoding" ]
7
3
2,657
3
0
2008-08-12T16:25:18.720000
2008-08-13T00:37:12.063000
9,024
9,031
HTTPS in IIS 5.1
I'm using IIS 5.1 in Windows XP on my development computer. I'm going to set up HTTPS on my company's web server, but I want to try doing it locally before doing it on a production system. But when I go into the Directory Security tab of my web site's configuration section, the "Secure communication" groupbox is disabl...
That is because IIS 5.1 under the limited Windows XP version is limited to only HTTP. You need to have a full version of IIS 6.0 on Windows 2003 to do this. Luckily you can download a VHD image of Windows 2003 from Microsoft and run it under a Virtual PC instance. Plus I would recommend this since you are trying to be ...
HTTPS in IIS 5.1 I'm using IIS 5.1 in Windows XP on my development computer. I'm going to set up HTTPS on my company's web server, but I want to try doing it locally before doing it on a production system. But when I go into the Directory Security tab of my web site's configuration section, the "Secure communication" g...
TITLE: HTTPS in IIS 5.1 QUESTION: I'm using IIS 5.1 in Windows XP on my development computer. I'm going to set up HTTPS on my company's web server, but I want to try doing it locally before doing it on a production system. But when I go into the Directory Security tab of my web site's configuration section, the "Secur...
[ "iis", "ssl" ]
7
3
3,283
2
0
2008-08-12T16:27:39.510000
2008-08-12T16:31:02.403000
9,044
275,353
Can I specify a class wide group on a TestNG test case?
I have a base class that represents a database test in TestNG, and I want to specify that all classes extending from this class are of a group "db-test", however I have found that this doesn't seem possible. I have tried the @Test annotation: @Test(groups = { "db-test" }) public class DBTestBase { } However, this doesn...
The answer is through a custom org.testng.IMethodSelector: Its includeMethod() can exclude any method we want, like a public not-annotated method. However, to register a custom Java MethodSelector, you must add it to the XMLTest instance managed by any TestRunner, which means you need your own custom TestRunner. But, t...
Can I specify a class wide group on a TestNG test case? I have a base class that represents a database test in TestNG, and I want to specify that all classes extending from this class are of a group "db-test", however I have found that this doesn't seem possible. I have tried the @Test annotation: @Test(groups = { "db-...
TITLE: Can I specify a class wide group on a TestNG test case? QUESTION: I have a base class that represents a database test in TestNG, and I want to specify that all classes extending from this class are of a group "db-test", however I have found that this doesn't seem possible. I have tried the @Test annotation: @Te...
[ "java", "testng" ]
16
2
12,563
5
0
2008-08-12T16:52:08.697000
2008-11-08T23:12:31.067000
9,052
9,054
Is there a way for MS Access to grab the current Active Directory user?
I'm working on a spec for a piece of software for my company and as part of the auditing system I think it would be neat if there was a way to grab the current Active Directory user. Hopefully something like: Dim strUser as String strUser = ActiveDirectory.User() MsgBox "Welcome back, " & strUser
Try this article - I have some code at work that will erm, work if this doesn't... Relevant quote: Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _ (ByVal IpBuffer As String, nSize As Long) As Long Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" _ (ByVal lp...
Is there a way for MS Access to grab the current Active Directory user? I'm working on a spec for a piece of software for my company and as part of the auditing system I think it would be neat if there was a way to grab the current Active Directory user. Hopefully something like: Dim strUser as String strUser = ActiveD...
TITLE: Is there a way for MS Access to grab the current Active Directory user? QUESTION: I'm working on a spec for a piece of software for my company and as part of the auditing system I think it would be neat if there was a way to grab the current Active Directory user. Hopefully something like: Dim strUser as String...
[ "ms-access", "active-directory" ]
12
6
28,642
4
0
2008-08-12T17:03:28.220000
2008-08-12T17:07:52.563000
9,072
204,732
YUI drag&drop proxy drag
Question for YUI experts... I have a table and I've made each cell of the first row draggable by proxy. In IE, when the drag proxy is released, the original table cell actually jumps to wherever the release point was. How can I prevent this from happening? Essentially, I want to know where the proxy was dropped and han...
You have to override the drop-functions, check for DD::dragOverEvent( ) DD:endDragEvent( ) functions on this reference: http://developer.yahoo.com/yui/docs/YAHOO.util.DD.html
YUI drag&drop proxy drag Question for YUI experts... I have a table and I've made each cell of the first row draggable by proxy. In IE, when the drag proxy is released, the original table cell actually jumps to wherever the release point was. How can I prevent this from happening? Essentially, I want to know where the ...
TITLE: YUI drag&drop proxy drag QUESTION: Question for YUI experts... I have a table and I've made each cell of the first row draggable by proxy. In IE, when the drag proxy is released, the original table cell actually jumps to wherever the release point was. How can I prevent this from happening? Essentially, I want ...
[ "javascript", "drag-and-drop", "yui" ]
6
2
1,071
1
0
2008-08-12T17:47:26.213000
2008-10-15T13:39:36.597000
9,081
9,083
grep: show lines surrounding each match
How do I grep and show the preceding and following 5 lines surrounding each matched line?
For BSD or GNU grep you can use -B num to set how many lines before the match and -A num for the number of lines after the match. grep -B 3 -A 2 foo README.txt If you want the same number of lines before and after you can use -C num. grep -C 3 foo README.txt This will show 3 lines before and 3 lines after.
grep: show lines surrounding each match How do I grep and show the preceding and following 5 lines surrounding each matched line?
TITLE: grep: show lines surrounding each match QUESTION: How do I grep and show the preceding and following 5 lines surrounding each matched line? ANSWER: For BSD or GNU grep you can use -B num to set how many lines before the match and -A num for the number of lines after the match. grep -B 3 -A 2 foo README.txt If ...
[ "search", "logging", "grep", "command-line-interface" ]
4,136
5,423
1,505,962
13
0
2008-08-12T17:55:32.813000
2008-08-12T17:57:43.307000
9,104
9,105
Add a bookmark that is only javascript, not a URL
I'm thinking that the reason I can't do this is because it might be a huge security hole, but here goes... I want to have a bookmark on my browser (FF3, preferably) that is only a snippet of javascript code. It would merely construct a URL based on the current date and then do a window.location = on that URL. I know th...
What you want is a bookmarklet they are easy to create and should work in most major browsers. Edit: Stack overflow seems not to allow creating bookmarklets in the context of the site, basically you can create a new bookmark and type the following in the location field javascript:window.location='http://www.google.com/...
Add a bookmark that is only javascript, not a URL I'm thinking that the reason I can't do this is because it might be a huge security hole, but here goes... I want to have a bookmark on my browser (FF3, preferably) that is only a snippet of javascript code. It would merely construct a URL based on the current date and ...
TITLE: Add a bookmark that is only javascript, not a URL QUESTION: I'm thinking that the reason I can't do this is because it might be a huge security hole, but here goes... I want to have a bookmark on my browser (FF3, preferably) that is only a snippet of javascript code. It would merely construct a URL based on the...
[ "javascript", "bookmarklet", "bookmarks" ]
59
73
77,167
5
0
2008-08-12T18:27:35.883000
2008-08-12T18:29:24.037000
9,122
1,495,476
Select all columns except one in MySQL?
I'm trying to use a select statement to get all of the columns from a certain MySQL table except one. Is there a simple way to do this? EDIT: There are 53 columns in this table (NOT MY DESIGN)
Actually there is a way, you need to have permissions of course for doing this... SET @sql = CONCAT('SELECT ', (SELECT REPLACE(GROUP_CONCAT(COLUMN_NAME), ',', '') FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ' ' AND TABLE_SCHEMA = ' '), ' FROM '); PREPARE stmt1 FROM @sql; EXECUTE stmt1; Replacing, and
Select all columns except one in MySQL? I'm trying to use a select statement to get all of the columns from a certain MySQL table except one. Is there a simple way to do this? EDIT: There are 53 columns in this table (NOT MY DESIGN)
TITLE: Select all columns except one in MySQL? QUESTION: I'm trying to use a select statement to get all of the columns from a certain MySQL table except one. Is there a simple way to do this? EDIT: There are 53 columns in this table (NOT MY DESIGN) ANSWER: Actually there is a way, you need to have permissions of cou...
[ "mysql", "select", "wildcard" ]
464
253
491,111
34
0
2008-08-12T18:45:55.207000
2009-09-29T23:35:25.420000
9,136
9,706
Enterprise Library CacheFactory.GetCacheManager Throws Null Ref
I'm trying to convert an application using the 1.1 version of the Enterprise Library Caching block over to the 2.0 version. I think where I'm really having a problem is that the configuration for the different EntLib pieces was split out over several files. Apparently, this used to be handled by the ConfigurationManage...
Looks like it was the configuration. I found a good example of the normal, one-file approach here: http://www.devx.com/dotnet/Article/31158/0/page/2 Using an external config file is actually trivial once you figure out the syntax for it. Ex.: In Web.config: In cachingconfiguration.config: Hopefully this helps somebody!
Enterprise Library CacheFactory.GetCacheManager Throws Null Ref I'm trying to convert an application using the 1.1 version of the Enterprise Library Caching block over to the 2.0 version. I think where I'm really having a problem is that the configuration for the different EntLib pieces was split out over several files...
TITLE: Enterprise Library CacheFactory.GetCacheManager Throws Null Ref QUESTION: I'm trying to convert an application using the 1.1 version of the Enterprise Library Caching block over to the 2.0 version. I think where I'm really having a problem is that the configuration for the different EntLib pieces was split out ...
[ "c#", "configuration", "enterprise-library" ]
6
4
9,182
1
0
2008-08-12T19:01:17.140000
2008-08-13T12:29:57.647000
9,161
9,176
Opening a file in my application from File Explorer
I've created my own application in VB.NET that saves its documents into a file with it's own custom extension (.eds). Assuming that I've properly associated the file extension with my application, how do I actually handle the processing of the selected file within my application when I double click on the file in File ...
Try this article but short answer is My.Application.CommandLineArgs
Opening a file in my application from File Explorer I've created my own application in VB.NET that saves its documents into a file with it's own custom extension (.eds). Assuming that I've properly associated the file extension with my application, how do I actually handle the processing of the selected file within my ...
TITLE: Opening a file in my application from File Explorer QUESTION: I've created my own application in VB.NET that saves its documents into a file with it's own custom extension (.eds). Assuming that I've properly associated the file extension with my application, how do I actually handle the processing of the select...
[ "vb.net", "file-extension" ]
5
2
1,330
1
0
2008-08-12T19:27:35.153000
2008-08-12T19:37:01.907000
9,173
559,613
Lingering assembly dependency in C# .NET
My C# project - we'll call it the SuperUI - used to make use of a class from an external assembly. Now it doesn't, but the compiler won't let me build the project without the assembly reference in place. Let me elaborate. This project used to throw and catch a custom exception class - the SuperException - which was der...
It's likely a transitive reference, where some type method call returns an instance of SuperException boxed ("downcast") as e.g. Exception, but from inspecting the code in the transitively included code, i.e. code from your external method calls, the compiler knows that you need to be able to have information about tha...
Lingering assembly dependency in C# .NET My C# project - we'll call it the SuperUI - used to make use of a class from an external assembly. Now it doesn't, but the compiler won't let me build the project without the assembly reference in place. Let me elaborate. This project used to throw and catch a custom exception c...
TITLE: Lingering assembly dependency in C# .NET QUESTION: My C# project - we'll call it the SuperUI - used to make use of a class from an external assembly. Now it doesn't, but the compiler won't let me build the project without the assembly reference in place. Let me elaborate. This project used to throw and catch a ...
[ "c#", ".net", "dependencies" ]
8
3
5,414
14
0
2008-08-12T19:35:44.590000
2009-02-18T02:23:00.040000
9,191
9,826
How to obtain good concurrent read performance from disk
I'd like to ask a question then follow it up with my own answer, but also see what answers other people have. We have two large files which we'd like to read from two separate threads concurrently. One thread will sequentially read fileA while the other thread will sequentially read fileB. There is no locking or commun...
The problem seems to be in Windows I/O scheduling policy. According to what I found here there are many ways for an O.S. to schedule disk requests. While Linux and others can choose between different policies, before Vista Windows was locked in a single policy: a FIFO queue, where all requests where splitted in 64 KB b...
How to obtain good concurrent read performance from disk I'd like to ask a question then follow it up with my own answer, but also see what answers other people have. We have two large files which we'd like to read from two separate threads concurrently. One thread will sequentially read fileA while the other thread wi...
TITLE: How to obtain good concurrent read performance from disk QUESTION: I'd like to ask a question then follow it up with my own answer, but also see what answers other people have. We have two large files which we'd like to read from two separate threads concurrently. One thread will sequentially read fileA while t...
[ "windows", "multithreading", "file-io" ]
26
12
9,358
6
0
2008-08-12T19:50:13.440000
2008-08-13T13:47:39.333000
9,228
9,233
ADO.NET Connection Pooling & SQLServer
What is it? How do I implement connection pooling with MS SQL? What are the performance ramifications when Executing many queries one-after-the other (i.e. using a loop with 30K+ iterations calling a stored procedure)? Executing a few queries that take a long time (10+ min)? Are there any best practices?
Connection pooling is a mechanism to re-use connections, as establishing a new connection is slow. If you use an MSSQL connection string and System.Data.SqlClient then you're already using it - in.Net this stuff is under the hood most of the time. A loop of 30k iterations might be better as a server side cursor (look u...
ADO.NET Connection Pooling & SQLServer What is it? How do I implement connection pooling with MS SQL? What are the performance ramifications when Executing many queries one-after-the other (i.e. using a loop with 30K+ iterations calling a stored procedure)? Executing a few queries that take a long time (10+ min)? Are t...
TITLE: ADO.NET Connection Pooling & SQLServer QUESTION: What is it? How do I implement connection pooling with MS SQL? What are the performance ramifications when Executing many queries one-after-the other (i.e. using a loop with 30K+ iterations calling a stored procedure)? Executing a few queries that take a long tim...
[ "sql-server", "performance", "ado.net" ]
3
3
2,510
4
0
2008-08-12T20:48:30.513000
2008-08-12T20:53:40.690000
9,231
9,260
Offsite backups
I was recently tasked with coming up with an offsite backup strategy. We have about 2TB of data that would need to be backed up so our needs are a little out of the norm. I looked into Iron Mountain and they wanted $12,000 a month! Does anyone have any suggestions on how best to handle backing up this much data on a bu...
You can buy external eSATA RAID boxes in the 8TB capacity range for $2600. I'm not saying that particular product is the right choice, but that's the kind of box that will do 6TB in RAID5 and still be portable enough to buy a couple of them and rotate them through the bank, like Stu says. Obviously if you have to have ...
Offsite backups I was recently tasked with coming up with an offsite backup strategy. We have about 2TB of data that would need to be backed up so our needs are a little out of the norm. I looked into Iron Mountain and they wanted $12,000 a month! Does anyone have any suggestions on how best to handle backing up this m...
TITLE: Offsite backups QUESTION: I was recently tasked with coming up with an offsite backup strategy. We have about 2TB of data that would need to be backed up so our needs are a little out of the norm. I looked into Iron Mountain and they wanted $12,000 a month! Does anyone have any suggestions on how best to handle...
[ "backup", "offsite" ]
8
8
1,300
9
0
2008-08-12T20:49:54.003000
2008-08-12T21:29:01.243000
9,240
9,502
Interfaces on different logic layers
Say you have an application divided into 3-tiers: GUI, business logic, and data access. In your business logic layer you have described your business objects: getters, setters, accessors, and so on... you get the idea. The interface to the business logic layer guarantees safe usage of the business logic, so all the met...
If I understand the question correctly, you've created a domain model and you would like to write an object-relational mapper to map between records in your database and your domain objects. However, you're concerned about polluting your domain model with the 'plumbing' code that would be necessary to read and write to...
Interfaces on different logic layers Say you have an application divided into 3-tiers: GUI, business logic, and data access. In your business logic layer you have described your business objects: getters, setters, accessors, and so on... you get the idea. The interface to the business logic layer guarantees safe usage ...
TITLE: Interfaces on different logic layers QUESTION: Say you have an application divided into 3-tiers: GUI, business logic, and data access. In your business logic layer you have described your business objects: getters, setters, accessors, and so on... you get the idea. The interface to the business logic layer guar...
[ "architecture" ]
12
7
5,339
9
0
2008-08-12T21:06:38.650000
2008-08-13T06:08:24.597000
9,256
16,362
How print Flex components in FireFox3?
Thanks to FireFox's buggy implementation of ActiveX components (it really should take an image of them when printing) Flex components (in our case charts) don't print in FX. They print fine in IE7, even IE6. We need these charts to print, but they also have dynamic content. I don't really want to draw them again as ima...
Using the ACPrintManager I was able to get firefox 3 to print perfectly! The one thing I had to add to the example was to check if stage was null, and callLater if the stage was null. private function initPrint():void { //if we don't have a stage, wait until the next frame and try again if ( stage == null ) { callLater...
How print Flex components in FireFox3? Thanks to FireFox's buggy implementation of ActiveX components (it really should take an image of them when printing) Flex components (in our case charts) don't print in FX. They print fine in IE7, even IE6. We need these charts to print, but they also have dynamic content. I don'...
TITLE: How print Flex components in FireFox3? QUESTION: Thanks to FireFox's buggy implementation of ActiveX components (it really should take an image of them when printing) Flex components (in our case charts) don't print in FX. They print fine in IE7, even IE6. We need these charts to print, but they also have dynam...
[ "apache-flex", "actionscript-3", "firefox" ]
5
3
1,509
2
0
2008-08-12T21:27:40.200000
2008-08-19T15:09:16.437000
9,272
971,143
How to find untracked files in a Perforce tree? (analogue of svn status)
Anybody have a script or alias to find untracked (really: unadded) files in a Perforce tree? EDIT: I updated the accepted answer on this one since it looks like P4V added support for this in the January 2009 release.
EDIT: Please use p4 status now. There is no need for jumping through hoops anymore. See @ColonelPanic's answer. In the Jan 2009 version of P4V, you can right-click on any folder in your workspace tree and click "reconcile offline work..." This will do a little processing then bring up a split-tree view of files that ar...
How to find untracked files in a Perforce tree? (analogue of svn status) Anybody have a script or alias to find untracked (really: unadded) files in a Perforce tree? EDIT: I updated the accepted answer on this one since it looks like P4V added support for this in the January 2009 release.
TITLE: How to find untracked files in a Perforce tree? (analogue of svn status) QUESTION: Anybody have a script or alias to find untracked (really: unadded) files in a Perforce tree? EDIT: I updated the accepted answer on this one since it looks like P4V added support for this in the January 2009 release. ANSWER: EDI...
[ "version-control", "language-agnostic", "perforce" ]
93
91
50,008
16
0
2008-08-12T21:44:32.070000
2009-06-09T16:28:42.070000
9,275
9,325
Using Parameters in MS Reporting Services (SQL Server 2008) against an ODBC data source
I writing a report in Visual Studio that takes a user input parameter and runs against an ODBC datasource. I would like to write the query manually and have reporting services replace part of the where clause with the parameter value before sending it to the database. What seems to be happening is that the @parmName I ...
It sounds like you'll need to treat the SQL Statement as an expression. For example: ="Select col1, col2 from table 1 Where col3 = " & Parameters!Param1.Value If the where clause is a string you would need to do the following: ="Select col1, col2 from table 1 Where col3 = '" & Parameters!Param1.Value & "'" Important: D...
Using Parameters in MS Reporting Services (SQL Server 2008) against an ODBC data source I writing a report in Visual Studio that takes a user input parameter and runs against an ODBC datasource. I would like to write the query manually and have reporting services replace part of the where clause with the parameter valu...
TITLE: Using Parameters in MS Reporting Services (SQL Server 2008) against an ODBC data source QUESTION: I writing a report in Visual Studio that takes a user input parameter and runs against an ODBC datasource. I would like to write the query manually and have reporting services replace part of the where clause with ...
[ "sql-server", "visual-studio", "sql-server-2008", "reporting-services", "odbc" ]
2
6
10,120
4
0
2008-08-12T21:47:45.277000
2008-08-12T23:43:15.183000
9,279
9,287
Keep Remote Directory Up-to-date
I absolutely love the Keep Remote Directory Up-to-date feature in Winscp. Unfortunately, I can't find anything as simple to use in OS X or Linux. I know the same thing can theoretically be accomplished using changedfiles or rsync, but I've always found the tutorials for both tools to be lacking and/or contradictory. I ...
How "real-time" do you want the syncing? I would still lean toward rsync since you know it is going to be fully supported on both platforms (Windows, too, with cygwin) and you can run it via a cron job. I have a super-simple bash file that I run on my system (this does not remove old files): #!/bin/sh rsync -avrz --pro...
Keep Remote Directory Up-to-date I absolutely love the Keep Remote Directory Up-to-date feature in Winscp. Unfortunately, I can't find anything as simple to use in OS X or Linux. I know the same thing can theoretically be accomplished using changedfiles or rsync, but I've always found the tutorials for both tools to be...
TITLE: Keep Remote Directory Up-to-date QUESTION: I absolutely love the Keep Remote Directory Up-to-date feature in Winscp. Unfortunately, I can't find anything as simple to use in OS X or Linux. I know the same thing can theoretically be accomplished using changedfiles or rsync, but I've always found the tutorials fo...
[ "linux", "macos", "ssh", "sftp" ]
45
19
42,224
18
0
2008-08-12T21:56:10.050000
2008-08-12T22:14:46.830000
9,289
9,297
Removing elements with Array.map in JavaScript
I would like to filter an array of items by using the map() function. Here is a code snippet: var filteredItems = items.map(function(item) { if(...some condition... ) { return item; } }); The problem is that filtered out items still uses space in the array and I would like to completely wipe them out. My specific code ...
You should use the filter method rather than map unless you want to mutate the items in the array, in addition to filtering. eg. var filteredItems = items.filter(function(item) { return...some condition...; }); [Edit: Of course you could always do sourceArray.filter(...).map(...) to both filter and mutate]
Removing elements with Array.map in JavaScript I would like to filter an array of items by using the map() function. Here is a code snippet: var filteredItems = items.map(function(item) { if(...some condition... ) { return item; } }); The problem is that filtered out items still uses space in the array and I would like...
TITLE: Removing elements with Array.map in JavaScript QUESTION: I would like to filter an array of items by using the map() function. Here is a code snippet: var filteredItems = items.map(function(item) { if(...some condition... ) { return item; } }); The problem is that filtered out items still uses space in the arra...
[ "javascript", "functional-programming", "data-manipulation", "client-side" ]
132
137
198,387
8
0
2008-08-12T22:21:30.263000
2008-08-12T22:38:28.327000
9,303
9,306
How do you retrieve selected text using Regex in C#?
How do you retrieve selected text using Regex in C#? I am looking for C# code that is equivalent to this Perl code: $indexVal = 0; if($string =~ /Index: (\d*)/){$indexVal = $1;}
int indexVal = 0; Regex re = new Regex(@"Index: (\d*)") Match m = re.Match(s) if(m.Success) indexVal = int.TryParse(m.Groups[1].toString()); I might have the group number wrong, but you should be able to figure it out from here.
How do you retrieve selected text using Regex in C#? How do you retrieve selected text using Regex in C#? I am looking for C# code that is equivalent to this Perl code: $indexVal = 0; if($string =~ /Index: (\d*)/){$indexVal = $1;}
TITLE: How do you retrieve selected text using Regex in C#? QUESTION: How do you retrieve selected text using Regex in C#? I am looking for C# code that is equivalent to this Perl code: $indexVal = 0; if($string =~ /Index: (\d*)/){$indexVal = $1;} ANSWER: int indexVal = 0; Regex re = new Regex(@"Index: (\d*)") Match ...
[ "c#", "regex", "perl" ]
13
7
2,420
5
0
2008-08-12T23:04:10.770000
2008-08-12T23:12:48.927000
9,304
9,310
C# 3.0 auto-properties — useful or not?
Note: This was posted when I was starting out C#. With 2014 knowledge, I can truly say that auto-properties are among the best things that ever happened to the C# language. I am used to create my properties in C# using a private and a public field: private string title; public string Title { get { return title; } set {...
We use them all the time in Stack Overflow. You may also be interested in a discussion of Properties vs. Public Variables. IMHO that's really what this is a reaction to, and for that purpose, it's great.
C# 3.0 auto-properties — useful or not? Note: This was posted when I was starting out C#. With 2014 knowledge, I can truly say that auto-properties are among the best things that ever happened to the C# language. I am used to create my properties in C# using a private and a public field: private string title; public st...
TITLE: C# 3.0 auto-properties — useful or not? QUESTION: Note: This was posted when I was starting out C#. With 2014 knowledge, I can truly say that auto-properties are among the best things that ever happened to the C# language. I am used to create my properties in C# using a private and a public field: private strin...
[ "c#", ".net", "automatic-properties" ]
158
121
50,291
17
0
2008-08-12T23:06:58.767000
2008-08-12T23:13:41.470000
9,314
9,387
"Could not find type" error loading a form in the Windows Forms Designer
I have a.NET 2.0 windows forms app, which makes heavy use of the ListView control. I've subclassed the ListView class into a templated SortableListView class, so it can be a bit smarter about how it displays things, and sort itself. Unfortunately this seems to break the Visual Studio Forms Designer, in both VS2005 and ...
when you added the listview, did you add it to the toolbox and then add it to the form? No, I just edited Main.Designer.cs and changed it from System.Windows.Forms.ListView to MyApp.Controls.SortableListView Suspecting it might have been due to the generics led me to actually finding a solution. For each class that I n...
"Could not find type" error loading a form in the Windows Forms Designer I have a.NET 2.0 windows forms app, which makes heavy use of the ListView control. I've subclassed the ListView class into a templated SortableListView class, so it can be a bit smarter about how it displays things, and sort itself. Unfortunately ...
TITLE: "Could not find type" error loading a form in the Windows Forms Designer QUESTION: I have a.NET 2.0 windows forms app, which makes heavy use of the ListView control. I've subclassed the ListView class into a templated SortableListView class, so it can be a bit smarter about how it displays things, and sort itse...
[ "c#", ".net", "winforms", "visual-studio-2008", "visual-studio-2005" ]
43
9
33,901
11
0
2008-08-12T23:17:00.540000
2008-08-13T01:23:58.633000
9,321
9,328
How do you create a static class?
How do you create a static class in C++? I should be able to do something like: cout << "bit 5 is " << BitParser::getBitAt(buffer, 5) << endl; Assuming I created the BitParser class. What would the BitParser class definition look like?
If you're looking for a way of applying the static keyword to a class, like you can in C# for example, then you won't be able to without using Managed C++. But the looks of your sample, you just need to create a public static method on your BitParser object. Like so: BitParser.h class BitParser { public: static bool ge...
How do you create a static class? How do you create a static class in C++? I should be able to do something like: cout << "bit 5 is " << BitParser::getBitAt(buffer, 5) << endl; Assuming I created the BitParser class. What would the BitParser class definition look like?
TITLE: How do you create a static class? QUESTION: How do you create a static class in C++? I should be able to do something like: cout << "bit 5 is " << BitParser::getBitAt(buffer, 5) << endl; Assuming I created the BitParser class. What would the BitParser class definition look like? ANSWER: If you're looking for a...
[ "c++", "class", "oop", "static-classes" ]
314
337
582,311
15
0
2008-08-12T23:35:00.613000
2008-08-12T23:43:37.773000
9,336
9,533
Generate sitemap on the fly
I'm trying to generate a sitemap.xml on the fly for a particular asp.net website. I found a couple solutions: chinookwebs cervoproject newtonking Chinookwebs is working great but seems a bit inactive right now and it's impossible to personalize the "priority" and the "changefreq" tags of each and every page, they all i...
Usually you'll use an HTTP Handler for this. Given a request for... http://www.yoursite.com/sitemap.axd...your handler will respond with a formatted XML sitemap. Whether that sitemap is generated on the fly, from a database, or some other method is up to the HTTP Handler implementation. Here's roughly what it would loo...
Generate sitemap on the fly I'm trying to generate a sitemap.xml on the fly for a particular asp.net website. I found a couple solutions: chinookwebs cervoproject newtonking Chinookwebs is working great but seems a bit inactive right now and it's impossible to personalize the "priority" and the "changefreq" tags of eac...
TITLE: Generate sitemap on the fly QUESTION: I'm trying to generate a sitemap.xml on the fly for a particular asp.net website. I found a couple solutions: chinookwebs cervoproject newtonking Chinookwebs is working great but seems a bit inactive right now and it's impossible to personalize the "priority" and the "chang...
[ ".net", "asp.net", "sitemap" ]
5
8
3,293
3
0
2008-08-13T00:01:11.780000
2008-08-13T07:19:07.713000
9,338
9,374
Quality Control / Log Monitoring
One of the articles I really enjoyed reading recently was Quality Control by Last.FM. In the spirit of this article, I was wondering if anyone else had favorite monitoring setups for web type applications. Or maybe if you don't believe in Log Monitoring, why? I'm looking for a mix of opinion slash experience here I gue...
We get a bunch of email/pager alerts from an older host/app/network monitoring environment that get gradually more abusive depending on severity of the problem/time taken to respond. Fortunately we all have thick skins and very broad senses of humour.:)
Quality Control / Log Monitoring One of the articles I really enjoyed reading recently was Quality Control by Last.FM. In the spirit of this article, I was wondering if anyone else had favorite monitoring setups for web type applications. Or maybe if you don't believe in Log Monitoring, why? I'm looking for a mix of op...
TITLE: Quality Control / Log Monitoring QUESTION: One of the articles I really enjoyed reading recently was Quality Control by Last.FM. In the spirit of this article, I was wondering if anyone else had favorite monitoring setups for web type applications. Or maybe if you don't believe in Log Monitoring, why? I'm looki...
[ "monitoring", "logging" ]
2
2
801
2
0
2008-08-13T00:01:56.800000
2008-08-13T01:04:19.013000
9,341
9,365
Running Javascript after control's selected value has been set
Simple ASP.NET application. I have two drop-down controls. On the first-drop down I have a JavaScript onChange event. The JavaScript enables the second drop-down and removes a value from it (the value selected in the first drop-down). If they click the blank first value of the drop-down, then the second drop-down will ...
<%@ Page Language="C#" %> Test Page One Two Three One Two Three Edit: Replaced the whole code. This should work even in your user control. I believe that Register.ClientScriptBlock is not working because the code you write in that block is executed before window.onload is called. And, I assume (I am not sure of this po...
Running Javascript after control's selected value has been set Simple ASP.NET application. I have two drop-down controls. On the first-drop down I have a JavaScript onChange event. The JavaScript enables the second drop-down and removes a value from it (the value selected in the first drop-down). If they click the blan...
TITLE: Running Javascript after control's selected value has been set QUESTION: Simple ASP.NET application. I have two drop-down controls. On the first-drop down I have a JavaScript onChange event. The JavaScript enables the second drop-down and removes a value from it (the value selected in the first drop-down). If t...
[ "asp.net", "javascript" ]
12
2
4,035
2
0
2008-08-13T00:11:03.863000
2008-08-13T00:53:34.077000
9,355
3,011,284
Programmatically select multiple files in windows explorer
I can display and select a single file in windows explorer like this: explorer.exe /select, "c:\path\to\file.txt" However, I can't work out how to select more than one file. None of the permutations of select I've tried work. Note: I looked at these pages for docs, neither helped. https://support.microsoft.com/kb/31485...
This should be possible with the shell function SHOpenFolderAndSelectItems EDIT Here is some sample code showing how to use the function in C/C++, without error checking: //Directory to open ITEMIDLIST *dir = ILCreateFromPath(_T("C:\\")); //Items in directory to select ITEMIDLIST *item1 = ILCreateFromPath(_T("C:\\Prog...
Programmatically select multiple files in windows explorer I can display and select a single file in windows explorer like this: explorer.exe /select, "c:\path\to\file.txt" However, I can't work out how to select more than one file. None of the permutations of select I've tried work. Note: I looked at these pages for d...
TITLE: Programmatically select multiple files in windows explorer QUESTION: I can display and select a single file in windows explorer like this: explorer.exe /select, "c:\path\to\file.txt" However, I can't work out how to select more than one file. None of the permutations of select I've tried work. Note: I looked at...
[ "windows", "explorer", "windows-shell" ]
24
18
22,226
9
0
2008-08-13T00:35:50.977000
2010-06-10T02:36:47.240000
9,361
16,650
ICE Faces fileInput file path and file name properties
I'd like to utilize an ICE Faces fileInput control to fill in the file path & file name for the input to an input field on a web page based on file that the user selects. How can I capture these properties without actually performing any file transfer operations?
I believe that the real answer is that you can't. The file path won't be sent by the browser for security reasons. The file name will be sent, however I don't believe it gets sent without an actual upload. The closest you could come, afaik, would be to forcibly kill the connection just when the upload starts. That woul...
ICE Faces fileInput file path and file name properties I'd like to utilize an ICE Faces fileInput control to fill in the file path & file name for the input to an input field on a web page based on file that the user selects. How can I capture these properties without actually performing any file transfer operations?
TITLE: ICE Faces fileInput file path and file name properties QUESTION: I'd like to utilize an ICE Faces fileInput control to fill in the file path & file name for the input to an input field on a web page based on file that the user selects. How can I capture these properties without actually performing any file tran...
[ "java", "ajax", "jsf", "icefaces" ]
5
0
1,731
1
0
2008-08-13T00:49:17.360000
2008-08-19T18:09:44.513000
9,372
9,380
How do I prevent IIS7 from dropping my cookies?
I'm using Windows Vista x64 with SP1, and I'm developing an ASP.NET app with IIS7 as the web server. I've got a problem where my cookies aren't "sticking" to the session, so I had a Google and found that there was a known issue with duplicate response headers overwriting instead of being added to the session. This prob...
Just a thought, have you got an underscore in the url. e.g. http://my_site? And one other thing, you're not running the app pool in web garden mode? i.e. Process Model -> Maximum Worker Processes: > 1 What type of app pool are you using - Integrated or Classic mode?
How do I prevent IIS7 from dropping my cookies? I'm using Windows Vista x64 with SP1, and I'm developing an ASP.NET app with IIS7 as the web server. I've got a problem where my cookies aren't "sticking" to the session, so I had a Google and found that there was a known issue with duplicate response headers overwriting ...
TITLE: How do I prevent IIS7 from dropping my cookies? QUESTION: I'm using Windows Vista x64 with SP1, and I'm developing an ASP.NET app with IIS7 as the web server. I've got a problem where my cookies aren't "sticking" to the session, so I had a Google and found that there was a known issue with duplicate response he...
[ "http", "iis", "iis-7", "cookies", "windows-vista" ]
6
4
5,158
1
0
2008-08-13T01:02:27.507000
2008-08-13T01:09:00.033000
9,376
34,033
ILMerge Best Practices
Do you use ILMerge? Do you use ILMerge to merge multiple assemblies to ease deployment of dll's? Have you found problems with deployment/versioning in production after ILMerging assemblies together? I'm looking for some advice in regards to using ILMerge to reduce deployment friction, if that is even possible.
I use ILMerge for almost all of my different applications. I have it integrated right into the release build process so what I end up with is one exe per application with no extra dll's. You can't ILMerge any C++ assemblies that have native code. You also can't ILMerge any assemblies that contain XAML for WPF (at least...
ILMerge Best Practices Do you use ILMerge? Do you use ILMerge to merge multiple assemblies to ease deployment of dll's? Have you found problems with deployment/versioning in production after ILMerging assemblies together? I'm looking for some advice in regards to using ILMerge to reduce deployment friction, if that is ...
TITLE: ILMerge Best Practices QUESTION: Do you use ILMerge? Do you use ILMerge to merge multiple assemblies to ease deployment of dll's? Have you found problems with deployment/versioning in production after ILMerging assemblies together? I'm looking for some advice in regards to using ILMerge to reduce deployment fri...
[ "c#", ".net", "deployment", "ilmerge" ]
74
46
60,317
12
0
2008-08-13T01:05:47.250000
2008-08-29T06:00:05.953000
9,383
9,384
Access a SQL Server 2005 Express Edition from a network computer
How do you access a SQL Server 2005 Express Edition from a application in a network computer? The access I need is both from application (Linq-to-SQL and ODBC) and from Management Studio
See this KB Article. How to configure SQL Server 2005 to allow remote connections. Oh, and remember that the SQLServer name will probably be MyMachineName\SQLExpress
Access a SQL Server 2005 Express Edition from a network computer How do you access a SQL Server 2005 Express Edition from a application in a network computer? The access I need is both from application (Linq-to-SQL and ODBC) and from Management Studio
TITLE: Access a SQL Server 2005 Express Edition from a network computer QUESTION: How do you access a SQL Server 2005 Express Edition from a application in a network computer? The access I need is both from application (Linq-to-SQL and ODBC) and from Management Studio ANSWER: See this KB Article. How to configure SQL...
[ "sql-server", "sql-server-2005-express" ]
1
5
1,256
2
0
2008-08-13T01:14:16.857000
2008-08-13T01:16:48.257000
9,409
9,426
Datagrid: Calculate Avg or Sum for column in Footer
I have a datagrid getting bound to a dataset, and I want to display the average result in the footer for a column populated with integers. The way I figure, there's 2 ways I can think of: 1."Use the Source, Luke" In the code where I'm calling DataGrid.DataBind(), use the DataTable.Compute() method ( or in my case DataS...
I don't know if either are necessarily better, but two alternate ways would be: Manually run through the table once you hit the footer and calculate from the on-screen text Manually retrieve the data and do the calculation separately from the bind Of course, #2 sort of offsets the advantages of data binding (assuming t...
Datagrid: Calculate Avg or Sum for column in Footer I have a datagrid getting bound to a dataset, and I want to display the average result in the footer for a column populated with integers. The way I figure, there's 2 ways I can think of: 1."Use the Source, Luke" In the code where I'm calling DataGrid.DataBind(), use ...
TITLE: Datagrid: Calculate Avg or Sum for column in Footer QUESTION: I have a datagrid getting bound to a dataset, and I want to display the average result in the footer for a column populated with integers. The way I figure, there's 2 ways I can think of: 1."Use the Source, Luke" In the code where I'm calling DataGri...
[ "asp.net", "vb.net", "datagrid", "report" ]
5
1
9,754
2
0
2008-08-13T02:15:17.093000
2008-08-13T02:59:55.943000
9,410
9,413
How do you pass a function as a parameter in C?
I want to create a function that performs a function passed by parameter on a set of data. How do you pass a function as a parameter in C?
Declaration A prototype for a function which takes a function parameter looks like the following: void func ( void (*f)(int) ); This states that the parameter f will be a pointer to a function which has a void return type and which takes a single int parameter. The following function ( print ) is an example of a functi...
How do you pass a function as a parameter in C? I want to create a function that performs a function passed by parameter on a set of data. How do you pass a function as a parameter in C?
TITLE: How do you pass a function as a parameter in C? QUESTION: I want to create a function that performs a function passed by parameter on a set of data. How do you pass a function as a parameter in C? ANSWER: Declaration A prototype for a function which takes a function parameter looks like the following: void fun...
[ "c", "function", "pointers", "syntax", "parameters" ]
815
970
811,917
10
0
2008-08-13T02:16:32.520000
2008-08-13T02:22:24.007000
9,433
9,453
Do you name controls on forms using the same convention as a private variable?
For some reason I never see this done. Is there a reason why not? For instance I like _blah for private variables, and at least in Windows Forms controls are by default private member variables, but I can't remember ever seeing them named that way. In the case that I am creating/storing control objects in local variabl...
This might be counter-intuitive for some, but we use the dreaded Hungarian notation for UI elements. The logic is simple: for any given data object you may have two or more controls associated with it. For example, you have a control that indicates a birth date on a text box, you will have: the text box a label indicat...
Do you name controls on forms using the same convention as a private variable? For some reason I never see this done. Is there a reason why not? For instance I like _blah for private variables, and at least in Windows Forms controls are by default private member variables, but I can't remember ever seeing them named th...
TITLE: Do you name controls on forms using the same convention as a private variable? QUESTION: For some reason I never see this done. Is there a reason why not? For instance I like _blah for private variables, and at least in Windows Forms controls are by default private member variables, but I can't remember ever se...
[ "user-interface", "oop", "coding-style" ]
10
13
1,345
11
0
2008-08-13T03:17:52.037000
2008-08-13T03:45:18.550000
9,434
688,199
Add multiple window.onload events
In my ASP.NET User Control I'm adding some JavaScript to the window.onload event: if (!Page.ClientScript.IsStartupScriptRegistered(this.GetType(), onloadScriptName)) Page.ClientScript.RegisterStartupScript(this.GetType(), onloadScriptName, "window.onload = function() {myFunction();};", true); My problem is, if there is...
Most of the "solutions" suggested are Microsoft-specific, or require bloated libraries. Here's one good way. This works with W3C-compliant browsers and with Microsoft IE. if (window.addEventListener) // W3C standard { window.addEventListener('load', myFunction, false); // NB **not** 'onload' } else if (window.attachEve...
Add multiple window.onload events In my ASP.NET User Control I'm adding some JavaScript to the window.onload event: if (!Page.ClientScript.IsStartupScriptRegistered(this.GetType(), onloadScriptName)) Page.ClientScript.RegisterStartupScript(this.GetType(), onloadScriptName, "window.onload = function() {myFunction();};",...
TITLE: Add multiple window.onload events QUESTION: In my ASP.NET User Control I'm adding some JavaScript to the window.onload event: if (!Page.ClientScript.IsStartupScriptRegistered(this.GetType(), onloadScriptName)) Page.ClientScript.RegisterStartupScript(this.GetType(), onloadScriptName, "window.onload = function() ...
[ "javascript", "asp.net", "events", "listener" ]
68
106
66,462
8
0
2008-08-13T03:18:32.893000
2009-03-27T01:34:31.973000
9,435
31,805
Planning and Building a mobile enabled site for your main site
We are in the initial planning stages of building out a mobile site for one of our clients. This mobile site will be in addition to the main site that we have already built for them. We've determined that the content is going to be a small subsection of the main site and will target the main audience that is expected t...
Newer phones come with WAP2 which uses HTML Mobile Profile (XHTML MP), which is quite similar to normal HTML. Older phones use Wireless Markup Language (WML). Depending on your audience I would consider making a mobile phone friendly version of the site using XHTML MP and drop WML completely. By mobile phone friendly I...
Planning and Building a mobile enabled site for your main site We are in the initial planning stages of building out a mobile site for one of our clients. This mobile site will be in addition to the main site that we have already built for them. We've determined that the content is going to be a small subsection of the...
TITLE: Planning and Building a mobile enabled site for your main site QUESTION: We are in the initial planning stages of building out a mobile site for one of our clients. This mobile site will be in addition to the main site that we have already built for them. We've determined that the content is going to be a small...
[ "html", "mobile", "responsive-design", "wap", "wml" ]
7
4
2,780
8
0
2008-08-13T03:23:55.987000
2008-08-28T07:39:01.357000
9,455
113,793
Running xinc on OpenBSD's Apache Server
Has anyone been able to get xinc to run correctly under OpenBSD's chrooted default Apache? I'd like to keep our development server running fully chrooted just like our Production server so that we make sure our code runs just fine chrooted.
Have you posted the issue on the Xinc bug tracker? Xinc itself should run fine as it runs both as a daemon and as a web app. As you alluded to, the issue may be that the daemon is not running in a chroot'ed environment where as the web interface is, leading to either side not grabbing the files.
Running xinc on OpenBSD's Apache Server Has anyone been able to get xinc to run correctly under OpenBSD's chrooted default Apache? I'd like to keep our development server running fully chrooted just like our Production server so that we make sure our code runs just fine chrooted.
TITLE: Running xinc on OpenBSD's Apache Server QUESTION: Has anyone been able to get xinc to run correctly under OpenBSD's chrooted default Apache? I'd like to keep our development server running fully chrooted just like our Production server so that we make sure our code runs just fine chrooted. ANSWER: Have you pos...
[ "php", "continuous-integration", "openbsd", "xinc" ]
11
4
662
4
0
2008-08-13T03:47:52.397000
2008-09-22T08:26:34.580000
9,467
9,474
Best way to write a RESTful service "client" in .Net?
What techniques do people use to "consume" services in the REST stile on.Net? Plain http client? Related to this: many rest services are now using JSON (its tighter and faster) - so what JSON lib is used?
My approach was Write some libraries and interfaces to serialize your objects into REST-compatible XML. You can't neccessarily just use the built-in serializers, because your service may not accept the same kind of XML that.NET wants to give you. Example: When passing booleans to a Rails REST service, "true" gets unser...
Best way to write a RESTful service "client" in .Net? What techniques do people use to "consume" services in the REST stile on.Net? Plain http client? Related to this: many rest services are now using JSON (its tighter and faster) - so what JSON lib is used?
TITLE: Best way to write a RESTful service "client" in .Net? QUESTION: What techniques do people use to "consume" services in the REST stile on.Net? Plain http client? Related to this: many rest services are now using JSON (its tighter and faster) - so what JSON lib is used? ANSWER: My approach was Write some librari...
[ ".net", "web-services", "rest" ]
7
5
2,679
1
0
2008-08-13T04:04:05.877000
2008-08-13T04:30:50.487000
9,472
9,531
WCF Backward Compatibility Issue
I have a WCF service that I have to reference from a.net 2.0 project. I have tried to reference it using the " add web reference " method but it messes up the params. For example, I have a method in the service that expects a char[] to be passed in, but when I add the web reference, the method expects an int[]. So then...
One of those instances that you need to edit the WSDL. For a start a useful tool http://codeplex.com/storm
WCF Backward Compatibility Issue I have a WCF service that I have to reference from a.net 2.0 project. I have tried to reference it using the " add web reference " method but it messes up the params. For example, I have a method in the service that expects a char[] to be passed in, but when I add the web reference, the...
TITLE: WCF Backward Compatibility Issue QUESTION: I have a WCF service that I have to reference from a.net 2.0 project. I have tried to reference it using the " add web reference " method but it messes up the params. For example, I have a method in the service that expects a char[] to be passed in, but when I add the ...
[ "c#", ".net", "wcf" ]
0
2
1,172
4
0
2008-08-13T04:27:31.773000
2008-08-13T07:14:23.353000
9,473
9,481
RaisePostBackEvent not firing
I have a custom control that implements IPostBackEventHandler. Some client-side events invoke __doPostBack(controlID, eventArgs). The control is implemented in two different user controls. In one control, RaisePostBackEvent is fired on the server-side when __doPostBack is invoked. In the other control, RaisePostBackEve...
There's a lot of ways this can fall apart. Are you adding the control to the page dynamically in code behind? If so alot of times your UniqueID can be off - even though the client id's are equal. Do you have a code sample that might demonstrate what you're doing?
RaisePostBackEvent not firing I have a custom control that implements IPostBackEventHandler. Some client-side events invoke __doPostBack(controlID, eventArgs). The control is implemented in two different user controls. In one control, RaisePostBackEvent is fired on the server-side when __doPostBack is invoked. In the o...
TITLE: RaisePostBackEvent not firing QUESTION: I have a custom control that implements IPostBackEventHandler. Some client-side events invoke __doPostBack(controlID, eventArgs). The control is implemented in two different user controls. In one control, RaisePostBackEvent is fired on the server-side when __doPostBack is...
[ "asp.net", "postback" ]
5
1
5,001
2
0
2008-08-13T04:30:30.610000
2008-08-13T04:45:06.557000
9,486
9,491
How do I make Visual Studio auto generate braces for a function block?
I could swear I've seen people typing function headers and then hitting some key combination to auto-create function braces and insert the cursor between them like so: void foo()_ to void foo() { _ } Is this a built-in feature?
Check out Resharper - it is a Visual Studio add-on with this feature, among many other development helps. Also see C# Completer, another add-on. If you want to roll your own, check out this article. Insane that one should have to do that, though.
How do I make Visual Studio auto generate braces for a function block? I could swear I've seen people typing function headers and then hitting some key combination to auto-create function braces and insert the cursor between them like so: void foo()_ to void foo() { _ } Is this a built-in feature?
TITLE: How do I make Visual Studio auto generate braces for a function block? QUESTION: I could swear I've seen people typing function headers and then hitting some key combination to auto-create function braces and insert the cursor between them like so: void foo()_ to void foo() { _ } Is this a built-in feature? AN...
[ "c#", "visual-studio" ]
11
5
6,977
5
0
2008-08-13T05:09:33.233000
2008-08-13T05:20:34.147000
9,508
9,526
C# 2.0 code consuming assemblies compiled with C# 3.0
This should be fine seeing as the CLR hasn't actually changed? The boxes running the C# 2.0 code have had.NET 3.5 rolled out. The background is that we have a windows service (.NET 2.0 exe built with VS2005, deployed to ~150 servers) that dynamically loads assemblies (almost like plug-ins) to complete various work item...
C#3 and.Net 3.5 adds new assemblies, but the IL is unchanged. This means that with.Net 2 assemblies you can compile and use C#3, as long as you don't use Linq or anything else that references System.Linq or System.Core yield, var, lambda syntax, anon types and initialisers are all compiler cleverness. The IL they produ...
C# 2.0 code consuming assemblies compiled with C# 3.0 This should be fine seeing as the CLR hasn't actually changed? The boxes running the C# 2.0 code have had.NET 3.5 rolled out. The background is that we have a windows service (.NET 2.0 exe built with VS2005, deployed to ~150 servers) that dynamically loads assemblie...
TITLE: C# 2.0 code consuming assemblies compiled with C# 3.0 QUESTION: This should be fine seeing as the CLR hasn't actually changed? The boxes running the C# 2.0 code have had.NET 3.5 rolled out. The background is that we have a windows service (.NET 2.0 exe built with VS2005, deployed to ~150 servers) that dynamical...
[ "c#", ".net", ".net-3.5" ]
11
6
991
3
0
2008-08-13T06:17:00.570000
2008-08-13T06:58:35.197000
9,543
9,643
How do you deploy your SharePoint solutions?
I am now in the process of planning the deployment of a SharePoint solution into a production environment. I have read about some tools that promise an easy way to automate this process, but nothing that seems to fit my scenario. In the testing phase I have used SharePoint Designer to copy site content between the diff...
I would also suggest checking out the SharePoint Content Deployment Wizard by Chris O'Brien. http://www.codeplex.com/SPDeploymentWizard Should help smooth the process you describe, and it's a nice tool for your kitbag regardless
How do you deploy your SharePoint solutions? I am now in the process of planning the deployment of a SharePoint solution into a production environment. I have read about some tools that promise an easy way to automate this process, but nothing that seems to fit my scenario. In the testing phase I have used SharePoint D...
TITLE: How do you deploy your SharePoint solutions? QUESTION: I am now in the process of planning the deployment of a SharePoint solution into a production environment. I have read about some tools that promise an easy way to automate this process, but nothing that seems to fit my scenario. In the testing phase I have...
[ "sharepoint", "deployment", "production" ]
18
4
15,570
3
0
2008-08-13T07:33:45.810000
2008-08-13T10:35:58.363000
9,570
10,888
What libraries do I need to link my mixed-mode application to?
I'm integrating.NET support into our C++ application. It's an old-school MFC application, with 1 extra file compiled with the "/clr" option that references a CWinFormsControl. I'm not allowed to remove the linker flag "/NODEFAULTLIB". (We have our own build management system, not Visual Studio's.) This means I have to ...
How I solved it: link with "/FORCE:MULTIPLE /verbose" (that links ok) and set the output aside. link with "/NODEFAULTIB /verbose" and trace all unresolveds in the output of the previous step and add the libraries 1 by 1. This resulted in doubles: "AAA.lib: XXX already defined in BBB.lib" Then I finally got it: Recompil...
What libraries do I need to link my mixed-mode application to? I'm integrating.NET support into our C++ application. It's an old-school MFC application, with 1 extra file compiled with the "/clr" option that references a CWinFormsControl. I'm not allowed to remove the linker flag "/NODEFAULTLIB". (We have our own build...
TITLE: What libraries do I need to link my mixed-mode application to? QUESTION: I'm integrating.NET support into our C++ application. It's an old-school MFC application, with 1 extra file compiled with the "/clr" option that references a CWinFormsControl. I'm not allowed to remove the linker flag "/NODEFAULTLIB". (We ...
[ "linker", "c++-cli", "mixed-mode" ]
1
1
1,202
3
0
2008-08-13T08:05:00.337000
2008-08-14T11:01:33.623000
9,589
12,064
Is there a good tool for Makefile generation?
I'm looking for a tool which can generate a Makefile for a C/C++ project for different compilers ( GCC, Microsoft Visual C++, C++Builder, etc.) and different platforms (Windows, Linux, and Mac).
Other suggestions you may want to consider: Scons is a cross-platform, cross-compiler build library, uses Python scripting for the build systems. Used in a variety of large projects, and performs very well. If you're using Qt, QMake is a nice build system too. CMake is also pretty sweet. Finally, if all else fails...
Is there a good tool for Makefile generation? I'm looking for a tool which can generate a Makefile for a C/C++ project for different compilers ( GCC, Microsoft Visual C++, C++Builder, etc.) and different platforms (Windows, Linux, and Mac).
TITLE: Is there a good tool for Makefile generation? QUESTION: I'm looking for a tool which can generate a Makefile for a C/C++ project for different compilers ( GCC, Microsoft Visual C++, C++Builder, etc.) and different platforms (Windows, Linux, and Mac). ANSWER: Other suggestions you may want to consider: Scons is...
[ "c++", "c", "cross-platform", "makefile" ]
51
40
64,148
10
0
2008-08-13T08:47:36.363000
2008-08-15T08:09:26.123000
9,591
9,919
What WPF books would you recommend?
Well, i've got a nice WPF book its called Sams Windows Presentation Foundation Unleashed. I really like to read and learn with it. Are there any other WPF books you could recommend?
I've found the following books very useful: Windows Presentation Foundation Unleashed - Adam Nathan You mention you already have this book, however I wanted to give my opinion on it. It is a great book for the newcomer - it is printed in full color which is a great help for visualizing both xaml and concepts for WPF. E...
What WPF books would you recommend? Well, i've got a nice WPF book its called Sams Windows Presentation Foundation Unleashed. I really like to read and learn with it. Are there any other WPF books you could recommend?
TITLE: What WPF books would you recommend? QUESTION: Well, i've got a nice WPF book its called Sams Windows Presentation Foundation Unleashed. I really like to read and learn with it. Are there any other WPF books you could recommend? ANSWER: I've found the following books very useful: Windows Presentation Foundation...
[ "wpf" ]
65
76
87,418
9
0
2008-08-13T08:59:42.783000
2008-08-13T14:57:08.973000
9,601
9,630
Visual Studio 2008 Window layout annoyance
I'm having a weird issue with Visual Studio 2008. Every time I fire it up, the solution explorer is about an inch wide. It's like it can't remember it's layout settings. Every un-docked window is in the position I place it. But if I dock a window, it's position is saved, but it's size will be reset to very-narrow (arou...
I had the same problem. It turned out that if the VS window was non-maximized, it was really small. So after making the non-maximized wider, the problem disappeared.
Visual Studio 2008 Window layout annoyance I'm having a weird issue with Visual Studio 2008. Every time I fire it up, the solution explorer is about an inch wide. It's like it can't remember it's layout settings. Every un-docked window is in the position I place it. But if I dock a window, it's position is saved, but i...
TITLE: Visual Studio 2008 Window layout annoyance QUESTION: I'm having a weird issue with Visual Studio 2008. Every time I fire it up, the solution explorer is about an inch wide. It's like it can't remember it's layout settings. Every un-docked window is in the position I place it. But if I dock a window, it's positi...
[ "visual-studio" ]
8
11
6,611
3
0
2008-08-13T09:24:10.020000
2008-08-13T10:04:49.143000
9,612
9,638
Setting Group Type for new Active Directory Entry in VB.NET
I'm trying to set the group type for a new Active Directory Entry via VB.NET and DirectoryServices to create a distribution list. How do I access the ADS_GROUP_TYPE enumerations? Specifically I'm after ADS_GROUP_TYPE_GLOBAL_GROUP.
You're correct, you can't actually get access to the enumerations. Just a wee nitpick, this constant doesn't need to be an object, you can make it an int32 - Const ADS_GROUP_TYPE_GLOBAL_GROUP As Object = &H2
Setting Group Type for new Active Directory Entry in VB.NET I'm trying to set the group type for a new Active Directory Entry via VB.NET and DirectoryServices to create a distribution list. How do I access the ADS_GROUP_TYPE enumerations? Specifically I'm after ADS_GROUP_TYPE_GLOBAL_GROUP.
TITLE: Setting Group Type for new Active Directory Entry in VB.NET QUESTION: I'm trying to set the group type for a new Active Directory Entry via VB.NET and DirectoryServices to create a distribution list. How do I access the ADS_GROUP_TYPE enumerations? Specifically I'm after ADS_GROUP_TYPE_GLOBAL_GROUP. ANSWER: Yo...
[ "vb.net", "active-directory", "directoryservices", "distribution-list" ]
3
0
4,165
3
0
2008-08-13T09:40:12.890000
2008-08-13T10:19:05.120000
9,614
9,635
Bidirectional outer join
Suppose we have a table A: itemid mark 1 5 2 3 and table B: itemid mark 1 3 3 5 I want to join A*B on A.itemid=B.itemid both right and left ways. i.e. result: itemid A.mark B.mark 1 5 3 2 3 NULL 3 NULL 5 Is there a way to do it in one query in MySQL?
It's called a full outer join and it's not supported natively in MySQL, judging from its docs. You can work around this limitation using UNION as described in the comments to the page I linked to. [edit] Since others posted snippets, here you go. You can see explanation on the linked page. SELECT * FROM A LEFT JOIN B O...
Bidirectional outer join Suppose we have a table A: itemid mark 1 5 2 3 and table B: itemid mark 1 3 3 5 I want to join A*B on A.itemid=B.itemid both right and left ways. i.e. result: itemid A.mark B.mark 1 5 3 2 3 NULL 3 NULL 5 Is there a way to do it in one query in MySQL?
TITLE: Bidirectional outer join QUESTION: Suppose we have a table A: itemid mark 1 5 2 3 and table B: itemid mark 1 3 3 5 I want to join A*B on A.itemid=B.itemid both right and left ways. i.e. result: itemid A.mark B.mark 1 5 3 2 3 NULL 3 NULL 5 Is there a way to do it in one query in MySQL? ANSWER: It's called a ful...
[ "sql", "mysql" ]
8
8
2,022
3
0
2008-08-13T09:41:43.917000
2008-08-13T10:15:39.293000
9,632
2,523,372
WPF: How to style or disable the default ContextMenu of a TextBox
Apparantly when users right-click in our WPF application, and they use the Windows Classic theme, the default ContextMenu of the TextBox (which contains Copy, Cut and Paste) has a black background. I know this works well: But this doesn't work: Does anyone know how to style or disable the default ContextMenu for all Te...
Due to a late bug report we discovered that we cannot use the ApplicationComands Cut Paste and Copy directly in a partial trusted application. Therefor, using these commands in any Commmand of your controls will do absolutely nothing when executed. So in essence Brads answer was almost there, it sure looked the right w...
WPF: How to style or disable the default ContextMenu of a TextBox Apparantly when users right-click in our WPF application, and they use the Windows Classic theme, the default ContextMenu of the TextBox (which contains Copy, Cut and Paste) has a black background. I know this works well: But this doesn't work: Does anyo...
TITLE: WPF: How to style or disable the default ContextMenu of a TextBox QUESTION: Apparantly when users right-click in our WPF application, and they use the Windows Classic theme, the default ContextMenu of the TextBox (which contains Copy, Cut and Paste) has a black background. I know this works well: But this doesn...
[ "wpf", "xaml", ".net-3.5" ]
31
9
42,384
6
0
2008-08-13T10:05:41.747000
2010-03-26T13:04:21.047000
9,666
9,788
Is accessing a variable in C# an atomic operation?
I've been raised to believe that if multiple threads can access a variable, then all reads from and writes to that variable must be protected by synchronization code, such as a "lock" statement, because the processor might switch to another thread halfway through a write. However, I was looking through System.Web.Secur...
For the definitive answer go to the spec.:) Partition I, Section 12.6.6 of the CLI spec states: "A conforming CLI shall guarantee that read and write access to properly aligned memory locations no larger than the native word size is atomic when all the write accesses to a location are the same size." So that confirms t...
Is accessing a variable in C# an atomic operation? I've been raised to believe that if multiple threads can access a variable, then all reads from and writes to that variable must be protected by synchronization code, such as a "lock" statement, because the processor might switch to another thread halfway through a wri...
TITLE: Is accessing a variable in C# an atomic operation? QUESTION: I've been raised to believe that if multiple threads can access a variable, then all reads from and writes to that variable must be protected by synchronization code, such as a "lock" statement, because the processor might switch to another thread hal...
[ "c#", "multithreading" ]
66
38
27,452
15
0
2008-08-13T11:41:29.307000
2008-08-13T13:24:41.533000
9,667
9,670
Validating a Win32 Window Handle
Given a handle of type HWND is it possible to confirm that the handle represents a real window?
There is a function IsWindow which does exactly what you asked for. BOOL isRealHandle = IsWindow(unknwodnHandle); Look at this link for more information.
Validating a Win32 Window Handle Given a handle of type HWND is it possible to confirm that the handle represents a real window?
TITLE: Validating a Win32 Window Handle QUESTION: Given a handle of type HWND is it possible to confirm that the handle represents a real window? ANSWER: There is a function IsWindow which does exactly what you asked for. BOOL isRealHandle = IsWindow(unknwodnHandle); Look at this link for more information.
[ "c++", "windows", "winapi" ]
9
16
2,356
2
0
2008-08-13T11:42:13.860000
2008-08-13T11:46:44.537000
9,673
9,685
How do I remove duplicates from a C# array?
I have been working with a string[] array in C# that gets returned from a function call. I could possibly cast to a Generic collection, but I was wondering if there was a better way to do it, possibly by using a temp array. What is the best way to remove duplicates from a C# array?
You could possibly use a LINQ query to do this: int[] s = { 1, 2, 3, 3, 4}; int[] q = s.Distinct().ToArray();
How do I remove duplicates from a C# array? I have been working with a string[] array in C# that gets returned from a function call. I could possibly cast to a Generic collection, but I was wondering if there was a better way to do it, possibly by using a temp array. What is the best way to remove duplicates from a C# ...
TITLE: How do I remove duplicates from a C# array? QUESTION: I have been working with a string[] array in C# that gets returned from a function call. I could possibly cast to a Generic collection, but I was wondering if there was a better way to do it, possibly by using a temp array. What is the best way to remove dup...
[ "c#", "arrays", "duplicates" ]
247
496
422,895
29
0
2008-08-13T11:48:44.360000
2008-08-13T12:03:05.940000
9,675
9,692
Document Server: Handling Concurrent Saves
I'm implementing a document server. Currently, if two users open the same document, then modify it and save the changes, the document's state will be undefined (either the first user's changes are saved permanently, or the second's). This is entirely unsatisfactory. I considered two possibilities to solve this problem:...
My suggestion would be something like your first one. When the first user (Bob) opens the document, he acquires a lock so that other users can only read the current document. If the user saves the document while he is using it, he keeps the lock. Only when he exits the document, it is unlocked and other people can edit...
Document Server: Handling Concurrent Saves I'm implementing a document server. Currently, if two users open the same document, then modify it and save the changes, the document's state will be undefined (either the first user's changes are saved permanently, or the second's). This is entirely unsatisfactory. I consider...
TITLE: Document Server: Handling Concurrent Saves QUESTION: I'm implementing a document server. Currently, if two users open the same document, then modify it and save the changes, the document's state will be undefined (either the first user's changes are saved permanently, or the second's). This is entirely unsatisf...
[ "concurrency", "locking", "versioning" ]
2
0
653
3
0
2008-08-13T11:49:14.250000
2008-08-13T12:10:43.240000
9,693
9,732
Visual Studio 2005 Macros stop working when Visual Studio 2008 is installed
I have a number of macros written for Visual Studio 2005, but they have since stopped working once I installed Visual Studio 2008 on my computer. No error is returned by the macro when I try and run it, and the environment merely shows the hourglass for a second and then returns to the normal cursor. Currently uninstal...
You may need to install (reinstall) VS 2005 SP1, since a security update from Microsoft (KB928365) on July 10 may have caused the issue.
Visual Studio 2005 Macros stop working when Visual Studio 2008 is installed I have a number of macros written for Visual Studio 2005, but they have since stopped working once I installed Visual Studio 2008 on my computer. No error is returned by the macro when I try and run it, and the environment merely shows the hour...
TITLE: Visual Studio 2005 Macros stop working when Visual Studio 2008 is installed QUESTION: I have a number of macros written for Visual Studio 2005, but they have since stopped working once I installed Visual Studio 2008 on my computer. No error is returned by the macro when I try and run it, and the environment mer...
[ "visual-studio", "visual-studio-2008", "ide", "visual-studio-2005", "macros" ]
0
3
1,155
1
0
2008-08-13T12:11:07.657000
2008-08-13T12:51:50.490000