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
68,085
09/16/2008 00:01:02
2,600
08/23/2008 13:40:14
2,820
131
Looking for a very basic introduction to SQL
I'm looking for a webpage or some other resource that provides a very basic introduction to SQL queries. I'm teaching a class on Geographic Information Systems and I'd like to go into a bit more depth on SQL than the textbook does, but I still want a written resource that I can point the students to. Most of the class are not computer geeks, so I need something that's fairly basic and isn't going to scare them off or confuse them too much.
sql
gis
null
null
null
null
open
Looking for a very basic introduction to SQL === I'm looking for a webpage or some other resource that provides a very basic introduction to SQL queries. I'm teaching a class on Geographic Information Systems and I'd like to go into a bit more depth on SQL than the textbook does, but I still want a written resource that I can point the students to. Most of the class are not computer geeks, so I need something that's fairly basic and isn't going to scare them off or confuse them too much.
0
68,100
09/16/2008 00:04:07
568
08/06/2008 19:50:58
836
36
Good ways to get up to speed on a complex project
The title says it all, but I'm curious to find methods that people use that I never thought about. Considering my relatively short history with development, I've never had to deal with massive code bases. What sort of things do you do to get familiar with a large, complex, code base as fast as you can to be effective?
productivity
null
null
null
null
null
open
Good ways to get up to speed on a complex project === The title says it all, but I'm curious to find methods that people use that I never thought about. Considering my relatively short history with development, I've never had to deal with massive code bases. What sort of things do you do to get familiar with a large, complex, code base as fast as you can to be effective?
0
68,103
09/16/2008 00:05:01
7,441
09/15/2008 13:45:09
46
5
How do I copy image data to the clipboard in my XUL application?
I have a XULRunner application that needs to copy image data to the clipboard. I have figured out how to handle copying text to the clipboard, and I can paste PNG data from the clipboard. What I can't figure out is how to get data from a data URL into the clipboard so that it can be pasted into other applications. This is the code I use to copy text (well, XUL): var transferObject=Components.classes["@mozilla.org/widget/transferable;1"]. createInstance(Components.interfaces.nsITransferable); var stringWrapper=Components.classes["@mozilla.org/supports-string;1"]. createInstance(Components.interfaces.nsISupportsString); var systemClipboard=Components.classes["@mozilla.org/widget/clipboard;1"]. createInstance(Components.interfaces.nsIClipboard); var objToSerialize=aDOMNode; transferObject.addDataFlavor("text/xul"); var xmls=new XMLSerializer(); var serializedObj=xmls.serializeToString(objToSerialize); stringWrapper.data=serializedObj; transferObject.setTransferData("text/xul",stringWrapper,serializedObj.length*2); And, as I said, the data I'm trying to transfer is a PNG as a data URL. So I'm looking for the equivalent to the above that will allow, e.g. Paint.NET to paste my app's data. Thanks in advance.
javascript
xul
xpcom
xulrunner
null
null
open
How do I copy image data to the clipboard in my XUL application? === I have a XULRunner application that needs to copy image data to the clipboard. I have figured out how to handle copying text to the clipboard, and I can paste PNG data from the clipboard. What I can't figure out is how to get data from a data URL into the clipboard so that it can be pasted into other applications. This is the code I use to copy text (well, XUL): var transferObject=Components.classes["@mozilla.org/widget/transferable;1"]. createInstance(Components.interfaces.nsITransferable); var stringWrapper=Components.classes["@mozilla.org/supports-string;1"]. createInstance(Components.interfaces.nsISupportsString); var systemClipboard=Components.classes["@mozilla.org/widget/clipboard;1"]. createInstance(Components.interfaces.nsIClipboard); var objToSerialize=aDOMNode; transferObject.addDataFlavor("text/xul"); var xmls=new XMLSerializer(); var serializedObj=xmls.serializeToString(objToSerialize); stringWrapper.data=serializedObj; transferObject.setTransferData("text/xul",stringWrapper,serializedObj.length*2); And, as I said, the data I'm trying to transfer is a PNG as a data URL. So I'm looking for the equivalent to the above that will allow, e.g. Paint.NET to paste my app's data. Thanks in advance.
0
68,109
09/16/2008 00:05:38
10,577
09/16/2008 00:05:38
1
0
Does Java save its runtime optimizations?
My professor did an informal benchmark on a little program and the Java times were: 1.7 seconds for the first run, and 0.8 seconds for the runs thereafter. Is this due entirely to the loading of the runtime environment into the operating environment or is it influenced by Java's optimizing the code and storing the results of those optimizations (sorry, I don't know the technical term for that)? Thanks! Matt
java
optimization
caching
null
null
null
open
Does Java save its runtime optimizations? === My professor did an informal benchmark on a little program and the Java times were: 1.7 seconds for the first run, and 0.8 seconds for the runs thereafter. Is this due entirely to the loading of the runtime environment into the operating environment or is it influenced by Java's optimizing the code and storing the results of those optimizations (sorry, I don't know the technical term for that)? Thanks! Matt
0
68,113
09/16/2008 00:06:34
10,273
09/15/2008 22:04:51
1
0
How to create a windows service from java app
I've just inherited a java application that needs to be installed as a service on XP and vista. It's been about 8 years since I've used windows in any form and I've never had to create a service, let alone from something like a java app (I've got a jar for the app and a single dependency jar - log4j). What is the magic necessary to make this run as a service? I've got the source, so code modifications, though preferably avoided, are possible.
java
windows
service
null
null
null
open
How to create a windows service from java app === I've just inherited a java application that needs to be installed as a service on XP and vista. It's been about 8 years since I've used windows in any form and I've never had to create a service, let alone from something like a java app (I've got a jar for the app and a single dependency jar - log4j). What is the magic necessary to make this run as a service? I've got the source, so code modifications, though preferably avoided, are possible.
0
68,114
09/16/2008 00:06:38
313,475
09/16/2008 00:01:29
1
1
General purpose javascript library for building rich internet applications
What is the *single* most useful general purpose javascript library for building rich internet applications?
javascript
ria
null
null
null
05/05/2012 13:42:39
not constructive
General purpose javascript library for building rich internet applications === What is the *single* most useful general purpose javascript library for building rich internet applications?
4
68,120
09/16/2008 00:07:20
10,452
09/15/2008 23:15:14
1
0
Wildcards for resources in a Tomcat Servlet's context.xml
I'm not overly familiar with Tomcat, but my team has inherited a complex project that revolves around a Java Servlet being hosted in Tomcat across many servers. Custom configuration management software is used to write out the server.xml, and various resources (connection pools, beans, server variables, etc) written into server.xml configure the servlet. This is all well and good. However, the names of some of the resources aren't known in advance. For example, the Servlet may need access to any number of "Anonymizers" as configured by the operator. Each anonymizer has a unique name associated with it. We create and configure each anonymizer using java beans similar to the following: <Resource name="bean/Anonymizer_toon" type="com.company.tomcatutil.AnonymizerBean" factory="org.apache.naming.factory.BeanFactory" className="teAnonymizer" databaseId="50" /> <Resource name="bean/Anonymizer_default" type="com.company.tomcatutil.AnonymizerBean" factory="org.apache.naming.factory.BeanFactory" className="teAnonymizer" databaseId="54" /> However, this appears to require us to have explicit entries in the Servlet's context.xml file for each an every possible resource name in advance. I'd like to replace the explicit context.xml entries with wildcards, or know if there is a better solution to this type of problem. Currently: <ResourceLink name="bean/Anonymizer_default" global="bean/Anonymizer_default" type="com.company.tomcatutil.AnonymizerBean"/> <ResourceLink name="bean/Anonymizer_toon" global="bean/Anonymizer_toon" type="com.company.tomcatutil.AnonymizerBean"/> Replaced with something like: <ResourceLink name="bean/Anonymizer_*" global="bean/Anonymizer_*" type="com.company.tomcatutil.AnonymizerBean"/> However, I haven't been able to figure out if this is possible or what the correct syntax might be. Can anyone make any suggestions about better ways to handle this?
java
tomcat
null
null
null
null
open
Wildcards for resources in a Tomcat Servlet's context.xml === I'm not overly familiar with Tomcat, but my team has inherited a complex project that revolves around a Java Servlet being hosted in Tomcat across many servers. Custom configuration management software is used to write out the server.xml, and various resources (connection pools, beans, server variables, etc) written into server.xml configure the servlet. This is all well and good. However, the names of some of the resources aren't known in advance. For example, the Servlet may need access to any number of "Anonymizers" as configured by the operator. Each anonymizer has a unique name associated with it. We create and configure each anonymizer using java beans similar to the following: <Resource name="bean/Anonymizer_toon" type="com.company.tomcatutil.AnonymizerBean" factory="org.apache.naming.factory.BeanFactory" className="teAnonymizer" databaseId="50" /> <Resource name="bean/Anonymizer_default" type="com.company.tomcatutil.AnonymizerBean" factory="org.apache.naming.factory.BeanFactory" className="teAnonymizer" databaseId="54" /> However, this appears to require us to have explicit entries in the Servlet's context.xml file for each an every possible resource name in advance. I'd like to replace the explicit context.xml entries with wildcards, or know if there is a better solution to this type of problem. Currently: <ResourceLink name="bean/Anonymizer_default" global="bean/Anonymizer_default" type="com.company.tomcatutil.AnonymizerBean"/> <ResourceLink name="bean/Anonymizer_toon" global="bean/Anonymizer_toon" type="com.company.tomcatutil.AnonymizerBean"/> Replaced with something like: <ResourceLink name="bean/Anonymizer_*" global="bean/Anonymizer_*" type="com.company.tomcatutil.AnonymizerBean"/> However, I haven't been able to figure out if this is possible or what the correct syntax might be. Can anyone make any suggestions about better ways to handle this?
0
68,136
09/16/2008 00:10:24
10,354
09/15/2008 22:37:00
1
1
Plone-like search box in Django?
Plone has a beautiful search box with a "Google suggest" like functionality for its site. It even indexes uploaded documents like PDFs. Does anyone know of a module that can provide this kind of functionality in a Django site?
django
search
null
null
null
null
open
Plone-like search box in Django? === Plone has a beautiful search box with a "Google suggest" like functionality for its site. It even indexes uploaded documents like PDFs. Does anyone know of a module that can provide this kind of functionality in a Django site?
0
68,144
09/16/2008 00:12:14
10,592
09/16/2008 00:12:14
1
0
Using XmlRpc in C++ and Windows
I need to use XmlRpc in C++ on a Windows platform. Despite the fact that my friends assure me that XmlRpc is a "widely available standard technology", there are not many libraries available for it. In fact I only found one library to do this on Windows, (plus another one that claims "you'll have to do a lot of work to get this to compile on Windows). The library I found was Chris Morley's "XmlRpc++". However, it doesn't have support for SSL. My question therefore is: what library should I be using?
c++
windows
ssl
xmlrpc
null
null
open
Using XmlRpc in C++ and Windows === I need to use XmlRpc in C++ on a Windows platform. Despite the fact that my friends assure me that XmlRpc is a "widely available standard technology", there are not many libraries available for it. In fact I only found one library to do this on Windows, (plus another one that claims "you'll have to do a lot of work to get this to compile on Windows). The library I found was Chris Morley's "XmlRpc++". However, it doesn't have support for SSL. My question therefore is: what library should I be using?
0
68,150
09/16/2008 00:13:16
7,545
09/15/2008 13:56:58
60
3
How Long Do You Keep Your Code?
I took a data structures class in C++ last year, and consequently implemented all the major data structures in templated code. I saved it all on a flash drive because I have a feeling that at some point in my life, I'll use it again. I imagine *something* I end up programming will need a B-Tree, or is that just delusional? How long do you typically save the code you write for possible reuse?
code-reuse
null
null
null
null
null
open
How Long Do You Keep Your Code? === I took a data structures class in C++ last year, and consequently implemented all the major data structures in templated code. I saved it all on a flash drive because I have a feeling that at some point in my life, I'll use it again. I imagine *something* I end up programming will need a B-Tree, or is that just delusional? How long do you typically save the code you write for possible reuse?
0
68,152
09/16/2008 00:13:22
10,589
09/16/2008 00:10:23
1
0
BASIC Programming
I'm looking for a IDE that allows me to compile/run/debug BASIC code. Any help is appreciated!!
basic
null
null
null
null
null
open
BASIC Programming === I'm looking for a IDE that allows me to compile/run/debug BASIC code. Any help is appreciated!!
0
68,156
09/16/2008 00:13:58
2,443
08/22/2008 10:53:30
1,173
51
Doing away with Globals?
I have a set of tree objects with a depth somewhere in the 20s. Each of the nodes in this tree needs access to its tree's root. A couple of solutions: 1. Each node can store a reference to the root directly (wastes memory) - I can compute the root at runtime by "going up" (wastes cycles) - I can use static fields (but this amounts to globals) Can someone provide a design that doesn't use a global (in any variation) but is more efficient that #1 or #2 in both memory or cycles respectively?
c#
java
oop
null
null
null
open
Doing away with Globals? === I have a set of tree objects with a depth somewhere in the 20s. Each of the nodes in this tree needs access to its tree's root. A couple of solutions: 1. Each node can store a reference to the root directly (wastes memory) - I can compute the root at runtime by "going up" (wastes cycles) - I can use static fields (but this amounts to globals) Can someone provide a design that doesn't use a global (in any variation) but is more efficient that #1 or #2 in both memory or cycles respectively?
0
68,169
09/16/2008 00:16:27
10,088
09/15/2008 21:09:09
18
2
What's the right way to branch with Visual Source Safe?
What I currently do is I link the project to another location and give it the same name, then check the box where it says "Branch after share." And then I would Check out the shared project and work off it. And finally merge with the original project. This works okay, but it feels very clunky: I have multiple instances of the project on my drive; I have to change physical address of the website (i use asp.net 1.1) every time I work on a different branch; That doesn't feel like the right way to do it. How do you branch your projects with VSS?
source
branch
safe
null
null
null
open
What's the right way to branch with Visual Source Safe? === What I currently do is I link the project to another location and give it the same name, then check the box where it says "Branch after share." And then I would Check out the shared project and work off it. And finally merge with the original project. This works okay, but it feels very clunky: I have multiple instances of the project on my drive; I have to change physical address of the website (i use asp.net 1.1) every time I work on a different branch; That doesn't feel like the right way to do it. How do you branch your projects with VSS?
0
68,174
09/16/2008 00:17:06
9,411
09/15/2008 18:43:54
18
2
What is the best way to build an index to get the fastest read response?
I need to index up to 500,000 entries for fastest read. The index needs to be rebuilt periodically , on disk.
indexing
null
null
null
null
null
open
What is the best way to build an index to get the fastest read response? === I need to index up to 500,000 entries for fastest read. The index needs to be rebuilt periodically , on disk.
0
68,209
09/16/2008 00:22:52
10,511
09/15/2008 23:33:54
1
1
Microsoft Reporting Services WebServices and Java
Has anyone successfully implemented a Java based solution that uses Microsoft SQL Server 2005 Reporting Services? Reporting Services comes with a set of Web Services that allow you to control the creation of a report, execution of a report, etc and I am just starting development on a POC of this integration. A couple of choices I have yet to make is whether I want to use Axis2 for the wsdl-to-java functionality or use WebLogic's clientgen (wsdl 2 java) solution. I guess I can also use JAX-WS and wsimport. Before I dive into this, I wanted to see if anyone was doing this successfully with one of the many options available. In the past, I've had a few issues on how null/blank/empty's are handled between .NET and Java web-services and I just wanted to see if this had come up as an issue with SSRS and Java integration. Thanks
java
web-services
reporting-services
webservice
axis
null
open
Microsoft Reporting Services WebServices and Java === Has anyone successfully implemented a Java based solution that uses Microsoft SQL Server 2005 Reporting Services? Reporting Services comes with a set of Web Services that allow you to control the creation of a report, execution of a report, etc and I am just starting development on a POC of this integration. A couple of choices I have yet to make is whether I want to use Axis2 for the wsdl-to-java functionality or use WebLogic's clientgen (wsdl 2 java) solution. I guess I can also use JAX-WS and wsimport. Before I dive into this, I wanted to see if anyone was doing this successfully with one of the many options available. In the past, I've had a few issues on how null/blank/empty's are handled between .NET and Java web-services and I just wanted to see if this had come up as an issue with SSRS and Java integration. Thanks
0
68,234
09/16/2008 00:26:56
1,684
08/18/2008 00:31:07
51
1
MVC Retrieve Model On Every Request
Let’s say I'm developing a helpdesk application that will be used by multiple departments. Every URL in the application will include a key indicating the specific department. The key will always be the first parameter of every action in the system. For example http://helpdesk/HR/Members http://helpdesk/HR/Members/PeterParker http://helpdesk/HR/Categories http://helpdesk/Finance/Members http://helpdesk/Finance/Members/BruceWayne http://helpdesk/Finance/Categories The problem is that in each action on each request, I have to take this parameter and then retrieve the Helpdesk Department model from the repository based on that key. From that model I can retrieve the list of members, categories etc., which is different for each Helpdesk Department. This obviously violates DRY. My question is, how can I create a base controller, which does this for me so that the particular Helpdesk Department specified in the URL is available to all derived controllers, and I can just focus on the actions? Any help is much appreciated
asp.net-mvc
mvc
null
null
null
null
open
MVC Retrieve Model On Every Request === Let’s say I'm developing a helpdesk application that will be used by multiple departments. Every URL in the application will include a key indicating the specific department. The key will always be the first parameter of every action in the system. For example http://helpdesk/HR/Members http://helpdesk/HR/Members/PeterParker http://helpdesk/HR/Categories http://helpdesk/Finance/Members http://helpdesk/Finance/Members/BruceWayne http://helpdesk/Finance/Categories The problem is that in each action on each request, I have to take this parameter and then retrieve the Helpdesk Department model from the repository based on that key. From that model I can retrieve the list of members, categories etc., which is different for each Helpdesk Department. This obviously violates DRY. My question is, how can I create a base controller, which does this for me so that the particular Helpdesk Department specified in the URL is available to all derived controllers, and I can just focus on the actions? Any help is much appreciated
0
68,282
09/16/2008 00:39:55
4,883
09/06/2008 10:24:59
1,059
10
Why do you need explicitly have the "self" argument into a Python method?
When defining a method on a class in Python, it looks something like this: class MyClass(object): def __init__(self, x, y): self.x = x self.y = y But in some other languages, such as C#, you have a reference to the object that the method is bound to with the "this" keyword without declaring it as an argument in the method prototype. Was this an intentional language design decision in Python or are there some implementation details that require the passing of "self" as an argument?
python
null
null
null
null
null
open
Why do you need explicitly have the "self" argument into a Python method? === When defining a method on a class in Python, it looks something like this: class MyClass(object): def __init__(self, x, y): self.x = x self.y = y But in some other languages, such as C#, you have a reference to the object that the method is bound to with the "this" keyword without declaring it as an argument in the method prototype. Was this an intentional language design decision in Python or are there some implementation details that require the passing of "self" as an argument?
0
68,283
09/16/2008 00:40:03
10,606
09/16/2008 00:20:54
1
0
View/edit MP3 id3 data in C#
What's a quick and easy way to view and edit MP3 id3 tags (artist, album, etc.) using C#?
c#
mp3
null
null
null
null
open
View/edit MP3 id3 data in C# === What's a quick and easy way to view and edit MP3 id3 tags (artist, album, etc.) using C#?
0
68,291
09/16/2008 00:41:48
281
08/04/2008 12:13:17
28
2
A/B testing on a news site to improve relevance
If you were running a news site that created a list of 10 top news stories, and you wanted to make tweaks to your algorithm and see if people liked the new top story mix better, how would you approach this? Simple Click logging in the DB associated with the post entry? A/B testing where you would show one version of the algorithm togroup A and another to group B and measure the clicks? What sort of characteristics would you base your decision on as to whether the changes were better?
algorithm
testing
null
null
null
null
open
A/B testing on a news site to improve relevance === If you were running a news site that created a list of 10 top news stories, and you wanted to make tweaks to your algorithm and see if people liked the new top story mix better, how would you approach this? Simple Click logging in the DB associated with the post entry? A/B testing where you would show one version of the algorithm togroup A and another to group B and measure the clicks? What sort of characteristics would you base your decision on as to whether the changes were better?
0
68,296
09/16/2008 00:42:41
6,010
09/11/2008 23:17:19
41
6
How do you quantify the advantages of programming environments?
I'm looking at starting a project with a team of really smart people with backgrounds in various assorted languages and programming environments. The only constraint is that it's "web-based." In this situation, how would you decide what technology to base your project on? All of us have our own favorite systems, but how can you quantify what the best way to proceed is? StackOverflow is built on ASP.NET because, as Jeff put it in podcast #3: > So it's sort of like 1.5 developers, so I need to actually get things done. In order to do that, I'm gonna fall back on what I know, and what I know is essentially ASP.NET. Again, I'm not looking for nominations for your favorite platform, but more interestingly, how did you arrive there, if there were multiple obvious options?
programming-languages
frameworks
language-agnostic
null
null
null
open
How do you quantify the advantages of programming environments? === I'm looking at starting a project with a team of really smart people with backgrounds in various assorted languages and programming environments. The only constraint is that it's "web-based." In this situation, how would you decide what technology to base your project on? All of us have our own favorite systems, but how can you quantify what the best way to proceed is? StackOverflow is built on ASP.NET because, as Jeff put it in podcast #3: > So it's sort of like 1.5 developers, so I need to actually get things done. In order to do that, I'm gonna fall back on what I know, and what I know is essentially ASP.NET. Again, I'm not looking for nominations for your favorite platform, but more interestingly, how did you arrive there, if there were multiple obvious options?
0
68,298
09/16/2008 00:43:08
10,636
09/16/2008 00:35:52
1
0
Good Java Practices in Ubuntu
Hey all, my Computational Science course this semester is entirely in Java. I was wondering if there was a good/preferred set of tools to use in ubuntu. Currently I use gedit with a terminal running in the bottom, but I'd like an API browser. I've considered Eclipse, but it seems to bloated and unfriendly for quick programs.
java
ubuntu
linux
school
null
null
open
Good Java Practices in Ubuntu === Hey all, my Computational Science course this semester is entirely in Java. I was wondering if there was a good/preferred set of tools to use in ubuntu. Currently I use gedit with a terminal running in the bottom, but I'd like an API browser. I've considered Eclipse, but it seems to bloated and unfriendly for quick programs.
0
68,307
09/16/2008 00:44:21
5,872
09/11/2008 14:47:11
1
0
How can I make a shortcut start in a different directory when running it as an administrator on Windows Vista?
I have a shortcut on my desktop which opens a command prompt with many arguments that I need. I set the 'start in' field to d:\ and it works as expected (the prompt starts in d:\). When I choose Advanced -> run as administrator and then open the shortcut, it starts in C:\Windows\System32, even though I have not changed the 'start in' field. How can I get it to start in d:\?
windows-vista
uac
windows
shortcuts
null
null
open
How can I make a shortcut start in a different directory when running it as an administrator on Windows Vista? === I have a shortcut on my desktop which opens a command prompt with many arguments that I need. I set the 'start in' field to d:\ and it works as expected (the prompt starts in d:\). When I choose Advanced -> run as administrator and then open the shortcut, it starts in C:\Windows\System32, even though I have not changed the 'start in' field. How can I get it to start in d:\?
0
68,312
09/16/2008 00:46:13
1,115,144
09/15/2008 16:09:15
102
5
Does anyone have a good resource for mobile CSS templates that work on most phones/devices?
More and more mobile devices are consuming content on my eCommerce sites. IPhones, Blackberries, PSPs, Windows Mobile, etc and I need some ideas how to handle repurposing my data using CSS templates for these devices. Any ideas would be great.
css
templates
mobile
null
null
null
open
Does anyone have a good resource for mobile CSS templates that work on most phones/devices? === More and more mobile devices are consuming content on my eCommerce sites. IPhones, Blackberries, PSPs, Windows Mobile, etc and I need some ideas how to handle repurposing my data using CSS templates for these devices. Any ideas would be great.
0
68,323
09/16/2008 00:47:54
10,583
09/16/2008 00:07:53
1
0
What is the best way to implement soft deletion?
Working on a project at the moment and we have to implement soft deletion for the majority of users (user roles). We decided to add an "is_deleted='0'" field on each table in the database and set it to '1' if particular user roles hit a delete button on a specific record. For future maintenance now, each SELECT query will need to ensure they do not include records where is_deleted='1'. Is there a better solution for implementing soft deletion?
sql
database
backup
data
null
null
open
What is the best way to implement soft deletion? === Working on a project at the moment and we have to implement soft deletion for the majority of users (user roles). We decided to add an "is_deleted='0'" field on each table in the database and set it to '1' if particular user roles hit a delete button on a specific record. For future maintenance now, each SELECT query will need to ensure they do not include records where is_deleted='1'. Is there a better solution for implementing soft deletion?
0
68,327
09/16/2008 00:48:37
680
08/07/2008 17:29:04
787
19
Change command Method for Tkinter Button in Python
I create a new Button object but did not specify the `command` option upon creation. Is there a way in Tkinter to change the command (onclick) function after the object has been created?
python
gui
tkinter
null
null
null
open
Change command Method for Tkinter Button in Python === I create a new Button object but did not specify the `command` option upon creation. Is there a way in Tkinter to change the command (onclick) function after the object has been created?
0
68,335
09/16/2008 00:50:10
10,668
09/16/2008 00:50:10
1
0
How do I copy a file to a remote server in python using scp or ssh?
I have a text file on my local machine that is generated by a python script run daily in cron. I would like to add a bit of code to have that file sent securely to my server over ssh. Help.
python
null
null
null
null
null
open
How do I copy a file to a remote server in python using scp or ssh? === I have a text file on my local machine that is generated by a python script run daily in cron. I would like to add a bit of code to have that file sent securely to my server over ssh. Help.
0
68,340
09/16/2008 00:51:01
9,094
09/15/2008 17:42:46
21
1
What level of complexity requires a framework?
At what level of complexity is it mandatory to switch to an existing framework for web development? What measurement of complexity is practical for web development? Code length? Feature list? Database Size?
complexity
frameworks
null
null
null
null
open
What level of complexity requires a framework? === At what level of complexity is it mandatory to switch to an existing framework for web development? What measurement of complexity is practical for web development? Code length? Feature list? Database Size?
0
68,346
09/16/2008 00:52:53
10,675
09/16/2008 00:52:53
1
0
Implement symmetric difference in SQL Server?
Here's a problem I've been trying to solve at work. I'm not a database expert, so that perhaps this is a bit sophomoric. All apologies. I have a given database D, which has been duplicated on another machine (in a perhaps dubious manner), resulting in database D'. It is my task to check that database D and D' are in fact exactly identical. The problem, of course, is what to actually do if they are not. For this purpose, my thought was to run a symmetric difference on each corresponding table and see the differences. There is a "large" number of tables, so I do not wish to run each symmetric difference by hand. How do I then implement a symmetric difference "function" (or stored procedure, or whatever you'd like) that can run on arbitrary tables without having to explicitly enumerate the columns? This is running on Windows, and your hedge fund will explode if you don't follow through. Good luck.
sql
server
difference
minus
symmetric
null
open
Implement symmetric difference in SQL Server? === Here's a problem I've been trying to solve at work. I'm not a database expert, so that perhaps this is a bit sophomoric. All apologies. I have a given database D, which has been duplicated on another machine (in a perhaps dubious manner), resulting in database D'. It is my task to check that database D and D' are in fact exactly identical. The problem, of course, is what to actually do if they are not. For this purpose, my thought was to run a symmetric difference on each corresponding table and see the differences. There is a "large" number of tables, so I do not wish to run each symmetric difference by hand. How do I then implement a symmetric difference "function" (or stored procedure, or whatever you'd like) that can run on arbitrary tables without having to explicitly enumerate the columns? This is running on Windows, and your hedge fund will explode if you don't follow through. Good luck.
0
68,352
09/16/2008 00:53:58
3,101
08/26/2008 16:37:25
108
6
List comparison
I use this question in interviews and I wonder what the best solution is. Write a Perl sub that takes *n* lists, and then returns *n*^2-1 lists telling you which items are in which lists; that is, which items are in the first list, the second, list, both the first and second list, and all other combinations of lists. Assume that *n* is reasonably small (less than 20). For example: list_compare([1, 3], [2, 3]); => ([1], [2], [3]); Here, the first result list gives all items that are only in list 1, the second result list gives all items that are only in list 2, and the third result list gives all items that are in both lists. list_compare([1, 3, 5, 7], [2, 3, 6, 7], [4, 5, 6, 7]) => ([1], [2], [3], [4], [5], [6], [7]) Here, the first list gives all items that are only in list 1, the second list gives all items that are only in list 2, and the third list gives all items that are in both lists 1 and 2, as in the first example. The fourth list gives all items that are only in list 3, the fifth list gives all items that are only in lists 1 and 3, the sixth list gives all items that are only in lists 2 and 3, and the seventh list gives all items that are in all 3 lists. I usually give this problem as a follow up to the subset of this problem for *n*=2. What is the solution?
perl
interview-questions
null
null
null
null
open
List comparison === I use this question in interviews and I wonder what the best solution is. Write a Perl sub that takes *n* lists, and then returns *n*^2-1 lists telling you which items are in which lists; that is, which items are in the first list, the second, list, both the first and second list, and all other combinations of lists. Assume that *n* is reasonably small (less than 20). For example: list_compare([1, 3], [2, 3]); => ([1], [2], [3]); Here, the first result list gives all items that are only in list 1, the second result list gives all items that are only in list 2, and the third result list gives all items that are in both lists. list_compare([1, 3, 5, 7], [2, 3, 6, 7], [4, 5, 6, 7]) => ([1], [2], [3], [4], [5], [6], [7]) Here, the first list gives all items that are only in list 1, the second list gives all items that are only in list 2, and the third list gives all items that are in both lists 1 and 2, as in the first example. The fourth list gives all items that are only in list 3, the fifth list gives all items that are only in lists 1 and 3, the sixth list gives all items that are only in lists 2 and 3, and the seventh list gives all items that are in all 3 lists. I usually give this problem as a follow up to the subset of this problem for *n*=2. What is the solution?
0
68,372
09/16/2008 00:55:59
3,499
08/28/2008 19:39:37
301
27
What are some of your favorite little known command-line tricks using Bash?
We all know how to use &lt;CTRL&gt;-R to reverse search through history, but did you know you can use &lt;CTRL&gt;-S to forward search if you set `stty stop ""`? Also, have you ever tried running bind -p to see all of your keyboard shortcuts listed? There are over 455 on Mac OS X by default. What are some of your favorite obscure tricks, keyboard shortcuts and shopt configuration using bash?
bash
null
null
null
null
05/27/2011 21:59:18
not a real question
What are some of your favorite little known command-line tricks using Bash? === We all know how to use &lt;CTRL&gt;-R to reverse search through history, but did you know you can use &lt;CTRL&gt;-S to forward search if you set `stty stop ""`? Also, have you ever tried running bind -p to see all of your keyboard shortcuts listed? There are over 455 on Mac OS X by default. What are some of your favorite obscure tricks, keyboard shortcuts and shopt configuration using bash?
1
68,391
09/16/2008 01:00:29
841
08/09/2008 09:37:17
129
9
How to write a Rails mixin that spans across model, controller, and view.
In an effort to reduce code duplication in my little Rails app, I've been working on getting common code between my models into it's own separate module, so far so good. The model stuff is fairly easy, I just have to include the module at the beginning, e.g.: class Iso < Sale include Shared::TracksSerialNumberExtension include Shared::OrderLines extend Shared::Filtered include Sendable::Model validates_presence_of :customer validates_associated :lines owned_by :customer def initialize( params = nil ) super self.created_at ||= Time.now.to_date end def after_initialize end order_lines :despatched # tracks_serial_numbers :items sendable :customer def created_at=( date ) write_attribute( :created_at, Chronic.parse( date ) ) end end This is working fine, now however, I'm going to have some controller and view code that's going to be common between these models as well, so far I have this for my sendable stuff: # This is a module that is used for pages/forms that are can be "sent" # either via fax, email, or printed. module Sendable module Model def self.included( klass ) klass.extend ClassMethods end module ClassMethods def sendable( class_to_send_to ) attr_accessor :fax_number, :email_address, :to_be_faxed, :to_be_emailed, :to_be_printed @_class_sending_to ||= class_to_send_to include InstanceMethods end def class_sending_to @_class_sending_to end end # ClassMethods module InstanceMethods def after_initialize( ) super self.to_be_faxed = false self.to_be_emailed = false self.to_be_printed = false target_class = self.send( self.class.class_sending_to ) if !target_class.nil? self.fax_number = target_class.send( :fax_number ) self.email_address = target_class.send( :email_address ) end end end end # Module Model end # Module Sendable Basically I'm planning on just doing an include Sendable::Controller, and Sendable::View (or the equivalent) for the controller and the view, but, is there a cleaner way to do this? I 'm after a neat way to have a bunch of common code between my model, controller, and view.
ruby
ruby-on-rails
rubyonrails
refactor
dry
null
open
How to write a Rails mixin that spans across model, controller, and view. === In an effort to reduce code duplication in my little Rails app, I've been working on getting common code between my models into it's own separate module, so far so good. The model stuff is fairly easy, I just have to include the module at the beginning, e.g.: class Iso < Sale include Shared::TracksSerialNumberExtension include Shared::OrderLines extend Shared::Filtered include Sendable::Model validates_presence_of :customer validates_associated :lines owned_by :customer def initialize( params = nil ) super self.created_at ||= Time.now.to_date end def after_initialize end order_lines :despatched # tracks_serial_numbers :items sendable :customer def created_at=( date ) write_attribute( :created_at, Chronic.parse( date ) ) end end This is working fine, now however, I'm going to have some controller and view code that's going to be common between these models as well, so far I have this for my sendable stuff: # This is a module that is used for pages/forms that are can be "sent" # either via fax, email, or printed. module Sendable module Model def self.included( klass ) klass.extend ClassMethods end module ClassMethods def sendable( class_to_send_to ) attr_accessor :fax_number, :email_address, :to_be_faxed, :to_be_emailed, :to_be_printed @_class_sending_to ||= class_to_send_to include InstanceMethods end def class_sending_to @_class_sending_to end end # ClassMethods module InstanceMethods def after_initialize( ) super self.to_be_faxed = false self.to_be_emailed = false self.to_be_printed = false target_class = self.send( self.class.class_sending_to ) if !target_class.nil? self.fax_number = target_class.send( :fax_number ) self.email_address = target_class.send( :email_address ) end end end end # Module Model end # Module Sendable Basically I'm planning on just doing an include Sendable::Controller, and Sendable::View (or the equivalent) for the controller and the view, but, is there a cleaner way to do this? I 'm after a neat way to have a bunch of common code between my model, controller, and view.
0
68,408
09/16/2008 01:03:22
3,610
08/29/2008 11:21:05
66
4
Comparing names
Is there any 'simple' algorithm to determine the likeliness of 2 names representing the same person? I'm not asking for something of the level that Custom department might be using. Just a simple algo that would tell me if 'James T. Clark' is most likely the same name as 'J. Thomas Clark' or 'James Clerk'. If there is an algo in C# that would be great, but I can translate from any language.
string
comparison
name
null
null
null
open
Comparing names === Is there any 'simple' algorithm to determine the likeliness of 2 names representing the same person? I'm not asking for something of the level that Custom department might be using. Just a simple algo that would tell me if 'James T. Clark' is most likely the same name as 'J. Thomas Clark' or 'James Clerk'. If there is an algo in C# that would be great, but I can translate from any language.
0
68,444
09/16/2008 01:10:33
6,277
09/13/2008 14:11:42
36
6
Combinging SWFs and other resources into a single SWF file
We have a program that produces several SWF files, some CSS and XML files, all of which need to be deployed for the thing to work. Is there a program or technique out there for wrapping all these files together into a single SWF file?
flash
swf
null
null
null
null
open
Combinging SWFs and other resources into a single SWF file === We have a program that produces several SWF files, some CSS and XML files, all of which need to be deployed for the thing to work. Is there a program or technique out there for wrapping all these files together into a single SWF file?
0
68,447
09/16/2008 01:10:40
6,311
09/13/2008 22:48:19
3
0
How can I change the main display via AppleScript?
From the Displays pane in System Preferences, I can manually change the main monitor by dragging the menu bar from one display to the other. I'd like to automate this and make it part of an AppleScript.
applescript
null
null
null
null
null
open
How can I change the main display via AppleScript? === From the Displays pane in System Preferences, I can manually change the main monitor by dragging the menu bar from one display to the other. I'd like to automate this and make it part of an AppleScript.
0
68,448
09/16/2008 01:11:14
10,578
09/16/2008 00:06:09
1
1
How to merge from branch to branch and back again (bidirectional merging) in SVN?
Using the svnmerge.py tool it is possible to merge between branches, up and down. It is hard to find the details for doing this. Hopefully, v1.5 will have a neat method for doing this without using svnmerge.py - details requested!
svn
version-control
null
null
null
null
open
How to merge from branch to branch and back again (bidirectional merging) in SVN? === Using the svnmerge.py tool it is possible to merge between branches, up and down. It is hard to find the details for doing this. Hopefully, v1.5 will have a neat method for doing this without using svnmerge.py - details requested!
0
68,454
09/16/2008 01:12:20
10,352
09/15/2008 22:35:57
6
0
Has Ubuntu reached the point yet where it's user friendly for most users?
I remember once before (1-2 yrs ago) if you needed to configure ANYTHING in Ubuntu, you needed to go use the command line. How is it today? Can I use it as my full desktop? Can I take it to presentations around the country and not embarrass myself because the projector won't work? Does it work well when I have to connect to various static networks? Basically, is it user friendly enough that I don't need to fight it in order to do things. Note: After my last experience, I absolutely positively refuse to use command line.
linux
ubuntu
null
null
null
03/31/2011 04:51:43
off topic
Has Ubuntu reached the point yet where it's user friendly for most users? === I remember once before (1-2 yrs ago) if you needed to configure ANYTHING in Ubuntu, you needed to go use the command line. How is it today? Can I use it as my full desktop? Can I take it to presentations around the country and not embarrass myself because the projector won't work? Does it work well when I have to connect to various static networks? Basically, is it user friendly enough that I don't need to fight it in order to do things. Note: After my last experience, I absolutely positively refuse to use command line.
2
68,456
09/16/2008 01:12:26
10,431
09/15/2008 23:05:28
1
1
Is anyone using the ASP.NET MVC Framework on live sites?
Is it ready for that? I've been playing with it for a short amount of time and it seems quite reasonable. Is anyone using it for live sites? any issues to be aware of?
asp.net-mvc
web-applications
null
null
null
null
open
Is anyone using the ASP.NET MVC Framework on live sites? === Is it ready for that? I've been playing with it for a short amount of time and it seems quite reasonable. Is anyone using it for live sites? any issues to be aware of?
0
68,457
09/16/2008 01:12:40
9,021
09/15/2008 17:31:26
735
13
What client do you use for Remote Desktop/VNC?
Which one client do you think is the best for remote PC management/access?
remote-desktop
vnc
null
null
null
null
open
What client do you use for Remote Desktop/VNC? === Which one client do you think is the best for remote PC management/access?
0
68,460
09/16/2008 01:12:56
6,320
09/14/2008 03:09:44
1
0
How to start/plan a software project for data collection on a PDA/handheld device.
A friend is having mysterious health problems that we're trying to track down. One thing that would help would be to improve his record keeping by giving him a handheld device with which he could keep track of various details of his day including diet and environmental factors. We will be getting him a device but haven't decided on Palm vs. Windows Mobile vs. other. I'd like to find some existing software but so far haven't been able to find something that is general enough or customizable to fit our needs. Ideally I'd like to find an open source project that I can join and contribute while customizing the software to do what I need it to, which I haven't even totally defined yet. I'm a C++ developer (way too) familiar with MSVS6 but would be happy to have an excuse to get into .NET or other modern frameworks. But if the easiest and quickest option is to work with something in C for the Palm I'd be happy to do that as well. (I've found a good but somewhat dated reference for [C++ programming for the Palm](http://answers.google.com/answers/threadview/id/123584.html)) Similar and more recent info like this is what I'm looking for. Thanks for any advice or suggestions about how to get started with this.
c++
open-source
windows-mobile
palm-os
null
null
open
How to start/plan a software project for data collection on a PDA/handheld device. === A friend is having mysterious health problems that we're trying to track down. One thing that would help would be to improve his record keeping by giving him a handheld device with which he could keep track of various details of his day including diet and environmental factors. We will be getting him a device but haven't decided on Palm vs. Windows Mobile vs. other. I'd like to find some existing software but so far haven't been able to find something that is general enough or customizable to fit our needs. Ideally I'd like to find an open source project that I can join and contribute while customizing the software to do what I need it to, which I haven't even totally defined yet. I'm a C++ developer (way too) familiar with MSVS6 but would be happy to have an excuse to get into .NET or other modern frameworks. But if the easiest and quickest option is to work with something in C for the Palm I'd be happy to do that as well. (I've found a good but somewhat dated reference for [C++ programming for the Palm](http://answers.google.com/answers/threadview/id/123584.html)) Similar and more recent info like this is what I'm looking for. Thanks for any advice or suggestions about how to get started with this.
0
68,477
09/16/2008 01:16:24
4,883
09/06/2008 10:24:59
1,064
10
Send file using POST from a Python script
Is there a way to send a file using POST from a Python script?
python
null
null
null
null
null
open
Send file using POST from a Python script === Is there a way to send a file using POST from a Python script?
0
68,504
09/16/2008 01:21:28
5,113
09/07/2008 23:46:50
16
3
What are my IDE/Editor choices for Haskell?
I typically use Emacs with hasktags for editing Haskell but I would like to enumerate all the choices and hopefully get feedback on each. - [Emacs][1] - [VIM][2] - [Visual Haskell][3] - [EclipseFP][4] - [leksah][5] - [SHIM][6] (wasn't this for emacs originially? did the project die?) - [HIDE][7] - [yi][8] If you've used one of the above, please tell me what you liked and didn't like about using it as a Haskell editor. I'm especially looking for something that gives me control over lots of the project management issues. Hopefully it can quickly navigate to source, show me haddock snippets on demand, look up type signatures and even help with refactoring. Further integration with hoogle and lambdabot are appreciated as well. [1]: http://www.haskell.org/haskell-mode/ [2]: http://www.cs.kent.ac.uk/people/staff/cr3/toolbox/haskell/Vim/index.html [3]: http://www.haskell.org/visualhaskell/ [4]: http://eclipsefp.sourceforge.net/ [5]: http://leksah.org/ [6]: http://www.vim.org/scripts/script.php?script_id=2356 [7]: http://www.haskell.org/haskellwiki/HIDE [8]: http://www.haskell.org/haskellwiki/Yi
haskell
editor
null
null
null
null
open
What are my IDE/Editor choices for Haskell? === I typically use Emacs with hasktags for editing Haskell but I would like to enumerate all the choices and hopefully get feedback on each. - [Emacs][1] - [VIM][2] - [Visual Haskell][3] - [EclipseFP][4] - [leksah][5] - [SHIM][6] (wasn't this for emacs originially? did the project die?) - [HIDE][7] - [yi][8] If you've used one of the above, please tell me what you liked and didn't like about using it as a Haskell editor. I'm especially looking for something that gives me control over lots of the project management issues. Hopefully it can quickly navigate to source, show me haddock snippets on demand, look up type signatures and even help with refactoring. Further integration with hoogle and lambdabot are appreciated as well. [1]: http://www.haskell.org/haskell-mode/ [2]: http://www.cs.kent.ac.uk/people/staff/cr3/toolbox/haskell/Vim/index.html [3]: http://www.haskell.org/visualhaskell/ [4]: http://eclipsefp.sourceforge.net/ [5]: http://leksah.org/ [6]: http://www.vim.org/scripts/script.php?script_id=2356 [7]: http://www.haskell.org/haskellwiki/HIDE [8]: http://www.haskell.org/haskellwiki/Yi
0
68,527
09/16/2008 01:25:16
92
08/01/2008 17:55:41
6,828
59
Should I use EJB3 or Spring for my business layer?
My team is developing a new service oriented product with a web front-end. In discussions about what technologies we will use we have settled on running a JBoss application server, and Flex frontend (with possible desktop deployment using Adobe AIR), and web services to interface the client and server. We've reached an impasse when it comes to which server technology to use for our business logic. The big argument is between EJB3 and Spring, with our biggest concerns being scalability and performance, and also maintainability of the code base. Here are my questions: 1. What are the arguments for or against EJB3 vs Spring? * What pitfalls can I expect with each? * Where can I find good benchmark information?
java
performance
spring
scalability
ejb-3.0
null
open
Should I use EJB3 or Spring for my business layer? === My team is developing a new service oriented product with a web front-end. In discussions about what technologies we will use we have settled on running a JBoss application server, and Flex frontend (with possible desktop deployment using Adobe AIR), and web services to interface the client and server. We've reached an impasse when it comes to which server technology to use for our business logic. The big argument is between EJB3 and Spring, with our biggest concerns being scalability and performance, and also maintainability of the code base. Here are my questions: 1. What are the arguments for or against EJB3 vs Spring? * What pitfalls can I expect with each? * Where can I find good benchmark information?
0
68,537
09/16/2008 01:27:15
8,303
09/15/2008 15:40:08
46
2
Design problem regarding type slicing with many different subclasses.
A basic problem I run into quite often, but ever found a clean solution to, is one where you want to code behaviour for interaction between different objects of a common base class or interface. To make it a bit concrete, I'll throw in an example; *Bob has been coding on a strategy game which supports "cool geographical effects". These round up to simple constraints such as if troops are walking in water, they are slowed 25%. If they are walking on grass, they are slowed 5%, and if they are walking on pavement they are slowed by 0%.* *Now, management told Bob that they needed new sorts of troops. There would be jeeps, boats and also hovercrafts. Also, they wanted jeeps to take damage if they went drove into water, and hovercrafts would ignore all three of the terrain types. Rumor has it also that they might add another terrain type with even more features than slowing units down and taking damage.* A very rough pseudo code example follows: public interface ITerrain { void AffectUnit(IUnit unit); } public class Water : ITerrain { public void AffectUnit(IUnit unit) { if (unit is HoverCraft) { // Don't affect it anyhow } if (unit is FootSoldier) { unit.SpeedMultiplier = 0.75f; } if (unit is Jeep) { unit.SpeedMultiplier = 0.70f; unit.Health -= 5.0f; } if (unit is Boat) { // Don't affect it anyhow } /* * List grows larger each day... */ } } public class Grass : ITerrain { public void AffectUnit(IUnit unit) { if (unit is HoverCraft) { // Don't affect it anyhow } if (unit is FootSoldier) { unit.SpeedMultiplier = 0.95f; } if (unit is Jeep) { unit.SpeedMultiplier = 0.85f; } if (unit is Boat) { unit.SpeedMultiplier = 0.0f; unit.Health = 0.0f; Boat boat = unit as Boat; boat.DamagePropeller(); // Perhaps throw in an explosion aswell? } /* * List grows larger each day... */ } } As you can see, things would have been better if Bob had a solid design document from the beginning. As the number of units and terrain types grow, so does code complexity. Not only does Bob have to worry about figuring out which members might need to be added to the unit interface, but he also has to repeat alot of code. It's very likely that new terrain types require additional information from what can be obtained from the basic IUnit interface. Each time we add another unit into the game, each terrain must be updated to handle the new unit. Clearly, this makes for a lot of repetition, not to mention the ugly runtime check which determines the type of unit being dealt with. I've opted out calls to the specific subtypes in this example, but those kinds of calls are neccessary to make. *An example would be that when a boat hits land, its propeller should be damaged. Not all units have propellers.* I am unsure what this kind of problem is called, but it is a many-to-many dependence which I have a hard time decoupling. I don't fancy having 100's of overloads for each IUnit subclass on ITerrain as I would want to come clean with coupling. Any light on this problem is highly sought after. Perhaps I'm thinking way out of orbit all together?
c#
design-patterns
type-slicing
null
null
null
open
Design problem regarding type slicing with many different subclasses. === A basic problem I run into quite often, but ever found a clean solution to, is one where you want to code behaviour for interaction between different objects of a common base class or interface. To make it a bit concrete, I'll throw in an example; *Bob has been coding on a strategy game which supports "cool geographical effects". These round up to simple constraints such as if troops are walking in water, they are slowed 25%. If they are walking on grass, they are slowed 5%, and if they are walking on pavement they are slowed by 0%.* *Now, management told Bob that they needed new sorts of troops. There would be jeeps, boats and also hovercrafts. Also, they wanted jeeps to take damage if they went drove into water, and hovercrafts would ignore all three of the terrain types. Rumor has it also that they might add another terrain type with even more features than slowing units down and taking damage.* A very rough pseudo code example follows: public interface ITerrain { void AffectUnit(IUnit unit); } public class Water : ITerrain { public void AffectUnit(IUnit unit) { if (unit is HoverCraft) { // Don't affect it anyhow } if (unit is FootSoldier) { unit.SpeedMultiplier = 0.75f; } if (unit is Jeep) { unit.SpeedMultiplier = 0.70f; unit.Health -= 5.0f; } if (unit is Boat) { // Don't affect it anyhow } /* * List grows larger each day... */ } } public class Grass : ITerrain { public void AffectUnit(IUnit unit) { if (unit is HoverCraft) { // Don't affect it anyhow } if (unit is FootSoldier) { unit.SpeedMultiplier = 0.95f; } if (unit is Jeep) { unit.SpeedMultiplier = 0.85f; } if (unit is Boat) { unit.SpeedMultiplier = 0.0f; unit.Health = 0.0f; Boat boat = unit as Boat; boat.DamagePropeller(); // Perhaps throw in an explosion aswell? } /* * List grows larger each day... */ } } As you can see, things would have been better if Bob had a solid design document from the beginning. As the number of units and terrain types grow, so does code complexity. Not only does Bob have to worry about figuring out which members might need to be added to the unit interface, but he also has to repeat alot of code. It's very likely that new terrain types require additional information from what can be obtained from the basic IUnit interface. Each time we add another unit into the game, each terrain must be updated to handle the new unit. Clearly, this makes for a lot of repetition, not to mention the ugly runtime check which determines the type of unit being dealt with. I've opted out calls to the specific subtypes in this example, but those kinds of calls are neccessary to make. *An example would be that when a boat hits land, its propeller should be damaged. Not all units have propellers.* I am unsure what this kind of problem is called, but it is a many-to-many dependence which I have a hard time decoupling. I don't fancy having 100's of overloads for each IUnit subclass on ITerrain as I would want to come clean with coupling. Any light on this problem is highly sought after. Perhaps I'm thinking way out of orbit all together?
0
68,543
09/16/2008 01:27:42
506
08/06/2008 12:56:30
90
12
Best Practice for Creating Data Tables Without Controls in ASP.net
So, I am kinda new to ASP.net development still, and I already don't like the stock ASP.net controls for displaying my database query results in table format. (I.e. I would much rather handle the HTML myself and so would the designer!) So my question is: What is the best and most secure practice for doing this without using ASP.net controls? So far my only idea involves populating my query result during the Page_Load event and then exposing a DataTable through a getter to the *.aspx page. From there I think I could just iterate with a foreach loop and craft my table as I see fit.
.net
asp.net
null
null
null
null
open
Best Practice for Creating Data Tables Without Controls in ASP.net === So, I am kinda new to ASP.net development still, and I already don't like the stock ASP.net controls for displaying my database query results in table format. (I.e. I would much rather handle the HTML myself and so would the designer!) So my question is: What is the best and most secure practice for doing this without using ASP.net controls? So far my only idea involves populating my query result during the Page_Load event and then exposing a DataTable through a getter to the *.aspx page. From there I think I could just iterate with a foreach loop and craft my table as I see fit.
0
68,548
09/16/2008 01:28:41
10,687
09/16/2008 01:00:49
1
0
"Winning" OO programming job interviews with sysadmin/Perl/Linux background?
I'm a student in software engineering in Montreal. For the last 3 years I've had a few interships (once per year). The first two (in the same company) were mostly sysadmin jobs, but I did get to do a few Perl programs (mostly log file analysing and statistics generation). My other intership was in the IT security field. I did a huge CGI Perl script to analyse time spent by users on the Internet. The thing is, what I really want to do is programming, but my interships were mostly sysadmins jobs with some programming (due to my previous experience with Linux and UNIX). I have another internship this winter, however I would like it to be in the OO programming field, and SW engineering. I have a background in system administration but I know OO quite well, due to my college courses and projects (C++, Java, VB.NET, ASP.NET, but not C# unfortunately :( ). My question is this : how can compete, in interviews, having no previous work experience in the OO field (though I build some projects in Java, Swing, etc., and am learning JSP right now), with other students with OO experience in previous interships? What should be my "selling points" ? I consider myself quite a good programmer, but my previous interviews didn't turn out well due to my lack of experience. In fact, I got an intership last winter in system administration, since, well... that's my background! Any tips on how to convince a potential employer that I am the perfect candidate despite my lack of professional experience (but lots of personal knowledge (and interest)) ? Thank you, Guillaume.
sysadmin
interview-questions
oo
engineering
candidate
null
open
"Winning" OO programming job interviews with sysadmin/Perl/Linux background? === I'm a student in software engineering in Montreal. For the last 3 years I've had a few interships (once per year). The first two (in the same company) were mostly sysadmin jobs, but I did get to do a few Perl programs (mostly log file analysing and statistics generation). My other intership was in the IT security field. I did a huge CGI Perl script to analyse time spent by users on the Internet. The thing is, what I really want to do is programming, but my interships were mostly sysadmins jobs with some programming (due to my previous experience with Linux and UNIX). I have another internship this winter, however I would like it to be in the OO programming field, and SW engineering. I have a background in system administration but I know OO quite well, due to my college courses and projects (C++, Java, VB.NET, ASP.NET, but not C# unfortunately :( ). My question is this : how can compete, in interviews, having no previous work experience in the OO field (though I build some projects in Java, Swing, etc., and am learning JSP right now), with other students with OO experience in previous interships? What should be my "selling points" ? I consider myself quite a good programmer, but my previous interviews didn't turn out well due to my lack of experience. In fact, I got an intership last winter in system administration, since, well... that's my background! Any tips on how to convince a potential employer that I am the perfect candidate despite my lack of professional experience (but lots of personal knowledge (and interest)) ? Thank you, Guillaume.
0
68,555
09/16/2008 01:30:11
1,574
08/16/2008 19:31:12
864
37
How do you stop a Visual Studio generated web service proxy class from encoding?
I'm using a Visual Studio generated proxy class to access a web service (added the web service as a web reference to my project). The problem is that the function the web service exposes expects a CDATA element, i.e.: <Function><![CDATA[<Blah></Blah>]]></Function> Unfortunately, when I pass in "<Blah></Blah>" into the proxy class, it calls the web service with this: <Function>&lt;![CDATA[&lt;Blah&gt;&lt;/Blah&gt;]]&gt;</Function> This appears to be causing problems with the web service. Is there any way to fix this while still using the proxy class generated by Visual Studio?
visual-studio
web-services
wsdl
proxy-classes
null
null
open
How do you stop a Visual Studio generated web service proxy class from encoding? === I'm using a Visual Studio generated proxy class to access a web service (added the web service as a web reference to my project). The problem is that the function the web service exposes expects a CDATA element, i.e.: <Function><![CDATA[<Blah></Blah>]]></Function> Unfortunately, when I pass in "<Blah></Blah>" into the proxy class, it calls the web service with this: <Function>&lt;![CDATA[&lt;Blah&gt;&lt;/Blah&gt;]]&gt;</Function> This appears to be causing problems with the web service. Is there any way to fix this while still using the proxy class generated by Visual Studio?
0
68,561
09/16/2008 01:31:31
6,276
09/13/2008 14:11:05
104
12
VS2008 Setup Project always requires .NET 3.5 at install time but I don't need it!
1, Create and build a default Windows Forms project and look at the project properties. It says that the project is targetting .NET Framework 2.0. 2, Create a Setup project that installs just the single executable from the Windows Forms project. 3, Run that installer and it always says that it needs to install .NET 3.5 SP1 on the machine. But it obviously only really needs 2.0 and so I do not want customers to be forced to install .NET 3.5 when they do not need it. They might already have 2.0 installed and so forcing the upgrade is not desirable! I have looked at the prerequisites of the setup project and checked the .NET Framework 2.0 entry and all the rest are unchecked. So I cannot find any reason for this strange runtime requirement. Anybody know how to resolve this one?
.net-3.5
.net-2.0
setup
null
null
null
open
VS2008 Setup Project always requires .NET 3.5 at install time but I don't need it! === 1, Create and build a default Windows Forms project and look at the project properties. It says that the project is targetting .NET Framework 2.0. 2, Create a Setup project that installs just the single executable from the Windows Forms project. 3, Run that installer and it always says that it needs to install .NET 3.5 SP1 on the machine. But it obviously only really needs 2.0 and so I do not want customers to be forced to install .NET 3.5 when they do not need it. They might already have 2.0 installed and so forcing the upgrade is not desirable! I have looked at the prerequisites of the setup project and checked the .NET Framework 2.0 entry and all the rest are unchecked. So I cannot find any reason for this strange runtime requirement. Anybody know how to resolve this one?
0
68,569
09/16/2008 01:32:20
10,755
09/16/2008 01:32:15
1
0
text watermark on website? how to do it?
I am a C++/C# developer and never spent time working on web pages. I would like to put text (randomly and diagonally perhaps) in large letters across the background of some pages. I want to be able to read the foreground text and also be able to read the "watermark". I understand that is probably more of a function of color selection. I have been unsuccessful in my attempts to do what I want. I would imagine this to be very simple for someone with the web design tools or html knowledge. Any links or sample code? Thanks
html
watermark
null
null
null
null
open
text watermark on website? how to do it? === I am a C++/C# developer and never spent time working on web pages. I would like to put text (randomly and diagonally perhaps) in large letters across the background of some pages. I want to be able to read the foreground text and also be able to read the "watermark". I understand that is probably more of a function of color selection. I have been unsuccessful in my attempts to do what I want. I would imagine this to be very simple for someone with the web design tools or html knowledge. Any links or sample code? Thanks
0
68,572
09/16/2008 01:33:02
1,385,358
08/25/2008 03:05:06
1,397
60
Fluent NHibernate Architecuture Question
I have a question that I may be over thinking at this point but here goes... I have 2 classes Users and Groups. Users and groups have a many to many relationship and I was thinking that the join table group_users I wanted to have an IsAuthorized property (because some groups are private -- users will need authorization). **Would you recommend creating a class for the join table as well as the User and Groups table?** Currently my classes look like this. public class Groups { public Groups() { members = new List<Person>(); } ... public virtual IList<Person> members { get; set; } } public class User { public User() { groups = new Groups() } ... public virtual IList<Groups> groups{ get; set; } } My mapping is like the following in both classes (I'm only showing the one in the users mapping but they are very similar): HasManyToMany<Groups>(x => x.Groups) .WithTableName("GroupMembers") .WithParentKeyColumn("UserID") .WithChildKeyColumn("GroupID") .Cascade.SaveUpdate(); **Should I write a class for the join table that looks like this?** public class GroupMembers { public virtual string GroupID { get; set; } public virtual string PersonID { get; set; } public virtual bool WaitingForAccept { get; set; } } I would really like to be able to adjust the group membership status and I guess I'm trying to think of the best way to go about this.
fluent
nhibernate
architecture
null
null
null
open
Fluent NHibernate Architecuture Question === I have a question that I may be over thinking at this point but here goes... I have 2 classes Users and Groups. Users and groups have a many to many relationship and I was thinking that the join table group_users I wanted to have an IsAuthorized property (because some groups are private -- users will need authorization). **Would you recommend creating a class for the join table as well as the User and Groups table?** Currently my classes look like this. public class Groups { public Groups() { members = new List<Person>(); } ... public virtual IList<Person> members { get; set; } } public class User { public User() { groups = new Groups() } ... public virtual IList<Groups> groups{ get; set; } } My mapping is like the following in both classes (I'm only showing the one in the users mapping but they are very similar): HasManyToMany<Groups>(x => x.Groups) .WithTableName("GroupMembers") .WithParentKeyColumn("UserID") .WithChildKeyColumn("GroupID") .Cascade.SaveUpdate(); **Should I write a class for the join table that looks like this?** public class GroupMembers { public virtual string GroupID { get; set; } public virtual string PersonID { get; set; } public virtual bool WaitingForAccept { get; set; } } I would really like to be able to adjust the group membership status and I guess I'm trying to think of the best way to go about this.
0
68,578
09/16/2008 01:34:41
7,870
09/15/2008 14:35:19
11
1
Multiple Cases in Switch:
I believe I've seen this somewhere, but I don't recall if it was a different language, or if I just can't remember the syntax well. Is there a way to fall through multiple case statements without stating case value: repeatedly? I know this works: Switch (value) { case 1: case 2: case 3: //do some stuff break; case 4: case 5: case 6: //do some different stuff break; default: //default stuff break; } but I'd like to do something like this: Switch (value) { case 1,2,3: //Do Something break; case 4,5,6: //Do Something break; default: //Do the Default break; } Is this syntax I'm thinking of from a different language, or am I missing something? Thanks!
c#
switch-statement
null
null
null
null
open
Multiple Cases in Switch: === I believe I've seen this somewhere, but I don't recall if it was a different language, or if I just can't remember the syntax well. Is there a way to fall through multiple case statements without stating case value: repeatedly? I know this works: Switch (value) { case 1: case 2: case 3: //do some stuff break; case 4: case 5: case 6: //do some different stuff break; default: //default stuff break; } but I'd like to do something like this: Switch (value) { case 1,2,3: //Do Something break; case 4,5,6: //Do Something break; default: //Do the Default break; } Is this syntax I'm thinking of from a different language, or am I missing something? Thanks!
0
68,583
09/16/2008 01:35:07
264
08/04/2008 09:58:18
1,482
14
foreach access the index or an assocative array
I have the following code snippet. $items[A] = "Test"; $items[B] = "Test"; $items[C] = "Test"; $items[D] = "Test"; $index = 0; foreach($items as $key => $value) { echo "$index is a $key containing $value\n"; $index++; } Expected output: 0 is a A containing Test 1 is a B containing Test 2 is a C containing Test 3 is a D containing Test Is there a way to leave out the $index variable?
php
foreach
null
null
null
null
open
foreach access the index or an assocative array === I have the following code snippet. $items[A] = "Test"; $items[B] = "Test"; $items[C] = "Test"; $items[D] = "Test"; $index = 0; foreach($items as $key => $value) { echo "$index is a $key containing $value\n"; $index++; } Expected output: 0 is a A containing Test 1 is a B containing Test 2 is a C containing Test 3 is a D containing Test Is there a way to leave out the $index variable?
0
68,592
09/16/2008 01:37:18
6,274
09/13/2008 14:05:27
1
0
Good ways to test a unit that communicates via HTTP
Often, I find myself wanting to write a unit test for a portion of code that accesses HTTP resources as part of its normal function. Have you found any good ways to write these kinds of tests?
language-agnostic
unit-testing
http
null
null
null
open
Good ways to test a unit that communicates via HTTP === Often, I find myself wanting to write a unit test for a portion of code that accesses HTTP resources as part of its normal function. Have you found any good ways to write these kinds of tests?
0
68,601
09/16/2008 01:38:35
10,755
09/16/2008 01:32:15
1
0
SVN hosting (and defect tracking)
Does anyone have experience with third party (non open source) svn hosting? I am looking at two (WUSH and someother one with svn in the name) They sound ok on paper - but I was hoping to get feedback. I was able to integrate minimal svn crossover into another web based tracking tool (elementool) but want to hear from others about trac, bugzilla and maybe fogbugz. I am taking over as a development manager for a bunch of projects and want to get the company off SSafe. I have been pleased with my past experiences with SVN but I did not like having to spend time managing an public/outward facing apache server - I would be happier spending the $50 or less each month for another company to do it. How has your experience been?
hosting
subversion
party
third
null
null
open
SVN hosting (and defect tracking) === Does anyone have experience with third party (non open source) svn hosting? I am looking at two (WUSH and someother one with svn in the name) They sound ok on paper - but I was hoping to get feedback. I was able to integrate minimal svn crossover into another web based tracking tool (elementool) but want to hear from others about trac, bugzilla and maybe fogbugz. I am taking over as a development manager for a bunch of projects and want to get the company off SSafe. I have been pleased with my past experiences with SVN but I did not like having to spend time managing an public/outward facing apache server - I would be happier spending the $50 or less each month for another company to do it. How has your experience been?
0
68,610
09/16/2008 01:40:10
10,761
09/16/2008 01:35:48
1
0
Text Centering Problem Using CSS with IE
I'm working on a site, and am having trouble getting text within a table to appear centered in IE. Firefox 2, 3 and Safari all work fine, but for some reason, the text won't appear centered in IE 6 or 7. I'm using: h2{font:300 12px "Helvetica", serif; text-align:center; text-transform:uppercase;}. I've also tried adding margin-left:auto; margin-right:auto position:relative; to no avail. Any help?
css
internet
explorer
center
text-align
null
open
Text Centering Problem Using CSS with IE === I'm working on a site, and am having trouble getting text within a table to appear centered in IE. Firefox 2, 3 and Safari all work fine, but for some reason, the text won't appear centered in IE 6 or 7. I'm using: h2{font:300 12px "Helvetica", serif; text-align:center; text-transform:uppercase;}. I've also tried adding margin-left:auto; margin-right:auto position:relative; to no avail. Any help?
0
68,614
09/16/2008 01:41:07
10,433
09/15/2008 23:06:36
1
0
Mixing EJB 2.x BMP entity beans with Hibernate 3.x
I have a large application that uses EJB 2.x entity beans (BMP). This is well-known to be a horrible persistence strategy (I can elaborate if necessary). I'd like to start migrating this application to use a much more expressive, transparent, and non-invasive persistence strategy, and given my company's previous experience with it, Hibernate 3.x is the obvious choice. Migrating to Hibernate is going to take a while, as over 100 tables in the application use entity beans. So I'm looking at a phased approach where the two persistence strategies run in parallel, ideally on the same tables at the same time, if possible. My question is, what are the pitfalls (if any) of combining these two persistence strategies? Will they get in each other's way?
java
hibernate
ejb2
null
null
null
open
Mixing EJB 2.x BMP entity beans with Hibernate 3.x === I have a large application that uses EJB 2.x entity beans (BMP). This is well-known to be a horrible persistence strategy (I can elaborate if necessary). I'd like to start migrating this application to use a much more expressive, transparent, and non-invasive persistence strategy, and given my company's previous experience with it, Hibernate 3.x is the obvious choice. Migrating to Hibernate is going to take a while, as over 100 tables in the application use entity beans. So I'm looking at a phased approach where the two persistence strategies run in parallel, ideally on the same tables at the same time, if possible. My question is, what are the pitfalls (if any) of combining these two persistence strategies? Will they get in each other's way?
0
68,617
09/16/2008 01:41:13
10,759
09/16/2008 01:34:15
1
0
Design question: does the Phone dial the PhoneNumber, or does the PhoneNumber dial itself on the Phone?
This is re-posted from something I posted on the DDD Yahoo! group. All things being equal, do you write phone.dial(phoneNumber) or phoneNumber.dialOn(phone)? Keep in mind possible future requirements (account numbers in addition to phone numbers, calculators in addition to phones). The choice tends to illustrate how the idioms of Information Expert, Single Responsibility Principle, and Tell Don't Ask are at odds with each other. phoneNumber.dialOn(phone) favors Information Expert and Tell Don't Ask, while phone.dial(phoneNumber) favors Single Responsibility Principle. If you are familiar with Ken Pugh's work in Prefactoring, this is the <a href="http://moffdub.wordpress.com/2008/09/10/the-spreadsheet-conundrum/">Spreadsheet Conundrum</a>; do you add rows or columns?
oop
null
null
null
null
null
open
Design question: does the Phone dial the PhoneNumber, or does the PhoneNumber dial itself on the Phone? === This is re-posted from something I posted on the DDD Yahoo! group. All things being equal, do you write phone.dial(phoneNumber) or phoneNumber.dialOn(phone)? Keep in mind possible future requirements (account numbers in addition to phone numbers, calculators in addition to phones). The choice tends to illustrate how the idioms of Information Expert, Single Responsibility Principle, and Tell Don't Ask are at odds with each other. phoneNumber.dialOn(phone) favors Information Expert and Tell Don't Ask, while phone.dial(phoneNumber) favors Single Responsibility Principle. If you are familiar with Ken Pugh's work in Prefactoring, this is the <a href="http://moffdub.wordpress.com/2008/09/10/the-spreadsheet-conundrum/">Spreadsheet Conundrum</a>; do you add rows or columns?
0
68,624
09/16/2008 01:42:35
4,998
09/07/2008 09:39:31
21
2
How to parse a query string into a NameValueCollection in .NET
I would like to parse a string such as "p1=6&p2=7&p3=8" into a NameValueCollection. What is the most elegant way of doing this?
.net
null
null
null
null
null
open
How to parse a query string into a NameValueCollection in .NET === I would like to parse a string such as "p1=6&p2=7&p3=8" into a NameValueCollection. What is the most elegant way of doing this?
0
68,630
09/16/2008 01:43:39
4,883
09/06/2008 10:24:59
1,084
11
Are tuples more efficient than lists in Python?
Is there any performance difference between tuples and lists when it comes to instantiation and retrieval of elements?
python
performance
null
null
null
null
open
Are tuples more efficient than lists in Python? === Is there any performance difference between tuples and lists when it comes to instantiation and retrieval of elements?
0
68,633
09/16/2008 01:44:18
340
08/04/2008 18:49:59
179
3
Regex that Will Match a Java Method Declaration
I need a Regex that will match a java method declaration. I have come up with one that will match a method declaration, but it requires the opening bracket of the method to be on the same line as the declaration. If you have any suggestions to improve my regex or simply have a better one then please submit an answer. Here is my regex: `"\w+ +\w+ *\(.*\) *\{"`
java
regex
methods
null
null
null
open
Regex that Will Match a Java Method Declaration === I need a Regex that will match a java method declaration. I have come up with one that will match a method declaration, but it requires the opening bracket of the method to be on the same line as the declaration. If you have any suggestions to improve my regex or simply have a better one then please submit an answer. Here is my regex: `"\w+ +\w+ *\(.*\) *\{"`
0
68,640
09/16/2008 01:45:44
10,722
09/16/2008 01:19:42
1
0
Can you have a Class in a Struct
Is it possible in C# to have a Struct with a member variable which is a Class type? If so, where does the information get stored, on the Stack, the Heap, or both?
c#
class
struct
null
null
null
open
Can you have a Class in a Struct === Is it possible in C# to have a Struct with a member variable which is a Class type? If so, where does the information get stored, on the Stack, the Heap, or both?
0
68,664
09/16/2008 01:50:33
9,825
09/15/2008 20:04:37
11
0
Algorithm for finding characters in the same positions in a list of strings?
Suppose I have: 1. Toby 2. Tiny 3. Tory 4. Tily Is there an algorithm that can easily create a list of common characters in the same positions in all these strings? (in this case the common characters are 'T' at position 0 and 'y' at position 3) I tried looking at some of the algorithms used for DNA sequence matching but it seems most of them are just used for finding common substrings regardless of their positions.
algorithms
string
null
null
null
null
open
Algorithm for finding characters in the same positions in a list of strings? === Suppose I have: 1. Toby 2. Tiny 3. Tory 4. Tily Is there an algorithm that can easily create a list of common characters in the same positions in all these strings? (in this case the common characters are 'T' at position 0 and 'y' at position 3) I tried looking at some of the algorithms used for DNA sequence matching but it seems most of them are just used for finding common substrings regardless of their positions.
0
68,666
09/16/2008 01:50:35
10,784
09/16/2008 01:50:35
1
0
CLIPBRD_E_CANT_OPEN error when setting the Clipboard from .NET
This is caused by a bug/feature in the .NET implementation of the clipboard when a delay occurs (sometimes caused by Terminal Services). The solution is to try multiple times within a loop and sleep in between. for (int i = 0; i < 10; i++) { try { Clipboard.SetText(sb.ToString()); return; } catch { } System.Threading.Thread.Sleep(10); }
clipbrd-e-cant-open
.net
clipboard
null
null
null
open
CLIPBRD_E_CANT_OPEN error when setting the Clipboard from .NET === This is caused by a bug/feature in the .NET implementation of the clipboard when a delay occurs (sometimes caused by Terminal Services). The solution is to try multiple times within a loop and sleep in between. for (int i = 0; i < 10; i++) { try { Clipboard.SetText(sb.ToString()); return; } catch { } System.Threading.Thread.Sleep(10); }
0
68,677
09/16/2008 01:52:12
3,750
08/30/2008 14:43:09
108
5
How can I print a binary value as hex in TSQL?
I'm using SQL Server 2000 to print out some values from a table using <code>PRINT</code>. With most non-string data, I can cast to nvarchar to be able to print it, but binary values attempt to convert using the bit representation of characters. For example: DECLARE @binvalue binary(4) SET @binvalue = 0x12345678 PRINT CAST(@binvalue AS nvarchar) Expected: > 0x12345678 Instead, it prints two gibberish characters. How can I print the value of binary data? Is there a built-in or do I need to roll my own?
tsql
sql-server
null
null
null
null
open
How can I print a binary value as hex in TSQL? === I'm using SQL Server 2000 to print out some values from a table using <code>PRINT</code>. With most non-string data, I can cast to nvarchar to be able to print it, but binary values attempt to convert using the bit representation of characters. For example: DECLARE @binvalue binary(4) SET @binvalue = 0x12345678 PRINT CAST(@binvalue AS nvarchar) Expected: > 0x12345678 Instead, it prints two gibberish characters. How can I print the value of binary data? Is there a built-in or do I need to roll my own?
0
68,688
09/16/2008 01:53:29
10,778
09/16/2008 01:48:10
1
0
DefaultButton in ASP.NET forms
What is the best solution of defaultButton and "Enter key pressed" for ASP.NET 2.0-3.5 forms?
asp.net
key
defaultbutton
enter
pressed
null
open
DefaultButton in ASP.NET forms === What is the best solution of defaultButton and "Enter key pressed" for ASP.NET 2.0-3.5 forms?
0
68,691
09/16/2008 01:53:46
1,359,937
09/16/2008 01:11:06
1
0
What's the best way to extract table content from a group of HTML files?
After cleaning a folder full of HTML files with TIDY, how can the tables content be extracted for further processing?
java
html
excel
csv
extract
null
open
What's the best way to extract table content from a group of HTML files? === After cleaning a folder full of HTML files with TIDY, how can the tables content be extracted for further processing?
0
68,717
09/16/2008 01:57:42
313,475
09/16/2008 00:01:29
8
2
Lisp super popular?
Will Lisp ever become super popular?
lisp
null
null
null
null
08/08/2010 13:02:35
not constructive
Lisp super popular? === Will Lisp ever become super popular?
4
68,720
09/16/2008 01:58:23
10,352
09/15/2008 22:35:57
13
0
Windows Server 2008 Virtual Hosting?
Is there anyone out there who has Windows Server 2008 virtual hosting under $75/mo?
windows
hosting
2008
null
null
03/18/2012 15:48:40
not constructive
Windows Server 2008 Virtual Hosting? === Is there anyone out there who has Windows Server 2008 virtual hosting under $75/mo?
4
68,746
09/16/2008 02:02:35
10,433
09/15/2008 23:06:36
6
0
Good pattern or framework for adding auditing to an existing app?
I have an existing J2EE enterprise application to which I need to add auditing, i.e. be able to record CRUD operations on several important domain types (Employee, AdministratorRights, etc.). The application has a standard n-tier architecture: - Web interface - Business operations encapsulated within a mixture of stateless session beans and transactional POJOs (using Spring) - persistence is a mixture of direct JDBC (from within the business layer) and EJB 2.x BMP entity beans (I know, I know) My question is: are there any standard patterns or (better still) frameworks/libraries specifically for adding auditing as a cross-cutting concern? I know AOP can be used to implement cross-cutting concerns in general; I want to know if there's something specifically aimed at auditing.
java
java-ee
aop
audit
crud
null
open
Good pattern or framework for adding auditing to an existing app? === I have an existing J2EE enterprise application to which I need to add auditing, i.e. be able to record CRUD operations on several important domain types (Employee, AdministratorRights, etc.). The application has a standard n-tier architecture: - Web interface - Business operations encapsulated within a mixture of stateless session beans and transactional POJOs (using Spring) - persistence is a mixture of direct JDBC (from within the business layer) and EJB 2.x BMP entity beans (I know, I know) My question is: are there any standard patterns or (better still) frameworks/libraries specifically for adding auditing as a cross-cutting concern? I know AOP can be used to implement cross-cutting concerns in general; I want to know if there's something specifically aimed at auditing.
0
68,749
09/16/2008 02:02:58
5,903
09/11/2008 15:49:15
213
19
Working with USB devices in .NET
Using .Net (C#), how can you work with USB devices? How can you detect USB events (connections/disconnections) and how do you communicate with devices (read/write). Is there a native .Net solution to do this?
.net
communication
usb
null
null
null
open
Working with USB devices in .NET === Using .Net (C#), how can you work with USB devices? How can you detect USB events (connections/disconnections) and how do you communicate with devices (read/write). Is there a native .Net solution to do this?
0
68,750
09/16/2008 02:03:16
364
08/05/2008 05:33:41
703
43
How do you write a C# Extension Method for a Generically Typed Class
This should hopefully be a simple one. I would like to add an extension method to the System.Web.Mvc.ViewPage< T > class. How should this extension method look? My first intuitive thought is something like this: namespace System.Web.Mvc { public static class ViewPageExtensions { public static string GetDefaultPageTitle(this ViewPage<Type> v) { return ""; } } }
c#
asp.net-mvc
generics
extension-methods
null
null
open
How do you write a C# Extension Method for a Generically Typed Class === This should hopefully be a simple one. I would like to add an extension method to the System.Web.Mvc.ViewPage< T > class. How should this extension method look? My first intuitive thought is something like this: namespace System.Web.Mvc { public static class ViewPageExtensions { public static string GetDefaultPageTitle(this ViewPage<Type> v) { return ""; } } }
0
68,764
09/16/2008 02:05:26
5,469
09/09/2008 21:03:22
575
30
How can you tell if viewstate in an ASP.Net application has been tampered with?
During a discussion about security, a developer on my team asked if there was a way to tell if viewstate has been tampered with. I'm embarrassed to say that I didnt know the answer. I told him I would find out, but thought I would give someone on here a chance to answer first. I know there is some automatic validation, but is there a way to do it manually if event validation is not enabled?
asp.net
viewstate
null
null
null
null
open
How can you tell if viewstate in an ASP.Net application has been tampered with? === During a discussion about security, a developer on my team asked if there was a way to tell if viewstate has been tampered with. I'm embarrassed to say that I didnt know the answer. I told him I would find out, but thought I would give someone on here a chance to answer first. I know there is some automatic validation, but is there a way to do it manually if event validation is not enabled?
0
68,774
09/16/2008 02:06:11
5,324
09/09/2008 06:49:51
436
19
Best way to open a socket in Python
I want to open a TCP client socket in Python. Do I have to go through all the low-level BSD create-socket-handle / connect-socket stuff or is there a simpler one-line way ? What I'm looking for is something similar to fsockopen in PHP.
python
networking
tcp
null
null
null
open
Best way to open a socket in Python === I want to open a TCP client socket in Python. Do I have to go through all the low-level BSD create-socket-handle / connect-socket stuff or is there a simpler one-line way ? What I'm looking for is something similar to fsockopen in PHP.
0
68,821
09/16/2008 02:14:21
3,857
08/31/2008 12:22:47
41
7
Dynamically hiding columns in a NSTableView
I want to dynamically hide/show some of the columns in a NSTableView, based on the data that is going to be displayed - basically, if a column is empty I'd like the column to be hidden. I'm currently populating the table with a controller class as the delegate for the table. Any ideas? I see that I can set the column hidden in Interface Builder, however there doesn't seem to be a good time to go through the columns and check if they are empty or not, since there doesn't seem to be a method that is called before/after all of the data in the table is populated.
cocoa
null
null
null
null
null
open
Dynamically hiding columns in a NSTableView === I want to dynamically hide/show some of the columns in a NSTableView, based on the data that is going to be displayed - basically, if a column is empty I'd like the column to be hidden. I'm currently populating the table with a controller class as the delegate for the table. Any ideas? I see that I can set the column hidden in Interface Builder, however there doesn't seem to be a good time to go through the columns and check if they are empty or not, since there doesn't seem to be a method that is called before/after all of the data in the table is populated.
0
68,832
09/16/2008 02:17:24
10,834
09/16/2008 02:13:55
1
0
How can I stop Visual Studio (both 2005 and 2008) from crashing (sometimes) when I select the "Close All But This" option?
It does not do it all the time.
visual-studio
null
null
null
null
null
open
How can I stop Visual Studio (both 2005 and 2008) from crashing (sometimes) when I select the "Close All But This" option? === It does not do it all the time.
0
68,835
09/16/2008 02:18:05
10,778
09/16/2008 01:48:10
1
1
Code Review
What code review policy you could recommend as the best for project you're managing?
review
agile
best
null
null
null
open
Code Review === What code review policy you could recommend as the best for project you're managing?
0
68,851
09/16/2008 02:21:04
5,056
09/07/2008 15:43:17
971
70
Where am I supposed to see FirePHP output?
Ok, so I am finally trying out FirePHP. I installed it and restarted firefox, enabled firebug for my localhost, moved the demo oo.php file that comes with the download into an IIS virtual directory, changed the include path, removed the apache_request_headers() call since I am running IIS and the only output I see? > Notice: Undefined offset: 1 in > C:\Documents and Settings\georgem\My > Documents\projects\auctronic\FirePHPCore\FirePHP.class.php > on line 167 <br/> > Hello World Nothing appears in the Firebug console. Am I missing something? **EDIT:** Noticed it said that output buffering has to be enabled so I added a call to ob_start() at the top of the file...same results.
php
firebug
firephp
null
null
null
open
Where am I supposed to see FirePHP output? === Ok, so I am finally trying out FirePHP. I installed it and restarted firefox, enabled firebug for my localhost, moved the demo oo.php file that comes with the download into an IIS virtual directory, changed the include path, removed the apache_request_headers() call since I am running IIS and the only output I see? > Notice: Undefined offset: 1 in > C:\Documents and Settings\georgem\My > Documents\projects\auctronic\FirePHPCore\FirePHP.class.php > on line 167 <br/> > Hello World Nothing appears in the Firebug console. Am I missing something? **EDIT:** Noticed it said that output buffering has to be enabled so I added a call to ob_start() at the top of the file...same results.
0
68,898
09/16/2008 02:29:43
2,581
08/23/2008 04:37:51
122
8
Automatic Internationalization Testing For Web
Does there exist a website service or set of scripts that will tell you whether your web page badly configured if your goal is to be internationally friendly? To be more precise, I'm wondering if something like this exists: Checking URL: http://www.example.com GET / HTTP/1.0 Accept-Charset: utf8 ... HTTP/1.0 200 OK Charset: iso-8859-1 ..<?xml version="1.0" charset="utf8" ?> WARNING: Header document conflict, your server claims to return iso-8859-1, but includes octet values outside the legal range. This can happen when your documents are saved with a different character set than your web server is configured to serve. From my understanding its unlikely that this will help me make a website that will allow people to post in Japanese or Hebrew, but it might be able to help my English websites reach a larger international audience.
testing
internationalization
null
null
null
null
open
Automatic Internationalization Testing For Web === Does there exist a website service or set of scripts that will tell you whether your web page badly configured if your goal is to be internationally friendly? To be more precise, I'm wondering if something like this exists: Checking URL: http://www.example.com GET / HTTP/1.0 Accept-Charset: utf8 ... HTTP/1.0 200 OK Charset: iso-8859-1 ..<?xml version="1.0" charset="utf8" ?> WARNING: Header document conflict, your server claims to return iso-8859-1, but includes octet values outside the legal range. This can happen when your documents are saved with a different character set than your web server is configured to serve. From my understanding its unlikely that this will help me make a website that will allow people to post in Japanese or Hebrew, but it might be able to help my English websites reach a larger international audience.
0
68,907
09/16/2008 02:30:56
10,703
09/16/2008 01:08:24
1
1
How do you measure the time a function takes to execute?
How can you measure the amount of time a function will take to execute? This is a relatively short function and the execution time would probably be in the millisecond range. This particular question relates to an embedded system.
embedded
profiling
time
null
null
null
open
How do you measure the time a function takes to execute? === How can you measure the amount of time a function will take to execute? This is a relatively short function and the execution time would probably be in the millisecond range. This particular question relates to an embedded system.
0
68,929
09/16/2008 02:34:38
10,823
09/16/2008 02:09:19
1
0
How to fix the endless printing loop bug in Nevrona Rave
[Nevrona Designs'][1] [Rave Reports][2] is a Report Engine for use by [Embarcadero's][3] [Delphi][4] IDE. This is more of a work-around than a true solution. I first posted this work-around on the [Nevrona newsgroup][5] (Group=nevrona.public.rave.developer.delphi.rave; Subject="Are you suffering from the Rave Endless Loop bug?: Work-around announced."; Date=13/11/2006 7:06 PM) This is my solution to the Rave Endless Loop bug. In Rave Reports version 6.5.0 (VCL10) that comes bundled with Delphi 2006, there is a nortorious bug that plagues many Rave report developers. If you have a non-empty dataset, and the data rows for this dataset fit exactly into a page (that is to say there are zero widow rows), then upon PrintPreview, Rave will get stuck in an infinite loop generating pages. This problem has been previously reported in this newsgroup under the following headings: 1. "error: generating infinite pages"; Hugo Hiram 20/9/2006 8:44PM 2. "Rave loop bug. Please help"; Tomas Lazar 11/07/2006 7:35PM 3. "Loop on full page of data?"; Tony Chistiansen 23/12/2004 3:41PM 4. reply to (3) by another complainant; Oliver Piche 5. "Endless lopp print bug"; Richso 9/11/2004 4:44PM In each of these postings, there was no response from Nevrona, and no solution was reported. Possibly, the problem has also been reported on an allied newsgroup (nevrona.public.rave.reports.general), to wit: 6. "Continuously generating report"; Jobard 20/11/2005 Although it is not clear to me if (6) is the Rave Endless loop bug or another problem. This posting did get a reply from Nevrona, but it was more in relation to multiple regions ("There is a problem when using multiple regions that go over a page-break.") than the problem of zero widows. [1]: http://www.nevrona.com/ [2]: http://www.nevrona.com/Products/RaveReports/StandardEdition/tabid/66/Default.aspx [3]: http://www.embarcadero.com/ [4]: http://www.codegear.com/products/delphi/win32 [5]: news://news.nevrona.com
delphi
endless-loop
rave
null
null
null
open
How to fix the endless printing loop bug in Nevrona Rave === [Nevrona Designs'][1] [Rave Reports][2] is a Report Engine for use by [Embarcadero's][3] [Delphi][4] IDE. This is more of a work-around than a true solution. I first posted this work-around on the [Nevrona newsgroup][5] (Group=nevrona.public.rave.developer.delphi.rave; Subject="Are you suffering from the Rave Endless Loop bug?: Work-around announced."; Date=13/11/2006 7:06 PM) This is my solution to the Rave Endless Loop bug. In Rave Reports version 6.5.0 (VCL10) that comes bundled with Delphi 2006, there is a nortorious bug that plagues many Rave report developers. If you have a non-empty dataset, and the data rows for this dataset fit exactly into a page (that is to say there are zero widow rows), then upon PrintPreview, Rave will get stuck in an infinite loop generating pages. This problem has been previously reported in this newsgroup under the following headings: 1. "error: generating infinite pages"; Hugo Hiram 20/9/2006 8:44PM 2. "Rave loop bug. Please help"; Tomas Lazar 11/07/2006 7:35PM 3. "Loop on full page of data?"; Tony Chistiansen 23/12/2004 3:41PM 4. reply to (3) by another complainant; Oliver Piche 5. "Endless lopp print bug"; Richso 9/11/2004 4:44PM In each of these postings, there was no response from Nevrona, and no solution was reported. Possibly, the problem has also been reported on an allied newsgroup (nevrona.public.rave.reports.general), to wit: 6. "Continuously generating report"; Jobard 20/11/2005 Although it is not clear to me if (6) is the Rave Endless loop bug or another problem. This posting did get a reply from Nevrona, but it was more in relation to multiple regions ("There is a problem when using multiple regions that go over a page-break.") than the problem of zero widows. [1]: http://www.nevrona.com/ [2]: http://www.nevrona.com/Products/RaveReports/StandardEdition/tabid/66/Default.aspx [3]: http://www.embarcadero.com/ [4]: http://www.codegear.com/products/delphi/win32 [5]: news://news.nevrona.com
0
68,964
09/16/2008 02:39:51
8,884
09/15/2008 17:08:28
51
10
Given an unsigned int, what's the fastest way to get the "indexes" of the set bits?
So for e.g. 0110 has bits 1 and 2 set, 1000 has bit 3 set 1111 has bits 0,1,2,3 set
algorithm
bit-manipulation
null
null
null
null
open
Given an unsigned int, what's the fastest way to get the "indexes" of the set bits? === So for e.g. 0110 has bits 1 and 2 set, 1000 has bit 3 set 1111 has bits 0,1,2,3 set
0
68,976
09/16/2008 02:41:42
10,431
09/15/2008 23:05:28
8
2
Anyone know of a scratch like program construction UI framework?
I quite like the drag and drop pluggable programming blocks in scratch ( http://scratch.mit.edu/ ) I'd like to be able to get users to create their own mini scripts using the same kind of technique... just wondering if anyone knows of anything similar I could utilise in .NET? ideally in WPF.
.net
scratch
null
null
null
null
open
Anyone know of a scratch like program construction UI framework? === I quite like the drag and drop pluggable programming blocks in scratch ( http://scratch.mit.edu/ ) I'd like to be able to get users to create their own mini scripts using the same kind of technique... just wondering if anyone knows of anything similar I could utilise in .NET? ideally in WPF.
0
68,985
09/16/2008 02:44:24
292
08/04/2008 13:14:31
690
37
Getting started with windows mobile development
I have a personal pet project I'd like to start on, targeted at windows mobile 6. I've never done win mobile dev and would like to know what resources are out there, good tools to use, perhaps a jump start tutorial, as well as any gotchas I might want to keep in mind when developing for the platform?
tutorials
windows-mobile
null
null
null
null
open
Getting started with windows mobile development === I have a personal pet project I'd like to start on, targeted at windows mobile 6. I've never done win mobile dev and would like to know what resources are out there, good tools to use, perhaps a jump start tutorial, as well as any gotchas I might want to keep in mind when developing for the platform?
0
68,986
09/16/2008 02:44:25
8,369
09/15/2008 15:49:32
1
0
What's a good lightweight Python MVC framework?
I know there are a ton of Python frameworks out there. Can you guys point me in the right direction? My primary concern is simplicity, I don't need a lot of extraneous features. Here are a couple of other things that I'd want (or don't want): - don't care for ORM, just want it to work with MySQL - has configurable routes - has support for layouts
python
mvc
framework
lightweight
null
null
open
What's a good lightweight Python MVC framework? === I know there are a ton of Python frameworks out there. Can you guys point me in the right direction? My primary concern is simplicity, I don't need a lot of extraneous features. Here are a couple of other things that I'd want (or don't want): - don't care for ORM, just want it to work with MySQL - has configurable routes - has support for layouts
0
68,993
09/16/2008 02:46:04
7,432
09/15/2008 13:43:53
41
7
how to get emacs to unwrap a block of code
Say I have a line in an emacs buffer that looks like this: foo -option1 value1 -option2 value2 -option3 value3 \ -option4 value4 ... I want it to look like this: foo -option1 value1 \ -option2 value2 \ -option3 value3 \ -option4 value4 \ ... I want each option/value pair on a separate line. I also want those subsequent lines indented appropriately according to mode rather than to add a fixed amount of whitespace. I would prefer that the code work on the current block, stopping at the first non-blank line or line that does not contain an option/value pair though I could settle for it working on a selected region. Anybody know of an elisp function to do this?
emacs
null
null
null
null
null
open
how to get emacs to unwrap a block of code === Say I have a line in an emacs buffer that looks like this: foo -option1 value1 -option2 value2 -option3 value3 \ -option4 value4 ... I want it to look like this: foo -option1 value1 \ -option2 value2 \ -option3 value3 \ -option4 value4 \ ... I want each option/value pair on a separate line. I also want those subsequent lines indented appropriately according to mode rather than to add a fixed amount of whitespace. I would prefer that the code work on the current block, stopping at the first non-blank line or line that does not contain an option/value pair though I could settle for it working on a selected region. Anybody know of an elisp function to do this?
0
68,999
09/16/2008 02:46:46
10,889
09/16/2008 02:46:46
1
0
How can I find the response time of a HTTP request through a Socket
I'm using a Java socket, connected to a server. If I send a HEADER http request, how can I measure the response time from the server? Must I use some provided timer, or is there a better way?
java
http
null
null
null
null
open
How can I find the response time of a HTTP request through a Socket === I'm using a Java socket, connected to a server. If I send a HEADER http request, how can I measure the response time from the server? Must I use some provided timer, or is there a better way?
0
69,000
09/16/2008 02:46:52
10,890
09/16/2008 02:46:52
1
0
Visual Studio basicHttpBinding and endpoint problems
I have a WPF application in VS 2008 with some web service references. For varying reasons (max message size, authentication methods) I need to manually define a number of settings in the WPF client's app.config for the service bindings. Unfortunately, this means that when I update the service references in the project we end up with a mess - multiple bindings and endpoints. Visual Studio creates new bindings and endpoints with a numeric suffix (ie "Service1" as a duplicate of "Service"), resulting in an invalid configuration as there may only be a single binding per service reference in a project. This is easy to duplicate - just create a simple "Hello World" ASP.Net web service and WPF application in a solution, change the maxBufferSize and maxReceivedMessageSize in the app.config binding and then update the service reference. At the moment we are working around this by simply undoing checkout on the app.config after updating the references but I can't help but think there must be a better way! Also, the settings we need to manually change are: <security mode="TransportCredentialOnly"> <transport clientCredentialType="Ntlm" /> </security> and: <binding maxBufferSize="655360" maxReceivedMessageSize="655360" /> We use a service factory class so if these settings are somehow able to be set programmatically that would work, although the properties don't seem to be exposed.
asp.net
visual-studio
web-services
wpf
null
null
open
Visual Studio basicHttpBinding and endpoint problems === I have a WPF application in VS 2008 with some web service references. For varying reasons (max message size, authentication methods) I need to manually define a number of settings in the WPF client's app.config for the service bindings. Unfortunately, this means that when I update the service references in the project we end up with a mess - multiple bindings and endpoints. Visual Studio creates new bindings and endpoints with a numeric suffix (ie "Service1" as a duplicate of "Service"), resulting in an invalid configuration as there may only be a single binding per service reference in a project. This is easy to duplicate - just create a simple "Hello World" ASP.Net web service and WPF application in a solution, change the maxBufferSize and maxReceivedMessageSize in the app.config binding and then update the service reference. At the moment we are working around this by simply undoing checkout on the app.config after updating the references but I can't help but think there must be a better way! Also, the settings we need to manually change are: <security mode="TransportCredentialOnly"> <transport clientCredentialType="Ntlm" /> </security> and: <binding maxBufferSize="655360" maxReceivedMessageSize="655360" /> We use a service factory class so if these settings are somehow able to be set programmatically that would work, although the properties don't seem to be exposed.
0
69,005
09/16/2008 02:48:25
10,431
09/15/2008 23:05:28
8
2
Any reccomendation on tools for doing translations / localization in .NET?
We have made use of Passolo for a number of years, But its kind of clunky and over priced. It's got to be able to handle winforms and WPF.... Is there any open source alternatives?
.net
null
null
null
null
null
open
Any reccomendation on tools for doing translations / localization in .NET? === We have made use of Passolo for a number of years, But its kind of clunky and over priced. It's got to be able to handle winforms and WPF.... Is there any open source alternatives?
0
69,030
09/16/2008 02:53:34
10,906
09/16/2008 02:53:33
1
0
In Applescript, how can I find out if a menu item is focused?
I have an script for OS X 10.5 that focuses the Search box in the Help menu of any application. I have it on a key combination and, much like Spotlight, I want it to toggle when I run the script. So, I want to detect if the search box is already focused for typing, and if so, type Esc instead of clicking the Help menu. Here is the script as it stands now: tell application "System Events" tell (first process whose frontmost is true) set helpMenuItem to menu bar item "Help" of menu bar 1 click helpMenuItem end tell end tell And I'm thinking of something like this: tell application "System Events" tell (first process whose frontmost is true) set helpMenuItem to menu bar item "Help" of menu bar 1 set searchBox to menu item 1 of menu of helpMenuItem if searchBox is focused then keystroke "Escape" --type Esc somehow.. I haven't looked up how yet else click helpMenuItem end if end tell end tell ... but I get this error: > Can’t get focused of {menu item 1 of menu "Help" of menu bar item "Help" of menu bar 1 of application process "Script Editor" of application "System Events"}. So is there a way I can get my script to detect whether the search box is already focused?
applescript
menu
focus
null
null
null
open
In Applescript, how can I find out if a menu item is focused? === I have an script for OS X 10.5 that focuses the Search box in the Help menu of any application. I have it on a key combination and, much like Spotlight, I want it to toggle when I run the script. So, I want to detect if the search box is already focused for typing, and if so, type Esc instead of clicking the Help menu. Here is the script as it stands now: tell application "System Events" tell (first process whose frontmost is true) set helpMenuItem to menu bar item "Help" of menu bar 1 click helpMenuItem end tell end tell And I'm thinking of something like this: tell application "System Events" tell (first process whose frontmost is true) set helpMenuItem to menu bar item "Help" of menu bar 1 set searchBox to menu item 1 of menu of helpMenuItem if searchBox is focused then keystroke "Escape" --type Esc somehow.. I haven't looked up how yet else click helpMenuItem end if end tell end tell ... but I get this error: > Can’t get focused of {menu item 1 of menu "Help" of menu bar item "Help" of menu bar 1 of application process "Script Editor" of application "System Events"}. So is there a way I can get my script to detect whether the search box is already focused?
0
69,048
09/16/2008 02:59:56
3,742
08/30/2008 14:08:11
166
19
Binding a form combo box in Access 2007
I've created an Access 2007 form that displays, for example, Products from a Product table. One of the fields in the Product table is a CategoryID that corresponds to this product's parent category. In the form, the CategoryID needs to be represented as a combo box that is bound to the Category table. The idea here is pretty straightforward: selecting a new Category should update the CategoryID in the Product table. The problem I'm running into is that selecting a new Category updates the CategoryName of the Category table instead of updating the CategoryID in the Product table. The reason for this is that it seems that the combo box must be bound only to the CategoryName of the Category table. What happens is if the current product has a CategoryID of 12 which is the CategoryName "Chairs" in the Category table then selecting a new value, let's say "Tables" (CategoryID 13) in the combo box updates the CategoryID of 12 with the new CategoryName "Tables" instead of updating the Product table CategoryID to 13. How can I bind the Category table to a combox box so that the datatextfield (which I wish existed in Access) is the CategoryName and the datavaluefield is the CategoryID and only the CategoryID of the Product will be updated when the selected combo box item is changed?
ms-access
forms
combobox
data-binding
null
null
open
Binding a form combo box in Access 2007 === I've created an Access 2007 form that displays, for example, Products from a Product table. One of the fields in the Product table is a CategoryID that corresponds to this product's parent category. In the form, the CategoryID needs to be represented as a combo box that is bound to the Category table. The idea here is pretty straightforward: selecting a new Category should update the CategoryID in the Product table. The problem I'm running into is that selecting a new Category updates the CategoryName of the Category table instead of updating the CategoryID in the Product table. The reason for this is that it seems that the combo box must be bound only to the CategoryName of the Category table. What happens is if the current product has a CategoryID of 12 which is the CategoryName "Chairs" in the Category table then selecting a new value, let's say "Tables" (CategoryID 13) in the combo box updates the CategoryID of 12 with the new CategoryName "Tables" instead of updating the Product table CategoryID to 13. How can I bind the Category table to a combox box so that the datatextfield (which I wish existed in Access) is the CategoryName and the datavaluefield is the CategoryID and only the CategoryID of the Product will be updated when the selected combo box item is changed?
0
69,049
09/16/2008 03:00:00
10,703
09/16/2008 01:08:24
11
2
How can you insure your code executes with no variability in execution time?
In an embedded application (written in C, on a 32-bit processor) with hard real-time constraints, the execution time of critical code (specially interrupts) needs to be constant. How do you insure that time variability is not introduced **in the execution** of the code, specifically due to the processor's caches (be it L1, L2 or L3)?
processor
time
profiling
caching
null
null
open
How can you insure your code executes with no variability in execution time? === In an embedded application (written in C, on a 32-bit processor) with hard real-time constraints, the execution time of critical code (specially interrupts) needs to be constant. How do you insure that time variability is not introduced **in the execution** of the code, specifically due to the processor's caches (be it L1, L2 or L3)?
0
69,063
09/16/2008 03:03:12
10,433
09/15/2008 23:06:36
6
3
How to default the source folder for new JUnit tests in Eclipse?
Most of our Eclipse projects have multiple source folders, for example: - src/main/java - src/test/java When you right-click on a class and choose New JUnit Test, the default source folder for the new test is "src/main/java" (presumably the first source folder listed in the project properties). Is there any way to change the default source folder for new JUnit tests, so that when I do the above action, the new test will be created in say the "src/test/java" folder by default?
java
eclipse
usability
junit
null
null
open
How to default the source folder for new JUnit tests in Eclipse? === Most of our Eclipse projects have multiple source folders, for example: - src/main/java - src/test/java When you right-click on a class and choose New JUnit Test, the default source folder for the new test is "src/main/java" (presumably the first source folder listed in the project properties). Is there any way to change the default source folder for new JUnit tests, so that when I do the above action, the new test will be created in say the "src/test/java" folder by default?
0
69,076
09/16/2008 03:06:00
1,368
08/14/2008 18:57:47
339
11
OpenID login workflow
When someone logs into a site using Open ID, what goes on behind the scene? can someone explain to me the work flow/steps of what happens during a typical login from a partner open ID site? (like this site) i.e. when I login at myopenid, what is passed into this site? how does SO know it was a correct login?
openid
null
null
null
null
null
open
OpenID login workflow === When someone logs into a site using Open ID, what goes on behind the scene? can someone explain to me the work flow/steps of what happens during a typical login from a partner open ID site? (like this site) i.e. when I login at myopenid, what is passed into this site? how does SO know it was a correct login?
0
69,089
09/16/2008 03:08:20
1,899
08/19/2008 09:19:13
6
0
How to do hit-highlighting of results from a SQL Server full-text query
Microsoft's Search Server 2008 has hit highlighting support built in, but SQL Server (2008) does not seem to have it. Do we need to build this from scratch or is there perhaps some libraries or knowledge around on how to do this? Thanks.
c#
sql-server
full-text-search
null
null
null
open
How to do hit-highlighting of results from a SQL Server full-text query === Microsoft's Search Server 2008 has hit highlighting support built in, but SQL Server (2008) does not seem to have it. Do we need to build this from scratch or is there perhaps some libraries or knowledge around on how to do this? Thanks.
0
69,093
09/16/2008 03:08:51
10,431
09/15/2008 23:05:28
18
3
Leading edge of Software Design?
So.... we have a much better tool kit of design advice these days.... Design patterns have been around for years Agile TDD/Refactoring processes have helped hone pragmatic OO skills Domain Driven Design offers great advice on understanding a problem space Polygot programming allows OO / functional / Dynamic allows appropriate ways of solving different kinds of problems Reflection / Aspects have allowed much simpler composability Frameworks have evolved slowly to be very powerful Where's the edge of how to design software now? What's up and coming?
software-engineering
null
null
null
null
null
open
Leading edge of Software Design? === So.... we have a much better tool kit of design advice these days.... Design patterns have been around for years Agile TDD/Refactoring processes have helped hone pragmatic OO skills Domain Driven Design offers great advice on understanding a problem space Polygot programming allows OO / functional / Dynamic allows appropriate ways of solving different kinds of problems Reflection / Aspects have allowed much simpler composability Frameworks have evolved slowly to be very powerful Where's the edge of how to design software now? What's up and coming?
0
69,104
09/16/2008 03:11:06
209
08/03/2008 13:54:19
101
6
Reading Body on chunked transfer encoded http requests in ASP.NET
A J2ME client is sending HTTP POST requests with chunked transfer encoding. When ASP.NET (in both IIS6 and WebDev.exe.server) tries to read the request it sets the Content-Length to 0. I guess this is ok because the Content-length is unknown when the request is loaded. However, when I read the Request.InputStream to the end, it returns 0. Here's the code I'm using to read the input stream. using (var reader = new StreamReader(httpRequestBodyStream, BodyTextEncoding)) { string readString = reader.ReadToEnd(); Console.WriteLine("CharSize:" + readString.Length); return BodyTextEncoding.GetBytes(readString); } I can simulate the behaiviour of the client with Fiddler, e.g. **URL** http://somesite.com:15148/page.aspx **Headers:** User-Agent: Fiddler Transfer-Encoding: Chunked Host: somesite.com:15148 **Body** rabbits rabbits rabbits rabbits. thanks for coming, it's been very useful! My body reader from above will return a zero length byte array...lame... Does anyone know how to enable chunked encoding on IIS and ASP.NET Development Server (cassini)?
asp.net
asp.net-mvc
null
null
null
null
open
Reading Body on chunked transfer encoded http requests in ASP.NET === A J2ME client is sending HTTP POST requests with chunked transfer encoding. When ASP.NET (in both IIS6 and WebDev.exe.server) tries to read the request it sets the Content-Length to 0. I guess this is ok because the Content-length is unknown when the request is loaded. However, when I read the Request.InputStream to the end, it returns 0. Here's the code I'm using to read the input stream. using (var reader = new StreamReader(httpRequestBodyStream, BodyTextEncoding)) { string readString = reader.ReadToEnd(); Console.WriteLine("CharSize:" + readString.Length); return BodyTextEncoding.GetBytes(readString); } I can simulate the behaiviour of the client with Fiddler, e.g. **URL** http://somesite.com:15148/page.aspx **Headers:** User-Agent: Fiddler Transfer-Encoding: Chunked Host: somesite.com:15148 **Body** rabbits rabbits rabbits rabbits. thanks for coming, it's been very useful! My body reader from above will return a zero length byte array...lame... Does anyone know how to enable chunked encoding on IIS and ASP.NET Development Server (cassini)?
0
69,107
09/16/2008 03:12:33
3,747
08/30/2008 14:33:59
328
28
Best Refactor to Handle Multiple jQuery Email Field Form Validation
What is the best way to refactor the attached code to accommodate multiple email addresses? The attached HTML/jQuery is complete and works for the first email address. I can setup the other two by copy/pasting and changing the code. But I would like to just refactor the existing code to handle multiple email address fields. <html> <head> <script src="includes/jquery/jquery-1.2.6.min.js" type="text/javascript"></script> <script language="javascript"> $(document).ready(function() { var validateUsername = $('#Email_Address_Status_Icon_1'); $('#Email_Address_1').keyup(function() { var t = this; if (this.value != this.lastValue) { if (this.timer) clearTimeout(this.timer); validateUsername.removeClass('error').html('Validating Email'); this.timer = setTimeout(function() { if (IsEmail(t.value)) { validateUsername.html('Valid Email'); } else { validateUsername.html('Not a valid Email'); }; }, 200); this.lastValue = this.value; } }); }); function IsEmail(email) { var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; if (regex.test(email)) return true; else return false; } </script> </head> <body> <div> <label for="Email_Address_1">Friend #1</label></div> <input type="text" ID="Email_Address_1"> <span id="Email_Address_Status_Icon_1"></span> </div> <div> <label for="Email_Address_2">Friend #2</label></div> <input type="text" id="Email_Address_2"> <span id="Email_Address_Status_Icon_2"></span> </div> <div> <label for="Email_Address_3">Friend #3</label></div> <input type="text" id="Email_Address_3"> <span id="Email_Address_Status_Icon_3"></span> </div> </form> </body> </html>
jquery
email
form-validation
refactor
null
null
open
Best Refactor to Handle Multiple jQuery Email Field Form Validation === What is the best way to refactor the attached code to accommodate multiple email addresses? The attached HTML/jQuery is complete and works for the first email address. I can setup the other two by copy/pasting and changing the code. But I would like to just refactor the existing code to handle multiple email address fields. <html> <head> <script src="includes/jquery/jquery-1.2.6.min.js" type="text/javascript"></script> <script language="javascript"> $(document).ready(function() { var validateUsername = $('#Email_Address_Status_Icon_1'); $('#Email_Address_1').keyup(function() { var t = this; if (this.value != this.lastValue) { if (this.timer) clearTimeout(this.timer); validateUsername.removeClass('error').html('Validating Email'); this.timer = setTimeout(function() { if (IsEmail(t.value)) { validateUsername.html('Valid Email'); } else { validateUsername.html('Not a valid Email'); }; }, 200); this.lastValue = this.value; } }); }); function IsEmail(email) { var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; if (regex.test(email)) return true; else return false; } </script> </head> <body> <div> <label for="Email_Address_1">Friend #1</label></div> <input type="text" ID="Email_Address_1"> <span id="Email_Address_Status_Icon_1"></span> </div> <div> <label for="Email_Address_2">Friend #2</label></div> <input type="text" id="Email_Address_2"> <span id="Email_Address_Status_Icon_2"></span> </div> <div> <label for="Email_Address_3">Friend #3</label></div> <input type="text" id="Email_Address_3"> <span id="Email_Address_Status_Icon_3"></span> </div> </form> </body> </html>
0
69,108
09/16/2008 03:12:40
10,644
09/16/2008 00:39:23
1
0
Using Java JAR file in .NET
What options/methods/software are available to convert a JAR file to a managed .NET assembly? Please provide all commercial and non-commercial methods in the answer. These don't include solutions which require Java to be installed on the host machine.
.net
java
jar
managed
null
null
open
Using Java JAR file in .NET === What options/methods/software are available to convert a JAR file to a managed .NET assembly? Please provide all commercial and non-commercial methods in the answer. These don't include solutions which require Java to be installed on the host machine.
0
69,112
09/16/2008 03:14:58
10,774
09/16/2008 01:44:32
1
1
What is a symbol?
Can someone describe what a symbol table is in a C and C++ application?
c
c++
null
null
null
null
open
What is a symbol? === Can someone describe what a symbol table is in a C and C++ application?
0
69,115
09/16/2008 03:15:40
716
08/08/2008 06:57:38
361
31
char[] to hex string exercise
Below is my current char* to hex string function. I wrote it as an exercise in bit manipulation. It takes ~5ms on a AMD Athlon MP 2800+ to hexify a 10 million byte array. Is there any trick or other way that I am missing? How can I make this faster? static const char _hex2asciiU_value[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; std::string char_to_hex( const unsigned char* _pArray, unsigned int _len ) { std::string str; str.resize(_len*2); char* pszHex = &str[0]; const unsigned char* pEnd = _pArray + _len; unsigned int ofs = 0; const char* pHex = _hex2asciiU_value; for( const unsigned char* pChar = _pArray; pChar != pEnd; pChar++, pszHex += 2 ) { ofs = *pChar >> 4; pszHex[0] = pHex[ofs]; pszHex[1] = pHex[*pChar-(ofs*16)]; } return str; }
c++
optimization
hex
null
null
null
open
char[] to hex string exercise === Below is my current char* to hex string function. I wrote it as an exercise in bit manipulation. It takes ~5ms on a AMD Athlon MP 2800+ to hexify a 10 million byte array. Is there any trick or other way that I am missing? How can I make this faster? static const char _hex2asciiU_value[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; std::string char_to_hex( const unsigned char* _pArray, unsigned int _len ) { std::string str; str.resize(_len*2); char* pszHex = &str[0]; const unsigned char* pEnd = _pArray + _len; unsigned int ofs = 0; const char* pHex = _hex2asciiU_value; for( const unsigned char* pChar = _pArray; pChar != pEnd; pChar++, pszHex += 2 ) { ofs = *pChar >> 4; pszHex[0] = pHex[ofs]; pszHex[1] = pHex[*pChar-(ofs*16)]; } return str; }
0
69,128
09/16/2008 03:18:10
10,941
09/16/2008 03:09:46
1
0
SaaS database design - Multiple Databases? Split?
I've seen SaaS applications hosted in many different ways. Is it a good idea to split features and modules across multiple databases? For example, putting things like the User table on one DB and feature/app specific tables on another DB and perhaps other commonly shared tables in another DB?
c#
database
architecture
saas
null
null
open
SaaS database design - Multiple Databases? Split? === I've seen SaaS applications hosted in many different ways. Is it a good idea to split features and modules across multiple databases? For example, putting things like the User table on one DB and feature/app specific tables on another DB and perhaps other commonly shared tables in another DB?
0