question_id
int64
4
6.31M
answer_id
int64
7
6.31M
title
stringlengths
9
150
question_body
stringlengths
0
28.8k
answer_body
stringlengths
60
27.2k
question_text
stringlengths
40
28.9k
combined_text
stringlengths
124
39.6k
tags
listlengths
1
6
question_score
int64
0
26.3k
answer_score
int64
0
28.8k
view_count
int64
15
14M
answer_count
int64
0
182
favorite_count
int64
0
32
question_creation_date
stringdate
2008-07-31 21:42:52
2011-06-10 18:12:18
answer_creation_date
stringdate
2008-07-31 22:17:57
2011-06-10 18:14:17
63,646
63,754
WPF Data Binding and Validation Rules Best Practices
I have a very simple WPF application in which I am using data binding to allow editing of some custom CLR objects. I am now wanting to put some input validation in when the user clicks save. However, all the WPF books I have read don't really devote any space to this issue. I see that you can create custom ValidationRu...
I think the new preferred way might be to use IDataErrorInfo Read more here
WPF Data Binding and Validation Rules Best Practices I have a very simple WPF application in which I am using data binding to allow editing of some custom CLR objects. I am now wanting to put some input validation in when the user clicks save. However, all the WPF books I have read don't really devote any space to this...
TITLE: WPF Data Binding and Validation Rules Best Practices QUESTION: I have a very simple WPF application in which I am using data binding to allow editing of some custom CLR objects. I am now wanting to put some input validation in when the user clicks save. However, all the WPF books I have read don't really devote...
[ ".net", "wpf", "data-binding", "validation" ]
101
83
120,516
6
0
2008-09-15T14:56:37.410000
2008-09-15T15:09:12.527000
63,658
63,739
How do I stop network flooding using Windows 2003 Network Load balancing?
I know that the MsNLB can be configured to user mulitcast with IGMP. However, if the switch does not support IGMP what are the options?
If you can find an old "dumb" hub, you can run the node NIC's through it, or if your switch is managable you can set the ports up so that they do not remember the MAC address to IP address mappings. I will say that I have had horrible experience with WLBS (the 2003+ version of NLB) in regards to port flooding. We have ...
How do I stop network flooding using Windows 2003 Network Load balancing? I know that the MsNLB can be configured to user mulitcast with IGMP. However, if the switch does not support IGMP what are the options?
TITLE: How do I stop network flooding using Windows 2003 Network Load balancing? QUESTION: I know that the MsNLB can be configured to user mulitcast with IGMP. However, if the switch does not support IGMP what are the options? ANSWER: If you can find an old "dumb" hub, you can run the node NIC's through it, or if you...
[ "windows-server-2003", "load-balancing" ]
0
0
960
1
0
2008-09-15T14:58:02.103000
2008-09-15T15:07:38.147000
63,671
63,757
Is it safe for structs to implement interfaces?
I seem to remember reading something about how it is bad for structs to implement interfaces in CLR via C#, but I can't seem to find anything about it. Is it bad? Are there unintended consequences of doing so? public interface Foo { Bar GetBar(); } public struct Fubar: Foo { public Bar GetBar() { return new Bar(); } }
There are several things going on in this question... It is possible for a struct to implement an interface, but there are concerns that come about with casting, mutability, and performance. See this post for more details: https://learn.microsoft.com/en-us/archive/blogs/abhinaba/c-structs-and-interface In general, stru...
Is it safe for structs to implement interfaces? I seem to remember reading something about how it is bad for structs to implement interfaces in CLR via C#, but I can't seem to find anything about it. Is it bad? Are there unintended consequences of doing so? public interface Foo { Bar GetBar(); } public struct Fubar: Fo...
TITLE: Is it safe for structs to implement interfaces? QUESTION: I seem to remember reading something about how it is bad for structs to implement interfaces in CLR via C#, but I can't seem to find anything about it. Is it bad? Are there unintended consequences of doing so? public interface Foo { Bar GetBar(); } publi...
[ "c#", "interface", "struct" ]
114
55
89,475
9
0
2008-09-15T14:59:29.743000
2008-09-15T15:09:21.780000
63,687
63,701
Calling function when program exits in java
I would like to save the programs settings every time the user exits the program. So I need a way to call a function when the user quits the program. How do I do that? I am using Java 1.5.
You can add a shutdown hook to your application by doing the following: Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { public void run() { // what you want to do } })); This is basically equivalent to having a try {} finally {} block around your entire program, and basically encompasses what's in the ...
Calling function when program exits in java I would like to save the programs settings every time the user exits the program. So I need a way to call a function when the user quits the program. How do I do that? I am using Java 1.5.
TITLE: Calling function when program exits in java QUESTION: I would like to save the programs settings every time the user exits the program. So I need a way to call a function when the user quits the program. How do I do that? I am using Java 1.5. ANSWER: You can add a shutdown hook to your application by doing the...
[ "java", "events" ]
18
45
20,487
4
0
2008-09-15T15:01:28.863000
2008-09-15T15:03:27.020000
63,694
64,142
Creating a Math library using Generics in C#
Is there any feasible way of using generics to create a Math library that does not depend on the base type chosen to store data? In other words, let's assume I want to write a Fraction class. The fraction can be represented by two ints or two doubles or whatnot. The important thing is that the basic four arithmetic ope...
Here is a way to abstract out the operators that is relatively painless. abstract class MathProvider { public abstract T Divide(T a, T b); public abstract T Multiply(T a, T b); public abstract T Add(T a, T b); public abstract T Negate(T a); public virtual T Subtract(T a, T b) { return Add(a, Negate(b)); } } class Doub...
Creating a Math library using Generics in C# Is there any feasible way of using generics to create a Math library that does not depend on the base type chosen to store data? In other words, let's assume I want to write a Fraction class. The fraction can be represented by two ints or two doubles or whatnot. The importan...
TITLE: Creating a Math library using Generics in C# QUESTION: Is there any feasible way of using generics to create a Math library that does not depend on the base type chosen to store data? In other words, let's assume I want to write a Fraction class. The fraction can be represented by two ints or two doubles or wha...
[ "c#", "generics", "interface", "math" ]
33
34
34,748
6
0
2008-09-15T15:02:16.337000
2008-09-15T15:51:16.857000
63,720
90,443
Does Vista do stricter checking of Interface Ids in DCOM calls? (the Stub received bad Data)?
I hope everyone will pardon the length, and narrative fashion, of this question. I decided to describe the situation in some detail in my blog. I later saw Joel's invitation to this site, and I thought I'd paste it here to see if anyone has any insight into the situation. I wrote, and now support, an application that c...
When Microsoft got the security religion, DCOM (and the underlying RPC) got a lot of attention, and there definitely were changes made to close security holes that resulted in stricter marshaling. I'm suprised you see this in Vista but not in XP, but its possible that additional checks were added for Vista. Alternative...
Does Vista do stricter checking of Interface Ids in DCOM calls? (the Stub received bad Data)? I hope everyone will pardon the length, and narrative fashion, of this question. I decided to describe the situation in some detail in my blog. I later saw Joel's invitation to this site, and I thought I'd paste it here to see...
TITLE: Does Vista do stricter checking of Interface Ids in DCOM calls? (the Stub received bad Data)? QUESTION: I hope everyone will pardon the length, and narrative fashion, of this question. I decided to describe the situation in some detail in my blog. I later saw Joel's invitation to this site, and I thought I'd pa...
[ "windows-vista", "dcom" ]
5
2
739
1
0
2008-09-15T15:05:05.267000
2008-09-18T06:10:31.627000
63,743
65,912
innerHTML manipulation in JavaScript
I am developing a web page code, which fetches dynamically the content from the server and then places this content to container nodes using something like container.innerHTML = content; Sometimes I have to overwrite some previous content in this node. This works fine, until it happens that previous content occupied mo...
The easiest solution that I have found would be to place an anchor tag at the top of the div you are editing: Then when you change the content of the div, you can do this to have the browser jump to your anchor tag: location.hash = 'ajax-div'; Use this to make sure the user isn't scrolled down too far when you update t...
innerHTML manipulation in JavaScript I am developing a web page code, which fetches dynamically the content from the server and then places this content to container nodes using something like container.innerHTML = content; Sometimes I have to overwrite some previous content in this node. This works fine, until it happ...
TITLE: innerHTML manipulation in JavaScript QUESTION: I am developing a web page code, which fetches dynamically the content from the server and then places this content to container nodes using something like container.innerHTML = content; Sometimes I have to overwrite some previous content in this node. This works f...
[ "javascript", "html", "dom" ]
0
4
2,660
6
0
2008-09-15T15:08:05.510000
2008-09-15T19:21:47.507000
63,748
64,847
Should I use clone when adding a new element? When should clone be used?
I want to implement in Java a class for handling graph data structures. I have a Node class and an Edge class. The Graph class maintains two list: a list of nodes and a list of edges. Each node must have an unique name. How do I guard against a situation like this: Graph g = new Graph(); Node n1 = new Node("#1"); Node...
I work with graph structures in Java a lot, and my advice would be to make any data member of the Node and Edge class that the Graph depends on for maintaining its structure final, with no setters. In fact, if you can, I would make Node and Edge completely immutable, which has many benefits. So, for example: public fin...
Should I use clone when adding a new element? When should clone be used? I want to implement in Java a class for handling graph data structures. I have a Node class and an Edge class. The Graph class maintains two list: a list of nodes and a list of edges. Each node must have an unique name. How do I guard against a si...
TITLE: Should I use clone when adding a new element? When should clone be used? QUESTION: I want to implement in Java a class for handling graph data structures. I have a Node class and an Edge class. The Graph class maintains two list: a list of nodes and a list of edges. Each node must have an unique name. How do I ...
[ "java", "memory", "class" ]
2
4
443
6
0
2008-09-15T15:08:20.360000
2008-09-15T17:19:00.797000
63,749
63,944
What user account would you recommend running the SQL Server Express 2008 services in a development environment?
The SQL Server Express 2008 setup allow you to assign different user account for each service. For a development environment, would you use a domain user, local user, NT Authority\NETWORK SERCVICE, NT Authority\Local System or some other account and why?
Local System is not recommended, it is an administrator equivalent account and thus can lead to questionable coding that takes advantage of administrator privileges which would not be allowed in a production system since security conscious Admins/DBA's really don't like to run services as admin. Depending on if the ser...
What user account would you recommend running the SQL Server Express 2008 services in a development environment? The SQL Server Express 2008 setup allow you to assign different user account for each service. For a development environment, would you use a domain user, local user, NT Authority\NETWORK SERCVICE, NT Author...
TITLE: What user account would you recommend running the SQL Server Express 2008 services in a development environment? QUESTION: The SQL Server Express 2008 setup allow you to assign different user account for each service. For a development environment, would you use a domain user, local user, NT Authority\NETWORK S...
[ "sql-server", "installation", "development-environment", "account" ]
29
36
65,314
4
0
2008-09-15T15:08:22.203000
2008-09-15T15:28:32.107000
63,756
64,026
Is there a way to "diff" two XMLs element-wise?
I'm needing to check the differences between two XMLs but not "blindly", Given that both use the same DTD, I'm actually interested in verifying wether they have the same amount of elements or if there's differences.
xmldiff from Logilab diffxml A commercial one include in XMLSpy
Is there a way to "diff" two XMLs element-wise? I'm needing to check the differences between two XMLs but not "blindly", Given that both use the same DTD, I'm actually interested in verifying wether they have the same amount of elements or if there's differences.
TITLE: Is there a way to "diff" two XMLs element-wise? QUESTION: I'm needing to check the differences between two XMLs but not "blindly", Given that both use the same DTD, I'm actually interested in verifying wether they have the same amount of elements or if there's differences. ANSWER: xmldiff from Logilab diffxml ...
[ "xml", "comparison", "diff", "dtd" ]
0
1
582
2
0
2008-09-15T15:09:20.903000
2008-09-15T15:37:38.793000
63,758
63,909
Is it possible to kill a Java Virtual Machine from another Virtual Machine?
I have a Java application that launches another java application. The launcher has a watchdog timer and receives periodic notifications from the second VM. However, if no notifications are received then the second virtual machine should be killed and the launcher will perform some additional clean-up activities. The qu...
I may be missing something but can't you call the destroy() method on the Process object returned by Runtime.exec()?
Is it possible to kill a Java Virtual Machine from another Virtual Machine? I have a Java application that launches another java application. The launcher has a watchdog timer and receives periodic notifications from the second VM. However, if no notifications are received then the second virtual machine should be kill...
TITLE: Is it possible to kill a Java Virtual Machine from another Virtual Machine? QUESTION: I have a Java application that launches another java application. The launcher has a watchdog timer and receives periodic notifications from the second VM. However, if no notifications are received then the second virtual mach...
[ "java", "process-management" ]
4
6
4,406
9
0
2008-09-15T15:09:23.527000
2008-09-15T15:24:49.043000
63,764
157,565
What databases do I have permissions on
How can I find what databases I have a minimum of read access to in either basic SQL, MySQL specific or in PHP?
There is a command in MySQL which can show you all of the permissions you have. The command is: SHOW GRANTS; It will give you output similar to: root@(none)~> show grants; +---------------------------------------------------------------------+ | Grants for root@localhost | +---------------------------------------------...
What databases do I have permissions on How can I find what databases I have a minimum of read access to in either basic SQL, MySQL specific or in PHP?
TITLE: What databases do I have permissions on QUESTION: How can I find what databases I have a minimum of read access to in either basic SQL, MySQL specific or in PHP? ANSWER: There is a command in MySQL which can show you all of the permissions you have. The command is: SHOW GRANTS; It will give you output similar ...
[ "php", "sql", "mysql", "permissions" ]
5
5
284
3
0
2008-09-15T15:09:54.210000
2008-10-01T13:22:51.007000
63,776
70,906
Bit reversal of an integer, ignoring integer size and endianness
Given an integer typedef: typedef unsigned int TYPE; or typedef unsigned long TYPE; I have the following code to reverse the bits of an integer: TYPE max_bit= (TYPE)-1; void reverse_int_setup() { TYPE bits= (TYPE)max_bit; while (bits <<= 1) max_bit= bits; } TYPE reverse_int(TYPE arg) { TYPE bit_setter= 1, bit_tester...
#include #include #define TYPE_BITS sizeof(TYPE)*CHAR_BIT typedef unsigned long TYPE; TYPE reverser(TYPE n) { TYPE nrev = 0, i, bit1, bit2; int count; for(i = 0; i < TYPE_BITS; i += 2) { /*In each iteration, we swap one bit on the 'right half' of the number with another on the left half*/ count = TYPE_BITS - i - 1;...
Bit reversal of an integer, ignoring integer size and endianness Given an integer typedef: typedef unsigned int TYPE; or typedef unsigned long TYPE; I have the following code to reverse the bits of an integer: TYPE max_bit= (TYPE)-1; void reverse_int_setup() { TYPE bits= (TYPE)max_bit; while (bits <<= 1) max_bit= bit...
TITLE: Bit reversal of an integer, ignoring integer size and endianness QUESTION: Given an integer typedef: typedef unsigned int TYPE; or typedef unsigned long TYPE; I have the following code to reverse the bits of an integer: TYPE max_bit= (TYPE)-1; void reverse_int_setup() { TYPE bits= (TYPE)max_bit; while (bits <...
[ "c", "integer", "bit-manipulation" ]
6
6
7,581
12
0
2008-09-15T15:10:49.107000
2008-09-16T10:06:42.217000
63,778
63,851
What are my options for having the RadioButtonList functionality of ASP.NET in WinForms?
Is this type of control only available in a 3rd-party library? Has someone implemented an open source version?
I believe you can include radio buttons in a grid, though that's more cumbersome than it needs to be. Also, I don't think it'd be that hard to make your own control that creates the radio buttons dynamically using a flowlayout panel.
What are my options for having the RadioButtonList functionality of ASP.NET in WinForms? Is this type of control only available in a 3rd-party library? Has someone implemented an open source version?
TITLE: What are my options for having the RadioButtonList functionality of ASP.NET in WinForms? QUESTION: Is this type of control only available in a 3rd-party library? Has someone implemented an open source version? ANSWER: I believe you can include radio buttons in a grid, though that's more cumbersome than it need...
[ "winforms", "webforms", "radio-button", "radiobuttonlist" ]
0
1
382
1
0
2008-09-15T15:10:55.800000
2008-09-15T15:17:33.083000
63,784
64,682
Implementing scripts in c++ app
I want to move various parts of my app into simple scripts, to allow people that do not have a strong knowledge of c++ to be able to edit and implement various features. Because it's a real time app, I need to have some kind of multitasking for these scripts. Ideally I want it so that the c++ app calls a script functio...
You can use either Lua or Python. Lua is more "lightweight" than python. It's got a smaller memory footprint than python does and in our experience was easier to integrate (people's mileage on this point might vary). It can support a bunch of scripts running simultaneously. Lua, at least, supports stopping/starting thr...
Implementing scripts in c++ app I want to move various parts of my app into simple scripts, to allow people that do not have a strong knowledge of c++ to be able to edit and implement various features. Because it's a real time app, I need to have some kind of multitasking for these scripts. Ideally I want it so that th...
TITLE: Implementing scripts in c++ app QUESTION: I want to move various parts of my app into simple scripts, to allow people that do not have a strong knowledge of c++ to be able to edit and implement various features. Because it's a real time app, I need to have some kind of multitasking for these scripts. Ideally I ...
[ "c++", "scripting" ]
26
26
11,280
9
0
2008-09-15T15:11:42.630000
2008-09-15T16:56:52.113000
63,787
69,387
What makes Drupal better/different from Joomla
I talked to a few friends who say that Drupal is amazing, and it is a way better than Joomla. What are the major differences/advantages?
The general consensus is that programmers prefer Drupal whereas mere mortals prefer Joomla. Joomla is praised for having a simpler user interface. (I personally don't agree with that; I think Joomla's UI is pretty painful to use. But then again, I'm looking at it with a programmer's eye.) Drupal, on the other hand, is ...
What makes Drupal better/different from Joomla I talked to a few friends who say that Drupal is amazing, and it is a way better than Joomla. What are the major differences/advantages?
TITLE: What makes Drupal better/different from Joomla QUESTION: I talked to a few friends who say that Drupal is amazing, and it is a way better than Joomla. What are the major differences/advantages? ANSWER: The general consensus is that programmers prefer Drupal whereas mere mortals prefer Joomla. Joomla is praised...
[ "drupal", "joomla" ]
3
20
2,938
8
0
2008-09-15T15:11:45.563000
2008-09-16T04:29:09.750000
63,790
254,008
VS 2003 Reports "unable to get the project file from the web server" when opening a solution from VSS
When attempting to open a project from source control on a newly formatted pc, I receive an "unable to get the project file from the web server" after getting the sln file from VSS. If I attempt to open the sln file from explorer, I also receive the same error. Any pointers or ideas? Thanks!
This question is very old so you have probably solved the issue, but just in case: Does the project file use IIS? If so then it is probably trying to read the project file from IIS and the virtual directory does not exist on the newly formatted computer. Also, there should be more detail about the message in the Output...
VS 2003 Reports "unable to get the project file from the web server" when opening a solution from VSS When attempting to open a project from source control on a newly formatted pc, I receive an "unable to get the project file from the web server" after getting the sln file from VSS. If I attempt to open the sln file fr...
TITLE: VS 2003 Reports "unable to get the project file from the web server" when opening a solution from VSS QUESTION: When attempting to open a project from source control on a newly formatted pc, I receive an "unable to get the project file from the web server" after getting the sln file from VSS. If I attempt to op...
[ "visual-sourcesafe", "visual-studio-2003" ]
0
1
3,303
4
0
2008-09-15T15:12:16.297000
2008-10-31T15:56:23.243000
63,805
65,148
Equivalent of *Nix 'which' command in PowerShell?
How do I ask PowerShell where something is? For instance, "which notepad" and it returns the directory where the notepad.exe is run from according to the current paths.
The very first alias I made once I started customizing my profile in PowerShell was 'which'. New-Alias which get-command To add this to your profile, type this: "`nNew-Alias which get-command" | add-content $profile The `n at the start of the last line is to ensure it will start as a new line.
Equivalent of *Nix 'which' command in PowerShell? How do I ask PowerShell where something is? For instance, "which notepad" and it returns the directory where the notepad.exe is run from according to the current paths.
TITLE: Equivalent of *Nix 'which' command in PowerShell? QUESTION: How do I ask PowerShell where something is? For instance, "which notepad" and it returns the directory where the notepad.exe is run from according to the current paths. ANSWER: The very first alias I made once I started customizing my profile in Power...
[ "unix", "powershell", "command" ]
514
505
150,756
18
0
2008-09-15T15:13:59.460000
2008-09-15T17:56:32.890000
63,870
63,941
Splitting a file and its lines under Linux/bash
I have a rather large file (150 million lines of 10 chars). I need to split it in 150 files of 2 million lines, with each output line being alternatively the first 5 characters or the last 5 characters of the source line. I could do this in Perl rather quickly, but I was wondering if there was an easy solution using ba...
Homework?:-) I would think that a simple pipe with sed (to split each line into two) and split (to split things up into multiple files) would be enough. The man command is your friend. Added after confirmation that it is not homework: How about sed 's/\(.....\)\(.....\)/\1\n\2/' input_file | split -l 2000000 - out-pref...
Splitting a file and its lines under Linux/bash I have a rather large file (150 million lines of 10 chars). I need to split it in 150 files of 2 million lines, with each output line being alternatively the first 5 characters or the last 5 characters of the source line. I could do this in Perl rather quickly, but I was ...
TITLE: Splitting a file and its lines under Linux/bash QUESTION: I have a rather large file (150 million lines of 10 chars). I need to split it in 150 files of 2 million lines, with each output line being alternatively the first 5 characters or the last 5 characters of the source line. I could do this in Perl rather q...
[ "linux", "bash", "large-files", "filesplitting" ]
2
2
3,788
4
0
2008-09-15T15:19:29.617000
2008-09-15T15:28:24.773000
63,875
75,372
SQL Server 2005 has problems connecting to a website running on the same server
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) Hello I am...
I fixed the issue that I had with the connection. The problem was on my application. The cause of the issue was that a connection string to the development (instead of the production) database, was hardcoded by one of the dialogs that generates the datasets. This dialog placed the connection string both on the web.conf...
SQL Server 2005 has problems connecting to a website running on the same server An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named P...
TITLE: SQL Server 2005 has problems connecting to a website running on the same server QUESTION: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. ...
[ "asp.net", "sql-server-2005", "database-connection" ]
1
0
1,742
9
0
2008-09-15T15:20:29.020000
2008-09-16T18:20:50.577000
63,876
63,947
DVD menu coding
As a programmer I have no idea how one would go about programming menus for a DVD, I have heard that this is possible, and even seen basic games using DVD menus - although it may very well be a closed-system. Is it even possible and if so, what language, compilers etc exist for this?
There are a couple of open source projects that can create DVDs plus menus. I recently used dvd-slideshow to create a simple dvd with menus etc. Another one is DVD Styler. All of these programs are basically a front-end for various command-line tools for encoding, menu creation etc. Since these are open source projects...
DVD menu coding As a programmer I have no idea how one would go about programming menus for a DVD, I have heard that this is possible, and even seen basic games using DVD menus - although it may very well be a closed-system. Is it even possible and if so, what language, compilers etc exist for this?
TITLE: DVD menu coding QUESTION: As a programmer I have no idea how one would go about programming menus for a DVD, I have heard that this is possible, and even seen basic games using DVD menus - although it may very well be a closed-system. Is it even possible and if so, what language, compilers etc exist for this? ...
[ "menu", "dvd" ]
10
5
9,806
4
0
2008-09-15T15:20:42.967000
2008-09-15T15:28:39.393000
63,882
63,906
How do you view SQL Server 2005 Reporting Services reports from ReportViewer Control in DMZ
I want to be able to view a SQL Server 2005 Reporting Services report from an ASP.NET application in a DMZ through a ReportViewer control. The SQLand SSRS server are behind the firewall.
`So I had to change the way an ASP.NET 2.0 application called reports from pages. Originally, I used JavaScript to open a new window. ViewCostReport.OnClientClick = "window.open('" + Report.GetProjectCostURL(_PromotionID) + "','ProjectCost','resizable=yes')"; The issue I had was that the window.open call would only wor...
How do you view SQL Server 2005 Reporting Services reports from ReportViewer Control in DMZ I want to be able to view a SQL Server 2005 Reporting Services report from an ASP.NET application in a DMZ through a ReportViewer control. The SQLand SSRS server are behind the firewall.
TITLE: How do you view SQL Server 2005 Reporting Services reports from ReportViewer Control in DMZ QUESTION: I want to be able to view a SQL Server 2005 Reporting Services report from an ASP.NET application in a DMZ through a ReportViewer control. The SQLand SSRS server are behind the firewall. ANSWER: `So I had to c...
[ "asp.net", "reporting-services", "reportviewer", "reportingservices-2005" ]
1
4
4,748
1
0
2008-09-15T15:21:31.360000
2008-09-15T15:24:23.973000
63,885
64,025
How can I fix an issue in IE where borders don't show up when the mouse isn't hovered over an image
I am trying to create a rather simple effect on a set of images. When an image doesn't have the mouse over it, I'd like it to have a simple, gray border. When it does have an image over it, I'd like it to have a different, "selected", border. The following CSS works great in Firefox:.myImage a img { border: 1px solid g...
Try using a different colour. I'm not sure IE understands 'grey' (instead, use 'gray').
How can I fix an issue in IE where borders don't show up when the mouse isn't hovered over an image I am trying to create a rather simple effect on a set of images. When an image doesn't have the mouse over it, I'd like it to have a simple, gray border. When it does have an image over it, I'd like it to have a differen...
TITLE: How can I fix an issue in IE where borders don't show up when the mouse isn't hovered over an image QUESTION: I am trying to create a rather simple effect on a set of images. When an image doesn't have the mouse over it, I'd like it to have a simple, gray border. When it does have an image over it, I'd like it ...
[ "css", "internet-explorer", "image" ]
0
1
1,502
6
0
2008-09-15T15:22:02.293000
2008-09-15T15:37:13.567000
63,897
63,964
Why are the hash codes generated by this function not unique?
I'm testing the VB function below that I got from a Google search. I plan to use it to generate hash codes for quick string comparison. However, there are occasions in which two different strings have the same hash code. For example, these strings "122Gen 1 heap size (.NET CLR Memory w3wp):mccsmtpteweb025.2083333333333...
I'm betting there are more than just "occasions" when two strings generate the same hash using your function. In fact, it probably happens more often than you think. A few things to realize: First, there will be hash collisions. It happens. Even with really, really big spaces like MD5 (128 bits) there are still two str...
Why are the hash codes generated by this function not unique? I'm testing the VB function below that I got from a Google search. I plan to use it to generate hash codes for quick string comparison. However, there are occasions in which two different strings have the same hash code. For example, these strings "122Gen 1 ...
TITLE: Why are the hash codes generated by this function not unique? QUESTION: I'm testing the VB function below that I got from a Google search. I plan to use it to generate hash codes for quick string comparison. However, there are occasions in which two different strings have the same hash code. For example, these ...
[ "vb6", "hash-code-uniqueness", "hash-function" ]
1
10
4,095
14
0
2008-09-15T15:23:04.523000
2008-09-15T15:30:38.560000
63,910
64,320
Best Way to Animate Sprites in Flex
Is there a preferred way to handle animation when using Flex -- For instance, if I want to render a ball and bounce it around the screen?
I prefer to use a tweening library for things like this. Check these out: Tweener TweenLite / TweenMax KitchenSync I've had good luck actually using the first two, and have read great things about the last one.
Best Way to Animate Sprites in Flex Is there a preferred way to handle animation when using Flex -- For instance, if I want to render a ball and bounce it around the screen?
TITLE: Best Way to Animate Sprites in Flex QUESTION: Is there a preferred way to handle animation when using Flex -- For instance, if I want to render a ball and bounce it around the screen? ANSWER: I prefer to use a tweening library for things like this. Check these out: Tweener TweenLite / TweenMax KitchenSync I've...
[ "apache-flex" ]
2
1
2,047
4
0
2008-09-15T15:25:01.973000
2008-09-15T16:14:05.273000
63,918
63,928
What is the best online javascript/css/html/xhtml/dom reference?
I'm a front-end developer and I was looking for opinions about the best all-round online documentation for javascript/css/html/xhtml/dom/browser quirks and support. I've tried Sitepoint, Quirksmode, W3Schools but all of these seem to be lacking in certain aspects and have been using them in combination.
I like gotapi.com (Update 2: Site is apparently offline -- Use another resource such as MDN ) Update: the original answer was from 2008 -- today I would say to check out Mozilla Developer Network (as many others have also said).
What is the best online javascript/css/html/xhtml/dom reference? I'm a front-end developer and I was looking for opinions about the best all-round online documentation for javascript/css/html/xhtml/dom/browser quirks and support. I've tried Sitepoint, Quirksmode, W3Schools but all of these seem to be lacking in certain...
TITLE: What is the best online javascript/css/html/xhtml/dom reference? QUESTION: I'm a front-end developer and I was looking for opinions about the best all-round online documentation for javascript/css/html/xhtml/dom/browser quirks and support. I've tried Sitepoint, Quirksmode, W3Schools but all of these seem to be ...
[ "javascript", "html", "css", "ajax", "xhtml" ]
15
10
8,586
20
0
2008-09-15T15:25:30.320000
2008-09-15T15:26:26.183000
63,930
64,049
Struts 1.3: forward outside the application context?
Struts 1.3 application. Main website is NOT served by struts/Java. I need to forward the result of a struts action to a page in the website, that is outside of the struts context. Currently, I forward to a JSP in context and use a meta-refresh to forward to the real location. That seems kinda sucky. Is there a better w...
You can't "forward", in the strict sense. Just call sendRedirect() on the HttpServletResponse object in your Action class's execute() method and then, return null. Alternately, either call setModule() on the ActionForward object (that you are going to return) or set the path to an absolute URI.
Struts 1.3: forward outside the application context? Struts 1.3 application. Main website is NOT served by struts/Java. I need to forward the result of a struts action to a page in the website, that is outside of the struts context. Currently, I forward to a JSP in context and use a meta-refresh to forward to the real ...
TITLE: Struts 1.3: forward outside the application context? QUESTION: Struts 1.3 application. Main website is NOT served by struts/Java. I need to forward the result of a struts action to a page in the website, that is outside of the struts context. Currently, I forward to a JSP in context and use a meta-refresh to fo...
[ "java", "struts" ]
4
7
5,807
3
0
2008-09-15T15:27:09.677000
2008-09-15T15:40:55.947000
63,935
63,985
Can I submit a Struts form that references POJO (i.e. not just String or boolean) fields?
I have a Struts (1.3x) ActionForm that has several String and boolean properties/fields, but also has some POJO fields. so my form looks something like: MyForm extends ActionForm { private String name; private int id; private Thing thing;...getters/setters... } In the JSP I can reference the POJO's fields thusly:...and...
You can, as long as the fields follow the JavaBean conventions and the setter takes something Struts can understand. So Thing needs getThingName() and setThingName(String).
Can I submit a Struts form that references POJO (i.e. not just String or boolean) fields? I have a Struts (1.3x) ActionForm that has several String and boolean properties/fields, but also has some POJO fields. so my form looks something like: MyForm extends ActionForm { private String name; private int id; private Thin...
TITLE: Can I submit a Struts form that references POJO (i.e. not just String or boolean) fields? QUESTION: I have a Struts (1.3x) ActionForm that has several String and boolean properties/fields, but also has some POJO fields. so my form looks something like: MyForm extends ActionForm { private String name; private in...
[ "java", "jsp", "struts" ]
1
2
883
1
0
2008-09-15T15:27:51.140000
2008-09-15T15:33:03.860000
63,938
64,191
How do I show data in the header of a SQL 2005 Reporting Services report?
Out of the box SSRS reports cannot have data exposed in the page header. Is there a way to get this data to show?
One of the things I want in my reports is to have nice headers for my reports. I like to have a logo and the user's report parameters along with other data to show to give more information for the business needs the report needs to clarify. One of the things that Microsoft SQL Server 2005 Reporting Services cannot do n...
How do I show data in the header of a SQL 2005 Reporting Services report? Out of the box SSRS reports cannot have data exposed in the page header. Is there a way to get this data to show?
TITLE: How do I show data in the header of a SQL 2005 Reporting Services report? QUESTION: Out of the box SSRS reports cannot have data exposed in the page header. Is there a way to get this data to show? ANSWER: One of the things I want in my reports is to have nice headers for my reports. I like to have a logo and ...
[ "sql", "reporting-services", "header", "report" ]
8
6
9,510
7
0
2008-09-15T15:28:07.333000
2008-09-15T15:58:42.860000
63,960
64,053
Game Programming and Event Handlers
I haven't programmed games for about 10 years (My last experience was DJGPP + Allegro), but I thought I'd check out XNA over the weekend to see how it was shaping up. I am fairly impressed, however as I continue to piece together a game engine, I have a (probably) basic question. How much should you rely on C#'s Delega...
If you were to think of an event as a subscriber list, in your code all you are doing is registering a subscriber. The number of instructions needed to achieve that is likely to be minimal at the CLR level. If you want your code to be generic or dynamic, then you're need to check if something is subscribed prior to cal...
Game Programming and Event Handlers I haven't programmed games for about 10 years (My last experience was DJGPP + Allegro), but I thought I'd check out XNA over the weekend to see how it was shaping up. I am fairly impressed, however as I continue to piece together a game engine, I have a (probably) basic question. How...
TITLE: Game Programming and Event Handlers QUESTION: I haven't programmed games for about 10 years (My last experience was DJGPP + Allegro), but I thought I'd check out XNA over the weekend to see how it was shaping up. I am fairly impressed, however as I continue to piece together a game engine, I have a (probably) b...
[ "c#", "xna", "camera" ]
12
10
10,687
7
0
2008-09-15T15:30:25.427000
2008-09-15T15:41:23.603000
63,974
70,281
Flickering during updates to Controls in WinForms (e.g. DataGridView)
In my application I have a DataGridView control that displays data for the selected object. When I select a different object (in a combobox above), I need to update the grid. Unfortunately different objects have completely different data, even different columns, so I need to clear all the existing data and columns, cre...
Rather than adding the rows of the data grid one at a time, use the DataGridView.Rows.AddRange method to add all the rows at once. That should only update the display once. There's also a DataGridView.Columns.AddRange to do the same for the columns.
Flickering during updates to Controls in WinForms (e.g. DataGridView) In my application I have a DataGridView control that displays data for the selected object. When I select a different object (in a combobox above), I need to update the grid. Unfortunately different objects have completely different data, even differ...
TITLE: Flickering during updates to Controls in WinForms (e.g. DataGridView) QUESTION: In my application I have a DataGridView control that displays data for the selected object. When I select a different object (in a combobox above), I need to update the grid. Unfortunately different objects have completely different...
[ "c#", ".net", "winforms" ]
7
7
23,562
8
0
2008-09-15T15:31:32.537000
2008-09-16T08:13:49.880000
63,995
64,199
Giving class unique ID on instantiation: .Net
I would like to give a class a unique ID every time a new one is instantiated. For example with a class named Foo i would like to be able to do the following dim a as New Foo() dim b as New Foo() and a would get a unique id and b would get a unique ID. The ids only have to be unique over run time so i would just like t...
Consider the following code: Public Class Foo Private ReadOnly _fooId As FooId Public Sub New() _fooId = New FooId() End Sub Public ReadOnly Property Id() As Integer Get Return _fooId.Id End Get End Property End Class Public NotInheritable Class FooId Private Shared _nextId As Integer Private ReadOnly _id As Integer...
Giving class unique ID on instantiation: .Net I would like to give a class a unique ID every time a new one is instantiated. For example with a class named Foo i would like to be able to do the following dim a as New Foo() dim b as New Foo() and a would get a unique id and b would get a unique ID. The ids only have to ...
TITLE: Giving class unique ID on instantiation: .Net QUESTION: I would like to give a class a unique ID every time a new one is instantiated. For example with a class named Foo i would like to be able to do the following dim a as New Foo() dim b as New Foo() and a would get a unique id and b would get a unique ID. The...
[ ".net", "vb.net" ]
2
2
2,949
9
0
2008-09-15T15:34:22.997000
2008-09-15T15:59:55.870000
64,000
64,183
Draining Standard Error in Java
When launching a process from Java, both stderr and stdout can block on output if I don't read from the pipes. Currently I have a thread that pro-actively reads from one and the main thread blocks on the other. Is there an easy way to join the two streams or otherwise cause the subprocess to continue while not losing t...
Set the redirectErrorStream property on ProcessBuilder to send stderr output to stdout: ProcessBuilder builder = new ProcessBuilder(command); builder.redirectErrorStream(true); You should then create a thread to deal with the process stream, something like the following: Process p = builder.start(); InputHandler outHa...
Draining Standard Error in Java When launching a process from Java, both stderr and stdout can block on output if I don't read from the pipes. Currently I have a thread that pro-actively reads from one and the main thread blocks on the other. Is there an easy way to join the two streams or otherwise cause the subproces...
TITLE: Draining Standard Error in Java QUESTION: When launching a process from Java, both stderr and stdout can block on output if I don't read from the pipes. Currently I have a thread that pro-actively reads from one and the main thread blocks on the other. Is there an easy way to join the two streams or otherwise c...
[ "java", "multithreading", "process-management" ]
5
4
1,154
2
0
2008-09-15T15:34:35.290000
2008-09-15T15:57:29.183000
64,003
64,097
How do I use PHP to get the current year?
I want to put a copyright notice in the footer of a web site, but I think it's incredibly tacky for the year to be outdated. How would I make the year update automatically with PHP
You can use either date or strftime. In this case I'd say it doesn't matter as a year is a year, no matter what (unless there's a locale that formats the year differently?) For example: On a side note, when formatting dates in PHP it matters when you want to format your date in a different locale than your default. If ...
How do I use PHP to get the current year? I want to put a copyright notice in the footer of a web site, but I think it's incredibly tacky for the year to be outdated. How would I make the year update automatically with PHP
TITLE: How do I use PHP to get the current year? QUESTION: I want to put a copyright notice in the footer of a web site, but I think it's incredibly tacky for the year to be outdated. How would I make the year update automatically with PHP ANSWER: You can use either date or strftime. In this case I'd say it doesn't m...
[ "php", "date" ]
1,136
1,429
1,508,468
18
0
2008-09-15T15:34:54.977000
2008-09-15T15:45:50.990000
64,010
66,984
How does one record audio from a Javascript based webapp?
I'm trying to write a web-app that records WAV files (eg: from the user's microphone). I know Javascript alone can not do this, but I'm interested in the least proprietary method to augment my Javascript with. My targeted browsers are Firefox for PC and Mac (so no ActiveX). I gather it can be done with Flash (but not a...
Flash requires you to use a media server (note: I'm still using Flash MX, but a quick Google search brings up documentation for Flash CS3 that seems to concur - note that Flash CS4 is out soon, might change then). Macromedia / Adobe aim to flog you their media server, but the Red5 open-source project might be suitible ...
How does one record audio from a Javascript based webapp? I'm trying to write a web-app that records WAV files (eg: from the user's microphone). I know Javascript alone can not do this, but I'm interested in the least proprietary method to augment my Javascript with. My targeted browsers are Firefox for PC and Mac (so ...
TITLE: How does one record audio from a Javascript based webapp? QUESTION: I'm trying to write a web-app that records WAV files (eg: from the user's microphone). I know Javascript alone can not do this, but I'm interested in the least proprietary method to augment my Javascript with. My targeted browsers are Firefox f...
[ "javascript", "audio", "web-applications" ]
5
4
16,865
7
0
2008-09-15T15:35:51.917000
2008-09-15T21:08:39.433000
64,014
64,138
How-To Auto Discover a WCF Service?
Is there a way to auto discover a specific WCF service in the network? I don't want to config my client with the address if this is possible.
What you want to look at is the WS-Discovery protocol. I found a sample on netfx3's website of using the specification. I would recommend searching services based on scope, by probing for services based on a specific endpoint.
How-To Auto Discover a WCF Service? Is there a way to auto discover a specific WCF service in the network? I don't want to config my client with the address if this is possible.
TITLE: How-To Auto Discover a WCF Service? QUESTION: Is there a way to auto discover a specific WCF service in the network? I don't want to config my client with the address if this is possible. ANSWER: What you want to look at is the WS-Discovery protocol. I found a sample on netfx3's website of using the specificat...
[ "wcf", ".net-3.5" ]
8
2
5,349
2
0
2008-09-15T15:36:26.690000
2008-09-15T15:50:37.530000
64,032
65,541
Can I write a plug in for Microsoft SQL Enterprise Manager which changes the query window background
Can I write a plug in for Microsoft SQL Enterprise Manager which changes the query window background if the query window points to a production database?
No, Enterprise Manager doesn't have a plug-in framework for you to hook in to.
Can I write a plug in for Microsoft SQL Enterprise Manager which changes the query window background Can I write a plug in for Microsoft SQL Enterprise Manager which changes the query window background if the query window points to a production database?
TITLE: Can I write a plug in for Microsoft SQL Enterprise Manager which changes the query window background QUESTION: Can I write a plug in for Microsoft SQL Enterprise Manager which changes the query window background if the query window points to a production database? ANSWER: No, Enterprise Manager doesn't have a ...
[ "sql-server" ]
7
1
125
2
0
2008-09-15T15:38:45.030000
2008-09-15T18:42:30.330000
64,036
64,066
How do you make a deep copy of an object?
It's a bit difficult to implement a deep object copy function. What steps you take to ensure the original object and the cloned one share no reference?
A safe way is to serialize the object, then deserialize. This ensures everything is a brand new reference. Here's an article about how to do this efficiently. Caveats: It's possible for classes to override serialization such that new instances are not created, e.g. for singletons. Also this of course doesn't work if yo...
How do you make a deep copy of an object? It's a bit difficult to implement a deep object copy function. What steps you take to ensure the original object and the cloned one share no reference?
TITLE: How do you make a deep copy of an object? QUESTION: It's a bit difficult to implement a deep object copy function. What steps you take to ensure the original object and the cloned one share no reference? ANSWER: A safe way is to serialize the object, then deserialize. This ensures everything is a brand new ref...
[ "java", "class", "clone" ]
365
191
456,546
23
0
2008-09-15T15:39:04.313000
2008-09-15T15:42:23.633000
64,038
64,064
Setting java locale settings
When I use the default java locale on my linux machine it comes out with the US locale settings, where do I change this so that it comes out with the correct locale?
I believe java gleans this from the environment variables in which it was launched, so you'll need to make sure your LANG and LC_* environment variables are set appropriately. The locale manpage has full info on said environment variables.
Setting java locale settings When I use the default java locale on my linux machine it comes out with the US locale settings, where do I change this so that it comes out with the correct locale?
TITLE: Setting java locale settings QUESTION: When I use the default java locale on my linux machine it comes out with the US locale settings, where do I change this so that it comes out with the correct locale? ANSWER: I believe java gleans this from the environment variables in which it was launched, so you'll need...
[ "java", "locale" ]
40
15
176,957
10
0
2008-09-15T15:39:06.480000
2008-09-15T15:42:17.753000
64,041
64,167
WinForms DataGridView font size
How do I change font size on the DataGridView?
private void UpdateFont() { //Change cell font foreach(DataGridViewColumn c in dgAssets.Columns) { c.DefaultCellStyle.Font = new Font("Arial", 8.5F, GraphicsUnit.Pixel); } }
WinForms DataGridView font size How do I change font size on the DataGridView?
TITLE: WinForms DataGridView font size QUESTION: How do I change font size on the DataGridView? ANSWER: private void UpdateFont() { //Change cell font foreach(DataGridViewColumn c in dgAssets.Columns) { c.DefaultCellStyle.Font = new Font("Arial", 8.5F, GraphicsUnit.Pixel); } }
[ "c#", "winforms", "datagridview" ]
51
56
172,148
11
0
2008-09-15T15:39:46.027000
2008-09-15T15:55:33.820000
64,051
64,129
Backporting a VB.Net 2008 app to target .Net 1.1
I have a small diagnostic VB.Net application ( 2 forms, 20 subs & functions) written using VB.Net 2008 that targets Framework 2.0 and higher, but now I realize I need to support Framework 1.1. I'm looking for the most efficient way to accomplish this given these constraints: I don't know which parts of the application ...
Your app sounds small enough that I would create a fresh project/solution in a separate folder for the 1.1 framework, copy over the necessary files, use the "Add Existing Item" option, and then build. All the problems will bubble up to the surface that way. A rather "ugly" approach, but it'll show you everything you ne...
Backporting a VB.Net 2008 app to target .Net 1.1 I have a small diagnostic VB.Net application ( 2 forms, 20 subs & functions) written using VB.Net 2008 that targets Framework 2.0 and higher, but now I realize I need to support Framework 1.1. I'm looking for the most efficient way to accomplish this given these constrai...
TITLE: Backporting a VB.Net 2008 app to target .Net 1.1 QUESTION: I have a small diagnostic VB.Net application ( 2 forms, 20 subs & functions) written using VB.Net 2008 that targets Framework 2.0 and higher, but now I realize I need to support Framework 1.1. I'm looking for the most efficient way to accomplish this gi...
[ "vb.net", ".net-1.1", "downgrade" ]
1
3
356
3
0
2008-09-15T15:41:22.090000
2008-09-15T15:49:39.140000
64,059
88,467
Is there a way to keep a page from rendering once a person has logged out but hit the "back" button?
I have some website which requires a logon and shows sensitive information. The person goes to the page, is prompted to log in, then gets to see the information. The person logs out of the site, and is redirected back to the login page. The person then can hit "back" and go right back to the page where the sensitive in...
The short answer is that it cannot be done securely. There are, however, a lot of tricks that can be implemented to make it difficult for users to hit back and get sensitive data displayed. Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetExpires(Now.AddSeconds(-1)); Response.Cache.SetNoStore...
Is there a way to keep a page from rendering once a person has logged out but hit the "back" button? I have some website which requires a logon and shows sensitive information. The person goes to the page, is prompted to log in, then gets to see the information. The person logs out of the site, and is redirected back t...
TITLE: Is there a way to keep a page from rendering once a person has logged out but hit the "back" button? QUESTION: I have some website which requires a logon and shows sensitive information. The person goes to the page, is prompted to log in, then gets to see the information. The person logs out of the site, and is...
[ "asp.net", "security", "browser", "caching", "back-button" ]
23
13
4,831
16
0
2008-09-15T15:41:42.620000
2008-09-17T22:48:08.180000
64,092
317,877
Autoproxy configuration script parsing in .Net/C#
In order for my application (.Net 1.1) to use the system configured proxy server (trough a proxy.pac script) I was using an interop calls to WinHTTP function WinHttpGetProxyForUrl, passing the proxy.pac url I got from the registry. Unfortunately, I hit a deployment scenario, where this does not work, as the proxy.pac f...
Just a thought: Why not create a micro web server that can serve the local PAC file over a localhost socket. You should use a random URI for the content so that it is difficult to browse this in unexpected ways. You could then pass a URL like http://localhost:1234/gfdjklskjgfsdjgklsdfklgfsjkl to the WinHttpGetProxyForU...
Autoproxy configuration script parsing in .Net/C# In order for my application (.Net 1.1) to use the system configured proxy server (trough a proxy.pac script) I was using an interop calls to WinHTTP function WinHttpGetProxyForUrl, passing the proxy.pac url I got from the registry. Unfortunately, I hit a deployment scen...
TITLE: Autoproxy configuration script parsing in .Net/C# QUESTION: In order for my application (.Net 1.1) to use the system configured proxy server (trough a proxy.pac script) I was using an interop calls to WinHTTP function WinHttpGetProxyForUrl, passing the proxy.pac url I got from the registry. Unfortunately, I hit...
[ "c#", "jscript.net", "autoproxy" ]
1
3
2,461
4
0
2008-09-15T15:45:30.380000
2008-11-25T16:08:13.670000
64,139
64,175
UserControl Property of type Enum displays in designer as bool or not at all
I have a usercontrol that has several public properties. These properties automatically show up in the properties window of the VS2005 designer under the "Misc" category. Except two of the properties which are enumerations don't show up correctly. The first on uses the following enum: public enum VerticalControlAlign {...
For starters, the second enum, AutoSizeMode is declared in System.Windows.Forms. So that might cause the designer some issues. Secondly, you might find the following page on MSDN useful: http://msdn.microsoft.com/en-us/library/tk67c2t8.aspx
UserControl Property of type Enum displays in designer as bool or not at all I have a usercontrol that has several public properties. These properties automatically show up in the properties window of the VS2005 designer under the "Misc" category. Except two of the properties which are enumerations don't show up correc...
TITLE: UserControl Property of type Enum displays in designer as bool or not at all QUESTION: I have a usercontrol that has several public properties. These properties automatically show up in the properties window of the VS2005 designer under the "Misc" category. Except two of the properties which are enumerations do...
[ "c#", "visual-studio", "enums", "user-controls" ]
1
0
13,427
4
0
2008-09-15T15:50:45.923000
2008-09-15T15:56:04.990000
64,141
64,163
Classes in Python
In Python is there any way to make a class, then make a second version of that class with identical dat,a but which can be changed, then reverted to be the same as the data in the original class? So I would make a class with the numbers 1 to 5 as the data in it, then make a second class with the same names for sections...
A class is a template, it allows you to create a blueprint, you can then have multiple instances of a class each with different numbers, like so. class dog(object): def __init__(self, height, width, lenght): self.height = height self.width = width self.length = length def revert(self): self.height = 1 self.width = 2 s...
Classes in Python In Python is there any way to make a class, then make a second version of that class with identical dat,a but which can be changed, then reverted to be the same as the data in the original class? So I would make a class with the numbers 1 to 5 as the data in it, then make a second class with the same ...
TITLE: Classes in Python QUESTION: In Python is there any way to make a class, then make a second version of that class with identical dat,a but which can be changed, then reverted to be the same as the data in the original class? So I would make a class with the numbers 1 to 5 as the data in it, then make a second cl...
[ "python", "class" ]
1
5
1,539
6
0
2008-09-15T15:51:02.833000
2008-09-15T15:54:52.107000
64,148
64,647
How to upgrade database schema built with an ORM tool?
I'm looking for a general solution for upgrading database schema with ORM tools, like JPOX or Hibernate. How do you do it in your projects? The first solution that comes to my mind is to create my own mechanism for upgrading databases, with SQL scripts doing all the work. But in this case I'll have to remember about cr...
LiquiBase is an interesting open source library for handling database refactorings (upgrades). I have not used it, but will definitely give it a try on my next project where I need to upgrade a db schema.
How to upgrade database schema built with an ORM tool? I'm looking for a general solution for upgrading database schema with ORM tools, like JPOX or Hibernate. How do you do it in your projects? The first solution that comes to my mind is to create my own mechanism for upgrading databases, with SQL scripts doing all th...
TITLE: How to upgrade database schema built with an ORM tool? QUESTION: I'm looking for a general solution for upgrading database schema with ORM tools, like JPOX or Hibernate. How do you do it in your projects? The first solution that comes to my mind is to create my own mechanism for upgrading databases, with SQL sc...
[ "java", "database", "orm", "migration" ]
7
7
5,779
8
0
2008-09-15T15:52:31.457000
2008-09-15T16:53:08.423000
64,174
64,275
How to change Firefox icon?
Is there any way to change Firefox system icon (the one on the left top of the window)? Precision: I want to change the icon of a bundled version of Firefox with apache/php and my application. So manual operation on each computer is not a solution. I try Resource Hacker and it's the good solution. The add ons one is go...
Resource hacker does the job of swapping application icons in Windows (up to XP, not tested with Vista yet). Available at: http://www.angusj.com/resourcehacker/
How to change Firefox icon? Is there any way to change Firefox system icon (the one on the left top of the window)? Precision: I want to change the icon of a bundled version of Firefox with apache/php and my application. So manual operation on each computer is not a solution. I try Resource Hacker and it's the good sol...
TITLE: How to change Firefox icon? QUESTION: Is there any way to change Firefox system icon (the one on the left top of the window)? Precision: I want to change the icon of a bundled version of Firefox with apache/php and my application. So manual operation on each computer is not a solution. I try Resource Hacker and...
[ "firefox", "firefox-addon", "icons" ]
9
4
17,376
5
0
2008-09-15T15:56:00.747000
2008-09-15T16:08:06.333000
64,185
66,924
Nice Python wrapper for Yahoo's Geoplanet web service?
Has anybody created a nice wrapper around Yahoo's geo webservice "GeoPlanet" yet?
After a brief amount of Googling, I found nothing that looks like a wrapper for this API, but I'm not quite sure if a wrapper is what is necessary for GeoPlanet. According to Yahoo's documentation for GeoPlanet, requests are made in the form of an HTTP GET messages which can very easily be made using Python's httplib m...
Nice Python wrapper for Yahoo's Geoplanet web service? Has anybody created a nice wrapper around Yahoo's geo webservice "GeoPlanet" yet?
TITLE: Nice Python wrapper for Yahoo's Geoplanet web service? QUESTION: Has anybody created a nice wrapper around Yahoo's geo webservice "GeoPlanet" yet? ANSWER: After a brief amount of Googling, I found nothing that looks like a wrapper for this API, but I'm not quite sure if a wrapper is what is necessary for GeoPl...
[ "python", "gis", "yahoo" ]
2
2
604
1
0
2008-09-15T15:57:48.450000
2008-09-15T21:01:02.807000
64,193
64,317
Ajax Control Toolkit Calendar Control CSS
I am using the AJAX Control Toolkit Popup Calendar Control in a datagrid. When it is in the footer it looks fine. When it is in the edit side of the datagrid it is inheriting the style from the datagrid and looks completely different (i.e. too big). Is there a way to alter the CSS so that it does not inherit the style ...
Open the page in firefox. However, first, download the firebug extension. Then, right click on the offending version and go down to inspect element. Firebug is awesome because it let's you navigate the css of any element. You have two options here: 1) Assign the topmost element an css class and work it that way. or If ...
Ajax Control Toolkit Calendar Control CSS I am using the AJAX Control Toolkit Popup Calendar Control in a datagrid. When it is in the footer it looks fine. When it is in the edit side of the datagrid it is inheriting the style from the datagrid and looks completely different (i.e. too big). Is there a way to alter the ...
TITLE: Ajax Control Toolkit Calendar Control CSS QUESTION: I am using the AJAX Control Toolkit Popup Calendar Control in a datagrid. When it is in the footer it looks fine. When it is in the edit side of the datagrid it is inheriting the style from the datagrid and looks completely different (i.e. too big). Is there a...
[ "css" ]
0
1
3,742
3
0
2008-09-15T15:58:52.347000
2008-09-15T16:13:52.700000
64,197
65,118
Make Test.QuickCheck.Batch use a default type for testing list functions
I am testing a function called extractions that operates over any list. extractions:: [a] -> [(a,[a])] extractions [] = [] extractions l = extract l [] where extract [] _ = [] extract (x:xs) prev = (x, prev++xs): extract xs (x: prev) I want to test it, for example, with import Test.QuickCheck.Batch prop_len l = length ...
The quickcheck manual says "no": Properties must have monomorphic types. `Polymorphic' properties, such as the one above, must be restricted to a particular type to be used for testing. It is convenient to do so by stating the types of one or more arguments in a where types = (x1:: t1, x2:: t2,...) clause...
Make Test.QuickCheck.Batch use a default type for testing list functions I am testing a function called extractions that operates over any list. extractions:: [a] -> [(a,[a])] extractions [] = [] extractions l = extract l [] where extract [] _ = [] extract (x:xs) prev = (x, prev++xs): extract xs (x: prev) I want to tes...
TITLE: Make Test.QuickCheck.Batch use a default type for testing list functions QUESTION: I am testing a function called extractions that operates over any list. extractions:: [a] -> [(a,[a])] extractions [] = [] extractions l = extract l [] where extract [] _ = [] extract (x:xs) prev = (x, prev++xs): extract xs (x: p...
[ "testing", "haskell", "type-inference", "quickcheck" ]
6
7
377
1
0
2008-09-15T15:59:53.153000
2008-09-15T17:53:03.523000
64,202
82,092
How to add a constant column when replicating a database?
I am using SQL Server 2000 and I have two databases that both replicate (transactional push subscription) to a single database. I need to know which database the records came from. So I want to add a fixed column specified in the publication to my table so I can tell which database the row originated from. How do I go ...
So the solution for me was to set up the replication publications to allow transformations and create a DTS package for each site that appends the siteid into the tables to keep the ids unique as I can't use guids.
How to add a constant column when replicating a database? I am using SQL Server 2000 and I have two databases that both replicate (transactional push subscription) to a single database. I need to know which database the records came from. So I want to add a fixed column specified in the publication to my table so I can...
TITLE: How to add a constant column when replicating a database? QUESTION: I am using SQL Server 2000 and I have two databases that both replicate (transactional push subscription) to a single database. I need to know which database the records came from. So I want to add a fixed column specified in the publication to...
[ "sql-server", "replication" ]
1
0
666
3
0
2008-09-15T16:00:00.503000
2008-09-17T11:14:25.320000
64,204
64,228
Can I filter the messages I receive from a message queue (MSMQ) by some property? (a.k.a. topic)
I am creating a Windows Service in C# that processes messages from a queue. I want to give ops the flexibility of partitioning the service in production according to properties of the message. For example, they should be able to say that one instance processes web orders from Customer A, another batch orders from Custo...
No, but you can PEEK into the queue and decide if you really want to consume the message.
Can I filter the messages I receive from a message queue (MSMQ) by some property? (a.k.a. topic) I am creating a Windows Service in C# that processes messages from a queue. I want to give ops the flexibility of partitioning the service in production according to properties of the message. For example, they should be ab...
TITLE: Can I filter the messages I receive from a message queue (MSMQ) by some property? (a.k.a. topic) QUESTION: I am creating a Windows Service in C# that processes messages from a queue. I want to give ops the flexibility of partitioning the service in production according to properties of the message. For example,...
[ "msmq" ]
5
5
3,931
2
0
2008-09-15T16:00:21.330000
2008-09-15T16:02:41.853000
64,208
72,028
How to force nolock hint for sql server logins
Does anyone know of a way to force a nolock hint on all transactions issued by a certain user? I'd like to provide a login for a support team to query the production system, but I want to protect it by forcing a nolock on everything they do. I'm using SQL Server 2005.
This is a painful and hacky way to do it, but it's what we're doing where I work. We're also using classic asp so we're using inline sql calls. we actually wrap the sql call in a function (here you can check for a specific user) and add "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED" to the beginning of the call. I ...
How to force nolock hint for sql server logins Does anyone know of a way to force a nolock hint on all transactions issued by a certain user? I'd like to provide a login for a support team to query the production system, but I want to protect it by forcing a nolock on everything they do. I'm using SQL Server 2005.
TITLE: How to force nolock hint for sql server logins QUESTION: Does anyone know of a way to force a nolock hint on all transactions issued by a certain user? I'd like to provide a login for a support team to query the production system, but I want to protect it by forcing a nolock on everything they do. I'm using SQL...
[ "sql", "sql-server", "security", "sql-server-2005", "query-optimization" ]
8
8
10,178
6
0
2008-09-15T16:00:46.913000
2008-09-16T13:12:39.100000
64,209
64,446
Detect changes in random ordered input (hash function?)
I'm reading lines of text that can come in any order. The problem is that the output can actually be indentical to the previous output. How can I detect this, without sorting the output first? Is there some kind of hash function that can take identical input, but in any order, and still produce the same result?
The easiest way would seem to be to hash each line on the way in, storing the hash and the original data, and then compare each new hash with your collection of existing hashes. If you get a positive, you could compare the actual data, to make sure it's not a false positive - though this would be extremely rare, you co...
Detect changes in random ordered input (hash function?) I'm reading lines of text that can come in any order. The problem is that the output can actually be indentical to the previous output. How can I detect this, without sorting the output first? Is there some kind of hash function that can take identical input, but ...
TITLE: Detect changes in random ordered input (hash function?) QUESTION: I'm reading lines of text that can come in any order. The problem is that the output can actually be indentical to the previous output. How can I detect this, without sorting the output first? Is there some kind of hash function that can take ide...
[ "java", "multithreading", "hash" ]
0
3
674
7
0
2008-09-15T16:01:02.357000
2008-09-15T16:30:08.260000
64,214
67,077
Should rails models be concerned with other models for the sake of skinny controllers?
I read everywhere that business logic belongs in the models and not in controller but where is the limit? I am toying with a personnal accounting application. Account Entry Operation When creating an operation it is only valid if the corresponding entries are created and linked to accounts so that the operation is bala...
but then the model will create and store instances of other models which is where my problem is. What is wrong with this? If your 'business logic' states that an Operation must have a valid set of Entries, then surely there is nothing wrong for the Operation class to know about, and deal with your Entry objects. You'll...
Should rails models be concerned with other models for the sake of skinny controllers? I read everywhere that business logic belongs in the models and not in controller but where is the limit? I am toying with a personnal accounting application. Account Entry Operation When creating an operation it is only valid if the...
TITLE: Should rails models be concerned with other models for the sake of skinny controllers? QUESTION: I read everywhere that business logic belongs in the models and not in controller but where is the limit? I am toying with a personnal accounting application. Account Entry Operation When creating an operation it is...
[ "ruby-on-rails", "ruby" ]
6
6
899
5
0
2008-09-15T16:01:15.490000
2008-09-15T21:19:57.783000
64,233
66,501
Fatal warnings on Windows
While working between a Windows MySQL server and a Debian MySQL server, I noticed that warnings were fatal on Windows, but silently ignored on Debian. I'd like to make the warnings fatal on both servers while I'm doing development, but I wasn't able to find a setting that effected this behavior. Anyone have any ideas?
I think what you're looking for is the sql_mode parameter in my.conf. STRICT_ALL_TABLES is the value. I guess it depends what you mean by "fatal". http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html
Fatal warnings on Windows While working between a Windows MySQL server and a Debian MySQL server, I noticed that warnings were fatal on Windows, but silently ignored on Debian. I'd like to make the warnings fatal on both servers while I'm doing development, but I wasn't able to find a setting that effected this behavio...
TITLE: Fatal warnings on Windows QUESTION: While working between a Windows MySQL server and a Debian MySQL server, I noticed that warnings were fatal on Windows, but silently ignored on Debian. I'd like to make the warnings fatal on both servers while I'm doing development, but I wasn't able to find a setting that eff...
[ "mysql" ]
3
3
129
2
0
2008-09-15T16:03:08.933000
2008-09-15T20:16:21.963000
64,238
64,519
Castle Windsor: How do you add a call to a factory facility not in xml?
I know how to tell Castle Windsor to resolve a reference from a factory's method using XML, but can I do it programmatically via the Container.AddComponent() interface? If not is there any other way to do it from code? EDIT: There seems to be some confusion so let me clarify, I am looking for a way to do the following ...
Directly from the Unit Test FactorySupportTestCase (which are your friends): [Test] public void FactorySupport_UsingProxiedFactory_WorksFine() { container.AddFacility("factories", new FactorySupportFacility()); container.AddComponent("standard.interceptor", typeof(StandardInterceptor)); container.AddComponent("factory"...
Castle Windsor: How do you add a call to a factory facility not in xml? I know how to tell Castle Windsor to resolve a reference from a factory's method using XML, but can I do it programmatically via the Container.AddComponent() interface? If not is there any other way to do it from code? EDIT: There seems to be some ...
TITLE: Castle Windsor: How do you add a call to a factory facility not in xml? QUESTION: I know how to tell Castle Windsor to resolve a reference from a factory's method using XML, but can I do it programmatically via the Container.AddComponent() interface? If not is there any other way to do it from code? EDIT: There...
[ ".net", "inversion-of-control", "castle-windsor" ]
2
3
2,408
1
0
2008-09-15T16:03:46.530000
2008-09-15T16:38:42.733000
64,258
64,301
Encrypt/Decrypt across machines is a no-no
I'm using an identical call to "CryptUnprotectData" (exposed from Crypt32.dll) between XP and Vista. Works fine in XP. I get the following exception when I run in Vista: "Decryption failed. Key not valid for use in specified state." As expected, the versions of crypt32.dll are different between XP and Vista (w/XP actua...
The CryptUnprotectData function documentation states that it usually only works when the user has the same logon credentials as the encrypter. This suggests to me that maybe the key is tied to the user's current token. Since you mention Vista, this makes me think UAC and restricted tokens. Can you show us some code? Ca...
Encrypt/Decrypt across machines is a no-no I'm using an identical call to "CryptUnprotectData" (exposed from Crypt32.dll) between XP and Vista. Works fine in XP. I get the following exception when I run in Vista: "Decryption failed. Key not valid for use in specified state." As expected, the versions of crypt32.dll are...
TITLE: Encrypt/Decrypt across machines is a no-no QUESTION: I'm using an identical call to "CryptUnprotectData" (exposed from Crypt32.dll) between XP and Vista. Works fine in XP. I get the following exception when I run in Vista: "Decryption failed. Key not valid for use in specified state." As expected, the versions ...
[ "encryption", "windows-vista", "cryptoapi" ]
4
4
2,722
2
0
2008-09-15T16:06:03.017000
2008-09-15T16:10:50.413000
64,272
64,507
How to eliminate flicker in Windows.Forms custom control when scrolling?
I want to create a custom control in C#. But every time I have to fully redraw my control, it flickers, even if I use double buffering (drawing to an Image first, and blitting that). How do I eliminate flicker when I have to fully redraw?
You could try putting the following in your constructor after the InitiliseComponent call. SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); EDIT: If you're giving this a go, if you can, remove your own double buffering code and just have the control dra...
How to eliminate flicker in Windows.Forms custom control when scrolling? I want to create a custom control in C#. But every time I have to fully redraw my control, it flickers, even if I use double buffering (drawing to an Image first, and blitting that). How do I eliminate flicker when I have to fully redraw?
TITLE: How to eliminate flicker in Windows.Forms custom control when scrolling? QUESTION: I want to create a custom control in C#. But every time I have to fully redraw my control, it flickers, even if I use double buffering (drawing to an Image first, and blitting that). How do I eliminate flicker when I have to full...
[ "c#", ".net", "winforms", "gdi+" ]
8
13
17,777
4
0
2008-09-15T16:07:51.933000
2008-09-15T16:36:43.003000
64,284
64,840
What's the best way to load highly re-used data in a .net web application
Let's say I have a list of categories for navigation on a web app. Rather than selecting from the database for every user, should I add a function call in the application_onStart of the global.asax to fetch that data into an array or collection that is re-used over and over. If my data does not change at all - (Edit - ...
You can store the list items in the Application object. You are right about the application_onStart(), simply call a method that will read your database and load the data to the Application object. In Global.asax public class Global: System.Web.HttpApplication { // The key to use in the rest of the web site to retrieve...
What's the best way to load highly re-used data in a .net web application Let's say I have a list of categories for navigation on a web app. Rather than selecting from the database for every user, should I add a function call in the application_onStart of the global.asax to fetch that data into an array or collection t...
TITLE: What's the best way to load highly re-used data in a .net web application QUESTION: Let's say I have a list of categories for navigation on a web app. Rather than selecting from the database for every user, should I add a function call in the application_onStart of the global.asax to fetch that data into an arr...
[ "asp.net", "caching", "global-asax", "application-start" ]
1
2
903
8
0
2008-09-15T16:09:15.503000
2008-09-15T17:17:08.010000
64,288
212,761
How can you cascade filter the attributes of more dimensions in a SSAS cube, viewed in Excel 2007
How can you cascade filter the attributes of more dimensions in a SSAS cube, viewed in Excel 2007. For example, if we have a cube Sales with the dimension Time and dimension Client, once the dimension Time is filtered to show only the sales from a particular date, if "Client.ClientName" is chosen as a filter in the fil...
Take a look at www.clicksoft.ro The product named QuickCubeFiltrator is a wizard like addin for excel 2007 that does cascade filtering. Might be what you need.
How can you cascade filter the attributes of more dimensions in a SSAS cube, viewed in Excel 2007 How can you cascade filter the attributes of more dimensions in a SSAS cube, viewed in Excel 2007. For example, if we have a cube Sales with the dimension Time and dimension Client, once the dimension Time is filtered to s...
TITLE: How can you cascade filter the attributes of more dimensions in a SSAS cube, viewed in Excel 2007 QUESTION: How can you cascade filter the attributes of more dimensions in a SSAS cube, viewed in Excel 2007. For example, if we have a cube Sales with the dimension Time and dimension Client, once the dimension Tim...
[ "sql-server", "excel", "ssas", "cube", "cascade-filtering" ]
2
1
1,570
2
0
2008-09-15T16:09:37.280000
2008-10-17T16:00:09.400000
64,291
1,266,970
API for server-side 3D rendering
I'm working on an application that needs to quickly render simple 3D scenes on the server, and then return them as a JPEG via HTTP. Basically, I want to be able to simply include a dynamic 3D scene in an HTML page, by doing something like: My question is about what technologies to use to do the rendering. In a desktop ...
RealityServer by mental images is designed to do precisely what is described here. More details are available on the product page (including a downloadable Developer Edition). RealityServer docs
API for server-side 3D rendering I'm working on an application that needs to quickly render simple 3D scenes on the server, and then return them as a JPEG via HTTP. Basically, I want to be able to simply include a dynamic 3D scene in an HTML page, by doing something like: My question is about what technologies to use t...
TITLE: API for server-side 3D rendering QUESTION: I'm working on an application that needs to quickly render simple 3D scenes on the server, and then return them as a JPEG via HTTP. Basically, I want to be able to simply include a dynamic 3D scene in an HTML page, by doing something like: My question is about what tec...
[ "api", "3d", "render", "server-side" ]
11
7
13,055
8
0
2008-09-15T16:09:51.947000
2009-08-12T15:36:22.173000
64,303
64,442
Convert WAV to WMA using .NET
What is the best solution for converting WAV files to WMA (and vice versa) in C#? I have actually implemented this once already using the Windows Media Encoder SDK, but having to distribute Windows Media Encoder with my application is cumbersome to say the least. The Windows Media Format SDK has large sections of the A...
I haven't tried it personally (so not sure if it's the 'best' solution), but http://www.codeproject.com/KB/audio-video/WmaCompressor.aspx looks like it should meet your requirements...
Convert WAV to WMA using .NET What is the best solution for converting WAV files to WMA (and vice versa) in C#? I have actually implemented this once already using the Windows Media Encoder SDK, but having to distribute Windows Media Encoder with my application is cumbersome to say the least. The Windows Media Format S...
TITLE: Convert WAV to WMA using .NET QUESTION: What is the best solution for converting WAV files to WMA (and vice versa) in C#? I have actually implemented this once already using the Windows Media Encoder SDK, but having to distribute Windows Media Encoder with my application is cumbersome to say the least. The Wind...
[ ".net", "audio", "wma" ]
7
1
7,364
5
0
2008-09-15T16:11:20.413000
2008-09-15T16:29:35.207000
64,311
64,635
How do you vertically center a custom image in a <li> element across browsers?
The design for the website I am working on calls for a custom image on lists instead of a bullet. Using the image is fine, but I have been having difficulties ensuring that it is centered against the text of the list item across all browsers. Does anyone know of a standard solution for this?
If you are referring to using a custom image bullet for your list this is the code you'll want to use, it will be vertically centered. I'm assuming here that the bullet image is 12px by 12px. ul li { background: transparent url(/link/to/custom/bullet.gif) no-repeat 0 50%; padding-left: 18px; } The only problem with thi...
How do you vertically center a custom image in a <li> element across browsers? The design for the website I am working on calls for a custom image on lists instead of a bullet. Using the image is fine, but I have been having difficulties ensuring that it is centered against the text of the list item across all browsers...
TITLE: How do you vertically center a custom image in a <li> element across browsers? QUESTION: The design for the website I am working on calls for a custom image on lists instead of a bullet. Using the image is fine, but I have been having difficulties ensuring that it is centered against the text of the list item a...
[ "css" ]
5
9
9,788
3
0
2008-09-15T16:13:15.680000
2008-09-15T16:51:41.843000
64,314
64,334
Copying databases to remote locations
Our EPOS system copies data by compressing the database into a zip file, and manually copying to each till, using shared directories. Each branched is liked to the main location, using VPN which can be problematic, but is required for the file sharing to work correctly. Since our database system currently does not supp...
Replication is the "right" way to go, so if migrating to another database is an option (is it really?), that's the best route. You might consider a utility that queries all the tables for raw data (in CSV?), sending that to files. Then at least you don't have to take the database down to do the backup.
Copying databases to remote locations Our EPOS system copies data by compressing the database into a zip file, and manually copying to each till, using shared directories. Each branched is liked to the main location, using VPN which can be problematic, but is required for the file sharing to work correctly. Since our d...
TITLE: Copying databases to remote locations QUESTION: Our EPOS system copies data by compressing the database into a zip file, and manually copying to each till, using shared directories. Each branched is liked to the main location, using VPN which can be problematic, but is required for the file sharing to work corr...
[ "database", "vpn", "point-of-sale", "file-sharing" ]
2
1
170
1
0
2008-09-15T16:13:34.417000
2008-09-15T16:16:15.470000
64,321
64,411
Refactoring dissassembled code
You write a function and, looking at the resulting assembly, you see it can be improved. You would like to keep the function you wrote, for readability, but you would like to substitute your own assembly for the compiler's. Is there any way to establish a relationship between your high-livel language function and the n...
If you are looking at the assembly, then its fair to assume that you have a good understanding about how code gets compiled down. If you have this knowledge, then its sometimes possible to 'reverse enginer' the changes back up into the original language but its often better not to bother. The optimisations that you mak...
Refactoring dissassembled code You write a function and, looking at the resulting assembly, you see it can be improved. You would like to keep the function you wrote, for readability, but you would like to substitute your own assembly for the compiler's. Is there any way to establish a relationship between your high-li...
TITLE: Refactoring dissassembled code QUESTION: You write a function and, looking at the resulting assembly, you see it can be improved. You would like to keep the function you wrote, for readability, but you would like to substitute your own assembly for the compiler's. Is there any way to establish a relationship be...
[ "optimization", "disassembly" ]
2
3
306
7
0
2008-09-15T16:14:18.097000
2008-09-15T16:26:18.083000
64,333
67,184
Disadvantages of Test Driven Development?
What do I lose by adopting test driven design? List only negatives; do not list benefits written in a negative form.
Several downsides (and I'm not claiming there are no benefits - especially when writing the foundation of a project - it'd save a lot of time at the end): Big time investment. For the simple case you lose about 20% of the actual implementation, but for complicated cases you lose much more. Additional Complexity. For co...
Disadvantages of Test Driven Development? What do I lose by adopting test driven design? List only negatives; do not list benefits written in a negative form.
TITLE: Disadvantages of Test Driven Development? QUESTION: What do I lose by adopting test driven design? List only negatives; do not list benefits written in a negative form. ANSWER: Several downsides (and I'm not claiming there are no benefits - especially when writing the foundation of a project - it'd save a lot ...
[ "unit-testing", "testing", "tdd" ]
201
137
87,401
31
0
2008-09-15T16:15:50.993000
2008-09-15T21:29:47.497000
64,351
64,515
using load() to load page that also uses jQuery
I'm trying to load a page that is basically an edit form inside a dialog (ui.dialog). I can load this page fine from an external (I'm using asp.net) page. The problem is that inside of my "popup" form, I need to $(function() {my function here}); syntax to do some stuff when the page loads, along with registering some.f...
If you really need to load that form via AJAX you could to do all the Javascript stuff in $.ajax callback itself. So, you load the popup form like this: $.ajax({ //... success: function(text) { // insert text into container // the code from $(function() {}); } });
using load() to load page that also uses jQuery I'm trying to load a page that is basically an edit form inside a dialog (ui.dialog). I can load this page fine from an external (I'm using asp.net) page. The problem is that inside of my "popup" form, I need to $(function() {my function here}); syntax to do some stuff wh...
TITLE: using load() to load page that also uses jQuery QUESTION: I'm trying to load a page that is basically an edit form inside a dialog (ui.dialog). I can load this page fine from an external (I'm using asp.net) page. The problem is that inside of my "popup" form, I need to $(function() {my function here}); syntax t...
[ "javascript", "jquery", "jquery-ui", "jquery-ui-dialog", "jquery-ui-plugins" ]
0
2
990
3
0
2008-09-15T16:18:02.050000
2008-09-15T16:38:27.913000
64,360
64,558
How to copy text from Emacs to another application on Linux
When I cut (kill) text in Emacs 22.1.1 (in its own window on X, in KDE, on Kubuntu), I can't paste (yank) it in any other application.
Insert the following into your.emacs file: (setq x-select-enable-clipboard t)
How to copy text from Emacs to another application on Linux When I cut (kill) text in Emacs 22.1.1 (in its own window on X, in KDE, on Kubuntu), I can't paste (yank) it in any other application.
TITLE: How to copy text from Emacs to another application on Linux QUESTION: When I cut (kill) text in Emacs 22.1.1 (in its own window on X, in KDE, on Kubuntu), I can't paste (yank) it in any other application. ANSWER: Insert the following into your.emacs file: (setq x-select-enable-clipboard t)
[ "emacs", "copy-paste" ]
127
109
78,297
13
0
2008-09-15T16:18:55.560000
2008-09-15T16:43:40.193000
64,364
73,590
Jabber Openfire server v3.6.0a+ - how do I use Hybrid authentication?
I'm setting up a Jabber server for my website. I've already got some user accounts in place in the openfire database, and working IMs between them. I'm now looking to add (some) of the users from my main database ( members table, with login, password [plain text]) and allowed_to_IM [0 or 1] fields) to allow them to com...
I have it using ldap and mysql and if it helps you my setting from openfire.xml are: org.jivesoftware.database.DefaultConnectionProvider com.mysql.jdbc.Driver jdbc:mysql://127.0.0.1:3306/openfire username pass 5 15 1.0 ldapsetting removed org.jivesoftware.openfire.auth.DefaultAuthProvider org.jivesoftware.openfire.ldap...
Jabber Openfire server v3.6.0a+ - how do I use Hybrid authentication? I'm setting up a Jabber server for my website. I've already got some user accounts in place in the openfire database, and working IMs between them. I'm now looking to add (some) of the users from my main database ( members table, with login, password...
TITLE: Jabber Openfire server v3.6.0a+ - how do I use Hybrid authentication? QUESTION: I'm setting up a Jabber server for my website. I've already got some user accounts in place in the openfire database, and working IMs between them. I'm now looking to add (some) of the users from my main database ( members table, wi...
[ "configuration", "xmpp", "openfire" ]
1
3
3,944
1
0
2008-09-15T16:19:14.637000
2008-09-16T15:29:26.213000
64,380
64,429
Using Apache mod_rewrite to remove sub-directories from URL
I'm managing an instance of Wordpress where the URLs are in the following format: http://www.example.com/example-category/blog-post-permalink/ The blog author did an inconsistent job of adding categories to posts, so while some of them had legitimate categories in their URLS, at least half are "uncategorised". I can ea...
Something as simple as: RewriteRule ^/[^/]+/([^/]+)/?$ /$2 [R] Perhaps would do it? That simple redirects /foo/bar/ to /bar.
Using Apache mod_rewrite to remove sub-directories from URL I'm managing an instance of Wordpress where the URLs are in the following format: http://www.example.com/example-category/blog-post-permalink/ The blog author did an inconsistent job of adding categories to posts, so while some of them had legitimate categorie...
TITLE: Using Apache mod_rewrite to remove sub-directories from URL QUESTION: I'm managing an instance of Wordpress where the URLs are in the following format: http://www.example.com/example-category/blog-post-permalink/ The blog author did an inconsistent job of adding categories to posts, so while some of them had le...
[ "apache", "wordpress", "mod-rewrite" ]
3
2
1,713
1
0
2008-09-15T16:22:00.467000
2008-09-15T16:27:59.437000
64,392
64,523
Game programming in Java?
I am looking into game programming in Java to see if it is feasible. When googling for it I find several old references to Java2D, Project Darkstar (Sun's MMO-server) and some books on Java game programming. But alot of the information seems to be several years old. So the question I am asking, is anyone creating any g...
there is the excellent open source 3d engine called jMonkey ( http://www.jmonkeyengine.com ) which is being used for a few commercial projects as well as hobby developers... there is also at a lower level the lwjgl library which jmonkeyengine is built on which is a set of apis to wrap opengl as well as provide other ga...
Game programming in Java? I am looking into game programming in Java to see if it is feasible. When googling for it I find several old references to Java2D, Project Darkstar (Sun's MMO-server) and some books on Java game programming. But alot of the information seems to be several years old. So the question I am asking...
TITLE: Game programming in Java? QUESTION: I am looking into game programming in Java to see if it is feasible. When googling for it I find several old references to Java2D, Project Darkstar (Sun's MMO-server) and some books on Java game programming. But alot of the information seems to be several years old. So the qu...
[ "java" ]
18
19
21,912
10
0
2008-09-15T16:23:52.100000
2008-09-15T16:39:34.650000
64,408
171,947
How do I get rid of "Cannot resolve property key" in fmt:message tags in JSPs in Intellij
This one has been bugging me for a while now. Is there a way I can stop Intellj IDEA from reporting missing keys in tags? My messages are not stored in property files so the issue does not apply in my case. I'm using IntelliJ IDEA 7.0.4
I reported this as an issue to JetBrains and according to their issue report this is fixed in "Diana 8858". AFICT that means this will be fixed in IDEA 8.0.
How do I get rid of "Cannot resolve property key" in fmt:message tags in JSPs in Intellij This one has been bugging me for a while now. Is there a way I can stop Intellj IDEA from reporting missing keys in tags? My messages are not stored in property files so the issue does not apply in my case. I'm using IntelliJ IDEA...
TITLE: How do I get rid of "Cannot resolve property key" in fmt:message tags in JSPs in Intellij QUESTION: This one has been bugging me for a while now. Is there a way I can stop Intellj IDEA from reporting missing keys in tags? My messages are not stored in property files so the issue does not apply in my case. I'm u...
[ "java", "jsp", "ide", "intellij-idea", "jstl" ]
0
1
3,167
2
0
2008-09-15T16:26:03.793000
2008-10-05T13:08:55.037000
64,420
64,763
How can I write an iPhone app entirely in JavaScript without making it just a web app?
I don't want to take the time to learn Obj-C. I've spent 7+ years doing web application programming. Shouldn't there be a way to use the WebView and just write the whole app in javascript, pulling the files right from the resources of the project?
I found the answer after searching around. Here's what I have done: Create a new project in XCode. I think I used the view-based app. Drag a WebView object onto your interface and resize. Inside of your WebViewController.m (or similarly named file, depending on the name of your view), in the viewDidLoad method: NSStrin...
How can I write an iPhone app entirely in JavaScript without making it just a web app? I don't want to take the time to learn Obj-C. I've spent 7+ years doing web application programming. Shouldn't there be a way to use the WebView and just write the whole app in javascript, pulling the files right from the resources o...
TITLE: How can I write an iPhone app entirely in JavaScript without making it just a web app? QUESTION: I don't want to take the time to learn Obj-C. I've spent 7+ years doing web application programming. Shouldn't there be a way to use the WebView and just write the whole app in javascript, pulling the files right fr...
[ "javascript", "ios", "objective-c" ]
85
72
37,465
10
0
2008-09-15T16:27:33.213000
2008-09-15T17:07:33.133000
64,434
64,926
Convert Parallels VM to Virtual PC 2007 VM
I'd like to convert a Parallels Virtual Machine image on my mac into an image usable by Virtual PC 2007. Does anyone know how to do that, or if it is possible?
It looks like qemu-img from qemu can do this, at least looking at its commandline help on a Ubuntu 8.04 machine where it claims support for, among others, the "parallels" and the "vpc" format. Have not tried myself, though. Hope this helps.
Convert Parallels VM to Virtual PC 2007 VM I'd like to convert a Parallels Virtual Machine image on my mac into an image usable by Virtual PC 2007. Does anyone know how to do that, or if it is possible?
TITLE: Convert Parallels VM to Virtual PC 2007 VM QUESTION: I'd like to convert a Parallels Virtual Machine image on my mac into an image usable by Virtual PC 2007. Does anyone know how to do that, or if it is possible? ANSWER: It looks like qemu-img from qemu can do this, at least looking at its commandline help on ...
[ "virtualization", "virtual-pc", "parallels" ]
2
1
1,461
2
0
2008-09-15T16:28:23.850000
2008-09-15T17:28:02.053000
64,436
70,526
Function Overloading and UDF in Excel VBA
I'm using Excel VBA to a write a UDF. I would like to overload my own UDF with a couple of different versions so that different arguments will call different functions. As VBA doesn't seem to support this, could anyone suggest a good, non-messy way of achieving the same goal? Should I be using Optional arguments or is ...
Declare your arguments as Optional Variants, then you can test to see if they're missing using IsMissing() or check their type using TypeName(), as shown in the following example: Public Function Foo(Optional v As Variant) As Variant If IsMissing(v) Then Foo = "Missing argument" ElseIf TypeName(v) = "String" Then Foo ...
Function Overloading and UDF in Excel VBA I'm using Excel VBA to a write a UDF. I would like to overload my own UDF with a couple of different versions so that different arguments will call different functions. As VBA doesn't seem to support this, could anyone suggest a good, non-messy way of achieving the same goal? S...
TITLE: Function Overloading and UDF in Excel VBA QUESTION: I'm using Excel VBA to a write a UDF. I would like to overload my own UDF with a couple of different versions so that different arguments will call different functions. As VBA doesn't seem to support this, could anyone suggest a good, non-messy way of achievin...
[ "excel", "user-defined-functions", "vba" ]
34
62
37,770
4
0
2008-09-15T16:28:28.373000
2008-09-16T08:59:22.750000
64,451
67,954
How do you convert a physical machine into a virtual machine image for use in MS Virtual Server or Hyper-V?
I'd like to use alternatives to System Center Virtual Machine Manager 2008 is possible, in other words, any FREE tools?
Before SCVMM, Microsoft's solution was the Virtual Server Migration Toolkit. This requires Windows Server 2003 Automated Deployment Services, which in turn can only be installed on Windows Server 2003 Enterprise Edition. It's about as far from a free tool as you can get. It only works on SP1, not SP2 (unless ADS has be...
How do you convert a physical machine into a virtual machine image for use in MS Virtual Server or Hyper-V? I'd like to use alternatives to System Center Virtual Machine Manager 2008 is possible, in other words, any FREE tools?
TITLE: How do you convert a physical machine into a virtual machine image for use in MS Virtual Server or Hyper-V? QUESTION: I'd like to use alternatives to System Center Virtual Machine Manager 2008 is possible, in other words, any FREE tools? ANSWER: Before SCVMM, Microsoft's solution was the Virtual Server Migrati...
[ "virtualization", "hyper-v" ]
4
2
7,624
4
0
2008-09-15T16:30:44.687000
2008-09-15T23:33:14.330000
64,454
64,535
What is the best way to make a .net client consume service from a Java server?
I have a user interface in.net which needs to receive data from a server, on a request/reply/update model. The only constraint is to use Java only on the server box. What is the best approach to achieve this? Is it by creating a Webservice in Java and then accessing it in.net, or should I create Java proxies and conver...
I recommend the web service route. It offers a standard interface that can be consumed by other client platforms in the future..NET clients interact with Java web services pretty well, though there are some gotchas. The best two technologies available for you for the.NET client are Microsoft Web Service Enhancements (W...
What is the best way to make a .net client consume service from a Java server? I have a user interface in.net which needs to receive data from a server, on a request/reply/update model. The only constraint is to use Java only on the server box. What is the best approach to achieve this? Is it by creating a Webservice i...
TITLE: What is the best way to make a .net client consume service from a Java server? QUESTION: I have a user interface in.net which needs to receive data from a server, on a request/reply/update model. The only constraint is to use Java only on the server box. What is the best approach to achieve this? Is it by creat...
[ "java", ".net", "interop" ]
2
1
491
3
0
2008-09-15T16:31:02.613000
2008-09-15T16:40:51.810000
64,469
64,521
VB.NET on Vista, trying to get date (Today) causes security exception
I have a VB6 program that someone recently helped me convert to VB.NET In the program, when saving files, I stamp them with the date which I was getting by calling the Today() function. When I try to run the new VB.NET code in Vista it throws a permission exception for the Today(). If I run Visual Studio Express (this ...
Use DateTime.Now or DateTime.Today. These are entirely managed and shouldn't throw security exceptions. The old VB6 functions, such as Len(), Left(), Right(), OpenFile(), FreeFile() are all present in the.NET Framework in the Microsoft.VisualBasic DLL. To maintain backwards compatibility, they all call the old function...
VB.NET on Vista, trying to get date (Today) causes security exception I have a VB6 program that someone recently helped me convert to VB.NET In the program, when saving files, I stamp them with the date which I was getting by calling the Today() function. When I try to run the new VB.NET code in Vista it throws a permi...
TITLE: VB.NET on Vista, trying to get date (Today) causes security exception QUESTION: I have a VB6 program that someone recently helped me convert to VB.NET In the program, when saving files, I stamp them with the date which I was getting by calling the Today() function. When I try to run the new VB.NET code in Vista...
[ "vb.net", "security", "date" ]
2
10
4,079
3
0
2008-09-15T16:32:52.310000
2008-09-15T16:39:00.487000
64,498
67,478
C++ method expansion
Can you specialize a template method within a template class without specializing the class template parameter? Please note that the specialization is on the value of the template parameter, not its type. This seems to compile under Visual Studio 2008 SP1 complier, but not GCC 4.2.4. #include using namespace std; templ...
Here is another workaround, also useful when you need to partialy specialize a function (which is not allowed). Create a template functor class (ie. class whose sole purpose is to execute a single member function, usually named operator() ), specialize it and then call from within your template function. I think I lear...
C++ method expansion Can you specialize a template method within a template class without specializing the class template parameter? Please note that the specialization is on the value of the template parameter, not its type. This seems to compile under Visual Studio 2008 SP1 complier, but not GCC 4.2.4. #include using...
TITLE: C++ method expansion QUESTION: Can you specialize a template method within a template class without specializing the class template parameter? Please note that the specialization is on the value of the template parameter, not its type. This seems to compile under Visual Studio 2008 SP1 complier, but not GCC 4.2...
[ "c++", "templates" ]
4
1
860
4
0
2008-09-15T16:35:36.907000
2008-09-15T22:03:09.117000
64,505
64,890
Sending mail from Python using SMTP
I'm using the following method to send mail from Python using SMTP. Is it the right method to use or are there gotchas I'm missing? from smtplib import SMTP import datetime debuglevel = 0 smtp = SMTP() smtp.set_debuglevel(debuglevel) smtp.connect('YOUR.MAIL.SERVER', 26) smtp.login('USERNAME@DOMAIN', 'PASSWORD') from...
The script I use is quite similar; I post it here as an example of how to use the email.* modules to generate MIME messages; so this script can be easily modified to attach pictures, etc. I rely on my ISP to add the date time header. My ISP requires me to use a secure smtp connection to send mail, I rely on the smtplib...
Sending mail from Python using SMTP I'm using the following method to send mail from Python using SMTP. Is it the right method to use or are there gotchas I'm missing? from smtplib import SMTP import datetime debuglevel = 0 smtp = SMTP() smtp.set_debuglevel(debuglevel) smtp.connect('YOUR.MAIL.SERVER', 26) smtp.login(...
TITLE: Sending mail from Python using SMTP QUESTION: I'm using the following method to send mail from Python using SMTP. Is it the right method to use or are there gotchas I'm missing? from smtplib import SMTP import datetime debuglevel = 0 smtp = SMTP() smtp.set_debuglevel(debuglevel) smtp.connect('YOUR.MAIL.SERVER...
[ "python", "smtp" ]
139
141
357,031
16
0
2008-09-15T16:36:35.547000
2008-09-15T17:24:40.253000
64,508
66,068
Guile scheme - quoted period?
What does the following Guile scheme code do? (eq? y '.) (cons x '.) The code is not valid in MzScheme, is there a portable equivalent across scheme implementations? I am trying to port this code written by someone else. Guile seems to respond to '. with #{.}#, but I'm not sure what it means or how to do this in anothe...
Okay, it seems that '. is valid syntax for (string->symbol ".") in Guile, whereas MzScheme at least requires |.| for the period as a symbol.
Guile scheme - quoted period? What does the following Guile scheme code do? (eq? y '.) (cons x '.) The code is not valid in MzScheme, is there a portable equivalent across scheme implementations? I am trying to port this code written by someone else. Guile seems to respond to '. with #{.}#, but I'm not sure what it mea...
TITLE: Guile scheme - quoted period? QUESTION: What does the following Guile scheme code do? (eq? y '.) (cons x '.) The code is not valid in MzScheme, is there a portable equivalent across scheme implementations? I am trying to port this code written by someone else. Guile seems to respond to '. with #{.}#, but I'm no...
[ "scheme", "guile" ]
4
3
558
3
0
2008-09-15T16:36:44.360000
2008-09-15T19:39:24.423000
64,570
64,608
Explode string into array with no empty elements?
PHP's explode function returns an array of strings split on some provided substring. It will return empty strings when there are leading, trailing, or consecutive delimiters, like this: var_dump(explode('/', '1/2//3/')); array(5) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(0) "" [3]=> string(1) "3" [4]=> str...
Try preg_split. $exploded = preg_split('@/@', '1/2//3/', -1, PREG_SPLIT_NO_EMPTY);
Explode string into array with no empty elements? PHP's explode function returns an array of strings split on some provided substring. It will return empty strings when there are leading, trailing, or consecutive delimiters, like this: var_dump(explode('/', '1/2//3/')); array(5) { [0]=> string(1) "1" [1]=> string(1) "2...
TITLE: Explode string into array with no empty elements? QUESTION: PHP's explode function returns an array of strings split on some provided substring. It will return empty strings when there are leading, trailing, or consecutive delimiters, like this: var_dump(explode('/', '1/2//3/')); array(5) { [0]=> string(1) "1" ...
[ "php", "arrays", "string", "filtering", "explode" ]
42
71
46,902
12
0
2008-09-15T16:45:06.417000
2008-09-15T16:48:28.110000
64,575
64,803
.NET Web Application Portability to SilverLight
The company where I work created this application which is core to our business and relies on the web browser to enforce certain "rules" that without them renders the application kinda useless to our customers. Sorry about having to be circumspect, An NDA along with a host of other things prevents me from saying exactl...
If the bulk of your application is on the back-end, you should still be able to keep the majority of the code intact and only replace the front-end. However, Silverlight requires an understanding of WPF, which is dramatically different than the HTML/JS that your app currently uses. I'd say if your UI is pretty thin, it...
.NET Web Application Portability to SilverLight The company where I work created this application which is core to our business and relies on the web browser to enforce certain "rules" that without them renders the application kinda useless to our customers. Sorry about having to be circumspect, An NDA along with a hos...
TITLE: .NET Web Application Portability to SilverLight QUESTION: The company where I work created this application which is core to our business and relies on the web browser to enforce certain "rules" that without them renders the application kinda useless to our customers. Sorry about having to be circumspect, An ND...
[ "asp.net", "silverlight" ]
1
1
2,487
3
0
2008-09-15T16:45:31.580000
2008-09-15T17:12:20.953000
64,582
64,622
C++/Java Performance for Neural Networks?
I was discussing neural networks (NN) with a friend over lunch the other day and he claimed the the performance of a NN written in Java would be similar to one written in C++. I know that with 'just in time' compiler techniques Java can do very well, but somehow I just don't buy it. Does anyone have any experience that...
The Hotspot JIT can now produce code faster than C++. The reason is run-time empirical optimization. For example, it can see that a certain loop takes the "false" branch 99% of the time and reorder the machine code instructions accordingly. There's lots of articles about this. If you want all the details, read Sun's ex...
C++/Java Performance for Neural Networks? I was discussing neural networks (NN) with a friend over lunch the other day and he claimed the the performance of a NN written in Java would be similar to one written in C++. I know that with 'just in time' compiler techniques Java can do very well, but somehow I just don't bu...
TITLE: C++/Java Performance for Neural Networks? QUESTION: I was discussing neural networks (NN) with a friend over lunch the other day and he claimed the the performance of a NN written in Java would be similar to one written in C++. I know that with 'just in time' compiler techniques Java can do very well, but someh...
[ "java", "c++", "performance", "neural-network" ]
6
11
2,331
7
0
2008-09-15T16:46:04.480000
2008-09-15T16:50:08.633000
64,599
64,628
.net: System.Web.Mail vs System.Net.Mail
I am considering converting a project that I've inherited from.net 1.1 to.net 2.0. The main warning I'm concerned about is that it wants me to switch from System.Web.Mail to using System.Net.Mail. I'm not ready to re-write all the components using the obsolete System.Web.Mail, so I'm curious to hear if any community me...
System.Web.Mail is not a full.NET native implementation of the SMTP protocol. Instead, it uses the pre-existing COM functionality in CDONTS. System.Net.Mail, in contrast, is a fully managed implementation of an SMTP client. I've had far fewer problems with System.Net.Mail as it avoids COM hell.
.net: System.Web.Mail vs System.Net.Mail I am considering converting a project that I've inherited from.net 1.1 to.net 2.0. The main warning I'm concerned about is that it wants me to switch from System.Web.Mail to using System.Net.Mail. I'm not ready to re-write all the components using the obsolete System.Web.Mail, s...
TITLE: .net: System.Web.Mail vs System.Net.Mail QUESTION: I am considering converting a project that I've inherited from.net 1.1 to.net 2.0. The main warning I'm concerned about is that it wants me to switch from System.Web.Mail to using System.Net.Mail. I'm not ready to re-write all the components using the obsolete ...
[ ".net", ".net-2.0" ]
76
111
33,278
7
0
2008-09-15T16:47:26.020000
2008-09-15T16:50:48.930000
64,602
65,062
What are differences between AssemblyVersion, AssemblyFileVersion and AssemblyInformationalVersion?
There are three assembly version attributes. What are differences? Is it ok if I use AssemblyVersion and ignore the rest? MSDN says: AssemblyVersion: Specifies the version of the assembly being attributed. AssemblyFileVersion: Instructs a compiler to use a specific version number for the Win32 file version resource. Th...
AssemblyVersion Where other assemblies that reference your assembly will look. If this number changes, other assemblies must update their references to your assembly! Only update this version if it breaks backward compatibility. The AssemblyVersion is required. I use the format: major.minor (and major for very stable c...
What are differences between AssemblyVersion, AssemblyFileVersion and AssemblyInformationalVersion? There are three assembly version attributes. What are differences? Is it ok if I use AssemblyVersion and ignore the rest? MSDN says: AssemblyVersion: Specifies the version of the assembly being attributed. AssemblyFileVe...
TITLE: What are differences between AssemblyVersion, AssemblyFileVersion and AssemblyInformationalVersion? QUESTION: There are three assembly version attributes. What are differences? Is it ok if I use AssemblyVersion and ignore the rest? MSDN says: AssemblyVersion: Specifies the version of the assembly being attribut...
[ ".net", "assemblies", "attributes" ]
946
984
226,995
7
0
2008-09-15T16:47:38.453000
2008-09-15T17:46:57.767000
64,605
64,638
Can I Mix VBScript and JScript in a Single HTA?
Is it possible to use both JScript and VBScript in the same HTA? Can I call VBScript functions from JScript and vice-versa? Are there any "gotchas," like the JScript running first and the VBScript running second (classic ASP pages have this issue).
Yeah, just separate them into different script tags: Edit: And, yeah, you can cross call between Javascript and VBScript with no extra work. Edit: This is also true of ANY Windows Scripting technology. It works in WSF files and can include scripts written in any supported ActiveScript language such as Perl as long as t...
Can I Mix VBScript and JScript in a Single HTA? Is it possible to use both JScript and VBScript in the same HTA? Can I call VBScript functions from JScript and vice-versa? Are there any "gotchas," like the JScript running first and the VBScript running second (classic ASP pages have this issue).
TITLE: Can I Mix VBScript and JScript in a Single HTA? QUESTION: Is it possible to use both JScript and VBScript in the same HTA? Can I call VBScript functions from JScript and vice-versa? Are there any "gotchas," like the JScript running first and the VBScript running second (classic ASP pages have this issue). ANSW...
[ "vbscript", "javascript", "hta" ]
2
12
7,992
3
0
2008-09-15T16:48:05.567000
2008-09-15T16:52:02.843000
64,631
67,714
What does a PHP developer need to know about https / secure socket layer connections?
I know next to nothing when it comes to the how and why of https connections. Obviously, when I'm transmitting secure data like passwords or especially credit card information, https is a critical tool. What do I need to know about it, though? What are the most common mistakes you see developers making when they implem...
An HTTPS, or Secure Sockets Layer (SSL) certificate is served for a site, and is typically signed by a Certificate Authority (CA), which is effectively a trusted 3rd party that verifies some basic details about your site, and certifies it for use in browsers. If your browser trusts the CA, then it trusts any certificat...
What does a PHP developer need to know about https / secure socket layer connections? I know next to nothing when it comes to the how and why of https connections. Obviously, when I'm transmitting secure data like passwords or especially credit card information, https is a critical tool. What do I need to know about it...
TITLE: What does a PHP developer need to know about https / secure socket layer connections? QUESTION: I know next to nothing when it comes to the how and why of https connections. Obviously, when I'm transmitting secure data like passwords or especially credit card information, https is a critical tool. What do I nee...
[ "php", "security", "ssl", "https" ]
10
23
5,541
7
0
2008-09-15T16:51:11.753000
2008-09-15T22:46:27.217000
64,639
64,662
Convert from scientific notation string to float in C#
What's the proper way to convert from a scientific notation string such as "1.234567E-06" to a floating point variable using C#?
Double.Parse("1.234567E-06", System.Globalization.NumberStyles.Float);
Convert from scientific notation string to float in C# What's the proper way to convert from a scientific notation string such as "1.234567E-06" to a floating point variable using C#?
TITLE: Convert from scientific notation string to float in C# QUESTION: What's the proper way to convert from a scientific notation string such as "1.234567E-06" to a floating point variable using C#? ANSWER: Double.Parse("1.234567E-06", System.Globalization.NumberStyles.Float);
[ "c#", "floating-point", "scientific-notation" ]
33
63
47,048
2
0
2008-09-15T16:52:06.087000
2008-09-15T16:55:10.230000
64,645
64,974
Define an interface in C++ that needs to be implemented in C# and C++
I have an interface that I have defined in C++ which now needs to be implemented in C#. What is the best way to go about this? I don't want to use COM at all in my interface definition. The way I have solved this right now is to to have two interface definitions, one in C++ and one in C#. I then expose the C# interface...
If you are willing to use C++/CLI for your managed code instead of C#, then you can just consume the native C++ interface definition directly via the header file. How easy this will be will depend on exactly what is in your interface - simplest case is something that you could use from C. Take a look at Marcus Heege's ...
Define an interface in C++ that needs to be implemented in C# and C++ I have an interface that I have defined in C++ which now needs to be implemented in C#. What is the best way to go about this? I don't want to use COM at all in my interface definition. The way I have solved this right now is to to have two interface...
TITLE: Define an interface in C++ that needs to be implemented in C# and C++ QUESTION: I have an interface that I have defined in C++ which now needs to be implemented in C#. What is the best way to go about this? I don't want to use COM at all in my interface definition. The way I have solved this right now is to to ...
[ "c#", ".net", "c++", "interop", "interface" ]
5
4
7,837
6
0
2008-09-15T16:52:59.283000
2008-09-15T17:33:46.673000
64,649
64,699
How do I get the find command to print out the file size with the file name?
If I issue the find command as follows: find. -name *.ear It prints out:./dir1/dir2/earFile1.ear./dir1/dir2/earFile2.ear./dir1/dir3/earFile1.ear I want to 'print' the name and the size to the command line:./dir1/dir2/earFile1.ear 5000 KB./dir1/dir2/earFile2.ear 5400 KB./dir1/dir3/earFile1.ear 5400 KB
find. -name '*.ear' -exec ls -lh "{}" \; just the h extra from jer.drab.org's reply. saves time converting to MB mentally;)
How do I get the find command to print out the file size with the file name? If I issue the find command as follows: find. -name *.ear It prints out:./dir1/dir2/earFile1.ear./dir1/dir2/earFile2.ear./dir1/dir3/earFile1.ear I want to 'print' the name and the size to the command line:./dir1/dir2/earFile1.ear 5000 KB./dir1...
TITLE: How do I get the find command to print out the file size with the file name? QUESTION: If I issue the find command as follows: find. -name *.ear It prints out:./dir1/dir2/earFile1.ear./dir1/dir2/earFile2.ear./dir1/dir3/earFile1.ear I want to 'print' the name and the size to the command line:./dir1/dir2/earFile1...
[ "unix", "command-line", "find", "solaris" ]
171
186
227,226
17
0
2008-09-15T16:53:13.353000
2008-09-15T16:59:16.973000
64,653
64,771
MySQL: "lock wait timeout exceeded"
I am trying to delete several rows from a MySQL 5.0.45 database: delete from bundle_inclusions; The client works for a while and then returns the error: Lock wait timeout exceeded; try restarting transaction It's possible there is some uncommitted transaction out there that has a lock on this table, but I need this pro...
I agree with Erik; TRUNCATE TABLE is the way to go. However, if you can't use that for some reason (for example, if you don't really want to delete every row in the table), you can try the following options: Delete the rows in smaller batches (e.g. DELETE FROM bundle_inclusions WHERE id BETWEEN? and?) If it's a MyISAM ...
MySQL: "lock wait timeout exceeded" I am trying to delete several rows from a MySQL 5.0.45 database: delete from bundle_inclusions; The client works for a while and then returns the error: Lock wait timeout exceeded; try restarting transaction It's possible there is some uncommitted transaction out there that has a loc...
TITLE: MySQL: "lock wait timeout exceeded" QUESTION: I am trying to delete several rows from a MySQL 5.0.45 database: delete from bundle_inclusions; The client works for a while and then returns the error: Lock wait timeout exceeded; try restarting transaction It's possible there is some uncommitted transaction out th...
[ "mysql", "database" ]
12
27
46,758
4
0
2008-09-15T16:53:54.787000
2008-09-15T17:08:29.213000
64,689
64,713
C pointers in C#
Is this function declaration in C#: void foo(string mystring) the same as this one in C: void foo(char *) i.e. In C#, does the called function receive a pointer behind the scenes?
In this specific instance, it is more like: void foo(const char *);.Net strings are immutable and passed by reference. However, in general C# receives a pointer or reference to an object behind the scenes.
C pointers in C# Is this function declaration in C#: void foo(string mystring) the same as this one in C: void foo(char *) i.e. In C#, does the called function receive a pointer behind the scenes?
TITLE: C pointers in C# QUESTION: Is this function declaration in C#: void foo(string mystring) the same as this one in C: void foo(char *) i.e. In C#, does the called function receive a pointer behind the scenes? ANSWER: In this specific instance, it is more like: void foo(const char *);.Net strings are immutable an...
[ "c#", "c", "string", "pointers", "language-implementation" ]
4
12
3,830
11
0
2008-09-15T16:58:25.980000
2008-09-15T17:01:19.497000
64,693
65,479
Simple haskell string manage
Theres is a little problem I want to solve with Haskell: let substitute a function that change all of the wildcards in a string for one concrete parameter. The function has de signature of: subs:: String -> String -> String -> String -- example: -- subs 'x' "x^3 + x + sin(x)" "6.2" will generate -- "6.2^3 + 6.2 + sin(6...
You could use the Text.Regex package. Your example might look something like this: import Text.Regex(mkRegex, subRegex) subs:: String -> String -> String -> String subs wildcard input value = subRegex (mkRegex wildcard) input value
Simple haskell string manage Theres is a little problem I want to solve with Haskell: let substitute a function that change all of the wildcards in a string for one concrete parameter. The function has de signature of: subs:: String -> String -> String -> String -- example: -- subs 'x' "x^3 + x + sin(x)" "6.2" will gen...
TITLE: Simple haskell string manage QUESTION: Theres is a little problem I want to solve with Haskell: let substitute a function that change all of the wildcards in a string for one concrete parameter. The function has de signature of: subs:: String -> String -> String -> String -- example: -- subs 'x' "x^3 + x + sin(...
[ "string", "haskell" ]
3
6
2,483
4
0
2008-09-15T16:58:45.527000
2008-09-15T18:35:34.870000
64,749
64,761
'^M' character at end of lines
When I run a particular SQL script in Unix environments, I see a '^M' character at the end of each line of the SQL script as it is echoed to the command line. I don't know on which OS the SQL script was initially created. What is causing this and how do I fix it?
It's caused by the DOS/Windows line-ending characters. Like Andy Whitfield said, the Unix command dos2unix will help fix the problem. If you want more information, you can read the man pages for that command.
'^M' character at end of lines When I run a particular SQL script in Unix environments, I see a '^M' character at the end of each line of the SQL script as it is echoed to the command line. I don't know on which OS the SQL script was initially created. What is causing this and how do I fix it?
TITLE: '^M' character at end of lines QUESTION: When I run a particular SQL script in Unix environments, I see a '^M' character at the end of each line of the SQL script as it is echoed to the command line. I don't know on which OS the SQL script was initially created. What is causing this and how do I fix it? ANSWER...
[ "sql", "unix", "newline", "carriage-return", "line-endings" ]
104
82
122,505
17
0
2008-09-15T17:05:24.790000
2008-09-15T17:07:05.553000
64,760
64,764
Should HTML co-exist with code?
In a web application, is it acceptable to use HTML in your code (non-scripted languages, Java,.NET)? There are two major sub questions: Should you use code to print HTML, or otherwise directly create HTML that is displayed? Should you mix code within your HTML pages?
Generally, it's better to keep presentation (HTML) separate from logic ("back-end" code). Your code is decoupled and easier to maintain this way.
Should HTML co-exist with code? In a web application, is it acceptable to use HTML in your code (non-scripted languages, Java,.NET)? There are two major sub questions: Should you use code to print HTML, or otherwise directly create HTML that is displayed? Should you mix code within your HTML pages?
TITLE: Should HTML co-exist with code? QUESTION: In a web application, is it acceptable to use HTML in your code (non-scripted languages, Java,.NET)? There are two major sub questions: Should you use code to print HTML, or otherwise directly create HTML that is displayed? Should you mix code within your HTML pages? A...
[ "html", "user-interface" ]
8
14
767
14
0
2008-09-15T17:06:50.857000
2008-09-15T17:07:38.780000
64,781
66,373
Batch insert using JPA/Toplink
I have a web application that receives messages through an HTTP interface, e.g.: http://server/application?source=123&destination=234&text=hello This request contains the ID of the sender, the ID of the recipient and the text of the message. This message should be processed like: finding the matching User object for bo...
You should decouple from the JPA interface and use the bare TopLink API. You can probably chuck the objects you're persisting into a UnitOfWork and commit the UnitOfWork on your schedule (sync or async). Note that one of the costs of em.persist() is the implicit clone that happens of the whole object graph. TopLink wil...
Batch insert using JPA/Toplink I have a web application that receives messages through an HTTP interface, e.g.: http://server/application?source=123&destination=234&text=hello This request contains the ID of the sender, the ID of the recipient and the text of the message. This message should be processed like: finding ...
TITLE: Batch insert using JPA/Toplink QUESTION: I have a web application that receives messages through an HTTP interface, e.g.: http://server/application?source=123&destination=234&text=hello This request contains the ID of the sender, the ID of the recipient and the text of the message. This message should be proces...
[ "java", "oracle", "jpa", "toplink" ]
2
3
6,812
2
0
2008-09-15T17:09:27.433000
2008-09-15T20:03:25.957000
64,790
67,957
Why aren't Xcode breakpoints functioning?
I have breakpoints set but Xcode appears to ignore them.
First of all, I agree 100% with the earlier folks that said turn OFF Load Symbols Lazily. I have two more things to add. (My first suggestion sounds obvious, but the first time someone suggested it to me, my reaction went along these lines: "come on, please, you really think I wouldn't know better...... oh.") Make sure...
Why aren't Xcode breakpoints functioning? I have breakpoints set but Xcode appears to ignore them.
TITLE: Why aren't Xcode breakpoints functioning? QUESTION: I have breakpoints set but Xcode appears to ignore them. ANSWER: First of all, I agree 100% with the earlier folks that said turn OFF Load Symbols Lazily. I have two more things to add. (My first suggestion sounds obvious, but the first time someone suggested...
[ "xcode", "breakpoints" ]
146
165
147,129
53
0
2008-09-15T17:10:26.700000
2008-09-15T23:34:46.150000
64,827
65,748
Rails, Restful Authentication & RSpec - How to test new models that require authentication
I've created a learning application using Bort, which is a base app that includes Restful Authentication and RSpec. I've got it up and running and added a new object that requires users to be logged in before they can do anything( before_filter:login_required in the controller). [edit: I should also mention that the us...
I have a very similar setup, and below is the code I'm currently using to test this stuff. In each of the describe s I put in: it_should_behave_like "login-required object" def attempt_access; do_post; end If all you need is a login, or it_should_behave_like "ownership-required object" def login_as_object_owner; login_...
Rails, Restful Authentication & RSpec - How to test new models that require authentication I've created a learning application using Bort, which is a base app that includes Restful Authentication and RSpec. I've got it up and running and added a new object that requires users to be logged in before they can do anything...
TITLE: Rails, Restful Authentication & RSpec - How to test new models that require authentication QUESTION: I've created a learning application using Bort, which is a base app that includes Restful Authentication and RSpec. I've got it up and running and added a new object that requires users to be logged in before th...
[ "ruby-on-rails", "testing", "rspec", "restful-authentication" ]
17
7
12,209
4
0
2008-09-15T17:15:03.893000
2008-09-15T19:04:35.737000