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
106,470
106,796
Changing the default settings for a console application
I would prefer that a console app would default to multithreaded debug. warning level 4. build browse information. no resource folder. Does anyone know of any technique that would allow me to create a console app, with my desired options, without manually setting it.
Yes, you can do that. What you want is to create your own project template. You can then select that template from the New Project wizard. I wasn't able to location documentation on how to create a project template in Visual Studio 6, but this MSDN article explains the procedure for Visual Studio 2005. Hopefully you wi...
Changing the default settings for a console application I would prefer that a console app would default to multithreaded debug. warning level 4. build browse information. no resource folder. Does anyone know of any technique that would allow me to create a console app, with my desired options, without manually setting ...
TITLE: Changing the default settings for a console application QUESTION: I would prefer that a console app would default to multithreaded debug. warning level 4. build browse information. no resource folder. Does anyone know of any technique that would allow me to create a console app, with my desired options, without...
[ "c++", "visual-studio", "visual-c++-6" ]
0
1
1,247
3
0
2008-09-19T23:57:21.920000
2008-09-20T02:17:22.020000
106,476
106,601
Possible to monitor processes another process launches via WMI?
I have a setup executable that I need to install. When I run it, it launches a msi to do the actual install and then dies immediately. The side effect of this is it will return control back to any console you call it from before the install finishes. Depending on what machine I run it on, it can take from three to ten ...
Would doing a WMI lookup of processes that have the initial setup as the parent process do the trick? For example, if I launch an MSI from a command prompt with process id 4000, I can execute the following command line to find information about msiexec process: c:\>wmic PROCESS WHERE ParentProcessId=4000 GET CommandLin...
Possible to monitor processes another process launches via WMI? I have a setup executable that I need to install. When I run it, it launches a msi to do the actual install and then dies immediately. The side effect of this is it will return control back to any console you call it from before the install finishes. Depen...
TITLE: Possible to monitor processes another process launches via WMI? QUESTION: I have a setup executable that I need to install. When I run it, it launches a msi to do the actual install and then dies immediately. The side effect of this is it will return control back to any console you call it from before the insta...
[ "windows", "scripting", "wmi", "wsh" ]
1
1
2,739
3
0
2008-09-19T23:59:44.300000
2008-09-20T00:44:33.833000
106,481
106,557
Javascript with embedded Ruby: How to safely assign a ruby value to a javascript variable
I have this line in a javascript block in a page: res = foo('<%= @ruby_var %>'); What is the best way to handle the case where @ruby_var has a single-quote in it? Else it will break the JavaScript code.
I think I'd use a ruby JSON library on @ruby_var to get proper js syntax for the string and get rid of the '', fex.: res = foo(<%= @ruby_var.to_json %>) (after require "json"'ing, not entirely sure how to do that in the page or if the above syntax is correct as I havn't used that templating language) (on the other hand...
Javascript with embedded Ruby: How to safely assign a ruby value to a javascript variable I have this line in a javascript block in a page: res = foo('<%= @ruby_var %>'); What is the best way to handle the case where @ruby_var has a single-quote in it? Else it will break the JavaScript code.
TITLE: Javascript with embedded Ruby: How to safely assign a ruby value to a javascript variable QUESTION: I have this line in a javascript block in a page: res = foo('<%= @ruby_var %>'); What is the best way to handle the case where @ruby_var has a single-quote in it? Else it will break the JavaScript code. ANSWER: ...
[ "javascript", "ruby" ]
5
11
7,893
7
0
2008-09-20T00:00:56.340000
2008-09-20T00:29:09.907000
106,508
106,614
What is a smart pointer and when should I use one?
What is a smart pointer and when should I use one?
UPDATE This answer is rather old, and so describes what was 'good' at the time, which was smart pointers provided by the Boost library. Since C++11, the standard library has provided sufficient smart pointers types, and so you should favour the use of std::unique_ptr, std::shared_ptr and std::weak_ptr. There was also s...
What is a smart pointer and when should I use one? What is a smart pointer and when should I use one?
TITLE: What is a smart pointer and when should I use one? QUESTION: What is a smart pointer and when should I use one? ANSWER: UPDATE This answer is rather old, and so describes what was 'good' at the time, which was smart pointers provided by the Boost library. Since C++11, the standard library has provided sufficie...
[ "c++", "pointers", "c++11", "smart-pointers", "c++-faq" ]
2,164
2,051
731,185
14
0
2008-09-20T00:09:24.963000
2008-09-20T00:48:23.480000
106,509
106,958
Disable button on form submission
I have a button that I would like to disable when the form submits to prevent the user submitting multiple times. I have tried naively disabling the button with javascript onclick but then if a client side validation that fails the button remains disabled. How do I disable the button when the form successfully submits ...
Give this a whirl: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Threading; public partial class _Default: System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { // Identify button as a "disa...
Disable button on form submission I have a button that I would like to disable when the form submits to prevent the user submitting multiple times. I have tried naively disabling the button with javascript onclick but then if a client side validation that fails the button remains disabled. How do I disable the button w...
TITLE: Disable button on form submission QUESTION: I have a button that I would like to disable when the form submits to prevent the user submitting multiple times. I have tried naively disabling the button with javascript onclick but then if a client side validation that fails the button remains disabled. How do I di...
[ "asp.net", "javascript", "webforms" ]
15
14
18,173
17
0
2008-09-20T00:09:30.330000
2008-09-20T03:27:41.180000
106,534
106,616
Adding HTML to my RSS/Atom feed in Rails
The default rails XML builder escapes all HTML, so something like: atom_feed do |feed| @stories.each do |story| feed.entry story do |entry| entry.title story.title entry.content " foo " end end end will produce the text: foo instead of: foo Is there any way to instruct the XML builder to not escape the XML?
turns out you need to do entry.content " foo ",:type => "html" althought wrapping it in a CDATA stops it working.
Adding HTML to my RSS/Atom feed in Rails The default rails XML builder escapes all HTML, so something like: atom_feed do |feed| @stories.each do |story| feed.entry story do |entry| entry.title story.title entry.content " foo " end end end will produce the text: foo instead of: foo Is there any way to instruct the XML b...
TITLE: Adding HTML to my RSS/Atom feed in Rails QUESTION: The default rails XML builder escapes all HTML, so something like: atom_feed do |feed| @stories.each do |story| feed.entry story do |entry| entry.title story.title entry.content " foo " end end end will produce the text: foo instead of: foo Is there any way to ...
[ "html", "ruby-on-rails", "rss", "builder", "atom-feed" ]
8
10
3,656
3
0
2008-09-20T00:17:56.660000
2008-09-20T00:48:36.227000
106,540
106,553
Why do I need to SEM_PRIORITY_Q when using a VxWorks inversion safe mutex?
In VxWorks, I am creating a mutex with the SEM_INVERSION_SAFE option, to protect against the priority inversion problem. The manual says that I must also use the SEM_PRIORITY_Q option. Why is that?
When creating a mutex semaphore in VxWroks, you have two options to deal with multiple tasks queued (waiting) for the semaphore: FIFO or Highest priority task first. When you use the SEM_INVERSION_SAFE option, the task holding the mutex will be bumped up to the same priority as the highest priority task waiting for the...
Why do I need to SEM_PRIORITY_Q when using a VxWorks inversion safe mutex? In VxWorks, I am creating a mutex with the SEM_INVERSION_SAFE option, to protect against the priority inversion problem. The manual says that I must also use the SEM_PRIORITY_Q option. Why is that?
TITLE: Why do I need to SEM_PRIORITY_Q when using a VxWorks inversion safe mutex? QUESTION: In VxWorks, I am creating a mutex with the SEM_INVERSION_SAFE option, to protect against the priority inversion problem. The manual says that I must also use the SEM_PRIORITY_Q option. Why is that? ANSWER: When creating a mute...
[ "mutex", "semaphore", "vxworks" ]
0
5
2,021
1
0
2008-09-20T00:20:55.327000
2008-09-20T00:26:56.403000
106,544
106,736
Rsync on Windows - Socket operation on non-socket
I get the following error when trying to run the latest Cygwin version of rsync in Windows XP SP2. The error occurs for attempts at both local syncs (that is: source and destination on the local harddisk only) and remote syncs (using "-e ssh" from the openssh package). Any advice on how to fix/workaround it? bash-3.2$ ...
Not really an answer to your question, but I've found Delta Copy to be a much better option than messing around with Cygwin. It connects to regular rsync daemons too.
Rsync on Windows - Socket operation on non-socket I get the following error when trying to run the latest Cygwin version of rsync in Windows XP SP2. The error occurs for attempts at both local syncs (that is: source and destination on the local harddisk only) and remote syncs (using "-e ssh" from the openssh package). ...
TITLE: Rsync on Windows - Socket operation on non-socket QUESTION: I get the following error when trying to run the latest Cygwin version of rsync in Windows XP SP2. The error occurs for attempts at both local syncs (that is: source and destination on the local harddisk only) and remote syncs (using "-e ssh" from the ...
[ "sockets", "cygwin", "rsync" ]
1
0
4,646
5
0
2008-09-20T00:22:03.060000
2008-09-20T01:42:29.903000
106,555
106,642
How to find the amount of physical memory occupied by a hash in Perl?
I have a Perl script where I maintain a very simple cache using a hash table. I would like to clear the hash once it occupies more than n bytes, to avoid Perl (32-bit) running out of memory and crashing. I can do a check on the number of keys-value pairs: if (scalar keys %cache > $maxSize) { %cache = (); } But is it po...
Devel::Size is the answer to your question. (Note that Devel::Size will temporarily allocate a significant amount of memory when processing a large data structure, so it's not really well suited to this purpose.) However, Cache::SizeAwareMemoryCache and Tie::Cache already implement what you're looking for (with somewha...
How to find the amount of physical memory occupied by a hash in Perl? I have a Perl script where I maintain a very simple cache using a hash table. I would like to clear the hash once it occupies more than n bytes, to avoid Perl (32-bit) running out of memory and crashing. I can do a check on the number of keys-value p...
TITLE: How to find the amount of physical memory occupied by a hash in Perl? QUESTION: I have a Perl script where I maintain a very simple cache using a hash table. I would like to clear the hash once it occupies more than n bytes, to avoid Perl (32-bit) running out of memory and crashing. I can do a check on the numb...
[ "perl", "memory", "hash" ]
18
27
12,268
7
0
2008-09-20T00:27:53.547000
2008-09-20T01:00:18.163000
106,563
108,370
Does the tee command always wait for EOF?
I'd like to log the output of a command to stdout as well as to a log file. I've got Cygwin installed and I'm trying to use the tee command to accomplish this. devenv mysolution.sln /build myproject "Release|Win32" | tee build.log Trouble is that tee seems to insist on waiting for the end of file before outputting anyt...
tee seems to insist on waiting for the end of file before outputting anything to either stdout or the log file. This should definitely not be happening - it would render tee nearly useless. Here's a simple test that I wrote that puts this to the test, and it's definitely not waiting for eof. $ cat test #!/bin/sh echo "...
Does the tee command always wait for EOF? I'd like to log the output of a command to stdout as well as to a log file. I've got Cygwin installed and I'm trying to use the tee command to accomplish this. devenv mysolution.sln /build myproject "Release|Win32" | tee build.log Trouble is that tee seems to insist on waiting ...
TITLE: Does the tee command always wait for EOF? QUESTION: I'd like to log the output of a command to stdout as well as to a log file. I've got Cygwin installed and I'm trying to use the tee command to accomplish this. devenv mysolution.sln /build myproject "Release|Win32" | tee build.log Trouble is that tee seems to ...
[ "command-line", "cygwin" ]
4
2
3,561
3
0
2008-09-20T00:32:01.650000
2008-09-20T14:49:49.027000
106,572
106,625
What's a good alternative to the included Terminal program on OS X?
My keyboard acts flaky when I use a terminal session on OS X (another question?), so using the command line is often frustrating. Other native applications seem fine and don't suffer the same problem. Is there another terminal application that might work better for me?
As the name ssh reveals: it is meant to be a shell application:) So there will be no gui or what so ever. If you are just pissed using the terminal... maybe try iTerm 2. Works pretty well...
What's a good alternative to the included Terminal program on OS X? My keyboard acts flaky when I use a terminal session on OS X (another question?), so using the command line is often frustrating. Other native applications seem fine and don't suffer the same problem. Is there another terminal application that might wo...
TITLE: What's a good alternative to the included Terminal program on OS X? QUESTION: My keyboard acts flaky when I use a terminal session on OS X (another question?), so using the command line is often frustrating. Other native applications seem fine and don't suffer the same problem. Is there another terminal applica...
[ "macos", "keyboard", "terminal" ]
2
8
8,226
5
0
2008-09-20T00:34:57.633000
2008-09-20T00:52:01.913000
106,581
111,431
Porting Windows software to Embedded/Realtime Operating Systems
I have an existing codebase targeting a Windows environment and with an eye to the future, would like to make this as cross platform as possible. I've had some sucess with standard Linux distributions by using cross platform libraries but would like to extend this to Realtime and or embedded operating systems. Would it...
If you are using the windows COM interface (I assume you're not talking about serial port here, but the Common Object Model), your code might need to be abstracted away from that. As you talk about IPC, then obviously this is a multi-tasking/multi-processing type code base. With that being the case, you will have to so...
Porting Windows software to Embedded/Realtime Operating Systems I have an existing codebase targeting a Windows environment and with an eye to the future, would like to make this as cross platform as possible. I've had some sucess with standard Linux distributions by using cross platform libraries but would like to ext...
TITLE: Porting Windows software to Embedded/Realtime Operating Systems QUESTION: I have an existing codebase targeting a Windows environment and with an eye to the future, would like to make this as cross platform as possible. I've had some sucess with standard Linux distributions by using cross platform libraries but...
[ "embedded", "cross-platform", "rtos" ]
3
1
520
6
0
2008-09-20T00:38:31.400000
2008-09-21T17:11:08.960000
106,591
106,787
What is the volatile keyword useful for?
At work today, I came across the volatile keyword in Java. Not being very familiar with it, I found this explanation. Given the detail in which that article explains the keyword in question, do you ever use it or could you ever see a case in which you could use this keyword in the correct manner?
volatile has semantics for memory visibility. Basically, the value of a volatile field becomes visible to all readers (other threads in particular) after a write operation completes on it. Without volatile, readers could see some non-updated value. To answer your question: Yes, I use a volatile variable to control whet...
What is the volatile keyword useful for? At work today, I came across the volatile keyword in Java. Not being very familiar with it, I found this explanation. Given the detail in which that article explains the keyword in question, do you ever use it or could you ever see a case in which you could use this keyword in t...
TITLE: What is the volatile keyword useful for? QUESTION: At work today, I came across the volatile keyword in Java. Not being very familiar with it, I found this explanation. Given the detail in which that article explains the keyword in question, do you ever use it or could you ever see a case in which you could use...
[ "java", "multithreading", "keyword", "volatile" ]
816
876
356,926
25
0
2008-09-20T00:41:02.267000
2008-09-20T02:09:51.007000
106,597
107,649
Why are fixnums in Emacs only 29 bits?
And why don't they change it? Edit: The reason ask is because I'm new to emacs and I would like to use Emacs as a "programmer calculator". So, I can manipulate 32-bit & 64-bit integers and have them behave as they would on the native machine.
Emacs-Lisp is a dynamically-typed language. This means that you need type tags at runtime. If you wanted to work with numbers, you would therefore normally have to pack them into some kind of tagged container that you can point to (i.e. “box” them), as there is no way of distinguishing a pointer from a machine integer ...
Why are fixnums in Emacs only 29 bits? And why don't they change it? Edit: The reason ask is because I'm new to emacs and I would like to use Emacs as a "programmer calculator". So, I can manipulate 32-bit & 64-bit integers and have them behave as they would on the native machine.
TITLE: Why are fixnums in Emacs only 29 bits? QUESTION: And why don't they change it? Edit: The reason ask is because I'm new to emacs and I would like to use Emacs as a "programmer calculator". So, I can manipulate 32-bit & 64-bit integers and have them behave as they would on the native machine. ANSWER: Emacs-Lisp ...
[ "emacs", "lisp", "elisp" ]
8
18
1,714
7
0
2008-09-20T00:44:11.697000
2008-09-20T08:40:08.200000
106,599
106,826
What is the most flexible serialization for .NET objects, yet simple to implement?
I would like to serialize and deserialize objects without having to worry about the entire class graph. Flexibility is key. I would like to be able to serialize any object passed to me without complete attributes needed throughout the entire object graph. That means that Binary Serialization is not an option as it only...
Have you considered serializing to JSON instead of XML? Json.NET has a really powerful and flexible serializer that has no problems with Hashtables/generic dictionaries and doesn't require any particular attributes. I know because I wrote it:) It gives you heaps of control through various options on the serializer and ...
What is the most flexible serialization for .NET objects, yet simple to implement? I would like to serialize and deserialize objects without having to worry about the entire class graph. Flexibility is key. I would like to be able to serialize any object passed to me without complete attributes needed throughout the en...
TITLE: What is the most flexible serialization for .NET objects, yet simple to implement? QUESTION: I would like to serialize and deserialize objects without having to worry about the entire class graph. Flexibility is key. I would like to be able to serialize any object passed to me without complete attributes needed...
[ "c#", ".net", "serialization" ]
29
55
7,655
12
0
2008-09-20T00:44:26.330000
2008-09-20T02:32:51.267000
106,609
106,683
Algorithm to blend gradient filled corners in image
I need to put an alpha blended gradient border around an image. My problem is in blending the corners so they are smooth where the horizontal and vertical gradients meet. I believe there is a standard algorithm that solves this problem. I think I even encountered it in school many years ago. But I have been unsuccessfu...
Presumably you're multiplying the two gradients where they overlap, right? Dunno about a standard algorithm. But if you use a signoid shaped gradient instead of a linear one, that should eliminate the visible edge where the two overlap. A simple sigmoid function is smoothstep(t) = t t (3 - 2*t) where 0 <= t <= 1
Algorithm to blend gradient filled corners in image I need to put an alpha blended gradient border around an image. My problem is in blending the corners so they are smooth where the horizontal and vertical gradients meet. I believe there is a standard algorithm that solves this problem. I think I even encountered it i...
TITLE: Algorithm to blend gradient filled corners in image QUESTION: I need to put an alpha blended gradient border around an image. My problem is in blending the corners so they are smooth where the horizontal and vertical gradients meet. I believe there is a standard algorithm that solves this problem. I think I eve...
[ "algorithm", "image", "graphics", "image-processing", "gradient" ]
5
2
2,172
2
0
2008-09-20T00:46:50.757000
2008-09-20T01:15:48.237000
106,622
122,155
Can Seam 2.0.2sp1 apps run on Tomcat 5.5.9 with JBoss Embedded?
I'm trying to run the Tomcat with JBoss Embedded jpa booking example. I run the build and deploy the war. I then get the following error: ERROR [catalina.core.ContainerBase.[Catalina].[localhost].[/jboss-seam-jpa]] Error configuring application listener of class com.sun.faces.config.ConfigureListener java.lang.NoClassD...
I got this to work. I ran ant tomcat55 under the seam/examples/jpa example. This included the el-.jars needed. I then ran 'ant clean' and 'ant jboss-embeded' and manually copied in all of the el-.jars from the tomcat55 make. This got past my problem above. Now I'm able to start tomcat 5.5.9 with embedded JBoss. I can r...
Can Seam 2.0.2sp1 apps run on Tomcat 5.5.9 with JBoss Embedded? I'm trying to run the Tomcat with JBoss Embedded jpa booking example. I run the build and deploy the war. I then get the following error: ERROR [catalina.core.ContainerBase.[Catalina].[localhost].[/jboss-seam-jpa]] Error configuring application listener of...
TITLE: Can Seam 2.0.2sp1 apps run on Tomcat 5.5.9 with JBoss Embedded? QUESTION: I'm trying to run the Tomcat with JBoss Embedded jpa booking example. I run the build and deploy the war. I then get the following error: ERROR [catalina.core.ContainerBase.[Catalina].[localhost].[/jboss-seam-jpa]] Error configuring appli...
[ "java", "jpa", "seam" ]
2
1
1,333
2
0
2008-09-20T00:51:31.103000
2008-09-23T16:32:16.057000
106,623
107,031
How can I give java.util.Random a specific seed in thirdparty classes?
I have a Java program that loads thirdparty class files (classes I did not write) and executes them. These classes often use java.util.Random, which by default generates random starting seed values every time it gets instantiated. For reasons of reproducability, I want to give these classes the same starting seed every...
Consider modifying the third party libraries to have them use a seen for their Random instances. Though you do not have the source code, you can probably edit the bytecode to do it. One helpful toolkit for doing such is ASM.
How can I give java.util.Random a specific seed in thirdparty classes? I have a Java program that loads thirdparty class files (classes I did not write) and executes them. These classes often use java.util.Random, which by default generates random starting seed values every time it gets instantiated. For reasons of rep...
TITLE: How can I give java.util.Random a specific seed in thirdparty classes? QUESTION: I have a Java program that loads thirdparty class files (classes I did not write) and executes them. These classes often use java.util.Random, which by default generates random starting seed values every time it gets instantiated. ...
[ "java", "random", "jvm", "classloader" ]
5
2
1,658
6
0
2008-09-20T00:51:31.320000
2008-09-20T03:56:21.737000
106,630
106,709
Why unicode() uses str() on my object only with no encoding given?
I start by creating a string variable with some non-ascii utf-8 encoded data on it: >>> text = 'á' >>> text '\xc3\xa1' >>> text.decode('utf-8') u'\xe1' Using unicode() on it raises errors... >>> unicode(text) Traceback (most recent call last): File " ", line 1, in UnicodeDecodeError: 'ascii' codec can't decode byte 0xc...
The behaviour does seem confusing, but intensional. I reproduce here the entirety of the unicode documentation from the Python Built-In Functions documentation (for version 2.5.2, as I write this): unicode([object[, encoding [, errors]]]) Return the Unicode string version of object using one of the following modes: If ...
Why unicode() uses str() on my object only with no encoding given? I start by creating a string variable with some non-ascii utf-8 encoded data on it: >>> text = 'á' >>> text '\xc3\xa1' >>> text.decode('utf-8') u'\xe1' Using unicode() on it raises errors... >>> unicode(text) Traceback (most recent call last): File " ",...
TITLE: Why unicode() uses str() on my object only with no encoding given? QUESTION: I start by creating a string variable with some non-ascii utf-8 encoded data on it: >>> text = 'á' >>> text '\xc3\xa1' >>> text.decode('utf-8') u'\xe1' Using unicode() on it raises errors... >>> unicode(text) Traceback (most recent cal...
[ "python", "unicode", "encoding" ]
7
8
1,138
2
0
2008-09-20T00:53:24.373000
2008-09-20T01:32:09.070000
106,632
106,839
Is it safe to use the Administrator Tasks in Central Administration?
Strange question, but: Sharepoint 2007 greets you with the Administrator Tasks on the Central Administration after installation. I just wonder if this list is "safe" to be used for my own Administration Tasks? The reason why i'm asking is because I found that Sharepoint uses a lot of "black magic" and unlogical behavio...
I wouldn't use that list as it seems to be specially modified with various extra fields and I wouldn't want to misuse those. It may just pay you to create your own administrative tasks list.
Is it safe to use the Administrator Tasks in Central Administration? Strange question, but: Sharepoint 2007 greets you with the Administrator Tasks on the Central Administration after installation. I just wonder if this list is "safe" to be used for my own Administration Tasks? The reason why i'm asking is because I fo...
TITLE: Is it safe to use the Administrator Tasks in Central Administration? QUESTION: Strange question, but: Sharepoint 2007 greets you with the Administrator Tasks on the Central Administration after installation. I just wonder if this list is "safe" to be used for my own Administration Tasks? The reason why i'm aski...
[ "sharepoint" ]
1
1
219
2
0
2008-09-20T00:55:19.800000
2008-09-20T02:38:56.897000
106,646
106,689
Web-page template where content takes full height of view-port if has 1 line minus footer
I am looking for a CSS-based web page template where the main content div occupies the full height of the view port (minus header and footer heights) when its content has few lines. The footer should be at the bottom of the viewport, rather than right below content, where it's more in the middle of the viewport. Conten...
Example here: http://www.rossdmartin.com/aitp/index.htm More in-depth resources: http://www.themaninblue.com/experiment/footerStickAlt/ http://ryanfait.com/sticky-footer/
Web-page template where content takes full height of view-port if has 1 line minus footer I am looking for a CSS-based web page template where the main content div occupies the full height of the view port (minus header and footer heights) when its content has few lines. The footer should be at the bottom of the viewpo...
TITLE: Web-page template where content takes full height of view-port if has 1 line minus footer QUESTION: I am looking for a CSS-based web page template where the main content div occupies the full height of the view port (minus header and footer heights) when its content has few lines. The footer should be at the bo...
[ "html", "css" ]
6
3
1,598
2
0
2008-09-20T01:00:56.493000
2008-09-20T01:19:36.917000
106,668
106,675
Simultaneously monitoring multiple log files (over ssh) on Windows?
I've used poderosa(a.NET terminal app) to monitor logs on multiple linux/solaris servers. This application is NOT getting currently maintained and I've had several problems with it. I'm wondering what other users do to simultaneously monitor several logs in real-time(as in tail -f logfile). I would like to be able to t...
You could use Putty Connection Manager to add tabs to PuTTy. Then SSH into the machine twice and tab back and forth. Tutorial on Setting it Up
Simultaneously monitoring multiple log files (over ssh) on Windows? I've used poderosa(a.NET terminal app) to monitor logs on multiple linux/solaris servers. This application is NOT getting currently maintained and I've had several problems with it. I'm wondering what other users do to simultaneously monitor several lo...
TITLE: Simultaneously monitoring multiple log files (over ssh) on Windows? QUESTION: I've used poderosa(a.NET terminal app) to monitor logs on multiple linux/solaris servers. This application is NOT getting currently maintained and I've had several problems with it. I'm wondering what other users do to simultaneously ...
[ "windows", "logging", "terminal", "monitoring" ]
4
1
9,402
8
0
2008-09-20T01:10:06.907000
2008-09-20T01:12:29.413000
106,684
110,338
How to create a new type of entity in Microsoft Robotics Studio 2.0?
What I'm trying to do with MRS is to teach myself some basic AI; what I want to do is to make a rocket entity, with things such as vectored exhaust, and staging. Anyone have an idea on how to make an entity that can fly? Or do I just need to constantly apply a force upwards?
Hey TraumaPony, your question looked lonely:) I took a look at an MSDN article about MRS 2.0 here I believe you'll actually need to create a Rocket entity of some kind and then a Thruster entity that it can use. In the article they were able to reuse a DifferentialDrive entity to propel their bot forward. I hope that h...
How to create a new type of entity in Microsoft Robotics Studio 2.0? What I'm trying to do with MRS is to teach myself some basic AI; what I want to do is to make a rocket entity, with things such as vectored exhaust, and staging. Anyone have an idea on how to make an entity that can fly? Or do I just need to constantl...
TITLE: How to create a new type of entity in Microsoft Robotics Studio 2.0? QUESTION: What I'm trying to do with MRS is to teach myself some basic AI; what I want to do is to make a rocket entity, with things such as vectored exhaust, and staging. Anyone have an idea on how to make an entity that can fly? Or do I just...
[ "artificial-intelligence", "robotics", "robotics-studio" ]
6
3
477
2
0
2008-09-20T01:16:23.850000
2008-09-21T05:41:07.077000
106,711
106,757
in Rails : Retrieve user input from a form that isn't associated with a Model, use the result within the controller
Here's a simplified version of what I'm trying to do: Before any other actions are performed, present the user with a form to retrieve a string. Input the string, and then redirect to the default controller action (e.g. index). The string only needs to exist, no other validations are necessary. The string must be avail...
Part of the problem is that you aren't setting @string. You don't really need the before_filter for this at all, and should just be able to use: def get_string @string = params[:string] || session[:string] respond_to do |format| if @string format.html {redirect_to(accounts_url)} # authenticate.html.erb else format.html...
in Rails : Retrieve user input from a form that isn't associated with a Model, use the result within the controller Here's a simplified version of what I'm trying to do: Before any other actions are performed, present the user with a form to retrieve a string. Input the string, and then redirect to the default controll...
TITLE: in Rails : Retrieve user input from a form that isn't associated with a Model, use the result within the controller QUESTION: Here's a simplified version of what I'm trying to do: Before any other actions are performed, present the user with a form to retrieve a string. Input the string, and then redirect to th...
[ "ruby-on-rails", "before-filter" ]
1
2
844
2
0
2008-09-20T01:32:57.807000
2008-09-20T01:52:24.483000
106,712
106,724
How to make sure a font exists before using it with .NET
I have a VB.NET Windows Forms project that at one point paints text directly to onto the form at runtime. Before I paint with the font though, I want to make sure that the font and font-size exists on the user's machine. If they don't, I'll try a few other similar fonts, eventually defaulting with Arial or something. W...
From an MSDN article titled "How To: Enumerate Installed Fonts", I found this code: InstalledFontCollection installedFontCollection = new InstalledFontCollection(); // Get the array of FontFamily objects. FontFamily[] fontFamilies = installedFontCollection.Families;
How to make sure a font exists before using it with .NET I have a VB.NET Windows Forms project that at one point paints text directly to onto the form at runtime. Before I paint with the font though, I want to make sure that the font and font-size exists on the user's machine. If they don't, I'll try a few other simila...
TITLE: How to make sure a font exists before using it with .NET QUESTION: I have a VB.NET Windows Forms project that at one point paints text directly to onto the form at runtime. Before I paint with the font though, I want to make sure that the font and font-size exists on the user's machine. If they don't, I'll try ...
[ ".net", "vb.net", "winforms", "fonts" ]
2
8
5,610
4
0
2008-09-20T01:33:28.583000
2008-09-20T01:39:34.187000
106,721
2,055,695
Anybody got an Actionscript 3 Youtube API / wrapper?
Google / Youtube has an API for Youtube for javascript and Actionscript 2. Unfortunately this API is not compatible with Actionscript 3 without a wrapper - which google does not themselves provide. Has anybody got an actionscript 3 wrapper they can make available?
FINALLY! YouTube's official API changed from AS2 to AS3 http://code.google.com/apis/youtube/flash_api_reference.html Note: This documentation was updated in October 2009 to explain how to use AS3 rather than ActionScript 2.0 (AS2).
Anybody got an Actionscript 3 Youtube API / wrapper? Google / Youtube has an API for Youtube for javascript and Actionscript 2. Unfortunately this API is not compatible with Actionscript 3 without a wrapper - which google does not themselves provide. Has anybody got an actionscript 3 wrapper they can make available?
TITLE: Anybody got an Actionscript 3 Youtube API / wrapper? QUESTION: Google / Youtube has an API for Youtube for javascript and Actionscript 2. Unfortunately this API is not compatible with Actionscript 3 without a wrapper - which google does not themselves provide. Has anybody got an actionscript 3 wrapper they can ...
[ "actionscript-3", "youtube", "youtube-api" ]
3
2
4,648
7
0
2008-09-20T01:37:49.883000
2010-01-13T09:45:02.117000
106,734
106,748
Most efficient way to programmatically determine if a web domain is available?
I am writing some code to determine whether a network domain is registered. For example, I want to check if "Google123.com" is available. There are at least two ways I can do this programmatically, but I'm not sure which is more valid: A) In linux/cygwin, I can launch the whois command to see if a domain is in use. B) ...
nslookup hits your dns server that's in your system settings. It can be behind the times or not have any dns entry. I would think the best way would be to have a tcp connection to whois.internic.net port 43 (the whois port), pass the name you want to check, and then you should get a response letting you know. If it doe...
Most efficient way to programmatically determine if a web domain is available? I am writing some code to determine whether a network domain is registered. For example, I want to check if "Google123.com" is available. There are at least two ways I can do this programmatically, but I'm not sure which is more valid: A) In...
TITLE: Most efficient way to programmatically determine if a web domain is available? QUESTION: I am writing some code to determine whether a network domain is registered. For example, I want to check if "Google123.com" is available. There are at least two ways I can do this programmatically, but I'm not sure which is...
[ "network-protocols", "whois", "nslookup" ]
13
7
4,886
6
0
2008-09-20T01:42:10.623000
2008-09-20T01:49:49.543000
106,765
106,799
I want my C# Windows Service to automatically update itself
Is there a framework that can be used to enable a C# Windows Service to automatically check for a newer version and upgrade itself? I can certainly write code to accomplish this, but I am looking for a framework that has already been implemented and (most importantly) tested. [edit] Here is a link to a similar question...
The only way to unload types is to destroy the appdomain. To do this would require separation of your hosting layer from your executing service code - this is pretty complex. (sort of like doing keyhole surgery) May be easier to either a) run a batch task or b) in-service detect updates then launch a seperate process t...
I want my C# Windows Service to automatically update itself Is there a framework that can be used to enable a C# Windows Service to automatically check for a newer version and upgrade itself? I can certainly write code to accomplish this, but I am looking for a framework that has already been implemented and (most impo...
TITLE: I want my C# Windows Service to automatically update itself QUESTION: Is there a framework that can be used to enable a C# Windows Service to automatically check for a newer version and upgrade itself? I can certainly write code to accomplish this, but I am looking for a framework that has already been implemen...
[ "c#", "windows-services", "upgrade" ]
37
20
34,262
9
0
2008-09-20T01:55:28.610000
2008-09-20T02:18:44.137000
106,766
111,199
Unit Testing File Modifications
A common task in programs I've been working on lately is modifying a text file in some way. (Hey, I'm on Linux. Everything's a file. And I do large-scale system admin.) But the file the code modifies may not exist on my desktop box. And I probably don't want to modify it if it IS on my desktop. I've read about unit tes...
You're talking about testing too much at once. If you start trying to attack a testing problem by saying "Let's verify that it modifies its environment correctly", you're doomed to failure. Environments have dozens, maybe even millions of potential variations. Instead, look at the pieces ("units") of your program. For ...
Unit Testing File Modifications A common task in programs I've been working on lately is modifying a text file in some way. (Hey, I'm on Linux. Everything's a file. And I do large-scale system admin.) But the file the code modifies may not exist on my desktop box. And I probably don't want to modify it if it IS on my d...
TITLE: Unit Testing File Modifications QUESTION: A common task in programs I've been working on lately is modifying a text file in some way. (Hey, I'm on Linux. Everything's a file. And I do large-scale system admin.) But the file the code modifies may not exist on my desktop box. And I probably don't want to modify i...
[ "python", "linux", "unit-testing" ]
23
16
5,536
6
0
2008-09-20T01:56:25.550000
2008-09-21T15:16:34.853000
106,770
106,807
Standard concise way to copy a file in Java?
It has always bothered me that the only way to copy a file in Java involves opening streams, declaring a buffer, reading in one file, looping through it, and writing it out to the other steam. The web is littered with similar, yet still slightly different implementations of this type of solution. Is there a better way ...
As toolkit mentions above, Apache Commons IO is the way to go, specifically FileUtils. copyFile(); it handles all the heavy lifting for you. And as a postscript, note that recent versions of FileUtils (such as the 2.0.1 release) have added the use of NIO for copying files; NIO can significantly increase file-copying pe...
Standard concise way to copy a file in Java? It has always bothered me that the only way to copy a file in Java involves opening streams, declaring a buffer, reading in one file, looping through it, and writing it out to the other steam. The web is littered with similar, yet still slightly different implementations of ...
TITLE: Standard concise way to copy a file in Java? QUESTION: It has always bothered me that the only way to copy a file in Java involves opening streams, declaring a buffer, reading in one file, looping through it, and writing it out to the other steam. The web is littered with similar, yet still slightly different i...
[ "java", "file", "copy" ]
430
277
279,638
16
0
2008-09-20T01:59:09.457000
2008-09-20T02:23:46.233000
106,794
106,918
What do you use to protect your .NET code from reverse engineering?
For a while we were using a tool called CodeVeil. I'm just wondering if there are better alternatives out there. Edit: Before more people misunderstand the question, I'm aware that a determined cracker would probably be able to defeat any of these tools. I'm not too concerned about them though. These tools are just mea...
I've had a lot of success with Xenocode Postbuild. The tool can obfuscate.NET assemblies, protect agaist Reflector disassembly, combine.NET assemblies into a single executable ("virtualization") and even compile.NET applications to standalone executables that do not need.NET runtime installed.
What do you use to protect your .NET code from reverse engineering? For a while we were using a tool called CodeVeil. I'm just wondering if there are better alternatives out there. Edit: Before more people misunderstand the question, I'm aware that a determined cracker would probably be able to defeat any of these tool...
TITLE: What do you use to protect your .NET code from reverse engineering? QUESTION: For a while we were using a tool called CodeVeil. I'm just wondering if there are better alternatives out there. Edit: Before more people misunderstand the question, I'm aware that a determined cracker would probably be able to defeat...
[ ".net", "obfuscation", "reflector" ]
14
5
7,135
9
0
2008-09-20T02:15:07.283000
2008-09-20T03:15:24.190000
106,800
106,813
Unit Testing Guidelines
Does anyone know of where to find unit testing guidelines and recommendations? I'd like to have something which addresses the following types of topics (for example): Should tests be in the same project as application logic? Should I have test classes to mirror my logic classes or should I have only as many test classe...
I would recommend Kent Beck's book on TDD. Also, you need to go to Martin Fowler's site. He has a lot of good information about testing as well. We are pretty big on TDD so I will answer the questions in that light. Should tests be in the same project as application logic? Typically we keep our tests in the same soluti...
Unit Testing Guidelines Does anyone know of where to find unit testing guidelines and recommendations? I'd like to have something which addresses the following types of topics (for example): Should tests be in the same project as application logic? Should I have test classes to mirror my logic classes or should I have ...
TITLE: Unit Testing Guidelines QUESTION: Does anyone know of where to find unit testing guidelines and recommendations? I'd like to have something which addresses the following types of topics (for example): Should tests be in the same project as application logic? Should I have test classes to mirror my logic classes...
[ "unit-testing", "tdd" ]
23
21
5,003
7
0
2008-09-20T02:19:11.750000
2008-09-20T02:26:31.157000
106,820
106,847
What is Java EE?
I realize that literally it translates to Java Enterprise Edition. But what I'm asking is what does this really mean? When a company requires Java EE experience, what are they really asking for? Experience with EJBs? Experience with Java web apps? I suspect that this means something different to different people and th...
Java EE is actually a collection of technologies and APIs for the Java platform designed to support "Enterprise" Applications which can generally be classed as large-scale, distributed, transactional and highly-available applications designed to support mission-critical business requirements. In terms of what an employ...
What is Java EE? I realize that literally it translates to Java Enterprise Edition. But what I'm asking is what does this really mean? When a company requires Java EE experience, what are they really asking for? Experience with EJBs? Experience with Java web apps? I suspect that this means something different to differ...
TITLE: What is Java EE? QUESTION: I realize that literally it translates to Java Enterprise Edition. But what I'm asking is what does this really mean? When a company requires Java EE experience, what are they really asking for? Experience with EJBs? Experience with Java web apps? I suspect that this means something d...
[ "jakarta-ee" ]
233
149
174,785
9
0
2008-09-20T02:29:30.773000
2008-09-20T02:43:37.090000
106,862
108,160
Any experiences with Intel's Threading Building Blocks?
Intel's Threading Building Blocks (TBB) open source library looks really interesting. Even though there's even an O'Reilly Book about the subject I don't hear about a lot of people using it. I'm interested in using it for some multi-level parallel applications (MPI + threads) in Unix (Mac, Linux, etc.) environments. Fo...
I've introduced it into our code base because we needed a bettor malloc to use when we moved to a 16 core machine. With 8 and under it wasn't a significant issue. It has worked well for us. We plan on using the fine grained concurrent containers next. Ideally we can make use of the real meat of the product, but that re...
Any experiences with Intel's Threading Building Blocks? Intel's Threading Building Blocks (TBB) open source library looks really interesting. Even though there's even an O'Reilly Book about the subject I don't hear about a lot of people using it. I'm interested in using it for some multi-level parallel applications (MP...
TITLE: Any experiences with Intel's Threading Building Blocks? QUESTION: Intel's Threading Building Blocks (TBB) open source library looks really interesting. Even though there's even an O'Reilly Book about the subject I don't hear about a lot of people using it. I'm interested in using it for some multi-level paralle...
[ "c++", "multithreading", "intel", "tbb" ]
26
13
7,013
10
0
2008-09-20T02:52:37.067000
2008-09-20T13:34:22.687000
106,864
109,838
Adobe Captivate 3 Typing Sound viewing a recording
I am using Adobe Captivate 3 and am having trouble disabling the typing noise when using a recording. Sometimes when I have this 'feature' disabled and make a recording, it doesn't make the typing sound, but when I publish the project, the typing sound returns. Also, I have other projects I am working on where the typi...
Couple items from some searching about: Adobe.com: Setting keyboard tap sounds If you do not like the tapping sounds in your finished project, use the following procedure to remove them. The tapping sound is a project-level setting, so the sound either plays on all slides or is removed from all slides. Adobe Captivate ...
Adobe Captivate 3 Typing Sound viewing a recording I am using Adobe Captivate 3 and am having trouble disabling the typing noise when using a recording. Sometimes when I have this 'feature' disabled and make a recording, it doesn't make the typing sound, but when I publish the project, the typing sound returns. Also, I...
TITLE: Adobe Captivate 3 Typing Sound viewing a recording QUESTION: I am using Adobe Captivate 3 and am having trouble disabling the typing noise when using a recording. Sometimes when I have this 'feature' disabled and make a recording, it doesn't make the typing sound, but when I publish the project, the typing soun...
[ "adobe", "adobe-captivate" ]
0
0
2,454
2
0
2008-09-20T02:53:40.577000
2008-09-21T00:03:20.600000
106,871
106,895
How do I make WISA act like LAMP (Protecting .mp3s on IIS)
I have created a few small flash widgets that stream.mp3 audio from an Apache/php host. The mp3 file cannot be directly accessed and does not save it self to the browsers cache. To do this I set the mp3 file permission on the host to "owner: read/write" (numeric value 600). This makes it so that only my.php file can re...
You're not really protecting the MP3s, just obfuscating them. Anyone can still save them, especially if they just fire up an HTTP debugger like Fiddler to figure out what HTTP calls are being made. The fact that you've set them to not cache and to go through a PHP script doesn't help much. To get this same effect using...
How do I make WISA act like LAMP (Protecting .mp3s on IIS) I have created a few small flash widgets that stream.mp3 audio from an Apache/php host. The mp3 file cannot be directly accessed and does not save it self to the browsers cache. To do this I set the mp3 file permission on the host to "owner: read/write" (numeri...
TITLE: How do I make WISA act like LAMP (Protecting .mp3s on IIS) QUESTION: I have created a few small flash widgets that stream.mp3 audio from an Apache/php host. The mp3 file cannot be directly accessed and does not save it self to the browsers cache. To do this I set the mp3 file permission on the host to "owner: r...
[ "php", "asp.net", "apache", "iis", "no-cache" ]
0
2
212
1
0
2008-09-20T02:56:24.127000
2008-09-20T03:06:20.170000
106,880
107,958
InternalsVisibleTo attribute isn't working
I am trying to use the InternalsVisibleTo assembly attribute to make my internal classes in a.NET class library visible to my unit test project. For some reason, I keep getting an error message that says: 'MyClassName' is inaccessible due to its protection level Both assemblies are signed and I have the correct key lis...
Are you absolutely sure you have the correct public key specified in the attribute? Note that you need to specify the full public key, not just the public key token. It looks something like: [assembly: InternalsVisibleTo("MyFriendAssembly, PublicKey=0024000004800000940000000602000000240000525341310004000001000100F73 F4...
InternalsVisibleTo attribute isn't working I am trying to use the InternalsVisibleTo assembly attribute to make my internal classes in a.NET class library visible to my unit test project. For some reason, I keep getting an error message that says: 'MyClassName' is inaccessible due to its protection level Both assemblie...
TITLE: InternalsVisibleTo attribute isn't working QUESTION: I am trying to use the InternalsVisibleTo assembly attribute to make my internal classes in a.NET class library visible to my unit test project. For some reason, I keep getting an error message that says: 'MyClassName' is inaccessible due to its protection le...
[ ".net", "attributes", "internalsvisibleto" ]
84
109
70,329
24
0
2008-09-20T02:59:22.323000
2008-09-20T11:40:12.633000
106,896
107,836
Possibilities for Python classes organized across files?
I'm used to the Java model where you can have one public class per file. Python doesn't have this restriction, and I'm wondering what's the best practice for organizing classes.
A Python file is called a "module" and it's one way to organize your software so that it makes "sense". Another is a directory, called a "package". A module is a distinct thing that may have one or two dozen closely-related classes. The trick is that a module is something you'll import, and you need that import to be p...
Possibilities for Python classes organized across files? I'm used to the Java model where you can have one public class per file. Python doesn't have this restriction, and I'm wondering what's the best practice for organizing classes.
TITLE: Possibilities for Python classes organized across files? QUESTION: I'm used to the Java model where you can have one public class per file. Python doesn't have this restriction, and I'm wondering what's the best practice for organizing classes. ANSWER: A Python file is called a "module" and it's one way to org...
[ "python", "class", "project-structure" ]
298
365
109,285
6
0
2008-09-20T03:07:01.870000
2008-09-20T10:27:39.860000
106,907
106,948
Making code internal but available for unit testing from other projects
We put all of our unit tests in their own projects. We find that we have to make certain classes public instead of internal just for the unit tests. Is there anyway to avoid having to do this. What are the memory implication by making classes public instead of sealed?
If you're using.NET, the InternalsVisibleTo assembly attribute allows you to create "friend" assemblies. These are specific strongly named assemblies that are allowed to access internal classes and members of the other assembly. Note, this should be used with discretion as it tightly couples the involved assemblies. A ...
Making code internal but available for unit testing from other projects We put all of our unit tests in their own projects. We find that we have to make certain classes public instead of internal just for the unit tests. Is there anyway to avoid having to do this. What are the memory implication by making classes publi...
TITLE: Making code internal but available for unit testing from other projects QUESTION: We put all of our unit tests in their own projects. We find that we have to make certain classes public instead of internal just for the unit tests. Is there anyway to avoid having to do this. What are the memory implication by ma...
[ "c#", "unit-testing", "scope" ]
163
241
89,182
6
0
2008-09-20T03:10:29.083000
2008-09-20T03:24:33.357000
106,912
107,437
How to draw custom button in Window Titlebar with Windows Forms?
How do you draw a custom button next to the minimize, maximize and close buttons within the Titlebar of the Form? I know you need to use Win32 API calls and override the WndProc procedure, but I haven't been able to figure out a solution that works right. Does anyone know how to do this? More specifically, does anyone ...
The following will work in XP, I have no Vista machine handy to test it, but I think your issues are steming from an incorrect hWnd somehow. Anyway, on with the poorly commented code. // The state of our little button ButtonState _buttState = ButtonState.Normal; Rectangle _buttPosition = new Rectangle(); [DllImport("u...
How to draw custom button in Window Titlebar with Windows Forms? How do you draw a custom button next to the minimize, maximize and close buttons within the Titlebar of the Form? I know you need to use Win32 API calls and override the WndProc procedure, but I haven't been able to figure out a solution that works right....
TITLE: How to draw custom button in Window Titlebar with Windows Forms? QUESTION: How do you draw a custom button next to the minimize, maximize and close buttons within the Titlebar of the Form? I know you need to use Win32 API calls and override the WndProc procedure, but I haven't been able to figure out a solution...
[ "winforms", "winapi", "windows-vista", "wndproc", "titlebar" ]
7
6
31,692
3
0
2008-09-20T03:12:42.200000
2008-09-20T06:49:21.507000
106,941
106,952
Should I use internal or public visibility by default?
I'm a pretty new C# and.NET developer. I recently created an MMC snapin using C# and was gratified by how easy it was to do, especially after hearing a lot of horror stories by some other developers in my organisation about how hard it is to do in C++. I pretty much went through the whole project at some point and made...
I believe in blackboxes where possible. As a programmer, I want a well defined blackbox which I can easily drop into my systems, and have it work. I give it values, call the appropriate methods, and then get my results back out of it. To that end, give me only the functionality that the class needs to expose to work. C...
Should I use internal or public visibility by default? I'm a pretty new C# and.NET developer. I recently created an MMC snapin using C# and was gratified by how easy it was to do, especially after hearing a lot of horror stories by some other developers in my organisation about how hard it is to do in C++. I pretty muc...
TITLE: Should I use internal or public visibility by default? QUESTION: I'm a pretty new C# and.NET developer. I recently created an MMC snapin using C# and was gratified by how easy it was to do, especially after hearing a lot of horror stories by some other developers in my organisation about how hard it is to do in...
[ "c#", ".net", "public", "internals" ]
43
40
16,880
14
0
2008-09-20T03:21:55.530000
2008-09-20T03:25:50.560000
106,956
209,475
Is the Unity Framework any good for Inversion of Control?
I have been using IoC for a little while now and I am curious if I should use Microsoft's Unity framework (official name "Unity Application Block"). Does anyone have experience using it? So for I have been copying my IoC container code from project to project, but I think it would be better to using something standard....
I would say stick with the one you know until you feel confident with it and the whole concept. After what you'll have a better judgement to pick a framework which fullfill your needs.
Is the Unity Framework any good for Inversion of Control? I have been using IoC for a little while now and I am curious if I should use Microsoft's Unity framework (official name "Unity Application Block"). Does anyone have experience using it? So for I have been copying my IoC container code from project to project, b...
TITLE: Is the Unity Framework any good for Inversion of Control? QUESTION: I have been using IoC for a little while now and I am curious if I should use Microsoft's Unity framework (official name "Unity Application Block"). Does anyone have experience using it? So for I have been copying my IoC container code from pro...
[ "inversion-of-control", "unity-container" ]
5
3
5,515
4
0
2008-09-20T03:27:30.853000
2008-10-16T17:13:56.490000
106,963
107,032
How can I lookup data about a book from its barcode number?
I'm building the world's simplest library application. All I want to be able to do is scan in a book's UPC (barcode) using a typical scanner (which just types the numbers of the barcode into a field) and then use it to look up data about the book... at a minimum, title, author, year published, and either the Dewey Deci...
There's a very straightforward web based solution over at ISBNDB.com that you may want to look at. Edit: Updated API documentation link, now there's version 2 available as well Link to prices and tiers here You can be up and running in just a few minutes (these examples are from API v1): register on the site and get a ...
How can I lookup data about a book from its barcode number? I'm building the world's simplest library application. All I want to be able to do is scan in a book's UPC (barcode) using a typical scanner (which just types the numbers of the barcode into a field) and then use it to look up data about the book... at a minim...
TITLE: How can I lookup data about a book from its barcode number? QUESTION: I'm building the world's simplest library application. All I want to be able to do is scan in a book's UPC (barcode) using a typical scanner (which just types the numbers of the barcode into a field) and then use it to look up data about the ...
[ "api", "language-agnostic", "barcode" ]
75
64
48,371
11
0
2008-09-20T03:28:34.360000
2008-09-20T03:56:30.767000
106,965
106,988
How do I read a file over a network that is in use/locked by another process in c#?
Is there a way to read a locked file across a network given that you are the machine admin on the remote machine? I haven't been able to read the locked file locally, and attempting it over the network adds another layer of difficulty.
Depending on the type of lock (read only vs exclusive) it should be possible to copy the file first, then you can work with the unlocked copy. You should be able to do that in a background thread. If you really like threading, have the file watcher start the read process once the copy is complete (although that might b...
How do I read a file over a network that is in use/locked by another process in c#? Is there a way to read a locked file across a network given that you are the machine admin on the remote machine? I haven't been able to read the locked file locally, and attempting it over the network adds another layer of difficulty.
TITLE: How do I read a file over a network that is in use/locked by another process in c#? QUESTION: Is there a way to read a locked file across a network given that you are the machine admin on the remote machine? I haven't been able to read the locked file locally, and attempting it over the network adds another lay...
[ "c#", ".net", "networking", "io" ]
2
1
1,384
2
0
2008-09-20T03:28:50.943000
2008-09-20T03:36:30.130000
106,979
106,994
What's the best way to pass data between concurrent threads in .NET?
I have two threads, one needs to poll a bunch of separate static resources looking for updates. The other one needs to get the data and store it in the database. How can thread 1 tell thread 2 that there is something to process?
If the pieces of data are independant then treat the pieces of data as work items to be processed by a pool of threads. Use the thread pool and QueueUserWorkItem to post the data to the thread(s). You should get better scalability using a pool of symmetric threads and limiting the amount of synchronisation that has to ...
What's the best way to pass data between concurrent threads in .NET? I have two threads, one needs to poll a bunch of separate static resources looking for updates. The other one needs to get the data and store it in the database. How can thread 1 tell thread 2 that there is something to process?
TITLE: What's the best way to pass data between concurrent threads in .NET? QUESTION: I have two threads, one needs to poll a bunch of separate static resources looking for updates. The other one needs to get the data and store it in the database. How can thread 1 tell thread 2 that there is something to process? ANS...
[ ".net", "multithreading", "concurrency" ]
4
7
1,548
4
0
2008-09-20T03:33:15.503000
2008-09-20T03:38:43.667000
107,005
107,115
Predict next auto-inserted row id (SQLite)
I'm trying to find if there is a reliable way (using SQLite ) to find the ID of the next row to be inserted, before it gets inserted. I need to use the id for another insert statement, but don't have the option of instantly inserting and getting the next row. Is predicting the next id as simple as getting the last id a...
Either scrapping or committing a series of database operations all at once is exactly what transactions are for. Query BEGIN; before the user starts fiddling and COMMIT; once he/she's done. You're guaranteed that either all the changes are applied (if you commit) or everything is scrapped (if you query ROLLBACK;, if th...
Predict next auto-inserted row id (SQLite) I'm trying to find if there is a reliable way (using SQLite ) to find the ID of the next row to be inserted, before it gets inserted. I need to use the id for another insert statement, but don't have the option of instantly inserting and getting the next row. Is predicting the...
TITLE: Predict next auto-inserted row id (SQLite) QUESTION: I'm trying to find if there is a reliable way (using SQLite ) to find the ID of the next row to be inserted, before it gets inserted. I need to use the id for another insert statement, but don't have the option of instantly inserting and getting the next row....
[ "database", "sqlite" ]
20
16
21,570
11
0
2008-09-20T03:45:26.007000
2008-09-20T04:32:51.757000
107,017
107,113
Detect And Remove Rootkit
What is the best (hopefully free or cheap) way to detect and then, if necessary, remove a rootkit found on your machine?
SysInternals stopped updating RootKit Revealer a couple of years ago. The only sure way to detect a rootkit is to do an offline compare of installed files and filesystem metadata from a trusted list of known files and their parameters. Obviously, you need to trust the machine you are running the comparison from. In mos...
Detect And Remove Rootkit What is the best (hopefully free or cheap) way to detect and then, if necessary, remove a rootkit found on your machine?
TITLE: Detect And Remove Rootkit QUESTION: What is the best (hopefully free or cheap) way to detect and then, if necessary, remove a rootkit found on your machine? ANSWER: SysInternals stopped updating RootKit Revealer a couple of years ago. The only sure way to detect a rootkit is to do an offline compare of install...
[ "rootkit" ]
2
4
2,092
3
0
2008-09-20T03:51:09.393000
2008-09-20T04:31:43.693000
107,018
108,877
Is there a reference for the SharePoint XSLT extension functions?
There are a couple of different.NET XSLT functions that I see used in the out of the box SharePoint web parts (RSS Viewer and Data View web part).... More...... Where can I find a reference that describes all of the extension functions that SharePoint provides?
I have been wanting more info on ddwrt as well. The most information I have been able to find is from Serge van den Oever that was later turned into the MSDN article referenced in the previous answer. http://weblogs.asp.net/soever/archive/2005/01/03/345535.aspx As he noted in his blog post, this article contains some i...
Is there a reference for the SharePoint XSLT extension functions? There are a couple of different.NET XSLT functions that I see used in the out of the box SharePoint web parts (RSS Viewer and Data View web part).... More...... Where can I find a reference that describes all of the extension functions that SharePoint pr...
TITLE: Is there a reference for the SharePoint XSLT extension functions? QUESTION: There are a couple of different.NET XSLT functions that I see used in the out of the box SharePoint web parts (RSS Viewer and Data View web part).... More...... Where can I find a reference that describes all of the extension functions ...
[ "sharepoint", "xslt", "rss", "web-parts", "dataview" ]
9
4
9,254
4
0
2008-09-20T03:51:43.587000
2008-09-20T17:56:52.230000
107,049
107,663
How to make a simple site render correctly on multiple mobile browsers?
We have a rather simple site (minimal JS) with plain html and CSS. It is a simple mobile interface for our main application. We are running into trouble because we have more than one column and several browsers seem to force single columns. Through some searching I ran into 2 meta tags. With these we have a good 'scale...
I wouldn't bother making a "medium" version for the iPhone etc, iPhone users can just look at your real web page easily enough. Have your full version and a single column version, and you'll reach the largest audience with minimal work. To answer your question though, there's no good way to make the Blackberry do anyth...
How to make a simple site render correctly on multiple mobile browsers? We have a rather simple site (minimal JS) with plain html and CSS. It is a simple mobile interface for our main application. We are running into trouble because we have more than one column and several browsers seem to force single columns. Through...
TITLE: How to make a simple site render correctly on multiple mobile browsers? QUESTION: We have a rather simple site (minimal JS) with plain html and CSS. It is a simple mobile interface for our main application. We are running into trouble because we have more than one column and several browsers seem to force singl...
[ "iphone", "blackberry", "mobile", "ie-mobile" ]
4
3
2,592
3
0
2008-09-20T04:04:34.337000
2008-09-20T08:48:55.730000
107,054
107,149
Consistent outdent of first letter with CSS?
I'm trying to implement an outdent of the first letter of the first paragraph of the body text. Where I'm stuck is in getting consistent spacing between the first letter and the rest of the paragraph. For example, there is a huge difference in spacing between a "W" and an "I" Anyone have any ideas about how to mitigate...
Apply this to p.outdent:first-letter: margin-left: -800px; padding-right: 460px; float: right; This will position the first letter on the right edge of the paragraph, then shove it left it by more or less the width of the paragraph, then move both the letter and all the padding into the float's large negative margin so...
Consistent outdent of first letter with CSS? I'm trying to implement an outdent of the first letter of the first paragraph of the body text. Where I'm stuck is in getting consistent spacing between the first letter and the rest of the paragraph. For example, there is a huge difference in spacing between a "W" and an "I...
TITLE: Consistent outdent of first letter with CSS? QUESTION: I'm trying to implement an outdent of the first letter of the first paragraph of the body text. Where I'm stuck is in getting consistent spacing between the first letter and the rest of the paragraph. For example, there is a huge difference in spacing betwe...
[ "css", "firefox", "safari", "typography" ]
1
5
1,730
2
0
2008-09-20T04:09:30.767000
2008-09-20T04:53:06.093000
107,062
107,065
Commercial uses for grid computing?
I keep hearing from associates about grid computing which, from what I can gather, is highly distributed stuff along the lines of SETI@Home. Is anyone working on these sort of systems for business use? My interest is in figuring out if there's a commercial reason for starting software development in this field.
Grid computing is really only needed if you have a lot of WORK that needs to be done, like folding proteins, otherwise a simple server farm will likely be plenty.
Commercial uses for grid computing? I keep hearing from associates about grid computing which, from what I can gather, is highly distributed stuff along the lines of SETI@Home. Is anyone working on these sort of systems for business use? My interest is in figuring out if there's a commercial reason for starting softwar...
TITLE: Commercial uses for grid computing? QUESTION: I keep hearing from associates about grid computing which, from what I can gather, is highly distributed stuff along the lines of SETI@Home. Is anyone working on these sort of systems for business use? My interest is in figuring out if there's a commercial reason fo...
[ "grid-computing" ]
4
1
1,395
4
0
2008-09-20T04:12:20.090000
2008-09-20T04:13:58.557000
107,073
107,131
An algorithm to generate a game map from individual images
I am designing a game to be played in the browser. Game is a space theme and I need to generate a map of the "Galaxy". The basic idea of the map is here: game map http://www.oglehq.com/map.png The map is a grid, with each grid sector can contain a planet/system and each of these has links to a number of adjacent grids....
There are two very nice browser-based vector / javascript-manipulable graphics packages which, together, are virtually universal: SVG and VML. They generally produce high-quality vector-based images with low bandwidth. SVG is supported by firefox, opera, safari, and chrome - technically only part of the specification i...
An algorithm to generate a game map from individual images I am designing a game to be played in the browser. Game is a space theme and I need to generate a map of the "Galaxy". The basic idea of the map is here: game map http://www.oglehq.com/map.png The map is a grid, with each grid sector can contain a planet/system...
TITLE: An algorithm to generate a game map from individual images QUESTION: I am designing a game to be played in the browser. Game is a space theme and I need to generate a map of the "Galaxy". The basic idea of the map is here: game map http://www.oglehq.com/map.png The map is a grid, with each grid sector can conta...
[ "algorithm" ]
3
3
1,840
7
0
2008-09-20T04:15:30.410000
2008-09-20T04:43:17.490000
107,076
108,229
Does WCF play well with Java?
Which of the WCF Service Protocols work well with Java? Do the TCP Service Bindings work with java remoting (either Corba, EJB, JMS, etc.)? What about the WebServices exposed as Service EndPoints. Have these been tested against the common Java WebServices stack for interoperability?
You will need to use one of the HTTP bindings. The TCP binding requires WCF to be on both sides.
Does WCF play well with Java? Which of the WCF Service Protocols work well with Java? Do the TCP Service Bindings work with java remoting (either Corba, EJB, JMS, etc.)? What about the WebServices exposed as Service EndPoints. Have these been tested against the common Java WebServices stack for interoperability?
TITLE: Does WCF play well with Java? QUESTION: Which of the WCF Service Protocols work well with Java? Do the TCP Service Bindings work with java remoting (either Corba, EJB, JMS, etc.)? What about the WebServices exposed as Service EndPoints. Have these been tested against the common Java WebServices stack for intero...
[ "c#", "java", "wcf" ]
9
8
5,640
3
0
2008-09-20T04:16:21.390000
2008-09-20T14:01:38.020000
107,079
107,104
Does WCF support WS-Eventing?
I know WCF supports many WS-* protocols but WS-Eventing does seem to be listed. I do know that WCF has a pub/sub model, but is it WS-Eventing compliant?
I seem to remember reading about this on CodeProject a while ago. Sorry I can't help more, but this is the article by Roman Kiss.
Does WCF support WS-Eventing? I know WCF supports many WS-* protocols but WS-Eventing does seem to be listed. I do know that WCF has a pub/sub model, but is it WS-Eventing compliant?
TITLE: Does WCF support WS-Eventing? QUESTION: I know WCF supports many WS-* protocols but WS-Eventing does seem to be listed. I do know that WCF has a pub/sub model, but is it WS-Eventing compliant? ANSWER: I seem to remember reading about this on CodeProject a while ago. Sorry I can't help more, but this is the art...
[ "wcf", "ws-eventing" ]
3
3
2,593
3
0
2008-09-20T04:17:31.450000
2008-09-20T04:27:11.910000
107,117
107,789
Why is there no generic synchronized queue in .NET?
I noticed that you can call Queue.Synchronize to get a thread-safe queue object, but the same method isn't available on Queue. Does anyone know why? Seems kind of weird.
Update - in.NET 4, there now is ConcurrentQueue in System.Collections.Concurrent, as documented here http://msdn.microsoft.com/en-us/library/dd267265.aspx. It's interesting to note that its IsSynchronized method (rightly) returns false. ConcurrentQueue is a complete ground up rewrite, creating copies of the queue to en...
Why is there no generic synchronized queue in .NET? I noticed that you can call Queue.Synchronize to get a thread-safe queue object, but the same method isn't available on Queue. Does anyone know why? Seems kind of weird.
TITLE: Why is there no generic synchronized queue in .NET? QUESTION: I noticed that you can call Queue.Synchronize to get a thread-safe queue object, but the same method isn't available on Queue. Does anyone know why? Seems kind of weird. ANSWER: Update - in.NET 4, there now is ConcurrentQueue in System.Collections.C...
[ ".net", "generics", "synchronization", "queue" ]
35
53
13,753
4
0
2008-09-20T04:34:48.553000
2008-09-20T10:02:01.280000
107,123
107,982
How to install Delphi 7 on Vista
I tried to install Delphi 7 on Vista several times and Vista prevented me from doing so by telling me that there are known problems with this application (Delphi 7). Several other people in my company experienced problems with installing D7 on Vista. This lead to the conclusion that we were at risk with our D7 applicat...
Running Delphi 7 under Vista is no problem if you can turn UAC off. With UAC on, you get an error message when starting D7, but it still works, just click ok and go on. Programs compiled with D7 have no problem with Vista. But new features of Vista are supported by Delphi 2007/2009 only. We use D7 on XP and on Vista, b...
How to install Delphi 7 on Vista I tried to install Delphi 7 on Vista several times and Vista prevented me from doing so by telling me that there are known problems with this application (Delphi 7). Several other people in my company experienced problems with installing D7 on Vista. This lead to the conclusion that we ...
TITLE: How to install Delphi 7 on Vista QUESTION: I tried to install Delphi 7 on Vista several times and Vista prevented me from doing so by telling me that there are known problems with this application (Delphi 7). Several other people in my company experienced problems with installing D7 on Vista. This lead to the c...
[ "delphi", "windows-vista" ]
8
6
17,767
10
0
2008-09-20T04:39:48.963000
2008-09-20T11:55:04.207000
107,154
107,306
Can a console app stay alive until it has finished its work?
I've just read up on Thread.IsBackground and if I understand it correctly, when it's set to false the Thread is a foreground thread which means it should stay alive until it has finished working even though the app have been exited out. Now I tested this with a winform app and it works as expected but when used with a ...
The Thread.IsBackground property only marks if the thread should block the process from exiting. It doesn't perform any magic to keep the thread alive until some sort of explicit exit. To quote the Thread.IsBackground Property MSDN (emphasis mine): A thread is either a background thread or a foreground thread. Backgrou...
Can a console app stay alive until it has finished its work? I've just read up on Thread.IsBackground and if I understand it correctly, when it's set to false the Thread is a foreground thread which means it should stay alive until it has finished working even though the app have been exited out. Now I tested this with...
TITLE: Can a console app stay alive until it has finished its work? QUESTION: I've just read up on Thread.IsBackground and if I understand it correctly, when it's set to false the Thread is a foreground thread which means it should stay alive until it has finished working even though the app have been exited out. Now ...
[ ".net", "multithreading" ]
2
2
610
3
0
2008-09-20T04:55:00.830000
2008-09-20T05:51:41.177000
107,160
108,086
How does one add a custom build step to an automake-based project in KDevelop?
I recently started work on a personal coding project using C++ and KDevelop. Although I started out by just hacking around, I figure it'll be better in the long run if I set up a proper unit test suite before going too much further. I've created a seperate test-runner executable as a sub project, and the tests I've add...
Although you could manipulate the default `make` target to run your tests, it is generally not recommended, because every invocation of make would run all the tests. You should use the "check" target instead, which is an accepted quasi-standard among software packages. By doing that, the tests are only started when you...
How does one add a custom build step to an automake-based project in KDevelop? I recently started work on a personal coding project using C++ and KDevelop. Although I started out by just hacking around, I figure it'll be better in the long run if I set up a proper unit test suite before going too much further. I've cre...
TITLE: How does one add a custom build step to an automake-based project in KDevelop? QUESTION: I recently started work on a personal coding project using C++ and KDevelop. Although I started out by just hacking around, I figure it'll be better in the long run if I set up a proper unit test suite before going too much...
[ "unit-testing", "automake", "kdevelop" ]
2
3
2,538
2
0
2008-09-20T04:57:02.213000
2008-09-20T13:00:57.777000
107,165
107,189
Big-O for Eight Year Olds?
I'm asking more about what this means to my code. I understand the concepts mathematically, I just have a hard time wrapping my head around what they mean conceptually. For example, if one were to perform an O(1) operation on a data structure, I understand that the number of operations it has to perform won't grow beca...
One way of thinking about it is this: O(N^2) means for every element, you're doing something with every other element, such as comparing them. Bubble sort is an example of this. O(N log N) means for every element, you're doing something that only needs to look at log N of the elements. This is usually because you know ...
Big-O for Eight Year Olds? I'm asking more about what this means to my code. I understand the concepts mathematically, I just have a hard time wrapping my head around what they mean conceptually. For example, if one were to perform an O(1) operation on a data structure, I understand that the number of operations it has...
TITLE: Big-O for Eight Year Olds? QUESTION: I'm asking more about what this means to my code. I understand the concepts mathematically, I just have a hard time wrapping my head around what they mean conceptually. For example, if one were to perform an O(1) operation on a data structure, I understand that the number of...
[ "algorithm", "theory", "big-o", "metrics" ]
321
301
43,179
25
0
2008-09-20T04:59:59.413000
2008-09-20T05:08:03
107,173
107,228
Building Ruby on Windows XP
Has anyone out there got a good set of instructions for building/compiling Ruby from source of windows XP?
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/184380 I normally get a binary installable for windows.. much faster if you just need Ruby installed. But you may be modifying ruby source.. anyways.. Update: I ended up compiling Ruby from source today... here is what worked for me http://madcoderspeak.blogsp...
Building Ruby on Windows XP Has anyone out there got a good set of instructions for building/compiling Ruby from source of windows XP?
TITLE: Building Ruby on Windows XP QUESTION: Has anyone out there got a good set of instructions for building/compiling Ruby from source of windows XP? ANSWER: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/184380 I normally get a binary installable for windows.. much faster if you just need Ruby install...
[ "ruby-on-rails", "ruby", "development-environment" ]
4
1
2,265
3
0
2008-09-20T05:03:45.553000
2008-09-20T05:24:03.227000
107,179
107,192
Can you debug a .NET app with ONLY the source code of one file?
I want to debug an application in Visual Studio but I ONLY have the source code for 1 class. I only need to step through a single function in that file, but I don't understand what I need to do it. I think the steps are normally something like this: Open a file in VS Load in the "symbols" (.PDB file) Attach to the runn...
You need *.pdb files (step 2 from your post) These files contain mapping between source code and compiled assembly. So your step are correct. If your source file has differences with original file, set check mark "Allow the source code to be different from the original version" in BP's properties dialog. Breakpoints an...
Can you debug a .NET app with ONLY the source code of one file? I want to debug an application in Visual Studio but I ONLY have the source code for 1 class. I only need to step through a single function in that file, but I don't understand what I need to do it. I think the steps are normally something like this: Open a...
TITLE: Can you debug a .NET app with ONLY the source code of one file? QUESTION: I want to debug an application in Visual Studio but I ONLY have the source code for 1 class. I only need to step through a single function in that file, but I don't understand what I need to do it. I think the steps are normally something...
[ ".net", "visual-studio", "debugging", "symbols" ]
1
7
901
4
0
2008-09-20T05:06:11.507000
2008-09-20T05:09:09.487000
107,196
107,448
Why is a different dll produced after a clean build, with no code changes?
When I do a clean build my C# project, the produced dll is different then the previously built one (which I saved separately). No code changes were made, just clean and rebuild. Diff shows some bytes in the DLL have changes -- few near the beginning and few near the end, but I can't figure out what these represent. Doe...
My best guess would be the changed bytes you're seeing are the internally-used metadata columns that are automatically generated at build-time. Some of the Ecma-335 Partition II (CLI Specification Metadata Definition) columns that can change per-build, even if the source code doesn't change at all: Module.Mvid: A build...
Why is a different dll produced after a clean build, with no code changes? When I do a clean build my C# project, the produced dll is different then the previously built one (which I saved separately). No code changes were made, just clean and rebuild. Diff shows some bytes in the DLL have changes -- few near the begin...
TITLE: Why is a different dll produced after a clean build, with no code changes? QUESTION: When I do a clean build my C# project, the produced dll is different then the previously built one (which I saved separately). No code changes were made, just clean and rebuild. Diff shows some bytes in the DLL have changes -- ...
[ "c#", ".net", "visual-studio", "build-process" ]
18
14
4,710
3
0
2008-09-20T05:09:49.220000
2008-09-20T06:52:17.913000
107,216
107,244
How to load a specific version of an assembly
To complete some testing I need to load the 64 bit version of an assembly even though I am running a 32 bit version of Windows. Is this possible?
I'm not sure why you would want to do this, but I suppose you could. If you don't do anything to tell it otherwise, the CLR will load the version of the assembly that is specific to the CPU you are using. That's usually what you want. But I have had an occasion where I needed to load the neutral IL version of an assemb...
How to load a specific version of an assembly To complete some testing I need to load the 64 bit version of an assembly even though I am running a 32 bit version of Windows. Is this possible?
TITLE: How to load a specific version of an assembly QUESTION: To complete some testing I need to load the 64 bit version of an assembly even though I am running a 32 bit version of Windows. Is this possible? ANSWER: I'm not sure why you would want to do this, but I suppose you could. If you don't do anything to tell...
[ "c#", ".net", "assemblies", "64-bit" ]
4
4
1,981
4
0
2008-09-20T05:19:01.177000
2008-09-20T05:31:30.180000
107,243
107,287
Are units of measurement unique to F#?
I was reading Andrew Kennedy's blog post series on units of measurement in F# and it makes a lot of sense in a lot of cases. Are there any other languages that have such a system? Edit: To be more clear, I mean the flexible units of measurement system where you can define your own arbitrarily.
Does TI-89 BASIC count? Enter 54_kg * (_c^2) and it will give you an answer in joules. Other than that, I can't recall any languages that have it built in, but any language with decent OO should make it simple to roll your own. Which means someone else probably already did. Google confirms. For example, here's one in P...
Are units of measurement unique to F#? I was reading Andrew Kennedy's blog post series on units of measurement in F# and it makes a lot of sense in a lot of cases. Are there any other languages that have such a system? Edit: To be more clear, I mean the flexible units of measurement system where you can define your own...
TITLE: Are units of measurement unique to F#? QUESTION: I was reading Andrew Kennedy's blog post series on units of measurement in F# and it makes a lot of sense in a lot of cases. Are there any other languages that have such a system? Edit: To be more clear, I mean the flexible units of measurement system where you c...
[ "programming-languages", "f#", "functional-programming" ]
21
11
3,644
11
0
2008-09-20T05:31:24.143000
2008-09-20T05:45:34.203000
107,254
111,352
How to repaint a Word 2003 menubar
I have a Word 2003.dot template that changes its menu based on the condition of the active document. The DocumentChange, DocumentOpen and NewDocument events of Word.Application trigger setting the.Visible and.Enabled properties of CommandBarButton controls. On switching active documents, controls exposed by changing th...
You are playing with the visible & enabled properties of the controls. But did you try to hide/unhide the whole commandbar to refresh it? application.CommandBars.ActiveMenuBar.visible = false application.CommandBars.ActiveMenuBar.visible = true
How to repaint a Word 2003 menubar I have a Word 2003.dot template that changes its menu based on the condition of the active document. The DocumentChange, DocumentOpen and NewDocument events of Word.Application trigger setting the.Visible and.Enabled properties of CommandBarButton controls. On switching active documen...
TITLE: How to repaint a Word 2003 menubar QUESTION: I have a Word 2003.dot template that changes its menu based on the condition of the active document. The DocumentChange, DocumentOpen and NewDocument events of Word.Application trigger setting the.Visible and.Enabled properties of CommandBarButton controls. On switch...
[ "vba", "ms-word" ]
1
1
404
1
0
2008-09-20T05:35:23.650000
2008-09-21T16:24:58.557000
107,264
107,281
How often to commit changes to source control?
How often should I commit changes to source control? After every small feature, or only for large features? I'm working on a project and have a long-term feature to implement. Currently, I'm committing after every chunk of work, i.e. every sub-feature implemented and bug fixed. I even commit after I've added a new chun...
Anytime I complete a "full thought" of code that compiles and runs I check-in. This usually ends up being anywhere between 15-60 minutes. Sometimes it could be longer, but I always try to checkin if I have a lot of code changes that I wouldn't want to rewrite in case of failure. I also usually make sure my code compile...
How often to commit changes to source control? How often should I commit changes to source control? After every small feature, or only for large features? I'm working on a project and have a long-term feature to implement. Currently, I'm committing after every chunk of work, i.e. every sub-feature implemented and bug f...
TITLE: How often to commit changes to source control? QUESTION: How often should I commit changes to source control? After every small feature, or only for large features? I'm working on a project and have a long-term feature to implement. Currently, I'm committing after every chunk of work, i.e. every sub-feature imp...
[ "version-control" ]
226
219
41,448
26
0
2008-09-20T05:37:10.777000
2008-09-20T05:43:06.347000
107,288
108,013
Is QuickSilver dead?
After having read that QuickSilver was no longer supported by BlackTree and has since gone open source, I noticed more and more people switching to/suggesting other app launchers i.e. Buttler and LaunchBar. Is QuickSilver still relevant? Has anyone experienced any instability since it's gone open source?
Quicksilver is still alive and well. There are at least a couple of endeavours to keep it going, up to date and restructure and clean up the code base. Check out the code from Google Code. As for launching apps, not even Spotlight comes close to how fast it is in Quicksilver. Of course the real joy of Quicksilver is pa...
Is QuickSilver dead? After having read that QuickSilver was no longer supported by BlackTree and has since gone open source, I noticed more and more people switching to/suggesting other app launchers i.e. Buttler and LaunchBar. Is QuickSilver still relevant? Has anyone experienced any instability since it's gone open s...
TITLE: Is QuickSilver dead? QUESTION: After having read that QuickSilver was no longer supported by BlackTree and has since gone open source, I noticed more and more people switching to/suggesting other app launchers i.e. Buttler and LaunchBar. Is QuickSilver still relevant? Has anyone experienced any instability sinc...
[ "macos", "quicksilver", "app-launcher" ]
11
12
4,303
13
0
2008-09-20T05:45:54.187000
2008-09-20T12:16:22.797000
107,292
107,525
What is the optimal way to organize shared .net assemblies in SVN?
We are starting a new SOA project with a lot of shared.net assemblies. The code for these assemblies will be stored in SVN. In development phase, we would like to be able to code these assemblies as an entire solution with as little SVN 'friction' as possible. When the project enters more of a maintenance mode, the ass...
What we did at our company was to set up a tools repository, and then a project repository. The tools repository is a Subversion repository, organized as follows: /svn/tools/ vendor1/ too11/ 1.0/ 1.1/ latest = a copy of vendor1/tool1/1.1 tool2/ 1.0/ 1.5/ latest = a copy of vendor1/tool2/1.5 vendor2/ foo/ 1.0.0/ 1.1.0/ ...
What is the optimal way to organize shared .net assemblies in SVN? We are starting a new SOA project with a lot of shared.net assemblies. The code for these assemblies will be stored in SVN. In development phase, we would like to be able to code these assemblies as an entire solution with as little SVN 'friction' as po...
TITLE: What is the optimal way to organize shared .net assemblies in SVN? QUESTION: We are starting a new SOA project with a lot of shared.net assemblies. The code for these assemblies will be stored in SVN. In development phase, we would like to be able to code these assemblies as an entire solution with as little SV...
[ ".net", "svn", "version-control" ]
4
6
1,259
2
0
2008-09-20T05:46:24.297000
2008-09-20T07:34:18.733000
107,294
107,301
Change pointer to an array to get a specific array element
I understand the overall meaning of pointers and references(or at least I think i do), I also understand that when I use new I am dynamically allocating memory. My question is the following: If i were to use cout << &p, it would display the "virtual memory location" of p. Is there a way in which I could manipulate this...
Sure, you can manipulate the pointer to access the different elements in the array, but you will need to manipulate the content of the pointer (i.e. the address of what p is pointing to), rather than the address of the pointer itself. int *p = new int[3]; p[0] = 13; p[1] = 54; p[2] = 42; cout << *p << ' ' << *(p+1) <<...
Change pointer to an array to get a specific array element I understand the overall meaning of pointers and references(or at least I think i do), I also understand that when I use new I am dynamically allocating memory. My question is the following: If i were to use cout << &p, it would display the "virtual memory loca...
TITLE: Change pointer to an array to get a specific array element QUESTION: I understand the overall meaning of pointers and references(or at least I think i do), I also understand that when I use new I am dynamically allocating memory. My question is the following: If i were to use cout << &p, it would display the "v...
[ "c++", "pointers" ]
6
8
975
5
0
2008-09-20T05:46:34.543000
2008-09-20T05:49:02.930000
107,314
219,506
Any suggestions for testing extjs code in a browser, preferably with selenium?
We've been using selenium with great success to handle high-level website testing (in addition to extensive python doctests at a module level). However now we're using extjs for a lot of pages and its proving difficult to incorporate Selenium tests for the complex components like grids. Has anyone had success writing a...
The biggest hurdle in testing ExtJS with Selenium is that ExtJS doesn't render standard HTML elements and the Selenium IDE will naively (and rightfully) generate commands targeted at elements that just act as decor -- superfluous elements that help ExtJS with the whole desktop-look-and-feel. Here are a few tips and tri...
Any suggestions for testing extjs code in a browser, preferably with selenium? We've been using selenium with great success to handle high-level website testing (in addition to extensive python doctests at a module level). However now we're using extjs for a lot of pages and its proving difficult to incorporate Seleniu...
TITLE: Any suggestions for testing extjs code in a browser, preferably with selenium? QUESTION: We've been using selenium with great success to handle high-level website testing (in addition to extensive python doctests at a module level). However now we're using extjs for a lot of pages and its proving difficult to i...
[ "unit-testing", "extjs", "selenium", "web-testing" ]
92
174
47,983
11
0
2008-09-20T05:53:50.377000
2008-10-20T19:01:39.017000
107,329
107,352
I need populate a repeater with pseudo-related data
Before I do this I figured I would ask if it was the best way. Each "Vendor" object has a "Bucket" object. In my repeater I need to display some properties from Vendor and some from Bucket, also some images populated by FileSystem that are linked to the vendor. I figured the best way to do this is bind the repeater wit...
If the Vendor object can only hold a single Bucket object it may be appropriate to bind it all in a single, top-level repeater. You can access the Bucket through simple data-binding all at the top level without overriding ItemDataBound. Because you're most likely binding the "Vendor", you have access to it's members in...
I need populate a repeater with pseudo-related data Before I do this I figured I would ask if it was the best way. Each "Vendor" object has a "Bucket" object. In my repeater I need to display some properties from Vendor and some from Bucket, also some images populated by FileSystem that are linked to the vendor. I figu...
TITLE: I need populate a repeater with pseudo-related data QUESTION: Before I do this I figured I would ask if it was the best way. Each "Vendor" object has a "Bucket" object. In my repeater I need to display some properties from Vendor and some from Bucket, also some images populated by FileSystem that are linked to ...
[ "c#", "asp.net", ".net-3.5", "controls", "repeater" ]
1
2
542
2
0
2008-09-20T05:59:52.657000
2008-09-20T06:12:02.143000
107,382
107,540
Regex index in matching string where the match failed
I am wondering if it is possible to extract the index position in a given string where a Regex failed when trying to match it? For example, if my regex was "abc" and I tried to match that with "abd" the match would fail at index 2. Edit for clarification. The reason I need this is to allow me to simplify the parsing co...
I agree with Colin Younger, I don't think it is possible with the existing Regex class. However, I think it is doable if you are willing to sweat a little: Get the Regex class source code (e.g. http://www.codeplex.com/NetMassDownloader to download the.Net source). Change the code to have a readonly property with the fa...
Regex index in matching string where the match failed I am wondering if it is possible to extract the index position in a given string where a Regex failed when trying to match it? For example, if my regex was "abc" and I tried to match that with "abd" the match would fail at index 2. Edit for clarification. The reason...
TITLE: Regex index in matching string where the match failed QUESTION: I am wondering if it is possible to extract the index position in a given string where a Regex failed when trying to match it? For example, if my regex was "abc" and I tried to match that with "abd" the match would fail at index 2. Edit for clarifi...
[ "c#", "regex" ]
7
4
4,172
5
0
2008-09-20T06:30:04.580000
2008-09-20T07:44:04.760000
107,390
107,450
What's the difference between a POST and a PUT HTTP REQUEST?
They both seem to be sending data to the server inside the body, so what makes them different?
HTTP PUT: PUT puts a file or resource at a specific URI, and exactly at that URI. If there's already a file or resource at that URI, PUT replaces that file or resource. If there is no file or resource there, PUT creates one. PUT is idempotent, but paradoxically PUT responses are not cacheable. HTTP 1.1 RFC location for...
What's the difference between a POST and a PUT HTTP REQUEST? They both seem to be sending data to the server inside the body, so what makes them different?
TITLE: What's the difference between a POST and a PUT HTTP REQUEST? QUESTION: They both seem to be sending data to the server inside the body, so what makes them different? ANSWER: HTTP PUT: PUT puts a file or resource at a specific URI, and exactly at that URI. If there's already a file or resource at that URI, PUT ...
[ "http", "post", "put" ]
1,038
1,011
921,269
19
0
2008-09-20T06:34:41.417000
2008-09-20T06:54:01.293000
107,405
107,427
How do you send a HEAD HTTP request in Python 2?
What I'm trying to do here is get the headers of a given URL so I can determine the MIME type. I want to be able to see if http://somedomain/foo/ will return an HTML document or a JPEG image for example. Thus, I need to figure out how to send a HEAD request so that I can read the MIME type without having to download th...
edit: This answer works, but nowadays you should just use the requests library as mentioned by other answers below. Use httplib. >>> import httplib >>> conn = httplib.HTTPConnection("www.google.com") >>> conn.request("HEAD", "/index.html") >>> res = conn.getresponse() >>> print res.status, res.reason 200 OK >>> print r...
How do you send a HEAD HTTP request in Python 2? What I'm trying to do here is get the headers of a given URL so I can determine the MIME type. I want to be able to see if http://somedomain/foo/ will return an HTML document or a JPEG image for example. Thus, I need to figure out how to send a HEAD request so that I can...
TITLE: How do you send a HEAD HTTP request in Python 2? QUESTION: What I'm trying to do here is get the headers of a given URL so I can determine the MIME type. I want to be able to see if http://somedomain/foo/ will return an HTML document or a JPEG image for example. Thus, I need to figure out how to send a HEAD req...
[ "python", "python-2.7", "http", "http-headers", "content-type" ]
118
105
75,942
11
0
2008-09-20T06:38:38.710000
2008-09-20T06:45:45.010000
107,413
107,434
Best way to translate mouse drag motion into 3d rotation of an object
I have a 3d object that I wish to be able to rotate around in 3d. The easiest way is to directly translate X and Y mouse motion to rotation about the Y and X axes, but if there is some rotation along both axes, the way the model rotates becomes highly counterintuitive (i.e. if you flip the object 180 degrees about one ...
Create an accumulator matrix and initialize it with the identity. Each frame, apply that to your modelview/world matrix state before drawing the object. Upon mouse motion, construct a rotation matrix about the X axis with some sensitivity_constant * delta_x. Construct another rotation matrix about the Y axis for the ot...
Best way to translate mouse drag motion into 3d rotation of an object I have a 3d object that I wish to be able to rotate around in 3d. The easiest way is to directly translate X and Y mouse motion to rotation about the Y and X axes, but if there is some rotation along both axes, the way the model rotates becomes highl...
TITLE: Best way to translate mouse drag motion into 3d rotation of an object QUESTION: I have a 3d object that I wish to be able to rotate around in 3d. The easiest way is to directly translate X and Y mouse motion to rotation about the Y and X axes, but if there is some rotation along both axes, the way the model rot...
[ "3d" ]
18
4
16,831
3
0
2008-09-20T06:40:45.740000
2008-09-20T06:48:11.697000
107,414
573,419
What's your best trick to break out of an unbalanced quote condition in BASE SAS?
As a base SAS programmer, you know the drill: You submit your SAS code, which contains an unbalanced quote, so now you've got not only and unclosed quote, but also unclosed comments, macro function definitions, and a missing run; or quit; statement. What's your best trick for not having those unbalanced quotes bother y...
enterprise guide 3 used to put the following line at the top of its automatically generated code: *';*";*/;run; however, the only way to really "reset" from all kinds of something unbalanced problems is to quit the sas session, and balance whatever is unbalanced before re-submitting the code. Using this kind of quick (...
What's your best trick to break out of an unbalanced quote condition in BASE SAS? As a base SAS programmer, you know the drill: You submit your SAS code, which contains an unbalanced quote, so now you've got not only and unclosed quote, but also unclosed comments, macro function definitions, and a missing run; or quit;...
TITLE: What's your best trick to break out of an unbalanced quote condition in BASE SAS? QUESTION: As a base SAS programmer, you know the drill: You submit your SAS code, which contains an unbalanced quote, so now you've got not only and unclosed quote, but also unclosed comments, macro function definitions, and a mis...
[ "sas", "radix", "quotes" ]
12
5
12,331
10
0
2008-09-20T06:41:08.297000
2009-02-21T17:21:35.067000
107,456
107,661
What's the best way to do a mapping application for the iPhone
So I'm looking at writing an iPhone application that shows things on a map. What frameworks/methodologies are out there for doing this? Searching around on Google, I could only find this one: http://code.google.com/p/iphone-google-maps-component/ Which according to the issues list is slow, and stops working after a whi...
I'm pretty sure your only options for now are: Call openURL: to switch to the Maps app Use the Google Maps component you linked to Roll your own thing Wait for Apple to expose a "MapKit" framework
What's the best way to do a mapping application for the iPhone So I'm looking at writing an iPhone application that shows things on a map. What frameworks/methodologies are out there for doing this? Searching around on Google, I could only find this one: http://code.google.com/p/iphone-google-maps-component/ Which acco...
TITLE: What's the best way to do a mapping application for the iPhone QUESTION: So I'm looking at writing an iPhone application that shows things on a map. What frameworks/methodologies are out there for doing this? Searching around on Google, I could only find this one: http://code.google.com/p/iphone-google-maps-com...
[ "iphone", "cocoa-touch", "maps" ]
6
4
1,306
5
0
2008-09-20T06:57:27.213000
2008-09-20T08:48:17.167000
107,464
108,773
Is JavaScript object-oriented?
There have been some questions about whether or not JavaScript is an object-oriented language. Even a statement, "just because a language has objects doesn't make it OO." Is JavaScript an object-oriented language?
IMO (and it is only an opinion) the key characteristic of an object orientated language would be that it would support polymorphism. Pretty much all dynamic languages do that. The next characteristic would be encapsulation and that is pretty easy to do in Javascript also. However in the minds of many it is inheritance ...
Is JavaScript object-oriented? There have been some questions about whether or not JavaScript is an object-oriented language. Even a statement, "just because a language has objects doesn't make it OO." Is JavaScript an object-oriented language?
TITLE: Is JavaScript object-oriented? QUESTION: There have been some questions about whether or not JavaScript is an object-oriented language. Even a statement, "just because a language has objects doesn't make it OO." Is JavaScript an object-oriented language? ANSWER: IMO (and it is only an opinion) the key characte...
[ "javascript", "oop" ]
55
53
230,628
27
0
2008-09-20T07:03:04.533000
2008-09-20T17:14:04.563000
107,531
108,935
XML based website - how to create?
I would like to create an XML-based website. I want to use XML files as datasources since it is a kind of online directory site. Can someone please give me a starting point? Are there any good online resources that I can refer to? I am pretty comfortable with ASP and JavaScript.
If you cannot or don't wish to store your data in XHTML format, then XSLT is definitely the way you want to go. By its very definition, it is a transformation language designed to transform data from one format to another. Because this is it's focus, it provides power, speed and flexibility you won't find in many other...
XML based website - how to create? I would like to create an XML-based website. I want to use XML files as datasources since it is a kind of online directory site. Can someone please give me a starting point? Are there any good online resources that I can refer to? I am pretty comfortable with ASP and JavaScript.
TITLE: XML based website - how to create? QUESTION: I would like to create an XML-based website. I want to use XML files as datasources since it is a kind of online directory site. Can someone please give me a starting point? Are there any good online resources that I can refer to? I am pretty comfortable with ASP and...
[ "javascript", "xml", "asp-classic" ]
6
5
14,327
9
0
2008-09-20T07:38:32.917000
2008-09-20T18:33:11.410000
107,546
107,662
How would you implement auto-capitalization in JavaScript/HTML
I need to implement auto-capitalization inside of a Telerik RadEditor control on an ASPX page as a user types. This can be an IE specific solution (IE6+). I currently capture every keystroke (down/up) as the user types to support a separate feature called "macros" that are essentially short keywords that expand into fo...
I'm not sure if this is what you're trying to do, but here is a function ( reference ) to convert a given string to title case: function toTitleCase(str) { return str.replace(/([\w&`'‘’"“.@:\/\{\(\[<>_]+-? *)/g, function(match, p1, index, title){ // ' fix syntax highlighting if (index > 0 && title.charAt(index - ...
How would you implement auto-capitalization in JavaScript/HTML I need to implement auto-capitalization inside of a Telerik RadEditor control on an ASPX page as a user types. This can be an IE specific solution (IE6+). I currently capture every keystroke (down/up) as the user types to support a separate feature called "...
TITLE: How would you implement auto-capitalization in JavaScript/HTML QUESTION: I need to implement auto-capitalization inside of a Telerik RadEditor control on an ASPX page as a user types. This can be an IE specific solution (IE6+). I currently capture every keystroke (down/up) as the user types to support a separat...
[ "javascript", "formatting", "text-editor" ]
2
4
4,455
4
0
2008-09-20T07:45:15.680000
2008-09-20T08:48:33.250000
107,549
107,564
GCC compiling a dll with __stdcall
When we compile a dll using __stdcall inside visual studio 2008 the compiled function names inside the dll are. FunctionName Though when we compile the same dll using GCC using wx-dev-cpp GCC appends the number of paramers the function has, so the name of the function using Dependency walker looks like. FunctionName@nu...
__stdcall decorates the function name by adding an underscore to the start, and the number of bytes of parameters to the end (separated by @). So, a function: void __stdcall Foo(int a, int b);...would become _Foo@8. If you list the function name (undecorated) in the EXPORTS section of your.DEF file, it is exported unde...
GCC compiling a dll with __stdcall When we compile a dll using __stdcall inside visual studio 2008 the compiled function names inside the dll are. FunctionName Though when we compile the same dll using GCC using wx-dev-cpp GCC appends the number of paramers the function has, so the name of the function using Dependency...
TITLE: GCC compiling a dll with __stdcall QUESTION: When we compile a dll using __stdcall inside visual studio 2008 the compiled function names inside the dll are. FunctionName Though when we compile the same dll using GCC using wx-dev-cpp GCC appends the number of paramers the function has, so the name of the functio...
[ "c++", "gcc", "name-decoration" ]
9
7
11,378
3
0
2008-09-20T07:46:05.490000
2008-09-20T07:53:07.750000
107,552
107,659
Whats the best way to get started with server virtualization?
We recently bought a new rack and set of servers for it, we want to be able to redeploy these boxes as build servers, QA regression test servers, lab re-correlation servers, simulation servers, etc. We have played a bit with VMWare, VirtualPC, VirtualBox etc, creating a virtual build server, but we came across a lot of...
The problem you're running into is the machine SID must be unique for each machine in a domain. Of course by copying an image you now break that unique constraint. I'd suggest that you read the documentation for Sysprep in the reskit and Vista System Image Manager - your friends for XP/Win2k3 and Vista/Win2k8 respectiv...
Whats the best way to get started with server virtualization? We recently bought a new rack and set of servers for it, we want to be able to redeploy these boxes as build servers, QA regression test servers, lab re-correlation servers, simulation servers, etc. We have played a bit with VMWare, VirtualPC, VirtualBox etc...
TITLE: Whats the best way to get started with server virtualization? QUESTION: We recently bought a new rack and set of servers for it, we want to be able to redeploy these boxes as build servers, QA regression test servers, lab re-correlation servers, simulation servers, etc. We have played a bit with VMWare, Virtual...
[ "vmware", "virtualization", "virtualbox", "virtual-pc" ]
2
4
706
2
0
2008-09-20T07:46:55.037000
2008-09-20T08:47:54.687000
107,566
107,935
Where should you enable SSL?
My last couple of projects have involved websites that sell a product/service and require a 'checkout' process in which users put in their credit card information and such. Obviously we got SSL certificates for the security of it plus giving peace of mind to the customers. I am, however, a little clueless as to the sub...
I personally go with "SSL from go to woe". If your user never enters a credit card number, sure, no SSL. But there's an inherent possible security leak from the cookie replay. User visits site and gets assigned a cookie. User browses site and adds data to cart ( using cookie ) User proceeds to payment page using cookie...
Where should you enable SSL? My last couple of projects have involved websites that sell a product/service and require a 'checkout' process in which users put in their credit card information and such. Obviously we got SSL certificates for the security of it plus giving peace of mind to the customers. I am, however, a ...
TITLE: Where should you enable SSL? QUESTION: My last couple of projects have involved websites that sell a product/service and require a 'checkout' process in which users put in their credit card information and such. Obviously we got SSL certificates for the security of it plus giving peace of mind to the customers....
[ "performance", "security", "ssl", "https" ]
19
14
3,132
10
0
2008-09-20T07:53:19.217000
2008-09-20T11:25:14.997000
107,585
109,589
Problem calling stored procedure from another stored procedure via classic ASP
We have a classic ASP application that simply works and we have been loathe to modify the code lest we invoke the wrath of some long-dead Greek gods. We recently had the requirement to add a feature to an application. The feature implementation is really just a database operation requires minimal change to the UI. I ch...
My first reaction is that this might not be an issue of calling cross-server, but one of calling a second proc from a first, and that this might be what's acting differently in the two different environments. My first question is this: what happens if you remove the cross-server aspect from the equation? If you could s...
Problem calling stored procedure from another stored procedure via classic ASP We have a classic ASP application that simply works and we have been loathe to modify the code lest we invoke the wrath of some long-dead Greek gods. We recently had the requirement to add a feature to an application. The feature implementat...
TITLE: Problem calling stored procedure from another stored procedure via classic ASP QUESTION: We have a classic ASP application that simply works and we have been loathe to modify the code lest we invoke the wrath of some long-dead Greek gods. We recently had the requirement to add a feature to an application. The f...
[ "sql-server", "stored-procedures", "asp-classic", "vbscript", "cross-server" ]
3
0
4,153
9
0
2008-09-20T08:03:38.130000
2008-09-20T22:14:21.440000
107,591
107,859
Unit testing MFC UI applications?
How do you unit test a large MFC UI application? We have a few large MFC applications that have been in development for many years, we use some standard automated QA tools to run basic scripts to check fundamentals, file open etc. These are run by the QA group post the daily build. But we would like to introduce proced...
It depends on how the App is structured. If logic and GUI code is separated (MVC) then testing the logic is easy. Take a look at Michael Feathers "Humble Dialog Box" (PDF). EDIT: If you think about it: You should very carefully refactor if the App is not structured that way. There is no other technique for testing the ...
Unit testing MFC UI applications? How do you unit test a large MFC UI application? We have a few large MFC applications that have been in development for many years, we use some standard automated QA tools to run basic scripts to check fundamentals, file open etc. These are run by the QA group post the daily build. But...
TITLE: Unit testing MFC UI applications? QUESTION: How do you unit test a large MFC UI application? We have a few large MFC applications that have been in development for many years, we use some standard automated QA tools to run basic scripts to check fundamentals, file open etc. These are run by the QA group post th...
[ "c++", "unit-testing", "user-interface", "mfc", "tdd" ]
23
14
13,605
7
0
2008-09-20T08:06:54.660000
2008-09-20T10:40:33.993000
107,598
134,203
Point Sequence Interpolation
Given an arbitrary sequence of points in space, how would you produce a smooth continuous interpolation between them? 2D and 3D solutions are welcome. Solutions that produce a list of points at arbitrary granularity and solutions that produce control points for bezier curves are also appreciated. Also, it would be cool...
The Catmull-Rom spline is guaranteed to pass through all the control points. I find this to be handier than trying to adjust intermediate control points for other types of splines. This PDF by Christopher Twigg has a nice brief introduction to the mathematics of the spline. The best summary sentence is: Catmull-Rom spl...
Point Sequence Interpolation Given an arbitrary sequence of points in space, how would you produce a smooth continuous interpolation between them? 2D and 3D solutions are welcome. Solutions that produce a list of points at arbitrary granularity and solutions that produce control points for bezier curves are also apprec...
TITLE: Point Sequence Interpolation QUESTION: Given an arbitrary sequence of points in space, how would you produce a smooth continuous interpolation between them? 2D and 3D solutions are welcome. Solutions that produce a list of points at arbitrary granularity and solutions that produce control points for bezier curv...
[ "math", "graphics", "vector-graphics", "bezier", "splines" ]
10
9
3,529
9
0
2008-09-20T08:13:44.253000
2008-09-25T16:00:42.637000
107,603
107,626
Is there still any reason to learn AWK?
I am constantly learning new tools, even old fashioned ones, because I like to use the right solution for the problem. Nevertheless, I wonder if there is still any reason to learn some of them. awk for example is interesting to me, but for simple text processing, I can use grep, cut, sed, etc. while for complex ones, I...
I think it depends on the environment you find yourself in. If you are a *nix person, then knowing awk is a Good Thing. The only other scripting environment that can be found on virtually every *nix is sh. So while grep, sed, etc can surely replace awk on a modern mainstream linux distro, when you move to more exotic s...
Is there still any reason to learn AWK? I am constantly learning new tools, even old fashioned ones, because I like to use the right solution for the problem. Nevertheless, I wonder if there is still any reason to learn some of them. awk for example is interesting to me, but for simple text processing, I can use grep, ...
TITLE: Is there still any reason to learn AWK? QUESTION: I am constantly learning new tools, even old fashioned ones, because I like to use the right solution for the problem. Nevertheless, I wonder if there is still any reason to learn some of them. awk for example is interesting to me, but for simple text processing...
[ "awk", "text-processing" ]
126
105
37,755
26
0
2008-09-20T08:20:18.200000
2008-09-20T08:31:51.387000
107,611
110,705
How can i temporarily load a font?
I need to load some fonts temporarily in my program. Preferably from a dll resource file.
And here a Delphi version: procedure LoadFontFromDll(const DllName, FontName: PWideChar); var DllHandle: HMODULE; ResHandle: HRSRC; ResSize, NbFontAdded: Cardinal; ResAddr: HGLOBAL; begin DllHandle:= LoadLibrary(DllName); if DllHandle = 0 then RaiseLastOSError; ResHandle:= FindResource(DllHandle, FontName, RT_FONT); if...
How can i temporarily load a font? I need to load some fonts temporarily in my program. Preferably from a dll resource file.
TITLE: How can i temporarily load a font? QUESTION: I need to load some fonts temporarily in my program. Preferably from a dll resource file. ANSWER: And here a Delphi version: procedure LoadFontFromDll(const DllName, FontName: PWideChar); var DllHandle: HMODULE; ResHandle: HRSRC; ResSize, NbFontAdded: Cardinal; ResA...
[ "delphi", "winapi" ]
10
10
6,100
3
0
2008-09-20T08:25:43.273000
2008-09-21T10:14:19.557000
107,616
108,032
XML-RPC: best way to handle 64-bit values?
So the official XML-RPC standard doesn't support 64-bit values. But in these modern times, 64-bit values are increasingly common. How do you handle these? What XML-RPC extensions are the most common? What language bindings are there? I'm especially interested in Python and C++, but all information is appreciated.
Some libraries support 64 bits extensions, indeed, but there doesn't seem to be a standard. xmlrpc-c, for example, has a so called i8 but it doesn't work with python (at least not by default). I would recommend to either: Convert the integer to string by hand and send it as such. XMLRPC will convert it to string anyway...
XML-RPC: best way to handle 64-bit values? So the official XML-RPC standard doesn't support 64-bit values. But in these modern times, 64-bit values are increasingly common. How do you handle these? What XML-RPC extensions are the most common? What language bindings are there? I'm especially interested in Python and C++...
TITLE: XML-RPC: best way to handle 64-bit values? QUESTION: So the official XML-RPC standard doesn't support 64-bit values. But in these modern times, 64-bit values are increasingly common. How do you handle these? What XML-RPC extensions are the most common? What language bindings are there? I'm especially interested...
[ "c++", "python", "64-bit", "xml-rpc" ]
4
7
2,595
4
0
2008-09-20T08:27:11.413000
2008-09-20T12:29:16.743000
107,660
107,680
How to compute the critical path of a directional acyclic graph?
What is the best (regarding performance) way to compute the critical path of a directional acyclic graph when the nodes of the graph have weight? For example, if I have the following structure: Node A (weight 3) / \ Node B (weight 4) Node D (weight 7) / \ Node E (weight 2) Node F (weight 3) The critical path should be ...
I have no clue about "critical paths", but I assume you mean this. Finding the longest path in an acyclic graph with weights is only possible by traversing the whole tree and then comparing the lengths, as you never really know how the rest of the tree is weighted. You can find more about tree traversal at Wikipedia. I...
How to compute the critical path of a directional acyclic graph? What is the best (regarding performance) way to compute the critical path of a directional acyclic graph when the nodes of the graph have weight? For example, if I have the following structure: Node A (weight 3) / \ Node B (weight 4) Node D (weight 7) / \...
TITLE: How to compute the critical path of a directional acyclic graph? QUESTION: What is the best (regarding performance) way to compute the critical path of a directional acyclic graph when the nodes of the graph have weight? For example, if I have the following structure: Node A (weight 3) / \ Node B (weight 4) Nod...
[ "algorithm", "graph-theory" ]
5
2
13,466
5
0
2008-09-20T08:48:05.497000
2008-09-20T09:02:10.923000
107,668
107,708
What do you use when you need reliable UDP?
If you have a situation where a TCP connection is potentially too slow and a UDP 'connection' is potentially too unreliable what do you use? There are various standard reliable UDP protocols out there, what experiences do you have with them? Please discuss one protocol per reply and if someone else has already mentione...
It's difficult to answer this question without some additional information on the domain of the problem. For example, what volume of data are you using? How often? What is the nature of the data? (eg. is it unique, one off data? Or is it a stream of sample data? etc.) What platform are you developing for? (eg. desktop/...
What do you use when you need reliable UDP? If you have a situation where a TCP connection is potentially too slow and a UDP 'connection' is potentially too unreliable what do you use? There are various standard reliable UDP protocols out there, what experiences do you have with them? Please discuss one protocol per re...
TITLE: What do you use when you need reliable UDP? QUESTION: If you have a situation where a TCP connection is potentially too slow and a UDP 'connection' is potentially too unreliable what do you use? There are various standard reliable UDP protocols out there, what experiences do you have with them? Please discuss o...
[ "sockets", "tcp", "network-programming", "udp" ]
105
26
78,108
15
0
2008-09-20T08:52:41.087000
2008-09-20T09:18:19.123000
107,674
107,736
Backend administration in Ruby on Rails
I'd like to build a real quick and dirty administrative backend for a Ruby on Rails application I have been attached to at the last minute. I've looked at activescaffold and streamlined and think they are both very attractive and they should be simple to get running, but I don't quite understand how to set up either on...
I think namespaces is the solution to the problem you have here: map.namespace:admin do |admin| admin.resources:customers end Which will create routes admin_customers, new_admin_customers, etc. Then inside the app/controller directory you can have an admin directory. Inside your admin directory, create an admin control...
Backend administration in Ruby on Rails I'd like to build a real quick and dirty administrative backend for a Ruby on Rails application I have been attached to at the last minute. I've looked at activescaffold and streamlined and think they are both very attractive and they should be simple to get running, but I don't ...
TITLE: Backend administration in Ruby on Rails QUESTION: I'd like to build a real quick and dirty administrative backend for a Ruby on Rails application I have been attached to at the last minute. I've looked at activescaffold and streamlined and think they are both very attractive and they should be simple to get run...
[ "ruby-on-rails", "admin", "generator", "scaffolding", "backend" ]
28
53
24,456
4
0
2008-09-20T08:56:39.953000
2008-09-20T09:34:11.580000
107,683
107,737
When and why should $_REQUEST be used instead of $_GET / $_POST / $_COOKIE?
Question in the title. And what happens when all 3 of $_GET[foo], $_POST[foo] and $_COOKIE[foo] exist? Which one of them gets included to $_REQUEST?
I'd say never. If I wanted something to be set via the various methods, I'd code for each of them to remind myself that I'd done it that way - otherwise you might end up with things being overwritten without realising. Shouldn't it work like this: $_GET = non destructive actions (sorting, recording actions, queries) $_...
When and why should $_REQUEST be used instead of $_GET / $_POST / $_COOKIE? Question in the title. And what happens when all 3 of $_GET[foo], $_POST[foo] and $_COOKIE[foo] exist? Which one of them gets included to $_REQUEST?
TITLE: When and why should $_REQUEST be used instead of $_GET / $_POST / $_COOKIE? QUESTION: Question in the title. And what happens when all 3 of $_GET[foo], $_POST[foo] and $_COOKIE[foo] exist? Which one of them gets included to $_REQUEST? ANSWER: I'd say never. If I wanted something to be set via the various metho...
[ "php" ]
22
53
9,833
6
0
2008-09-20T09:02:24.340000
2008-09-20T09:34:24.637000
107,693
107,759
global variables in php not working as expected
I'm having trouble with global variables in php. I have a $screen var set in one file, which requires another file that calls an initSession() defined in yet another file. The initSession() declares global $screen and then processes $screen further down using the value set in the very first script. How is this possible...
Global DOES NOT make the variable global. I know it's tricky:-) Global says that a local variable will be used as if it was a variable with a higher scope. E.G: Note that global vars are rarely a good idea. You can code 99.99999% of the time without them and your code is much easier to maintain if you don't have fuzzy ...
global variables in php not working as expected I'm having trouble with global variables in php. I have a $screen var set in one file, which requires another file that calls an initSession() defined in yet another file. The initSession() declares global $screen and then processes $screen further down using the value se...
TITLE: global variables in php not working as expected QUESTION: I'm having trouble with global variables in php. I have a $screen var set in one file, which requires another file that calls an initSession() defined in yet another file. The initSession() declares global $screen and then processes $screen further down ...
[ "php", "global" ]
29
63
87,527
7
0
2008-09-20T09:10:57.877000
2008-09-20T09:48:01.907000
107,701
107,921
How can I Remove .DS_Store files from a Git repository?
How can I remove those annoying Mac OS X.DS_Store files from a Git repository?
Remove existing.DS_Store files from the repository: find. -name.DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch Add this line:.DS_Store to the file.gitignore, which can be found at the top level of your repository (or create the file if it isn't there already). You can do this easily with this command in the top...
How can I Remove .DS_Store files from a Git repository? How can I remove those annoying Mac OS X.DS_Store files from a Git repository?
TITLE: How can I Remove .DS_Store files from a Git repository? QUESTION: How can I remove those annoying Mac OS X.DS_Store files from a Git repository? ANSWER: Remove existing.DS_Store files from the repository: find. -name.DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch Add this line:.DS_Store to the file.git...
[ "macos", "git", "gitignore" ]
1,757
3,408
1,099,125
32
0
2008-09-20T09:15:50.033000
2008-09-20T11:18:06.417000
107,705
107,717
Disable output buffering
Is output buffering enabled by default in Python's interpreter for sys.stdout? If the answer is positive, what are all the ways to disable it? Suggestions so far: Use the -u command line switch Wrap sys.stdout in an object that flushes after every write Set PYTHONUNBUFFERED env var sys.stdout = os.fdopen(sys.stdout.fil...
From Magnus Lycka answer on a mailing list: You can skip buffering for a whole python process using python -u or by setting the environment variable PYTHONUNBUFFERED. You could also replace sys.stdout with some other stream like wrapper which does a flush after every call. class Unbuffered(object): def __init__(self, s...
Disable output buffering Is output buffering enabled by default in Python's interpreter for sys.stdout? If the answer is positive, what are all the ways to disable it? Suggestions so far: Use the -u command line switch Wrap sys.stdout in an object that flushes after every write Set PYTHONUNBUFFERED env var sys.stdout =...
TITLE: Disable output buffering QUESTION: Is output buffering enabled by default in Python's interpreter for sys.stdout? If the answer is positive, what are all the ways to disable it? Suggestions so far: Use the -u command line switch Wrap sys.stdout in an object that flushes after every write Set PYTHONUNBUFFERED en...
[ "python", "stdout", "output-buffering" ]
673
522
400,333
16
0
2008-09-20T09:17:20.480000
2008-09-20T09:24:31.307000
107,735
108,035
How to overcome StackOverflowException bypassing unhandled exception handling in .NET
After hitting a few StackOverflowExceptions in.NET I noticed they completely bypass the unhandled exception handlers that.NET offers (Application.ThreadException / AppDomain.UnhandledException). This is very disturbing since we have critical cleanup code in those exception handlers. Is there any way to overcome this?
There are three kind of so-called "asynchronous exceptions". That are the ThreadAbortException, the OutOfMemoryException and the mentioned StackOverflowException. Those excepions are allowed to occur at any instruction in your code. And, there's also a way to overcome them: The easiest is the ThreadAbortException. When...
How to overcome StackOverflowException bypassing unhandled exception handling in .NET After hitting a few StackOverflowExceptions in.NET I noticed they completely bypass the unhandled exception handlers that.NET offers (Application.ThreadException / AppDomain.UnhandledException). This is very disturbing since we have c...
TITLE: How to overcome StackOverflowException bypassing unhandled exception handling in .NET QUESTION: After hitting a few StackOverflowExceptions in.NET I noticed they completely bypass the unhandled exception handlers that.NET offers (Application.ThreadException / AppDomain.UnhandledException). This is very disturbi...
[ ".net", "exception", "stack-overflow" ]
14
26
8,534
4
0
2008-09-20T09:33:00.553000
2008-09-20T12:33:05.673000
107,772
110,215
What are good sources to study the threading implementation of a XMPP application?
From my understanding the XMPP protocol is based on an always-on connection where you have no, immediate, indication of when an XML message ends. This means you have to evaluate the stream as it comes. This also means that, probably, you have to deal with asynchronous connections since the socket can block in the middl...
Are you wanting to deal with multiple connections at once? Good asynch socket processing is a must in that case, to avoid one thread per connection. Otherwise, you just need an XML parser that can deal with a chunk of bytes at a time. Expat is the canonical example; if you're in Java, try XP. These types of XML parsers...
What are good sources to study the threading implementation of a XMPP application? From my understanding the XMPP protocol is based on an always-on connection where you have no, immediate, indication of when an XML message ends. This means you have to evaluate the stream as it comes. This also means that, probably, you...
TITLE: What are good sources to study the threading implementation of a XMPP application? QUESTION: From my understanding the XMPP protocol is based on an always-on connection where you have no, immediate, indication of when an XML message ends. This means you have to evaluate the stream as it comes. This also means t...
[ "multithreading", "networking", "xmpp" ]
2
1
263
3
0
2008-09-20T09:53:48.477000
2008-09-21T04:01:26.503000
107,794
107,932
Importing/exporting history from SVN to TFS
Are there any import and export tools that would let us move projects into and out of team system with full history and log? Our current SCM is SVN. PS - Sorry, I know it's a repost, but I didn't get an answer before...:)
Unfortunately, you probably didn't get an answer because there isn't a good one on offer... I've looked into this a couple of times before, initially for the first TFS Betas. (At the time we were eager to move away from VSS while waiting for TFS to be ready... the compromise we ended up with then was to use SVN in the ...
Importing/exporting history from SVN to TFS Are there any import and export tools that would let us move projects into and out of team system with full history and log? Our current SCM is SVN. PS - Sorry, I know it's a repost, but I didn't get an answer before...:)
TITLE: Importing/exporting history from SVN to TFS QUESTION: Are there any import and export tools that would let us move projects into and out of team system with full history and log? Our current SCM is SVN. PS - Sorry, I know it's a repost, but I didn't get an answer before...:) ANSWER: Unfortunately, you probably...
[ "svn", "version-control", "tfs", "import", "export" ]
5
2
5,560
5
0
2008-09-20T10:05:18.260000
2008-09-20T11:23:05.890000
107,800
108,966
Can Flash save content without server-side help?
As far as I know, Flash has to pass info off to another external process in order to save files - POSTing to PHP or talking to an executable, right? But every once in a while I hear rumors that Flash is able to open a file, make changes, then save/write those changes, all on its own - is it possible?
This will be available in Flash Player 10: Reading and Writing Local Files in Flash Player 10 http://www.mikechambers.com/blog/2008/08/20/reading-and-writing-local-files-in-flash-player-10/ Otherwise you need to use Adobe AIR, or bounce it off the server. mike chambers mesh@adobe.com
Can Flash save content without server-side help? As far as I know, Flash has to pass info off to another external process in order to save files - POSTing to PHP or talking to an executable, right? But every once in a while I hear rumors that Flash is able to open a file, make changes, then save/write those changes, al...
TITLE: Can Flash save content without server-side help? QUESTION: As far as I know, Flash has to pass info off to another external process in order to save files - POSTing to PHP or talking to an executable, right? But every once in a while I hear rumors that Flash is able to open a file, make changes, then save/write...
[ "flash", "actionscript-3" ]
3
5
1,437
4
0
2008-09-20T10:06:59.160000
2008-09-20T18:44:54.517000