PostId
int64
4
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
1
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-55
461k
OwnerUndeletedAnswerCountAtPostTime
int64
0
21.5k
Title
stringlengths
3
250
BodyMarkdown
stringlengths
5
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
32
30.1k
OpenStatus_id
int64
0
4
56,589
09/11/2008 13:53:31
1,284
08/14/2008 11:34:29
53
15
Can you query different databases on the same server using 1 NHibernate Session?
Does a new SessionFactory and Session object have to be created for each database? I have a data store for my application data, and a seperate data store for my employee security, which is used to validate users. Do I have to create a new SessionFactory ans Session object for calls to the 2 different databases?
asp.net
nhibernate
null
null
null
null
open
Can you query different databases on the same server using 1 NHibernate Session? === Does a new SessionFactory and Session object have to be created for each database? I have a data store for my application data, and a seperate data store for my employee security, which is used to validate users. Do I have to create a new SessionFactory ans Session object for calls to the 2 different databases?
0
56,591
09/11/2008 13:53:57
5,827
09/11/2008 13:30:19
1
0
Double Quotes in Oracle Column Aliases
Ok, this is bit of an obscure question, but hopefully someone can help me out with it. The system I'm working on builds a dynamic SQL string for execution inside a stored procedure, and part of that dynamic SQL defining column aliases, which themselves are actually values retrieved from another table of user generated data. So, for example, the string might look something like; SELECT table1.Col1 AS "This is an alias" FROM table1 This works fine. However, the value that is used for the alias can potentially contain a double quote character, which breaks the outer quotes. I thought that I could maybe escape double quotes inside the alias somehow, but I've had no luck figuring out how to do so. Backslash doesn't work, and using two double quotes in a row results in this error; SQL Error: ORA-03001: unimplemented feature 03001. 00000 - "unimplemented feature" *Cause: This feature is not implemented. Has anyone had any experience with this issue before? Cheers for any insight anyone has. p.s. the quotes are needed around the aliases because they can contain spaces.
oracle
quotes
alias
null
null
null
open
Double Quotes in Oracle Column Aliases === Ok, this is bit of an obscure question, but hopefully someone can help me out with it. The system I'm working on builds a dynamic SQL string for execution inside a stored procedure, and part of that dynamic SQL defining column aliases, which themselves are actually values retrieved from another table of user generated data. So, for example, the string might look something like; SELECT table1.Col1 AS "This is an alias" FROM table1 This works fine. However, the value that is used for the alias can potentially contain a double quote character, which breaks the outer quotes. I thought that I could maybe escape double quotes inside the alias somehow, but I've had no luck figuring out how to do so. Backslash doesn't work, and using two double quotes in a row results in this error; SQL Error: ORA-03001: unimplemented feature 03001. 00000 - "unimplemented feature" *Cause: This feature is not implemented. Has anyone had any experience with this issue before? Cheers for any insight anyone has. p.s. the quotes are needed around the aliases because they can contain spaces.
0
56,611
09/11/2008 13:59:37
1,100
08/12/2008 11:58:29
68
4
How to escape XML content with XSL to safetly output it as JSON?
How to escape XML content (eg. quotes) with XSL to safetly output it as JSON?
xslt
xml
json
escaping
null
null
open
How to escape XML content with XSL to safetly output it as JSON? === How to escape XML content (eg. quotes) with XSL to safetly output it as JSON?
0
56,628
09/11/2008 14:08:11
5,469
09/09/2008 21:03:22
49
10
How do you clear the transaction log in a SQL Server 2005 database?
I'm not a SQL expert, and I'm reminded of the fact every time I need to do something beyond the basics. I have a test database that is not large in size, but the transaction log definitely is. How do I clear out the transaction log?
sql-server
sql
null
null
null
null
open
How do you clear the transaction log in a SQL Server 2005 database? === I'm not a SQL expert, and I'm reminded of the fact every time I need to do something beyond the basics. I have a test database that is not large in size, but the transaction log definitely is. How do I clear out the transaction log?
0
56,630
09/11/2008 14:09:01
4,257
09/02/2008 14:39:35
517
44
How can I get a fixed-position menu like slashdot's comment filtration menu
Slashdot has a little widget that allows you to tweak your comment threshold to filter out down-modded comments. It will be in one place if you scroll to the top of the page, and as you scroll down, at some point, where its original home is about to scroll off the page, it will switch to fixed position, and stay on your screen. (To see an example, click [here][1].) My question is, how can I accomplish the same effect of having a menu be in one place when scrolled up, and switch to fixed position as the user scrolls down? I know this will involve a combination of CSS and javascript. I'm not necessarily looking for a full example of working code, but what steps will my code need to go through? [1]: http://news.slashdot.org/news/08/09/10/2257242.shtml
javascript
css
design
null
null
null
open
How can I get a fixed-position menu like slashdot's comment filtration menu === Slashdot has a little widget that allows you to tweak your comment threshold to filter out down-modded comments. It will be in one place if you scroll to the top of the page, and as you scroll down, at some point, where its original home is about to scroll off the page, it will switch to fixed position, and stay on your screen. (To see an example, click [here][1].) My question is, how can I accomplish the same effect of having a menu be in one place when scrolled up, and switch to fixed position as the user scrolls down? I know this will involve a combination of CSS and javascript. I'm not necessarily looking for a full example of working code, but what steps will my code need to go through? [1]: http://news.slashdot.org/news/08/09/10/2257242.shtml
0
56,638
09/11/2008 14:11:35
3,468
08/28/2008 17:05:59
155
15
how to convert from prtime to .net datetime
I want to convert a number that is in [PRTime][1] format (a 64-bit integer representing the number of microseconds since midnight (00:00:00) 1 January 1970 Coordinated Universal Time (UTC)) to a datetime. note that this is slightly different than the usual "number of millisecconds since 1/1/1970" [1]: http://developer.mozilla.org/en/docs/PRTime
datetime-operation
firefox.
null
null
null
null
open
how to convert from prtime to .net datetime === I want to convert a number that is in [PRTime][1] format (a 64-bit integer representing the number of microseconds since midnight (00:00:00) 1 January 1970 Coordinated Universal Time (UTC)) to a datetime. note that this is slightly different than the usual "number of millisecconds since 1/1/1970" [1]: http://developer.mozilla.org/en/docs/PRTime
0
56,648
09/11/2008 14:16:43
1,175
08/13/2008 10:21:54
1,662
126
What's the Best Way to Shuffle an NSMutableArray?
If you have an NSMutableArray, how do you shuffle the elements randomly? (I have my own answer for this, which is posted below, but I'm new to Cocoa and I'm interested to know if there is a better way.)
objectivec
cocoa
shuffle
null
null
null
open
What's the Best Way to Shuffle an NSMutableArray? === If you have an NSMutableArray, how do you shuffle the elements randomly? (I have my own answer for this, which is posted below, but I'm new to Cocoa and I'm interested to know if there is a better way.)
0
56,654
09/11/2008 14:19:35
2,348
08/21/2008 19:00:04
72
4
How do I access performance counters from C# in Windows XP Embedded?
I have an application running under Windows XP, and I'm accessing the Processor and Memory performance counters. When I try to run the same code and access them on XP Embedded, the counters don't seem to be present. They are present in the image - I can see them all in perfmon. What's the missing piece here?
c#
.net
windows-xp-embedded
null
null
null
open
How do I access performance counters from C# in Windows XP Embedded? === I have an application running under Windows XP, and I'm accessing the Processor and Memory performance counters. When I try to run the same code and access them on XP Embedded, the counters don't seem to be present. They are present in the image - I can see them all in perfmon. What's the missing piece here?
0
56,655
09/11/2008 14:19:49
267
08/04/2008 10:11:06
3,408
171
Arithmetic underflow or overflow exception during debugging
This is the day of weird behavior. We have a Win32 project made with Delphi 2007, which hosts the .NET runtime and calls into .NET to show new forms, as part of a transition period. Recently we've begun experiencing exceptions at seemingly random locations and points of our code: Arithmetic overflow or underflow. The stack trace of one of these looks like this: at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.RunDialog(Form form) at System.Windows.Forms.Form.ShowDialog(IWin32Window owner) at System.Windows.Forms.Form.ShowDialog() at Gatsoft.Gat.UI.Windows.Forms.Remanaging.RemanageForm.DelphiOpenInNewMode(String employeeCode, String departmentCode, DateTime date) in C:\Dev\VS.NET\Gatsoft\Gatsoft.Gat.UI.Windows\Forms\Remanaging\RemanageForm.Delphi.cs:line 67 In the Visual Studio solution, one of the outmost class libraries (ie. pulls in all the references it can), has set a specific debug program, targetted for the Delphi project output. This allows us to debug .NET code from Visual Studio, even though the main bulk of the program is written in Delphi. The problem only occurs when run from the debugger, not if we just run the exe file directly (either through explorer, shortcuts, or even Ctrl+F5 inside Visual Studio). There's apparently no spyware on the machine (as hinted by [this](http://bytes.com/forum/thread106203.html)). Any other things we can check?
exception
random
visual-studio
debugging
null
null
open
Arithmetic underflow or overflow exception during debugging === This is the day of weird behavior. We have a Win32 project made with Delphi 2007, which hosts the .NET runtime and calls into .NET to show new forms, as part of a transition period. Recently we've begun experiencing exceptions at seemingly random locations and points of our code: Arithmetic overflow or underflow. The stack trace of one of these looks like this: at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.RunDialog(Form form) at System.Windows.Forms.Form.ShowDialog(IWin32Window owner) at System.Windows.Forms.Form.ShowDialog() at Gatsoft.Gat.UI.Windows.Forms.Remanaging.RemanageForm.DelphiOpenInNewMode(String employeeCode, String departmentCode, DateTime date) in C:\Dev\VS.NET\Gatsoft\Gatsoft.Gat.UI.Windows\Forms\Remanaging\RemanageForm.Delphi.cs:line 67 In the Visual Studio solution, one of the outmost class libraries (ie. pulls in all the references it can), has set a specific debug program, targetted for the Delphi project output. This allows us to debug .NET code from Visual Studio, even though the main bulk of the program is written in Delphi. The problem only occurs when run from the debugger, not if we just run the exe file directly (either through explorer, shortcuts, or even Ctrl+F5 inside Visual Studio). There's apparently no spyware on the machine (as hinted by [this](http://bytes.com/forum/thread106203.html)). Any other things we can check?
0
56,657
09/11/2008 14:20:26
5,475
09/09/2008 21:50:17
82
8
Copying a directory that is version controlled
I am curious whether it is OK to copy a directory that is under version control and start working on both copies. I know it can be different from one VCS to another, but I intentionally don't specify any VCS since I am curious about different cases. I was talking to a coworker recently about doing it in SVN. I think it should be OK, but I am still not 100% sure, since I don't know what exactly SVN is storing in the working copy. However, if we talk about the DVCS world, things might be even more unclear, since every working copy is a repository by itself. Being faced with doing this in bzr now, I decided to ask the question.
vcs
dvcs
svn
bazaar
null
null
open
Copying a directory that is version controlled === I am curious whether it is OK to copy a directory that is under version control and start working on both copies. I know it can be different from one VCS to another, but I intentionally don't specify any VCS since I am curious about different cases. I was talking to a coworker recently about doing it in SVN. I think it should be OK, but I am still not 100% sure, since I don't know what exactly SVN is storing in the working copy. However, if we talk about the DVCS world, things might be even more unclear, since every working copy is a repository by itself. Being faced with doing this in bzr now, I decided to ask the question.
0
56,658
09/11/2008 14:21:32
5,182
09/08/2008 11:20:40
174
9
How do I specify in HTML or CSS the absolute minimum width of a table cell.
What's the best way to ensure a table cell cannot be less than a certain minimum width. **For example**: I want to ensure that all cells in a table are at least 100px wide regards of the width of the tables container. If there is more available space the table cells should fill that space.
html
html-table
null
null
null
null
open
How do I specify in HTML or CSS the absolute minimum width of a table cell. === What's the best way to ensure a table cell cannot be less than a certain minimum width. **For example**: I want to ensure that all cells in a table are at least 100px wide regards of the width of the tables container. If there is more available space the table cells should fill that space.
0
56,672
09/11/2008 14:25:17
123
08/02/2008 08:01:26
1,585
86
How do you profile your code?
I hope not everyone is using Rational Purify. So what do you do when you want to measure - time taken by a function - peak memory usage - code coverage At the moment, we do manually [using log statements with timestamps and another script to parse the log and output to excel. phew...) What would you recommend? pointing to tools or any techniques would be appreciated!
productivity
code-profiling
c
null
null
null
open
How do you profile your code? === I hope not everyone is using Rational Purify. So what do you do when you want to measure - time taken by a function - peak memory usage - code coverage At the moment, we do manually [using log statements with timestamps and another script to parse the log and output to excel. phew...) What would you recommend? pointing to tools or any techniques would be appreciated!
0
56,677
09/11/2008 14:27:19
5,854
09/11/2008 14:27:19
1
0
Is there a way to parser a SQL query to pull out the column names and table names?
I have 150+ SQL queries in separate text files that I need to analyze (just the actual SQL code, not the data results) in order to identify all column names and table names used. Preferably with the number of times each column and table makes an appearance. Writing a brand new SQL parsing program is trickier than is seems, with nested SELECT statements and the like. There has to be a program, or code out there that does this (or something close to this), but I have found it.
sql
parser
null
null
null
null
open
Is there a way to parser a SQL query to pull out the column names and table names? === I have 150+ SQL queries in separate text files that I need to analyze (just the actual SQL code, not the data results) in order to identify all column names and table names used. Preferably with the number of times each column and table makes an appearance. Writing a brand new SQL parsing program is trickier than is seems, with nested SELECT statements and the like. There has to be a program, or code out there that does this (or something close to this), but I have found it.
0
56,680
09/11/2008 14:29:34
1,638
08/17/2008 17:58:57
552
50
Is a Flex debugger included in the sdk?
I have been writing Flex applications for a few months now and luckily have not needed a full debugger as of yet, so far I have just used a few Alert boxes... Is there an available debugger that is included in the free Flex SDK? I am not using FlexBuilder (I have been using Emacs and compiling with ant). If not, how do you debug Flex applications without FlexBuilder? (note: I have no intentions of using flexbuilder)
flex
null
null
null
null
null
open
Is a Flex debugger included in the sdk? === I have been writing Flex applications for a few months now and luckily have not needed a full debugger as of yet, so far I have just used a few Alert boxes... Is there an available debugger that is included in the free Flex SDK? I am not using FlexBuilder (I have been using Emacs and compiling with ant). If not, how do you debug Flex applications without FlexBuilder? (note: I have no intentions of using flexbuilder)
0
56,682
09/11/2008 14:30:19
3,153
08/27/2008 02:45:05
759
31
How to see if a subfile of a directory has changed
In Windows, is there an easy way to tell if a folder has a subfile that has changed? I verified, and the last modified date on the folder does not get updated when a subfile changes. Is there a registry entry I can set that will modify this behavior? If it matters, I am using an NTFS volume. I would ultimately like to have this ability from a C++ program. **Scanning an entire directory recursively will not work for me because the folder is much too large.**
ntfs
filesystems
windows
c++
null
null
open
How to see if a subfile of a directory has changed === In Windows, is there an easy way to tell if a folder has a subfile that has changed? I verified, and the last modified date on the folder does not get updated when a subfile changes. Is there a registry entry I can set that will modify this behavior? If it matters, I am using an NTFS volume. I would ultimately like to have this ability from a C++ program. **Scanning an entire directory recursively will not work for me because the folder is much too large.**
0
56,684
09/11/2008 14:30:41
3,012
08/26/2008 11:55:24
206
9
How can I get rid of Windows Update reboot prompt?
I want Windows Update to automatically download and install updates on my Vista machine, however I don't want to be bothered by the system tray reboot prompts (which can, at best, only be postponed by 4 hours). I have performed the registry hack described [here][1] to prevent Windows forcibly rebooting my machine, which is a good start. However, is there any way to get rid of the reboot prompts altogether, or decrease their frequency? [1]: http://www.howtogeek.com/howto/windows-vista/prevent-windows-update-from-forcibly-rebooting-your-computer/
windows
windows-vista
windows-update
null
null
null
open
How can I get rid of Windows Update reboot prompt? === I want Windows Update to automatically download and install updates on my Vista machine, however I don't want to be bothered by the system tray reboot prompts (which can, at best, only be postponed by 4 hours). I have performed the registry hack described [here][1] to prevent Windows forcibly rebooting my machine, which is a good start. However, is there any way to get rid of the reboot prompts altogether, or decrease their frequency? [1]: http://www.howtogeek.com/howto/windows-vista/prevent-windows-update-from-forcibly-rebooting-your-computer/
0
56,687
09/11/2008 14:31:47
5,812
09/11/2008 13:00:29
1
0
How do I ensure that RMI uses only a specific set of ports?
In our application, we are using RMI for client-server communication in two very different ways: 1. Pushing data from the server to the client to be displayed. 2. Sending control information from the client to the server. 3. Callbacks from those control messages code paths that reach back from the server to the client (sidebar note - this is a side-effect of some legacy code and is not our long-term intent). What we would like to do is ensure that all of our RMI-related code will use only a known specified inventory of ports. This includes the registry port (commonly expected to be 1099), the server port and any ports resulting from the callbacks. Here is what we already know: 1. LocateRegistry.getRegistry(1099) or Locate.createRegistry(1099) will ensure that the registry is listening in on 1099. 2. Using the UnicastRemoteObject constructor / exportObject static method with a port argument will specify the server port. These points are also covered in this <a href="http://forums.sun.com/thread.jspa?threadID=370039&messageID=1566073">Sun forum post</a>. What we don't know is: how do we ensure that the client connections back to the server resulting from the callbacks will only connect on a specified port rather than defaulting to an anonymous port?
java
java.rmi
null
null
null
null
open
How do I ensure that RMI uses only a specific set of ports? === In our application, we are using RMI for client-server communication in two very different ways: 1. Pushing data from the server to the client to be displayed. 2. Sending control information from the client to the server. 3. Callbacks from those control messages code paths that reach back from the server to the client (sidebar note - this is a side-effect of some legacy code and is not our long-term intent). What we would like to do is ensure that all of our RMI-related code will use only a known specified inventory of ports. This includes the registry port (commonly expected to be 1099), the server port and any ports resulting from the callbacks. Here is what we already know: 1. LocateRegistry.getRegistry(1099) or Locate.createRegistry(1099) will ensure that the registry is listening in on 1099. 2. Using the UnicastRemoteObject constructor / exportObject static method with a port argument will specify the server port. These points are also covered in this <a href="http://forums.sun.com/thread.jspa?threadID=370039&messageID=1566073">Sun forum post</a>. What we don't know is: how do we ensure that the client connections back to the server resulting from the callbacks will only connect on a specified port rather than defaulting to an anonymous port?
0
56,692
09/11/2008 14:34:11
2,868
08/25/2008 16:43:06
52
3
Random weighted choice
Consider the class below that represents a Broker: public class Broker { public string Name = string.Empty; public int Weight = 0; public Broker(string n, int w) { this.Name = n; this.Weight = w; } } I'd like to randomly select a Broker from an array, taking into account their weights. What do you think of the code below? class Program { private static Random _rnd = new Random(); public static Broker GetBroker(List<Broker> brokers, int totalWeight) { // totalWeight is the sum of all brokers' weight int randomNumber = _rnd.Next(0, totalWeight); Broker selectedBroker = null; foreach (Broker broker in brokers) { if (randomNumber <= broker.Weight) { selectedBroker = broker; break; } randomNumber = randomNumber - broker.Weight; } return selectedBroker; } static void Main(string[] args) { List<Broker> brokers = new List<Broker>(); brokers.Add(new Broker("A", 10)); brokers.Add(new Broker("B", 20)); brokers.Add(new Broker("C", 20)); brokers.Add(new Broker("D", 10)); // total the weigth int totalWeight = 0; foreach (Broker broker in brokers) { totalWeight += broker.Weight; } while (true) { Dictionary<string, int> result = new Dictionary<string, int>(); Broker selectedBroker = null; for (int i = 0; i < 1000; i++) { selectedBroker = GetBroker(brokers, totalWeight); if (selectedBroker != null) { if (result.ContainsKey(selectedBroker.Name)) { result[selectedBroker.Name] = result[selectedBroker.Name] + 1; } else { result.Add(selectedBroker.Name, 1); } } } Console.WriteLine("A\t\t" + result["A"]); Console.WriteLine("B\t\t" + result["B"]); Console.WriteLine("C\t\t" + result["C"]); Console.WriteLine("D\t\t" + result["D"]); result.Clear(); Console.WriteLine(); Console.ReadLine(); } } } I'm not so confident. When I run this, Broker A always gets more hits than Broker D, and they have the same weight. Is there a more accurate algorithm? Thanks!
c#
algorithm
random
null
null
null
open
Random weighted choice === Consider the class below that represents a Broker: public class Broker { public string Name = string.Empty; public int Weight = 0; public Broker(string n, int w) { this.Name = n; this.Weight = w; } } I'd like to randomly select a Broker from an array, taking into account their weights. What do you think of the code below? class Program { private static Random _rnd = new Random(); public static Broker GetBroker(List<Broker> brokers, int totalWeight) { // totalWeight is the sum of all brokers' weight int randomNumber = _rnd.Next(0, totalWeight); Broker selectedBroker = null; foreach (Broker broker in brokers) { if (randomNumber <= broker.Weight) { selectedBroker = broker; break; } randomNumber = randomNumber - broker.Weight; } return selectedBroker; } static void Main(string[] args) { List<Broker> brokers = new List<Broker>(); brokers.Add(new Broker("A", 10)); brokers.Add(new Broker("B", 20)); brokers.Add(new Broker("C", 20)); brokers.Add(new Broker("D", 10)); // total the weigth int totalWeight = 0; foreach (Broker broker in brokers) { totalWeight += broker.Weight; } while (true) { Dictionary<string, int> result = new Dictionary<string, int>(); Broker selectedBroker = null; for (int i = 0; i < 1000; i++) { selectedBroker = GetBroker(brokers, totalWeight); if (selectedBroker != null) { if (result.ContainsKey(selectedBroker.Name)) { result[selectedBroker.Name] = result[selectedBroker.Name] + 1; } else { result.Add(selectedBroker.Name, 1); } } } Console.WriteLine("A\t\t" + result["A"]); Console.WriteLine("B\t\t" + result["B"]); Console.WriteLine("C\t\t" + result["C"]); Console.WriteLine("D\t\t" + result["D"]); result.Clear(); Console.WriteLine(); Console.ReadLine(); } } } I'm not so confident. When I run this, Broker A always gets more hits than Broker D, and they have the same weight. Is there a more accurate algorithm? Thanks!
0
56,704
09/11/2008 14:37:28
1,223
08/13/2008 13:53:10
306
34
What jobs to give to an intern?
Interns typically get given the mundane jobs - bit of filing, some simple bugfixes, a 'no use' project or CD\DVD duplication for example. If you were (or are) an Intern, what would you want from your internship? If you're responsible for an Intern, what measures have you taken to make the internship a really valuable one - both for the company and the Intern?
management
null
null
null
null
10/25/2011 16:08:35
not constructive
What jobs to give to an intern? === Interns typically get given the mundane jobs - bit of filing, some simple bugfixes, a 'no use' project or CD\DVD duplication for example. If you were (or are) an Intern, what would you want from your internship? If you're responsible for an Intern, what measures have you taken to make the internship a really valuable one - both for the company and the Intern?
4
56,707
09/11/2008 14:38:25
5,054
09/07/2008 15:33:08
8
2
Java Right Click does not make a selection. What is the easiest way to solve this globally?
Is there a way to globally make right click also select the element that you right click on? From what I understand this has been a bug in Swing for a long time likely to never be fixed because at this point applications depend on it. Any advice on doing this on a global scale? Perhaps on the L&F?
java
swing
null
null
null
null
open
Java Right Click does not make a selection. What is the easiest way to solve this globally? === Is there a way to globally make right click also select the element that you right click on? From what I understand this has been a bug in Swing for a long time likely to never be fixed because at this point applications depend on it. Any advice on doing this on a global scale? Perhaps on the L&F?
0
56,708
09/11/2008 14:38:42
4,910
09/06/2008 14:49:31
60
6
Objective C for Windows
What would be the best way to write Objective-C on the Windows platform? Cygwin and gcc? Is there a way I can somehow integrate this into Visual Studio? Along those lines - are there any suggestions as to how to link in and use the Windows SDK for something like this. Its a different beast but I know I can write assembly and link in the Windows DLLs giving me accessibility to those calls but I don't know how to do this without googling and getting piecemeal directions. Is anyone aware of a good online or book resource to do or explain these kinds of things?
windows
winapi
gcc
cygwin
objective-c
null
open
Objective C for Windows === What would be the best way to write Objective-C on the Windows platform? Cygwin and gcc? Is there a way I can somehow integrate this into Visual Studio? Along those lines - are there any suggestions as to how to link in and use the Windows SDK for something like this. Its a different beast but I know I can write assembly and link in the Windows DLLs giving me accessibility to those calls but I don't know how to do this without googling and getting piecemeal directions. Is anyone aware of a good online or book resource to do or explain these kinds of things?
0
56,709
09/11/2008 14:39:32
383
08/05/2008 10:46:37
2,859
257
User does not have permission to run DBCC DBREINDEX
I get the following error message in SQL Server 2005: User '<username>' does not have permission to run DBCC DBREINDEX for object '<table>'. Which minimum role do I have to give to user in order to run the command?
security
sql-server-2005
null
null
null
null
open
User does not have permission to run DBCC DBREINDEX === I get the following error message in SQL Server 2005: User '<username>' does not have permission to run DBCC DBREINDEX for object '<table>'. Which minimum role do I have to give to user in order to run the command?
0
56,715
09/11/2008 14:40:12
5,247
09/08/2008 17:30:43
1
5
Best way to query disk space on remote server
I am trying to nail down free space on a remote server by querying all the drives and then looping until I find the drive I am seeking. Is there a better way to do this? Dim oConn As New ConnectionOptions Dim sNameSpace As String = "\\mnb-content2\root\cimv2" Dim oMS As New ManagementScope(sNameSpace, oConn) Dim oQuery As System.Management.ObjectQuery = New System.Management.ObjectQuery("select FreeSpace,Size,Name from Win32_LogicalDisk where DriveType=3") Dim oSearcher As ManagementObjectSearcher = New ManagementObjectSearcher(oMS, oQuery) Dim oReturnCollection As ManagementObjectCollection = oSearcher.Get() Dim oReturn As ManagementObject For Each oReturn In oReturnCollection 'Disk name Console.WriteLine("Name : " + oReturn("Name").ToString()) 'Free Space in bytes Dim sFreespace As String = oReturn("FreeSpace").ToString() If Left(oReturn("Name").ToString(), 1) = "Y" Then Console.WriteLine(sFreespace) End If Next
.net
null
null
null
null
null
open
Best way to query disk space on remote server === I am trying to nail down free space on a remote server by querying all the drives and then looping until I find the drive I am seeking. Is there a better way to do this? Dim oConn As New ConnectionOptions Dim sNameSpace As String = "\\mnb-content2\root\cimv2" Dim oMS As New ManagementScope(sNameSpace, oConn) Dim oQuery As System.Management.ObjectQuery = New System.Management.ObjectQuery("select FreeSpace,Size,Name from Win32_LogicalDisk where DriveType=3") Dim oSearcher As ManagementObjectSearcher = New ManagementObjectSearcher(oMS, oQuery) Dim oReturnCollection As ManagementObjectCollection = oSearcher.Get() Dim oReturn As ManagementObject For Each oReturn In oReturnCollection 'Disk name Console.WriteLine("Name : " + oReturn("Name").ToString()) 'Free Space in bytes Dim sFreespace As String = oReturn("FreeSpace").ToString() If Left(oReturn("Name").ToString(), 1) = "Y" Then Console.WriteLine(sFreespace) End If Next
0
56,716
09/11/2008 14:40:17
5,733
09/11/2008 06:29:13
31
4
Architecture for modeling
A common solution to building a model of a system which consists of many items of different types is to create a modular system, where each module is responsible for particular type. For example, there will be module for wombats WombatModule:IModule, where IModule interface has methods like GetCount() (to find number of wombats) and Update() (to update all wombats' state). More object-oriented approach would be to have class for every item type and create an instance for every item. That will make class Wombat:IItem with methods like Update() (to update this one wombat). From code perspective difference is negligible, but run-time is significantly different. Module-oriented solution is certainly faster: less object creation, easier to optimize operations common for all wombats. Problems come when number of types and modules grow. Either you lose most of performance advantage because each module only supports several items, or modules' complexity grows to accomodate for slightly different items of one general type - say, fat and slim wombats. Or both. At least once I've seen it degrade into poor state when all WombatModule does is keep a collection of hidden Wombat objects and run their methods in loop. When performance is less of a problem than long-term development, can you identify any architectural reasons to use modules instead of per-item objects? May be there's another possibility I'm missing?
architecture
modeling
modularity
null
null
null
open
Architecture for modeling === A common solution to building a model of a system which consists of many items of different types is to create a modular system, where each module is responsible for particular type. For example, there will be module for wombats WombatModule:IModule, where IModule interface has methods like GetCount() (to find number of wombats) and Update() (to update all wombats' state). More object-oriented approach would be to have class for every item type and create an instance for every item. That will make class Wombat:IItem with methods like Update() (to update this one wombat). From code perspective difference is negligible, but run-time is significantly different. Module-oriented solution is certainly faster: less object creation, easier to optimize operations common for all wombats. Problems come when number of types and modules grow. Either you lose most of performance advantage because each module only supports several items, or modules' complexity grows to accomodate for slightly different items of one general type - say, fat and slim wombats. Or both. At least once I've seen it degrade into poor state when all WombatModule does is keep a collection of hidden Wombat objects and run their methods in loop. When performance is less of a problem than long-term development, can you identify any architectural reasons to use modules instead of per-item objects? May be there's another possibility I'm missing?
0
56,722
09/11/2008 14:41:45
1,419
08/15/2008 15:14:42
71
10
Automated processing of an Email in Java
Just got a request from my boss for an application I'm working on. Basically we're getting an email address setup for an external client to submit excel files to. What I need is a way to automatically pick up any email sent to this address, so I can take the attachment, process it and save it to a folder. Any information of even where to start would be helpful.\ Note: We're using a lotus notes server to do this, but a generic way would be more helpful (If possible).
java
email
lotus-notes
null
null
null
open
Automated processing of an Email in Java === Just got a request from my boss for an application I'm working on. Basically we're getting an email address setup for an external client to submit excel files to. What I need is a way to automatically pick up any email sent to this address, so I can take the attachment, process it and save it to a folder. Any information of even where to start would be helpful.\ Note: We're using a lotus notes server to do this, but a generic way would be more helpful (If possible).
0
56,723
09/11/2008 14:41:46
5,412
09/09/2008 13:33:06
1
1
Display blanks instead of 0 or 0.0 in a BIRT report
When using an aggregate control in some reports you would prefer to see a blank field instead of 0. There does not appear to be a way to do this automatically. Does anyone have a way that this can be done. Note, you want to maintain the '0' value for the field in cases when you export, but you want to show a blank when rendering to PDF or HTML.
eclipse
reporting
birt
null
null
null
open
Display blanks instead of 0 or 0.0 in a BIRT report === When using an aggregate control in some reports you would prefer to see a blank field instead of 0. There does not appear to be a way to do this automatically. Does anyone have a way that this can be done. Note, you want to maintain the '0' value for the field in cases when you export, but you want to show a blank when rendering to PDF or HTML.
0
56,729
09/11/2008 14:43:18
95
08/01/2008 18:28:24
412
31
How to call the AllocateAndInitializeSid function from C#?
Can somebody give me a complete and working example of calling the AllocateAndInitializeSid function from C# code? I found [this][1]: BOOL WINAPI AllocateAndInitializeSid( __in PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, __in BYTE nSubAuthorityCount, __in DWORD dwSubAuthority0, __in DWORD dwSubAuthority1, __in DWORD dwSubAuthority2, __in DWORD dwSubAuthority3, __in DWORD dwSubAuthority4, __in DWORD dwSubAuthority5, __in DWORD dwSubAuthority6, __in DWORD dwSubAuthority7, __out PSID *pSid ); and I don't know how to construct the signature of this method - what should I do with *PSID_IDENTIFIER_AUTHORITY* and *PSID* types? How should I pass them (using *ref*? using *out*?)? [1]: http://msdn.microsoft.com/en-us/library/aa375213(VS.85).aspx
c#
.net
null
null
null
null
open
How to call the AllocateAndInitializeSid function from C#? === Can somebody give me a complete and working example of calling the AllocateAndInitializeSid function from C# code? I found [this][1]: BOOL WINAPI AllocateAndInitializeSid( __in PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, __in BYTE nSubAuthorityCount, __in DWORD dwSubAuthority0, __in DWORD dwSubAuthority1, __in DWORD dwSubAuthority2, __in DWORD dwSubAuthority3, __in DWORD dwSubAuthority4, __in DWORD dwSubAuthority5, __in DWORD dwSubAuthority6, __in DWORD dwSubAuthority7, __out PSID *pSid ); and I don't know how to construct the signature of this method - what should I do with *PSID_IDENTIFIER_AUTHORITY* and *PSID* types? How should I pass them (using *ref*? using *out*?)? [1]: http://msdn.microsoft.com/en-us/library/aa375213(VS.85).aspx
0
56,737
09/11/2008 14:45:40
1,605
08/17/2008 13:59:17
1
0
Is DocumentBuilder.parse() thread safe?
Is the standard Java 1.6 [javax.xml.parsers.DocumentBuilder][1] class thread safe? Is it safe to call the parse() method from several threads in parallel? The JavaDoc doesn't mention the issue, but the [JavaDoc for the same class][2] in Java 1.4 specifically says that it *isn't* meant to be concurrent; so can I assume that in 1.6 it is? [1]: http://java.sun.com/javase/6/docs/api/javax/xml/parsers/DocumentBuilder.html [2]: http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/parsers/DocumentBuilder.html
java
null
null
null
null
null
open
Is DocumentBuilder.parse() thread safe? === Is the standard Java 1.6 [javax.xml.parsers.DocumentBuilder][1] class thread safe? Is it safe to call the parse() method from several threads in parallel? The JavaDoc doesn't mention the issue, but the [JavaDoc for the same class][2] in Java 1.4 specifically says that it *isn't* meant to be concurrent; so can I assume that in 1.6 it is? [1]: http://java.sun.com/javase/6/docs/api/javax/xml/parsers/DocumentBuilder.html [2]: http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/parsers/DocumentBuilder.html
0
56,741
09/11/2008 14:46:04
3,153
08/27/2008 02:45:05
769
31
File system journaling - how to query it?
Is there a way to access file system journaling info via some type of Windows API? If not what other methods are available to a user mode developer?
c++
windows
winapi
filesystems
null
null
open
File system journaling - how to query it? === Is there a way to access file system journaling info via some type of Windows API? If not what other methods are available to a user mode developer?
0
56,761
09/11/2008 14:51:43
2,106
08/20/2008 11:56:49
26
2
Keyboard Shortcut in Access 2003
Is there a keyboard shortcut in Access 2003 that will run a query while in design or sql mode?
ms-access
null
null
null
null
null
open
Keyboard Shortcut in Access 2003 === Is there a keyboard shortcut in Access 2003 that will run a query while in design or sql mode?
0
56,764
09/11/2008 14:52:15
303
08/04/2008 13:48:50
912
14
Starting a new job focused on brownfield application refactoring & Agile
I am starting a new job on Monday. The company has a home grown enterprise case management application written in ASP.NET/VB.NET. They are attempting to implement an Agile development process. They have gone so far as to get two people Scrum Master certified and hire an Agile coach. They are currently focused on 6-9 months of refactoring. My question is what are some good approaches/tooling given this environment for becoming familiar with the code base and being productive as soon as I hit the ground?
.net
vb.net
refactoring
brownfield
null
null
open
Starting a new job focused on brownfield application refactoring & Agile === I am starting a new job on Monday. The company has a home grown enterprise case management application written in ASP.NET/VB.NET. They are attempting to implement an Agile development process. They have gone so far as to get two people Scrum Master certified and hire an Agile coach. They are currently focused on 6-9 months of refactoring. My question is what are some good approaches/tooling given this environment for becoming familiar with the code base and being productive as soon as I hit the ground?
0
56,767
09/11/2008 14:54:07
1,360
08/14/2008 18:11:31
70
15
Object initialization in C# (.Net)
Is there a difference (performance, overhead) between these two ways of initializing an object: MyTypedDataSet aDataSet = new MyTypedDataSet(); ds.Merge(anotherDataSet); and MyTypedDataSet ds = anotherDataSet; Which do you recommend?
c#
object
initialization
dataset
null
null
open
Object initialization in C# (.Net) === Is there a difference (performance, overhead) between these two ways of initializing an object: MyTypedDataSet aDataSet = new MyTypedDataSet(); ds.Merge(anotherDataSet); and MyTypedDataSet ds = anotherDataSet; Which do you recommend?
0
56,769
09/11/2008 14:54:59
2,077
08/20/2008 07:26:21
330
8
How do I tell a multi-core / multi-CPU machine to process function calls in a loop in parallel?
I am currently designing an application that has one module which will load large amounts of data from a database and reduce it to a much smaller set by various calculations depending on the circumstances. Many of the more intensive operations behave deterministically and would lend themselves to parallel processing. Provided I have a loop that iterates over a large number of data chunks arriving from the db and for each one call a deterministic function without side effects, how would I make it so that the program does not wait for the function to return but rather sets the next calls going, so they could be processed in parallel? A naive approach to demonstrate the principle would do me for now. I have read Google's MapReduce paper and while I could use the overall principle in a number of places, I won't, for now, target large clusters, rather it's going to be a single multi-core or multi-CPU machine for version 1.0. So currently, I'm not sure if I can actually use the library or would have to roll a dumbed-down basic version myself. I am at an early stage of the design process and so far I am targeting C-something (for the speed critical bits) and Python (for the productivity critical bits) as my languages. If there are compelling reasons, I might switch, but so far I am contented with my choice. Please note that I'm aware of the fact that it might take longer to retrieve the next chunk from the database than to process the current one and the whole process would then be I/O-bound. I would, however, assume for now that it isn't and in practice use a db cluster or memory caching or something else to be not I/O-bound at this point.
concurrency
mapreduce
parallel-computing
null
null
null
open
How do I tell a multi-core / multi-CPU machine to process function calls in a loop in parallel? === I am currently designing an application that has one module which will load large amounts of data from a database and reduce it to a much smaller set by various calculations depending on the circumstances. Many of the more intensive operations behave deterministically and would lend themselves to parallel processing. Provided I have a loop that iterates over a large number of data chunks arriving from the db and for each one call a deterministic function without side effects, how would I make it so that the program does not wait for the function to return but rather sets the next calls going, so they could be processed in parallel? A naive approach to demonstrate the principle would do me for now. I have read Google's MapReduce paper and while I could use the overall principle in a number of places, I won't, for now, target large clusters, rather it's going to be a single multi-core or multi-CPU machine for version 1.0. So currently, I'm not sure if I can actually use the library or would have to roll a dumbed-down basic version myself. I am at an early stage of the design process and so far I am targeting C-something (for the speed critical bits) and Python (for the productivity critical bits) as my languages. If there are compelling reasons, I might switch, but so far I am contented with my choice. Please note that I'm aware of the fact that it might take longer to retrieve the next chunk from the database than to process the current one and the whole process would then be I/O-bound. I would, however, assume for now that it isn't and in practice use a db cluster or memory caching or something else to be not I/O-bound at this point.
0
56,770
09/11/2008 14:55:02
83
08/01/2008 16:31:56
1,206
81
Dynamic navigation and web applications
I'm creating an ASP.NET web site where all pages hang off a database-driven tree-hierarchy. Pages typically present HTML content. But, some will execute programming. Examples: (1) a "contact us" form or (2) a report generator How should I represent/reference the programming within the database? Should I have a varchar value of a Web User Control (.ascx) name? Or a Web Form (.aspx) name? Something else? Or should it just be an integer or other such ID in a dictionary within my application? Can I make an ASP.NET Site Map Provider with this structure?
asp.net
database
web-applications
database-design
null
null
open
Dynamic navigation and web applications === I'm creating an ASP.NET web site where all pages hang off a database-driven tree-hierarchy. Pages typically present HTML content. But, some will execute programming. Examples: (1) a "contact us" form or (2) a report generator How should I represent/reference the programming within the database? Should I have a varchar value of a Web User Control (.ascx) name? Or a Web Form (.aspx) name? Something else? Or should it just be an integer or other such ID in a dictionary within my application? Can I make an ASP.NET Site Map Provider with this structure?
0
56,771
09/11/2008 14:55:02
5,878
09/11/2008 14:55:02
1
0
How do you set focus to the HTML5 canvas element?
I'm using the HTML5 `<canvas>` element in Firefox 2.0.0.16 and in Safari 3.1.2, both on my iMac. (I've tried this in Firefox 3.0 on Windows as well, also to no avail.) The tag looks like this: <td> <canvas id="display" width="500px" height="500px"> </canvas> </td> I have a button to "activate" some functionality that interacts with the canvas. That button's onclick() event calls a function. In that function I have the following line: document.getElementById("display").focus(); This does not work. Firebug reports no error. But the focus still remains where it was. I can click on the canvas or tab towards the canvas and focus will be lost from the other elements, but apparently never be gained on by the canvas. (The canvas's onfocus() event never fires.) I find this odd. Is it that the canvas simply cannot get focus, or am I missing something here? Any insight would be appreciated. Thank you.
javascript
focus
canvas
null
null
null
open
How do you set focus to the HTML5 canvas element? === I'm using the HTML5 `<canvas>` element in Firefox 2.0.0.16 and in Safari 3.1.2, both on my iMac. (I've tried this in Firefox 3.0 on Windows as well, also to no avail.) The tag looks like this: <td> <canvas id="display" width="500px" height="500px"> </canvas> </td> I have a button to "activate" some functionality that interacts with the canvas. That button's onclick() event calls a function. In that function I have the following line: document.getElementById("display").focus(); This does not work. Firebug reports no error. But the focus still remains where it was. I can click on the canvas or tab towards the canvas and focus will be lost from the other elements, but apparently never be gained on by the canvas. (The canvas's onfocus() event never fires.) I find this odd. Is it that the canvas simply cannot get focus, or am I missing something here? Any insight would be appreciated. Thank you.
0
56,786
09/11/2008 14:59:29
4,787
09/05/2008 15:36:12
1
1
Do I need to leave gaps in a standard server rack?
We have a 42U rack which is getting a load of new 1U and 2U servers real soon. One of the guys here reckons that you need to leave a gap between the servers (of 1U) to aid cooling. Question is, do you? When looking around the datacenter, no-one else seems to be, and it also diminishes how much we can fit in. We're using Dell 1850 and 2950 hardware.
hosting
rack
null
null
null
null
open
Do I need to leave gaps in a standard server rack? === We have a 42U rack which is getting a load of new 1U and 2U servers real soon. One of the guys here reckons that you need to leave a gap between the servers (of 1U) to aid cooling. Question is, do you? When looking around the datacenter, no-one else seems to be, and it also diminishes how much we can fit in. We're using Dell 1850 and 2950 hardware.
0
56,798
09/11/2008 15:01:58
2,599
08/23/2008 13:39:26
106
3
Converting scripts from ksh to bash.
I have some ksh scripts which I'd like to convert to run with bash instead. Are there any useful on-line resources for this? I'm really looking for a list of differences between the two shells and any gotchas I might encounter, although all information is welcome :-)
unix
bash
ksh
null
null
null
open
Converting scripts from ksh to bash. === I have some ksh scripts which I'd like to convert to run with bash instead. Are there any useful on-line resources for this? I'm really looking for a list of differences between the two shells and any gotchas I might encounter, although all information is welcome :-)
0
56,801
09/11/2008 15:02:20
2,357
08/21/2008 20:18:05
28
10
The difference between the connections strings in SQLCLR
I was reviewing some code that a consultant checked in and notice they were using SQLCLR. I don't have any experience with it so thought I would research what it was about. I noticed that they used Dim cn As New SqlConnection("server=LOCALHOST;integrated security=yes;database=" & sDb) instead of DIM conn As New SqlConnection("context connection=true") I'm wondering what the difference since it's localhost on the first?
sqlclr
null
null
null
null
null
open
The difference between the connections strings in SQLCLR === I was reviewing some code that a consultant checked in and notice they were using SQLCLR. I don't have any experience with it so thought I would research what it was about. I noticed that they used Dim cn As New SqlConnection("server=LOCALHOST;integrated security=yes;database=" & sDb) instead of DIM conn As New SqlConnection("context connection=true") I'm wondering what the difference since it's localhost on the first?
0
56,810
09/11/2008 15:04:25
2,077
08/20/2008 07:26:21
335
8
How do I start threads in plain C?
I have used fork() in C to start another process. How do I start a new thread?
c
multithreading
null
null
null
null
open
How do I start threads in plain C? === I have used fork() in C to start another process. How do I start a new thread?
0
56,812
09/11/2008 15:05:57
5,849
09/11/2008 14:22:20
1
1
BOM not expected in CF but sent by IIS/SP
I'm trying to consume a SharePoint webservice from Coldfusion via cfinvoke('cause I don't want to deal with(read parse) the SOAP response itself). The soap response includes a byte-order-mark character(BOM), which produces the following exception in CF:<br /> "Cannot perform web service invocation GetList.<br/> The fault returned when invoking the web service operation is:<br/> 'AxisFault<br /> faultCode: {http://www.w3.org/2003/05/soap-envelope}Server.userException<br /> faultSubcode:<br /> faultString: org.xml.sax.SAXParseException: Content is not allowed in prolog." Is it possible to get CF to handle that character? Is it possible to get IIS/SP to not send that character?
web-services
sharepoint
iis
coldfusion
bom
null
open
BOM not expected in CF but sent by IIS/SP === I'm trying to consume a SharePoint webservice from Coldfusion via cfinvoke('cause I don't want to deal with(read parse) the SOAP response itself). The soap response includes a byte-order-mark character(BOM), which produces the following exception in CF:<br /> "Cannot perform web service invocation GetList.<br/> The fault returned when invoking the web service operation is:<br/> 'AxisFault<br /> faultCode: {http://www.w3.org/2003/05/soap-envelope}Server.userException<br /> faultSubcode:<br /> faultString: org.xml.sax.SAXParseException: Content is not allowed in prolog." Is it possible to get CF to handle that character? Is it possible to get IIS/SP to not send that character?
0
56,837
09/11/2008 15:12:03
2,443
08/22/2008 10:53:30
689
38
How can I make an exact copy of a xml node's children with XSLT?
My problem is that my XML document contains snippets of XHTML within it and while passing it through an XSLT I would like it to render those snippets without mangling them. I've tried wrapping the snippet in a CDATA but it doesn't work since less than and greater than are translated to &lt; and &gt; as opposed to being echoed directly. What's the XSL required for doing this?
xml
xslt
xhtml
null
null
null
open
How can I make an exact copy of a xml node's children with XSLT? === My problem is that my XML document contains snippets of XHTML within it and while passing it through an XSLT I would like it to render those snippets without mangling them. I've tried wrapping the snippet in a CDATA but it doesn't work since less than and greater than are translated to &lt; and &gt; as opposed to being echoed directly. What's the XSL required for doing this?
0
56,843
09/11/2008 15:12:52
2,797
08/25/2008 07:48:49
238
21
Looking for an HQL builder (Hibernate Query Language)
I'm looking for a builder for [HQL][1] in Java. I want to get rid of things like: StringBuilder builder = new StringBuilder() .append("select stock from ") .append( Stock.class.getName() ) .append( " as stock where stock.id = ") .append( id ); I'd rather have something like: HqlBuilder builder = new HqlBuilder() .select( "stock" ) .from( Stock.class.getName() ).as( "stock" ) .where( "stock.id" ).equals( id ); I googled a bit, and I couldn't find one. I wrote a quick & dumb `HqlBuilder` that suits my needs for now, but I'd love to find one that has more users and tests than me alone. Thanks! [1]: http://www.hibernate.org/hib_docs/reference/en/html/queryhql.html
java
hql
null
null
null
null
open
Looking for an HQL builder (Hibernate Query Language) === I'm looking for a builder for [HQL][1] in Java. I want to get rid of things like: StringBuilder builder = new StringBuilder() .append("select stock from ") .append( Stock.class.getName() ) .append( " as stock where stock.id = ") .append( id ); I'd rather have something like: HqlBuilder builder = new HqlBuilder() .select( "stock" ) .from( Stock.class.getName() ).as( "stock" ) .where( "stock.id" ).equals( id ); I googled a bit, and I couldn't find one. I wrote a quick & dumb `HqlBuilder` that suits my needs for now, but I'd love to find one that has more users and tests than me alone. Thanks! [1]: http://www.hibernate.org/hib_docs/reference/en/html/queryhql.html
0
56,856
09/11/2008 15:15:52
1,967
08/19/2008 15:58:15
23
2
How do I make a UIDatePicker display specific dates?
My application has a need to let the user choose a date from a list of dates conforming to a certain pattern. For instance, they may need to choose a monday from a list Monday's for a month. Is there a way to get a UIDatePicker to limit date choices to a certain subset or should I just use a UIPickerView?
iphone
cocoa
cocoa-touch
null
null
null
open
How do I make a UIDatePicker display specific dates? === My application has a need to let the user choose a date from a list of dates conforming to a certain pattern. For instance, they may need to choose a monday from a list Monday's for a month. Is there a way to get a UIDatePicker to limit date choices to a certain subset or should I just use a UIPickerView?
0
56,859
09/11/2008 15:17:02
5,362
09/09/2008 10:53:45
11
1
Is it possible to display a modal window in SCSF at the center of the screen
In SCSF application I would like to display a view as a modal window at the center of the screen. Is it possible to do that? WindowSmartPartInfo doesn't have any option for setting screen postion. Thanks.
scsf
cab
null
null
null
null
open
Is it possible to display a modal window in SCSF at the center of the screen === In SCSF application I would like to display a view as a modal window at the center of the screen. Is it possible to do that? WindowSmartPartInfo doesn't have any option for setting screen postion. Thanks.
0
56,860
09/11/2008 15:17:38
303
08/04/2008 13:48:50
951
15
What is the Liskov Substitution Principal?
The Liskov Substitution Principal (LSP) is a concept in Object Oriented Programming that states: > Functions that use pointers or > references to base classes must be > able to use objects of derived classes > with out knowing it. At it's heart LSP is about interfaces and contracts as well as how to decided when to extend a class vs. use another strategy such as composition to achieve your goal. The most effective way I have seen to illustrate this point was in <a href="http://oreilly.com/catalog/9780596008673/index.html">Head First OOA&D</a>. They present a scenario where you are a developer on a project to build a framework for strategy games. They present a class that represents a board that looks like this: ![Class Diagram][1] All of the methods take X and Y coordinates as parameters to locate the tile position in the two dimensional array of Tiles. This will allow a game developer to manage units in the board during the course of the game. The book goes on to change the requirements to say that the game frame work must also support 3d game boards to accommodate games that have flight. So a ThreeDBoard class is introduced that extends Board. At first glace this seems like a good decision. Board provides both the Height and Width properties and ThreeDBoard provides the Z axis. Where it breaks down is when you look at all the other members inherited from Board. The methods for AddUnit, GetTile, GetUnits and so on, all take both X and Y parameters in the Board class but the ThreeDBoard needs a Z parameter as well. So you must implement those methods again with a Z parameter. The Z parameter has no context to the Board class and the inherited methods from the Board class lose their meaning. A unit of code attempting to use the ThreeDBoard class as it's base class Board would be very out of luck. Maybe we should find another approach. Instead of extending Board, ThreeDBoard should be composed of Board objects. One Board object per unit of the Z axis. This allows us to use good object oriented principals like encapsulation and reuse and doesn't violate LSP. [1]: http://www.iamnotmyself.com/content/binary/WindowsLiveWriter/WhatistheLiskovSubstitutionPrincipal_D0F1/Board_thumb.png
lsp
oop
null
null
null
null
open
What is the Liskov Substitution Principal? === The Liskov Substitution Principal (LSP) is a concept in Object Oriented Programming that states: > Functions that use pointers or > references to base classes must be > able to use objects of derived classes > with out knowing it. At it's heart LSP is about interfaces and contracts as well as how to decided when to extend a class vs. use another strategy such as composition to achieve your goal. The most effective way I have seen to illustrate this point was in <a href="http://oreilly.com/catalog/9780596008673/index.html">Head First OOA&D</a>. They present a scenario where you are a developer on a project to build a framework for strategy games. They present a class that represents a board that looks like this: ![Class Diagram][1] All of the methods take X and Y coordinates as parameters to locate the tile position in the two dimensional array of Tiles. This will allow a game developer to manage units in the board during the course of the game. The book goes on to change the requirements to say that the game frame work must also support 3d game boards to accommodate games that have flight. So a ThreeDBoard class is introduced that extends Board. At first glace this seems like a good decision. Board provides both the Height and Width properties and ThreeDBoard provides the Z axis. Where it breaks down is when you look at all the other members inherited from Board. The methods for AddUnit, GetTile, GetUnits and so on, all take both X and Y parameters in the Board class but the ThreeDBoard needs a Z parameter as well. So you must implement those methods again with a Z parameter. The Z parameter has no context to the Board class and the inherited methods from the Board class lose their meaning. A unit of code attempting to use the ThreeDBoard class as it's base class Board would be very out of luck. Maybe we should find another approach. Instead of extending Board, ThreeDBoard should be composed of Board objects. One Board object per unit of the Z axis. This allows us to use good object oriented principals like encapsulation and reuse and doesn't violate LSP. [1]: http://www.iamnotmyself.com/content/binary/WindowsLiveWriter/WhatistheLiskovSubstitutionPrincipal_D0F1/Board_thumb.png
0
56,867
09/11/2008 15:20:30
2,871
08/25/2008 16:56:00
41
4
Interface vs Base class
When should I use an interface and when should I use a base class? Should it always be an interface if I don't want to actually define a base implementation of the methods? If I have a Dog and Cat class. Why would I want to implement IPet instead of PetBase? I can understand having interfaces for ISheds or IBarks (IMakesNoise?), because those can be placed on a pet by pet basis, but I don't understand which to use for a generic Pet.
language-agnostic
oop
null
null
null
null
open
Interface vs Base class === When should I use an interface and when should I use a base class? Should it always be an interface if I don't want to actually define a base implementation of the methods? If I have a Dog and Cat class. Why would I want to implement IPet instead of PetBase? I can understand having interfaces for ISheds or IBarks (IMakesNoise?), because those can be placed on a pet by pet basis, but I don't understand which to use for a generic Pet.
0
56,886
09/11/2008 15:29:00
4,770
09/05/2008 14:24:23
31
4
UI Thread Safety
Any suggestions on the best way to ensure thread safety when changing the properties on Form controls? I have been using Me.Invoke in the past, and I was wondering if you have pros/cons, comments, suggestions, etc.
winforms
vb.net
multithreading
.net-3.5
null
null
open
UI Thread Safety === Any suggestions on the best way to ensure thread safety when changing the properties on Form controls? I have been using Me.Invoke in the past, and I was wondering if you have pros/cons, comments, suggestions, etc.
0
56,895
09/11/2008 15:32:14
3,839
08/31/2008 10:11:12
618
36
Proving SQL query equivalency
How would you go about proving that two queries are functionally equivalent, eg they will always both return the same result set.
sql
oracle
null
null
null
null
open
Proving SQL query equivalency === How would you go about proving that two queries are functionally equivalent, eg they will always both return the same result set.
0
56,905
09/11/2008 15:35:25
3,635
08/29/2008 16:13:11
34
6
ASP.Net AJAX JavaScript Serialization Error
Ran into an “Out of Stack Space” error trying to serialize an ASP.Net AJAX Array object. Here is the scenario with simplified code 1. Default.aspx 2. MainScript.js function getObject(){ return new Array(); } function function1(obj){ var s=Sys.Serialization.JavaScriptSerializer.serialize(obj); alert(s); } function function2(){ var obj=getObject(); var s=Sys.Serialization.JavaScriptSerializer.serialize(obj); alert(s); } 3. Content.aspx 4. ContentScript.js function serializeObject(){ var obj=window.top.getObject(); window.top.function1(obj); // <– This works fine obj=new Array(); window.top.function1(obj); // <– this causes an Out of Stack Space error } The code for the sample pages and JavaScript is [here][1] Posting the code for the aspx pages here posed a problem. So please check the above link to see the code for the aspx pages A web page (default.aspx) with an IFrame on that hosts a content page (content.aspx). Clicking the “Serialize Object” button calls the JavaScript function serializeObject(). The serialization works fine for Array objects created in the top window (outside the frame). However if the array object is created in the IFrame, serialization bombs with an out of stack space error. I stepped through ASP.Net AJAX JS files and what I discovered is, the process goes into an endless loop trying to figure out the type of the array object. Endless call to Number.IsInstanceOf and pretty soon you get an out of stack error Any ideas? TIA [1]: http://braincells2pixels.wordpress.com/2008/02/14/aspnet-ajax-javascript-serialization-error/
asp.net
ajax
serialization
null
null
null
open
ASP.Net AJAX JavaScript Serialization Error === Ran into an “Out of Stack Space” error trying to serialize an ASP.Net AJAX Array object. Here is the scenario with simplified code 1. Default.aspx 2. MainScript.js function getObject(){ return new Array(); } function function1(obj){ var s=Sys.Serialization.JavaScriptSerializer.serialize(obj); alert(s); } function function2(){ var obj=getObject(); var s=Sys.Serialization.JavaScriptSerializer.serialize(obj); alert(s); } 3. Content.aspx 4. ContentScript.js function serializeObject(){ var obj=window.top.getObject(); window.top.function1(obj); // <– This works fine obj=new Array(); window.top.function1(obj); // <– this causes an Out of Stack Space error } The code for the sample pages and JavaScript is [here][1] Posting the code for the aspx pages here posed a problem. So please check the above link to see the code for the aspx pages A web page (default.aspx) with an IFrame on that hosts a content page (content.aspx). Clicking the “Serialize Object” button calls the JavaScript function serializeObject(). The serialization works fine for Array objects created in the top window (outside the frame). However if the array object is created in the IFrame, serialization bombs with an out of stack space error. I stepped through ASP.Net AJAX JS files and what I discovered is, the process goes into an endless loop trying to figure out the type of the array object. Endless call to Number.IsInstanceOf and pretty soon you get an out of stack error Any ideas? TIA [1]: http://braincells2pixels.wordpress.com/2008/02/14/aspnet-ajax-javascript-serialization-error/
0
56,906
09/11/2008 15:35:31
3,012
08/26/2008 11:55:24
223
9
Opening a file stored in a database in .NET
I'm storing a Word document in a SQL Server 2005 database in a varbinary(max) column. Is there a way to open this document from a VB.NET Windows Forms application without serialising to a file first (i.e. directly from the byte array I've read from the database)?
sql-server
vb.net
null
null
null
null
open
Opening a file stored in a database in .NET === I'm storing a Word document in a SQL Server 2005 database in a varbinary(max) column. Is there a way to open this document from a VB.NET Windows Forms application without serialising to a file first (i.e. directly from the byte array I've read from the database)?
0
56,908
09/11/2008 15:35:34
2,429
08/22/2008 08:48:22
335
14
C#: Create a virtual drive in Computer
Is there any way to create a virtual drive in "(My) Computer" and manipulate it, somewhat like JungleDisk does it? It probably does something like: override OnRead(object sender, Event e) { ShowFilesFromAmazon(); } Are there any API:s for this? Maybe to write to an XML-file or a database, instead of a real drive.
c#
.net
virtualization
storage
null
null
open
C#: Create a virtual drive in Computer === Is there any way to create a virtual drive in "(My) Computer" and manipulate it, somewhat like JungleDisk does it? It probably does something like: override OnRead(object sender, Event e) { ShowFilesFromAmazon(); } Are there any API:s for this? Maybe to write to an XML-file or a database, instead of a real drive.
0
56,913
09/11/2008 15:36:40
914
08/10/2008 10:32:48
663
40
Batch renaming of files with international chars on Windows XP
I have a whole bunch of files with filenames using our lovely Swedish letters **å å** and **ö**. For various reasons I now need to convert these to an [a-zA-Z] range. Just removing anything outside this range is fairly easy. The thing that's causing me trouble is that I'd like to replace **å** with **a**, **ö** with **o** and so on. This is charset troubles at their worst. I have a set of test files: files\Copy of New Text Documen åäö t.txt files\fofo.txt files\New Text Document.txt files\worstcase åäöÅÄÖéÉ.txt I'm basing my script on this line, piping it's results into various commands for %%X in (files\*.txt) do (echo %%X) The wierd thing is that if I print the results of this (the plain for-loop that is) into a file I get this output: files\Copy of New Text Documen †„” t.txt files\fofo.txt files\New Text Document.txt files\worstcase †„”Ž™‚.txt So something wierd is happening to my filenames before they even reach the other tools (I've been trying to do this using a sed port for Windows from something called GnuWin32 but no luck so far) and doing the replace on these characters doesn't help either. **How would you solve this problem? I'm open to any type of tools, commandline or otherwise**
windows
international
filenames
batch
rename
null
open
Batch renaming of files with international chars on Windows XP === I have a whole bunch of files with filenames using our lovely Swedish letters **å å** and **ö**. For various reasons I now need to convert these to an [a-zA-Z] range. Just removing anything outside this range is fairly easy. The thing that's causing me trouble is that I'd like to replace **å** with **a**, **ö** with **o** and so on. This is charset troubles at their worst. I have a set of test files: files\Copy of New Text Documen åäö t.txt files\fofo.txt files\New Text Document.txt files\worstcase åäöÅÄÖéÉ.txt I'm basing my script on this line, piping it's results into various commands for %%X in (files\*.txt) do (echo %%X) The wierd thing is that if I print the results of this (the plain for-loop that is) into a file I get this output: files\Copy of New Text Documen †„” t.txt files\fofo.txt files\New Text Document.txt files\worstcase †„”Ž™‚.txt So something wierd is happening to my filenames before they even reach the other tools (I've been trying to do this using a sed port for Windows from something called GnuWin32 but no luck so far) and doing the replace on these characters doesn't help either. **How would you solve this problem? I'm open to any type of tools, commandline or otherwise**
0
56,923
09/11/2008 15:38:26
4,099
09/01/2008 18:59:39
35
3
How do I script a password change for a SQL server login?
Just what the title says, I need to change the password for an existing sql server login and I want to do it via sql script.
sql
sql-server
sql-server-2005
null
null
null
open
How do I script a password change for a SQL server login? === Just what the title says, I need to change the password for an existing sql server login and I want to do it via sql script.
0
56,943
09/11/2008 15:43:04
5,896
09/11/2008 15:29:18
1
0
Yes/No dialog in Java ME
I'm looking for a simple solution for a yes/no dialog to use in a Java ME midlet. I'd like to use it like this but other ways are okey. if (YesNoDialog.ask("Are you sure?") == true) { // yes was chosen } else { // no was chosen }
gui
java-me
midlet
null
null
null
open
Yes/No dialog in Java ME === I'm looking for a simple solution for a yes/no dialog to use in a Java ME midlet. I'd like to use it like this but other ways are okey. if (YesNoDialog.ask("Are you sure?") == true) { // yes was chosen } else { // no was chosen }
0
56,944
09/11/2008 15:43:07
4,540
09/04/2008 17:35:05
98
6
secure way to authenticate administrator in ASP.NET site using OpenID with DotNetOpenID
Encouraged by SO, I'm trying to write an ASP.NET site that uses OpenID for user authentication. It's a regular WinForms site (not MVC.NET), using the [DotNetOpenId][1] library for authentication. Is it safe for me to permit/deny administrative functions on the site by simply comparing the current session's "ClaimedID" (as returned in the OpenIdLogin_LoggedIn event, as member DotNetOpenId.RelyingParty,OpenIdEventArgs.Response.ClaimedIdentifier) to a known administrator's OpenID (i.e. mine)? If so, is it safe for this ID to be visible (e.g. in open source code), or should it be "hidden" in a configuration file or a database row? (I know it's better design to make it configurable, my question is just about safety.) [1]: http://code.google.com/p/dotnetopenid/
asp.net
openid
dotnetopenauth
null
null
null
open
secure way to authenticate administrator in ASP.NET site using OpenID with DotNetOpenID === Encouraged by SO, I'm trying to write an ASP.NET site that uses OpenID for user authentication. It's a regular WinForms site (not MVC.NET), using the [DotNetOpenId][1] library for authentication. Is it safe for me to permit/deny administrative functions on the site by simply comparing the current session's "ClaimedID" (as returned in the OpenIdLogin_LoggedIn event, as member DotNetOpenId.RelyingParty,OpenIdEventArgs.Response.ClaimedIdentifier) to a known administrator's OpenID (i.e. mine)? If so, is it safe for this ID to be visible (e.g. in open source code), or should it be "hidden" in a configuration file or a database row? (I know it's better design to make it configurable, my question is just about safety.) [1]: http://code.google.com/p/dotnetopenid/
0
56,947
09/11/2008 15:45:13
2,915
08/25/2008 23:15:12
2,970
121
How is floating point stored? When does it matter?
In follow up to [this question][1], it appears that some numbers cannot be represented by floating point at all, and instead are approximated. How are floating point numbers stored? Is there a common standard for the different sizes? What kind of gotchas do I need to watch out for if I use floating point? Are they cross-language compatible (ie, what conversions do I need to deal with to send a floating point number from a python program to a C program over TCP/IP)? -Adam [1]: http://stackoverflow.com/questions/56820/round-in-python-doesnt-seem-to-be-rounding-properly
floating-point
rounding-error
null
null
null
null
open
How is floating point stored? When does it matter? === In follow up to [this question][1], it appears that some numbers cannot be represented by floating point at all, and instead are approximated. How are floating point numbers stored? Is there a common standard for the different sizes? What kind of gotchas do I need to watch out for if I use floating point? Are they cross-language compatible (ie, what conversions do I need to deal with to send a floating point number from a python program to a C program over TCP/IP)? -Adam [1]: http://stackoverflow.com/questions/56820/round-in-python-doesnt-seem-to-be-rounding-properly
0
56,949
09/11/2008 15:46:53
1,143
08/12/2008 18:58:24
848
69
Race Condition Analysers for .NET
I've seen there are some race condition analysis tools for C++, C and Java. Anyone know of any static analysis tools that do the same for .NET?
.net
static-analysis
racecondition
null
null
null
open
Race Condition Analysers for .NET === I've seen there are some race condition analysis tools for C++, C and Java. Anyone know of any static analysis tools that do the same for .NET?
0
56,950
09/11/2008 15:47:03
2,230
08/21/2008 03:03:34
856
16
Right Align text in SQL Server
We all know T-SQL's string manipulation capabilities sometimes leaves much to be desired... I have a numeric field that needs to be output in T-SQL as a right-aligned text column. Example: Value ---------- 143.55 3532.13 1.75 How would you go about that? A good solution ought to be clear and compact, but remember there is such a thing as "too clever". I agree this is the wrong place to do this, but sometimes we're stuck by forces outside our control. Thank you.
sql-server
tsql
null
null
null
null
open
Right Align text in SQL Server === We all know T-SQL's string manipulation capabilities sometimes leaves much to be desired... I have a numeric field that needs to be output in T-SQL as a right-aligned text column. Example: Value ---------- 143.55 3532.13 1.75 How would you go about that? A good solution ought to be clear and compact, but remember there is such a thing as "too clever". I agree this is the wrong place to do this, but sometimes we're stuck by forces outside our control. Thank you.
0
56,951
09/11/2008 15:47:40
5,440
09/09/2008 15:34:12
1
0
Is it possible to programmatically push files to a wireless SD card?
Is it possible to programmatically push files to a wireless SD card - like a www.eye.fi card? I use a Mac and thought I could do this using some AppleScript - but have not found a way... Derek
wireless
applescript
null
null
null
null
open
Is it possible to programmatically push files to a wireless SD card? === Is it possible to programmatically push files to a wireless SD card - like a www.eye.fi card? I use a Mac and thought I could do this using some AppleScript - but have not found a way... Derek
0
56,954
09/11/2008 15:49:09
4,792
09/05/2008 16:08:18
31
7
EasyMock: How do I create a mock of a genericized class without a warning?
The code private SomeClass<Integer> someClass; someClass = EasyMock.createMock(SomeClass.class); gives me a warning "Type safety: The expression of type SomeClass needs unchecked conversion to conform to SomeClass&lt;Integer&gt;".
java
generics
mocking
easymock
null
null
open
EasyMock: How do I create a mock of a genericized class without a warning? === The code private SomeClass<Integer> someClass; someClass = EasyMock.createMock(SomeClass.class); gives me a warning "Type safety: The expression of type SomeClass needs unchecked conversion to conform to SomeClass&lt;Integer&gt;".
0
56,956
09/11/2008 15:50:27
5,496
09/10/2008 02:49:33
16
1
License guidelines for using log4net in a commercial application
I am looking to provide some logging support for a closed source commercial application. I have been using log4net for non-distributed projects and am very happy with it. I have googled a bit and actually read (or at least attempted to) the apache log4net license. But lacking a knack for legal-speak I just don't quite get what the rules are. My understanding is that one can use a library such as log4net in a commercial package if it's used in object form. If used in source form, then a different set of rules apply. Can anyone shed some light (or links) on this topic? Peter
licensing
log4net
commercial
closed-source
null
null
open
License guidelines for using log4net in a commercial application === I am looking to provide some logging support for a closed source commercial application. I have been using log4net for non-distributed projects and am very happy with it. I have googled a bit and actually read (or at least attempted to) the apache log4net license. But lacking a knack for legal-speak I just don't quite get what the rules are. My understanding is that one can use a library such as log4net in a commercial package if it's used in object form. If used in source form, then a different set of rules apply. Can anyone shed some light (or links) on this topic? Peter
0
56,974
09/11/2008 15:58:55
292
08/04/2008 13:14:31
601
33
keyword for the outer class from an anonymous inner class?
In the following snippet public class a{ public void otherMethod(){} public void doStuff(String str, InnerClass b){} pubic void method(a){ doStuff("asd", new InnerClass(){ public void innerMethod(){ otherMethod(); } } ); } } Ss there a keyword to refer to the outer class from the inner class? Basically what I want to do is outer.otherMethod(), or something of the like, but can't seem to find anything?
jave
anonymous-inner-class
null
null
null
null
open
keyword for the outer class from an anonymous inner class? === In the following snippet public class a{ public void otherMethod(){} public void doStuff(String str, InnerClass b){} pubic void method(a){ doStuff("asd", new InnerClass(){ public void innerMethod(){ otherMethod(); } } ); } } Ss there a keyword to refer to the outer class from the inner class? Basically what I want to do is outer.otherMethod(), or something of the like, but can't seem to find anything?
0
56,975
09/11/2008 15:59:06
4,965
09/07/2008 03:17:47
26
3
What is the best way to send large batches of emails in ASP.NET?
I'm currently looping through a datareader and calling the System.Net.Mail.SmtpClient's Send() method. The problem with this is that it's slow. Each email takes about 5-10 seconds to send (it's possible this is just an issue with my host). I had to override the executionTimeout default in my web.config file (it defaults to 90 seconds) like this: <httpRuntime executionTimeout="3000" /> One caveat: I'm on a shared host, so I don't think it is possible for me to send using the PickupDirectoryFromIis option (at least, it gave me errors when I turned it on).
asp.net
email
batch
null
null
null
open
What is the best way to send large batches of emails in ASP.NET? === I'm currently looping through a datareader and calling the System.Net.Mail.SmtpClient's Send() method. The problem with this is that it's slow. Each email takes about 5-10 seconds to send (it's possible this is just an issue with my host). I had to override the executionTimeout default in my web.config file (it defaults to 90 seconds) like this: <httpRuntime executionTimeout="3000" /> One caveat: I'm on a shared host, so I don't think it is possible for me to send using the PickupDirectoryFromIis option (at least, it gave me errors when I turned it on).
0
56,981
09/11/2008 16:01:03
83
08/01/2008 16:31:56
1,206
81
Which is the best database schema for Linq to SQL?
I'm creating a web site where all pages hang off a database-driven tree-hierarchy. All but one node has a parent node. Nodes may have role-based read permissions. Some nodes may have special rules (such as: don't display within navigation menus). Nodes may represent links to other nodes (like a shortcut in Windows). Nodes typically represent pages. Pages present either HTML content or [execute programming][1]. Some pages may be roots of subtrees (alternate masterpages and stylesheets). Please help me setup my nodes database in Microsoft SQL Server for use by Linq to SQL. I've got three ideas: 1. Many lightweight tables with almost zero nullalbe fields. ![#1 Many lightweight tables with almost zero nullalbe fields][2] 2. Heavyweight Node table with lots of nullalbe fields. ![#2 Heavyweight Node table with lots of nullalbe fields][3] 3. Best (or worst) of both: Lots of nullalbe foreign keys to many lightweight tables. ![#3 Lots of nullalbe foreign keys to many lightweight tables][4] Which do you feel best represents the data? Which will be easiest to use with Linq to SQL? How can I keep my data integrity rules within the database? How do I best enforce them within my programming? - Nodes must be either (but not both) links or pages. - Pages must be either (but not both) html or code. - Links may not be roots, html, nor code. Can I make an ASP.NET Site Map Provider with such a structure? Should I? [1]: http://stackoverflow.com/questions/56770/dynamic-navigation-and-web-applications [2]: http://img126.imageshack.us/img126/2016/scan1ro8.gif [3]: http://img124.imageshack.us/img124/9909/scan2xm2.gif [4]: http://img124.imageshack.us/img124/1999/scan3wn8.gif
.net
sql
database
linq-to-sql
database-design
null
open
Which is the best database schema for Linq to SQL? === I'm creating a web site where all pages hang off a database-driven tree-hierarchy. All but one node has a parent node. Nodes may have role-based read permissions. Some nodes may have special rules (such as: don't display within navigation menus). Nodes may represent links to other nodes (like a shortcut in Windows). Nodes typically represent pages. Pages present either HTML content or [execute programming][1]. Some pages may be roots of subtrees (alternate masterpages and stylesheets). Please help me setup my nodes database in Microsoft SQL Server for use by Linq to SQL. I've got three ideas: 1. Many lightweight tables with almost zero nullalbe fields. ![#1 Many lightweight tables with almost zero nullalbe fields][2] 2. Heavyweight Node table with lots of nullalbe fields. ![#2 Heavyweight Node table with lots of nullalbe fields][3] 3. Best (or worst) of both: Lots of nullalbe foreign keys to many lightweight tables. ![#3 Lots of nullalbe foreign keys to many lightweight tables][4] Which do you feel best represents the data? Which will be easiest to use with Linq to SQL? How can I keep my data integrity rules within the database? How do I best enforce them within my programming? - Nodes must be either (but not both) links or pages. - Pages must be either (but not both) html or code. - Links may not be roots, html, nor code. Can I make an ASP.NET Site Map Provider with such a structure? Should I? [1]: http://stackoverflow.com/questions/56770/dynamic-navigation-and-web-applications [2]: http://img126.imageshack.us/img126/2016/scan1ro8.gif [3]: http://img124.imageshack.us/img124/9909/scan2xm2.gif [4]: http://img124.imageshack.us/img124/1999/scan3wn8.gif
0
56,999
09/11/2008 16:07:32
4,376
09/03/2008 09:30:40
140
11
How to access a PCMCIA modem's serial number?
A Sprint cellular modem plugs into a laptop - often the PCMCIA slot. To connect, the user opens a program called the Connection Manager. This program has a menu option to display the serial number and phone number of the modem that's currently inserted. Does that imply that the serial/phone number of the modem could be available to other programs running on the system? (Note: let's assume this is Windows XP.) Specifically, could a company's VPN software be configured to pass along information about which modem is being used to connect? Finally, is there existing VPN software that already does this, or would it have to be custom-programmed?
hardware
vpn
modem
null
null
null
open
How to access a PCMCIA modem's serial number? === A Sprint cellular modem plugs into a laptop - often the PCMCIA slot. To connect, the user opens a program called the Connection Manager. This program has a menu option to display the serial number and phone number of the modem that's currently inserted. Does that imply that the serial/phone number of the modem could be available to other programs running on the system? (Note: let's assume this is Windows XP.) Specifically, could a company's VPN software be configured to pass along information about which modem is being used to connect? Finally, is there existing VPN software that already does this, or would it have to be custom-programmed?
0
57,002
09/11/2008 16:08:06
2,443
08/22/2008 10:53:30
690
38
CSS to make an empty cell's border appear?
What CSS should I use to make a cell's border appear even if the cell is empty? IE 7 specifically.
css
null
null
null
null
null
open
CSS to make an empty cell's border appear? === What CSS should I use to make a cell's border appear even if the cell is empty? IE 7 specifically.
0
57,004
09/11/2008 16:08:44
572
08/06/2008 20:56:54
3,618
276
How can I find what search terms (if any) brought a user to my site?
I want to create dynamic content based on this. I know it's somewhere, as web analytics engines can get this data to determine how people got to your site (referrer, search terms used, etc.), but I don't know how to get at it myself.
search-engine
analytics
null
null
null
null
open
How can I find what search terms (if any) brought a user to my site? === I want to create dynamic content based on this. I know it's somewhere, as web analytics engines can get this data to determine how people got to your site (referrer, search terms used, etc.), but I don't know how to get at it myself.
0
57,007
09/11/2008 16:09:57
2,171
08/20/2008 18:04:57
112
2
Getting Information From Master File Table on Windows
I need to get some information that is contained in the MFT on a Windows machine, and I'm hoping that there is some super-secret API for getting this information. I need to be able to get to this information programmatically, and because of legal concerns I might not be able to use the tools provided by the company formally known as sysinternals. My other option (which I really don't want to have to do) is to get the start sector of the MFT with DeviceIoControl, and manually parse through the information. Anyway, in particular, what I really need to get out of the Master File Table is the logical sectors used to hold the data that is associated with a file. Thanks, Terry
windows
filesystems
null
null
null
null
open
Getting Information From Master File Table on Windows === I need to get some information that is contained in the MFT on a Windows machine, and I'm hoping that there is some super-secret API for getting this information. I need to be able to get to this information programmatically, and because of legal concerns I might not be able to use the tools provided by the company formally known as sysinternals. My other option (which I really don't want to have to do) is to get the start sector of the MFT with DeviceIoControl, and manually parse through the information. Anyway, in particular, what I really need to get out of the Master File Table is the logical sectors used to hold the data that is associated with a file. Thanks, Terry
0
57,010
09/11/2008 16:10:38
4,200
09/02/2008 09:57:33
337
25
Best way to remove duplicates from an array of strings
EDIT: Note this is not a question of obtaining distinct values! Elements in my example are only "duplicated" if they occur sequentially in my array. I have an array containing a set of strings. Within the array elements can be duplicated in two ways. Consider this example; [0] first line [1] first line [2] the two lines above are a duplicate and I want to remove one of them [3] second line [4] ...continued [5] second line [6] ...continued [7] there is a duplicate in the four lines above and I want to remove one of them... In this example I want to obtain an array minus elements [1], [5], and [6], resulting in; [0] first line [1] the two lines above are a duplicate and I want to remove one of them [2] second line [3] ...continued [4] there is a duplicate in the four lines above and I want to remove one of them... By default here is the approach I will take: I would have an indexed loop over the elements peeking ahead to look for duplicates. If I found a duplicate I would mark one of them with a "remove me" token. When the loop ends I would then remove the marked elements. (If I removed elements while looping I would need to update the loop index, which would get messy and probably obscure the algorithm.) Do you have any clever suggestions for a better approach?
c#
.net
algorithm
null
null
null
open
Best way to remove duplicates from an array of strings === EDIT: Note this is not a question of obtaining distinct values! Elements in my example are only "duplicated" if they occur sequentially in my array. I have an array containing a set of strings. Within the array elements can be duplicated in two ways. Consider this example; [0] first line [1] first line [2] the two lines above are a duplicate and I want to remove one of them [3] second line [4] ...continued [5] second line [6] ...continued [7] there is a duplicate in the four lines above and I want to remove one of them... In this example I want to obtain an array minus elements [1], [5], and [6], resulting in; [0] first line [1] the two lines above are a duplicate and I want to remove one of them [2] second line [3] ...continued [4] there is a duplicate in the four lines above and I want to remove one of them... By default here is the approach I will take: I would have an indexed loop over the elements peeking ahead to look for duplicates. If I found a duplicate I would mark one of them with a "remove me" token. When the loop ends I would then remove the marked elements. (If I removed elements while looping I would need to update the loop index, which would get messy and probably obscure the algorithm.) Do you have any clever suggestions for a better approach?
0
57,019
09/11/2008 16:15:21
5,908
09/11/2008 16:15:20
1
0
Where should crossplatform apps keep its data?
I'm building an application that is targeting Windows, Mac and Linux soon. I was wondering where should I keep application data such as settings, etc. Application's installation folder is the easiest choice, but I think that might be a problem with new Vista security model. Besides, users might want different settings. Is it C:\Documents and Settings\username\MyApp good for both Vista and XP? Is it /home/username/.MyApp good for Linux and Macs? Any ideas and/or links to best practices much appreciated. Thanks! Juan
crossplatform
application
xp
vista
linux
null
open
Where should crossplatform apps keep its data? === I'm building an application that is targeting Windows, Mac and Linux soon. I was wondering where should I keep application data such as settings, etc. Application's installation folder is the easiest choice, but I think that might be a problem with new Vista security model. Besides, users might want different settings. Is it C:\Documents and Settings\username\MyApp good for both Vista and XP? Is it /home/username/.MyApp good for Linux and Macs? Any ideas and/or links to best practices much appreciated. Thanks! Juan
0
57,020
09/11/2008 16:15:52
1,695
08/18/2008 02:49:06
1,038
73
Which .Net collection for adding multiple objects at once and getting notified ?
Was considering the `System.Collections.ObjectModel ObservableCollection<T>` class. This one is strange because - it has an Add Method which takes **one** item only. No AddRange or equivalent. - the Notification event arguments has a NewItems property, which is a **IList** (of objects.. not T) My need here is to add a batch of objects to a collection and the listener also gets the batch as part of the notification. Am I missing something with ObservableCollection ? Is there another class that meets my spec?
c#
.net-3.5
collections
null
null
null
open
Which .Net collection for adding multiple objects at once and getting notified ? === Was considering the `System.Collections.ObjectModel ObservableCollection<T>` class. This one is strange because - it has an Add Method which takes **one** item only. No AddRange or equivalent. - the Notification event arguments has a NewItems property, which is a **IList** (of objects.. not T) My need here is to add a batch of objects to a collection and the listener also gets the batch as part of the notification. Am I missing something with ObservableCollection ? Is there another class that meets my spec?
0
57,034
09/11/2008 16:21:03
2,186
08/20/2008 20:27:52
1
0
jQuery and Java applets
I'm working on a project where we're using a Java applet for part of the UI (a map, specifically), but building the rest of the UI around the applet in HTML/JavaScript, communicating with the applet through LiveConnect/NPAPI. A little bizarre, I know, but let's presume that setup is not under discussion. I started out planning on using jQuery as my JavaScript framework, but I've run into two issues. <b>Issue the first: </b> Selecting the applet doesn't provide access to the applet's methods. Java: public class MyApplet extends JApplet { // ... public String foo() { return "foo!"; } } JavaScript: var applet = $("#applet-id"); alert(applet.foo()); Running the above JavaScript results in <pre>$("#applet-id").foo is not a function</pre> This is in contrast to Prototype, where the analogous code does work: var applet = $("applet-id"); alert(applet.foo()); So...where'd the applet methods go? <b>Issue the second:</b> There's a known problem with jQuery and applets in Firefox 2: <http://www.pengoworks.com/workshop/jquery/bug_applet/jquery_applet_bug.htm> It's a long shot, but does anybody know of a workaround? I suspect this problem isn't fixable, which will mean switching to Prototype. Thanks for the help!
java
javascript
jquery
applet
null
null
open
jQuery and Java applets === I'm working on a project where we're using a Java applet for part of the UI (a map, specifically), but building the rest of the UI around the applet in HTML/JavaScript, communicating with the applet through LiveConnect/NPAPI. A little bizarre, I know, but let's presume that setup is not under discussion. I started out planning on using jQuery as my JavaScript framework, but I've run into two issues. <b>Issue the first: </b> Selecting the applet doesn't provide access to the applet's methods. Java: public class MyApplet extends JApplet { // ... public String foo() { return "foo!"; } } JavaScript: var applet = $("#applet-id"); alert(applet.foo()); Running the above JavaScript results in <pre>$("#applet-id").foo is not a function</pre> This is in contrast to Prototype, where the analogous code does work: var applet = $("applet-id"); alert(applet.foo()); So...where'd the applet methods go? <b>Issue the second:</b> There's a known problem with jQuery and applets in Firefox 2: <http://www.pengoworks.com/workshop/jquery/bug_applet/jquery_applet_bug.htm> It's a long shot, but does anybody know of a workaround? I suspect this problem isn't fixable, which will mean switching to Prototype. Thanks for the help!
0
57,053
09/11/2008 16:36:12
4,939
09/06/2008 20:36:05
40
1
What, if any, checksum is used for TNT.com tracking numbers?
I am writing some software to identify tracking numbers (in the same way that Google identifies FedEx or UPS numbers when you search for them). Most couriers use a system, such as a "weighted average mod system" which can be used to identify if a number is a valid tracking number. Does anyone know if TNT consignment numbers use such a system, and if so, what it is? I have asked TNT support, and the rep told me they do not... but I'd like to doublecheck.
algorithm
validation
checksum
null
null
null
open
What, if any, checksum is used for TNT.com tracking numbers? === I am writing some software to identify tracking numbers (in the same way that Google identifies FedEx or UPS numbers when you search for them). Most couriers use a system, such as a "weighted average mod system" which can be used to identify if a number is a valid tracking number. Does anyone know if TNT consignment numbers use such a system, and if so, what it is? I have asked TNT support, and the rep told me they do not... but I'd like to doublecheck.
0
57,054
09/11/2008 16:36:20
1,228
08/13/2008 13:58:55
1,674
122
How to solve call ambiguity between Generic.IList<T>.this[] and IList.this[]?
I've got a collection that implements an interface that extends both IList<T> and List. public Interface IMySpecialCollection : IList<MyObject>, IList { ... } That means I have two versions of the indexer. I wish the generic implementation to be used, so I implement that one normally: public MyObject this[int index] { .... } I only need the IList version for serialization, so I implement it explicitly, to keep it hidden: object IList.this[int index] { ... } However, in my unit tests, the following MyObject foo = target[0]; results in a compiler error > The call is ambiguous between the > following methods or properties This happens even when I cast my collection to IList before calling the indexer object foo = ((IList)target)[0]; I'm a bit surprised at this; I believe I've done it before and it works fine. What am I missing here? How can I get IList<T> and IList to coexist within the same interface?
somebodytagthisplease
null
null
null
null
null
open
How to solve call ambiguity between Generic.IList<T>.this[] and IList.this[]? === I've got a collection that implements an interface that extends both IList<T> and List. public Interface IMySpecialCollection : IList<MyObject>, IList { ... } That means I have two versions of the indexer. I wish the generic implementation to be used, so I implement that one normally: public MyObject this[int index] { .... } I only need the IList version for serialization, so I implement it explicitly, to keep it hidden: object IList.this[int index] { ... } However, in my unit tests, the following MyObject foo = target[0]; results in a compiler error > The call is ambiguous between the > following methods or properties This happens even when I cast my collection to IList before calling the indexer object foo = ((IList)target)[0]; I'm a bit surprised at this; I believe I've done it before and it works fine. What am I missing here? How can I get IList<T> and IList to coexist within the same interface?
0
57,058
09/11/2008 16:38:23
5,832
09/11/2008 13:36:07
1
0
What not to do in C?
I would just like a few things that you guys see as bad programing practices in pure C, so I can watch out for those.
c
null
null
null
null
null
open
What not to do in C? === I would just like a few things that you guys see as bad programing practices in pure C, so I can watch out for those.
0
57,068
09/11/2008 16:43:10
1,862
08/18/2008 23:53:20
1,605
134
Good Databases with sample data
Does anybody know of any sample databases I could download, preferably in CSV or some similar easy to import format so that I could get more practice in working with different types of data sets? The Canadian Department of Environment has [historical weather data][1] that you can download. Unfortunately it's not in a format I can import into any other database, and you can only query it based on the included program which is actually quite limited in what kind of data it can provide. Does anybody know of any interesting data sets that are freely available? [1]: http://www.climate.weatheroffice.ec.gc.ca/Welcome_e.html
database
free
sample
null
null
null
open
Good Databases with sample data === Does anybody know of any sample databases I could download, preferably in CSV or some similar easy to import format so that I could get more practice in working with different types of data sets? The Canadian Department of Environment has [historical weather data][1] that you can download. Unfortunately it's not in a format I can import into any other database, and you can only query it based on the included program which is actually quite limited in what kind of data it can provide. Does anybody know of any interesting data sets that are freely available? [1]: http://www.climate.weatheroffice.ec.gc.ca/Welcome_e.html
0
57,075
09/11/2008 16:45:38
966
08/11/2008 07:35:55
56
5
How do I assign a keyboard shortcut to a VBA macro in Outlook 2007?
How can I assign a keyboard shortcut to a VBA macro in Outlook 2007? I know how to create a tool for the macro and put it in a menu with an underscore shortcut. This solution requires me to use a shortcut of ALT-{menu key}-{tool key}. What if I want to assign it to ALT-F12 or something like that? The Visual Basic Editor is assigned to the keyboard shortcut ALT-F11 in Outlook 2007. I want to assign a keyboard shortcut like that to a macro, or if necessary a macro on a tool in either a menu or a toolbar.
vba
outlook
macros
keyboard-shortcuts
null
null
open
How do I assign a keyboard shortcut to a VBA macro in Outlook 2007? === How can I assign a keyboard shortcut to a VBA macro in Outlook 2007? I know how to create a tool for the macro and put it in a menu with an underscore shortcut. This solution requires me to use a shortcut of ALT-{menu key}-{tool key}. What if I want to assign it to ALT-F12 or something like that? The Visual Basic Editor is assigned to the keyboard shortcut ALT-F11 in Outlook 2007. I want to assign a keyboard shortcut like that to a macro, or if necessary a macro on a tool in either a menu or a toolbar.
0
57,091
09/11/2008 16:59:29
5,348
09/09/2008 10:07:08
1
0
How to position a DIV to fill all available space between a header DIV and a footer DIV?
Let's say I have a parent DIV. Inside, there are three child DIVs: header, content and footer. Header is attached to the top of the parent and fills it horizontally. Footer is attached to the bottom of the parent and fills it horizontally too. Content is supposed to fill all the space between header and footer. Now comes the hard part: you don't know the height of the header nor footer beforehand (eg. header and footer are filled dynamically). How to position content without using JavaScript? Example: <div style="position : relative; width : 200px; height : 200px; background-color : #e0e0ff; overflow : hidden;"> <div style="background-color: #80ff80; position : absolute; left : 0; right : 0; top : 0;"> header </div> <div style="background-color: #8080ff; overflow : auto; position : absolute;"> content (how to position it?) </div> <div style="background-color: #ff8080; position : absolute; bottom : 0px; left :0; right : 0;"> footer </div> </div>
html
css
null
null
null
null
open
How to position a DIV to fill all available space between a header DIV and a footer DIV? === Let's say I have a parent DIV. Inside, there are three child DIVs: header, content and footer. Header is attached to the top of the parent and fills it horizontally. Footer is attached to the bottom of the parent and fills it horizontally too. Content is supposed to fill all the space between header and footer. Now comes the hard part: you don't know the height of the header nor footer beforehand (eg. header and footer are filled dynamically). How to position content without using JavaScript? Example: <div style="position : relative; width : 200px; height : 200px; background-color : #e0e0ff; overflow : hidden;"> <div style="background-color: #80ff80; position : absolute; left : 0; right : 0; top : 0;"> header </div> <div style="background-color: #8080ff; overflow : auto; position : absolute;"> content (how to position it?) </div> <div style="background-color: #ff8080; position : absolute; bottom : 0px; left :0; right : 0;"> footer </div> </div>
0
57,094
09/11/2008 17:00:47
4,872
09/06/2008 09:14:55
218
3
How can I programmatically run the ASP.Net Development Server using C#?
I have ASP.NET web pages for which I want to build automated tests (using WatiN & MBUnit). How do I start the ASP.Net Development Server from my code? I do not want to use IIS.
c#
asp.net
null
null
null
null
open
How can I programmatically run the ASP.Net Development Server using C#? === I have ASP.NET web pages for which I want to build automated tests (using WatiN & MBUnit). How do I start the ASP.Net Development Server from my code? I do not want to use IIS.
0
57,098
09/11/2008 17:01:09
4,903
09/06/2008 14:16:54
253
16
Looking for in-depth comparison of selectors and events for jQuery and Prototype
A few of the third-party applications we use are written in Prototype, and I'm really having trouble with selectors and events. I know how to accomplish it all in jQuery quickly, but I'm not about to load both libraries. Can you provide a few links that do a top-down comparison of selectors and/or events for jQuery and Prototype, so I can look at the Prototype equivalents of jQuery syntax? Something sort of along the lines of this slide presentation: [http://remysharp.com/2007/10/25/prototype-and-jquery-going-from-one-to-the-other/][1] [1]: http://remysharp.com/2007/10/25/prototype-and-jquery-going-from-one-to-the-other/
jquery
events
prototype
selectors
null
null
open
Looking for in-depth comparison of selectors and events for jQuery and Prototype === A few of the third-party applications we use are written in Prototype, and I'm really having trouble with selectors and events. I know how to accomplish it all in jQuery quickly, but I'm not about to load both libraries. Can you provide a few links that do a top-down comparison of selectors and/or events for jQuery and Prototype, so I can look at the Prototype equivalents of jQuery syntax? Something sort of along the lines of this slide presentation: [http://remysharp.com/2007/10/25/prototype-and-jquery-going-from-one-to-the-other/][1] [1]: http://remysharp.com/2007/10/25/prototype-and-jquery-going-from-one-to-the-other/
0
57,102
09/11/2008 17:07:37
5,425
09/09/2008 14:09:58
1
0
Embedded java databases
I would like to get opinions or suggestions regarding embedded databases in Java. In particular I was looking at H2, HSQLDB and Derby. Have you use any of these in a production project? Do you have comment or recommendations to select one over the others? Thanks
java
database
embedded
null
null
null
open
Embedded java databases === I would like to get opinions or suggestions regarding embedded databases in Java. In particular I was looking at H2, HSQLDB and Derby. Have you use any of these in a production project? Do you have comment or recommendations to select one over the others? Thanks
0
57,104
09/11/2008 17:08:27
3,488
08/28/2008 18:28:18
198
15
Rails BLOB support
I'm going to be starting a project soon that requires support for BLOBs (Binary Large OBjects: basically big binary files stored within the database). I'd like to use Ruby on Rails for the webapp, but I'm concerned with the BLOB support. In my experience with other languages, frameworks, and databases, BLOBs are often overlooked and thus have poor, difficult, and/or buggy functionality. Does RoR spport BLOBs adequately? Are there any gotchas that creep up once you're already committed to Rails? BTW: I want to be using PostgreSQL and/or MySQL as the backend database. Obviously, BLOB support in the underlying database is important. For the moment, I want to avoid focusing on the DB's BLOB capabilities; I'm more interested in how Rails itself reacts. Ideally, Rails should be hiding the details of the database from me, and so I should be able to switch from one to the other. If this is _not_ the case (ie: there's some problem with using Rails with a particular DB) then please do mention it.
ruby-on-rails
blob
null
null
null
null
open
Rails BLOB support === I'm going to be starting a project soon that requires support for BLOBs (Binary Large OBjects: basically big binary files stored within the database). I'd like to use Ruby on Rails for the webapp, but I'm concerned with the BLOB support. In my experience with other languages, frameworks, and databases, BLOBs are often overlooked and thus have poor, difficult, and/or buggy functionality. Does RoR spport BLOBs adequately? Are there any gotchas that creep up once you're already committed to Rails? BTW: I want to be using PostgreSQL and/or MySQL as the backend database. Obviously, BLOB support in the underlying database is important. For the moment, I want to avoid focusing on the DB's BLOB capabilities; I'm more interested in how Rails itself reacts. Ideally, Rails should be hiding the details of the database from me, and so I should be able to switch from one to the other. If this is _not_ the case (ie: there's some problem with using Rails with a particular DB) then please do mention it.
0
57,106
09/11/2008 17:09:26
5,653
09/10/2008 16:42:43
11
1
Anyone know of an NFL or NBA api?
How do sites like yahoo get there NFL information. I wanted to tap into NFL information for a web app.
nflapi
null
null
null
null
null
open
Anyone know of an NFL or NBA api? === How do sites like yahoo get there NFL information. I wanted to tap into NFL information for a web app.
0
57,108
09/11/2008 17:10:43
5,899
09/11/2008 15:36:13
11
1
Are there any Technical Advantages on Mainframe (or any other legacy systems)?
**Background**: I believe most of the major financial institutes and major retailers still have many critical business processes and data relied on the legacy systems, such as Mainframe. Many developers still write code on those terminal windows without a debugger to add enhancements to their Mainframe systems, which I call the stone age of programming. (No offense to the Mainframe developers.) **Question**: Are there any Technical Advantages on these legacy systems compared to the modern systems built on .Net, J2EE or other modern platforms? The only reason for keeping these systems, I think, is these big banks and retailers are locked-in by these legacy systems, which have been developed and enhanced for more than 20 years. No one can afford the money / risks to port them to a modern platform. Please share your thoughts.
legacy
system
null
null
null
null
open
Are there any Technical Advantages on Mainframe (or any other legacy systems)? === **Background**: I believe most of the major financial institutes and major retailers still have many critical business processes and data relied on the legacy systems, such as Mainframe. Many developers still write code on those terminal windows without a debugger to add enhancements to their Mainframe systems, which I call the stone age of programming. (No offense to the Mainframe developers.) **Question**: Are there any Technical Advantages on these legacy systems compared to the modern systems built on .Net, J2EE or other modern platforms? The only reason for keeping these systems, I think, is these big banks and retailers are locked-in by these legacy systems, which have been developed and enhanced for more than 20 years. No one can afford the money / risks to port them to a modern platform. Please share your thoughts.
0
57,117
09/11/2008 17:17:30
5,675
09/10/2008 21:40:18
13
2
Recommended Python RSS/Atom feed generator?
Can you recommend a feed generator library for Python? I could build the XML myself, but I'm looking for a recommended library that is built from the ground up around the RSS (or Atom) spec.
python
rss
null
null
null
null
open
Recommended Python RSS/Atom feed generator? === Can you recommend a feed generator library for Python? I could build the XML myself, but I'm looking for a recommended library that is built from the ground up around the RSS (or Atom) spec.
0
57,124
09/11/2008 17:21:31
4,997
09/07/2008 09:34:00
674
18
How to detect true Windows version
I know I can call the GetVersionEx Win32 API function to retrieve Windows version. In most cases returned value reflects the version of my Windows, but sometimes that is not so. If a user runs my application under the compatibility layer, then GetVersionEx won't be reporting the real version but the version enforced by the compatibility layer. For example, if I'm running Vista and execute my program in "Windows NT 4" compatibility mode, GetVersionEx won't return version 6.0 but 4.0. Is there a way to bypass this behaviour and get true Windows version?
windows
winapi
null
null
null
null
open
How to detect true Windows version === I know I can call the GetVersionEx Win32 API function to retrieve Windows version. In most cases returned value reflects the version of my Windows, but sometimes that is not so. If a user runs my application under the compatibility layer, then GetVersionEx won't be reporting the real version but the version enforced by the compatibility layer. For example, if I'm running Vista and execute my program in "Windows NT 4" compatibility mode, GetVersionEx won't return version 6.0 but 4.0. Is there a way to bypass this behaviour and get true Windows version?
0
57,137
09/11/2008 17:31:11
5,626
09/10/2008 15:11:18
66
2
403 Forbidden error using Subversion
I recently upgraded to Subversion 1.5, and now I cannot commit my code to the repository. I get an error message: "403 Forbidden in response to MKACTIVITY". I know the upgrade worked because my fellow developers are not getting this issue. What's going on?
subversion
null
null
null
null
null
open
403 Forbidden error using Subversion === I recently upgraded to Subversion 1.5, and now I cannot commit my code to the repository. I get an error message: "403 Forbidden in response to MKACTIVITY". I know the upgrade worked because my fellow developers are not getting this issue. What's going on?
0
57,140
09/11/2008 17:32:51
5,056
09/07/2008 15:43:17
647
55
Is there any disadvantage to returning this instead of void?
Say instead of returning void a method you returned a reference to the class even if it didn't make any particular semantic sense. It seems to me like it would give you more options on how the methods are called, allowing you to use it in a fluent-interface-like style and I can't really think of any disadvantages since you don't have to do anything with the return value (even store it). So suppose you're in a situation where you want to update an object and then return its current value. instead of saying myObj.Update(); var val = myObj.GetCurrentValue(); you will be able to combine the two lines to say var val = myObj.Update().GetCurrentValue(); On a related note, what do you guys think of having the language include a new bit of syntactic sugar: var val = myObj.Update()<.GetCurrentValue(); This operator would have a low order of precedence so myObj.Update() would execute first and then call GetCurrentValue() on myObj instead of the void return of Update. Essentially I'm imagining an operator that will say "call the method on the right-hand side of the operator on the first valid object on the left". Any thoughts?
.net
fluent-interface
null
null
null
null
open
Is there any disadvantage to returning this instead of void? === Say instead of returning void a method you returned a reference to the class even if it didn't make any particular semantic sense. It seems to me like it would give you more options on how the methods are called, allowing you to use it in a fluent-interface-like style and I can't really think of any disadvantages since you don't have to do anything with the return value (even store it). So suppose you're in a situation where you want to update an object and then return its current value. instead of saying myObj.Update(); var val = myObj.GetCurrentValue(); you will be able to combine the two lines to say var val = myObj.Update().GetCurrentValue(); On a related note, what do you guys think of having the language include a new bit of syntactic sugar: var val = myObj.Update()<.GetCurrentValue(); This operator would have a low order of precedence so myObj.Update() would execute first and then call GetCurrentValue() on myObj instead of the void return of Update. Essentially I'm imagining an operator that will say "call the method on the right-hand side of the operator on the first valid object on the left". Any thoughts?
0
57,145
09/11/2008 17:33:41
2,881
08/25/2008 17:46:55
239
5
Using Small (1-10 Items) Instance-Level Collections in Java
While creating classes in Java I often find myself creating instance-level collections that I know ahead of time will be very small - less than 10 items in the collection. But I don't know the number of items ahead of time so I typically opt for a dynamic collection (ArrayList, Vector, etc). class Foo { ArrayList<Bar> bars = new ArrayList<Bar>(10); } A part of me keeps nagging at me that it's wasteful to use complex dynamic collections for something this small in size. Is there a better way of implementing something like this? Or is this the norm? Note, I'm not hit with any (noticeable) performance penalties or anything like that. This is just me wondering if there isn't a better way to do things.
java
collections
null
null
null
null
open
Using Small (1-10 Items) Instance-Level Collections in Java === While creating classes in Java I often find myself creating instance-level collections that I know ahead of time will be very small - less than 10 items in the collection. But I don't know the number of items ahead of time so I typically opt for a dynamic collection (ArrayList, Vector, etc). class Foo { ArrayList<Bar> bars = new ArrayList<Bar>(10); } A part of me keeps nagging at me that it's wasteful to use complex dynamic collections for something this small in size. Is there a better way of implementing something like this? Or is this the norm? Note, I'm not hit with any (noticeable) performance penalties or anything like that. This is just me wondering if there isn't a better way to do things.
0
57,152
09/11/2008 17:35:20
83
08/01/2008 16:31:56
1,216
82
What's the best way to handle one-to-one relationships in SQL?
Let's say I've got Alpha things that may or may not *be* or be *related to* Bravo or Charlie things. These are one-to-one relationships: No Alpha will relate to more than one Bravo. And no Bravo will relate to more than one Alpha. I've got a few goals: - a system that's easy to learn and maintain. - data integrity enforced within my database. - a schema that matches the real-world, logical organization of my data. - classes/objects within my programming that map well to database tables (à la Linq to SQL) - speedy read and write operations - effective use of space (few null fields) I've got three ideas&hellip; PK = primary key FK = foreign key NU = nullable One table with many nullalbe fields (flat file)&hellip; Alphas -------- PK AlphaId AlphaOne AlphaTwo AlphaThree NU BravoOne NU BravoTwo NU BravoThree NU CharlieOne NU CharlieTwo NU CharlieThree Many tables with zero nullalbe fields&hellip; Alphas -------- PK AlphaId AlphaOne AlphaTwo AlphaThree Bravos -------- FK PK AlphaId BravoOne BravoTwo BravoThree Charlies -------- FK PK AlphaId CharlieOne CharlieTwo CharlieThree Best (or worst) of both: Lots of nullalbe foreign keys to many tables&hellip; Alphas -------- PK AlphaId AlphaOne AlphaTwo AlphaThree NU FK BravoId NU FK CharlieId Bravos -------- PK BravoId BravoOne BravoTwo BravoThree Charlies -------- PK CharlieId CharlieOne CharlieTwo CharlieThree What if an Alpha must be either Bravo or Charlie, but not both? What if instead of just Bravos and Charlies, Alphas could also be any of Deltas, Echos, Foxtrots, or Golfs, etc&hellip;?
database-design
database
schema
linq
linq-to-sql
null
open
What's the best way to handle one-to-one relationships in SQL? === Let's say I've got Alpha things that may or may not *be* or be *related to* Bravo or Charlie things. These are one-to-one relationships: No Alpha will relate to more than one Bravo. And no Bravo will relate to more than one Alpha. I've got a few goals: - a system that's easy to learn and maintain. - data integrity enforced within my database. - a schema that matches the real-world, logical organization of my data. - classes/objects within my programming that map well to database tables (à la Linq to SQL) - speedy read and write operations - effective use of space (few null fields) I've got three ideas&hellip; PK = primary key FK = foreign key NU = nullable One table with many nullalbe fields (flat file)&hellip; Alphas -------- PK AlphaId AlphaOne AlphaTwo AlphaThree NU BravoOne NU BravoTwo NU BravoThree NU CharlieOne NU CharlieTwo NU CharlieThree Many tables with zero nullalbe fields&hellip; Alphas -------- PK AlphaId AlphaOne AlphaTwo AlphaThree Bravos -------- FK PK AlphaId BravoOne BravoTwo BravoThree Charlies -------- FK PK AlphaId CharlieOne CharlieTwo CharlieThree Best (or worst) of both: Lots of nullalbe foreign keys to many tables&hellip; Alphas -------- PK AlphaId AlphaOne AlphaTwo AlphaThree NU FK BravoId NU FK CharlieId Bravos -------- PK BravoId BravoOne BravoTwo BravoThree Charlies -------- PK CharlieId CharlieOne CharlieTwo CharlieThree What if an Alpha must be either Bravo or Charlie, but not both? What if instead of just Bravos and Charlies, Alphas could also be any of Deltas, Echos, Foxtrots, or Golfs, etc&hellip;?
0
57,154
09/11/2008 17:36:33
4,570
09/04/2008 18:09:36
334
22
Problems with migrating Cardspace cards between computers
Here's the scenario. I'm using myopenid for, among other things, StackOverflow. When I initially set up my openid account with myopenid, I decided to try out Cardspace because they had support. I later wanted to access Stackoverflow from another machine so I chose to back up my card. I gave it a password and a filename and successfully created a backup file. I was also to able successfully import it to my laptop. Here is where the problem comes in - I am unable to use the card that I backed up from my laptop. The original card still works great on my desktop. Additional information is that my desktop is running Windows XP SP3 (x86) while my laptop is running Windows Vista (x64). Any ideas? Am I doing something wrong? I'm seriously considering dropping Cardspace on myopenid and moving to a password solution with them instead. Thanks!
openid
cardspace
null
null
null
null
open
Problems with migrating Cardspace cards between computers === Here's the scenario. I'm using myopenid for, among other things, StackOverflow. When I initially set up my openid account with myopenid, I decided to try out Cardspace because they had support. I later wanted to access Stackoverflow from another machine so I chose to back up my card. I gave it a password and a filename and successfully created a backup file. I was also to able successfully import it to my laptop. Here is where the problem comes in - I am unable to use the card that I backed up from my laptop. The original card still works great on my desktop. Additional information is that my desktop is running Windows XP SP3 (x86) while my laptop is running Windows Vista (x64). Any ideas? Am I doing something wrong? I'm seriously considering dropping Cardspace on myopenid and moving to a password solution with them instead. Thanks!
0
57,168
09/11/2008 17:42:11
2,536
08/22/2008 17:37:07
839
37
How to copy a row from one SQL Server table to another
I have two identical tables and need to copy rows from table to another. What is the best way to do that? (I need to programmatically copy just a few rows, I don't need to use the bulk copy utility). Thanks rp
sql
sql-server
null
null
null
null
open
How to copy a row from one SQL Server table to another === I have two identical tables and need to copy rows from table to another. What is the best way to do that? (I need to programmatically copy just a few rows, I don't need to use the bulk copy utility). Thanks rp
0
57,170
09/11/2008 17:42:58
4,089
09/01/2008 18:19:43
183
8
What collaboration tools are effective for working with non-technical people?
For programmers working in corporate environments and outside of the start up world, there are a wide variety of non-technical people that are important stakeholders in the development process. These include other functions within the company such as marketing, finance and legal, for example, and also include customers and others outside the company. The point of this question is not “care and feeding” of these groups, but simply what tools have been found to work to facilitate collaboration and necessary interaction? I’m thinking along of the lines of IM versus wikis versus traditional email distribution lists, or the corporate sharepoint portal, but wonder what others have found to work.
collaboration
corporate
null
null
null
null
open
What collaboration tools are effective for working with non-technical people? === For programmers working in corporate environments and outside of the start up world, there are a wide variety of non-technical people that are important stakeholders in the development process. These include other functions within the company such as marketing, finance and legal, for example, and also include customers and others outside the company. The point of this question is not “care and feeding” of these groups, but simply what tools have been found to work to facilitate collaboration and necessary interaction? I’m thinking along of the lines of IM versus wikis versus traditional email distribution lists, or the corporate sharepoint portal, but wonder what others have found to work.
0
57,179
09/11/2008 17:46:58
5,932
09/11/2008 17:43:38
1
0
Oracle from .Net with a 64 bit client
Has anyone had any luck of using Oracle from .Net on a 64 bit machine, and using the UDT capabilities of Oracle? I've been able to use an x64 ODP.Net client, but cannot find one with any support for UDTs. Thanks Nick
.net
oracle
64bit
null
null
null
open
Oracle from .Net with a 64 bit client === Has anyone had any luck of using Oracle from .Net on a 64 bit machine, and using the UDT capabilities of Oracle? I've been able to use an x64 ODP.Net client, but cannot find one with any support for UDTs. Thanks Nick
0
57,183
09/11/2008 17:48:18
3,498
08/28/2008 19:35:00
60
4
Get CVS history for a particular user
How do I get the history of commits that have been made to the repository for a particular user? I am able to access CVS either through the command line or TortioseCVS, so a solution using either method is sufficient.
cvs
history
tortoisecvs
null
null
null
open
Get CVS history for a particular user === How do I get the history of commits that have been made to the repository for a particular user? I am able to access CVS either through the command line or TortioseCVS, so a solution using either method is sufficient.
0
57,194
09/11/2008 17:51:19
111
08/02/2008 03:35:55
192
10
FTP Timout on LIST when directory is empty
Our business uses the WebMethods integration server to handle most of our outbound communications, and its FTP functionality leaves something to be desired. We are having a problem that may be specific to WebMethods, but if anyone can point me in a direction of what kinds of things might cause this I'd appreciate it. When polling two of our partners' FTP servers, we connect without issue but, when doing a LIST on a directory that is empty (no files and no subdirectories) it's timing out. The actual error is: > com.wm.net.ftpCException: [ISC.0064.9010] java.net.SocketTimeoutException: Accept timed out It's being thrown during the invocation of the pub.client.ftp:ls service. I've logged in with a number of FTP clients without a problem to the same sites. I've used whatever the default FTP client is in windows, FileZilla and lftp. All without issue. The servers themselves aren't the same FTP server software from what I can tell. One is Microsoft FTP, the other I'm uncertain on but is definitely not Microsoft. Any idea what could cause an FTP client to timeout when waiting for a LIST response on an empty directory? The visible responses from the FTP server appear to be the same, but is there a difference in how LIST responds for an empty directory that I'm unaware of? This problem is consistent on these two servers. Everything functions fine on directories with files or subdirectories within it, but not when empty. Any thoughts or directions would be appreciated. Thanks! Eric Sipple
webmethods
java
null
null
null
null
open
FTP Timout on LIST when directory is empty === Our business uses the WebMethods integration server to handle most of our outbound communications, and its FTP functionality leaves something to be desired. We are having a problem that may be specific to WebMethods, but if anyone can point me in a direction of what kinds of things might cause this I'd appreciate it. When polling two of our partners' FTP servers, we connect without issue but, when doing a LIST on a directory that is empty (no files and no subdirectories) it's timing out. The actual error is: > com.wm.net.ftpCException: [ISC.0064.9010] java.net.SocketTimeoutException: Accept timed out It's being thrown during the invocation of the pub.client.ftp:ls service. I've logged in with a number of FTP clients without a problem to the same sites. I've used whatever the default FTP client is in windows, FileZilla and lftp. All without issue. The servers themselves aren't the same FTP server software from what I can tell. One is Microsoft FTP, the other I'm uncertain on but is definitely not Microsoft. Any idea what could cause an FTP client to timeout when waiting for a LIST response on an empty directory? The visible responses from the FTP server appear to be the same, but is there a difference in how LIST responds for an empty directory that I'm unaware of? This problem is consistent on these two servers. Everything functions fine on directories with files or subdirectories within it, but not when empty. Any thoughts or directions would be appreciated. Thanks! Eric Sipple
0
57,202
09/11/2008 17:54:09
730
08/08/2008 12:40:04
222
33
How do I put a link to a webpage in a JScript Alert dialog box?
I would like to put a link to a webpage in an alert dialog box so that I can give a more detailed description of how to fix the error that makes the dialog box get created. How can I make the dialog box show something like this: There was an error. Go to this page to fix it. wwww.TheWebPageToFix.com Thanks.
javascript
alert
null
null
null
null
open
How do I put a link to a webpage in a JScript Alert dialog box? === I would like to put a link to a webpage in an alert dialog box so that I can give a more detailed description of how to fix the error that makes the dialog box get created. How can I make the dialog box show something like this: There was an error. Go to this page to fix it. wwww.TheWebPageToFix.com Thanks.
0
57,208
09/11/2008 17:57:50
3,012
08/26/2008 11:55:24
240
9
ToolStrips in TabPages frequently disappear from Windows Forms designer
I have a Windows Form app with a TabControl. One of the TabPages in the TabControl contains a ToolStrip. Frequently, the Windows Form designer will spontaneously set the Visible property of the Toolstrip to False. To get the toolstrip to reappear in my form, I have to manually find the control and set the property back to True. It's really annoying. Does anyone know why this happens, or how to stop it? I've tried setting the minimum height of the control to a non-zero value, but that has no effect. I'm using VS2008, VB.NET and the .Net framework 2.0, however I've struggled with this problem in VS2005 too, in several different applications.
vb.net
winforms
visual-studio
null
null
null
open
ToolStrips in TabPages frequently disappear from Windows Forms designer === I have a Windows Form app with a TabControl. One of the TabPages in the TabControl contains a ToolStrip. Frequently, the Windows Form designer will spontaneously set the Visible property of the Toolstrip to False. To get the toolstrip to reappear in my form, I have to manually find the control and set the property back to True. It's really annoying. Does anyone know why this happens, or how to stop it? I've tried setting the minimum height of the control to a non-zero value, but that has no effect. I'm using VS2008, VB.NET and the .Net framework 2.0, however I've struggled with this problem in VS2005 too, in several different applications.
0
57,238
09/11/2008 18:09:39
5,261
09/08/2008 18:44:40
125
13
Find Missing Javascript Includes in Website
Say I have several JavaScript includes in a page: <script type="text/javascript" src="/js/script0.js"></script> <script type="text/javascript" src="/js/script1.js"></script> <script type="text/javascript" src="/js/script2.js"></script> <script type="text/javascript" src="/js/script3.js"></script> <script type="text/javascript" src="/js/script4.js"></script> Is there a way i can tell if any of those weren't found (404) without having to manually check each one? I guess i'm looking for an online tool or something similar. Any ideas?
javascript
include
null
null
null
null
open
Find Missing Javascript Includes in Website === Say I have several JavaScript includes in a page: <script type="text/javascript" src="/js/script0.js"></script> <script type="text/javascript" src="/js/script1.js"></script> <script type="text/javascript" src="/js/script2.js"></script> <script type="text/javascript" src="/js/script3.js"></script> <script type="text/javascript" src="/js/script4.js"></script> Is there a way i can tell if any of those weren't found (404) without having to manually check each one? I guess i'm looking for an online tool or something similar. Any ideas?
0
57,243
09/11/2008 18:11:28
5,255
09/08/2008 18:00:10
11
1
Finding missing emails in SQL Server
I am trying to do something I've done a million times and it's not working, can anyone tell me why? I have a table for people who sent in resumes, and it has their email address in it... I want to find out if any of these people have NOT signed up on the web site. The aspnet_Membership table has all the people who ARE signed up on the web site. There are 9472 job seekers, with unique email addresses. This query produces 1793 results: select j.email from jobseeker j join aspnet_Membership m on j.email = m.email This suggests that there should be 7679 (9472-1793) emails of people who are not signed up on the web site. Since 1793 of them DID match, I would expect the rest of them DON'T match... but when I do the query for that, I get nothing! Why is this query giving me nothing??? select j.email from jobseeker j where j.email not in (select email from aspnet_Membership) I don't know how that could be not working - it basically says "show me all the emails which are IN the jobseeker table, but NOT IN the aspnet_Membership table...
sql
join
anti-join
null
null
null
open
Finding missing emails in SQL Server === I am trying to do something I've done a million times and it's not working, can anyone tell me why? I have a table for people who sent in resumes, and it has their email address in it... I want to find out if any of these people have NOT signed up on the web site. The aspnet_Membership table has all the people who ARE signed up on the web site. There are 9472 job seekers, with unique email addresses. This query produces 1793 results: select j.email from jobseeker j join aspnet_Membership m on j.email = m.email This suggests that there should be 7679 (9472-1793) emails of people who are not signed up on the web site. Since 1793 of them DID match, I would expect the rest of them DON'T match... but when I do the query for that, I get nothing! Why is this query giving me nothing??? select j.email from jobseeker j where j.email not in (select email from aspnet_Membership) I don't know how that could be not working - it basically says "show me all the emails which are IN the jobseeker table, but NOT IN the aspnet_Membership table...
0