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
61,517
09/14/2008 18:00:43
2,148
08/20/2008 15:20:13
459
25
Python dictionary from an object's fields
Do you know if there is a built-in function to build a dictionary from an arbitrary object? I'd like to do something like this: >>> class Foo: ... bar = 'hello' ... baz = 'world' ... >>> f = Foo() >>> props(f) { 'bar' : 'hello', 'baz' : 'world' } Thanks
python
object
dictionary
properties
null
null
open
Python dictionary from an object's fields === Do you know if there is a built-in function to build a dictionary from an arbitrary object? I'd like to do something like this: >>> class Foo: ... bar = 'hello' ... baz = 'world' ... >>> f = Foo() >>> props(f) { 'bar' : 'hello', 'baz' : 'world' } Thanks
0
61,520
09/14/2008 18:04:57
1,574
08/16/2008 19:31:12
832
37
What are the pros and cons of object databases?
There is a lot of information out there on object-relational mappers and how to best avoid impedance mismatch, all of which seem to be moot points if one were to use an object database. My question is why isn't this used more frequently? Is it because of performance reasons or because object databases cause your data to become proprietary to your application or is it due to something else?
database
null
null
null
null
null
open
What are the pros and cons of object databases? === There is a lot of information out there on object-relational mappers and how to best avoid impedance mismatch, all of which seem to be moot points if one were to use an object database. My question is why isn't this used more frequently? Is it because of performance reasons or because object databases cause your data to become proprietary to your application or is it due to something else?
0
61,524
09/14/2008 18:09:36
3,153
08/27/2008 02:45:05
1,264
49
Testing network interrupts in software
I have a network C++ program in Windows that I'd like to test for network disconnects at various times. What are my options? Currently I am: 1. Actually disconnecting the network wire from the back of my computer 2. using ipconfig /release 3. Using the [cports][1] program to close out the socket completely None of these methods though are ideal for me, and I'd like to emulate network problems more easily. I would like for sometimes connects to fail, sometimes socket reads to fail, and sometimes socket writes to fail. It would be great if there was some utility I could use to emulate these types of problems. It would also be nice to be able to build some automated unit tests while this emulated bad network is up. [1]: http://www.nirsoft.net/utils/cports.html
c++
windows
testing
networking
network-programming
null
open
Testing network interrupts in software === I have a network C++ program in Windows that I'd like to test for network disconnects at various times. What are my options? Currently I am: 1. Actually disconnecting the network wire from the back of my computer 2. using ipconfig /release 3. Using the [cports][1] program to close out the socket completely None of these methods though are ideal for me, and I'd like to emulate network problems more easily. I would like for sometimes connects to fail, sometimes socket reads to fail, and sometimes socket writes to fail. It would be great if there was some utility I could use to emulate these types of problems. It would also be nice to be able to build some automated unit tests while this emulated bad network is up. [1]: http://www.nirsoft.net/utils/cports.html
0
61,532
09/14/2008 18:21:38
6,357
09/14/2008 18:21:38
1
0
Tips for hiring good testers?
We're looking to add a few good testers (err "qa engineers") to our team. It's been my experience in the past that the "10-1" rule for developers (good devs are 10 times more productive than mediocre devs) is even more prevalent for testers. Most testers I've worked with found a decent amount of issues, but there's a few stand-out testers that I've worked with that could rip applications apart and make the dev team cry. So the question is -- how do you find these rockstar testers? The web is full of exams and tips to separate out the great from mediocre developers, but whats the magic interview questions and tests to find the amazing testers? We're about to start the second round of interviewing with the people that have passed the phone screen (aka idiot test) and any suggestions you have for this challenge greatly appreciated.
testing
qa
hiring
hr
null
null
open
Tips for hiring good testers? === We're looking to add a few good testers (err "qa engineers") to our team. It's been my experience in the past that the "10-1" rule for developers (good devs are 10 times more productive than mediocre devs) is even more prevalent for testers. Most testers I've worked with found a decent amount of issues, but there's a few stand-out testers that I've worked with that could rip applications apart and make the dev team cry. So the question is -- how do you find these rockstar testers? The web is full of exams and tips to separate out the great from mediocre developers, but whats the magic interview questions and tests to find the amazing testers? We're about to start the second round of interviewing with the people that have passed the phone screen (aka idiot test) and any suggestions you have for this challenge greatly appreciated.
0
61,535
09/14/2008 18:32:37
6,305
09/13/2008 21:33:24
81
3
How To Discover RSS Feeds for a given URL
I get a URL from a user. I need to know:<br/> a) is the URL a valid RSS feed?<br/> b) if not is there a valid feed associated with that URL using PHP/Javascript or something similar (Ex. http://techcrunch.com fails a), but b) would return their RSS feed)
php
rss
atom
feeds
discover
null
open
How To Discover RSS Feeds for a given URL === I get a URL from a user. I need to know:<br/> a) is the URL a valid RSS feed?<br/> b) if not is there a valid feed associated with that URL using PHP/Javascript or something similar (Ex. http://techcrunch.com fails a), but b) would return their RSS feed)
0
61,552
09/14/2008 18:54:32
811
08/09/2008 03:53:10
2,216
86
Are there legitimate uses for JavaScript's "with" statement?
[Alan Storm's comments][1] in response to my answer regarding the [`with` statement][2] got me thinking. I've seldom found reason to use this particular language feature, and had never given much thought to how it might cause trouble. Now, i'm curious as to how i might make effective use of `with`, while avoiding its pitfalls... So my question is, where have you found the `with` statement useful? [1]: http://beta.stackoverflow.com/questions/61088/hidden-features-of-javascript#61118 [2]: http://developer.mozilla.org/index.php?title=En/Core_JavaScript_1.5_Reference/Statements/With
javascript
best-practices
language-features
null
null
null
open
Are there legitimate uses for JavaScript's "with" statement? === [Alan Storm's comments][1] in response to my answer regarding the [`with` statement][2] got me thinking. I've seldom found reason to use this particular language feature, and had never given much thought to how it might cause trouble. Now, i'm curious as to how i might make effective use of `with`, while avoiding its pitfalls... So my question is, where have you found the `with` statement useful? [1]: http://beta.stackoverflow.com/questions/61088/hidden-features-of-javascript#61118 [2]: http://developer.mozilla.org/index.php?title=En/Core_JavaScript_1.5_Reference/Statements/With
0
61,556
09/14/2008 18:58:51
6,361
09/14/2008 18:58:50
1
0
Spell Checking Service with python using mod_python
What is the best available method for developing a spell check engine (for example, with aspell_python), that works with apache mod_python ? apache 2.0.59+RHEL4+mod_python+aspell_python seems to crash. Any alternative to using aspell_python ?
spellchecking
aspell
mod-python
null
null
null
open
Spell Checking Service with python using mod_python === What is the best available method for developing a spell check engine (for example, with aspell_python), that works with apache mod_python ? apache 2.0.59+RHEL4+mod_python+aspell_python seems to crash. Any alternative to using aspell_python ?
0
61,559
09/14/2008 19:00:24
2,077
08/20/2008 07:26:21
376
8
Is c# (with .Net/Mono) or Java the better cross-platform language?
I lack the overview over both alternatives but I have pretty much freedom of choice for my next project. I'm looking for hard technical facts in the areas of - performance (for example, I'm told Java is good for threading, and I hear the runtime code optimization has become very good recently for .Net) - <i>real world</i> portability (it's both meant to be portable, what's Catch 22 for each?) - tool availability (CI, build automation, debugging, IDE) I am especially looking for what you actually experienced in your own work rather than the things I could google. My application would be a backend service processing large amounts of data from time series. My main target platform would be Linux.
mono
java
crossplatform
null
null
null
open
Is c# (with .Net/Mono) or Java the better cross-platform language? === I lack the overview over both alternatives but I have pretty much freedom of choice for my next project. I'm looking for hard technical facts in the areas of - performance (for example, I'm told Java is good for threading, and I hear the runtime code optimization has become very good recently for .Net) - <i>real world</i> portability (it's both meant to be portable, what's Catch 22 for each?) - tool availability (CI, build automation, debugging, IDE) I am especially looking for what you actually experienced in your own work rather than the things I could google. My application would be a backend service processing large amounts of data from time series. My main target platform would be Linux.
0
61,604
09/14/2008 20:13:51
6,309
09/13/2008 22:22:33
1
0
api documentation and "value limits": do they match ?
Do you often see in API documentation (as in 'javadoc of public functions' for example) the description of "value limits" as well as the classic documentation ? Note: I am not talking about [comments within the code][1] By "value limits", I mean: - does a parameter can support a null value (or an empty String, or...) ? - does a 'return value' can be null or is guaranteed to never be null (or can be "empty", or...) ? Sample: What I often see (without having access to source code) is: /** * Get all readers name for this current Report. <br /> * <b>Warning</b>The Report must have been published first. * @param aReaderNameRegexp filter in order to return only reader matching the regexp * @return array of reader names */ String[] getReaderNames(final String aReaderNameRegexp); What I *like to see* would be: /** * Get all readers name for this current Report. <br /> * <b>Warning</b>The Report must have been published first. * @param aReaderNameRegexp filter in order to return only reader matching the regexp * (can be null or empty) * @return array of reader names * (null if Report has not yet been published, * empty array if no reader match criteria, * reader names array matching regexp, or all readers if regexp is null or empty) */ String[] getReaderNames(final String aReaderNameRegexp); My point is: When I use a library with a getReaderNames() function in it, I often do not even need to read the API documentation to guess what it does. But I need to be sure ***how to use it***. My only concern when I want to use this function is: what should I expect in term of parameters and return values ? That is all I need to know to safely setup my parameters and safely test the return value, yet I almost never see that kind of information in API documentation... What do you think ? value limits and API, do they belong together or not ? [1]: http://stackoverflow.com/questions/20922/do-you-comment-your-code
language-agnostic
documentation
comments
null
null
null
open
api documentation and "value limits": do they match ? === Do you often see in API documentation (as in 'javadoc of public functions' for example) the description of "value limits" as well as the classic documentation ? Note: I am not talking about [comments within the code][1] By "value limits", I mean: - does a parameter can support a null value (or an empty String, or...) ? - does a 'return value' can be null or is guaranteed to never be null (or can be "empty", or...) ? Sample: What I often see (without having access to source code) is: /** * Get all readers name for this current Report. <br /> * <b>Warning</b>The Report must have been published first. * @param aReaderNameRegexp filter in order to return only reader matching the regexp * @return array of reader names */ String[] getReaderNames(final String aReaderNameRegexp); What I *like to see* would be: /** * Get all readers name for this current Report. <br /> * <b>Warning</b>The Report must have been published first. * @param aReaderNameRegexp filter in order to return only reader matching the regexp * (can be null or empty) * @return array of reader names * (null if Report has not yet been published, * empty array if no reader match criteria, * reader names array matching regexp, or all readers if regexp is null or empty) */ String[] getReaderNames(final String aReaderNameRegexp); My point is: When I use a library with a getReaderNames() function in it, I often do not even need to read the API documentation to guess what it does. But I need to be sure ***how to use it***. My only concern when I want to use this function is: what should I expect in term of parameters and return values ? That is all I need to know to safely setup my parameters and safely test the return value, yet I almost never see that kind of information in API documentation... What do you think ? value limits and API, do they belong together or not ? [1]: http://stackoverflow.com/questions/20922/do-you-comment-your-code
0
61,605
09/14/2008 20:15:19
4,883
09/06/2008 10:24:59
934
9
Is it pythonic for a function to return multiple values?
In python, you can have a function return multiple values. Here's a contrived example: def divide(x, y): quotient = x/y remainder = x % y return quotient, remainder (q, r) = divide(22, 7) This seems very useful, but it looks like it can also be abused ("Well..function X already computes what we need as an intermediate value. Let's have X return that value also"). When should you draw the line and define a different method?
python
null
null
null
null
null
open
Is it pythonic for a function to return multiple values? === In python, you can have a function return multiple values. Here's a contrived example: def divide(x, y): quotient = x/y remainder = x % y return quotient, remainder (q, r) = divide(22, 7) This seems very useful, but it looks like it can also be abused ("Well..function X already computes what we need as an intermediate value. Let's have X return that value also"). When should you draw the line and define a different method?
0
61,615
09/14/2008 20:28:43
4,926
09/06/2008 18:01:11
1,375
61
Should you use international identifiers in Java/C#?
C# and Java allow almost any character in class names, method names, local variables, etc.. Is it bad practice to use non-ASCII characters, testing the boundaries of poor editors and analysis tools and making it difficult for some people to read, or is American arrogance the only argument against?
c#
java
coding-style
null
null
null
open
Should you use international identifiers in Java/C#? === C# and Java allow almost any character in class names, method names, local variables, etc.. Is it bad practice to use non-ASCII characters, testing the boundaries of poor editors and analysis tools and making it difficult for some people to read, or is American arrogance the only argument against?
0
61,622
09/14/2008 20:37:13
886
08/10/2008 07:46:39
140
10
NHibernate and shared web hosting
Has anyone been able to get an NHibernate-based project up and running on a shared web host? NHibernate does a whole lot of fancy stuff with reflection behind the scenes but the host that I'm using at the moment only allows applications to run in medium trust, which limits what you can do with reflection, and it's throwing up all sorts of security permission errors. This is the case even though I'm only using public properties in my mapping files, though I do have some classes defined as proxies. Which companies offer decent (and reasonably priced) web hosting that allows NHibernate to run without complaining?
security
nhibernate
web-hosting
null
null
null
open
NHibernate and shared web hosting === Has anyone been able to get an NHibernate-based project up and running on a shared web host? NHibernate does a whole lot of fancy stuff with reflection behind the scenes but the host that I'm using at the moment only allows applications to run in medium trust, which limits what you can do with reflection, and it's throwing up all sorts of security permission errors. This is the case even though I'm only using public properties in my mapping files, though I do have some classes defined as proxies. Which companies offer decent (and reasonably priced) web hosting that allows NHibernate to run without complaining?
0
61,634
09/14/2008 20:46:20
1,467
08/15/2008 17:35:39
229
18
Windows API Dialogs without using resource files
I'm trying to create a dialog box using C++ and the windows API, but I don't want the dialog defined in a resource file. I can't find anything good on this on the web, none of the examples I've read seem to define the dialog programmatically. Anyone know how to do this? A simple example is fine, I'm not doing anything complicated with it yet.
c++
winapi
dialog
windows-api
null
null
open
Windows API Dialogs without using resource files === I'm trying to create a dialog box using C++ and the windows API, but I don't want the dialog defined in a resource file. I can't find anything good on this on the web, none of the examples I've read seem to define the dialog programmatically. Anyone know how to do this? A simple example is fine, I'm not doing anything complicated with it yet.
0
61,635
09/14/2008 20:52:39
1,615
08/17/2008 15:19:59
71
1
"Beautifying" an OS X disk image
When I downloaded Skype, I noticed that, in place of a normal "disk image" icon, there was a custom icon, and when I double clicked on the icon, the window used a colorful image as the background, prompting me to drag the skype icon into the applications folder. How can I do that with my applications? Thanks, Jason
osx
diskimage
skype
icon
null
null
open
"Beautifying" an OS X disk image === When I downloaded Skype, I noticed that, in place of a normal "disk image" icon, there was a custom icon, and when I double clicked on the icon, the window used a colorful image as the background, prompting me to drag the skype icon into the applications folder. How can I do that with my applications? Thanks, Jason
0
61,638
09/14/2008 20:55:37
230
08/03/2008 19:32:46
657
38
Killer DateTime Utility for ASP.net
I was wondering if anyone could suggest a utility library that has useful functions for handling dates in ASP.NET easily taking away some of the leg work you normally have to do when handling dates? Subsonic Sugar has some really nice functions: http://subsonichelp.com/html/1413bafa-b5aa-99aa-0478-10875abe82ec.htm http://subsonicproject.googlecode.com/svn/trunk/SubSonic/Sugar/ Is there anything better out there?
asp.net
date
null
null
null
null
open
Killer DateTime Utility for ASP.net === I was wondering if anyone could suggest a utility library that has useful functions for handling dates in ASP.NET easily taking away some of the leg work you normally have to do when handling dates? Subsonic Sugar has some really nice functions: http://subsonichelp.com/html/1413bafa-b5aa-99aa-0478-10875abe82ec.htm http://subsonicproject.googlecode.com/svn/trunk/SubSonic/Sugar/ Is there anything better out there?
0
61,669
09/14/2008 21:41:54
6,266
09/13/2008 12:51:36
194
14
Profiling in Visual Studio 2008 PRO
How do I use the profiler in Visual Studio 2008? I know theres a build option in Config Properties -> Linker -> Advanced -> Profile (/PROFILE), however I can't find anything about actauly using it, only articles I was able to find appear to only apply to older versions of Visual Studio (eg most say to goto Build->Profile to bring up the profile dialog box, yet in 2008 there is no such menu item). Is this because Visual Studio 2008 does not include a profiler, and if it does where is it and where is the documentation for it?
c++
visual-studio
vs2008
profiling
null
null
open
Profiling in Visual Studio 2008 PRO === How do I use the profiler in Visual Studio 2008? I know theres a build option in Config Properties -> Linker -> Advanced -> Profile (/PROFILE), however I can't find anything about actauly using it, only articles I was able to find appear to only apply to older versions of Visual Studio (eg most say to goto Build->Profile to bring up the profile dialog box, yet in 2008 there is no such menu item). Is this because Visual Studio 2008 does not include a profiler, and if it does where is it and where is the documentation for it?
0
61,675
09/14/2008 21:53:57
3,796
08/30/2008 21:50:13
13
3
Recovering from a broken TCP socket in Ruby when in gets()
I'm reading lines of input on a TCP socket, similar to this: class Bla def getcmd @sock.gets unless @sock.closed? end def start srv = TCPServer.new(5000) @sock = srv.accept while ! @sock.closed? ans = getcmd end end end If the endpoint terminates the connection while getline() is running then gets() hangs. How can I work around this? Is it necessary to do non-blocking or timed I/O?
ruby
tcp
socket
gets
null
null
open
Recovering from a broken TCP socket in Ruby when in gets() === I'm reading lines of input on a TCP socket, similar to this: class Bla def getcmd @sock.gets unless @sock.closed? end def start srv = TCPServer.new(5000) @sock = srv.accept while ! @sock.closed? ans = getcmd end end end If the endpoint terminates the connection while getline() is running then gets() hangs. How can I work around this? Is it necessary to do non-blocking or timed I/O?
0
61,677
09/14/2008 21:57:32
5,449
09/09/2008 17:03:59
41
3
Expose an event handler to VBScript users of my COM object
Suppose I have a COM object which users can access via a call such as: Set s = CreateObject("Server") What I'd like to be able to do is allow the user to specify an event handler for the object, like so: Function ServerEvent MsgBox "Event handled" End Function s.OnDoSomething = ServerEvent Is this possible and, if so, how do I expose this in my type library in C++ (specifically BCB 2007)?
com
vbscript
bcb
null
null
null
open
Expose an event handler to VBScript users of my COM object === Suppose I have a COM object which users can access via a call such as: Set s = CreateObject("Server") What I'd like to be able to do is allow the user to specify an event handler for the object, like so: Function ServerEvent MsgBox "Event handled" End Function s.OnDoSomething = ServerEvent Is this possible and, if so, how do I expose this in my type library in C++ (specifically BCB 2007)?
0
61,680
09/14/2008 22:08:02
396
08/05/2008 12:46:44
440
12
How to work around a very large 2d array in C++
I need to create a 2D int array of size 800x800. But doing so creates a stack overflow (ha ha). I'm new to C++, so should I do something like a vector of vectors? And just encapsulate the 2d array into a class? Specifically, this array is my zbuffer in a graphics program. I need to store a z value for every pixel on the screen (hence the large size of 800x800). Thanks!
c++
graphics
2darray
vectors
zbuffer
null
open
How to work around a very large 2d array in C++ === I need to create a 2D int array of size 800x800. But doing so creates a stack overflow (ha ha). I'm new to C++, so should I do something like a vector of vectors? And just encapsulate the 2d array into a class? Specifically, this array is my zbuffer in a graphics program. I need to store a z value for every pixel on the screen (hence the large size of 800x800). Thanks!
0
61,688
09/14/2008 22:16:05
2,649
08/23/2008 22:57:29
38
3
Stopping keystrokes being lost in a web application
My current project is to write a web application that is an equivalent of an existing desktop application. In the desktop app at certain points in the workflow the user might click on a button and then be shown a form to fill in. Even if it takes a little time for the app to display the form, expert users know what the form will be and will start typing, knowing that the app will "catch up with them". In a web application this doesn't happen: when the user clicks a link their keystrokes are then lost until the form on the following page is dispayed. Does anyone have any tricks for preventing this? Do I have to move away from using separate pages and use AJAX to embed the form in the page using something like [GWT][1], or will that still have the problem of lost keystrokes? [1]: http://code.google.com/webtoolkit/
javascript
gwt
null
null
null
null
open
Stopping keystrokes being lost in a web application === My current project is to write a web application that is an equivalent of an existing desktop application. In the desktop app at certain points in the workflow the user might click on a button and then be shown a form to fill in. Even if it takes a little time for the app to display the form, expert users know what the form will be and will start typing, knowing that the app will "catch up with them". In a web application this doesn't happen: when the user clicks a link their keystrokes are then lost until the form on the following page is dispayed. Does anyone have any tricks for preventing this? Do I have to move away from using separate pages and use AJAX to embed the form in the page using something like [GWT][1], or will that still have the problem of lost keystrokes? [1]: http://code.google.com/webtoolkit/
0
61,691
09/14/2008 22:25:46
4,050
09/01/2008 14:24:01
329
31
How to add uninstall option in .NET Setup Project?
The .NET Setup project seems to have a lot of options, but I don't see an "Uninstall" option. I'd prefer if people could "uninstall" from the standard "start menu" folder rather than send them to the control panel to uninstall my app, so can someone please tell me how to do this? Also, I am aware of non Microsoft installers that have this feature, but if possible I'd like to stay with the Microsoft toolkit.
.net
installer
setup
uninstall
null
null
open
How to add uninstall option in .NET Setup Project? === The .NET Setup project seems to have a lot of options, but I don't see an "Uninstall" option. I'd prefer if people could "uninstall" from the standard "start menu" folder rather than send them to the control panel to uninstall my app, so can someone please tell me how to do this? Also, I am aware of non Microsoft installers that have this feature, but if possible I'd like to stay with the Microsoft toolkit.
0
61,692
09/14/2008 22:28:03
1,849
08/18/2008 21:46:57
20
4
How do I get my Java application to shutdown nicely in windows?
I have a Java application which I want to shutdown 'nicely' when the user selects Start->Shutdown. I've tried using JVM shutdown listeners via Runtime.addShutdownHook(...) but this doesn't work as I can't use any UI elements from it. I've also tried using the exit handler on my main application UI window but it has no way to pause or halt shutdown as far as I can tell. How can I handle shutdown nicely?
java
windows
shutdown
null
null
null
open
How do I get my Java application to shutdown nicely in windows? === I have a Java application which I want to shutdown 'nicely' when the user selects Start->Shutdown. I've tried using JVM shutdown listeners via Runtime.addShutdownHook(...) but this doesn't work as I can't use any UI elements from it. I've also tried using the exit handler on my main application UI window but it has no way to pause or halt shutdown as far as I can tell. How can I handle shutdown nicely?
0
61,699
09/14/2008 22:39:04
5,302
09/08/2008 22:49:47
91
10
Adding assemblies to the GAC
Until recently we were using Inno Setup for our installations, something I would like to continue doing, unless we can get an [uninstall option in the start menu][1] (thanks Giovanni Galbo), however we now need to GAC some external libraries, something I suspect is only doable (or at least only supported) though the .NET Setup Project. Is it possible to call a GAC'ing library from another setup application? [1]: http://stackoverflow.com/questions/61691/how-to-add-uninstall-option-in-net-setup-project
installer
setup
uninstall
gac
null
null
open
Adding assemblies to the GAC === Until recently we were using Inno Setup for our installations, something I would like to continue doing, unless we can get an [uninstall option in the start menu][1] (thanks Giovanni Galbo), however we now need to GAC some external libraries, something I suspect is only doable (or at least only supported) though the .NET Setup Project. Is it possible to call a GAC'ing library from another setup application? [1]: http://stackoverflow.com/questions/61691/how-to-add-uninstall-option-in-net-setup-project
0
61,704
09/14/2008 22:46:13
4,321
09/02/2008 20:27:30
83
4
Switching editors in Eclipse with keyboard, rather than switching Design/Source
In Eclipse, I can switch through open editors using control-page up/down. This works great, except for editors like XML or JavaScript, where there are Design and Source tabs. For those editors, it just toggles between the different tabs. Is there any way to get Eclipse to ignore them? I know about alt-F6 for "Next Editor", but that doesn't use the same order that the editor tabs are displayed in, so it's confusing.
eclipse
null
null
null
null
null
open
Switching editors in Eclipse with keyboard, rather than switching Design/Source === In Eclipse, I can switch through open editors using control-page up/down. This works great, except for editors like XML or JavaScript, where there are Design and Source tabs. For those editors, it just toggles between the different tabs. Is there any way to get Eclipse to ignore them? I know about alt-F6 for "Next Editor", but that doesn't use the same order that the editor tabs are displayed in, so it's confusing.
0
61,705
09/14/2008 22:46:58
4,949
09/06/2008 23:35:41
101
10
Where to save high scores in an XNA game?
I'm making a simple 2 player game in XNA and started looking into saving the player's high scores. I want the game to work on the XBox 360 as well as Windows, so I have to use the framework to save the data. It seems that you save data to a particular user's gamer tag - so my question is, what to do with high scores? * Save the user's own scores in their profile? (So you can only see your own scores if you're the only one signed in) * Try and save other player's scores in all profiles? (Seems like a pain to try and keep this sync'd) * Store scores online * The 360 seems to have a standard method for showing friend's high scores. Can this be accessed from within XNA, or is it only available to published games? * Roll my own. (Seems excessive for such a small personal project.)
xna
data-storage
xbox
null
null
null
open
Where to save high scores in an XNA game? === I'm making a simple 2 player game in XNA and started looking into saving the player's high scores. I want the game to work on the XBox 360 as well as Windows, so I have to use the framework to save the data. It seems that you save data to a particular user's gamer tag - so my question is, what to do with high scores? * Save the user's own scores in their profile? (So you can only see your own scores if you're the only one signed in) * Try and save other player's scores in all profiles? (Seems like a pain to try and keep this sync'd) * Store scores online * The 360 seems to have a standard method for showing friend's high scores. Can this be accessed from within XNA, or is it only available to published games? * Roll my own. (Seems excessive for such a small personal project.)
0
61,714
09/14/2008 23:09:25
1,849
08/18/2008 21:46:57
48
6
How to capturing crash logs in Java
I'm working on a cross platform application in Java which currently works nicely on Windows, Linux and MacOS X. I'm trying to work out a nice way to do detection (and handling) of 'crashes'. Is there an easy, cross-platform way to detect 'crashes' in Java and to do something in response? I guess by 'crashes' I mean uncaught exceptions. However the code does use some JNI so it'd be nice to be able to catch crashes from bad JNI code, but I have a feeling that's JVM specific.
java
error-handling
crash
null
null
null
open
How to capturing crash logs in Java === I'm working on a cross platform application in Java which currently works nicely on Windows, Linux and MacOS X. I'm trying to work out a nice way to do detection (and handling) of 'crashes'. Is there an easy, cross-platform way to detect 'crashes' in Java and to do something in response? I guess by 'crashes' I mean uncaught exceptions. However the code does use some JNI so it'd be nice to be able to catch crashes from bad JNI code, but I have a feeling that's JVM specific.
0
61,718
09/14/2008 23:25:02
6,369
09/14/2008 23:13:34
1
0
Database integration tests
When you are doing integration tests with either just your data access layer or the majority of the application stack. What is the best way prevent multiple tests from clashing with each other if they are run on the same database?
tdd
integration-testing
null
null
null
null
open
Database integration tests === When you are doing integration tests with either just your data access layer or the majority of the application stack. What is the best way prevent multiple tests from clashing with each other if they are run on the same database?
0
61,739
09/14/2008 23:59:04
3,655
08/29/2008 17:52:25
219
20
How to determine the size of the button portion of a Windows radio button
I'm drawing old school (unthemed - themed radios are a whole other problem) radio buttons myself using DrawFrameControl: DrawFrameControl(dc, &rectRadio, DFC_BUTTON, isChecked() ? DFCS_BUTTONRADIO | DFCS_CHECKED : DFCS_BUTTONRADIO); I've never been able to figure out a sure fire way to figure out what to pass for the RECT. I've been using a 12x12 rectangle but I'de like Windows to tell me the size of a radio button. DrawFrameControl seems to scale the radio button to fit the rect I pass so I have to be close to the "right" size of the radio looks off from other (non-owner drawn) radios on the screen. Anyone know how to do this?
windows
gui
winapi
gdi
null
null
open
How to determine the size of the button portion of a Windows radio button === I'm drawing old school (unthemed - themed radios are a whole other problem) radio buttons myself using DrawFrameControl: DrawFrameControl(dc, &rectRadio, DFC_BUTTON, isChecked() ? DFCS_BUTTONRADIO | DFCS_CHECKED : DFCS_BUTTONRADIO); I've never been able to figure out a sure fire way to figure out what to pass for the RECT. I've been using a 12x12 rectangle but I'de like Windows to tell me the size of a radio button. DrawFrameControl seems to scale the radio button to fit the rect I pass so I have to be close to the "right" size of the radio looks off from other (non-owner drawn) radios on the screen. Anyone know how to do this?
0
61,747
09/15/2008 00:14:10
6,371
09/14/2008 23:41:29
1
0
Installing PDO-drivers for PostgreSQL on Mac (using Zend for eclipse)
How can I get PDO to work on my mac (os x 10.5)? I'm using the built in php and php in Zend/Eclipse. Can't seem to find useful drivers for it at all.
eclipse
osx
postgresql
zend
pdo
null
open
Installing PDO-drivers for PostgreSQL on Mac (using Zend for eclipse) === How can I get PDO to work on my mac (os x 10.5)? I'm using the built in php and php in Zend/Eclipse. Can't seem to find useful drivers for it at all.
0
61,750
09/15/2008 00:22:47
1,196
08/13/2008 12:33:04
3,968
271
How to implement database engine independent paging?
Task: implement paging of database records suitable for different RDBMS. Method should work for mainstream engines - MSSQL2000+, Oracle, MySql, etc. Please don't post RDBMS specific solutions, I know how to implement this for most of the modern database engines. I'm looking for the universal solution. Only temporary based solutions come to my mind at the moment.
database
paging
null
null
null
null
open
How to implement database engine independent paging? === Task: implement paging of database records suitable for different RDBMS. Method should work for mainstream engines - MSSQL2000+, Oracle, MySql, etc. Please don't post RDBMS specific solutions, I know how to implement this for most of the modern database engines. I'm looking for the universal solution. Only temporary based solutions come to my mind at the moment.
0
61,760
09/15/2008 00:36:50
2,017
08/19/2008 20:01:30
199
19
Browser WYSIWYG best practices.
I am using a rich text editor on a web page. .NET has feature that prevent one from posting HTML tags, so I added a JavaScript snippet to change the angle brackets to and alias pair of characters before the post. The alias is replaced on the server with the necessary angle bracket and then stored in the database. With XSS aside, what are common ways of fixing this problem. (i.e. Is there a better way?) If you have comments on XSS(cross-site scripting), I'm sure that will help someone.
asp.net
javascript
wysiwyg
null
null
null
open
Browser WYSIWYG best practices. === I am using a rich text editor on a web page. .NET has feature that prevent one from posting HTML tags, so I added a JavaScript snippet to change the angle brackets to and alias pair of characters before the post. The alias is replaced on the server with the necessary angle bracket and then stored in the database. With XSS aside, what are common ways of fixing this problem. (i.e. Is there a better way?) If you have comments on XSS(cross-site scripting), I'm sure that will help someone.
0
61,763
09/15/2008 00:41:44
3,547
08/29/2008 04:44:20
86
9
Good Ruby on Rails File Manager?
Does anyone know of a good, open source, web-based file manager that is easy to integrate with Ruby on Rails?
ruby-on-rails
null
null
null
null
02/27/2012 16:11:54
not constructive
Good Ruby on Rails File Manager? === Does anyone know of a good, open source, web-based file manager that is easy to integrate with Ruby on Rails?
4
61,775
09/15/2008 01:14:22
5,642
09/10/2008 15:42:57
545
25
Replacing Virtual PC/Server with VMWare Fusion/Server for Development Environments
I develop exclusively on VMs. I currently run Boot Camp on a MacBook Pro and do all my development on a series of Virtual PC VMs for many different environments. This [post by Andrew Connell][1] litterally changed the way I work. I'm thinking about switching to Fusion and running everything in OS X but I wasn't able to answer the following questions about VM Fusion/Workstation/Server. **I need to know if the following features from Virtual PC/Server exist in their VMWare counter parts.** 1. Differencing Disks (ability to create a Base VM and provision new VMs which just add deltas on top of the base [saves a ton of disk space, and makes it easy to spin up new VMs with a base set of funcitonality]). 2. Undo disks (ability to rollback all changes to the VM within a session). 3. Easily NAT out a different subnet for the VM to sit in. 4. Share VMs between VM Player and VM Server. I'd like to build up a VM locally (on OS X/Fusion) and then move it to some server (Win2k3/Win2k8 and VM Server) and host it there but with VM Server. 5. An equivalent to Hyper-V. 6. Ability to Share disks between multiple VMs. If I have a bunch of databases on a virtual disk and want them to appear on more than one VM I should be able to just attach them. 7. (Nice to have) Support for multiple processors assigned to a VM . **Is there a VMWare guru out there who knows for sure that the above features are available on the other side?** **Also the above has been free (as long as you have licenses for Windows machines), besides buying Fusion are there any other costs?** [1]: http://www.andrewconnell.com/blog/articles/UseVirtualPCsDifferencingDisksToYourAdvantage.aspx
vmware
virtualization
virtual-pc
null
null
null
open
Replacing Virtual PC/Server with VMWare Fusion/Server for Development Environments === I develop exclusively on VMs. I currently run Boot Camp on a MacBook Pro and do all my development on a series of Virtual PC VMs for many different environments. This [post by Andrew Connell][1] litterally changed the way I work. I'm thinking about switching to Fusion and running everything in OS X but I wasn't able to answer the following questions about VM Fusion/Workstation/Server. **I need to know if the following features from Virtual PC/Server exist in their VMWare counter parts.** 1. Differencing Disks (ability to create a Base VM and provision new VMs which just add deltas on top of the base [saves a ton of disk space, and makes it easy to spin up new VMs with a base set of funcitonality]). 2. Undo disks (ability to rollback all changes to the VM within a session). 3. Easily NAT out a different subnet for the VM to sit in. 4. Share VMs between VM Player and VM Server. I'd like to build up a VM locally (on OS X/Fusion) and then move it to some server (Win2k3/Win2k8 and VM Server) and host it there but with VM Server. 5. An equivalent to Hyper-V. 6. Ability to Share disks between multiple VMs. If I have a bunch of databases on a virtual disk and want them to appear on more than one VM I should be able to just attach them. 7. (Nice to have) Support for multiple processors assigned to a VM . **Is there a VMWare guru out there who knows for sure that the above features are available on the other side?** **Also the above has been free (as long as you have licenses for Windows machines), besides buying Fusion are there any other costs?** [1]: http://www.andrewconnell.com/blog/articles/UseVirtualPCsDifferencingDisksToYourAdvantage.aspx
0
61,779
09/15/2008 01:34:04
1,915
08/19/2008 14:11:04
244
18
What technology(ies) and language(s) is Microsoft Navison implemented with/in?
Navision is also known as Microsoft Dynamics NAV.
technologies
null
null
null
null
null
open
What technology(ies) and language(s) is Microsoft Navison implemented with/in? === Navision is also known as Microsoft Dynamics NAV.
0
61,781
09/15/2008 01:41:31
2,908
08/25/2008 21:46:25
251
23
python cgi on IIS
How do you set up IIS so that you can call python scripts from asp pages? Ok, so I found the answer to that question here: <a href="http://support.microsoft.com/kb/276494">http://support.microsoft.com/kb/276494</a> So on to my next question: How do you call a cgi script from within classic asp (vb) code? Particularly one which is not in the web root directory.
vb
asp
python
cgi
null
null
open
python cgi on IIS === How do you set up IIS so that you can call python scripts from asp pages? Ok, so I found the answer to that question here: <a href="http://support.microsoft.com/kb/276494">http://support.microsoft.com/kb/276494</a> So on to my next question: How do you call a cgi script from within classic asp (vb) code? Particularly one which is not in the web root directory.
0
61,784
09/15/2008 01:56:25
5,291
09/08/2008 21:37:17
28
0
Has anyone attempted to make PHP's system functions more Object-Oriented?
I'm just curious if any project exists that attempts to group all (or most) of PHP's built-in functions into a more object-oriented class hierarchy. For example, grouping all the string functions into a single String class, etc. I realize this won't actually solve any problems, since all the built-in functions would still be accessible in the global namespace, but it would certainly make usability much easier.
php
null
null
null
null
null
open
Has anyone attempted to make PHP's system functions more Object-Oriented? === I'm just curious if any project exists that attempts to group all (or most) of PHP's built-in functions into a more object-oriented class hierarchy. For example, grouping all the string functions into a single String class, etc. I realize this won't actually solve any problems, since all the built-in functions would still be accessible in the global namespace, but it would certainly make usability much easier.
0
61,785
09/15/2008 01:57:10
4,337
09/02/2008 22:43:39
1,671
130
HardDisk.Dispose
What is the proper way to dispose an old hard disk (which might have contained sensitive information)? I was about to throw it away in the recycle box but thought better to check it with SO users first.
hardware
harddrive
null
null
null
null
open
HardDisk.Dispose === What is the proper way to dispose an old hard disk (which might have contained sensitive information)? I was about to throw it away in the recycle box but thought better to check it with SO users first.
0
61,795
09/15/2008 02:07:18
2,718
08/24/2008 17:08:10
104
10
Java profiler for IBM JVM 1.4.2 (WebSphere 6.0.2)
I'm looking for a Java profiler that works well with the JVM coming with WebSphere 6.0.2 (IBM JVM 1.4.2). I use yourkit for my usual profiling needs, but it specifically refuses to work with this old jvm (I'm sure the authors had their reasons...). Can anybody point to a decent profiler that can do the job? Not interested in a generic list of profilers, BTW, I've seen the other stackoverflow theread, but I'd rather not try them one by one. I would prefer a free version, if possible, since this is a one-off need (I hope!) and I would rather not pay for another profiler just for this.
java
websphere
profiler
null
null
null
open
Java profiler for IBM JVM 1.4.2 (WebSphere 6.0.2) === I'm looking for a Java profiler that works well with the JVM coming with WebSphere 6.0.2 (IBM JVM 1.4.2). I use yourkit for my usual profiling needs, but it specifically refuses to work with this old jvm (I'm sure the authors had their reasons...). Can anybody point to a decent profiler that can do the job? Not interested in a generic list of profilers, BTW, I've seen the other stackoverflow theread, but I'd rather not try them one by one. I would prefer a free version, if possible, since this is a one-off need (I hope!) and I would rather not pay for another profiler just for this.
0
61,796
09/15/2008 02:08:06
3,966
09/01/2008 03:51:27
3
2
Does Tiles for Struts2 support UTF-8 encoded templates?
If so what are required configuration elements to enable UTF-8 for tiles? I'm finding my tile results are sent as: Content-Type text/html;
java
internationalization
tiles
null
null
null
open
Does Tiles for Struts2 support UTF-8 encoded templates? === If so what are required configuration elements to enable UTF-8 for tiles? I'm finding my tile results are sent as: Content-Type text/html;
0
61,805
09/15/2008 02:25:56
364
08/05/2008 05:33:41
631
39
ASP.NET MVC ViewData (using indices) Question
I had a working solution using ASP.NET MVC Preview 3 (was upgraded from a Preview 2 solution) that uses an untyped ViewMasterPage like so: public partial class Home : ViewMasterPage On Home.Master there is a display statement like this: <%= ((GenericViewData)ViewData["Generic"]).Skin %> However, a developer on the team just changed the assembly references to Preview 4. Following this, the code will no longer populate ViewData with indexed values like the above. Instead, ViewData["Generic"] is null. As per [this question][1], ViewData.Eval("Generic") works, and ViewData.Model is also populated correctly. However, the reason this solution isn't using typed pages etc. is because it is kind of a legacy solution. As such, it is impractical to go through this fairly large solution and update all .aspx pages (especially as the compiler doesn't detect this sort of stuff). I have tried reverting the assemblies by removing the reference and then adding a reference to the Preview 3 assembly in the 'bin' folder of the project. This did not change anything. I have even tried reverting the Project file to an earlier version and that still did not seem to fix the problem. I have other solutions using the same technique that continue to work. Is there anything you can suggest as to why this has suddenly stopped working and how I might go about fixing it (any hint in the right direction would be appreciated)? Thanks in advance. [1]: http://stackoverflow.com/questions/18787/aspnet-mvc-user-control-viewdata
asp.net-mvc
null
null
null
null
null
open
ASP.NET MVC ViewData (using indices) Question === I had a working solution using ASP.NET MVC Preview 3 (was upgraded from a Preview 2 solution) that uses an untyped ViewMasterPage like so: public partial class Home : ViewMasterPage On Home.Master there is a display statement like this: <%= ((GenericViewData)ViewData["Generic"]).Skin %> However, a developer on the team just changed the assembly references to Preview 4. Following this, the code will no longer populate ViewData with indexed values like the above. Instead, ViewData["Generic"] is null. As per [this question][1], ViewData.Eval("Generic") works, and ViewData.Model is also populated correctly. However, the reason this solution isn't using typed pages etc. is because it is kind of a legacy solution. As such, it is impractical to go through this fairly large solution and update all .aspx pages (especially as the compiler doesn't detect this sort of stuff). I have tried reverting the assemblies by removing the reference and then adding a reference to the Preview 3 assembly in the 'bin' folder of the project. This did not change anything. I have even tried reverting the Project file to an earlier version and that still did not seem to fix the problem. I have other solutions using the same technique that continue to work. Is there anything you can suggest as to why this has suddenly stopped working and how I might go about fixing it (any hint in the right direction would be appreciated)? Thanks in advance. [1]: http://stackoverflow.com/questions/18787/aspnet-mvc-user-control-viewdata
0
61,817
09/15/2008 03:04:09
364
08/05/2008 05:33:41
631
40
What's the best method in ASP.NET to obtain the current domain?
I am wondering what the best way to obtain the current domain is in ASP.NET? For instance: http://www.domainname.com/subdir/ should yield http://www.domainname.com http://www.sub.domainname.com/subdir/ should yield http://sub.domainname.com As a guide, I should be able to add a url like "/Folder/Content/filename.html" (say as generated by Url.RouteUrl() in ASP.NET MVC) straight onto the URL and it should work.
asp.net
domain-name
null
null
null
null
open
What's the best method in ASP.NET to obtain the current domain? === I am wondering what the best way to obtain the current domain is in ASP.NET? For instance: http://www.domainname.com/subdir/ should yield http://www.domainname.com http://www.sub.domainname.com/subdir/ should yield http://sub.domainname.com As a guide, I should be able to add a url like "/Folder/Content/filename.html" (say as generated by Url.RouteUrl() in ASP.NET MVC) straight onto the URL and it should work.
0
61,826
09/15/2008 03:26:46
6,377
09/15/2008 03:26:46
1
0
What should I learn next after VB and C#
I am currently learning VB and C# and have been for the last two and a bit years but I would really like to broaden my programming skills a little bit. I was just wondering what people would recommend learning? I have looked into ruby a little bit but haven't really dug my teeth into it, I have also looked into F#. I can't really decide which way I should go.
vb.net
null
null
null
null
05/11/2012 11:53:35
not constructive
What should I learn next after VB and C# === I am currently learning VB and C# and have been for the last two and a bit years but I would really like to broaden my programming skills a little bit. I was just wondering what people would recommend learning? I have looked into ruby a little bit but haven't really dug my teeth into it, I have also looked into F#. I can't really decide which way I should go.
4
61,838
09/15/2008 03:51:30
6,044
09/12/2008 03:56:50
1
3
Do I need to release xib resources?
If I have something like a UILabel linked to a xib file, do I need to release it on dealloc of my view? The reason I ask is because I don't alloc it, which makes me think I don't need to release it either? eg (in the header): IBOutlet UILabel *lblExample; in the implementation: .... [lblExample setText:@"whatever"]; .... -(void)dealloc{ [lblExample release];//????????? }
iphone
null
null
null
null
null
open
Do I need to release xib resources? === If I have something like a UILabel linked to a xib file, do I need to release it on dealloc of my view? The reason I ask is because I don't alloc it, which makes me think I don't need to release it either? eg (in the header): IBOutlet UILabel *lblExample; in the implementation: .... [lblExample setText:@"whatever"]; .... -(void)dealloc{ [lblExample release];//????????? }
0
61,850
09/15/2008 04:07:11
4,140
09/02/2008 01:10:54
649
44
Is there a way to asynchronously filter an IList?
Ok, so there has to be a way to do this... no? If not I'd love some ideas. I have two repeaters and an image inside an update panel along with some AJAX dropdowns with link buttons to the left. I want to update the data inside the update panel as fast as possible as values are selected from the dropdowns. What do you think would be the best way to update the data? The repeaters are populated by objects, so if I could just filter the objects by some properties I could end up with the correct data. No new data from the server is needed. Anyone have some ideas?
c#
javascript
ajax
.net-3.5
null
null
open
Is there a way to asynchronously filter an IList? === Ok, so there has to be a way to do this... no? If not I'd love some ideas. I have two repeaters and an image inside an update panel along with some AJAX dropdowns with link buttons to the left. I want to update the data inside the update panel as fast as possible as values are selected from the dropdowns. What do you think would be the best way to update the data? The repeaters are populated by objects, so if I could just filter the objects by some properties I could end up with the correct data. No new data from the server is needed. Anyone have some ideas?
0
61,853
09/15/2008 04:24:55
6,276
09/13/2008 14:11:05
31
2
Anyone using WPF for real LOB applications?
Anyone using WPF for real LOB applications? We have all seen the clever demos of WPF showing videos mapped onto 3D elements. These look great but what about the real world of line-of-business applications that make up the majority of developers efforts. Is WPF just for nice eye candy?
.net
wpf
null
null
null
null
open
Anyone using WPF for real LOB applications? === Anyone using WPF for real LOB applications? We have all seen the clever demos of WPF showing videos mapped onto 3D elements. These look great but what about the real world of line-of-business applications that make up the majority of developers efforts. Is WPF just for nice eye candy?
0
61,861
09/15/2008 04:38:47
2,758
08/24/2008 22:12:45
142
11
Web Control Properties
I would like to make my web control more readable in design mode, basically I want the tag declaration to look like: <cc1:Ctrl ID="Value1" runat="server"> <Values>string value 1</Value> <Values>string value 2</Value> </cc1:Ctrl> Lets say I have a private variable in the code behind: List<string> values = new List<string>(); So how can I make my user control fill out the private variable with the values that are declared in the markup?
c#
asp.net
null
null
null
null
open
Web Control Properties === I would like to make my web control more readable in design mode, basically I want the tag declaration to look like: <cc1:Ctrl ID="Value1" runat="server"> <Values>string value 1</Value> <Values>string value 2</Value> </cc1:Ctrl> Lets say I have a private variable in the code behind: List<string> values = new List<string>(); So how can I make my user control fill out the private variable with the values that are declared in the markup?
0
61,863
09/15/2008 04:43:43
6,330
09/14/2008 07:37:48
1
1
Rosetta Stone - Sorting Arrays
I thought I would pose a question I'm describing as a "Rosetta Stone". That is to say, I am posing a question, and would like to see answers given for a number of different languages so that someone moving from one language to another can see how some typical operation is done. I have always found these types of comparisons to be very educational when moving into a new language, and a fun quick way to see differences between languages without having to use them heavily for a while. This particular question is, given an array of items in the typical collection appropriate to the language at hand, how do you sort them? Sample code with some description would be good. I'll present the Objective C answer: // Can only modify mutable arrays NSMutableArray *sortArray = [NSMutableArray arrayWithArray:myArrayOfStuff]; Sort NSString ignoring case: [sortArray sortUsingSelector: @selector(caseInsensitiveCompare:)]; Sort most foundation objects (would also work for NSString as well), assuming numbers are wrapped in NSNumber class: [sortArray sortUsingSelector:@selector(compare:)]; Sort instances of your own classes: [sortArray sortUsingSelector:@selector(myCompare:)]; For the last one, in your class you'd implement a comparison method like so: // Class instance method to compare self with object "obj" - (NSComparisonResult) myCompare:(myObject *)obj { NSComparisonResult retVal = NSSame; if ( self < obj ) // by whatever rules make sense for your class of course retVal = NSAscending; else if ( self > obj ) retVal = NSDescending; return result; }
arrays
objectivec
sorting
rosetta
null
null
open
Rosetta Stone - Sorting Arrays === I thought I would pose a question I'm describing as a "Rosetta Stone". That is to say, I am posing a question, and would like to see answers given for a number of different languages so that someone moving from one language to another can see how some typical operation is done. I have always found these types of comparisons to be very educational when moving into a new language, and a fun quick way to see differences between languages without having to use them heavily for a while. This particular question is, given an array of items in the typical collection appropriate to the language at hand, how do you sort them? Sample code with some description would be good. I'll present the Objective C answer: // Can only modify mutable arrays NSMutableArray *sortArray = [NSMutableArray arrayWithArray:myArrayOfStuff]; Sort NSString ignoring case: [sortArray sortUsingSelector: @selector(caseInsensitiveCompare:)]; Sort most foundation objects (would also work for NSString as well), assuming numbers are wrapped in NSNumber class: [sortArray sortUsingSelector:@selector(compare:)]; Sort instances of your own classes: [sortArray sortUsingSelector:@selector(myCompare:)]; For the last one, in your class you'd implement a comparison method like so: // Class instance method to compare self with object "obj" - (NSComparisonResult) myCompare:(myObject *)obj { NSComparisonResult retVal = NSSame; if ( self < obj ) // by whatever rules make sense for your class of course retVal = NSAscending; else if ( self > obj ) retVal = NSDescending; return result; }
0
61,870
09/15/2008 04:53:37
6,382
09/15/2008 04:53:37
1
0
Sum of items in a collection
Using LINQ to SQL, I have an Order class with a collection of OrderDetails. The Order Details has a property called LineTotal which gets Qnty x ItemPrice. I know how to do a new LINQ query of the database to find the order total, but as I already have the collection of OrderDetails from the DB, is there a simple method to return the sum of the LineTotal directly from the collection? I'd like to add the order total as a property of my Order class. I imagine I could loop through the collection and calculate the sum with a for each Order.OrderDetail, but I'm guessing there is a better way.
linq
sum
null
null
null
null
open
Sum of items in a collection === Using LINQ to SQL, I have an Order class with a collection of OrderDetails. The Order Details has a property called LineTotal which gets Qnty x ItemPrice. I know how to do a new LINQ query of the database to find the order total, but as I already have the collection of OrderDetails from the DB, is there a simple method to return the sum of the LineTotal directly from the collection? I'd like to add the order total as a property of my Order class. I imagine I could loop through the collection and calculate the sum with a for each Order.OrderDetail, but I'm guessing there is a better way.
0
61,871
09/15/2008 04:55:08
6,379
09/15/2008 04:35:57
1
1
How do I use my pager (more/less) on error output only
I have a program that spits out both standard error and standard out, and I want to run my pager less on the standard error, but *ignore* standard out. How do I do that?
unix
null
null
null
null
null
open
How do I use my pager (more/less) on error output only === I have a program that spits out both standard error and standard out, and I want to run my pager less on the standard error, but *ignore* standard out. How do I do that?
0
61,872
09/15/2008 04:55:25
4,964
09/07/2008 03:07:41
1
2
Use Float or Decimal for Accounting Application Dollar Amount?
We are rewriting our legacy Accounting System in VB.NET and SQL Server. We brought in a new team of .NET/ SQL Programmers to do the rewrite. Most of the system is already completed with the Dollar amounts using Floats. The legacy system language, I programmed in, did not have a Float so I probably would have used a Decimal. What is your recommendation? Should Float or Decimal data type be used for dollar amounts? What are some of the pros and cons for either? One Con mentioned in our daily scrum was you have to be careful when you calculate an amount that returns a result that is over two decimal positions. It sounds like you will have to round the amount to two decimal positions. Another Con is all displays and printed amounts have to have a Format Statement that shows two decimal positions. I noticed a few times where this was not done and the amounts did not look correct. (i.e. 10.2 or 10.2546) A pro is the Float only takes up 8 bytes on disk where the Decimal would take of 9 bytes (Decimal 12,2) Thanks
sql-server
vb.net
accounting
null
null
null
open
Use Float or Decimal for Accounting Application Dollar Amount? === We are rewriting our legacy Accounting System in VB.NET and SQL Server. We brought in a new team of .NET/ SQL Programmers to do the rewrite. Most of the system is already completed with the Dollar amounts using Floats. The legacy system language, I programmed in, did not have a Float so I probably would have used a Decimal. What is your recommendation? Should Float or Decimal data type be used for dollar amounts? What are some of the pros and cons for either? One Con mentioned in our daily scrum was you have to be careful when you calculate an amount that returns a result that is over two decimal positions. It sounds like you will have to round the amount to two decimal positions. Another Con is all displays and printed amounts have to have a Format Statement that shows two decimal positions. I noticed a few times where this was not done and the amounts did not look correct. (i.e. 10.2 or 10.2546) A pro is the Float only takes up 8 bytes on disk where the Decimal would take of 9 bytes (Decimal 12,2) Thanks
0
61,882
09/15/2008 05:06:05
1,068
08/12/2008 08:44:09
100
6
Power Efficient Software Coding
In a typical handheld/portable embedded system device Battery life is a major concern in design of H/W, S/W and the features the device can support. From the Software programming perspective, one is aware of MIPS, Memory(Data and Program) optimized code. I am aware of the H/W Deep sleep mode, Standby mode that are used to clock the hardware at lower Cycles or turn of the clock entirel to some unused circutis to save power, but i am looking for some ideas from that point of view: Wherein my code is running and it needs to keep executing, given this how can I write the code "power" efficiently so as to consume minimum watts? Are there any special programming constructs, data structures, control structures which i should look at to achieve minimum power consumption for a given functionality. Are there any s/w high level design considerations which one should keep in mind at time of code structure design, or during low level design to make the code as power efficient(Least power consuming) as possible? -AD
efficient
power
null
null
null
null
open
Power Efficient Software Coding === In a typical handheld/portable embedded system device Battery life is a major concern in design of H/W, S/W and the features the device can support. From the Software programming perspective, one is aware of MIPS, Memory(Data and Program) optimized code. I am aware of the H/W Deep sleep mode, Standby mode that are used to clock the hardware at lower Cycles or turn of the clock entirel to some unused circutis to save power, but i am looking for some ideas from that point of view: Wherein my code is running and it needs to keep executing, given this how can I write the code "power" efficiently so as to consume minimum watts? Are there any special programming constructs, data structures, control structures which i should look at to achieve minimum power consumption for a given functionality. Are there any s/w high level design considerations which one should keep in mind at time of code structure design, or during low level design to make the code as power efficient(Least power consuming) as possible? -AD
0
61,888
09/15/2008 05:16:15
1,897
08/19/2008 07:54:49
225
32
Using svn for general purpose backup
Is it possible to use SVN as general purpose backup tool? (as kind of rsync alternative)
svn
backup
null
null
null
null
open
Using svn for general purpose backup === Is it possible to use SVN as general purpose backup tool? (as kind of rsync alternative)
0
61,894
09/15/2008 05:21:47
4,904
09/06/2008 14:19:40
1
0
What's a good way to find relative paths in Google App Engine?
So I've done the trivial "warmup" apps with GAE. Now I'd like to build something with a more complex directory structure. Something along the lines of: siteroot/ models/ controllers/ controller1/ controller2/ ... templates/ template1/ template2/ ... ..etc. The controllers will be Python modules handling requests. They would then need to locate (Django-style) templates in associated folders. Most of the demo apps I've seen resolve template paths like this: path = os.path.join(os.path.dirname(__file__), 'myPage.html') ...the __ file __ property resolves to the currently executing script. So, in my above example, if a Python script were running in controllers/controller1/, then the 'myPage.html' would resolve to that same directory -- controllers/controller1/myPage.html -- and I would rather cleanly separate my Python code and templates. The solution I've hacked together feels... hacky: base_paths = os.path.split(os.path.dirname(__file__)) template_dir = os.path.join(base_paths[0], "templates") So, I'm just snipping off the last element of the path for the currently running script and appending the template directory to the new path. The other (non-GAE specific) solutions I've seen for resolving Python paths seem pretty heavyweight (such as splitting paths into lists and manipulating accordingly). Django seems to have an answer for this, but I'd rather stick to the GAE API, vs. creating a full Django app and modifying it for GAE. I'm assuming anything hard-coded would be non-starter, since the apps live on Google's infinite server farm. So what's a better way?
python
null
null
null
null
null
open
What's a good way to find relative paths in Google App Engine? === So I've done the trivial "warmup" apps with GAE. Now I'd like to build something with a more complex directory structure. Something along the lines of: siteroot/ models/ controllers/ controller1/ controller2/ ... templates/ template1/ template2/ ... ..etc. The controllers will be Python modules handling requests. They would then need to locate (Django-style) templates in associated folders. Most of the demo apps I've seen resolve template paths like this: path = os.path.join(os.path.dirname(__file__), 'myPage.html') ...the __ file __ property resolves to the currently executing script. So, in my above example, if a Python script were running in controllers/controller1/, then the 'myPage.html' would resolve to that same directory -- controllers/controller1/myPage.html -- and I would rather cleanly separate my Python code and templates. The solution I've hacked together feels... hacky: base_paths = os.path.split(os.path.dirname(__file__)) template_dir = os.path.join(base_paths[0], "templates") So, I'm just snipping off the last element of the path for the currently running script and appending the template directory to the new path. The other (non-GAE specific) solutions I've seen for resolving Python paths seem pretty heavyweight (such as splitting paths into lists and manipulating accordingly). Django seems to have an answer for this, but I'd rather stick to the GAE API, vs. creating a full Django app and modifying it for GAE. I'm assuming anything hard-coded would be non-starter, since the apps live on Google's infinite server farm. So what's a better way?
0
61,902
09/15/2008 05:28:22
5,234
09/08/2008 16:25:48
8
1
iframe wikipedia article without the wrapper
I want to embed a wikipedia article into a page but I don't want all the wrapper (navigation, etc.) that sits around the articles. I saw it done here: http://www.dayah.com/periodic/. Click on an element and the iframe is displayed and links to the article only (no wrapper). So how'd they do that? Seems like JavaScript handles showing the iframe and constructing the href but after browsing the pages javascript (http://www.dayah.com/periodic/Script/interactivity.js) I still can't figure out how the url is built. Thanks.
javascript
iframe
wikipedia
null
null
null
open
iframe wikipedia article without the wrapper === I want to embed a wikipedia article into a page but I don't want all the wrapper (navigation, etc.) that sits around the articles. I saw it done here: http://www.dayah.com/periodic/. Click on an element and the iframe is displayed and links to the article only (no wrapper). So how'd they do that? Seems like JavaScript handles showing the iframe and constructing the href but after browsing the pages javascript (http://www.dayah.com/periodic/Script/interactivity.js) I still can't figure out how the url is built. Thanks.
0
61,906
09/15/2008 05:33:09
3,332
08/28/2008 00:26:09
11
3
Lazy loading property and session.get problem
In Hibernate we have two classes with the following classes with JPA mapping: package com.example.hibernate import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; @Entity public class Foo { private long id; private Bar bar; @Id @GeneratedValue(strategy = GenerationType.AUTO) public long getId() { return id; } public void setId(long id) { this.id = id; } @ManyToOne(fetch = FetchType.LAZY) public Bar getBar() { return bar; } public void setBar(Bar bar) { this.bar = bar; } } package com.example.hibernate import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; public class Bar { private long id; private String title; @Id @GeneratedValue(strategy = GenerationType.AUTO) public long getId() { return id; } public void setId(long id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } } Now when we load from the database an object from class Foo using session get e.g: Foo foo = (Foo)session.get(Foo.class, 1 /* or some other id that exists in the DB*/); the Bar member of foo is a proxy object (in our case javassist proxy but it can be cglib one depending on the bytecode provider you use), that is not initialized. If you then use session.get to fetch the Bar object that is the member of the Foo class just loaded (we are in the same session), Hibernate does not issue another DB query and fetches the object from the session (first level) cache. The problem is this is a proxy to Bar class which is not initialized and trying to call this object getId() will return 0, and getTitle() will return null. Our current solution is pretty ugly and checks if the object returned from get is a proxy here is the code (form a generic DAO implementation): @SuppressWarnings("unchecked") @Override @Transactional(readOnly = true) public <T extends IEntity> T get(Class<T> clazz, Serializable primaryKey) throws DataAccessException { T entity = (T) currentSession().get(clazz, primaryKey); if (entity != null) { if (LOG.isWarnEnabled()) { LOG.warn("Object not found for class " + clazz.getName() + " with primary key " + primaryKey); } } else if (entity instanceof HibernateProxy){ // TODO: force initialization due to Hibernate bug HibernateProxy proxy = (HibernateProxy)entity; if (!Hibernate.isInitialized(proxy)) { Hibernate.initialize(proxy); } entity = (T)proxy.getHibernateLazyInitializer().getImplementation(); } return entity; } Is there a better way to do this, couldn't find a solution in the Hibernate forum, and didn't find the issue in Hibernate's JIRA. Note: we cannot just use foo.getBar() (which will initialize the proxy properly) to get the Bar class object, because the session.get operation to fetch the Bar object does not know (or care for that matter) that the Bar class is also a lazy member of a Foo object that was just fetched.
java
hibernate
null
null
null
null
open
Lazy loading property and session.get problem === In Hibernate we have two classes with the following classes with JPA mapping: package com.example.hibernate import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; @Entity public class Foo { private long id; private Bar bar; @Id @GeneratedValue(strategy = GenerationType.AUTO) public long getId() { return id; } public void setId(long id) { this.id = id; } @ManyToOne(fetch = FetchType.LAZY) public Bar getBar() { return bar; } public void setBar(Bar bar) { this.bar = bar; } } package com.example.hibernate import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; public class Bar { private long id; private String title; @Id @GeneratedValue(strategy = GenerationType.AUTO) public long getId() { return id; } public void setId(long id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } } Now when we load from the database an object from class Foo using session get e.g: Foo foo = (Foo)session.get(Foo.class, 1 /* or some other id that exists in the DB*/); the Bar member of foo is a proxy object (in our case javassist proxy but it can be cglib one depending on the bytecode provider you use), that is not initialized. If you then use session.get to fetch the Bar object that is the member of the Foo class just loaded (we are in the same session), Hibernate does not issue another DB query and fetches the object from the session (first level) cache. The problem is this is a proxy to Bar class which is not initialized and trying to call this object getId() will return 0, and getTitle() will return null. Our current solution is pretty ugly and checks if the object returned from get is a proxy here is the code (form a generic DAO implementation): @SuppressWarnings("unchecked") @Override @Transactional(readOnly = true) public <T extends IEntity> T get(Class<T> clazz, Serializable primaryKey) throws DataAccessException { T entity = (T) currentSession().get(clazz, primaryKey); if (entity != null) { if (LOG.isWarnEnabled()) { LOG.warn("Object not found for class " + clazz.getName() + " with primary key " + primaryKey); } } else if (entity instanceof HibernateProxy){ // TODO: force initialization due to Hibernate bug HibernateProxy proxy = (HibernateProxy)entity; if (!Hibernate.isInitialized(proxy)) { Hibernate.initialize(proxy); } entity = (T)proxy.getHibernateLazyInitializer().getImplementation(); } return entity; } Is there a better way to do this, couldn't find a solution in the Hibernate forum, and didn't find the issue in Hibernate's JIRA. Note: we cannot just use foo.getBar() (which will initialize the proxy properly) to get the Bar class object, because the session.get operation to fetch the Bar object does not know (or care for that matter) that the Bar class is also a lazy member of a Foo object that was just fetched.
0
61,914
09/15/2008 05:47:37
6,367
09/14/2008 21:53:42
1
1
VS 2005 Toolbox kind of control .NET
I'm looking for a control that the Visual Studio "Toolbox" menu uses. It can be docked and can retract (pin). Would you know where I can find a control or COM I could use which would look like this?
c#
.net
c++
vs2005
vb
null
open
VS 2005 Toolbox kind of control .NET === I'm looking for a control that the Visual Studio "Toolbox" menu uses. It can be docked and can retract (pin). Would you know where I can find a control or COM I could use which would look like this?
0
61,927
09/15/2008 06:07:05
5,232
09/08/2008 16:15:20
29
9
VS Code Snippets automatic synchronizer?
I use more than one machine for development in VS 2008. Is there a tool to automatically synchronize the snippets between the machines? Same concept of synchronizing browsers' bookmark.
code-snippets
null
null
null
null
null
open
VS Code Snippets automatic synchronizer? === I use more than one machine for development in VS 2008. Is there a tool to automatically synchronize the snippets between the machines? Same concept of synchronizing browsers' bookmark.
0
61,929
09/15/2008 06:16:50
979
08/11/2008 12:06:42
33
4
Firebird database replication
I have reached the point where I've decided to replace my custom-built replication system with a system that has been built by someone else, mainly for reliability purposes. Can anyone recommend any replication system that is worth it? Is [FiBRE][1] any good? What I need might be a little away from a generic system, though. I have five departments with each having it's own copy of the database, and the master in a remote location. The departments all have sporadic internet connection, the master is always online. The data has to flow back and forth from the master, meaning that all departments need to be equal to the master (when internet connection is available), and to upload changes made during network outage that are later distributed to other departments by the master. [1]: http://fibre.sourceforge.net
database
replication
firebird
null
null
null
open
Firebird database replication === I have reached the point where I've decided to replace my custom-built replication system with a system that has been built by someone else, mainly for reliability purposes. Can anyone recommend any replication system that is worth it? Is [FiBRE][1] any good? What I need might be a little away from a generic system, though. I have five departments with each having it's own copy of the database, and the master in a remote location. The departments all have sporadic internet connection, the master is always online. The data has to flow back and forth from the master, meaning that all departments need to be equal to the master (when internet connection is available), and to upload changes made during network outage that are later distributed to other departments by the master. [1]: http://fibre.sourceforge.net
0
61,953
09/15/2008 07:03:32
4,872
09/06/2008 09:14:55
342
10
How do you bind an Enum to a DropDownList control in ASP.NET?
Let's say I have the following simple enum: enum Response { Yes = 1, No = 2, Maybe = 3 } How can I bind this enum to a DropDownList control so that the descriptions are displayed in the list as well as retrieve the associated numeric value (1,2,3) once an option has been selected?
c#
.net
asp.net
null
null
null
open
How do you bind an Enum to a DropDownList control in ASP.NET? === Let's say I have the following simple enum: enum Response { Yes = 1, No = 2, Maybe = 3 } How can I bind this enum to a DropDownList control so that the descriptions are displayed in the list as well as retrieve the associated numeric value (1,2,3) once an option has been selected?
0
61,959
09/15/2008 07:07:47
3,397
08/28/2008 12:49:13
1
3
TFS vs open source alternatives?
We're currently in the process of setting up a source control/build/and more-server for .NET development and we're thinking about either utilizing the Team Foundation Server (which costs a lot of dough) or combining several open source options, such as SourceForge Enterprise/GForge and Subversion and CruiseControl.net and so on. Has anyone walked down the full blown OSS road or is it TFS only if you want to get it right and get to work soon?
.net
open-source
tfs
cruisecontrol.net
subversion
null
open
TFS vs open source alternatives? === We're currently in the process of setting up a source control/build/and more-server for .NET development and we're thinking about either utilizing the Team Foundation Server (which costs a lot of dough) or combining several open source options, such as SourceForge Enterprise/GForge and Subversion and CruiseControl.net and so on. Has anyone walked down the full blown OSS road or is it TFS only if you want to get it right and get to work soon?
0
61,963
09/15/2008 07:15:53
5,043
09/07/2008 14:23:39
11
2
Howto import an oracle dump in an different tablespace
I want to import an oracle dump into a different tablespace. I have a tablespace A used by User A. I've revoked DBA on this user and given him the grants connect and resource. Then I've dumped everything with the command > exp a/*** owner=a file=oracledump.dmp log=log.log compress=y Now I want to import the dump into the tablespace B used by User B. So I've given him the grants on connect and resource (no DBA). Then I've executed the following import: > imp b/*** file=oracledump.dmp log=import.log fromuser=a touser=b The result is a log with lots of errors: > IMP-00017: following statement failed with ORACLE error 20001: "BEGIN DBMS_STATS.SET_TABLE_STATS > IMP-00003: ORACLE error 20001 encountered > ORA-20001: Invalid or inconsistent input values After that I've tried the same import command but with the option statistics=none. This resulted in the following errors: > ORA-00959: tablespace 'A_TBLSPACE' does not exist How should this be done?
oracle
null
null
null
null
null
open
Howto import an oracle dump in an different tablespace === I want to import an oracle dump into a different tablespace. I have a tablespace A used by User A. I've revoked DBA on this user and given him the grants connect and resource. Then I've dumped everything with the command > exp a/*** owner=a file=oracledump.dmp log=log.log compress=y Now I want to import the dump into the tablespace B used by User B. So I've given him the grants on connect and resource (no DBA). Then I've executed the following import: > imp b/*** file=oracledump.dmp log=import.log fromuser=a touser=b The result is a log with lots of errors: > IMP-00017: following statement failed with ORACLE error 20001: "BEGIN DBMS_STATS.SET_TABLE_STATS > IMP-00003: ORACLE error 20001 encountered > ORA-20001: Invalid or inconsistent input values After that I've tried the same import command but with the option statistics=none. This resulted in the following errors: > ORA-00959: tablespace 'A_TBLSPACE' does not exist How should this be done?
0
61,967
09/15/2008 07:18:51
4,872
09/06/2008 09:14:55
342
10
Is there a way to loop through a table variable in TSQL without using a cursor?
Let's say I have the following simple table variable: declare @databases table ( DatabaseID int, Name varchar(15), Server varchar(15) ) -- insert a bunch rows into @databases Is declaring and using a cursor my only option if I wanted to iterate through the rows? Is there another way?
sql-server
tsql
loops
null
null
null
open
Is there a way to loop through a table variable in TSQL without using a cursor? === Let's say I have the following simple table variable: declare @databases table ( DatabaseID int, Name varchar(15), Server varchar(15) ) -- insert a bunch rows into @databases Is declaring and using a cursor my only option if I wanted to iterate through the rows? Is there another way?
0
61,972
09/15/2008 07:28:56
6,390
09/15/2008 07:28:56
1
0
JavaScript sqlite
Best recommendations for accessing and manipulation of sqlite databases from JavaScript.
javascript
sqlite
null
null
null
null
open
JavaScript sqlite === Best recommendations for accessing and manipulation of sqlite databases from JavaScript.
0
61,995
09/15/2008 08:06:59
1,532
08/16/2008 12:19:36
131
11
xslt and xpath: match conditionally upon current node value
given the following xml: <current> <login_name>jd</login_name> </current> <people> <person> <first>John</first> <last>Doe</last> <login_name>jd</login_name> </preson> <person> <first>Pierre</first> <last>Spring</last> <login_name>ps</login_name> </preson> </people> how can i get "John Doe" from within the current/login matcher? i tried the following: <xsl:template match="current/login_name"> <xsl:value-of select="../people/first[login_name = .]"/> <xsl:text> </xsl:text> <xsl:value-of select="../people/last[login_name = .]"/> </xsl:template>
xslt
xpath
null
null
null
null
open
xslt and xpath: match conditionally upon current node value === given the following xml: <current> <login_name>jd</login_name> </current> <people> <person> <first>John</first> <last>Doe</last> <login_name>jd</login_name> </preson> <person> <first>Pierre</first> <last>Spring</last> <login_name>ps</login_name> </preson> </people> how can i get "John Doe" from within the current/login matcher? i tried the following: <xsl:template match="current/login_name"> <xsl:value-of select="../people/first[login_name = .]"/> <xsl:text> </xsl:text> <xsl:value-of select="../people/last[login_name = .]"/> </xsl:template>
0
61,996
09/15/2008 08:07:29
6,093
09/12/2008 11:07:34
188
5
Typesetting programs
I often want to printout programs so that I can read them when away from the computer, and I'm wondering what tools people use to make the code readable when printed. Today I'm using [a2ps][1] which works reasonably well, but it shouldn't be impossible to improve it. For example: index over functions etc. cross references from usage to definitions. [c2ps][2] have some of these features, but at the moment I'm not doing much c-coding so its of limited use. [Human factors and typography for more readable programs][3] have described a lot of the ideas I'm thinking of but I haven't been able to find any code that have come out of that. [1]: http://www.inf.enst.fr/~demaille/a2ps/ [2]: http://www.cs.technion.ac.il/users/c2ps/ [3]: http://portal.acm.org/citation.cfm?id=67000
printing
typesetting
null
null
null
null
open
Typesetting programs === I often want to printout programs so that I can read them when away from the computer, and I'm wondering what tools people use to make the code readable when printed. Today I'm using [a2ps][1] which works reasonably well, but it shouldn't be impossible to improve it. For example: index over functions etc. cross references from usage to definitions. [c2ps][2] have some of these features, but at the moment I'm not doing much c-coding so its of limited use. [Human factors and typography for more readable programs][3] have described a lot of the ideas I'm thinking of but I haven't been able to find any code that have come out of that. [1]: http://www.inf.enst.fr/~demaille/a2ps/ [2]: http://www.cs.technion.ac.il/users/c2ps/ [3]: http://portal.acm.org/citation.cfm?id=67000
0
62,012
09/15/2008 09:16:30
6,085
09/12/2008 09:50:47
41
3
Apache Fall Back When PHP Fails
I was wondering if anybody knew of a method to configure apache to fall back to returning a static HTML page, should it (Apache) be able to determine that PHP has died? This would provide the developer with a elegant solution to displaying an error page and not (worst case scenario) the source code of the PHP page that should have been executed. Thanks.
php
apache
configuration
null
null
null
open
Apache Fall Back When PHP Fails === I was wondering if anybody knew of a method to configure apache to fall back to returning a static HTML page, should it (Apache) be able to determine that PHP has died? This would provide the developer with a elegant solution to displaying an error page and not (worst case scenario) the source code of the PHP page that should have been executed. Thanks.
0
62,013
09/15/2008 09:19:11
968
08/11/2008 07:44:54
1,104
73
Problem with Login control of ASP.NET
I set up a website to use SqlMembershipProvider as written on [this page][1]. I followed every step. I have the database, I modified the Web.config to use this provider, with the correct connection string, and the authentication mode is set to Forms. Created some users to test with. I created a Login.aspx and put the Login control on it. Everything works fine until the point that a user can log in. I call Default.aspx, it gets redirected to Login.aspx, I enter the user and the correct password. No error message, nothing seems to be wrong, but I see again the Login form, to enter the user's login information. However if I check the cookies in the browser, I can see that the cookie with the specified name exists. I already tried to handle the events by myself and check, what is happening in them, but no success. I'm using VS2008, Website in filesystem, SQL Express 2005 to store aspnetdb, no role management, tested with K-Meleon, IE7.0 and Chrome. Any ideas? [1]: http://msdn.microsoft.com/en-us/library/ms998347.aspx
asp.net
null
null
null
null
null
open
Problem with Login control of ASP.NET === I set up a website to use SqlMembershipProvider as written on [this page][1]. I followed every step. I have the database, I modified the Web.config to use this provider, with the correct connection string, and the authentication mode is set to Forms. Created some users to test with. I created a Login.aspx and put the Login control on it. Everything works fine until the point that a user can log in. I call Default.aspx, it gets redirected to Login.aspx, I enter the user and the correct password. No error message, nothing seems to be wrong, but I see again the Login form, to enter the user's login information. However if I check the cookies in the browser, I can see that the cookie with the specified name exists. I already tried to handle the events by myself and check, what is happening in them, but no success. I'm using VS2008, Website in filesystem, SQL Express 2005 to store aspnetdb, no role management, tested with K-Meleon, IE7.0 and Chrome. Any ideas? [1]: http://msdn.microsoft.com/en-us/library/ms998347.aspx
0
62,017
09/15/2008 09:28:51
6,394
09/15/2008 08:02:20
1
0
best way to get started using Asterisk
I'm interested in learning more about Asterisk (open source PBX) so I thought I would try building a "hobby" system for my home. Just play around with getting a juiced up voicemail system going for my family. That is, until I found out that a TDM11B kit from Digium costs over $500(!) if I want to get an FXO/FXS card with echo cancellation. My question(s) are: what's the best way to go about learning Asterisk? Moreover, if I just want to get a souped version of voicemail going at home is there way I can do it without having to buy an expensive card to hook into the PSTN? thanks, - John
telephony
null
null
null
null
null
open
best way to get started using Asterisk === I'm interested in learning more about Asterisk (open source PBX) so I thought I would try building a "hobby" system for my home. Just play around with getting a juiced up voicemail system going for my family. That is, until I found out that a TDM11B kit from Digium costs over $500(!) if I want to get an FXO/FXS card with echo cancellation. My question(s) are: what's the best way to go about learning Asterisk? Moreover, if I just want to get a souped version of voicemail going at home is there way I can do it without having to buy an expensive card to hook into the PSTN? thanks, - John
0
62,027
09/15/2008 09:34:11
4,996
09/07/2008 09:28:22
8
1
WSE 2.0 raisies wse910
I had to use a WSE 2.0 and it raised wse910 error when the time difference between the server and client was more than 5 minutes. I read in many places that setting the timeToleranceInSeconds, ttlInSeconds and defaultTtlInSeconds values should help but only setting the clock of the client machine solved the problem. Any experiences?
wse2
wse910
timetoleranceinseconds
ttlinseconds
defaultttlinseconds
null
open
WSE 2.0 raisies wse910 === I had to use a WSE 2.0 and it raised wse910 error when the time difference between the server and client was more than 5 minutes. I read in many places that setting the timeToleranceInSeconds, ttlInSeconds and defaultTtlInSeconds values should help but only setting the clock of the client machine solved the problem. Any experiences?
0
62,029
09/15/2008 09:38:26
45,603
08/25/2008 09:52:34
325
17
VS2008 Command Prompt + Cygwin
I use the VS2008 command prompt for builds, TFS access etc. and the cygwin prompt for grep, vi and unix-like tools. Is there any way I can 'import' the vcvars32.bat functionality into the cygwin environment so I can call "tfs checkout" from cygwin itself?
command-line
cygwin
null
null
null
null
open
VS2008 Command Prompt + Cygwin === I use the VS2008 command prompt for builds, TFS access etc. and the cygwin prompt for grep, vi and unix-like tools. Is there any way I can 'import' the vcvars32.bat functionality into the cygwin environment so I can call "tfs checkout" from cygwin itself?
0
62,034
09/15/2008 09:40:40
6,413
09/15/2008 09:37:12
1
0
Unit Testing Monorail's RedirectToReferrer()
I am trying to write a unit test for an action method which calls the Controller.RedirectToReferrer() method, but am getting a "No referrer available" message. How can I isolate and mock this method? Thanks, -- rauchy
c#
unit-testing
castle-monorail
null
null
null
open
Unit Testing Monorail's RedirectToReferrer() === I am trying to write a unit test for an action method which calls the Controller.RedirectToReferrer() method, but am getting a "No referrer available" message. How can I isolate and mock this method? Thanks, -- rauchy
0
62,038
09/15/2008 09:42:18
3,974
09/01/2008 06:18:59
207
9
Rails model validators break earlier migrations
I have a sequence of migrations in a rails app which includes the following steps: 1. Create basic version of the 'user' model 2. Create an instance of this model - there needs to be at least one initial user in my system so that you can log in and start using it 3. Update the 'user' model to add a new field / column. Now I'm using "validates_inclusion_of" on this new field/column. This worked fine on my initial development machine, which already had a database with these migrations applied. However, if I go to a fresh machine and run all the migrations, step 2 fails, because validates_inclusion_of fails, because the field from migration 3 hasn't been added to the model class yet. As a workaround, I can comment out the "validates_..." line, run the migrations, and uncomment it, but that's not nice. Better would be to re-order my migrations so the user creation (step 2) comes last, after all columns have been added. I'm a rails newbie though, so I thought I'd ask what the preferred way to handle this situation is :)
ruby-on-rails
migration
validation
null
null
null
open
Rails model validators break earlier migrations === I have a sequence of migrations in a rails app which includes the following steps: 1. Create basic version of the 'user' model 2. Create an instance of this model - there needs to be at least one initial user in my system so that you can log in and start using it 3. Update the 'user' model to add a new field / column. Now I'm using "validates_inclusion_of" on this new field/column. This worked fine on my initial development machine, which already had a database with these migrations applied. However, if I go to a fresh machine and run all the migrations, step 2 fails, because validates_inclusion_of fails, because the field from migration 3 hasn't been added to the model class yet. As a workaround, I can comment out the "validates_..." line, run the migrations, and uncomment it, but that's not nice. Better would be to re-order my migrations so the user creation (step 2) comes last, after all columns have been added. I'm a rails newbie though, so I thought I'd ask what the preferred way to handle this situation is :)
0
62,044
09/15/2008 09:45:00
3,499
08/28/2008 19:39:37
284
24
How do I use a pipe in the exec parameter for a find command?
I'm trying to construct a find command to process a bunch of files in a directory using two different executables. Unfortunately, -exec on find doesn't allow to use pipe or even \| because the shell interprets that character first. Here is specifically what I'm trying to do (which doesn't work because pipe ends the find command): find /path/to/jpgs -type f -exec jhead -v {} | grep 123 \; -print
bash
null
null
null
null
null
open
How do I use a pipe in the exec parameter for a find command? === I'm trying to construct a find command to process a bunch of files in a directory using two different executables. Unfortunately, -exec on find doesn't allow to use pipe or even \| because the shell interprets that character first. Here is specifically what I'm trying to do (which doesn't work because pipe ends the find command): find /path/to/jpgs -type f -exec jhead -v {} | grep 123 \; -print
0
62,062
09/15/2008 09:55:40
6,400
09/15/2008 09:03:41
1
0
How to do Flash pseudo-streaming?
I need to build something that starts serving a H.264 encoded video to a flash server halfway through the file (to support skipping to a point in the video that has not been buffered yet). Currently, the videos are in the FLV container format, but transcoding is an option. I managed to re-write the file header and metadata information for a given byte offset. This works for older videos, but not for H.264 encoded files. I suspect this is because the video tags inside the file also have to be altered, which is not feasible (it would take too much processing power). What is the "proper" way to do it?
flash
flv
streaming
null
null
null
open
How to do Flash pseudo-streaming? === I need to build something that starts serving a H.264 encoded video to a flash server halfway through the file (to support skipping to a point in the video that has not been buffered yet). Currently, the videos are in the FLV container format, but transcoding is an option. I managed to re-write the file header and metadata information for a given byte offset. This works for older videos, but not for H.264 encoded files. I suspect this is because the video tags inside the file also have to be altered, which is not feasible (it would take too much processing power). What is the "proper" way to do it?
0
62,064
09/15/2008 09:56:22
3,397
08/28/2008 12:49:13
13
4
The best Django webcasts/videos
I'm currently learning Django though reading [the Django Book][1], but I'm a huge fan of webcasts/screencasts/videos and haven't found any good ones so far. Are there any and which ones would you recommend? [1]: http://www.djangobook.com/
python
django
video
screencasts
webcast
03/20/2012 00:23:28
not constructive
The best Django webcasts/videos === I'm currently learning Django though reading [the Django Book][1], but I'm a huge fan of webcasts/screencasts/videos and haven't found any good ones so far. Are there any and which ones would you recommend? [1]: http://www.djangobook.com/
4
62,069
09/15/2008 09:58:36
942
08/10/2008 21:10:34
298
22
MySQL Interview Questions
I've been asked to screen some candidates for a MySQL DBA / Developer position for a role that requires an enterprise level skill set. I myself am a SQL Server person so I know what I would be looking for from that point of view with regards to scalability / design etc but is there anything specific I should be asking with regards to MySQL? I would ideally like to ask them about enterprise level features of MySQL that they would typically only use when working on a big database. Need to separate out the enterprise developers from the home / small website kind of guys. Thanks.
mysql
interview-questions
null
null
null
11/30/2011 03:23:46
not constructive
MySQL Interview Questions === I've been asked to screen some candidates for a MySQL DBA / Developer position for a role that requires an enterprise level skill set. I myself am a SQL Server person so I know what I would be looking for from that point of view with regards to scalability / design etc but is there anything specific I should be asking with regards to MySQL? I would ideally like to ask them about enterprise level features of MySQL that they would typically only use when working on a big database. Need to separate out the enterprise developers from the home / small website kind of guys. Thanks.
4
62,076
09/15/2008 10:04:46
6,143
09/12/2008 16:01:15
21
3
Beta Test Guidelines / Agreement
I'm going to roll out a private beta soon but never participated myself in something like that. So which points should be included in a beta test agreement between me and the users? Pointing me to an example agreement would be a plus.
private
beta
user
agreement
guidelines
null
open
Beta Test Guidelines / Agreement === I'm going to roll out a private beta soon but never participated myself in something like that. So which points should be included in a beta test agreement between me and the users? Pointing me to an example agreement would be a plus.
0
62,077
09/15/2008 10:05:11
6,399
09/15/2008 09:03:18
1
0
Is there a Transformation engine or libary using .NET ?
We're looking for a Transformation library or engine which can read any input and transform this to a existing business object using custom rules. XSLT is both to complex (to learn) and to simple (not enough features) Can anybody recommend a C# library or engine? I have seen Altova MapForce but would like something I can send out to dozens of people who will build / design their own transformations without having to pay dozens of Altova licenses. Thx, -Edo
c#
altova
transformation
null
null
null
open
Is there a Transformation engine or libary using .NET ? === We're looking for a Transformation library or engine which can read any input and transform this to a existing business object using custom rules. XSLT is both to complex (to learn) and to simple (not enough features) Can anybody recommend a C# library or engine? I have seen Altova MapForce but would like something I can send out to dozens of people who will build / design their own transformations without having to pay dozens of Altova licenses. Thx, -Edo
0
62,079
09/15/2008 10:06:19
1,384,652
08/01/2008 12:01:23
2,000
83
Comparing runtimes
I am trying to get some accurate runtime comparisons of PHP vs Python (and potentially any other language that I have to include). Timing within a script is not my problem but timing within a script does not account for everything from the moment the request is made to run the script to output. 1) Is it actually worth taking such things into account? 2) Assuming it is worth taking it into account, how do I do this? I'm using a Mac so I've got access to Linux commands and I'm not afraid to compile/create a command to help me, I just don't know how to write such a command. Thanks in advance for any help
timing
php
python
null
null
null
open
Comparing runtimes === I am trying to get some accurate runtime comparisons of PHP vs Python (and potentially any other language that I have to include). Timing within a script is not my problem but timing within a script does not account for everything from the moment the request is made to run the script to output. 1) Is it actually worth taking such things into account? 2) Assuming it is worth taking it into account, how do I do this? I'm using a Mac so I've got access to Linux commands and I'm not afraid to compile/create a command to help me, I just don't know how to write such a command. Thanks in advance for any help
0
62,086
09/15/2008 10:12:05
6,448
09/15/2008 10:12:05
1
0
E4X : Assigning to root node
I am using Adobe Flex/Air here, but as far as I know this applies to all of JavaScript. I have come across this problem a few times, and there must be an easy solution out there! Suppose I have the following XML (using e4x): var xml:XML = <root><example>foo</example></root> I can change the contents of the example node using the following code: xml.example = "bar"; However, if I have this: var xml:XML = <root>foo</root> How do i change the contents of the root node? xml = "bar"; Obviously doesn't work as I'm attempting to assign a string to an XML object.
javascript
flex
air
e4x
null
null
open
E4X : Assigning to root node === I am using Adobe Flex/Air here, but as far as I know this applies to all of JavaScript. I have come across this problem a few times, and there must be an easy solution out there! Suppose I have the following XML (using e4x): var xml:XML = <root><example>foo</example></root> I can change the contents of the example node using the following code: xml.example = "bar"; However, if I have this: var xml:XML = <root>foo</root> How do i change the contents of the root node? xml = "bar"; Obviously doesn't work as I'm attempting to assign a string to an XML object.
0
62,102
09/15/2008 10:26:10
4,406
09/03/2008 14:38:45
122
19
What does Class::MethodMaker exactly do?
I want to know what exactly is the sequence of calls when a getter/setter created through Class::MethodMaker is called? How costlier are getter/setters defined by MethodMaker than the native ones(overwritten in the module)?
perl
null
null
null
null
null
open
What does Class::MethodMaker exactly do? === I want to know what exactly is the sequence of calls when a getter/setter created through Class::MethodMaker is called? How costlier are getter/setters defined by MethodMaker than the native ones(overwritten in the module)?
0
62,106
09/15/2008 10:27:51
4,977
09/07/2008 07:24:42
344
18
Flexible compiler pipeline definitions...
I'm developing a compiler framework for .NET and want a flexible way of defining pipelines. I've considered the following options: - WWF - Custom XML pipeline description - Custom pipeline description in code (using Nemerle's macros to define syntax for it) - Other code-based description Requirements: - Must not depend on functionality only in the later versions of .NET (3+) since it's intended to be cross-platform and be used on top of managed kernels, meaning semi-limited .NET functionality. - Must allow conditional pipeline building, so you can specify that certain command line options will correspond to certain elements and orders. WWF would be nice, but doesn't meet the first requirement. The others would work but are less than optimal due to the work involved. Does anyone know of a solution that will meet these goals with little to no modification?
compiler
workflow
pipeline
null
null
null
open
Flexible compiler pipeline definitions... === I'm developing a compiler framework for .NET and want a flexible way of defining pipelines. I've considered the following options: - WWF - Custom XML pipeline description - Custom pipeline description in code (using Nemerle's macros to define syntax for it) - Other code-based description Requirements: - Must not depend on functionality only in the later versions of .NET (3+) since it's intended to be cross-platform and be used on top of managed kernels, meaning semi-limited .NET functionality. - Must allow conditional pipeline building, so you can specify that certain command line options will correspond to certain elements and orders. WWF would be nice, but doesn't meet the first requirement. The others would work but are less than optimal due to the work involved. Does anyone know of a solution that will meet these goals with little to no modification?
0
62,110
09/15/2008 10:30:51
6,452
09/15/2008 10:16:25
1
0
ADO.NET Entity Framework tutorials
Does anyone know of any good tutorials on ADO.NET Entity Framework? There are a few useful links here at [Stack OverFlow][1], and I've found one tutorial at [Jason's DotNet Architecture Blog][2], but can anyone recommend any other good tutorials? Any tutorials available from Microsoft, either online or as part of any conference/course material? [1]: http://stackoverflow.com/questions/42826/where-to-start-with-entity-framework [2]: http://dotnet-architecture-jdo.blogspot.com/2008/08/adonet-entity-framework-part.html
ado.net
entity-framework
tutorials
resources
null
03/13/2012 09:14:30
not constructive
ADO.NET Entity Framework tutorials === Does anyone know of any good tutorials on ADO.NET Entity Framework? There are a few useful links here at [Stack OverFlow][1], and I've found one tutorial at [Jason's DotNet Architecture Blog][2], but can anyone recommend any other good tutorials? Any tutorials available from Microsoft, either online or as part of any conference/course material? [1]: http://stackoverflow.com/questions/42826/where-to-start-with-entity-framework [2]: http://dotnet-architecture-jdo.blogspot.com/2008/08/adonet-entity-framework-part.html
4
62,126
09/15/2008 10:39:41
4,200
09/02/2008 09:57:33
596
32
What are the real benefits of TFS for the individual developer?
The question of TFS **versus** OSS has [already been asked][1], with most answers tending toward OSS as the better alternative. I'm in a position where my employer (an ISV with a mix of onshore, offshore development staff) is about to take the plunge to TFS. We currently develop with VS 2008, subversion, and various supporting toolsl NUnit, NCover, etc. I've read the [marketing hyperbole][2] but I'm unconvinced. Can anyone speak from experience of the benefits of TFS or Team System for the individual developer? Has your coding life improved? [1]: http://stackoverflow.com/questions/61959/tfs-vs-open-source-alternatives [2]: http://msdn.microsoft.com/en-us/vstudio/products/bb931331.aspx
tfs
software-tools
null
null
null
null
open
What are the real benefits of TFS for the individual developer? === The question of TFS **versus** OSS has [already been asked][1], with most answers tending toward OSS as the better alternative. I'm in a position where my employer (an ISV with a mix of onshore, offshore development staff) is about to take the plunge to TFS. We currently develop with VS 2008, subversion, and various supporting toolsl NUnit, NCover, etc. I've read the [marketing hyperbole][2] but I'm unconvinced. Can anyone speak from experience of the benefits of TFS or Team System for the individual developer? Has your coding life improved? [1]: http://stackoverflow.com/questions/61959/tfs-vs-open-source-alternatives [2]: http://msdn.microsoft.com/en-us/vstudio/products/bb931331.aspx
0
62,127
09/15/2008 10:40:10
5,544
09/10/2008 11:46:46
46
3
How can I find the current DNS server?
I'm using Delphi and need to get the current Windows DNS server IP address so I can do a lookup. What function should I call to find it? The only solution I have right now does an ipconfig/all to get it, which is horrible.
windows
delphi
dns
null
null
null
open
How can I find the current DNS server? === I'm using Delphi and need to get the current Windows DNS server IP address so I can do a lookup. What function should I call to find it? The only solution I have right now does an ipconfig/all to get it, which is horrible.
0
62,137
09/15/2008 10:45:57
5,466
09/09/2008 20:38:17
36
7
What is a Covered Index?
I've just heard the term covered index in some database discussion - what does it mean?
sql
database
indexing
null
null
null
open
What is a Covered Index? === I've just heard the term covered index in some database discussion - what does it mean?
0
62,146
09/15/2008 10:54:54
3,168
08/27/2008 05:16:27
13
1
Does anyone have a handy visulization widget that I can use for a web project?
What I want is lots of nodes which can expand making a a map. I'd ideally like to be able to navigate around the map fluidly. Thanks, Alex.
visualization
null
null
null
null
null
open
Does anyone have a handy visulization widget that I can use for a web project? === What I want is lots of nodes which can expand making a a map. I'd ideally like to be able to navigate around the map fluidly. Thanks, Alex.
0
62,151
09/15/2008 10:57:42
1,801
08/18/2008 16:01:48
107
18
DateTime.Now vs. DateTime.UtcNow
I've been wondering what exactly are the principles of how the two properties work. I know the second one is universal and basically doesn't deal with time zones, but can someone explain in detail how they work and which one should be used in what scenario?
date
.net
c#
null
null
null
open
DateTime.Now vs. DateTime.UtcNow === I've been wondering what exactly are the principles of how the two properties work. I know the second one is universal and basically doesn't deal with time zones, but can someone explain in detail how they work and which one should be used in what scenario?
0
62,153
09/15/2008 10:59:42
797
08/09/2008 02:14:04
2,783
98
Reasons not to build your own bug tracking system
Several times now I've been faced with plans from a team that wants to build their own bug tracking system - Not as a product, but as an internal tool. The arguments I've heard in favous are usually along the lines of : - Wanting to 'eat our own dog food' in terms of some internally built web framework - Needing some highly specialised report, or the ability to tweak some feature in some allegedly unique way - Believing that it isn't difficult to build a bug tracking system What arguments might you use to support buying an existing bug tracking system? In particular, what features sound easy but turn out hard to implement, or are difficult and important but often overlooked?
bug-tracking
nih
null
null
null
null
open
Reasons not to build your own bug tracking system === Several times now I've been faced with plans from a team that wants to build their own bug tracking system - Not as a product, but as an internal tool. The arguments I've heard in favous are usually along the lines of : - Wanting to 'eat our own dog food' in terms of some internally built web framework - Needing some highly specialised report, or the ability to tweak some feature in some allegedly unique way - Believing that it isn't difficult to build a bug tracking system What arguments might you use to support buying an existing bug tracking system? In particular, what features sound easy but turn out hard to implement, or are difficult and important but often overlooked?
0
62,154
09/15/2008 11:00:17
383
08/05/2008 10:46:37
2,983
261
Response.Clear in ASP.NET 3.5
I have recently upgraded some of my web applications to ASP.NET 3.5 by installing the framework on the server and setting up my web applications acrodingly and all is well, however. On some pages, I want to clear the current contents of the response buffer with code like this: Response.Clear(); // Output some stuff Response.End(); But this now isn't working in 3.5 when it did in 2.0. I have also tried setting the response buffer to false but this didn't work either. Can anyone let me know why it isn't working or if there is a work around?
asp.net
null
null
null
null
null
open
Response.Clear in ASP.NET 3.5 === I have recently upgraded some of my web applications to ASP.NET 3.5 by installing the framework on the server and setting up my web applications acrodingly and all is well, however. On some pages, I want to clear the current contents of the response buffer with code like this: Response.Clear(); // Output some stuff Response.End(); But this now isn't working in 3.5 when it did in 2.0. I have also tried setting the response buffer to false but this didn't work either. Can anyone let me know why it isn't working or if there is a work around?
0
62,159
09/15/2008 11:02:43
4,694
09/05/2008 09:30:26
111
9
Would you bother to mock StreamReader object ?
I use a stream reader to import some data and at the moment I hardcode a small sample file in the test to do the job. Is it sensible to use Mock Objects with this and how ?
.net
mocking
null
null
null
null
open
Would you bother to mock StreamReader object ? === I use a stream reader to import some data and at the moment I hardcode a small sample file in the test to do the job. Is it sensible to use Mock Objects with this and how ?
0
62,173
09/15/2008 11:08:45
6,461
09/15/2008 10:26:05
1
0
Where can I find a QR Code component/API for Windows Mobile?
I am looking for a **3rd party solution to integrate a QR code reader** in Windows Mobile Applications (.NET Compact Framework). I tried out the [QuickMark][1] reader, which can be called outside the application and communicates using Windows Messages. It works quiet well, but doesn't give me every option I need (e.g. it has to be installed etc.). Are there other good solutions which I may have missed? Anything Open Source? Tested on different devices? [1]: http://www.quickmark.com.tw/En/basic/index.asp
windows-mobile
qr-code
components
compactframework
null
null
open
Where can I find a QR Code component/API for Windows Mobile? === I am looking for a **3rd party solution to integrate a QR code reader** in Windows Mobile Applications (.NET Compact Framework). I tried out the [QuickMark][1] reader, which can be called outside the application and communicates using Windows Messages. It works quiet well, but doesn't give me every option I need (e.g. it has to be installed etc.). Are there other good solutions which I may have missed? Anything Open Source? Tested on different devices? [1]: http://www.quickmark.com.tw/En/basic/index.asp
0
62,188
09/15/2008 11:17:38
13
08/01/2008 04:18:04
1,562
65
Stack overflow code golf
To commemorate the public launch of Stack Overflow, what's the shortest code to cause a stack overflow? Any language welcome.
stack-overflow
code-golf
language-agnostic
fun
null
11/16/2011 01:25:20
not constructive
Stack overflow code golf === To commemorate the public launch of Stack Overflow, what's the shortest code to cause a stack overflow? Any language welcome.
4
62,201
09/15/2008 11:25:19
3,974
09/01/2008 06:18:59
214
9
How (and whether) to populate rails application with initial data
I've got a rails application where users have to log in. Therefore in order for the application to be usable, there must be one initial user in the system for the first person to log in with (they can then create subsequent users). Up to now I've used a migration to add a special user to the database. After asking [this question][1], it seems that I should be using db:schema:load, rather than running the migrations, to set up fresh databases on new development machines. Unfortunately, this doesn't seem to include the migrations which insert data, only those which set up tables, keys etc. My question is, what's the best way to handle this situation: - Is there a way to get d:s:l to include data-insertion migrations? - Should I not be using migrations at all to insert data this way? - Should I not be pre-populating the database with data at all? Should I update the application code so that it handles the case where there are no users gracefully, and lets an initial user account be created live from within the application? - Any other options? :) [1]: http://stackoverflow.com/questions/62038/rails-model-validators-break-earlier-migrations
ruby-on-rails
data-migration
null
null
null
null
open
How (and whether) to populate rails application with initial data === I've got a rails application where users have to log in. Therefore in order for the application to be usable, there must be one initial user in the system for the first person to log in with (they can then create subsequent users). Up to now I've used a migration to add a special user to the database. After asking [this question][1], it seems that I should be using db:schema:load, rather than running the migrations, to set up fresh databases on new development machines. Unfortunately, this doesn't seem to include the migrations which insert data, only those which set up tables, keys etc. My question is, what's the best way to handle this situation: - Is there a way to get d:s:l to include data-insertion migrations? - Should I not be using migrations at all to insert data this way? - Should I not be pre-populating the database with data at all? Should I update the application code so that it handles the case where there are no users gracefully, and lets an initial user account be created live from within the application? - Any other options? :) [1]: http://stackoverflow.com/questions/62038/rails-model-validators-break-earlier-migrations
0
62,219
09/15/2008 11:41:43
5,056
09/07/2008 15:43:17
806
62
Is there any way to get rid of the long list of usings at the top of my .cs files?
Simple question - As I get more and more namespaces in my solution, the list of using statements at the top of my files grows longer and longer. This is especially the case in my unit tests where for each component that might be called I need to include the using for the interface, the IoC container, and the concrete type. With upward of 17 lines of usings in my integration test files its just getting downright messy. Does anyone know if theres a way to define a macro for my base using statements? Any other solutions?
c#
.net
visual-studio
namespaces
organizing
null
open
Is there any way to get rid of the long list of usings at the top of my .cs files? === Simple question - As I get more and more namespaces in my solution, the list of using statements at the top of my files grows longer and longer. This is especially the case in my unit tests where for each component that might be called I need to include the using for the interface, the IoC container, and the concrete type. With upward of 17 lines of usings in my integration test files its just getting downright messy. Does anyone know if theres a way to define a macro for my base using statements? Any other solutions?
0
62,222
09/15/2008 11:42:56
3,885
08/31/2008 16:43:36
86
5
Centos or Debian as a server OS ?
What would you choose for a server used for web hosting, dns and email and why?
debian
centos
null
null
null
02/05/2011 11:04:28
off topic
Centos or Debian as a server OS ? === What would you choose for a server used for web hosting, dns and email and why?
2
62,225
09/15/2008 11:44:26
6,511
09/15/2008 11:44:26
1
0
Classis ASP debugging global.asa in VS2005
I was trying to set a breakpoint in global.asa in an old classis ASP project with IIS 6 in Visual Studio 2005. Somehow the context menu for actually setting the breakpoint somewhere in global.asa is disabled (greyed). How can I set a breakpoint then? Breakpoints in .asp pages are no problem though and do work fine.
debugging
asp
classic
global.asa
vs
null
open
Classis ASP debugging global.asa in VS2005 === I was trying to set a breakpoint in global.asa in an old classis ASP project with IIS 6 in Visual Studio 2005. Somehow the context menu for actually setting the breakpoint somewhere in global.asa is disabled (greyed). How can I set a breakpoint then? Breakpoints in .asp pages are no problem though and do work fine.
0
62,226
09/15/2008 11:45:06
6,260
09/13/2008 11:43:24
31
1
How do I access class variables of a parent object in PHP?
An instance of class A instanciates a couple of other objects, say for example from class B: $foo = new B(); I would like to access A's public class variables from methods within B. Unless I'm missing something, the only way to do this is to pass the current object to the instances of B: $foo = new B($this); Is this best practice or is there another way to do this?
oop
php5
null
null
null
null
open
How do I access class variables of a parent object in PHP? === An instance of class A instanciates a couple of other objects, say for example from class B: $foo = new B(); I would like to access A's public class variables from methods within B. Unless I'm missing something, the only way to do this is to pass the current object to the instances of B: $foo = new B($this); Is this best practice or is there another way to do this?
0
62,241
09/15/2008 11:51:48
3,885
08/31/2008 16:43:36
86
6
How to convert a Reader to InputStream and a Writer to OutputStream ?
Is there an easy way to avoid dealing with text encoding problems?
java
stream
null
null
null
null
open
How to convert a Reader to InputStream and a Writer to OutputStream ? === Is there an easy way to avoid dealing with text encoding problems?
0
62,245
09/15/2008 11:54:16
5,601
09/10/2008 14:34:01
1
2
Merging records for Mnesia
I am trying to refactor some code I have for software that collects current status of agents in a call queue. Currently, for each of the 6 or so events that I listen to, I check in a mnesia table if an agent exists and change some values in the row depending on the event or add it as new if the agent doesn't exist. Currently I have this mnesia transaction in each event and of course that is a bunch of repeated code for checking the existance of agents and so on. I'm trying to change it so that there is one function like *change_agent/2* that I call from the events that handles this for me. My problems are of course records.... I find no way of dynamically creating them or merging 2 of them together or anything. Preferably there would be a function I could call like: change_agent("001", #agent(id = "001", name = "Steve")). change_agent("001", #agent(id = "001", paused = 0, talking_to = "None")). Any ideas?
erlang
mnesia
null
null
null
null
open
Merging records for Mnesia === I am trying to refactor some code I have for software that collects current status of agents in a call queue. Currently, for each of the 6 or so events that I listen to, I check in a mnesia table if an agent exists and change some values in the row depending on the event or add it as new if the agent doesn't exist. Currently I have this mnesia transaction in each event and of course that is a bunch of repeated code for checking the existance of agents and so on. I'm trying to change it so that there is one function like *change_agent/2* that I call from the events that handles this for me. My problems are of course records.... I find no way of dynamically creating them or merging 2 of them together or anything. Preferably there would be a function I could call like: change_agent("001", #agent(id = "001", name = "Steve")). change_agent("001", #agent(id = "001", paused = 0, talking_to = "None")). Any ideas?
0