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
39,288
39,293
What exactly consists of 'Business Logic' in an application?
I have heard umpteen times that we 'should not mix business logic with other code' or statements like that. I think every single code I write (processing steps I mean) consists of logic that is related to the business requirements.. Can anyone tell me what exactly consists of business logic? How can it be distinguished...
Simply define what you are doing in plain English. When you are saying things businesswise, like "make those suffer", "steal that money", "destroy this portion of earth" you are talking about business layer. To make it clear, things that get you excited go here. When you are saying "show this here", "do not show that",...
What exactly consists of 'Business Logic' in an application? I have heard umpteen times that we 'should not mix business logic with other code' or statements like that. I think every single code I write (processing steps I mean) consists of logic that is related to the business requirements.. Can anyone tell me what ex...
TITLE: What exactly consists of 'Business Logic' in an application? QUESTION: I have heard umpteen times that we 'should not mix business logic with other code' or statements like that. I think every single code I write (processing steps I mean) consists of logic that is related to the business requirements.. Can anyo...
[ "business-logic-layer" ]
20
49
6,843
8
0
2008-09-02T11:40:00.427000
2008-09-02T11:43:39.403000
39,304
39,314
Do C++ logging frameworks sacrifice reusability?
In C++, there isn't a de-facto standard logging tool. In my experience, shops roll their own. This creates a bit of a problem, however, when trying to create reusable software components. If everything in your system depends on the logging component, this makes the software less reusable, basically forcing any downstre...
Yes. But dependency injection will help in this case. You can create an abstract logging base-class and create implementations for the logging-frameworks you want to use. Your components are just dependent on the abstract base-class. And you inject the implementations along with al their dependencies as needed.
Do C++ logging frameworks sacrifice reusability? In C++, there isn't a de-facto standard logging tool. In my experience, shops roll their own. This creates a bit of a problem, however, when trying to create reusable software components. If everything in your system depends on the logging component, this makes the softw...
TITLE: Do C++ logging frameworks sacrifice reusability? QUESTION: In C++, there isn't a de-facto standard logging tool. In my experience, shops roll their own. This creates a bit of a problem, however, when trying to create reusable software components. If everything in your system depends on the logging component, th...
[ "c++", "logging", "code-reuse" ]
3
5
1,175
3
0
2008-09-02T11:47:46.010000
2008-09-02T11:51:29.290000
39,331
39,344
What generic techniques can be applied to optimize SQL queries?
What techniques can be applied effectively to improve the performance of SQL queries? Are there any general rules that apply?
Use primary keys Avoid select * Be as specific as you can when building your conditional statements De-normalisation can often be more efficient Table variables and temporary tables (where available) will often be better than using a large source table Partitioned views Employ indices and constraints
What generic techniques can be applied to optimize SQL queries? What techniques can be applied effectively to improve the performance of SQL queries? Are there any general rules that apply?
TITLE: What generic techniques can be applied to optimize SQL queries? QUESTION: What techniques can be applied effectively to improve the performance of SQL queries? Are there any general rules that apply? ANSWER: Use primary keys Avoid select * Be as specific as you can when building your conditional statements De-...
[ "sql", "performance" ]
13
19
5,690
11
0
2008-09-02T11:59:59.240000
2008-09-02T12:06:43.170000
39,357
40,819
Windows Vista Virtual PC-image for Visual Studio-development minimized
Which features and services in Vista can you remove with nLite (or tool of choice) to make a Virtual PC-image of Vista as small as possible? The VPC must work with development in Visual Studio. A normal install of Vista today is like 12-14 GB, which is silly when I got it to work with Visual Studio at 4 GB. But with Vi...
You can try and cut stuff out with vLite, but unless you cut out a real lot it's not going to save a ton of drive space. Here's your best bets: Disable Hibernate and run disk cleanup to remove any hibernation file. Disable System restore entirely and use disk cleanup to remove all restore points... this will save an en...
Windows Vista Virtual PC-image for Visual Studio-development minimized Which features and services in Vista can you remove with nLite (or tool of choice) to make a Virtual PC-image of Vista as small as possible? The VPC must work with development in Visual Studio. A normal install of Vista today is like 12-14 GB, which...
TITLE: Windows Vista Virtual PC-image for Visual Studio-development minimized QUESTION: Which features and services in Vista can you remove with nLite (or tool of choice) to make a Virtual PC-image of Vista as small as possible? The VPC must work with development in Visual Studio. A normal install of Vista today is li...
[ "windows-vista", "virtual-pc" ]
5
3
1,573
1
0
2008-09-02T12:12:03.080000
2008-09-02T22:22:19.167000
39,364
39,387
Failed to load Zend/Loader.php. Trying to work out why?
I have inherited a client site which crashes every 3 or 4 days. It is built using the zend-framework with which I have no knowledge. The following code: Is causing the following error: [Tue Sep 02 12:58:45 2008] [error] [client 78.***.***.32] PHP Warning: require_once(Zend/Loader.php) [function.require-once]: failed to...
for a start I think your include path should maybe have a trailing slash. Here is an example of mine: set_include_path('../library/ZendFramework-1.5.2/library/:../application/classes/:../application/classes/excpetions/:../application/forms/'); You bootstrap file will be included by another file (probably an index.php f...
Failed to load Zend/Loader.php. Trying to work out why? I have inherited a client site which crashes every 3 or 4 days. It is built using the zend-framework with which I have no knowledge. The following code: Is causing the following error: [Tue Sep 02 12:58:45 2008] [error] [client 78.***.***.32] PHP Warning: require_...
TITLE: Failed to load Zend/Loader.php. Trying to work out why? QUESTION: I have inherited a client site which crashes every 3 or 4 days. It is built using the zend-framework with which I have no knowledge. The following code: Is causing the following error: [Tue Sep 02 12:58:45 2008] [error] [client 78.***.***.32] PHP...
[ "php", "zend-framework" ]
2
3
37,729
6
0
2008-09-02T12:16:50.977000
2008-09-02T12:35:03.197000
39,365
39,472
Developing and Testing a Facebook application
Typically I develop my websites on trunk, then merge changes to a testing branch where they are put on a 'beta' website, and then finally they are merged onto a live branch and put onto the live website. With a Facebook application things are a bit tricky. As you can't view a Facebook application through a normal web b...
The way I and my partner did it was we each made our own private Facebook applications, that pointed to our IP address where we worked on it. Since we worked in the same place, we each picked a different port, and had our router forward that port to our local IP address. It was kinda slow to refresh a page, but it work...
Developing and Testing a Facebook application Typically I develop my websites on trunk, then merge changes to a testing branch where they are put on a 'beta' website, and then finally they are merged onto a live branch and put onto the live website. With a Facebook application things are a bit tricky. As you can't view...
TITLE: Developing and Testing a Facebook application QUESTION: Typically I develop my websites on trunk, then merge changes to a testing branch where they are put on a 'beta' website, and then finally they are merged onto a live branch and put onto the live website. With a Facebook application things are a bit tricky....
[ "testing", "web-applications", "facebook" ]
41
14
24,155
8
0
2008-09-02T12:18:59.130000
2008-09-02T13:12:55.867000
39,389
39,393
How to add a web part zone in SharePoint using SharePoint Designer
I need to add a web part zone to a wiki page. I'm opening the page using SharePoint Designer, but there doesn't seem to be an obvious way (such as a menu) to add a Web Part Zone.
from: http://office.microsoft.com/en-us/sharepointdesigner/HA101513941033.aspx Insert a Web Part zone In Office SharePoint Designer 2007, open the page where you want to insert the Web Part zone. If the Web Parts task pane is not already open, open it by clicking Web Parts on the Task Panes menu. In Design view, click ...
How to add a web part zone in SharePoint using SharePoint Designer I need to add a web part zone to a wiki page. I'm opening the page using SharePoint Designer, but there doesn't seem to be an obvious way (such as a menu) to add a Web Part Zone.
TITLE: How to add a web part zone in SharePoint using SharePoint Designer QUESTION: I need to add a web part zone to a wiki page. I'm opening the page using SharePoint Designer, but there doesn't seem to be an obvious way (such as a menu) to add a Web Part Zone. ANSWER: from: http://office.microsoft.com/en-us/sharepo...
[ "sharepoint", "moss", "sharepoint-designer" ]
3
10
22,212
3
0
2008-09-02T12:35:58.933000
2008-09-02T12:38:31.957000
39,391
39,449
Does new URL(...).openConnection() necessarily imply a POST?
If I create an HTTP java.net.URL and then call openConnection() on it, does it necessarily imply that an HTTP post is going to happen? I know that openStream() implies a GET. If so, how do you perform one of the other HTTP verbs without having to work with the raw socket layer?
If you retrieve the URLConnection object using openConnection() it doesn't actually start communicating with the server. That doesn't happen until you get the stream from the URLConnection(). When you first get the connection you can add/change headers and other connection properties before actually opening it. URLConn...
Does new URL(...).openConnection() necessarily imply a POST? If I create an HTTP java.net.URL and then call openConnection() on it, does it necessarily imply that an HTTP post is going to happen? I know that openStream() implies a GET. If so, how do you perform one of the other HTTP verbs without having to work with th...
TITLE: Does new URL(...).openConnection() necessarily imply a POST? QUESTION: If I create an HTTP java.net.URL and then call openConnection() on it, does it necessarily imply that an HTTP post is going to happen? I know that openStream() implies a GET. If so, how do you perform one of the other HTTP verbs without havi...
[ "java", "http", "url" ]
11
18
21,933
2
0
2008-09-02T12:37:27.107000
2008-09-02T13:06:11.263000
39,392
39,543
ASP.NET MVC vs. XSL
Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of data on a web-page with XSL over ASP.NET MVC? The two alternatives are: ASP.NET (MVC/WebForms) with XSL Getting the data from the database and transforming it to XML which is then displayed on the different pages with XSL-templates...
I can see the main benefit of employing XSLT to transform your data and display it to the user would be the following: The data is already in an XML format The data follows a well defined schema (this makes using tools like XMLSpy much easier). The data needs to be transformed into a number of different output formats,...
ASP.NET MVC vs. XSL Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of data on a web-page with XSL over ASP.NET MVC? The two alternatives are: ASP.NET (MVC/WebForms) with XSL Getting the data from the database and transforming it to XML which is then displayed on the different page...
TITLE: ASP.NET MVC vs. XSL QUESTION: Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of data on a web-page with XSL over ASP.NET MVC? The two alternatives are: ASP.NET (MVC/WebForms) with XSL Getting the data from the database and transforming it to XML which is then displayed on ...
[ "asp.net-mvc", "xslt" ]
7
7
3,847
6
0
2008-09-02T12:37:34.890000
2008-09-02T13:45:10.470000
39,395
39,404
How do I calculate PI in C#?
How can I calculate the value of PI using C#? I was thinking it would be through a recursive function, if so, what would it look like and are there any math equations to back it up? I'm not too fussy about performance, mainly how to go about it from a learning point of view.
If you want recursion: PI = 2 * (1 + 1/3 * (1 + 2/5 * (1 + 3/7 * (...)))) This would become, after some rewriting: PI = 2 * F(1); with F(i): double F (int i) { return 1 + i / (2.0 * i + 1) * F(i + 1); } Isaac Newton (you may have heard of him before;) ) came up with this trick. Note that I left out the end condition, t...
How do I calculate PI in C#? How can I calculate the value of PI using C#? I was thinking it would be through a recursive function, if so, what would it look like and are there any math equations to back it up? I'm not too fussy about performance, mainly how to go about it from a learning point of view.
TITLE: How do I calculate PI in C#? QUESTION: How can I calculate the value of PI using C#? I was thinking it would be through a recursive function, if so, what would it look like and are there any math equations to back it up? I'm not too fussy about performance, mainly how to go about it from a learning point of vie...
[ "c#", "pi" ]
30
45
83,979
20
0
2008-09-02T12:39:12.623000
2008-09-02T12:44:04.220000
39,419
39,441
How large is a DWORD with 32- and 64-bit code?
In Visual C++ a DWORD is just an unsigned long that is machine, platform, and SDK dependent. However, since DWORD is a double word (that is 2 * 16), is a DWORD still 32-bit on 64-bit architectures?
Actually, on 32-bit computers a word is 32-bit, but the DWORD type is a leftover from the good old days of 16-bit. In order to make it easier to port programs to the newer system, Microsoft has decided all the old types will not change size. You can find the official list here: http://msdn.microsoft.com/en-us/library/a...
How large is a DWORD with 32- and 64-bit code? In Visual C++ a DWORD is just an unsigned long that is machine, platform, and SDK dependent. However, since DWORD is a double word (that is 2 * 16), is a DWORD still 32-bit on 64-bit architectures?
TITLE: How large is a DWORD with 32- and 64-bit code? QUESTION: In Visual C++ a DWORD is just an unsigned long that is machine, platform, and SDK dependent. However, since DWORD is a double word (that is 2 * 16), is a DWORD still 32-bit on 64-bit architectures? ANSWER: Actually, on 32-bit computers a word is 32-bit, ...
[ "c++", "winapi", "64-bit", "dword" ]
58
70
155,533
4
0
2008-09-02T12:50:26.340000
2008-09-02T13:02:40.837000
39,438
41,100
Developer moving from SQL Server to Oracle
We are bringing a new project in house and whereas previously all our work was on SQL Server the new product uses an oracle back end. Can anyone advise any crib sheets or such like that gives an SQL Server person like me a rundown of what the major differences are - Would like to be able to get up and running as soon a...
@hamishcmcn Your assertion that '' == Null is simply not true. In the relational world Null should only ever be read to mean "I don't know". The only result you will get from Oracle (and most other decent databases) when you compare a value to Null is 'False'. Off the top of my head the major differences between SQL Se...
Developer moving from SQL Server to Oracle We are bringing a new project in house and whereas previously all our work was on SQL Server the new product uses an oracle back end. Can anyone advise any crib sheets or such like that gives an SQL Server person like me a rundown of what the major differences are - Would like...
TITLE: Developer moving from SQL Server to Oracle QUESTION: We are bringing a new project in house and whereas previously all our work was on SQL Server the new product uses an oracle back end. Can anyone advise any crib sheets or such like that gives an SQL Server person like me a rundown of what the major difference...
[ "sql-server", "database", "oracle" ]
7
3
4,121
8
0
2008-09-02T13:01:06.737000
2008-09-03T02:52:17.677000
39,447
39,467
How can I expose only a fragment of IList<>?
I have a class property exposing an internal IList<> through System.Collections.ObjectModel.ReadOnlyCollection<> How can I pass a part of this ReadOnlyCollection<> without copying elements into a new array (I need a live view, and the target device is short on memory)? I'm targetting Compact Framework 2.0.
Try a method that returns an enumeration using yield: IEnumerable FilterCollection ( ReadOnlyCollection input ) { foreach ( T item in input ) if ( /* criterion is met */ ) yield return item; }
How can I expose only a fragment of IList<>? I have a class property exposing an internal IList<> through System.Collections.ObjectModel.ReadOnlyCollection<> How can I pass a part of this ReadOnlyCollection<> without copying elements into a new array (I need a live view, and the target device is short on memory)? I'm t...
TITLE: How can I expose only a fragment of IList<>? QUESTION: I have a class property exposing an internal IList<> through System.Collections.ObjectModel.ReadOnlyCollection<> How can I pass a part of this ReadOnlyCollection<> without copying elements into a new array (I need a live view, and the target device is short...
[ "c#", "windows-mobile", "compact-framework", ".net-2.0" ]
12
15
2,269
6
0
2008-09-02T13:05:48.630000
2008-09-02T13:11:08.867000
39,454
39,498
Is there a secret trick to force antialiasing inside Viewport3D in Windows XP?
Under Windows XP WPF true 3D content (which is usually displayed using the Viewport3D control) looks extremely ugly because it is by default not antialiased as the rest of the WPF graphics are. Especially at lower resolution the experience is so bad that it can not be used in production code. I have managed to force an...
Have you tried this (from your thread on MSDN forums)? Well, it seems the reference in the MSDN link above incorrectly specify the affected registry root key. In MSDN it is specified as HKEY_CURRENT_USER, while the correct root key should be HKEY_LOCAL_MACHINE. I've tried setting up the HKEY_LOCAL_MACHINE\Software\Micr...
Is there a secret trick to force antialiasing inside Viewport3D in Windows XP? Under Windows XP WPF true 3D content (which is usually displayed using the Viewport3D control) looks extremely ugly because it is by default not antialiased as the rest of the WPF graphics are. Especially at lower resolution the experience i...
TITLE: Is there a secret trick to force antialiasing inside Viewport3D in Windows XP? QUESTION: Under Windows XP WPF true 3D content (which is usually displayed using the Viewport3D control) looks extremely ugly because it is by default not antialiased as the rest of the WPF graphics are. Especially at lower resolutio...
[ "wpf", "windows-xp", "3d", "antialiasing", "viewport3d" ]
6
2
1,971
3
0
2008-09-02T13:08:22.337000
2008-09-02T13:24:31.890000
39,457
40,101
Regular expression to match (C) function calls
Does anyone have a regular expression for matching function calls in C programs?
After a bit more searching I decided to let the compiler do the hard work. Get the compiler to produce a Register Transfer Language (RTL) file using the -dr options of gcc. The produced RTL file has the suffix.rtl or.expand. This file is far easier to parse as the functions calls are already identified.
Regular expression to match (C) function calls Does anyone have a regular expression for matching function calls in C programs?
TITLE: Regular expression to match (C) function calls QUESTION: Does anyone have a regular expression for matching function calls in C programs? ANSWER: After a bit more searching I decided to let the compiler do the hard work. Get the compiler to produce a Register Transfer Language (RTL) file using the -dr options ...
[ "regex" ]
3
2
4,009
3
0
2008-09-02T13:09:02.163000
2008-09-02T17:29:06.203000
39,468
39,478
Calling DLL functions from VB6
I've got a Windows DLL that I wrote, written in C/C++ (all exported functions are 'C'). The DLL works fine for me in VC++. I've given the DLL to another company who do all their development in VB. They seem to be having a problem linking to the functions. I haven't used VB in ten years and I don't even have it installe...
By using __declspec for export, the function name will get exported mangled, i.e. contain type information to help the C++ compiler resolve overloads. VB6 cannot handle mangled names. As a workaround, you have to de-mangle the names. The easiest solution is to link the DLL file using an export definition file in VC++. ...
Calling DLL functions from VB6 I've got a Windows DLL that I wrote, written in C/C++ (all exported functions are 'C'). The DLL works fine for me in VC++. I've given the DLL to another company who do all their development in VB. They seem to be having a problem linking to the functions. I haven't used VB in ten years an...
TITLE: Calling DLL functions from VB6 QUESTION: I've got a Windows DLL that I wrote, written in C/C++ (all exported functions are 'C'). The DLL works fine for me in VC++. I've given the DLL to another company who do all their development in VB. They seem to be having a problem linking to the functions. I haven't used ...
[ "c++", "c", "vb6" ]
2
4
9,346
3
0
2008-09-02T13:11:25.887000
2008-09-02T13:16:15.530000
39,473
99,990
raytracing with CUDA
I'm currently implementing a raytracer. Since raytracing is extremely computation heavy and since I am going to be looking into CUDA programming anyway, I was wondering if anyone has any experience with combining the two. I can't really tell if the computational models match and I would like to know what to expect. I g...
One thing to be very wary of in CUDA is that divergent control flow in your kernel code absolutely KILLS performance, due to the structure of the underlying GPU hardware. GPUs typically have massively data-parallel workloads with highly-coherent control flow (i.e. you have a couple million pixels, each of which (or at ...
raytracing with CUDA I'm currently implementing a raytracer. Since raytracing is extremely computation heavy and since I am going to be looking into CUDA programming anyway, I was wondering if anyone has any experience with combining the two. I can't really tell if the computational models match and I would like to kno...
TITLE: raytracing with CUDA QUESTION: I'm currently implementing a raytracer. Since raytracing is extremely computation heavy and since I am going to be looking into CUDA programming anyway, I was wondering if anyone has any experience with combining the two. I can't really tell if the computational models match and I...
[ "cuda", "raytracing" ]
11
24
17,510
2
0
2008-09-02T13:12:56.273000
2008-09-19T06:05:18.650000
39,474
39,590
How to get IntelliSense to reliably work in Visual Studio 2008
Does anyone know how to get IntelliSense to work reliably when working in C/C++ projects? It seems to work for about 1 in 10 files. Visual Studio 2005 seems to be a lot better than 2008. Edit: Whilst not necessarily a solution, the work-around provided here: How to get IntelliSense to reliably work in Visual Studio 200...
I've also realized than Intellisense is sometime 'lost', on some big project. Why? No idea. This is why we have bought Visual Assist (from Tomato software ) and disabled Intellisense by deleting the dll feacp.dll in the Visual studio subdirectory (C:\Program Files\Microsoft Visual Studio 8\VC\vcpackages) This is not a ...
How to get IntelliSense to reliably work in Visual Studio 2008 Does anyone know how to get IntelliSense to work reliably when working in C/C++ projects? It seems to work for about 1 in 10 files. Visual Studio 2005 seems to be a lot better than 2008. Edit: Whilst not necessarily a solution, the work-around provided here...
TITLE: How to get IntelliSense to reliably work in Visual Studio 2008 QUESTION: Does anyone know how to get IntelliSense to work reliably when working in C/C++ projects? It seems to work for about 1 in 10 files. Visual Studio 2005 seems to be a lot better than 2008. Edit: Whilst not necessarily a solution, the work-ar...
[ "c++", "c", "visual-studio-2008", "intellisense" ]
40
27
46,236
12
0
2008-09-02T13:13:36.567000
2008-09-02T14:02:01.240000
39,475
39,927
Git "bad sha1 file" error
Hello I have the following error by git-fsck, which cannot be cleaned by git-gc even in --aggressive mode. What can I do next to fix this repository error? $ git-fsck bad sha1 file:.git/objects/55/tmp_obj_a07724
It's not a simple answer, sadly. But this might help: Recovering from repository corruption (from the Git's user manual).
Git "bad sha1 file" error Hello I have the following error by git-fsck, which cannot be cleaned by git-gc even in --aggressive mode. What can I do next to fix this repository error? $ git-fsck bad sha1 file:.git/objects/55/tmp_obj_a07724
TITLE: Git "bad sha1 file" error QUESTION: Hello I have the following error by git-fsck, which cannot be cleaned by git-gc even in --aggressive mode. What can I do next to fix this repository error? $ git-fsck bad sha1 file:.git/objects/55/tmp_obj_a07724 ANSWER: It's not a simple answer, sadly. But this might help: R...
[ "git", "version-control" ]
9
8
9,126
3
0
2008-09-02T13:14:49.030000
2008-09-02T16:17:20.587000
39,476
39,496
What is the yield keyword used for in C#?
In the How Can I Expose Only a Fragment of IList<> question one of the answers had the following code snippet: IEnumerable FilteredList() { foreach(object item in FullList) { if(IsItemInPartialList(item)) yield return item; } } What does the yield keyword do there? I've seen it referenced in a couple places, and one ot...
The yield contextual keyword actually does quite a lot here. The function returns an object that implements the IEnumerable interface. If a calling function starts foreach ing over this object, the function is called again until it "yields". This is syntactic sugar introduced in C# 2.0. In earlier versions you had to c...
What is the yield keyword used for in C#? In the How Can I Expose Only a Fragment of IList<> question one of the answers had the following code snippet: IEnumerable FilteredList() { foreach(object item in FullList) { if(IsItemInPartialList(item)) yield return item; } } What does the yield keyword do there? I've seen it...
TITLE: What is the yield keyword used for in C#? QUESTION: In the How Can I Expose Only a Fragment of IList<> question one of the answers had the following code snippet: IEnumerable FilteredList() { foreach(object item in FullList) { if(IsItemInPartialList(item)) yield return item; } } What does the yield keyword do t...
[ "c#", "yield" ]
1,052
951
503,143
20
0
2008-09-02T13:15:24.877000
2008-09-02T13:23:16.200000
39,485
41,887
Software Phase Locked Loop example code needed
Does anyone know of anywhere I can find actual code examples of Software Phase Locked Loops (SPLLs)? I need an SPLL that can track a PSK modulated signal that is somewhere between 1.1 KHz and 1.3 KHz. A Google search brings up plenty of academic papers and patents but nothing usable. Even a trip to the University libra...
This is an interactive design package for designing digital (i.e. software) phase locked loops (PLLs). Fill in the form and press the ``Submit'' button, and a PLL will be designed for you. Interactive Digital Phase Locked Loop Design This will get you started, but you really need to understand the fundamentals of PLL d...
Software Phase Locked Loop example code needed Does anyone know of anywhere I can find actual code examples of Software Phase Locked Loops (SPLLs)? I need an SPLL that can track a PSK modulated signal that is somewhere between 1.1 KHz and 1.3 KHz. A Google search brings up plenty of academic papers and patents but noth...
TITLE: Software Phase Locked Loop example code needed QUESTION: Does anyone know of anywhere I can find actual code examples of Software Phase Locked Loops (SPLLs)? I need an SPLL that can track a PSK modulated signal that is somewhere between 1.1 KHz and 1.3 KHz. A Google search brings up plenty of academic papers an...
[ "signal-processing" ]
7
2
19,694
3
0
2008-09-02T13:18:19.410000
2008-09-03T15:09:28.700000
39,517
39,634
Languages other than SQL in postgres
I've been using PostgreSQL a little bit lately, and one of the things that I think is cool is that you can use languages other than SQL for scripting functions and whatnot. But when is this actually useful? For example, the documentation says that the main use for PL/Perl is that it's pretty good at text manipulation. ...
"isn't that [text manipulation] more of something that should be programmed into the application?" Usually, yes. The generally accepted " three-tier " application design for databases says that your logic should be in the middle tier, between the client and the database. However, sometimes you need some logic in a trig...
Languages other than SQL in postgres I've been using PostgreSQL a little bit lately, and one of the things that I think is cool is that you can use languages other than SQL for scripting functions and whatnot. But when is this actually useful? For example, the documentation says that the main use for PL/Perl is that it...
TITLE: Languages other than SQL in postgres QUESTION: I've been using PostgreSQL a little bit lately, and one of the things that I think is cool is that you can use languages other than SQL for scripting functions and whatnot. But when is this actually useful? For example, the documentation says that the main use for ...
[ "sql", "database", "postgresql", "trusted-vs-untrusted" ]
6
3
1,536
7
0
2008-09-02T13:32:54.447000
2008-09-02T14:17:55.990000
39,533
39,619
How to identify that you're running under a VM?
Is there a way to identify, from within a VM, that your code is running inside a VM? I guess there are more or less easy ways to identify specific VM systems, especially if the VM has the provider's extensions installed (such as for VirtualBox or VMWare). But is there a general way to identify that you are not running ...
A lot of the research on this is dedicated to detecting so-called "blue pill" attacks, that is, a malicious hypervisor that is actively attempting to evade detection. The classic trick to detect a VM is to populate the ITLB, run an instruction that must be virtualized (which necessarily clears out such processor state ...
How to identify that you're running under a VM? Is there a way to identify, from within a VM, that your code is running inside a VM? I guess there are more or less easy ways to identify specific VM systems, especially if the VM has the provider's extensions installed (such as for VirtualBox or VMWare). But is there a g...
TITLE: How to identify that you're running under a VM? QUESTION: Is there a way to identify, from within a VM, that your code is running inside a VM? I guess there are more or less easy ways to identify specific VM systems, especially if the VM has the provider's extensions installed (such as for VirtualBox or VMWare)...
[ "virtualization" ]
38
27
47,594
12
0
2008-09-02T13:39:47.610000
2008-09-02T14:13:47.250000
39,536
39,672
How to download a live MySQL db into a local test db on demand, without SSH?
I have a fairly small MySQL database (a Textpattern install) on a server that I do not have SSH access to (I have FTP access only). I need to regularly download the live database to my local dev server on demand; i.e., I would like to either run a script and/or have a cron job running. What are some good ways of doing ...
Since you can access your database remotely, you can use mysqldump from your windows machine to fetch the remote database. From commandline: cd "into mysql directory" mysqldump -u USERNAME -p -h YOUR_HOST_IP DATABASE_TO_MIRROR >c:\backup\database.sql The program will ask you for the database password and then generate ...
How to download a live MySQL db into a local test db on demand, without SSH? I have a fairly small MySQL database (a Textpattern install) on a server that I do not have SSH access to (I have FTP access only). I need to regularly download the live database to my local dev server on demand; i.e., I would like to either r...
TITLE: How to download a live MySQL db into a local test db on demand, without SSH? QUESTION: I have a fairly small MySQL database (a Textpattern install) on a server that I do not have SSH access to (I have FTP access only). I need to regularly download the live database to my local dev server on demand; i.e., I woul...
[ "php", "ruby", "database", "mysql" ]
8
6
2,952
6
0
2008-09-02T13:42:16.530000
2008-09-02T14:33:01.977000
39,541
39,556
What's the simplest .NET equivalent of a VB6 control array?
Maybe I just don't know.NET well enough yet, but I have yet to see a satisfactory way to implement this simple VB6 code easily in.NET (assume this code is on a form with N CommandButtons in array Command1() and N TextBoxes in array Text1()): Private Sub Command1_Click(Index As Integer) Text1(Index).Text = Timer End S...
Make a generic list of textboxes: var textBoxes = new List (); // Create 10 textboxes in the collection for (int i = 0; i < 10; i++) { var textBox = new TextBox(); textBox.Text = "Textbox " + i; textBoxes.Add(textBox); } // Loop through and set new values on textboxes in collection for (int i = 0; i < textBoxes.Count...
What's the simplest .NET equivalent of a VB6 control array? Maybe I just don't know.NET well enough yet, but I have yet to see a satisfactory way to implement this simple VB6 code easily in.NET (assume this code is on a form with N CommandButtons in array Command1() and N TextBoxes in array Text1()): Private Sub Comman...
TITLE: What's the simplest .NET equivalent of a VB6 control array? QUESTION: Maybe I just don't know.NET well enough yet, but I have yet to see a satisfactory way to implement this simple VB6 code easily in.NET (assume this code is on a form with N CommandButtons in array Command1() and N TextBoxes in array Text1()): ...
[ ".net", "vb6", "vb6-migration", "control-array" ]
10
5
12,156
9
0
2008-09-02T13:44:13.997000
2008-09-02T13:51:33.183000
39,561
39,574
Visual Studio 2005/2012: How to keep first curly brace on same line?
Trying to get my css / C# functions to look like this: body { color:#222; } instead of this: body { color:#222; } when I auto-format the code.
C# In the Tools Menu click Options Click Show all Parameters (checkbox at the bottom left) ( Show all settings in VS 2010) Text Editor C# Formatting New lines And there check when you want new lines with brackets Css: almost the same, but fewer options In the Tools Menu click Options Click Show all Parameters (checkbox...
Visual Studio 2005/2012: How to keep first curly brace on same line? Trying to get my css / C# functions to look like this: body { color:#222; } instead of this: body { color:#222; } when I auto-format the code.
TITLE: Visual Studio 2005/2012: How to keep first curly brace on same line? QUESTION: Trying to get my css / C# functions to look like this: body { color:#222; } instead of this: body { color:#222; } when I auto-format the code. ANSWER: C# In the Tools Menu click Options Click Show all Parameters (checkbox at the bot...
[ "visual-studio" ]
150
267
75,806
8
0
2008-09-02T13:52:48.050000
2008-09-02T13:55:30.960000
39,562
39,587
How do you build a multi-language web site?
A friend of mine is now building a web application with J2EE and Struts, and it's going to be prepared to display pages in several languages. I was told that the best way to support a multi-language site is to use a properties file where you store all the strings of your pages, something like: welcome.english = "Welcom...
They way I have designed the database before is to have an News-table containing basic info like NewsID (int), NewsPubDate (datetime), NewsAuthor (varchar/int) and then have a linked table NewsText that has these columns: NewsID(int), NewsText(text), NewsLanguageID(int). And at last you have a Language-table that has L...
How do you build a multi-language web site? A friend of mine is now building a web application with J2EE and Struts, and it's going to be prepared to display pages in several languages. I was told that the best way to support a multi-language site is to use a properties file where you store all the strings of your page...
TITLE: How do you build a multi-language web site? QUESTION: A friend of mine is now building a web application with J2EE and Struts, and it's going to be prepared to display pages in several languages. I was told that the best way to support a multi-language site is to use a properties file where you store all the st...
[ "database", "jakarta-ee", "web-applications", "multilingual" ]
6
6
12,841
5
0
2008-09-02T13:52:56.083000
2008-09-02T14:01:01.867000
39,576
39,602
Best way to do multi-row insert in Oracle?
I'm looking for a good way to perform multi-row inserts into an Oracle 9 database. The following works in MySQL but doesn't seem to be supported in Oracle. INSERT INTO TMP_DIM_EXCH_RT (EXCH_WH_KEY, EXCH_NAT_KEY, EXCH_DATE, EXCH_RATE, FROM_CURCY_CD, TO_CURCY_CD, EXCH_EFF_DATE, EXCH_EFF_END_DATE, EXCH_LAST_UPDATED_DATE) ...
This works in Oracle: insert into pager (PAG_ID,PAG_PARENT,PAG_NAME,PAG_ACTIVE) select 8000,0,'Multi 8000',1 from dual union all select 8001,0,'Multi 8001',1 from dual The thing to remember here is to use the from dual statement.
Best way to do multi-row insert in Oracle? I'm looking for a good way to perform multi-row inserts into an Oracle 9 database. The following works in MySQL but doesn't seem to be supported in Oracle. INSERT INTO TMP_DIM_EXCH_RT (EXCH_WH_KEY, EXCH_NAT_KEY, EXCH_DATE, EXCH_RATE, FROM_CURCY_CD, TO_CURCY_CD, EXCH_EFF_DATE, ...
TITLE: Best way to do multi-row insert in Oracle? QUESTION: I'm looking for a good way to perform multi-row inserts into an Oracle 9 database. The following works in MySQL but doesn't seem to be supported in Oracle. INSERT INTO TMP_DIM_EXCH_RT (EXCH_WH_KEY, EXCH_NAT_KEY, EXCH_DATE, EXCH_RATE, FROM_CURCY_CD, TO_CURCY_C...
[ "sql", "oracle", "sql-insert", "oracle9i" ]
381
226
845,569
9
0
2008-09-02T13:56:19.413000
2008-09-02T14:08:12.333000
39,585
39,591
What's a good design pattern for web method return values?
When coding web services, how do you structure your return values? How do you handle error conditions (expected ones and unexpected ones)? If you are returning something simple like an int, do you just return it, or embed it in a more complex object? Do all of the web methods within one service return an instance of a ...
I like the Request/Response object pattern, where you encapsulate your arguments into a single [Operation]Request class, which has simple public properties on it. Something like AddCustomerRequest, which would return AddCustomerResponse. The response can include information on the success/failure of the operation, any ...
What's a good design pattern for web method return values? When coding web services, how do you structure your return values? How do you handle error conditions (expected ones and unexpected ones)? If you are returning something simple like an int, do you just return it, or embed it in a more complex object? Do all of ...
TITLE: What's a good design pattern for web method return values? QUESTION: When coding web services, how do you structure your return values? How do you handle error conditions (expected ones and unexpected ones)? If you are returning something simple like an int, do you just return it, or embed it in a more complex ...
[ "web-services", "soap", "wsdl" ]
9
8
1,447
4
0
2008-09-02T14:00:09.420000
2008-09-02T14:03:08.163000
39,615
39,664
How to loop through files matching wildcard in batch file
I have a set of base filenames, for each name 'f' there are exactly two files, 'f.in' and 'f.out'. I want to write a batch file (in Windows XP) which goes through all the filenames, for each one it should: Display the base name 'f' Perform an action on 'f.in' Perform another action on 'f.out' I don't have any way to li...
Assuming you have two programs that process the two files, process_in.exe and process_out.exe: for %%f in (*.in) do ( echo %%~nf process_in "%%~nf.in" process_out "%%~nf.out" ) %%~nf is a substitution modifier, that expands %f to a file name only. See other modifiers in https://technet.microsoft.com/en-us/library/bb490...
How to loop through files matching wildcard in batch file I have a set of base filenames, for each name 'f' there are exactly two files, 'f.in' and 'f.out'. I want to write a batch file (in Windows XP) which goes through all the filenames, for each one it should: Display the base name 'f' Perform an action on 'f.in' Pe...
TITLE: How to loop through files matching wildcard in batch file QUESTION: I have a set of base filenames, for each name 'f' there are exactly two files, 'f.in' and 'f.out'. I want to write a batch file (in Windows XP) which goes through all the filenames, for each one it should: Display the base name 'f' Perform an a...
[ "command-line", "windows-xp", "batch-file" ]
216
326
368,946
7
0
2008-09-02T14:12:02.527000
2008-09-02T14:28:51.457000
39,639
67,661
Aspectj doesn't catch all events in spring framework?
My project is based on spring framework 2.5.4. And I try to add aspects for some controllers (I use aspectj 1.5.3). I've enabled auto-proxy in application-servlet.xml, just pasted these lines to the end of the xml file: Created aspect: package com.example.bg.web.utils; import org.apache.log4j.Logger; import org.aspect...
Your breakpoints aren't being hit because you are using Spring's AOP Proxies. See understanding-aop-proxies for a description of how AOP Proxies are special. Basically, the MVC framework is going to call the handleRequest method on your controller's proxy (which for example the MultiActionController you're using as a b...
Aspectj doesn't catch all events in spring framework? My project is based on spring framework 2.5.4. And I try to add aspects for some controllers (I use aspectj 1.5.3). I've enabled auto-proxy in application-servlet.xml, just pasted these lines to the end of the xml file: Created aspect: package com.example.bg.web.uti...
TITLE: Aspectj doesn't catch all events in spring framework? QUESTION: My project is based on spring framework 2.5.4. And I try to add aspects for some controllers (I use aspectj 1.5.3). I've enabled auto-proxy in application-servlet.xml, just pasted these lines to the end of the xml file: Created aspect: package com....
[ "java", "spring", "spring-aop" ]
7
2
2,913
4
0
2008-09-02T14:19:23.040000
2008-09-15T22:35:30.613000
39,651
39,862
git-stash vs. git-branch
In a previous Git question, Daniel Benamy was talking about a workflow in Git: I was working on master and committed some stuff and then decided I wanted to put that work on hold. I backed up a few commits and then branched from before I started my crap work. He wanted to restore his working state to a previous point i...
'stash' takes the uncommitted, " dirty " stuff on your working copy, and stashes it away, leaving you with a clean working copy. It doesn't really branch at all. You can then apply the stash on top of any other branch. Or, as of Git 1.6, you can do: git stash branch [ ] to apply the stash on top of a new branch, all in...
git-stash vs. git-branch In a previous Git question, Daniel Benamy was talking about a workflow in Git: I was working on master and committed some stuff and then decided I wanted to put that work on hold. I backed up a few commits and then branched from before I started my crap work. He wanted to restore his working st...
TITLE: git-stash vs. git-branch QUESTION: In a previous Git question, Daniel Benamy was talking about a workflow in Git: I was working on master and committed some stuff and then decided I wanted to put that work on hold. I backed up a few commits and then branched from before I started my crap work. He wanted to rest...
[ "git" ]
96
111
37,645
4
0
2008-09-02T14:22:44.390000
2008-09-02T15:54:59.953000
39,662
39,814
TFS Linking Backlog items
In TFS whats the easiest way of linking a backlog item to a large number of other backlog items, without doing them one at a time? I do not have access to the underlying database so am unable to write a query to do it.
I'd stay away from the SQL Query. Instead, I'd either use the API or Web Services. Here's an example API call to retrieve and edit a work item: http://msdn.microsoft.com/en-us/library/bb130323.aspx You could modify that to add the links. Would be much safer, easier, and much more supported than going directly to the da...
TFS Linking Backlog items In TFS whats the easiest way of linking a backlog item to a large number of other backlog items, without doing them one at a time? I do not have access to the underlying database so am unable to write a query to do it.
TITLE: TFS Linking Backlog items QUESTION: In TFS whats the easiest way of linking a backlog item to a large number of other backlog items, without doing them one at a time? I do not have access to the underlying database so am unable to write a query to do it. ANSWER: I'd stay away from the SQL Query. Instead, I'd e...
[ "tfs" ]
1
0
715
3
0
2008-09-02T14:26:50.633000
2008-09-02T15:33:37.463000
39,663
39,760
What is the best way to do Bit Field manipulation in Python?
I'm reading some MPEG Transport Stream protocol over UDP and it has some funky bitfields in it (length 13 for example). I'm using the "struct" library to do the broad unpacking, but is there a simple way to say "Grab the next 13 bits" rather than have to hand-tweak the bit manipulation? I'd like something like the way ...
It's an often-asked question. There's an ASPN Cookbook entry on it that has served me in the past. And there is an extensive page of requirements one person would like to see from a module doing this.
What is the best way to do Bit Field manipulation in Python? I'm reading some MPEG Transport Stream protocol over UDP and it has some funky bitfields in it (length 13 for example). I'm using the "struct" library to do the broad unpacking, but is there a simple way to say "Grab the next 13 bits" rather than have to hand...
TITLE: What is the best way to do Bit Field manipulation in Python? QUESTION: I'm reading some MPEG Transport Stream protocol over UDP and it has some funky bitfields in it (length 13 for example). I'm using the "struct" library to do the broad unpacking, but is there a simple way to say "Grab the next 13 bits" rather...
[ "python", "udp", "bit", "bit-fields" ]
27
9
14,017
2
0
2008-09-02T14:28:40.600000
2008-09-02T15:13:44.093000
39,674
39,790
Adapt Replace all strings in all tables to work with text
I have the following script. It replaces all instances of @lookFor with @replaceWith in all tables in a database. However it doesn't work with text fields only varchar etc. Could this be easily adapted? ------------------------------------------------------------ -- Name: STRING REPLACER -- Author: ADUGGLEBY -- Version...
Yeah. What I ended up doing is I converted to varchar(max) on the fly, and the replace took care of the rest. -- PREPARE SET NOCOUNT ON -- VARIABLES DECLARE @tblName NVARCHAR(150) DECLARE @colName NVARCHAR(150) DECLARE @tblID int DECLARE @first bit DECLARE @lookFor nvarchar(250) DECLARE @replaceWith nvarchar(250) -- ...
Adapt Replace all strings in all tables to work with text I have the following script. It replaces all instances of @lookFor with @replaceWith in all tables in a database. However it doesn't work with text fields only varchar etc. Could this be easily adapted? -----------------------------------------------------------...
TITLE: Adapt Replace all strings in all tables to work with text QUESTION: I have the following script. It replaces all instances of @lookFor with @replaceWith in all tables in a database. However it doesn't work with text fields only varchar etc. Could this be easily adapted? -----------------------------------------...
[ "sql-server", "t-sql", "text", "cursors" ]
5
2
812
2
0
2008-09-02T14:33:47.403000
2008-09-02T15:22:03.467000
39,691
39,970
Javascript Best Practices
What are some good resources to learn best practices for Javascript? I'm mainly concerned about when something should be an object vs. when it should just be tracked in the DOM. Also I would like to better learn how to organize my code so it's easy to unit test.
Seconding Javascript: The Good Parts and Resig's book Secrets of the Javascript Ninja. Here are some tips for Javascript: Don't pollute the global namespace (put all functions into objects/closures) Take a look at YUI, it's a huge codebase with only 2 global objects: YAHOO and YAHOO_config Use the Module pattern for si...
Javascript Best Practices What are some good resources to learn best practices for Javascript? I'm mainly concerned about when something should be an object vs. when it should just be tracked in the DOM. Also I would like to better learn how to organize my code so it's easy to unit test.
TITLE: Javascript Best Practices QUESTION: What are some good resources to learn best practices for Javascript? I'm mainly concerned about when something should be an object vs. when it should just be tracked in the DOM. Also I would like to better learn how to organize my code so it's easy to unit test. ANSWER: Seco...
[ "javascript", "unit-testing" ]
34
36
6,752
8
0
2008-09-02T14:41:22.050000
2008-09-02T16:31:14.143000
39,712
41,600
Visual Studio 2005/2008: How can you share/force all developers to use the same formatting rules?
I would like to have all developers on my team to use the same rules for formatting several types of code (ASPX, CSS, JavaScript, C#). Can I have visual studio look to a common place for these rules? I would like to not rely on export/import settings as that brings many settings along. I (for example) don't care what f...
StyleCop, originally called "Source Analysis" is the best choice for C#. The first version was rather inflexible, but after recognizing the value that it provides for the community, Microsoft has opened it up to extensions and customizations. It's a solid tool. For Visual Studio settings, it's trivial to export a sub-s...
Visual Studio 2005/2008: How can you share/force all developers to use the same formatting rules? I would like to have all developers on my team to use the same rules for formatting several types of code (ASPX, CSS, JavaScript, C#). Can I have visual studio look to a common place for these rules? I would like to not re...
TITLE: Visual Studio 2005/2008: How can you share/force all developers to use the same formatting rules? QUESTION: I would like to have all developers on my team to use the same rules for formatting several types of code (ASPX, CSS, JavaScript, C#). Can I have visual studio look to a common place for these rules? I wo...
[ "visual-studio", "formatting" ]
5
8
1,438
10
0
2008-09-02T14:53:11.990000
2008-09-03T12:57:18.173000
39,728
176,467
How to upgrade TFS 2005 to TFS 2008?
What is the best way to go about upgrading TFS 2005 to 2008? Also, what about the Team Build scripts ("Build Types"), are those compatible with Team Build 2008 or do they need converted/migrated somehow?
First and foremost - backup everything! The databases, the machine itself... You can never be too careful. I was able to upgrade the TFS installation at my company by using these resources: http://olausson.net/blog/CommentView,guid,6f97b619-a5ac-41af-a908-f099d49a3b16.aspx http://blogs.msdn.com/sudhir/archive/2007/05/3...
How to upgrade TFS 2005 to TFS 2008? What is the best way to go about upgrading TFS 2005 to 2008? Also, what about the Team Build scripts ("Build Types"), are those compatible with Team Build 2008 or do they need converted/migrated somehow?
TITLE: How to upgrade TFS 2005 to TFS 2008? QUESTION: What is the best way to go about upgrading TFS 2005 to 2008? Also, what about the Team Build scripts ("Build Types"), are those compatible with Team Build 2008 or do they need converted/migrated somehow? ANSWER: First and foremost - backup everything! The database...
[ "visual-studio-2008", "tfs", "msbuild", "visual-studio-2005", "tfs-migration" ]
3
3
1,095
3
0
2008-09-02T15:00:15.420000
2008-10-06T22:29:48.693000
39,734
39,966
How to add submenu items to the Windows Explorer context menu?
I can create a menu item in the Windows Explorer context menu by adding keys in the registry to HKEY_CLASSES_ROOT\Folder\shell. How can I create submenu items to the just created menu item?
I believe anything non-trival you'll have to create a Context Menu Handler. You'll have to create a COM object that will create the menus and carry out the commands as they're clicked. I've only done this using C++ and COM. I'm not sure if there are easier ways to do this.
How to add submenu items to the Windows Explorer context menu? I can create a menu item in the Windows Explorer context menu by adding keys in the registry to HKEY_CLASSES_ROOT\Folder\shell. How can I create submenu items to the just created menu item?
TITLE: How to add submenu items to the Windows Explorer context menu? QUESTION: I can create a menu item in the Windows Explorer context menu by adding keys in the registry to HKEY_CLASSES_ROOT\Folder\shell. How can I create submenu items to the just created menu item? ANSWER: I believe anything non-trival you'll hav...
[ "windows", "user-interface", "windows-shell" ]
9
3
7,526
2
0
2008-09-02T15:02:21.860000
2008-09-02T16:30:22.820000
39,735
40,120
Have you got a CascadingDropDown working with ASP.NET MVC?
If so how? Did you roll your own with jQuery or use the Microsoft AJAX toolkit? Did you create a webservice or call an action? EDIT: Please note that this question was asked before Microsoft announced that they were going to bundle jQuery in with VS/ASP.NET MVC. I think there is less of a discussion around this topic n...
jQuery, action, return JSON. http://devlicio.us/blogs/mike_nichols/archive/2008/05/25/jquery-cascade-cascading-values-from-forms.aspx
Have you got a CascadingDropDown working with ASP.NET MVC? If so how? Did you roll your own with jQuery or use the Microsoft AJAX toolkit? Did you create a webservice or call an action? EDIT: Please note that this question was asked before Microsoft announced that they were going to bundle jQuery in with VS/ASP.NET MVC...
TITLE: Have you got a CascadingDropDown working with ASP.NET MVC? QUESTION: If so how? Did you roll your own with jQuery or use the Microsoft AJAX toolkit? Did you create a webservice or call an action? EDIT: Please note that this question was asked before Microsoft announced that they were going to bundle jQuery in w...
[ "c#", "asp.net-mvc", "ajax", "controls" ]
5
3
5,200
4
0
2008-09-02T15:02:25.807000
2008-09-02T17:38:04.230000
39,739
40,350
Remote Debugging Server Side of a Web Application with Visual Studio 2008
So, I've read that it is not a good idea to install VS2008 on my test server machine as it changes the run time environment too much. I've never attempted remote debugging with Visual Studio before, so what is the "best" way to get line by line remote debugging of server side web app code. I'd like to be able to set a ...
First, this is MUCH easier if both the server and your workstation are on the same domain (the server needs access to connect to your machine). In your C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86 (or x64, or ia64) directory are the files you need to copy to your server. There are differ...
Remote Debugging Server Side of a Web Application with Visual Studio 2008 So, I've read that it is not a good idea to install VS2008 on my test server machine as it changes the run time environment too much. I've never attempted remote debugging with Visual Studio before, so what is the "best" way to get line by line r...
TITLE: Remote Debugging Server Side of a Web Application with Visual Studio 2008 QUESTION: So, I've read that it is not a good idea to install VS2008 on my test server machine as it changes the run time environment too much. I've never attempted remote debugging with Visual Studio before, so what is the "best" way to ...
[ "asp.net", "visual-studio", "debugging", "asp-classic" ]
8
12
8,008
2
0
2008-09-02T15:04:06.707000
2008-09-02T19:19:54.313000
39,742
39,947
Does git have anything like `svn propset svn:keywords` or pre-/post-commit hooks?
Browsing through the git documentation, I can't see anything analogous to SVN's commit hooks or the "propset" features that can, say, update a version number or copyright notice within a file whenever it is committed to the repository. Are git users expected to write external scripts for this sort of functionality (whi...
Quoting from the Git FAQ: Does git have keyword expansion? Not recommended. Keyword expansion causes all sorts of strange problems and isn't really useful anyway, especially within the context of an SCM. Outside git you may perform keyword expansion using a script. The Linux kernel export script does this to set the EX...
Does git have anything like `svn propset svn:keywords` or pre-/post-commit hooks? Browsing through the git documentation, I can't see anything analogous to SVN's commit hooks or the "propset" features that can, say, update a version number or copyright notice within a file whenever it is committed to the repository. Ar...
TITLE: Does git have anything like `svn propset svn:keywords` or pre-/post-commit hooks? QUESTION: Browsing through the git documentation, I can't see anything analogous to SVN's commit hooks or the "propset" features that can, say, update a version number or copyright notice within a file whenever it is committed to ...
[ "svn", "git", "version-control" ]
39
14
22,679
5
0
2008-09-02T15:05:22.150000
2008-09-02T16:25:27.917000
39,744
39,765
Getting Configuration value from web.config file using VB and .Net 1.1
I have the following web config file. I am having some difficulty in retrieving the value from the "AppName.DataAccess.ConnectionString" key. I know I could move it to the AppSetting block and get it realtively easily but I do not wnat to duplicate the key (and thereby clutter my already cluttered web.config file). Ano...
The custom section is supposed to have a class that defines how the various configuration data can be managed, (This is in the Type section). Is this class not available for you to examine? MSDN has a decent explanation of how to create custom configuration sections in VB that may be helpful to you: http://msdn.microso...
Getting Configuration value from web.config file using VB and .Net 1.1 I have the following web config file. I am having some difficulty in retrieving the value from the "AppName.DataAccess.ConnectionString" key. I know I could move it to the AppSetting block and get it realtively easily but I do not wnat to duplicate ...
TITLE: Getting Configuration value from web.config file using VB and .Net 1.1 QUESTION: I have the following web config file. I am having some difficulty in retrieving the value from the "AppName.DataAccess.ConnectionString" key. I know I could move it to the AppSetting block and get it realtively easily but I do not ...
[ "vb.net", "configuration-files", ".net-1.1" ]
0
2
4,017
1
0
2008-09-02T15:05:47.077000
2008-09-02T15:15:07.057000
39,746
224,136
TortoiseHg in Vista 64-bit not showing the context menu
I installed TortoiseHg (Mercurial) in my Vista 64-bit and the context menu is not showing up when I right click a file or folder. Is there any workaround for this problem?
Update: TortoiseHg 0.8 (released 2009-07-01) now includes both 32 and 64 bit shell extensions in the installer, and also works with Windows 7. The workaround described below is no longer necessary. A workaround to getting the context menus in Windows Explorer is buried in the TortoiseHg development mailing list archive...
TortoiseHg in Vista 64-bit not showing the context menu I installed TortoiseHg (Mercurial) in my Vista 64-bit and the context menu is not showing up when I right click a file or folder. Is there any workaround for this problem?
TITLE: TortoiseHg in Vista 64-bit not showing the context menu QUESTION: I installed TortoiseHg (Mercurial) in my Vista 64-bit and the context menu is not showing up when I right click a file or folder. Is there any workaround for this problem? ANSWER: Update: TortoiseHg 0.8 (released 2009-07-01) now includes both 32...
[ "mercurial", "tortoisehg", "vista64" ]
12
20
6,100
8
0
2008-09-02T15:06:17.467000
2008-10-22T01:15:20.620000
39,758
39,778
What does Google Chrome mean to web developers?
From a web developer point of view, what changes are expected in the development arena when Google Chrome is released? Are the developments powerful enough to make another revolution in the web? Will the way we see web programming change? Or is it just another web browser?
I think this is just another web browser. The most impact I expect to be improved Javascript performance, and the usability perspective. The first will benefit developers, especially when using Google Gears. I think the users will benefit the most from an enhanced user experience, the safety features, and ease of use. ...
What does Google Chrome mean to web developers? From a web developer point of view, what changes are expected in the development arena when Google Chrome is released? Are the developments powerful enough to make another revolution in the web? Will the way we see web programming change? Or is it just another web browser...
TITLE: What does Google Chrome mean to web developers? QUESTION: From a web developer point of view, what changes are expected in the development arena when Google Chrome is released? Are the developments powerful enough to make another revolution in the web? Will the way we see web programming change? Or is it just a...
[ "google-chrome" ]
18
14
1,992
17
0
2008-09-02T15:12:55.033000
2008-09-02T15:19:33.970000
39,770
39,786
What do you call the tags in Subversion and CVS that add automatic content?
Things like $log$ and $version$ which add data upon check-in to the file. I'm interested in seeing the other ones and what information they can provide, but I can't get much info unless I know what they are called.
Both Subversion and CVS call them Keywords. Have a look in the SVN manual here (scroll down to svn:keywords ) or here for CVS.
What do you call the tags in Subversion and CVS that add automatic content? Things like $log$ and $version$ which add data upon check-in to the file. I'm interested in seeing the other ones and what information they can provide, but I can't get much info unless I know what they are called.
TITLE: What do you call the tags in Subversion and CVS that add automatic content? QUESTION: Things like $log$ and $version$ which add data upon check-in to the file. I'm interested in seeing the other ones and what information they can provide, but I can't get much info unless I know what they are called. ANSWER: Bo...
[ "svn", "tags", "cvs" ]
2
7
321
3
0
2008-09-02T15:17:16.020000
2008-09-02T15:20:54.060000
39,771
39,776
Is a GUID unique 100% of the time?
Is a GUID unique 100% of the time? Will it stay unique over multiple threads?
While each generated GUID is not guaranteed to be unique, the total number of unique keys (2 128 or 3.4×10 38 ) is so large that the probability of the same number being generated twice is very small. For example, consider the observable universe, which contains about 5×10 22 stars; every star could then have 6.8×10 15...
Is a GUID unique 100% of the time? Is a GUID unique 100% of the time? Will it stay unique over multiple threads?
TITLE: Is a GUID unique 100% of the time? QUESTION: Is a GUID unique 100% of the time? Will it stay unique over multiple threads? ANSWER: While each generated GUID is not guaranteed to be unique, the total number of unique keys (2 128 or 3.4×10 38 ) is so large that the probability of the same number being generated ...
[ "language-agnostic", "guid" ]
675
536
270,400
25
0
2008-09-02T15:17:22.680000
2008-09-02T15:19:17.450000
39,772
39,797
Encrypt data from users in web applications
Some web applications, like Google Docs, store data generated by the users. Data that can only be read by its owner. Or maybe not? As far as I know, this data is stored as is in a remote database. So, if anybody with enough privileges in the remote system (a sysadmin, for instance) can lurk my data, my privacy could ge...
If encryption/decryption is performed on the server, there is no way you can make sure that the cleartext is not dumped somewhere in some log file or the like. You need to do the encryption/decryption inside the browser using JavaScript/Java/ActiveX or whatever. As a user, you need to trust the client-side of the web s...
Encrypt data from users in web applications Some web applications, like Google Docs, store data generated by the users. Data that can only be read by its owner. Or maybe not? As far as I know, this data is stored as is in a remote database. So, if anybody with enough privileges in the remote system (a sysadmin, for ins...
TITLE: Encrypt data from users in web applications QUESTION: Some web applications, like Google Docs, store data generated by the users. Data that can only be read by its owner. Or maybe not? As far as I know, this data is stored as is in a remote database. So, if anybody with enough privileges in the remote system (a...
[ "encryption", "web-applications", "privacy" ]
4
6
4,515
5
0
2008-09-02T15:18:05.300000
2008-09-02T15:25:30.477000
39,777
91,543
Implementing a '20 Questions'-like Wizard in a Database
I am looking to implement a data-driven wizard with the question tree stored in an Oracle database. What is the best schema to use to make the database portion flexible (i.e. easy to add new paths of questions) without sacrificing too much in terms of performance?
You can build a tree structure using a foreign key that references the same table (a "pig's ear" relationship as it is often known). Then you can use the CONNECT BY syntax to traverse the tree. Here is a simple example: SQL> create table qs 2 ( q_id integer primary key 3, parent_q_id integer references qs 4, parent_q_a...
Implementing a '20 Questions'-like Wizard in a Database I am looking to implement a data-driven wizard with the question tree stored in an Oracle database. What is the best schema to use to make the database portion flexible (i.e. easy to add new paths of questions) without sacrificing too much in terms of performance?
TITLE: Implementing a '20 Questions'-like Wizard in a Database QUESTION: I am looking to implement a data-driven wizard with the question tree stored in an Oracle database. What is the best schema to use to make the database portion flexible (i.e. easy to add new paths of questions) without sacrificing too much in ter...
[ "sql", "oracle", "database-design" ]
0
0
1,398
1
0
2008-09-02T15:19:33.067000
2008-09-18T10:44:23.700000
39,780
39,820
How do I check job status from SSIS control flow?
Here's my scenario - I have an SSIS job that depends on another prior SSIS job to run. I need to be able to check the first job's status before I kick off the second one. It's not feasible to add the 2nd job into the workflow of the first one, as it is already way too complex. I want to be able to check the first job's...
You may want to create a third package the runs packageA and then packageB. The third package would only contain two execute package tasks. http://msdn.microsoft.com/en-us/library/ms137609.aspx @Craig A status table is an option but you will have to keep monitoring it. Here is an article about events in SSIS for you or...
How do I check job status from SSIS control flow? Here's my scenario - I have an SSIS job that depends on another prior SSIS job to run. I need to be able to check the first job's status before I kick off the second one. It's not feasible to add the 2nd job into the workflow of the first one, as it is already way too c...
TITLE: How do I check job status from SSIS control flow? QUESTION: Here's my scenario - I have an SSIS job that depends on another prior SSIS job to run. I need to be able to check the first job's status before I kick off the second one. It's not feasible to add the 2nd job into the workflow of the first one, as it is...
[ "sql-server", "ssis" ]
3
4
3,492
2
0
2008-09-02T15:19:50.587000
2008-09-02T15:36:04.727000
39,792
39,807
How do I do multiple updates in a single SQL query?
I have an SQL query that takes the following form: UPDATE foo SET flag=true WHERE id=? I also have a PHP array which has a list of IDs. What is the best way to accomplish this other than with parsing, as follows,... foreach($list as $item){ $querycondition = $querycondition. " OR ". $item; }... and using the output in ...
This would achieve the same thing, but probably won't yield much of a speed increase, but looks nicer. mysql_query("UPDATE foo SET flag=true WHERE id IN (".implode(', ',$list).")");
How do I do multiple updates in a single SQL query? I have an SQL query that takes the following form: UPDATE foo SET flag=true WHERE id=? I also have a PHP array which has a list of IDs. What is the best way to accomplish this other than with parsing, as follows,... foreach($list as $item){ $querycondition = $querycon...
TITLE: How do I do multiple updates in a single SQL query? QUESTION: I have an SQL query that takes the following form: UPDATE foo SET flag=true WHERE id=? I also have a PHP array which has a list of IDs. What is the best way to accomplish this other than with parsing, as follows,... foreach($list as $item){ $querycon...
[ "php", "sql", "where-clause" ]
8
9
3,415
8
0
2008-09-02T15:22:57.007000
2008-09-02T15:29:18.770000
39,824
39,832
Debugging an exception in an empty catch block
I'm debugging a production application that has a rash of empty catch blocks sigh: try {*SOME CODE*} catch{} Is there a way of seeing what the exception is when the debugger hits the catch in the IDE?
In VS, if you look in the Locals area of your IDE while inside the catch block, you will have something to the effect of $EXCEPTION which will have all of the information for the exception that was just caught.
Debugging an exception in an empty catch block I'm debugging a production application that has a rash of empty catch blocks sigh: try {*SOME CODE*} catch{} Is there a way of seeing what the exception is when the debugger hits the catch in the IDE?
TITLE: Debugging an exception in an empty catch block QUESTION: I'm debugging a production application that has a rash of empty catch blocks sigh: try {*SOME CODE*} catch{} Is there a way of seeing what the exception is when the debugger hits the catch in the IDE? ANSWER: In VS, if you look in the Locals area of your...
[ "debugging", "exception", "ide", "try-catch" ]
8
11
3,045
7
0
2008-09-02T15:38:09.637000
2008-09-02T15:41:12.907000
39,843
40,868
How do I create a base page in WPF?
I have decided that all my WPF pages need to register a routed event. Rather than include public static readonly RoutedEvent MyEvent= EventManager.RegisterRoutedEvent("MyEvent", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(BasePage)); on every page, I decided to create a base page (named BasePage). I put ...
Here's how I've done this in my current project. First I've defined a class (as @Daren Thomas said - just a plain old C# class, no associated XAML file), like this (and yes, this is a real class - best not to ask): public class PigFinderPage: Page { /* add custom events and properties here */ } Then I create a new Page...
How do I create a base page in WPF? I have decided that all my WPF pages need to register a routed event. Rather than include public static readonly RoutedEvent MyEvent= EventManager.RegisterRoutedEvent("MyEvent", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(BasePage)); on every page, I decided to create ...
TITLE: How do I create a base page in WPF? QUESTION: I have decided that all my WPF pages need to register a routed event. Rather than include public static readonly RoutedEvent MyEvent= EventManager.RegisterRoutedEvent("MyEvent", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(BasePage)); on every page, I ...
[ ".net", "wpf" ]
10
29
16,516
5
0
2008-09-02T15:45:03.550000
2008-09-02T22:58:19.127000
39,855
1,694,704
Embed a PowerPoint presentation into HTML
Is it possible to embed a PowerPoint presentation (.ppt) into a webpage (.xhtml)? This will be used on a local intranet where there is a mix of Internet Explorer 6 and Internet Explorer 7 only, so no need to consider other browsers. I've given up... I guess Flash is the way forward.
Google Docs can serve up PowerPoint (and PDF) documents in it's document viewer. You don't have to sign up for Google Docs, just upload it to your website, and call it from your page:
Embed a PowerPoint presentation into HTML Is it possible to embed a PowerPoint presentation (.ppt) into a webpage (.xhtml)? This will be used on a local intranet where there is a mix of Internet Explorer 6 and Internet Explorer 7 only, so no need to consider other browsers. I've given up... I guess Flash is the way for...
TITLE: Embed a PowerPoint presentation into HTML QUESTION: Is it possible to embed a PowerPoint presentation (.ppt) into a webpage (.xhtml)? This will be used on a local intranet where there is a mix of Internet Explorer 6 and Internet Explorer 7 only, so no need to consider other browsers. I've given up... I guess Fl...
[ "xhtml", "embed", "powerpoint" ]
65
96
197,099
23
0
2008-09-02T15:50:10.433000
2009-11-07T22:47:35.740000
39,856
39,864
how do I import a class to use inside Flex application?
I have an actionscript file that defines a class that I would like to use inside a Flex application. I have defined some custom controls in a actionscript file and then import them via the application tag: but this code is not a flex component, rather it is a library for performing math routines, how do I import this c...
You'd need to import the class inside a script tag. import com.apterasoftware.scorecard.controls.*; // Other imports go here // Functions and other code go here Then you'll be able to reference that class anywhere else in your script tag. Depending on how the class is written you may not be able to use binding within ...
how do I import a class to use inside Flex application? I have an actionscript file that defines a class that I would like to use inside a Flex application. I have defined some custom controls in a actionscript file and then import them via the application tag: but this code is not a flex component, rather it is a libr...
TITLE: how do I import a class to use inside Flex application? QUESTION: I have an actionscript file that defines a class that I would like to use inside a Flex application. I have defined some custom controls in a actionscript file and then import them via the application tag: but this code is not a flex component, r...
[ "apache-flex", "actionscript-3" ]
0
5
7,739
2
0
2008-09-02T15:51:51.787000
2008-09-02T15:56:51.993000
39,867
40,141
How to run gpg from a script run by cron?
I have a script that has a part that looks like that: for file in `ls *.tar.gz`; do echo encrypting $file gpg --passphrase-file /home/$USER/.gnupg/backup-passphrase \ --simple-sk-checksum -c $file done For some reason if I run this script manually, works perfectly fine and all files are encrypted. If I run this as cron...
It turns out that the answer was easier than I expected. There is a --batch parameter missing, gpg tries to read from /dev/tty that doesn't exist for cron jobs. To debug that I have used --exit-on-status-write-error param. But to use that I was inspired by exit status 2, reported by echoing $? as Cd-Man suggested.
How to run gpg from a script run by cron? I have a script that has a part that looks like that: for file in `ls *.tar.gz`; do echo encrypting $file gpg --passphrase-file /home/$USER/.gnupg/backup-passphrase \ --simple-sk-checksum -c $file done For some reason if I run this script manually, works perfectly fine and all ...
TITLE: How to run gpg from a script run by cron? QUESTION: I have a script that has a part that looks like that: for file in `ls *.tar.gz`; do echo encrypting $file gpg --passphrase-file /home/$USER/.gnupg/backup-passphrase \ --simple-sk-checksum -c $file done For some reason if I run this script manually, works perfe...
[ "bash", "cron", "gnupg" ]
27
24
26,717
7
0
2008-09-02T15:58:49.947000
2008-09-02T17:48:02.243000
39,879
39,961
Why doesn't JavaScript support multithreading?
Is it a deliberate design decision or a problem with our current day browsers which will be rectified in the coming versions?
JavaScript does not support multi-threading because the JavaScript interpreter in the browser is a single thread (AFAIK). Even Google Chrome will not let a single web page’s JavaScript run concurrently because this would cause massive concurrency issues in existing web pages. All Chrome does is separate multiple compon...
Why doesn't JavaScript support multithreading? Is it a deliberate design decision or a problem with our current day browsers which will be rectified in the coming versions?
TITLE: Why doesn't JavaScript support multithreading? QUESTION: Is it a deliberate design decision or a problem with our current day browsers which will be rectified in the coming versions? ANSWER: JavaScript does not support multi-threading because the JavaScript interpreter in the browser is a single thread (AFAIK)...
[ "javascript", "multithreading", "browser" ]
336
230
200,663
16
0
2008-09-02T16:03:23.773000
2008-09-02T16:29:36.627000
39,892
40,036
How To Write a Plug-In for IE
The IE Developer Toolbar is a plugin that can dock or separate from the browser. I understand its much more difficult to do this in IE than in Firefox. How does one create an IE plugin? What languages are available for this task? How can I make a Hello World plugin?
Here are a few resources that might help you in your quest to create browser helper objects (BHO). http://petesearch.com/wiki/ (archived) http://www.hackszine.com/blog/archive/2007/06/howto_port_firefox_extensions.html http://msdn.microsoft.com/en-us/library/ms182554(VS.80).aspx http://www.codeplex.com/TeamTestPlugins
How To Write a Plug-In for IE The IE Developer Toolbar is a plugin that can dock or separate from the browser. I understand its much more difficult to do this in IE than in Firefox. How does one create an IE plugin? What languages are available for this task? How can I make a Hello World plugin?
TITLE: How To Write a Plug-In for IE QUESTION: The IE Developer Toolbar is a plugin that can dock or separate from the browser. I understand its much more difficult to do this in IE than in Firefox. How does one create an IE plugin? What languages are available for this task? How can I make a Hello World plugin? ANSW...
[ "internet-explorer", "plugins", "ieaddon" ]
21
12
19,673
2
0
2008-09-02T16:07:53.310000
2008-09-02T17:00:57.410000
39,903
39,955
VS.NET defaults to private class
Why does Visual Studio declare new classes as private in C#? I almost always switch them over to public, am I the crazy one?
Private access by default seems like a reasonable design choice on the part of the C# language specifiers. A good general design principle is to make all access levels as restrictive as possible, to minimize dependencies. You are less likely to end up with the wrong access level if you start as restrictive as possible ...
VS.NET defaults to private class Why does Visual Studio declare new classes as private in C#? I almost always switch them over to public, am I the crazy one?
TITLE: VS.NET defaults to private class QUESTION: Why does Visual Studio declare new classes as private in C#? I almost always switch them over to public, am I the crazy one? ANSWER: Private access by default seems like a reasonable design choice on the part of the C# language specifiers. A good general design princi...
[ "c#", "visual-studio" ]
6
8
468
6
0
2008-09-02T16:10:31.837000
2008-09-02T16:28:29.767000
39,910
40,929
How to use the SharePoint MultipleLookupField control?
I want to use the MultipleLookupField control in a web page that will run in the context of SharePoint. I was wondering if anyone would help me with an example, which shows step by step how to use the control two display two SPField Collections.
I'm not entirely sure I understand your question, especially the bit about displaying two SPField collections. Sorry if this turns out to be the answer to a completely different question! Anyway here's a quick demo walkthrough of using the MultipleLookupField in a web part. Create a team site. Add a few tasks to the ta...
How to use the SharePoint MultipleLookupField control? I want to use the MultipleLookupField control in a web page that will run in the context of SharePoint. I was wondering if anyone would help me with an example, which shows step by step how to use the control two display two SPField Collections.
TITLE: How to use the SharePoint MultipleLookupField control? QUESTION: I want to use the MultipleLookupField control in a web page that will run in the context of SharePoint. I was wondering if anyone would help me with an example, which shows step by step how to use the control two display two SPField Collections. ...
[ "sharepoint" ]
1
2
5,528
3
0
2008-09-02T16:14:06.773000
2008-09-02T23:46:21.087000
39,912
39,944
How do I remove an item from a stl vector with a certain value?
I was looking at the API documentation for stl vector, and noticed there was no method on the vector class that allowed the removal of an element with a certain value. This seems like a common operation, and it seems odd that there's no built in way to do this.
std::remove does not actually erase elements from the container: it overwrites the elements that should not be removed at the beginning of the container, and returns the iterator pointing to the next element after them. This iterator can be passed to container_type::erase to do the actual removal of the extra elements ...
How do I remove an item from a stl vector with a certain value? I was looking at the API documentation for stl vector, and noticed there was no method on the vector class that allowed the removal of an element with a certain value. This seems like a common operation, and it seems odd that there's no built in way to do ...
TITLE: How do I remove an item from a stl vector with a certain value? QUESTION: I was looking at the API documentation for stl vector, and noticed there was no method on the vector class that allowed the removal of an element with a certain value. This seems like a common operation, and it seems odd that there's no b...
[ "c++", "stl" ]
165
191
228,865
12
0
2008-09-02T16:14:13.170000
2008-09-02T16:23:15.520000
39,914
41,224
How do I set windows to perform auto login?
Windows has a feature that allows an administrator to perform auto-logon whenever it is started. How can this feature be activated?
Based on the advice, moved the answer to the answers section: There are tools out there that give you a GUI for setting this easily, but you can also do it relatively easily by editing the registry. Under the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon Add the follow...
How do I set windows to perform auto login? Windows has a feature that allows an administrator to perform auto-logon whenever it is started. How can this feature be activated?
TITLE: How do I set windows to perform auto login? QUESTION: Windows has a feature that allows an administrator to perform auto-logon whenever it is started. How can this feature be activated? ANSWER: Based on the advice, moved the answer to the answers section: There are tools out there that give you a GUI for setti...
[ "windows" ]
0
4
491
2
0
2008-09-02T16:15:10
2008-09-03T05:52:56.273000
39,915
39,997
Extra tables or non-specific foreign keys?
There are several types of objects in a system, and each has it's own table in the database. A user should be able to comment on any of them. How would you design the comments table(s)? I can think of a few options: One comments table, with a FK column for each object type (ObjectAID, ObjectBID, etc) Several comments t...
@palmsey Pretty much, but the variation on that pattern that I've seen most often gets rid of ObjectAID et al. ParentID becomes both the PK and the FK to Parents. That gets you something like: Parents ParentID ObjectA ParentID (FK and PK) ColumnFromA NOT NULL ObjectB ParentID (FK and PK) ColumnFromB NOT NULL Comments w...
Extra tables or non-specific foreign keys? There are several types of objects in a system, and each has it's own table in the database. A user should be able to comment on any of them. How would you design the comments table(s)? I can think of a few options: One comments table, with a FK column for each object type (Ob...
TITLE: Extra tables or non-specific foreign keys? QUESTION: There are several types of objects in a system, and each has it's own table in the database. A user should be able to comment on any of them. How would you design the comments table(s)? I can think of a few options: One comments table, with a FK column for ea...
[ "database-design", "foreign-keys", "normalization" ]
1
1
296
5
0
2008-09-02T16:15:15.443000
2008-09-02T16:43:10.823000
39,916
39,963
Programmatically building htpasswd
Is there a programmatic way to build htpasswd files, without depending on OS specific functions (i.e. exec(), passthru() )?
.httpasswd files are just text files with a specific format depending on the hash function specified. If you are using MD5 they look like this: foo:$apr1$y1cXxW5l$3vapv2yyCXaYz8zGoXj241 That's the login, a colon,,$apr1$, the salt and 1000 times md5 encoded as base64. If you select SHA1 they look like this: foo:{SHA}BW6...
Programmatically building htpasswd Is there a programmatic way to build htpasswd files, without depending on OS specific functions (i.e. exec(), passthru() )?
TITLE: Programmatically building htpasswd QUESTION: Is there a programmatic way to build htpasswd files, without depending on OS specific functions (i.e. exec(), passthru() )? ANSWER: .httpasswd files are just text files with a specific format depending on the hash function specified. If you are using MD5 they look l...
[ "php", "automation", ".htpasswd" ]
22
38
21,978
3
0
2008-09-02T16:15:23.197000
2008-09-02T16:29:51.587000
39,928
40,105
How to fix native client error 'Connection is busy with results for another command'?
I'm getting a Connection Busy With Results From Another Command error from a SQLServer Native Client driver when a SSIS package is running. Only when talking to SQLServer 2000. A different part that talks to SQLServer 2005 seems to always run fine. Any thoughts?
Microsoft KB article 822668 is relevant here: FIX: "Connection is busy with results for another command" error message occurs when you run a linked server query Symptoms Under stress conditions, you may receive the following error message when you perform linked server activity: Server: Msg 7399, Level 16, State 1, Pro...
How to fix native client error 'Connection is busy with results for another command'? I'm getting a Connection Busy With Results From Another Command error from a SQLServer Native Client driver when a SSIS package is running. Only when talking to SQLServer 2000. A different part that talks to SQLServer 2005 seems to al...
TITLE: How to fix native client error 'Connection is busy with results for another command'? QUESTION: I'm getting a Connection Busy With Results From Another Command error from a SQLServer Native Client driver when a SSIS package is running. Only when talking to SQLServer 2000. A different part that talks to SQLServe...
[ "sql-server", "ssis", "connection" ]
5
1
30,897
5
0
2008-09-02T16:18:36.700000
2008-09-02T17:29:38.790000
39,929
40,069
PGP signatures from Python?
What is the easiest way to create and verify PGP/GPG signatures from within a Python application? I can call pgp or gpg using subprocess and parse the output, but I was looking for a way that didn't require an external program to be installed (my application is cross-platform mac/windows/unix).
I think GPGME and the PyMe Python wrapper should do what you need.
PGP signatures from Python? What is the easiest way to create and verify PGP/GPG signatures from within a Python application? I can call pgp or gpg using subprocess and parse the output, but I was looking for a way that didn't require an external program to be installed (my application is cross-platform mac/windows/uni...
TITLE: PGP signatures from Python? QUESTION: What is the easiest way to create and verify PGP/GPG signatures from within a Python application? I can call pgp or gpg using subprocess and parse the output, but I was looking for a way that didn't require an external program to be installed (my application is cross-platfo...
[ "python", "security", "cross-platform", "gnupg" ]
7
8
2,548
2
0
2008-09-02T16:19:11.533000
2008-09-02T17:15:23.583000
39,946
39,988
Coupling and cohesion
I'm trying to boil down the concepts of coupling and cohesion to a concise definition. Can someone give me a short and understandable explanation (shorter than the definitions on Wikipedia here and here )? How do they interact? Thanks. Anybody have a good, short example?
Coupling Loose: You and the guy at the convenience store. You communicate through a well-defined protocol to achieve your respective goals - you pay money, he lets you walk out with the bag of Cheetos. Either one of you can be replaced without disrupting the system. Tight: You and your wife. Cohesion Low: The convenien...
Coupling and cohesion I'm trying to boil down the concepts of coupling and cohesion to a concise definition. Can someone give me a short and understandable explanation (shorter than the definitions on Wikipedia here and here )? How do they interact? Thanks. Anybody have a good, short example?
TITLE: Coupling and cohesion QUESTION: I'm trying to boil down the concepts of coupling and cohesion to a concise definition. Can someone give me a short and understandable explanation (shorter than the definitions on Wikipedia here and here )? How do they interact? Thanks. Anybody have a good, short example? ANSWER:...
[ "oop", "architecture", "theory", "software-design", "ooad" ]
77
233
47,283
6
0
2008-09-02T16:24:57.107000
2008-09-02T16:37:49.307000
39,960
40,173
Javascript equivalent of Python's locals()?
In Python one can get a dictionary of all local and global variables in the current scope with the built-in functions locals() and globals(). Is there some equivalent way of doing this in Javascript? For instance, I would like to do something like the following: var foo = function(){ alert('foo'); }; var bar = function...
locals() - No. globals() - Yes. window is a reference to the global scope, like globals() in python. globals()["foo"] is the same as: window["foo"]
Javascript equivalent of Python's locals()? In Python one can get a dictionary of all local and global variables in the current scope with the built-in functions locals() and globals(). Is there some equivalent way of doing this in Javascript? For instance, I would like to do something like the following: var foo = fun...
TITLE: Javascript equivalent of Python's locals()? QUESTION: In Python one can get a dictionary of all local and global variables in the current scope with the built-in functions locals() and globals(). Is there some equivalent way of doing this in Javascript? For instance, I would like to do something like the follow...
[ "javascript", "python" ]
26
18
15,743
6
0
2008-09-02T16:29:30.997000
2008-09-02T18:01:29.697000
39,977
40,003
How are tags made in Subversion?
I know how to use tags in subversion. I create a tag every time I get to a release milestone. What I don't quite understand is how they work. Is a tag just a copy, made from what ever revision I specify? Or is a tag more like a reference, where internally subversion just says GO TO /trunk/project/ Revision 5 or whateve...
Yes, a svn copy (whether you are thinking of it as a tag, a branch, or copying a file in trunk) is all the same. SVN will internally create a pointer to the source location at that revision. If you then make changes to the copy (which you are likely to do if it is a branch or a copied file in trunk, but shouldn't do fo...
How are tags made in Subversion? I know how to use tags in subversion. I create a tag every time I get to a release milestone. What I don't quite understand is how they work. Is a tag just a copy, made from what ever revision I specify? Or is a tag more like a reference, where internally subversion just says GO TO /tru...
TITLE: How are tags made in Subversion? QUESTION: I know how to use tags in subversion. I create a tag every time I get to a release milestone. What I don't quite understand is how they work. Is a tag just a copy, made from what ever revision I specify? Or is a tag more like a reference, where internally subversion ju...
[ "svn" ]
14
12
11,438
6
0
2008-09-02T16:35:09.610000
2008-09-02T16:45:50.567000
39,983
322,727
Security implications of multi-threaded javascript
Reading through this question on multi-threaded javascript, I was wondering if there would be any security implications in allowing javascript to spawn mutliple threads. For example, would there be a risk of a malicious script repeatedly spawning thread after thread in an attempt to overwhelm the operating system or in...
No, multiple threads would not add extra security problems in a perfect implementation. Threaded javascript would add complexity to the javascript interpreter which makes it more likely to have an exploitable bug. But threads alone are not going to add any security issues. Threads are not present in javascript because ...
Security implications of multi-threaded javascript Reading through this question on multi-threaded javascript, I was wondering if there would be any security implications in allowing javascript to spawn mutliple threads. For example, would there be a risk of a malicious script repeatedly spawning thread after thread in...
TITLE: Security implications of multi-threaded javascript QUESTION: Reading through this question on multi-threaded javascript, I was wondering if there would be any security implications in allowing javascript to spawn mutliple threads. For example, would there be a risk of a malicious script repeatedly spawning thre...
[ "javascript", "multithreading" ]
3
3
754
4
0
2008-09-02T16:36:29.747000
2008-11-27T01:41:46.570000
39,996
41,087
Improving performance with OPC tags
I am working with a PC based automation software package called Think'n'Do created by Phoenix Contact It does real time processing, read inputs/ control logic / write outputs all done in a maximum of 50ms. We have an OPC server that is reading/writing tags from a PLC every 10ms. There is a long delay in writing a tag t...
It depends on how you have your OPC client configured to pull data. When you subscribe to a group in OPC, you get to specify a refresh rate. This might default to 1s or even 5s, depending on the OPC client. There's also a limit the OPC server might put on the frequency of updated data. This only applies if you have you...
Improving performance with OPC tags I am working with a PC based automation software package called Think'n'Do created by Phoenix Contact It does real time processing, read inputs/ control logic / write outputs all done in a maximum of 50ms. We have an OPC server that is reading/writing tags from a PLC every 10ms. Ther...
TITLE: Improving performance with OPC tags QUESTION: I am working with a PC based automation software package called Think'n'Do created by Phoenix Contact It does real time processing, read inputs/ control logic / write outputs all done in a maximum of 50ms. We have an OPC server that is reading/writing tags from a PL...
[ "performance", "automation", "opc" ]
4
5
9,837
4
0
2008-09-02T16:42:46.843000
2008-09-03T02:36:46.060000
40,021
42,011
Create new page in Webtop
How do I create a new webpage in the Documentum front end Webtop?
Why WebTop? You should use Web Publisher which is built on WebTop with the specific purpose of managing web content. Is this an OOTB installation? Web Publisher / WebTop requires significant amount of customization in order to start being useful. Do you have templates defined? If so, then just go to File New and select...
Create new page in Webtop How do I create a new webpage in the Documentum front end Webtop?
TITLE: Create new page in Webtop QUESTION: How do I create a new webpage in the Documentum front end Webtop? ANSWER: Why WebTop? You should use Web Publisher which is built on WebTop with the specific purpose of managing web content. Is this an OOTB installation? Web Publisher / WebTop requires significant amount of ...
[ "documentum", "webtop" ]
1
1
874
2
0
2008-09-02T16:54:04.960000
2008-09-03T16:04:19.190000
40,022
40,029
Best way to update LINQ to SQL classes after database schema change
I'm using LINQ to SQL classes in a project where the database design is still in a bit of flux. Is there an easy way of synchronising the classes with the schema, or do I need to manually update the classes if a table design changes?
You can use SQLMetal.exe to generate your dbml and or cs/vb file. Use a pre-build script to start it and target the directory where your datacontext project belongs. C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\x64\sqlmetal.exe /server: /database: /code:"path\Solution\DataContextProject\dbContext.cs" /language:csh...
Best way to update LINQ to SQL classes after database schema change I'm using LINQ to SQL classes in a project where the database design is still in a bit of flux. Is there an easy way of synchronising the classes with the schema, or do I need to manually update the classes if a table design changes?
TITLE: Best way to update LINQ to SQL classes after database schema change QUESTION: I'm using LINQ to SQL classes in a project where the database design is still in a bit of flux. Is there an easy way of synchronising the classes with the schema, or do I need to manually update the classes if a table design changes? ...
[ "c#", ".net", "linq-to-sql" ]
76
65
37,248
7
0
2008-09-02T16:54:55.693000
2008-09-02T16:58:28.633000
40,026
40,086
Can the same Adobe AIR app run more than once?
As the title says, is there a way to run the same Adobe AIR app more than once? I have a little widget I wrote that shows thumbnails from a couple of photo streams, and I'd like to fix it so I can look at more than one stream at a time. Thanks!
It seems that this is not possible. From the documentation: Only one instance of an AIR application is started. When an already running application is invoked again, AIR dispatches a new invoke event to the running instance. It also gives a possible workaround: It is the responsibility of an AIR to respond to an invoke...
Can the same Adobe AIR app run more than once? As the title says, is there a way to run the same Adobe AIR app more than once? I have a little widget I wrote that shows thumbnails from a couple of photo streams, and I'd like to fix it so I can look at more than one stream at a time. Thanks!
TITLE: Can the same Adobe AIR app run more than once? QUESTION: As the title says, is there a way to run the same Adobe AIR app more than once? I have a little widget I wrote that shows thumbnails from a couple of photo streams, and I'd like to fix it so I can look at more than one stream at a time. Thanks! ANSWER: I...
[ "javascript", "air", "adobe" ]
4
2
3,966
8
0
2008-09-02T16:56:30.713000
2008-09-02T17:24:28.803000
40,028
41,231
How to find a normal vector pointing directly from virtual world to screen in Java3D?
I think it can be done by applying the transformation matrix of the scenegraph to z-normal (0, 0, 1), but it doesn't work. My code goes like this: Vector3f toScreenVector = new Vector3f(0, 0, 1); Transform3D t3d = new Transform3D(); tg.getTransform(t3d); //tg is Transform Group of all objects in a scene t3d.transform(t...
Yes, you got my question right. Sorry that I was a little bit confused yesterday. Now I have corrected the code by following your suggestion and mixing two pieces of code in the question together: Vector3f toScreenVector = new Vector3f(0, 0, 1); Transform3D t3d = new Transform3D(); canvas.getImagePlateToVworld(t3d); t...
How to find a normal vector pointing directly from virtual world to screen in Java3D? I think it can be done by applying the transformation matrix of the scenegraph to z-normal (0, 0, 1), but it doesn't work. My code goes like this: Vector3f toScreenVector = new Vector3f(0, 0, 1); Transform3D t3d = new Transform3D(); t...
TITLE: How to find a normal vector pointing directly from virtual world to screen in Java3D? QUESTION: I think it can be done by applying the transformation matrix of the scenegraph to z-normal (0, 0, 1), but it doesn't work. My code goes like this: Vector3f toScreenVector = new Vector3f(0, 0, 1); Transform3D t3d = ne...
[ "java", "graphics", "java-3d" ]
1
0
1,121
2
0
2008-09-02T16:57:08.543000
2008-09-03T06:07:08.893000
40,039
46,480
How do I read and write raw ip packets from java on a mac?
What would be the easiest way to be able to send and receive raw network packets. Do I have to write my own JNI wrapping of some c API, and in that case what API am I looking for? EDIT: I want to be able to do what wireshark does, i.e. record all incomming packets on an interface, and in addition be able to send back m...
If you start with the idea that you need something like a packet sniffer, you'll want to look at http://netresearch.ics.uci.edu/kfujii/jpcap/doc/.
How do I read and write raw ip packets from java on a mac? What would be the easiest way to be able to send and receive raw network packets. Do I have to write my own JNI wrapping of some c API, and in that case what API am I looking for? EDIT: I want to be able to do what wireshark does, i.e. record all incomming pack...
TITLE: How do I read and write raw ip packets from java on a mac? QUESTION: What would be the easiest way to be able to send and receive raw network packets. Do I have to write my own JNI wrapping of some c API, and in that case what API am I looking for? EDIT: I want to be able to do what wireshark does, i.e. record ...
[ "java", "macos", "networking" ]
3
1
6,609
5
0
2008-09-02T17:01:28.920000
2008-09-05T18:28:37.593000
40,043
40,061
How do I create a database programmatically in SQL Server?
How can I create a new database from my C# application? I'm assuming once I create it, I can simply generate a connection string on the fly and connect to it, and the issue all the CREATE TABLE statements.
KB307283 explains how to create a database using ADO.NET. From the article: String str; SqlConnection myConn = new SqlConnection ("Server=localhost;Integrated security=SSPI;database=master"); str = "CREATE DATABASE MyDatabase ON PRIMARY " + "(NAME = MyDatabase_Data, " + "FILENAME = 'C:\\MyDatabaseData.mdf', " + "SIZE ...
How do I create a database programmatically in SQL Server? How can I create a new database from my C# application? I'm assuming once I create it, I can simply generate a connection string on the fly and connect to it, and the issue all the CREATE TABLE statements.
TITLE: How do I create a database programmatically in SQL Server? QUESTION: How can I create a new database from my C# application? I'm assuming once I create it, I can simply generate a connection string on the fly and connect to it, and the issue all the CREATE TABLE statements. ANSWER: KB307283 explains how to cre...
[ ".net", "sql-server" ]
8
13
509
2
0
2008-09-02T17:04:46.853000
2008-09-02T17:09:15.800000
40,054
40,208
How can I update in Linq an entity that is disconnected from database?
Code below does not run correctly and throws InvalidOperationExcepiton. public void Foo() { DataContext context = new DataContext(); LinqEntity item = new LinqEntity(){ Id = 1, Name = "John", Surname = "Doe"}; context.LinqEntities.Attach(item, true); }
By default, the entities will use all fields for checking concurrency when making edits. That's what's throwing the InvalidOperationException. This can be setting the Update Check property for all fields to Never. This must be done on all fields to attach the entity as modified. If this is done, an additional call to c...
How can I update in Linq an entity that is disconnected from database? Code below does not run correctly and throws InvalidOperationExcepiton. public void Foo() { DataContext context = new DataContext(); LinqEntity item = new LinqEntity(){ Id = 1, Name = "John", Surname = "Doe"}; context.LinqEntities.Attach(item, true)...
TITLE: How can I update in Linq an entity that is disconnected from database? QUESTION: Code below does not run correctly and throws InvalidOperationExcepiton. public void Foo() { DataContext context = new DataContext(); LinqEntity item = new LinqEntity(){ Id = 1, Name = "John", Surname = "Doe"}; context.LinqEntities....
[ "c#", "linq" ]
6
4
1,391
4
0
2008-09-02T17:08:36.690000
2008-09-02T18:26:10.403000
40,075
40,148
Generic Map/Reduce List Extensions in C#
I am writing a few extensions to mimic the map and reduce functions in Lisp. public delegate R ReduceFunction (T t, R previous); public delegate void TransformFunction (T t, params object[] args); public static R Reduce (this List list, ReduceFunction r, R initial) { var aggregate = initial; foreach(var t in list) agg...
These look very similar to extensions in Linq already: //takes a function that matches the Func delegate listInstance.Aggregate( startingValue, (x, y) => /* aggregate two subsequent values */ ); //takes a function that matches the Action delegate listInstance.ForEach( x => /* do something with x */); Why is the 2nd ex...
Generic Map/Reduce List Extensions in C# I am writing a few extensions to mimic the map and reduce functions in Lisp. public delegate R ReduceFunction (T t, R previous); public delegate void TransformFunction (T t, params object[] args); public static R Reduce (this List list, ReduceFunction r, R initial) { var aggreg...
TITLE: Generic Map/Reduce List Extensions in C# QUESTION: I am writing a few extensions to mimic the map and reduce functions in Lisp. public delegate R ReduceFunction (T t, R previous); public delegate void TransformFunction (T t, params object[] args); public static R Reduce (this List list, ReduceFunction r, R ini...
[ "c#", "functional-programming", "extension-methods" ]
28
36
28,398
5
0
2008-09-02T17:18:19.460000
2008-09-02T17:49:54.080000
40,090
40,093
Is overloading the only way to have default function arguments in C#?
Is it true that the only way to handle default function arguments is through function overloading? For example, in PHP I can do this: function foo($x, $y=0) { } Would the best way to handle it in C# be this? void foo(int x) { foo(x, 0); } void foo(int x, int y) { } Example lifted from here Edit Made the C# example int...
Yes, that'd be best, except you'd omit the $ s on the parameter names, as others have pointed out. For those interested in the rationale behind the lack of default parameter values, see @Giovanni Galbo's explanation.
Is overloading the only way to have default function arguments in C#? Is it true that the only way to handle default function arguments is through function overloading? For example, in PHP I can do this: function foo($x, $y=0) { } Would the best way to handle it in C# be this? void foo(int x) { foo(x, 0); } void foo(i...
TITLE: Is overloading the only way to have default function arguments in C#? QUESTION: Is it true that the only way to handle default function arguments is through function overloading? For example, in PHP I can do this: function foo($x, $y=0) { } Would the best way to handle it in C# be this? void foo(int x) { foo(x,...
[ "c#", "overloading" ]
10
5
2,942
8
0
2008-09-02T17:25:56.367000
2008-09-02T17:27:26.333000
40,112
41,036
Is there a way to get ms-access to display images from external files
I've got an MS-Access app (1/10th MS-Acccess, 9/10ths MS-SQL) that needs to display photographs of some assets along with their specifications. Currently the images are stored in an MS-Access table as an OLE Object (and copy-n-pasted into the field by the users). For various reasons, I would like to do is store the ori...
Another option is to put an image control on your form. There is a property of that control (Picture) that is simply the path to the image. Here is a short example in VBA of how you might use it. txtPhoto would be a text box bound to the database field with the path to the image imgPicture is the image control The exam...
Is there a way to get ms-access to display images from external files I've got an MS-Access app (1/10th MS-Acccess, 9/10ths MS-SQL) that needs to display photographs of some assets along with their specifications. Currently the images are stored in an MS-Access table as an OLE Object (and copy-n-pasted into the field b...
TITLE: Is there a way to get ms-access to display images from external files QUESTION: I've got an MS-Access app (1/10th MS-Acccess, 9/10ths MS-SQL) that needs to display photographs of some assets along with their specifications. Currently the images are stored in an MS-Access table as an OLE Object (and copy-n-paste...
[ "ms-access", "image" ]
6
7
58,398
7
0
2008-09-02T17:34:34.163000
2008-09-03T01:44:05.780000
40,119
40,285
How to find a Java Memory Leak
How do you find a memory leak in Java (using, for example, JHat)? I have tried to load the heap dump up in JHat to take a basic look. However, I do not understand how I am supposed to be able to find the root reference ( ref ) or whatever it is called. Basically, I can tell that there are several hundred megabytes of h...
I use following approach to finding memory leaks in Java. I've used jProfiler with great success, but I believe that any specialized tool with graphing capabilities (diffs are easier to analyze in graphical form) will work. Start the application and wait until it get to "stable" state, when all the initialization is co...
How to find a Java Memory Leak How do you find a memory leak in Java (using, for example, JHat)? I have tried to load the heap dump up in JHat to take a basic look. However, I do not understand how I am supposed to be able to find the root reference ( ref ) or whatever it is called. Basically, I can tell that there are...
TITLE: How to find a Java Memory Leak QUESTION: How do you find a memory leak in Java (using, for example, JHat)? I have tried to load the heap dump up in JHat to take a basic look. However, I do not understand how I am supposed to be able to find the root reference ( ref ) or whatever it is called. Basically, I can t...
[ "java", "memory", "memory-leaks", "jhat" ]
150
133
159,975
12
0
2008-09-02T17:37:12.173000
2008-09-02T18:49:35.590000
40,122
40,170
Exceptions in Web Services
My group is developing a service-based (.NET WCF) application and we're trying to decide how to handle exceptions in our internal services. Should we throw exceptions? Return exceptions serialized as XML? Just return an error code? Keep in mind that the user will never see these exceptions, it's only for other parts of...
WCF uses SoapFaults as its native way of transmitting exceptions from either the service to the client, or the client to the service. You can declare a custom SOAP fault using the FaultContract attribute in your contract interface: For example: [ServiceContract(Namespace="foobar")] interface IContract { [OperationContr...
Exceptions in Web Services My group is developing a service-based (.NET WCF) application and we're trying to decide how to handle exceptions in our internal services. Should we throw exceptions? Return exceptions serialized as XML? Just return an error code? Keep in mind that the user will never see these exceptions, i...
TITLE: Exceptions in Web Services QUESTION: My group is developing a service-based (.NET WCF) application and we're trying to decide how to handle exceptions in our internal services. Should we throw exceptions? Return exceptions serialized as XML? Just return an error code? Keep in mind that the user will never see t...
[ ".net", "wcf", "web-services", "exception" ]
2
3
1,137
5
0
2008-09-02T17:38:59.470000
2008-09-02T17:59:04.307000
40,132
40,142
Best way to pass a large number of arguments into a configuration dialog
I've got a situation where I have a main form that pops up an advanced configuration form that just has half a dozen matched check boxes and combo boxes to select some advanced options (the check boxes to enable/disable, the combo to select a media if enabled). If I just pass the individual settings for the check and c...
I personally would create a carrier object to store the values. You then get the nice intellisense for it, and changes to it would be quite straightforward. It would also be faster than dictionary lookups for parameter values. And of course, you get type safety.:)
Best way to pass a large number of arguments into a configuration dialog I've got a situation where I have a main form that pops up an advanced configuration form that just has half a dozen matched check boxes and combo boxes to select some advanced options (the check boxes to enable/disable, the combo to select a medi...
TITLE: Best way to pass a large number of arguments into a configuration dialog QUESTION: I've got a situation where I have a main form that pops up an advanced configuration form that just has half a dozen matched check boxes and combo boxes to select some advanced options (the check boxes to enable/disable, the comb...
[ "c#" ]
2
6
464
4
0
2008-09-02T17:44:32.313000
2008-09-02T17:48:04.193000
40,133
40,156
Getting Apache to modify static webpages on the fly
I have been experimenting with woopra.com A web analytics tool. Which requires a piece of javascript code to be added to each page to function. This is easy enough with more dynamic sites with universal headers or footers but not for totally static html pages. I attempted to work round it by using a combination of Apac...
I think that mod_filter_ext is the module you are looking for. You can write a short Perl script for example to insert the JS code in the pages and register it to process HTML pages: while (<>) { s/ /\Q
Getting Apache to modify static webpages on the fly I have been experimenting with woopra.com A web analytics tool. Which requires a piece of javascript code to be added to each page to function. This is easy enough with more dynamic sites with universal headers or footers but not for totally static html pages. I attem...
TITLE: Getting Apache to modify static webpages on the fly QUESTION: I have been experimenting with woopra.com A web analytics tool. Which requires a piece of javascript code to be added to each page to function. This is easy enough with more dynamic sites with universal headers or footers but not for totally static h...
[ "apache", "templates", "filtering", "ssi" ]
3
2
4,314
4
0
2008-09-02T17:45:39.020000
2008-09-02T17:53:01.620000
40,154
4,868,661
How do you beta test an iphone app?
How can you beta test an iPhone app? I can get it on my own device, and anyone that gives me a device, I can run it on theirs, but is there a way to do a limited release via the app store for beta testing? Related: Also, see this question on getting your app onto phones without using the App Store.
In year 2011, there's a new service out called "Test Flight", and it addresses this issue directly. Apple has since bought TestFlight in 2014 and has integrated it into iTunes Connect and App Store Connect.
How do you beta test an iphone app? How can you beta test an iPhone app? I can get it on my own device, and anyone that gives me a device, I can run it on theirs, but is there a way to do a limited release via the app store for beta testing? Related: Also, see this question on getting your app onto phones without using...
TITLE: How do you beta test an iphone app? QUESTION: How can you beta test an iPhone app? I can get it on my own device, and anyone that gives me a device, I can run it on theirs, but is there a way to do a limited release via the app store for beta testing? Related: Also, see this question on getting your app onto ph...
[ "ios", "beta-testing" ]
469
173
199,214
9
0
2008-09-02T17:52:24.120000
2011-02-01T22:24:12.823000
40,161
40,180
Does C# have built-in support for parsing page-number strings?
Does C# have built-in support for parsing strings of page numbers? By page numbers, I mean the format you might enter into a print dialog that's a mixture of comma and dash-delimited. Something like this: 1,3,5-10,12 What would be really nice is a solution that gave me back some kind of list of all page numbers represe...
Should be simple: foreach( string s in "1,3,5-10,12".Split(',') ) { // try and get the number int num; if( int.TryParse( s, out num ) ) { yield return num; continue; // skip the rest } // otherwise we might have a range // split on the range delimiter string[] subs = s.Split('-'); int start, end; // now see if we can...
Does C# have built-in support for parsing page-number strings? Does C# have built-in support for parsing strings of page numbers? By page numbers, I mean the format you might enter into a print dialog that's a mixture of comma and dash-delimited. Something like this: 1,3,5-10,12 What would be really nice is a solution ...
TITLE: Does C# have built-in support for parsing page-number strings? QUESTION: Does C# have built-in support for parsing strings of page numbers? By page numbers, I mean the format you might enter into a print dialog that's a mixture of comma and dash-delimited. Something like this: 1,3,5-10,12 What would be really n...
[ "c#", "parsing" ]
20
25
8,577
11
0
2008-09-02T17:53:54.473000
2008-09-02T18:07:14.410000
40,169
40,179
Is it okay to have a lot of database views?
I infrequently (monthly/quarterly) generate hundreds of Crystal Reports reports using Microsoft SQL Server 2005 database views. Are those views wasting CPU cycles and RAM during all the time that I am not reading from them? Should I instead use stored procedures, temporary tables, or short-lived normal tables since I r...
For the most part, it doesn't matter. Yes, SQL Server will have more choices when it parses SELECT * FROM table (it'll have to look in the system catalogs for 'table') but it's highly optimized for that, and provided you have sufficient RAM (most servers nowadays do), you won't notice a difference between 0 and 1,000 v...
Is it okay to have a lot of database views? I infrequently (monthly/quarterly) generate hundreds of Crystal Reports reports using Microsoft SQL Server 2005 database views. Are those views wasting CPU cycles and RAM during all the time that I am not reading from them? Should I instead use stored procedures, temporary ta...
TITLE: Is it okay to have a lot of database views? QUESTION: I infrequently (monthly/quarterly) generate hundreds of Crystal Reports reports using Microsoft SQL Server 2005 database views. Are those views wasting CPU cycles and RAM during all the time that I am not reading from them? Should I instead use stored proced...
[ "sql", "sql-server", "database", "database-design", "crystal-reports" ]
11
10
4,861
4
0
2008-09-02T17:58:52.310000
2008-09-02T18:06:41.043000
40,171
250,296
How to compress JPEG images with ASP on Windows CE
The ASP page gets data uses that to draw a graph, I then need to save the image created to JPEG to be displayed on the browser and also used in PDF and other format. What is the best way to compress the image? I am currently porting a JPEG compression library to ASP but I think it will be too slow on this ARM device ru...
Take a look at the Imaging APIs (start your traversal at the IImagingFactory interface ). If your device has a JPG compression codec installed (remember that CE is modular, so it may or may not be present) you can use it to create a stream (or file) from the image. From there you can do with it what you wish.
How to compress JPEG images with ASP on Windows CE The ASP page gets data uses that to draw a graph, I then need to save the image created to JPEG to be displayed on the browser and also used in PDF and other format. What is the best way to compress the image? I am currently porting a JPEG compression library to ASP bu...
TITLE: How to compress JPEG images with ASP on Windows CE QUESTION: The ASP page gets data uses that to draw a graph, I then need to save the image created to JPEG to be displayed on the browser and also used in PDF and other format. What is the best way to compress the image? I am currently porting a JPEG compression...
[ "asp-classic", "compression", "windows-ce", "jpeg" ]
2
3
1,680
2
0
2008-09-02T18:00:04.880000
2008-10-30T14:13:56.527000
40,211
1,769,763
How to Compare Flags in C#?
I have a flag enum below. [Flags] public enum FlagTest { None = 0x0, Flag1 = 0x1, Flag2 = 0x2, Flag3 = 0x4 } I cannot make the if statement evaluate to true. FlagTest testItem = FlagTest.Flag1 | FlagTest.Flag2; if (testItem == FlagTest.Flag1) { // Do something, // however This is never true. } How can I make this true...
In.NET 4 there is a new method Enum.HasFlag. This allows you to write: if ( testItem.HasFlag( FlagTest.Flag1 ) ) { // Do Stuff } which is much more readable, IMO. The.NET source indicates that this performs the same logic as the accepted answer: public Boolean HasFlag(Enum flag) { if (!this.GetType().IsEquivalentTo(fla...
How to Compare Flags in C#? I have a flag enum below. [Flags] public enum FlagTest { None = 0x0, Flag1 = 0x1, Flag2 = 0x2, Flag3 = 0x4 } I cannot make the if statement evaluate to true. FlagTest testItem = FlagTest.Flag1 | FlagTest.Flag2; if (testItem == FlagTest.Flag1) { // Do something, // however This is never true...
TITLE: How to Compare Flags in C#? QUESTION: I have a flag enum below. [Flags] public enum FlagTest { None = 0x0, Flag1 = 0x1, Flag2 = 0x2, Flag3 = 0x4 } I cannot make the if statement evaluate to true. FlagTest testItem = FlagTest.Flag1 | FlagTest.Flag2; if (testItem == FlagTest.Flag1) { // Do something, // however ...
[ "c#", ".net", "enums", "attributes", "flags" ]
163
335
94,060
11
0
2008-09-02T18:28:16.733000
2009-11-20T11:04:36.407000
40,230
40,303
GUIDs as Primary Keys - Offline OLTP
We are working on designing an application that is typically OLTP (think: purchasing system). However, this one in particular has the need that some users will be offline, so they need to be able to download the DB to their machine, work on it, and then sync back once they're on the LAN. I would like to note that I kno...
Using Guids as primary keys is acceptable and is considered a fairly standard practice for the same reasons that you are considering them. They can be overused which can make things a bit tedious to debug and manage, so try to keep them out of code tables and other reference data if at all possible. The thing that you ...
GUIDs as Primary Keys - Offline OLTP We are working on designing an application that is typically OLTP (think: purchasing system). However, this one in particular has the need that some users will be offline, so they need to be able to download the DB to their machine, work on it, and then sync back once they're on the...
TITLE: GUIDs as Primary Keys - Offline OLTP QUESTION: We are working on designing an application that is typically OLTP (think: purchasing system). However, this one in particular has the need that some users will be offline, so they need to be able to download the DB to their machine, work on it, and then sync back o...
[ "sql-server", "synchronization", "guid", "offline", "oltp" ]
5
8
1,531
15
0
2008-09-02T18:35:36.230000
2008-09-02T18:56:50.063000
40,242
40,262
What is the best way to migrate an existing messy webapp to elegant MVC?
I joined a new company about a month ago. The company is rather small in size and has pretty strong "start-up" feel to it. I'm working as a Java developer on a team of 3 others. The company primarily sells a service to for businesses/business-type people to use in communicating with each other. One of the main things I...
Your best bet is probably to refactor it slowly as you go along. Few us of have the resources that would be required to completely start from scratch with something that has so many business rules buried in it. Management really hates it when you spend months on developing an app that has more bugs than the one you rep...
What is the best way to migrate an existing messy webapp to elegant MVC? I joined a new company about a month ago. The company is rather small in size and has pretty strong "start-up" feel to it. I'm working as a Java developer on a team of 3 others. The company primarily sells a service to for businesses/business-type...
TITLE: What is the best way to migrate an existing messy webapp to elegant MVC? QUESTION: I joined a new company about a month ago. The company is rather small in size and has pretty strong "start-up" feel to it. I'm working as a Java developer on a team of 3 others. The company primarily sells a service to for busine...
[ "java", "model-view-controller", "jsp", "architecture" ]
5
12
1,559
8
0
2008-09-02T18:39:00.840000
2008-09-02T18:43:56.647000
40,264
40,324
How many constructor arguments is too many?
Let's say you have a class called Customer, which contains the following fields: UserName Email First Name Last Name Let's also say that according to your business logic, all Customer objects must have these four properties defined. Now, we can do this pretty easily by forcing the constructor to specify each of these p...
Two design approaches to consider The essence pattern The fluent interface pattern These are both similar in intent, in that we slowly build up an intermediate object, and then create our target object in a single step. An example of the fluent interface in action would be: public class CustomerBuilder { String surname...
How many constructor arguments is too many? Let's say you have a class called Customer, which contains the following fields: UserName Email First Name Last Name Let's also say that according to your business logic, all Customer objects must have these four properties defined. Now, we can do this pretty easily by forcin...
TITLE: How many constructor arguments is too many? QUESTION: Let's say you have a class called Customer, which contains the following fields: UserName Email First Name Last Name Let's also say that according to your business logic, all Customer objects must have these four properties defined. Now, we can do this prett...
[ "parameters", "refactoring", "constructor", "coding-style" ]
164
141
99,506
15
0
2008-09-02T18:44:31.933000
2008-09-02T19:08:20.910000
40,269
661,129
Finding the storage card path on WM6
Is there an easy way to find the storage card's path on a Windows Mobile device when there is a storage card and a bluetooth ftp connection?
Keep in mind that "\Storage Card" is english oriented. A device made for a different region may have a different name. The name of the storage card path on my device varies with how I am using the device. Some time ago in the MSDN forms I responded to a few questions on how to detect the storage cards in the file syste...
Finding the storage card path on WM6 Is there an easy way to find the storage card's path on a Windows Mobile device when there is a storage card and a bluetooth ftp connection?
TITLE: Finding the storage card path on WM6 QUESTION: Is there an easy way to find the storage card's path on a Windows Mobile device when there is a storage card and a bluetooth ftp connection? ANSWER: Keep in mind that "\Storage Card" is english oriented. A device made for a different region may have a different na...
[ "windows-mobile" ]
6
5
18,349
8
0
2008-09-02T18:44:59.267000
2009-03-19T05:13:54.187000
40,273
40,961
What's the best way to use SOAP with Ruby?
A client of mine has asked me to integrate a 3rd party API into their Rails app. The only problem is that the API uses SOAP. Ruby has basically dropped SOAP in favor of REST. They provide a Java adapter that apparently works with the Java-Ruby bridge, but we'd like to keep it all in Ruby, if possible. I looked into soa...
We used the built in soap/wsdlDriver class, which is actually SOAP4R. It's dog slow, but really simple. The SOAP4R that you get from gems/etc is just an updated version of the same thing. Example code: require 'soap/wsdlDriver' client = SOAP::WSDLDriverFactory.new( 'http://example.com/service.wsdl' ).create_rpc_driver...
What's the best way to use SOAP with Ruby? A client of mine has asked me to integrate a 3rd party API into their Rails app. The only problem is that the API uses SOAP. Ruby has basically dropped SOAP in favor of REST. They provide a Java adapter that apparently works with the Java-Ruby bridge, but we'd like to keep it ...
TITLE: What's the best way to use SOAP with Ruby? QUESTION: A client of mine has asked me to integrate a 3rd party API into their Rails app. The only problem is that the API uses SOAP. Ruby has basically dropped SOAP in favor of REST. They provide a Java adapter that apparently works with the Java-Ruby bridge, but we'...
[ "ruby-on-rails", "ruby", "soap" ]
91
36
88,832
10
0
2008-09-02T18:46:09.060000
2008-09-03T00:27:21.393000
40,302
40,321
Create object from database row
Let's say I'm building a data access layer for an application. Typically I have a class definition for a each kind of object that is stored in the database. Of course, the actual data access retrieves data in the form of a datareader, typed or untyped dataset, or similar, usually with the data needed to create one obje...
I highly encourage you to use an ORM tool. Even simple projects can make use of ORM quickly and quietly... in particular, look at Castle 's ActiveRecord tool (which sits on top of NHibernate to simplify model declaration).
Create object from database row Let's say I'm building a data access layer for an application. Typically I have a class definition for a each kind of object that is stored in the database. Of course, the actual data access retrieves data in the form of a datareader, typed or untyped dataset, or similar, usually with th...
TITLE: Create object from database row QUESTION: Let's say I'm building a data access layer for an application. Typically I have a class definition for a each kind of object that is stored in the database. Of course, the actual data access retrieves data in the form of a datareader, typed or untyped dataset, or simila...
[ ".net" ]
4
3
3,091
5
0
2008-09-02T18:56:36.837000
2008-09-02T19:06:00.073000
40,311
40,327
Installer changes PATH variable, changes don't show up in Command Shell
I added a custom install action to my installer to add one of my installation directories to the System PATH environment variable. After I run the installer, the PATH variable reflects the changes (when I access it through the Control Panel::System applet), but when I start a new command shell, the PATH variable does n...
I think this depends on how you are starting the new Command shell. For example, when you change the PATH environment variable under System properties, the change isn't reflected until you open a new Command prompt. I think when you launch a new "cmd" process (from the Run dialog for example), you get a fresh copy of a...
Installer changes PATH variable, changes don't show up in Command Shell I added a custom install action to my installer to add one of my installation directories to the System PATH environment variable. After I run the installer, the PATH variable reflects the changes (when I access it through the Control Panel::System...
TITLE: Installer changes PATH variable, changes don't show up in Command Shell QUESTION: I added a custom install action to my installer to add one of my installation directories to the System PATH environment variable. After I run the installer, the PATH variable reflects the changes (when I access it through the Con...
[ "windows-installer", "environment", "path", "custom-action" ]
5
6
5,616
5
0
2008-09-02T19:01:34.950000
2008-09-02T19:09:28.397000
40,322
41,132
I can't see "Report Builder" button in the Report Manager on SQL Server 2005
I am a member of all the roles (Browser, Content Manager, My Reports, Publisher, Report Builder). If I login with a Local Administrator account, I can see and use it fine. Any ideas?
The first thing I would check is to make sure that your normal login is mapped to a role with the correct system-level permissions. The item-level role definitions don't make a difference for the "Report Builder" button. From the browser-based report manager interface: Click "site settings" In the Security section, cli...
I can't see "Report Builder" button in the Report Manager on SQL Server 2005 I am a member of all the roles (Browser, Content Manager, My Reports, Publisher, Report Builder). If I login with a Local Administrator account, I can see and use it fine. Any ideas?
TITLE: I can't see "Report Builder" button in the Report Manager on SQL Server 2005 QUESTION: I am a member of all the roles (Browser, Content Manager, My Reports, Publisher, Report Builder). If I login with a Local Administrator account, I can see and use it fine. Any ideas? ANSWER: The first thing I would check is ...
[ "sql-server", "reporting-services", "reportbuilder" ]
14
17
24,745
2
0
2008-09-02T19:06:09.980000
2008-09-03T03:21:55.670000
40,344
47,361
What's the best way to work with SQL Server data non-programmatically?
We have a SQL server database. To manipulate the data non-programmatically, I can use SQL Server Management Studio by right-clicking a table and selecting "Open Table". However this is slow for very large tables and sorting and filtering is cumbersome. Typically what we have done until now is to create an Access databa...
Joel Coehoorn's answer is of course correct, that if the data is critical or there are naive users using the data, then a application front end should be developed. That being said, I have cases where a wise user (ok, me) user needs to just get in there and poke around. Instead of directly looking at the tables, use MS...
What's the best way to work with SQL Server data non-programmatically? We have a SQL server database. To manipulate the data non-programmatically, I can use SQL Server Management Studio by right-clicking a table and selecting "Open Table". However this is slow for very large tables and sorting and filtering is cumberso...
TITLE: What's the best way to work with SQL Server data non-programmatically? QUESTION: We have a SQL server database. To manipulate the data non-programmatically, I can use SQL Server Management Studio by right-clicking a table and selecting "Open Table". However this is slow for very large tables and sorting and fil...
[ "sql-server", "ms-access", "ssms" ]
5
2
1,258
6
0
2008-09-02T19:17:27.097000
2008-09-06T09:54:23.157000
40,346
40,370
Coding magazines
So, we have coding books, coding RSS feeds, and music to code by. Are there any coding magazines that anyone would recommend?
The venerable Dr. Dobbs Journal is still pretty good. It covers multiple platforms, and mixes some fairly hard-core technical articles with lighter fare (interviews with notables, a "Developer Diaries" column that profiles regular-Joe (and Jane) developers from a range of fields). If you are employed and have authority...
Coding magazines So, we have coding books, coding RSS feeds, and music to code by. Are there any coding magazines that anyone would recommend?
TITLE: Coding magazines QUESTION: So, we have coding books, coding RSS feeds, and music to code by. Are there any coding magazines that anyone would recommend? ANSWER: The venerable Dr. Dobbs Journal is still pretty good. It covers multiple platforms, and mixes some fairly hard-core technical articles with lighter fa...
[ "resources" ]
47
21
29,591
19
0
2008-09-02T19:18:01.277000
2008-09-02T19:30:40.077000