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
69,440
71,750
What Safari-specific pure CSS hacks are out there?
I'm wondering if there's any way to write CSS specifically for Safari using only CSS. I know there has to be something out there, but I haven't found it yet.
I think the question is valid. I agree with the other responses, but it doesn't mean it's a terrible question. I've only ever had to use a Safari CSS hack once as a temporary solution and later got rid of it. I agree that you shouldn't have to target just Safari, but no harm in knowing how to do it. FYI, this hack only...
What Safari-specific pure CSS hacks are out there? I'm wondering if there's any way to write CSS specifically for Safari using only CSS. I know there has to be something out there, but I haven't found it yet.
TITLE: What Safari-specific pure CSS hacks are out there? QUESTION: I'm wondering if there's any way to write CSS specifically for Safari using only CSS. I know there has to be something out there, but I haven't found it yet. ANSWER: I think the question is valid. I agree with the other responses, but it doesn't mean...
[ "css", "safari" ]
18
25
22,491
6
0
2008-09-16T04:43:04.070000
2008-09-16T12:35:22.747000
69,443
69,532
Going Ruby: Straight to IronRuby?
I just started to learn Ruby and as a.Net developer, I'm wondering if I should just go straight ahead and use IronRuby, without trying some pure Ruby first. What do you think? Will I be missing anything? -- rauchy
I would use pure ruby (Matz Ruby Interpreter (MRI)) to start off. My understanding is that iron ruby is not quite ready yet. If you are looking for a good book my current favorite (over pickaxe) is http://www.amazon.com/gp/product/0596516177 by matz and flanagan, the book is very concise well written paragraphs and the...
Going Ruby: Straight to IronRuby? I just started to learn Ruby and as a.Net developer, I'm wondering if I should just go straight ahead and use IronRuby, without trying some pure Ruby first. What do you think? Will I be missing anything? -- rauchy
TITLE: Going Ruby: Straight to IronRuby? QUESTION: I just started to learn Ruby and as a.Net developer, I'm wondering if I should just go straight ahead and use IronRuby, without trying some pure Ruby first. What do you think? Will I be missing anything? -- rauchy ANSWER: I would use pure ruby (Matz Ruby Interpreter ...
[ "ruby", "ironruby" ]
4
3
651
4
0
2008-09-16T04:43:52.303000
2008-09-16T05:07:39.063000
69,445
73,071
Programmatically change the text of a TextLayer in After Effects
I'm using the After Effects CS3 Javascript API to dynamically create and change text layers in a composition. Or at least I'm trying to because I can't seem to find the right property to change to alter the actual text of the TextLayer object.
Hmm, must read docs harder next time. var theComposition = app.project.item(1); var theTextLayer = theComposition.layers[1]; theTextLayer.property("Source Text").setValue("This text is from code");
Programmatically change the text of a TextLayer in After Effects I'm using the After Effects CS3 Javascript API to dynamically create and change text layers in a composition. Or at least I'm trying to because I can't seem to find the right property to change to alter the actual text of the TextLayer object.
TITLE: Programmatically change the text of a TextLayer in After Effects QUESTION: I'm using the After Effects CS3 Javascript API to dynamically create and change text layers in a composition. Or at least I'm trying to because I can't seem to find the right property to change to alter the actual text of the TextLayer o...
[ "javascript", "after-effects" ]
5
4
16,191
4
0
2008-09-16T04:44:16.110000
2008-09-16T14:41:11.527000
69,470
72,889
Getting The XML Data Inside Custom XPath function
Is there a way to get the current xml data when we make our own custom XPath function (see here). I know you have access to an XPathContext but is this enough? Example: Our XML: smang buzz Our XSL: How do we get the entire XML tree? Edit: To clarify: I'm creating a custom function that ends up executing static Java cod...
Try changing your XSL so you call 'ourFunction(/)'. That should pass the root node to the function. You could also try. or.. You'll presumably need to change the signature of the implementing function, I'll let someone else help with that.
Getting The XML Data Inside Custom XPath function Is there a way to get the current xml data when we make our own custom XPath function (see here). I know you have access to an XPathContext but is this enough? Example: Our XML: smang buzz Our XSL: How do we get the entire XML tree? Edit: To clarify: I'm creating a cust...
TITLE: Getting The XML Data Inside Custom XPath function QUESTION: Is there a way to get the current xml data when we make our own custom XPath function (see here). I know you have access to an XPathContext but is this enough? Example: Our XML: smang buzz Our XSL: How do we get the entire XML tree? Edit: To clarify: I...
[ "java", "xslt", "xpath", "saxon" ]
4
1
703
2
0
2008-09-16T04:50:27.780000
2008-09-16T14:26:50.110000
69,480
69,512
How do I change the background color in gnuplot?
I have a script that renders graphs in gnuplot. The graphs all end up with an ugly white background. How do I change this? (Ideally, with a command that goes into a gnuplot script, as opposed to a command-line option or something in a settings file)
Ooh, found it. It's along the lines of: set terminal png x222222 xffffff
How do I change the background color in gnuplot? I have a script that renders graphs in gnuplot. The graphs all end up with an ugly white background. How do I change this? (Ideally, with a command that goes into a gnuplot script, as opposed to a command-line option or something in a settings file)
TITLE: How do I change the background color in gnuplot? QUESTION: I have a script that renders graphs in gnuplot. The graphs all end up with an ugly white background. How do I change this? (Ideally, with a command that goes into a gnuplot script, as opposed to a command-line option or something in a settings file) AN...
[ "gnuplot" ]
13
10
27,827
4
0
2008-09-16T04:52:43.093000
2008-09-16T05:00:53.417000
69,492
69,509
What simple method can I use to debug an embedded processor without serial port or video?
We have a small embedded system without any video or serial ports (i.e. we can't output text via printf). We would like to track the progress of our code through the initialization sequence. Is there some simple things we can do to help with this. It is not running any OS, and the hardware platform is somewhat customiz...
The simplest most scalable solution are state LEDs. Toggle LEDs based on actions, either in binary form or when certain actions occur if you can narrow your focus. The most powerful will be a hardware JTAG device. You don't even need to set breakpoints - simply being able to stop the application and inspect the state o...
What simple method can I use to debug an embedded processor without serial port or video? We have a small embedded system without any video or serial ports (i.e. we can't output text via printf). We would like to track the progress of our code through the initialization sequence. Is there some simple things we can do t...
TITLE: What simple method can I use to debug an embedded processor without serial port or video? QUESTION: We have a small embedded system without any video or serial ports (i.e. we can't output text via printf). We would like to track the progress of our code through the initialization sequence. Is there some simple ...
[ "debugging", "embedded", "hardware" ]
5
10
1,235
8
0
2008-09-16T04:55:25.833000
2008-09-16T04:59:27.850000
69,538
69,549
What tools can be used to find which DLLs are referenced?
This is an antique problem with VB6 DLL and COM objects but I still face it day to day. What tools or procedures can be used to see which DLL file or version another DLL is referencing? I am referring to compiled DLLs at runtime, not from within VB6 IDE. It's DLL hell.
Dependency Walker shows you all the files that a DLL links to (or is trying to link to) and it's free.
What tools can be used to find which DLLs are referenced? This is an antique problem with VB6 DLL and COM objects but I still face it day to day. What tools or procedures can be used to see which DLL file or version another DLL is referencing? I am referring to compiled DLLs at runtime, not from within VB6 IDE. It's DL...
TITLE: What tools can be used to find which DLLs are referenced? QUESTION: This is an antique problem with VB6 DLL and COM objects but I still face it day to day. What tools or procedures can be used to see which DLL file or version another DLL is referencing? I am referring to compiled DLLs at runtime, not from withi...
[ "dll", "vb6", "reference" ]
9
7
3,853
2
0
2008-09-16T05:10:46.343000
2008-09-16T05:14:19.330000
69,564
69,668
Does PHP class property scope overridden by passing as reference?
In PHP, if you return a reference to a protected/private property to a class outside the scope of the property does the reference override the scope? e.g. class foo { protected bar = array(); getBar() { return &bar } } class foo2 { blip = new foo().getBar(); // i know this isn't php } Is this correct and is the array...
Well, your sample code is not PHP, but yes, if you return a reference to a protected variable, you can use that reference to modify the data outside of the class's scope. Here's an example: bar = array(); } public function &getBar() { return $this->bar; } } class foo2 { var $barReference; var $fooInstance; public f...
Does PHP class property scope overridden by passing as reference? In PHP, if you return a reference to a protected/private property to a class outside the scope of the property does the reference override the scope? e.g. class foo { protected bar = array(); getBar() { return &bar } } class foo2 { blip = new foo().get...
TITLE: Does PHP class property scope overridden by passing as reference? QUESTION: In PHP, if you return a reference to a protected/private property to a class outside the scope of the property does the reference override the scope? e.g. class foo { protected bar = array(); getBar() { return &bar } } class foo2 { bl...
[ "php", "reference" ]
1
4
1,233
1
0
2008-09-16T05:18:06.183000
2008-09-16T05:50:24.813000
69,565
69,600
Can an fdopen() cause a memory leak?
I use fdopen to associate a stream with an open file. When I close() the file, is the stream automatically disassociated as well, and all stream memory returned to the OS, or do I need to be aware of the fdopen'd file and close it in a specific manner? -Adam
close() is a system call. It will close the file descriptor in the kernel, but will not free the FILE pointer and resources in libc. You should use fclose() on the FILE pointer instead, which will also take care of closing the file descriptor.
Can an fdopen() cause a memory leak? I use fdopen to associate a stream with an open file. When I close() the file, is the stream automatically disassociated as well, and all stream memory returned to the OS, or do I need to be aware of the fdopen'd file and close it in a specific manner? -Adam
TITLE: Can an fdopen() cause a memory leak? QUESTION: I use fdopen to associate a stream with an open file. When I close() the file, is the stream automatically disassociated as well, and all stream memory returned to the OS, or do I need to be aware of the fdopen'd file and close it in a specific manner? -Adam ANSWE...
[ "file-io", "memory-leaks", "stream" ]
4
5
1,978
1
0
2008-09-16T05:18:36.713000
2008-09-16T05:30:28.637000
69,591
69,615
How do I create a regex in Emacs for exactly 3 digits?
I want to create a regexp in Emacs that matches exactly 3 digits. For example, I want to match the following: 123 345 789 But not 1234 12 12 23 If I use [0-9]+ I match any single string of digits. I thought [0-9]{3} would work, but when tested in re-builder it doesn't match anything.
If you're entering the regex interactively, and want to use {3}, you need to use backslashes to escape the curly braces. If you don't want to match any part of the longer strings of numbers, use \b to match word boundaries around the numbers. This leaves: \b[0-9]\{3\}\b For those wanting more information about \b, see ...
How do I create a regex in Emacs for exactly 3 digits? I want to create a regexp in Emacs that matches exactly 3 digits. For example, I want to match the following: 123 345 789 But not 1234 12 12 23 If I use [0-9]+ I match any single string of digits. I thought [0-9]{3} would work, but when tested in re-builder it does...
TITLE: How do I create a regex in Emacs for exactly 3 digits? QUESTION: I want to create a regexp in Emacs that matches exactly 3 digits. For example, I want to match the following: 123 345 789 But not 1234 12 12 23 If I use [0-9]+ I match any single string of digits. I thought [0-9]{3} would work, but when tested in ...
[ "regex", "emacs" ]
31
57
99,506
7
0
2008-09-16T05:26:06.227000
2008-09-16T05:33:38.347000
69,627
69,639
unpatented one-way encryption algorithm
I am looking for a simple unpatented one-way encryption algorithm, preferably in c. I would like to use it to validate passwords.
SHA-1 and the rest of its family were patented by the US government which "has released the patent under a royalty free license". Many public-domain implementations may be found through Google.:-)
unpatented one-way encryption algorithm I am looking for a simple unpatented one-way encryption algorithm, preferably in c. I would like to use it to validate passwords.
TITLE: unpatented one-way encryption algorithm QUESTION: I am looking for a simple unpatented one-way encryption algorithm, preferably in c. I would like to use it to validate passwords. ANSWER: SHA-1 and the rest of its family were patented by the US government which "has released the patent under a royalty free lic...
[ "encryption", "hash" ]
1
13
1,134
7
0
2008-09-16T05:37:29.400000
2008-09-16T05:42:11.370000
69,645
782,768
Take a screenshot via a Python script on Linux
I want to take a screenshot via a python script and unobtrusively save it. I'm only interested in the Linux solution, and should support any X based environment.
This works without having to use scrot or ImageMagick. import gtk.gdk w = gtk.gdk.get_default_root_window() sz = w.get_size() print "The size of the window is %d x %d" % sz pb = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,False,8,sz[0],sz[1]) pb = pb.get_from_drawable(w,w.get_colormap(),0,0,0,0,sz[0],sz[1]) if (pb!= None): ...
Take a screenshot via a Python script on Linux I want to take a screenshot via a python script and unobtrusively save it. I'm only interested in the Linux solution, and should support any X based environment.
TITLE: Take a screenshot via a Python script on Linux QUESTION: I want to take a screenshot via a python script and unobtrusively save it. I'm only interested in the Linux solution, and should support any X based environment. ANSWER: This works without having to use scrot or ImageMagick. import gtk.gdk w = gtk.gdk.g...
[ "python", "linux", "screenshot" ]
94
65
120,246
15
0
2008-09-16T05:44:54.840000
2009-04-23T17:27:52.080000
69,646
69,683
SVN and renaming the server it's running on
I'm running VisualSVN as my SVN server and using TortoiseSVN as the client. I've just renamed the server from mach1 to mach2 and now can't use SVN because it's looking for the repositories at http://mach1:81/ instead of the new name http://mach2:81/ Any idea how to fix this?
Use the "relocate" option provided by Tortoise SVN. Just right click on the upper-most checked out folder, select relocate, and then enter the new URL.
SVN and renaming the server it's running on I'm running VisualSVN as my SVN server and using TortoiseSVN as the client. I've just renamed the server from mach1 to mach2 and now can't use SVN because it's looking for the repositories at http://mach1:81/ instead of the new name http://mach2:81/ Any idea how to fix this?
TITLE: SVN and renaming the server it's running on QUESTION: I'm running VisualSVN as my SVN server and using TortoiseSVN as the client. I've just renamed the server from mach1 to mach2 and now can't use SVN because it's looking for the repositories at http://mach1:81/ instead of the new name http://mach2:81/ Any idea...
[ "svn", "tortoisesvn", "visualsvn" ]
2
9
965
3
0
2008-09-16T05:45:31.640000
2008-09-16T05:55:31.507000
69,676
1,869,230
MySQL, Asterisk Dialplans and call forwarding
How do I get Asterisk to forward incoming calls based on matching the incoming call number with a number to forward to? Both numbers are stored in a MySQL database.
The solution I was looking for ended up looking like this: [default] exten => _X.,1,Set(ARRAY(${EXTEN}_phone)=${DTC_ICF(phone_number,${EXTEN})}) exten => _X.,n(callphone),Dial(SIP/metaswitch/${${EXTEN}_phone},26) exten => _X.,n(end),Hangup()
MySQL, Asterisk Dialplans and call forwarding How do I get Asterisk to forward incoming calls based on matching the incoming call number with a number to forward to? Both numbers are stored in a MySQL database.
TITLE: MySQL, Asterisk Dialplans and call forwarding QUESTION: How do I get Asterisk to forward incoming calls based on matching the incoming call number with a number to forward to? Both numbers are stored in a MySQL database. ANSWER: The solution I was looking for ended up looking like this: [default] exten => _X.,...
[ "mysql", "asterisk", "telephony" ]
3
1
9,510
2
0
2008-09-16T05:53:02.950000
2009-12-08T19:20:47.543000
69,692
74,147
Get two Linux (virtual) boxes talking over a serial port
What is the best way to setup one Linux box to listen on its serial port for incoming connections? I've done a lot of googling but I can't find the right combination of commands to actually get them to talk! My main objective is to provide a serial interface to running instances of kvm/qemu VMs. They currently only hav...
The Linux Serial HOWTO has a lot of detailed information about serial communication in general. The more-specific Linux Remote Serial Console HOWTO is what you're really looking for if you want to be able to log into your virtualized systems using the serial port as if you were at the console. As Hein indicated, you'll...
Get two Linux (virtual) boxes talking over a serial port What is the best way to setup one Linux box to listen on its serial port for incoming connections? I've done a lot of googling but I can't find the right combination of commands to actually get them to talk! My main objective is to provide a serial interface to r...
TITLE: Get two Linux (virtual) boxes talking over a serial port QUESTION: What is the best way to setup one Linux box to listen on its serial port for incoming connections? I've done a lot of googling but I can't find the right combination of commands to actually get them to talk! My main objective is to provide a ser...
[ "linux", "serial-port", "virtualization", "kvm", "qemu" ]
4
5
2,987
3
0
2008-09-16T05:59:15.510000
2008-09-16T16:18:57.703000
69,695
69,721
stringstream manipulators & vstudio 2003
I am trying to use a stringstream object in VC++ (VStudio 2003) butI am getting an error when I use the overloaded << operator to try and set some manipulators. I am trying the following: int SomeInt = 1; stringstream StrStream; StrStream << std::setw(2) << SomeInt; This will not compile (error C2593: 'operator <<' is ...
Are you sure you included all of the right headers? The following compiles for me in VS2003: #include #include #include int main() { int SomeInt = 1; std::stringstream StrStream; StrStream << std::setw(2) << SomeInt; return 0; }
stringstream manipulators & vstudio 2003 I am trying to use a stringstream object in VC++ (VStudio 2003) butI am getting an error when I use the overloaded << operator to try and set some manipulators. I am trying the following: int SomeInt = 1; stringstream StrStream; StrStream << std::setw(2) << SomeInt; This will no...
TITLE: stringstream manipulators & vstudio 2003 QUESTION: I am trying to use a stringstream object in VC++ (VStudio 2003) butI am getting an error when I use the overloaded << operator to try and set some manipulators. I am trying the following: int SomeInt = 1; stringstream StrStream; StrStream << std::setw(2) << Som...
[ "visual-studio", "stl" ]
0
1
551
3
0
2008-09-16T05:59:39.300000
2008-09-16T06:08:56.017000
69,700
70,459
What is a good regression testing framework for software applications?
Am looking for a regression test framework where I can add tests to.. Tests could be any sort of binaries that poke an application..
This really depends on what you're trying to do, but one of the features of the new Test::Harness (disclaimer: I'm the original author and still a core developer) is that if your tests output TAP (the Test Anything Protocol), you can use Test::Harness to run test suites written in multiple languages. As a result, you d...
What is a good regression testing framework for software applications? Am looking for a regression test framework where I can add tests to.. Tests could be any sort of binaries that poke an application..
TITLE: What is a good regression testing framework for software applications? QUESTION: Am looking for a regression test framework where I can add tests to.. Tests could be any sort of binaries that poke an application.. ANSWER: This really depends on what you're trying to do, but one of the features of the new Test:...
[ "testing" ]
3
2
5,139
5
0
2008-09-16T06:02:08.527000
2008-09-16T08:49:30.950000
69,702
70,393
Java Collections using wildcard
public static void main(String[] args) { List mylist = new ArrayList (); mylist.add("Java"); // compile error } The above code does not allow you to add elements to the list and wild cards can only be used as a signature in methods, again not for adding but only for accessing. In this case what purpose does the abov...
Let's say you have an interface and two classes: interface IResult {} class AResult implements IResult {} class BResult implements IResult {} Then you have classes that return a list as a result: interface ITest { List getResult(); } class ATest implements ITest { // look, overridden! List getResult(); } class BTest ...
Java Collections using wildcard public static void main(String[] args) { List mylist = new ArrayList (); mylist.add("Java"); // compile error } The above code does not allow you to add elements to the list and wild cards can only be used as a signature in methods, again not for adding but only for accessing. In this...
TITLE: Java Collections using wildcard QUESTION: public static void main(String[] args) { List mylist = new ArrayList (); mylist.add("Java"); // compile error } The above code does not allow you to add elements to the list and wild cards can only be used as a signature in methods, again not for adding but only for ...
[ "java" ]
10
5
6,957
7
0
2008-09-16T06:02:43.613000
2008-09-16T08:35:29.643000
69,715
69,869
Which PHP open source shopping cart solutions have features that benefit me as the web developer?
There are hundreds of shopping cart solutions available for every platform, and all hosting plans come with several already installed. As a developer I understand that most of these are fairly similar from a user perspective. But which ones are built with the developer in mind? For example, which ones have a decent API...
osCommerce is one of those products that was badly designed from the beginning, and becomes basically unmaintainable as time moves forward. Addons are patches, and custom code modifies core. (Unless things have drastically changed since I last looked at it - judging by the version numbers, they have not). While probabl...
Which PHP open source shopping cart solutions have features that benefit me as the web developer? There are hundreds of shopping cart solutions available for every platform, and all hosting plans come with several already installed. As a developer I understand that most of these are fairly similar from a user perspecti...
TITLE: Which PHP open source shopping cart solutions have features that benefit me as the web developer? QUESTION: There are hundreds of shopping cart solutions available for every platform, and all hosting plans come with several already installed. As a developer I understand that most of these are fairly similar fro...
[ "php", "e-commerce", "shopping-cart" ]
4
7
3,494
11
0
2008-09-16T06:07:16.207000
2008-09-16T06:42:09.400000
69,729
74,357
Visual Studio 2005 - 'Updating IntelliSense' hang-up
I am having trouble with my Visual Studio 2005 IntelliSense for some time now. It used to work fine, but for some reason the 'Updating IntelliSense...' does no longer seem to be able to complete for the solution I'm working on currenly- it simply gets stuck somewhere at about 3-bars of progress and blocks one of my pre...
I have found that the best fix for Intellisense in VS2005 is to install SP1, and then this hotfix: 947315. It has the added benefit of fixing most of the multi-core build issues. This hotfix also includes the ability to control Intellisense via Macros. More information here. As for making SP1 more friendly for existing...
Visual Studio 2005 - 'Updating IntelliSense' hang-up I am having trouble with my Visual Studio 2005 IntelliSense for some time now. It used to work fine, but for some reason the 'Updating IntelliSense...' does no longer seem to be able to complete for the solution I'm working on currenly- it simply gets stuck somewhere...
TITLE: Visual Studio 2005 - 'Updating IntelliSense' hang-up QUESTION: I am having trouble with my Visual Studio 2005 IntelliSense for some time now. It used to work fine, but for some reason the 'Updating IntelliSense...' does no longer seem to be able to complete for the solution I'm working on currenly- it simply ge...
[ "visual-studio", "visual-studio-2005", "intellisense" ]
6
5
11,515
4
0
2008-09-16T06:11:14.153000
2008-09-16T16:41:49.270000
69,738
69,765
C++: how to get fprintf results as a std::string w/o sprintf
I am working with an open-source UNIX tool that is implemented in C++, and I need to change some code to get it to do what I want. I would like to make the smallest possible change in hopes of getting my patch accepted upstream. Solutions that are implementable in standard C++ and do not create more external dependenci...
I am using #3: the boost string format library - but I have to admit that I've never had any problem with the differences in format specifications. Works like a charm for me - and the external dependencies could be worse (a very stable library) Edited: adding an example how to use boost::format instead of printf: sprin...
C++: how to get fprintf results as a std::string w/o sprintf I am working with an open-source UNIX tool that is implemented in C++, and I need to change some code to get it to do what I want. I would like to make the smallest possible change in hopes of getting my patch accepted upstream. Solutions that are implementab...
TITLE: C++: how to get fprintf results as a std::string w/o sprintf QUESTION: I am working with an open-source UNIX tool that is implemented in C++, and I need to change some code to get it to do what I want. I would like to make the smallest possible change in hopes of getting my patch accepted upstream. Solutions th...
[ "c++", "unix", "format", "printf", "stdstring" ]
20
14
42,245
8
0
2008-09-16T06:12:48.173000
2008-09-16T06:18:25.510000
69,743
69,758
How to use "%f" to populate a double value into a string with the right precision
I am trying to populate a string with a double value using a sprintf like this: sprintf(S, "%f", val); But the precision is being cut off to six decimal places. I need about 10 decimal places for the precision. How can that be achieved?
%[width].[precision] Width should include the decimal point. %8.2 means 8 characters wide; 5 digits before the point and 2 after. One character is reserved for the point. 5 + 1 + 2 = 8
How to use "%f" to populate a double value into a string with the right precision I am trying to populate a string with a double value using a sprintf like this: sprintf(S, "%f", val); But the precision is being cut off to six decimal places. I need about 10 decimal places for the precision. How can that be achieved?
TITLE: How to use "%f" to populate a double value into a string with the right precision QUESTION: I am trying to populate a string with a double value using a sprintf like this: sprintf(S, "%f", val); But the precision is being cut off to six decimal places. I need about 10 decimal places for the precision. How can t...
[ "c", "floating-point", "precision", "printf" ]
6
9
32,408
5
0
2008-09-16T06:14:43.367000
2008-09-16T06:17:41.860000
69,748
69,769
Split a list by distinct date
Another easy one hopefully. Let's say I have a collection like this: List allDates; I want to turn that into List > dividedDates; where each List in 'dividedDates' contains all of the dates in 'allDates' that belong to a distinct year. Is there a bit of LINQ trickery that my tired mind can't pick out right now? Solutio...
var q = from date in allDates group date by date.Year into datesByYear select datesByYear.ToList(); q.ToList(); //returns List >
Split a list by distinct date Another easy one hopefully. Let's say I have a collection like this: List allDates; I want to turn that into List > dividedDates; where each List in 'dividedDates' contains all of the dates in 'allDates' that belong to a distinct year. Is there a bit of LINQ trickery that my tired mind can...
TITLE: Split a list by distinct date QUESTION: Another easy one hopefully. Let's say I have a collection like this: List allDates; I want to turn that into List > dividedDates; where each List in 'dividedDates' contains all of the dates in 'allDates' that belong to a distinct year. Is there a bit of LINQ trickery that...
[ "c#", "linq" ]
8
8
4,898
2
0
2008-09-16T06:15:50.320000
2008-09-16T06:19:46.817000
69,753
69,862
Any way to programmatically wrap a .NET WebService with a SoapExtension?
Basically, I'm trying to tap into the Soap pipeline in.NET 2.0 - I want to do what a SoapExtension can do if you provide a custom SoapExtensionAttribute... but to do it for every SOAP call without having to add the extension attribute to dozens of WebMethods. What I'm looking for is any extension point that lets me hoo...
There is a configuration property, soapExtensionTypes that does this, but affects all web services covered by the.config (all of them in the same directory or a sub-directory as the.config)
Any way to programmatically wrap a .NET WebService with a SoapExtension? Basically, I'm trying to tap into the Soap pipeline in.NET 2.0 - I want to do what a SoapExtension can do if you provide a custom SoapExtensionAttribute... but to do it for every SOAP call without having to add the extension attribute to dozens of...
TITLE: Any way to programmatically wrap a .NET WebService with a SoapExtension? QUESTION: Basically, I'm trying to tap into the Soap pipeline in.NET 2.0 - I want to do what a SoapExtension can do if you provide a custom SoapExtensionAttribute... but to do it for every SOAP call without having to add the extension attr...
[ "c#", ".net", "web-services" ]
0
2
1,023
1
0
2008-09-16T06:16:42.300000
2008-09-16T06:40:30.247000
69,766
126,566
Visual Studio 2005 ERROR: An error occurred generating a bootstrapper: Invalid syntax
I'm working on VS 2005 and something has gone wrong on my machine. Suddenly, out of the blue, I can no longer build deployment files. The build message is: ERROR: An error occurred generating a bootstrapper: Invalid syntax. ERROR: General failure building bootstrapper ERROR: Unrecoverable build error A quick Google sea...
SOLUTION! Thanks to Michael Bleifer of Microsoft support - I installed.NET 2.0 SP1, and the problem was solved!
Visual Studio 2005 ERROR: An error occurred generating a bootstrapper: Invalid syntax I'm working on VS 2005 and something has gone wrong on my machine. Suddenly, out of the blue, I can no longer build deployment files. The build message is: ERROR: An error occurred generating a bootstrapper: Invalid syntax. ERROR: Gen...
TITLE: Visual Studio 2005 ERROR: An error occurred generating a bootstrapper: Invalid syntax QUESTION: I'm working on VS 2005 and something has gone wrong on my machine. Suddenly, out of the blue, I can no longer build deployment files. The build message is: ERROR: An error occurred generating a bootstrapper: Invalid ...
[ "visual-studio", "deployment", "build", "bootstrapping" ]
2
1
5,263
5
0
2008-09-16T06:18:53.340000
2008-09-24T11:20:58.683000
69,768
69,784
How do you configure the Apache server which ships Mac OS X?
Mac OS X ships with apache pre-installed, but the files are in non-standard locations. This question is a place to collect information about where configuration files live, and how to tweak the apache installation to do things like serve php pages.
Apache Config file is: /private/etc/apache2/httpd.conf Default DocumentRoot is: /Library/Webserver/Documents/ To enable PHP, at around line 114 (maybe) in the /private/etc/apache2/httpd.conf file is the following line: #LoadModule php5_module libexec/apache2/libphp5.so Remove the pound sign to uncomment the line so now...
How do you configure the Apache server which ships Mac OS X? Mac OS X ships with apache pre-installed, but the files are in non-standard locations. This question is a place to collect information about where configuration files live, and how to tweak the apache installation to do things like serve php pages.
TITLE: How do you configure the Apache server which ships Mac OS X? QUESTION: Mac OS X ships with apache pre-installed, but the files are in non-standard locations. This question is a place to collect information about where configuration files live, and how to tweak the apache installation to do things like serve php...
[ "apache", "macos" ]
11
20
15,736
5
0
2008-09-16T06:19:45.663000
2008-09-16T06:23:53.373000
69,788
69,945
How to configure IIS7 to allow zip file uploads using classic asp?
I recently installed Windows 2008 Server to replace a crashed hard drive on a web server with a variety of web pages including several classic ASP applications. One of these makes extensive use of file uploads using a com tool that has worked for several years. More information: My users did not provide good informatio...
There is a size limit that you will probably need to set - what's the 500 error?
How to configure IIS7 to allow zip file uploads using classic asp? I recently installed Windows 2008 Server to replace a crashed hard drive on a web server with a variety of web pages including several classic ASP applications. One of these makes extensive use of file uploads using a com tool that has worked for severa...
TITLE: How to configure IIS7 to allow zip file uploads using classic asp? QUESTION: I recently installed Windows 2008 Server to replace a crashed hard drive on a web server with a variety of web pages including several classic ASP applications. One of these makes extensive use of file uploads using a com tool that has...
[ "iis", "iis-7", "asp-classic" ]
2
0
2,682
2
0
2008-09-16T06:25:02.373000
2008-09-16T06:59:54.490000
69,814
72,614
How do you use gnuplot's built-in fonts?
The gnuplot docs have this to say about fonts: Five basic fonts are supported directly by the gd library. These are `tiny` (5x8 pixels), `small` (6x12 pixels), `medium`, (7x13 Bold), `large` (8x16) or `giant` (9x15 pixels). But when i try to use one: gnuplot> set terminal png font tiny I get: Could not find/open font w...
The problem was that, for these fonts for some reason, you don't use the standard syntax I tried above: gnuplot> set terminal png font tiny But instead, you drop the word "font" for these five special fonts: gnuplot> set terminal png tiny
How do you use gnuplot's built-in fonts? The gnuplot docs have this to say about fonts: Five basic fonts are supported directly by the gd library. These are `tiny` (5x8 pixels), `small` (6x12 pixels), `medium`, (7x13 Bold), `large` (8x16) or `giant` (9x15 pixels). But when i try to use one: gnuplot> set terminal png fo...
TITLE: How do you use gnuplot's built-in fonts? QUESTION: The gnuplot docs have this to say about fonts: Five basic fonts are supported directly by the gd library. These are `tiny` (5x8 pixels), `small` (6x12 pixels), `medium`, (7x13 Bold), `large` (8x16) or `giant` (9x15 pixels). But when i try to use one: gnuplot> s...
[ "gnuplot" ]
5
4
13,036
1
0
2008-09-16T06:30:28.913000
2008-09-16T14:03:42.583000
69,828
69,842
Does the DOCTYPE declaration have to be the first tag in an HTML document?
Our security manager dynamically inserts a bit of javascript at the top of every html page when a page is requested by the client. It is inserted above the DOCTYPE statement. I think this might be the cause of the layout problems I am having. Ideas anyone?
Yes, DOCTYPE must be the first data on the page: http://www.w3schools.com/tags/tag_DOCTYPE.asp
Does the DOCTYPE declaration have to be the first tag in an HTML document? Our security manager dynamically inserts a bit of javascript at the top of every html page when a page is requested by the client. It is inserted above the DOCTYPE statement. I think this might be the cause of the layout problems I am having. Id...
TITLE: Does the DOCTYPE declaration have to be the first tag in an HTML document? QUESTION: Our security manager dynamically inserts a bit of javascript at the top of every html page when a page is requested by the client. It is inserted above the DOCTYPE statement. I think this might be the cause of the layout proble...
[ "html", "doctype" ]
14
7
12,287
8
0
2008-09-16T06:34:23.850000
2008-09-16T06:36:41.753000
69,832
294,686
Which Open Source CMS do you find most reliable and performance-oriented?
We need a good CMS that supports data clustering (managing and storing data on different servers). By "good", I mean: reliable, minimum bugs, the faster the better. (Oh, and it should make coffee:) )
Yes … kitchen sink + community + support: Plone. Development heading very much in the right direction. Plone is in some ways a different creature from many other systems. Depending on the environment, ultra-high performance may require some attention but in the community there's great expertise to steer any attention t...
Which Open Source CMS do you find most reliable and performance-oriented? We need a good CMS that supports data clustering (managing and storing data on different servers). By "good", I mean: reliable, minimum bugs, the faster the better. (Oh, and it should make coffee:) )
TITLE: Which Open Source CMS do you find most reliable and performance-oriented? QUESTION: We need a good CMS that supports data clustering (managing and storing data on different servers). By "good", I mean: reliable, minimum bugs, the faster the better. (Oh, and it should make coffee:) ) ANSWER: Yes … kitchen sink ...
[ "content-management-system", "cluster-computing" ]
0
2
764
5
0
2008-09-16T06:35:14.720000
2008-11-17T01:21:45.710000
69,835
86,915
How do I use Nant/Ant naming patterns?
I have to admit that I always forgot the syntactical intracacies of the naming patterns for Nant (eg. those used in filesets). The double asterisk/single asterisk stuff seems to be very forgettable in my mind. Can someone provide a definitive guide to the naming patterns?
The rules are: a single star (*) matches zero or more characters within a path name a double star (**) matches zero or more characters across directory levels a question mark (?) matches exactly one character within a path name Another way to think about it is double star (**) matches slash (/) but single star (*) does...
How do I use Nant/Ant naming patterns? I have to admit that I always forgot the syntactical intracacies of the naming patterns for Nant (eg. those used in filesets). The double asterisk/single asterisk stuff seems to be very forgettable in my mind. Can someone provide a definitive guide to the naming patterns?
TITLE: How do I use Nant/Ant naming patterns? QUESTION: I have to admit that I always forgot the syntactical intracacies of the naming patterns for Nant (eg. those used in filesets). The double asterisk/single asterisk stuff seems to be very forgettable in my mind. Can someone provide a definitive guide to the naming ...
[ "ant", "nant" ]
121
295
65,958
4
0
2008-09-16T06:35:37.183000
2008-09-17T19:49:12.103000
69,837
69,858
What would cause a visitor to return to the top of the previous page, instead of to the point in the page where the link resides?
I've seen this weird behavior on several sites recently: I scroll down a page and follow a link to another page. When I click the Back button and return, I am left back at the top of the previous page, not at the link. This is very annoying if I'm clicking on links in a search results page or a list of "10 Best Foo Bar...
Many sites have a text box (for searching the site, or something) that is set to automatically take focus when the page loads (using javascript or something). In many browsers, the page will jump to that text box when it gets focus. It really is very annoying:(
What would cause a visitor to return to the top of the previous page, instead of to the point in the page where the link resides? I've seen this weird behavior on several sites recently: I scroll down a page and follow a link to another page. When I click the Back button and return, I am left back at the top of the pre...
TITLE: What would cause a visitor to return to the top of the previous page, instead of to the point in the page where the link resides? QUESTION: I've seen this weird behavior on several sites recently: I scroll down a page and follow a link to another page. When I click the Back button and return, I am left back at ...
[ "html", "browser-history" ]
0
3
213
2
0
2008-09-16T06:35:54.797000
2008-09-16T06:40:01.823000
69,843
69,988
What is an example of "this" assignment in C#?
Does anybody have useful example of this assignment inside a C# method? I have been asked for it once during job interview, and I am still interested in answer myself.
The other answers are incorrect when they say you cannot assign to 'this'. True, you can't for a class type, but you can for a struct type: public struct MyValueType { public int Id; public void Swap(ref MyValueType other) { MyValueType temp = this; this = other; other = temp; } } At any point a struct can alter itself...
What is an example of "this" assignment in C#? Does anybody have useful example of this assignment inside a C# method? I have been asked for it once during job interview, and I am still interested in answer myself.
TITLE: What is an example of "this" assignment in C#? QUESTION: Does anybody have useful example of this assignment inside a C# method? I have been asked for it once during job interview, and I am still interested in answer myself. ANSWER: The other answers are incorrect when they say you cannot assign to 'this'. Tru...
[ "c#", "language-features" ]
14
46
5,720
6
0
2008-09-16T06:37:37.100000
2008-09-16T07:09:42.703000
69,859
69,958
how could I intercept linux sys calls?
Besides the LD_PRELOAD trick, and Linux Kernel Modules that replace a certain syscall with one provided by you, is there any possibility to intercept a syscall ( open for example ), so that it first goes through your function, before it reaches the actual open?
if you really need a solution you might be interested in the DR rootkit that accomplishes just this, http://www.immunityinc.com/downloads/linux_rootkit_source.tbz2 the article about it is here http://www.theregister.co.uk/2008/09/04/linux_rootkit_released/
how could I intercept linux sys calls? Besides the LD_PRELOAD trick, and Linux Kernel Modules that replace a certain syscall with one provided by you, is there any possibility to intercept a syscall ( open for example ), so that it first goes through your function, before it reaches the actual open?
TITLE: how could I intercept linux sys calls? QUESTION: Besides the LD_PRELOAD trick, and Linux Kernel Modules that replace a certain syscall with one provided by you, is there any possibility to intercept a syscall ( open for example ), so that it first goes through your function, before it reaches the actual open? ...
[ "c", "linux", "redirect", "hook", "system-calls" ]
28
1
26,088
10
0
2008-09-16T06:40:20.120000
2008-09-16T07:02:28.477000
69,913
69,984
Why don't self-closing script elements work?
What is the reason browsers do not correctly recognize: Only this is recognized: Does this break the concept of XHTML support? Note: This statement is correct at least for all IE (6-8 beta 2).
The non-normative appendix ‘HTML Compatibility Guidelines’ of the XHTML 1 specification says: С.3. Element Minimization and Empty Element Content Given an empty instance of an element whose content model is not EMPTY (for example, an empty title or paragraph) do not use the minimized form (e.g. use and not ). XHTML DTD...
Why don't self-closing script elements work? What is the reason browsers do not correctly recognize: Only this is recognized: Does this break the concept of XHTML support? Note: This statement is correct at least for all IE (6-8 beta 2).
TITLE: Why don't self-closing script elements work? QUESTION: What is the reason browsers do not correctly recognize: Only this is recognized: Does this break the concept of XHTML support? Note: This statement is correct at least for all IE (6-8 beta 2). ANSWER: The non-normative appendix ‘HTML Compatibility Guidelin...
[ "javascript", "html", "internet-explorer", "xhtml" ]
1,521
518
165,710
12
0
2008-09-16T06:52:38.563000
2008-09-16T07:08:47.853000
69,923
69,953
Stored procedures reverse engineering
We're having problem with a huge number of legacy stored procedures at work. Do you guys recommend any tool the can help better understand those procedures? Some kind of reverse engineering that indentifies inter-procedure dependencies and/or procedure vs. tables dependencies. Can be a free or commercial tool. Thanks!
Redgate has a rather expensive product called SQL Dependency Tracker that seems to fulfill the requirements.
Stored procedures reverse engineering We're having problem with a huge number of legacy stored procedures at work. Do you guys recommend any tool the can help better understand those procedures? Some kind of reverse engineering that indentifies inter-procedure dependencies and/or procedure vs. tables dependencies. Can ...
TITLE: Stored procedures reverse engineering QUESTION: We're having problem with a huge number of legacy stored procedures at work. Do you guys recommend any tool the can help better understand those procedures? Some kind of reverse engineering that indentifies inter-procedure dependencies and/or procedure vs. tables ...
[ "database", "stored-procedures", "reverse-engineering", "legacy" ]
12
4
12,169
8
0
2008-09-16T06:54:50.943000
2008-09-16T07:00:49.620000
69,927
69,990
Best way for a Swing GUI to communicate with domain logic?
I have some domain logic implemented in a number of POJOs. I want to write a Swing user interface to allow the user to initiate and see the results of various domain actions. What's the best pattern/framework/library for communications between the UI and the domain? This boils down into: the UI being able to convert a ...
Definitely MVC - something like this example which clearly splits things out. The problem with the Swing examples is that they seem to show the MVC all working within the swing stuff, which does not seem right to me
Best way for a Swing GUI to communicate with domain logic? I have some domain logic implemented in a number of POJOs. I want to write a Swing user interface to allow the user to initiate and see the results of various domain actions. What's the best pattern/framework/library for communications between the UI and the do...
TITLE: Best way for a Swing GUI to communicate with domain logic? QUESTION: I have some domain logic implemented in a number of POJOs. I want to write a Swing user interface to allow the user to initiate and see the results of various domain actions. What's the best pattern/framework/library for communications between...
[ "java", "user-interface", "swing" ]
7
2
1,374
3
0
2008-09-16T06:55:28.400000
2008-09-16T07:10:18.113000
69,928
113,120
WPF: Org Chart TreeView Conditional Formatting
The company has the traditional complex organizational structure, defining the amount of levels using the letter 'n' rather than an actual number. I will try and express the structure I'm trying to achieve in mono-spaced font: Alice,--------|-------,------,------, Bob Fred Jack Kim Lucy | | Charlie Greg Darren Henry Er...
I did end up using tips from the linked article, which I'd already read through but didn't think would help me. The meat of it happens here, in a converter: _ Public Class ItemsPanelOrientationConverter Implements IValueConverter Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, _ ByVal p...
WPF: Org Chart TreeView Conditional Formatting The company has the traditional complex organizational structure, defining the amount of levels using the letter 'n' rather than an actual number. I will try and express the structure I'm trying to achieve in mono-spaced font: Alice,--------|-------,------,------, Bob Fred...
TITLE: WPF: Org Chart TreeView Conditional Formatting QUESTION: The company has the traditional complex organizational structure, defining the amount of levels using the letter 'n' rather than an actual number. I will try and express the structure I'm trying to achieve in mono-spaced font: Alice,--------|-------,-----...
[ "wpf", "xaml" ]
2
0
3,173
2
0
2008-09-16T06:55:35.153000
2008-09-22T04:04:00.560000
69,934
70,027
Set 4 Space Indent in Emacs in Text Mode
I've been unsuccessful in getting Emacs to switch from 8 space tabs to 4 space tabs when pressing the TAB in buffers with the major mode text-mode. I've added the following to my.emacs: (setq-default indent-tabs-mode nil) (setq-default tab-width 4);;; And I have tried (setq indent-tabs-mode nil) (setq tab-width 4) No m...
Do not confuse variable tab-width with variable tab-stop-list. The former is used for the display of literal TAB characters. The latter controls what characters are inserted when you press the TAB character in certain modes. -- GNU Emacs Manual (customize-variable (quote tab-stop-list)) or add tab-stop-list entry to cu...
Set 4 Space Indent in Emacs in Text Mode I've been unsuccessful in getting Emacs to switch from 8 space tabs to 4 space tabs when pressing the TAB in buffers with the major mode text-mode. I've added the following to my.emacs: (setq-default indent-tabs-mode nil) (setq-default tab-width 4);;; And I have tried (setq inde...
TITLE: Set 4 Space Indent in Emacs in Text Mode QUESTION: I've been unsuccessful in getting Emacs to switch from 8 space tabs to 4 space tabs when pressing the TAB in buffers with the major mode text-mode. I've added the following to my.emacs: (setq-default indent-tabs-mode nil) (setq-default tab-width 4);;; And I hav...
[ "emacs", "indentation" ]
183
33
175,682
21
0
2008-09-16T06:57:34.743000
2008-09-16T07:19:32.227000
69,959
78,444
PostgreSQL DbLink Compilation on Solaris 10
After successfully building dblink on solaris 10 using Sun C 5.9 SunOS_sparc 2007/05/03 and gmake. I ran gmake installcheck and got the following output: ========== running regression test queries ========== test dblink... FAILED ====================== 1 of 1 tests failed. The differences that caused some tests to f...
To solve this issue I tried using the 8.2 dblink sources, instead of the latest version. You also need to make sure you use gnu make not the sun make.
PostgreSQL DbLink Compilation on Solaris 10 After successfully building dblink on solaris 10 using Sun C 5.9 SunOS_sparc 2007/05/03 and gmake. I ran gmake installcheck and got the following output: ========== running regression test queries ========== test dblink... FAILED ====================== 1 of 1 tests failed....
TITLE: PostgreSQL DbLink Compilation on Solaris 10 QUESTION: After successfully building dblink on solaris 10 using Sun C 5.9 SunOS_sparc 2007/05/03 and gmake. I ran gmake installcheck and got the following output: ========== running regression test queries ========== test dblink... FAILED ====================== 1 ...
[ "postgresql", "dblink" ]
1
1
938
2
0
2008-09-16T07:02:50.193000
2008-09-16T23:50:06.497000
69,979
69,995
Can I implement a web user authentication system in python without POST?
My university doesn't support the POST cgi method (I know, it's crazy), and I was hoping to be able to have a system where a user can have a username and password and log in securely. Is this even possible? If it's not, how would you do it with POST? Just out of curiosity. Cheers!
You can actually do it all with GET methods. However, you'll want to use a full challenge response protocol for the logins. (You can hash on the client side using javascript. You just need to send out a unique challenge each time.) You'll also want to use SSL to ensure that no one can see the strings as they go across....
Can I implement a web user authentication system in python without POST? My university doesn't support the POST cgi method (I know, it's crazy), and I was hoping to be able to have a system where a user can have a username and password and log in securely. Is this even possible? If it's not, how would you do it with PO...
TITLE: Can I implement a web user authentication system in python without POST? QUESTION: My university doesn't support the POST cgi method (I know, it's crazy), and I was hoping to be able to have a system where a user can have a username and password and log in securely. Is this even possible? If it's not, how would...
[ "python", "authentication", "cgi" ]
1
5
3,079
6
0
2008-09-16T07:07:42.550000
2008-09-16T07:10:40.033000
69,982
70,698
Writing a Firefox plugin for parsing a custom client-side language
I had an idea for a client-side language other than JavaScript, and I'd like to look into developing a Firefox plugin that would treat includes of this new language in a page, like, just as if it were a natively supported language. The plugin would do all of the language parsing and ideally be able to perform every ope...
@Nathan de Vries: no, actually, NPAPI plugins you suggested don't let one implement support for
Writing a Firefox plugin for parsing a custom client-side language I had an idea for a client-side language other than JavaScript, and I'd like to look into developing a Firefox plugin that would treat includes of this new language in a page, like, just as if it were a natively supported language. The plugin would do a...
TITLE: Writing a Firefox plugin for parsing a custom client-side language QUESTION: I had an idea for a client-side language other than JavaScript, and I'd like to look into developing a Firefox plugin that would treat includes of this new language in a page, like, just as if it were a natively supported language. The...
[ "firefox" ]
6
2
1,868
4
0
2008-09-16T07:08:05.827000
2008-09-16T09:25:12.003000
69,998
70,049
Tabs and spaces in vim
How do I prevent vim from replacing spaces with tabs when autoindent is on? An example: if I have two tabs and 7 spaces in the beginning of the line, and tabstop=3, and I press Enter, the next line has four tabs and 1 space in the beginning, but I don't want that...
It is perhaps a good idea not to use tabs at all.:set expandtab If you want to replace all the tabs in your file to 3 spaces (which will look pretty similar to tabstop=3 )::%s/^I/ / (where ^I is the TAB character) From the VIM online help: 'tabstop' 'ts' number (default 8) local to buffer Number of spaces that a in the...
Tabs and spaces in vim How do I prevent vim from replacing spaces with tabs when autoindent is on? An example: if I have two tabs and 7 spaces in the beginning of the line, and tabstop=3, and I press Enter, the next line has four tabs and 1 space in the beginning, but I don't want that...
TITLE: Tabs and spaces in vim QUESTION: How do I prevent vim from replacing spaces with tabs when autoindent is on? An example: if I have two tabs and 7 spaces in the beginning of the line, and tabstop=3, and I press Enter, the next line has four tabs and 1 space in the beginning, but I don't want that... ANSWER: It ...
[ "vim", "vi" ]
76
84
94,791
6
0
2008-09-16T07:11:20.077000
2008-09-16T07:23:38.113000
70,004
70,030
Using Lisp in C#
As a lot of people pointed out in this question, Lisp is mostly used as a learning experience. Nevertheless, it would be great if I could somehow use my Lisp algorithms and combine them with my C# programs. In college my profs never could tell me how to use my Lisp routines in a program (no, not writing a GUI in Lisp, ...
Try these.Net implementations of Lisp: IronScheme IronScheme will aim to be a R6RS conforming Scheme implementation based on the Microsoft DLR. L Sharp.NET L Sharp.NET is a powerful Lisp-like scripting language for.NET. It uses a Lisp dialect similar to Arc but tightly integrates with the.NET Framework which provides a...
Using Lisp in C# As a lot of people pointed out in this question, Lisp is mostly used as a learning experience. Nevertheless, it would be great if I could somehow use my Lisp algorithms and combine them with my C# programs. In college my profs never could tell me how to use my Lisp routines in a program (no, not writin...
TITLE: Using Lisp in C# QUESTION: As a lot of people pointed out in this question, Lisp is mostly used as a learning experience. Nevertheless, it would be great if I could somehow use my Lisp algorithms and combine them with my C# programs. In college my profs never could tell me how to use my Lisp routines in a progr...
[ "c#", "lisp" ]
13
14
13,782
7
0
2008-09-16T07:13:03.240000
2008-09-16T07:19:57.920000
70,013
70,630
How to Detect if I'm Compiling Code with a particular Visual Studio version?
Is there any way to know if I'm compiling under a specific Microsoft Visual Studio version?
_MSC_VER and possibly _MSC_FULL_VER is what you need. You can also examine visualc.hpp in any recent boost install for some usage examples. Some values for the more recent versions of the compiler are: MSVC++ 14.30 _MSC_VER == 1933 (Visual Studio 2022 version 17.3.4) MSVC++ 14.30 _MSC_VER == 1932 (Visual Studio 2022 ve...
How to Detect if I'm Compiling Code with a particular Visual Studio version? Is there any way to know if I'm compiling under a specific Microsoft Visual Studio version?
TITLE: How to Detect if I'm Compiling Code with a particular Visual Studio version? QUESTION: Is there any way to know if I'm compiling under a specific Microsoft Visual Studio version? ANSWER: _MSC_VER and possibly _MSC_FULL_VER is what you need. You can also examine visualc.hpp in any recent boost install for some ...
[ "c++", "visual-studio" ]
280
543
203,581
7
0
2008-09-16T07:15:43.437000
2008-09-16T09:14:11.123000
70,074
70,231
Ruby exception inheritance with dynamically generated classes
I'm new to Ruby, so I'm having some trouble understanding this weird exception problem I'm having. I'm using the ruby-aaws gem to access Amazon ECS: http://www.caliban.org/ruby/ruby-aws/. This defines a class Amazon::AWS:Error: module Amazon module AWS # All dynamically generated exceptions occur within this namespace....
Ok, I'll try to help here: First a module is not a class, it allows you to mix behaviour in a class. second see the following example: module A module B module Error def foobar puts "foo" end end end end class StandardError include A::B::Error end StandardError.new.kind_of?(A::B::Error) StandardError.new.kind_of?(A::...
Ruby exception inheritance with dynamically generated classes I'm new to Ruby, so I'm having some trouble understanding this weird exception problem I'm having. I'm using the ruby-aaws gem to access Amazon ECS: http://www.caliban.org/ruby/ruby-aws/. This defines a class Amazon::AWS:Error: module Amazon module AWS # All...
TITLE: Ruby exception inheritance with dynamically generated classes QUESTION: I'm new to Ruby, so I'm having some trouble understanding this weird exception problem I'm having. I'm using the ruby-aaws gem to access Amazon ECS: http://www.caliban.org/ruby/ruby-aws/. This defines a class Amazon::AWS:Error: module Amazo...
[ "ruby", "exception", "metaprogramming" ]
3
5
2,538
4
0
2008-09-16T07:29:10.847000
2008-09-16T08:00:17.450000
70,090
77,292
Visually customize autocomplete in Wicket
How can I visually customize autocomplete fields in Wicket (change colors, fonts, etc.)?
You can use CSS to modify the look of this component. For the Ajax auto-complete component in 1.3 the element you want to override is div.wicket-aa, so for example you might do: div.wicket-aa { background-color:white; border:1px solid #CCCCCC; color:black; } div.wicket-aa ul { list-style-image:none; list-style-position...
Visually customize autocomplete in Wicket How can I visually customize autocomplete fields in Wicket (change colors, fonts, etc.)?
TITLE: Visually customize autocomplete in Wicket QUESTION: How can I visually customize autocomplete fields in Wicket (change colors, fonts, etc.)? ANSWER: You can use CSS to modify the look of this component. For the Ajax auto-complete component in 1.3 the element you want to override is div.wicket-aa, so for exampl...
[ "autocomplete", "wicket" ]
4
8
2,796
2
0
2008-09-16T07:34:01.223000
2008-09-16T21:24:35.627000
70,096
70,138
How do I programmatically convert mp3 to an itunes-playable aac/m4a file?
I've been looking for a way to convert an mp3 to aac programmatically or via the command line with no luck. Ideally, I'd have a snippet of code that I could call from my rails app that converts an mp3 to an aac. I installed ffmpeg and libfaac and was able to create an aac file with the following command: ffmpeg -i test...
FFmpeg provides AAC encoding facilities if you've compiled them in. If you are using Windows you can grab full binaries from here ffmpeg -i source.mp3 -acodec libfaac -ab 128k dest.aac I'm not sure how you would call this from ruby. Also, be sure to set the bitrate appropriately.
How do I programmatically convert mp3 to an itunes-playable aac/m4a file? I've been looking for a way to convert an mp3 to aac programmatically or via the command line with no luck. Ideally, I'd have a snippet of code that I could call from my rails app that converts an mp3 to an aac. I installed ffmpeg and libfaac and...
TITLE: How do I programmatically convert mp3 to an itunes-playable aac/m4a file? QUESTION: I've been looking for a way to convert an mp3 to aac programmatically or via the command line with no luck. Ideally, I'd have a snippet of code that I could call from my rails app that converts an mp3 to an aac. I installed ffmp...
[ "ruby", "mp3", "aac", "m4a" ]
5
9
11,521
7
0
2008-09-16T07:35:16.837000
2008-09-16T07:42:33.683000
70,098
70,259
Is it bad to load many managed DLL's without using any types in them?
Background: At my company we are developing a bunch applications that are using the same core dll's. These dll's are using Spring.net's IoC-container to wire things up (auto-wiring). All applications are using the same spring configuration file, and this configuration file points to many classes in many different dll's...
If none of the code from the assembly is ever used, then eventually the pages from that assembly will be moved from memory into the page file in favour of actively used pages. In which case, the overall long-term effect is likely to be minor. Although, there will be a negative effect on startup time.
Is it bad to load many managed DLL's without using any types in them? Background: At my company we are developing a bunch applications that are using the same core dll's. These dll's are using Spring.net's IoC-container to wire things up (auto-wiring). All applications are using the same spring configuration file, and ...
TITLE: Is it bad to load many managed DLL's without using any types in them? QUESTION: Background: At my company we are developing a bunch applications that are using the same core dll's. These dll's are using Spring.net's IoC-container to wire things up (auto-wiring). All applications are using the same spring config...
[ "c#", ".net", "dll", "inversion-of-control", "spring.net" ]
3
1
643
4
0
2008-09-16T07:35:55.307000
2008-09-16T08:06:36.857000
70,109
70,128
DropDownList doesn't postback on SelectedIndexChanged
I'm writing an ASP.Net webform with some DropDownList controls on it. Then user changes selected item in one of dropdowns, ASP.Net doesn't seem to handle SelectedIndexChanged event until form is submitted with a 'Submit' button click. How do I make my dropdowns handle SelectedIndexChanged instantly? P.S. It's a classic...
Setting the AutoPostback property to true will cause it to postback when the selection is changed. Please note that this requires javascript to be enabled.
DropDownList doesn't postback on SelectedIndexChanged I'm writing an ASP.Net webform with some DropDownList controls on it. Then user changes selected item in one of dropdowns, ASP.Net doesn't seem to handle SelectedIndexChanged event until form is submitted with a 'Submit' button click. How do I make my dropdowns hand...
TITLE: DropDownList doesn't postback on SelectedIndexChanged QUESTION: I'm writing an ASP.Net webform with some DropDownList controls on it. Then user changes selected item in one of dropdowns, ASP.Net doesn't seem to handle SelectedIndexChanged event until form is submitted with a 'Submit' button click. How do I make...
[ "asp.net", "drop-down-menu" ]
13
26
41,843
4
0
2008-09-16T07:38:48.483000
2008-09-16T07:40:51.880000
70,140
70,173
What do the flags in a Maildir message filename mean?
I'm cleaning up some old Maildir folders, and finding messages with names like: 1095812260.M625118P61205V0300FF04I002DC537_0.redoak.cise.ufl.edu,S=2576:2,ST They don't show up in my IMAP client, so I presume there's some semaphore indicating the message already got moved somewhere else. Is that the case, and can the fi...
The 'M' is just part of the unique filename and has nothing to do with the fact that the mail doesn't show up in mail clients. The 'T' at the end of the filename, after the ':' sign, however tells the IMAP server that this message is Trashed. See http://cr.yp.to/proto/maildir.html
What do the flags in a Maildir message filename mean? I'm cleaning up some old Maildir folders, and finding messages with names like: 1095812260.M625118P61205V0300FF04I002DC537_0.redoak.cise.ufl.edu,S=2576:2,ST They don't show up in my IMAP client, so I presume there's some semaphore indicating the message already got ...
TITLE: What do the flags in a Maildir message filename mean? QUESTION: I'm cleaning up some old Maildir folders, and finding messages with names like: 1095812260.M625118P61205V0300FF04I002DC537_0.redoak.cise.ufl.edu,S=2576:2,ST They don't show up in my IMAP client, so I presume there's some semaphore indicating the me...
[ "imap", "maildir" ]
13
17
13,023
2
0
2008-09-16T07:43:07.210000
2008-09-16T07:49:37.163000
70,143
70,591
Merge multiple xslt stylesheets
I have a xslt stylesheet with multiple xsl:import s and I want to merge them all into the one xslt file. It is a limitation of the system we are using where it passes around the xsl stylesheet as a string object stored in memory. This is transmitted to remote machine where it performs the transformation. Since it is no...
You can use an XSL stylesheet to merge your stylesheets. However, this is equivalent to using the xsl:include element, not xsl:import (as Azat Razetdinov has already pointed out). You can read up on the difference here. Therefore you should first replace the xsl:import's with xsl:include's, resolve any conflicts and te...
Merge multiple xslt stylesheets I have a xslt stylesheet with multiple xsl:import s and I want to merge them all into the one xslt file. It is a limitation of the system we are using where it passes around the xsl stylesheet as a string object stored in memory. This is transmitted to remote machine where it performs th...
TITLE: Merge multiple xslt stylesheets QUESTION: I have a xslt stylesheet with multiple xsl:import s and I want to merge them all into the one xslt file. It is a limitation of the system we are using where it passes around the xsl stylesheet as a string object stored in memory. This is transmitted to remote machine wh...
[ "xslt" ]
9
16
9,077
5
0
2008-09-16T07:43:49.843000
2008-09-16T09:10:21.273000
70,150
78,260
What attributes help runtime .Net performance?
I am looking for attributes I can use to ensure the best runtime performance for my.Net application by giving hints to the loader, JIT compiler or ngen. For example we have DebuggableAttribute which should be set to not debug and not disable optimization for optimal performance. [Debuggable(false, false)] Are there any...
Ecma-335 specifies some more CompilationRelaxations for relaxed exception handling (so-called e-relaxed calls) in Annex F "Imprecise faults", but they have not been exposed by Microsoft. Specifically CompilationRelaxations.RelaxedArrayExceptions and CompilationRelaxations.RelaxedNullReferenceException are mentioned the...
What attributes help runtime .Net performance? I am looking for attributes I can use to ensure the best runtime performance for my.Net application by giving hints to the loader, JIT compiler or ngen. For example we have DebuggableAttribute which should be set to not debug and not disable optimization for optimal perfor...
TITLE: What attributes help runtime .Net performance? QUESTION: I am looking for attributes I can use to ensure the best runtime performance for my.Net application by giving hints to the loader, JIT compiler or ngen. For example we have DebuggableAttribute which should be set to not debug and not disable optimization ...
[ ".net", "performance", "runtime" ]
15
6
2,380
3
0
2008-09-16T07:44:52.760000
2008-09-16T23:14:42.087000
70,161
653,098
How to read values from numbers written as words?
As we all know numbers can be written either in numerics, or called by their names. While there are a lot of examples to be found that convert 123 into one hundred twenty three, I could not find good examples of how to convert it the other way around. Some of the caveats: cardinal/nominal or ordinal: "one" and "first" ...
I was playing around with a PEG parser to do what you wanted (and may post that as a separate answer later) when I noticed that there's a very simple algorithm that does a remarkably good job with common forms of numbers in English, Spanish, and German, at the very least. Working with English for example, you need a di...
How to read values from numbers written as words? As we all know numbers can be written either in numerics, or called by their names. While there are a lot of examples to be found that convert 123 into one hundred twenty three, I could not find good examples of how to convert it the other way around. Some of the caveat...
TITLE: How to read values from numbers written as words? QUESTION: As we all know numbers can be written either in numerics, or called by their names. While there are a lot of examples to be found that convert 123 into one hundred twenty three, I could not find good examples of how to convert it the other way around. ...
[ "algorithm", "language-agnostic", "parsing", "numbers", "nlp" ]
51
47
15,667
12
0
2008-09-16T07:47:36.760000
2009-03-17T05:28:46.030000
70,169
70,204
How to highlight source code in HTML?
I want to highlight C/C++/Java/C# etc source codes in my website. How can I do this? Is it a CPU intensive job to highlight the source code?
You can either do this server-side or client-side. It's not very processor intensive, but if you do it client side (using Javascript) there will be a noticeable lag. Most client side solutions revolve around Google Code's syntax highlighting engine. This seems to be the most popular one: SyntaxHighlighter Server-side s...
How to highlight source code in HTML? I want to highlight C/C++/Java/C# etc source codes in my website. How can I do this? Is it a CPU intensive job to highlight the source code?
TITLE: How to highlight source code in HTML? QUESTION: I want to highlight C/C++/Java/C# etc source codes in my website. How can I do this? Is it a CPU intensive job to highlight the source code? ANSWER: You can either do this server-side or client-side. It's not very processor intensive, but if you do it client side...
[ "html", "syntax-highlighting" ]
26
27
39,312
9
0
2008-09-16T07:48:51.563000
2008-09-16T07:53:41.037000
70,170
70,186
In a client-server application: How to send to the DB the user's application password?
I have an Java desktop application which connects directly with the DB (an Oracle). The application has multiple user accounts. What is the correct method to send the user's password (not DB password) over the network? I don't want to send it in plain text.
You could connect over a secure socket connection, or hash the password locally before sending it to the database (or better, both) - Ideally, the only time the password should exist in plain text form is prior to hashing. If you can do all of that on the client side, more the better.
In a client-server application: How to send to the DB the user's application password? I have an Java desktop application which connects directly with the DB (an Oracle). The application has multiple user accounts. What is the correct method to send the user's password (not DB password) over the network? I don't want t...
TITLE: In a client-server application: How to send to the DB the user's application password? QUESTION: I have an Java desktop application which connects directly with the DB (an Oracle). The application has multiple user accounts. What is the correct method to send the user's password (not DB password) over the netwo...
[ "java", "oracle", "security", "passwords" ]
2
5
1,009
5
0
2008-09-16T07:49:07.023000
2008-09-16T07:51:02.540000
70,216
70,253
What's the purpose of META-INF?
In Java, you often see a META-INF folder containing some meta files. What is the purpose of this folder and what can I put there?
Generally speaking, you should not put anything into META-INF yourself. Instead, you should rely upon whatever you use to package up your JAR. This is one of the areas where I think Ant really excels: specifying JAR file manifest attributes. It's very easy to say something like: At least, I think that's easy...:-) The ...
What's the purpose of META-INF? In Java, you often see a META-INF folder containing some meta files. What is the purpose of this folder and what can I put there?
TITLE: What's the purpose of META-INF? QUESTION: In Java, you often see a META-INF folder containing some meta files. What is the purpose of this folder and what can I put there? ANSWER: Generally speaking, you should not put anything into META-INF yourself. Instead, you should rely upon whatever you use to package u...
[ "java", "meta-inf" ]
364
76
338,110
13
0
2008-09-16T07:55:20.720000
2008-09-16T08:05:30.120000
70,269
70,937
Silverlight 2 Drag and Drop tutorials
I'm wondering if people can suggest the best tutorial that will walk me through the best way to do Drag and Drop with control collision detection etc, using MS Silverlight V2. I've done the Jesse Liberty tutorials at Silverlight.net, and they were a good introduction, but I'm looking for something a bit deeper. Suggest...
Here is a page that explained the solution for my use. Silverlight 2 Drag, Drop, and Import Content Example
Silverlight 2 Drag and Drop tutorials I'm wondering if people can suggest the best tutorial that will walk me through the best way to do Drag and Drop with control collision detection etc, using MS Silverlight V2. I've done the Jesse Liberty tutorials at Silverlight.net, and they were a good introduction, but I'm looki...
TITLE: Silverlight 2 Drag and Drop tutorials QUESTION: I'm wondering if people can suggest the best tutorial that will walk me through the best way to do Drag and Drop with control collision detection etc, using MS Silverlight V2. I've done the Jesse Liberty tutorials at Silverlight.net, and they were a good introduct...
[ "silverlight" ]
5
3
6,048
4
0
2008-09-16T08:10:04.070000
2008-09-16T10:12:42.187000
70,272
70,296
Single Form Hide on Startup
I have an application with one form in it, and on the Load method I need to hide the form. The form will display itself when it has a need to (think along the lines of a outlook 2003 style popup), but I can' figure out how to hide the form on load without something messy. Any suggestions?
I'm coming at this from C#, but should be very similar in vb.net. In your main program file, in the Main method, you will have something like: Application.Run(new MainForm()); This creates a new main form and limits the lifetime of the application to the lifetime of the main form. However, if you remove the parameter t...
Single Form Hide on Startup I have an application with one form in it, and on the Load method I need to hide the form. The form will display itself when it has a need to (think along the lines of a outlook 2003 style popup), but I can' figure out how to hide the form on load without something messy. Any suggestions?
TITLE: Single Form Hide on Startup QUESTION: I have an application with one form in it, and on the Load method I need to hide the form. The form will display itself when it has a need to (think along the lines of a outlook 2003 style popup), but I can' figure out how to hide the form on load without something messy. A...
[ "c#", "vb.net", "winforms" ]
82
119
137,897
25
0
2008-09-16T08:10:53.773000
2008-09-16T08:16:36.100000
70,292
70,502
When should you use standard html tags/inputs and when should you use the asp.net controls?
As I put together each asp.net page It's clear that most of the time I could use the standard HTML tags just as easily as the web forms controls. When this is the case what is the lure of the webforms controls?
HTML controls will be output a lot faster than server controls since there is nothing required on part of the server.. It just literally copies the markup in the ASPX page. Server controls however require instantiation.. Parsing of the postback data and the like, this is obviously where the work comes in for the server...
When should you use standard html tags/inputs and when should you use the asp.net controls? As I put together each asp.net page It's clear that most of the time I could use the standard HTML tags just as easily as the web forms controls. When this is the case what is the lure of the webforms controls?
TITLE: When should you use standard html tags/inputs and when should you use the asp.net controls? QUESTION: As I put together each asp.net page It's clear that most of the time I could use the standard HTML tags just as easily as the web forms controls. When this is the case what is the lure of the webforms controls?...
[ "c#", "asp.net", "html", "visual-studio", "webforms" ]
2
5
337
2
0
2008-09-16T08:15:45.010000
2008-09-16T08:55:52.200000
70,303
70,375
How do you implement GetHashCode for structure with two string, when both strings are interchangeable
I have a structure in C#: public struct UserInfo { public string str1 { get; set; } public string str2 { get; set; } } The only rule is that UserInfo(str1="AA", str2="BB").Equals(UserInfo(str1="BB", str2="AA")) How to override the GetHashCode function for this structure?
MSDN: A hash function must have the following properties: If two objects compare as equal, the GetHashCode method for each object must return the same value. However, if two objects do not compare as equal, the GetHashCode methods for the two object do not have to return different values. The GetHashCode method for an ...
How do you implement GetHashCode for structure with two string, when both strings are interchangeable I have a structure in C#: public struct UserInfo { public string str1 { get; set; } public string str2 { get; set; } } The only rule is that UserInfo(str1="AA", str2="BB").Equals(UserInfo(str1="BB", str2="AA")) How to...
TITLE: How do you implement GetHashCode for structure with two string, when both strings are interchangeable QUESTION: I have a structure in C#: public struct UserInfo { public string str1 { get; set; } public string str2 { get; set; } } The only rule is that UserInfo(str1="AA", str2="BB").Equals(UserInfo(str1="BB", ...
[ "c#", "hashtable" ]
72
71
46,516
15
0
2008-09-16T08:17:43.553000
2008-09-16T08:32:00.213000
70,318
70,771
rake db:migrate doesn't detect new migration?
Experienced with Rails / ActiveRecord 2.1.1 You create a first version with (for example) ruby script\generate scaffold product title:string description:text image_url:string This create (for example) a migration file called 20080910122415_create_products.rb You apply the migration with rake db:migrate Now, you add a f...
You should be able to use rake db:migrate:up to force it to go forward, but then you risk missing interleaved migrations from other people on your team if you run rake db:migrate twice, it will reapply all your migrations. I encounter the same behavior on windows with SQLite, it might be a bug specific to such an envir...
rake db:migrate doesn't detect new migration? Experienced with Rails / ActiveRecord 2.1.1 You create a first version with (for example) ruby script\generate scaffold product title:string description:text image_url:string This create (for example) a migration file called 20080910122415_create_products.rb You apply the m...
TITLE: rake db:migrate doesn't detect new migration? QUESTION: Experienced with Rails / ActiveRecord 2.1.1 You create a first version with (for example) ruby script\generate scaffold product title:string description:text image_url:string This create (for example) a migration file called 20080910122415_create_products....
[ "ruby-on-rails", "activerecord", "migration" ]
6
1
21,162
4
0
2008-09-16T08:22:03.527000
2008-09-16T09:39:54.230000
70,324
70,358
Java inner class and static nested class
What is the main difference between an inner class and a static nested class in Java? Does design / implementation play a role in choosing one of these?
From the Java Tutorial: Nested classes are divided into two categories: static and non-static. Nested classes that are declared static are simply called static nested classes. Non-static nested classes are called inner classes. Static nested classes are accessed using the enclosing class name: OuterClass.StaticNestedCl...
Java inner class and static nested class What is the main difference between an inner class and a static nested class in Java? Does design / implementation play a role in choosing one of these?
TITLE: Java inner class and static nested class QUESTION: What is the main difference between an inner class and a static nested class in Java? Does design / implementation play a role in choosing one of these? ANSWER: From the Java Tutorial: Nested classes are divided into two categories: static and non-static. Nest...
[ "java", "inner-classes", "static-classes" ]
2,080
1,913
943,912
28
0
2008-09-16T08:22:35.727000
2008-09-16T08:28:34.090000
70,347
70,658
Zlib-compatible compression streams?
Are System.IO.Compression.GZipStream or System.IO.Compression.Deflate compatible with zlib compression?
From MSDN about System.IO.Compression.GZipStream: This class represents the gzip data format, which uses an industry standard algorithm for lossless file compression and decompression. From the zlib FAQ: The gz* functions in zlib on the other hand use the gzip format. So zlib and GZipStream should be interoperable, but...
Zlib-compatible compression streams? Are System.IO.Compression.GZipStream or System.IO.Compression.Deflate compatible with zlib compression?
TITLE: Zlib-compatible compression streams? QUESTION: Are System.IO.Compression.GZipStream or System.IO.Compression.Deflate compatible with zlib compression? ANSWER: From MSDN about System.IO.Compression.GZipStream: This class represents the gzip data format, which uses an industry standard algorithm for lossless fil...
[ "c#", "compression", "zlib" ]
14
10
22,910
8
0
2008-09-16T08:25:33.817000
2008-09-16T09:18:21.490000
70,361
70,422
ASP.NET Custom Control Styling
I am in the process of beginning work on several ASP.NET custom controls. I was wondering if I could get some input on your guys/girls thoughts on how you apply styling to your controls. I would rather push it so CSS, so for the few controls I have done in the past, I have simply stuck a string property which allows yo...
It would depend on how the custom controls are being used - A commercial, re-distributable control should be compliant with the VS IDE, and behave the way users expect it to when they implement the control. On the other hand there is no point in wasting a lot of time to get styling to work if you or your team are the o...
ASP.NET Custom Control Styling I am in the process of beginning work on several ASP.NET custom controls. I was wondering if I could get some input on your guys/girls thoughts on how you apply styling to your controls. I would rather push it so CSS, so for the few controls I have done in the past, I have simply stuck a ...
TITLE: ASP.NET Custom Control Styling QUESTION: I am in the process of beginning work on several ASP.NET custom controls. I was wondering if I could get some input on your guys/girls thoughts on how you apply styling to your controls. I would rather push it so CSS, so for the few controls I have done in the past, I ha...
[ "asp.net", "styles", "custom-server-controls" ]
3
3
1,358
2
0
2008-09-16T08:29:06.117000
2008-09-16T08:41:11.813000
70,371
70,396
Asp.net MVC routing ambiguous, two paths for same page
I'm trying out ASP.NET MVC routing and have of course stumbled across a problem. I have a section, /Admin/Pages/, and this is also accessible through /Pages/, which it shouldn't. What could I be missing? The routing code in global.asax: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{re...
I'd suggest adding an explicit route for /Pages/ at the beginning. The problem is that it's being handled by the Default route and deriving: controller = "Pages" action = "Index" id = "" which are exactly the same as the parameters for your Admin route.
Asp.net MVC routing ambiguous, two paths for same page I'm trying out ASP.NET MVC routing and have of course stumbled across a problem. I have a section, /Admin/Pages/, and this is also accessible through /Pages/, which it shouldn't. What could I be missing? The routing code in global.asax: public static void RegisterR...
TITLE: Asp.net MVC routing ambiguous, two paths for same page QUESTION: I'm trying out ASP.NET MVC routing and have of course stumbled across a problem. I have a section, /Admin/Pages/, and this is also accessible through /Pages/, which it shouldn't. What could I be missing? The routing code in global.asax: public sta...
[ "asp.net-mvc", "routes" ]
5
7
2,657
4
0
2008-09-16T08:31:30.743000
2008-09-16T08:36:06.100000
70,377
71,150
Remove VSMacros80 directory
Is there any way to prevent Visual Studio from creating a VSMacros80 folder in my default project directory?
I just found it out myself: If you add a trailing backslash to the Project Folder setting e.g. changing it from C:\dev to C:\dev\, the VSMacros80 directory will no longer be created. I tested it with Visual Studio 2005 SP1, with all windows updates installed.
Remove VSMacros80 directory Is there any way to prevent Visual Studio from creating a VSMacros80 folder in my default project directory?
TITLE: Remove VSMacros80 directory QUESTION: Is there any way to prevent Visual Studio from creating a VSMacros80 folder in my default project directory? ANSWER: I just found it out myself: If you add a trailing backslash to the Project Folder setting e.g. changing it from C:\dev to C:\dev\, the VSMacros80 directory ...
[ "visual-studio", "visual-studio-2005" ]
12
17
3,477
4
0
2008-09-16T08:32:09.463000
2008-09-16T10:49:29.540000
70,386
1,213,583
Icons on menus of MFC Feature Pack classes
There are three places where menus show up in the new MFC functionality (Feature Pack): In menu bars (CMFCMenuBar) In popup menus (CMFCPopupMenu) In the 'dropdown menu' version of CMFCButton I want to put icons (high-color and with transparancy) in the menus in all of them. I have found CFrameWndEx::OnDrawMenuImage() w...
This is how I got it to work: First, as the others said, create an invisible toolbar next to your main toolbar (I'm using the usual names based on AppWizard's names): MainFrm.h: class CMainFrame { //... CMFCToolBar m_wndToolBar; CMFCToolBar m_wndInvisibleToolBar; //... }; MainFrm.cpp: int CMainFrame::OnCreate(LPCREATE...
Icons on menus of MFC Feature Pack classes There are three places where menus show up in the new MFC functionality (Feature Pack): In menu bars (CMFCMenuBar) In popup menus (CMFCPopupMenu) In the 'dropdown menu' version of CMFCButton I want to put icons (high-color and with transparancy) in the menus in all of them. I ...
TITLE: Icons on menus of MFC Feature Pack classes QUESTION: There are three places where menus show up in the new MFC functionality (Feature Pack): In menu bars (CMFCMenuBar) In popup menus (CMFCPopupMenu) In the 'dropdown menu' version of CMFCButton I want to put icons (high-color and with transparancy) in the menus ...
[ "mfc", "mfc-feature-pack" ]
8
4
9,071
5
0
2008-09-16T08:34:36.460000
2009-07-31T16:36:14.847000
70,389
70,553
What is the Simplest Tomcat/Apache Connector (Windows)?
I have apache 2.2 and tomcat 5.5 running on a Windows XP machine. Which tomcat/apache connector is the easiest to set up and is well documented?
mod_proxy_ajp would be the easiest to use if you are using Apache 2.2. It is part of the Apache distribution so you don't need to install any additional software. In your httpd.conf you need to make sure that mod_proxy and mod_proxy_ajp are loaded: LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_ajp_modul...
What is the Simplest Tomcat/Apache Connector (Windows)? I have apache 2.2 and tomcat 5.5 running on a Windows XP machine. Which tomcat/apache connector is the easiest to set up and is well documented?
TITLE: What is the Simplest Tomcat/Apache Connector (Windows)? QUESTION: I have apache 2.2 and tomcat 5.5 running on a Windows XP machine. Which tomcat/apache connector is the easiest to set up and is well documented? ANSWER: mod_proxy_ajp would be the easiest to use if you are using Apache 2.2. It is part of the Apa...
[ "windows", "apache", "tomcat", "connector" ]
3
5
2,191
2
0
2008-09-16T08:34:53.387000
2008-09-16T09:03:40.463000
70,397
76,143
How should Rails models containing database and non-database datasources be broken up?
So I'm working on a Rails app to get the feeling for the whole thing. I've got a Product model that's a standard ActiveRecord model. However, I also want to get some additional product info from Amazon ECS. So my complete model gets some of its info from the database and some from the web service. My question is, shoul...
As with most things: it depends. Each of your ideas have merit. If it were me, I'd start out this way: class Product < ActiveRecord::Base has_one:aws_item end class AWSItem belongs_to:product end The key questions you want to ask yourself are: Are you only going to be offering AWS ECS items, or will you have other prod...
How should Rails models containing database and non-database datasources be broken up? So I'm working on a Rails app to get the feeling for the whole thing. I've got a Product model that's a standard ActiveRecord model. However, I also want to get some additional product info from Amazon ECS. So my complete model gets ...
TITLE: How should Rails models containing database and non-database datasources be broken up? QUESTION: So I'm working on a Rails app to get the feeling for the whole thing. I've got a Product model that's a standard ActiveRecord model. However, I also want to get some additional product info from Amazon ECS. So my co...
[ "ruby-on-rails", "ruby" ]
2
1
1,053
4
0
2008-09-16T08:36:12.993000
2008-09-16T19:43:21.207000
70,402
70,631
Why is quicksort better than mergesort?
I was asked this question during an interview. They're both O(nlogn) and yet most people use Quicksort instead of Mergesort. Why is that?
Quicksort has O( n 2 ) worst-case runtime and O( n log n ) average case runtime. However, it’s superior to merge sort in many scenarios because many factors influence an algorithm’s runtime, and, when taking them all together, quicksort wins out. In particular, the often-quoted runtime of sorting algorithms refers to t...
Why is quicksort better than mergesort? I was asked this question during an interview. They're both O(nlogn) and yet most people use Quicksort instead of Mergesort. Why is that?
TITLE: Why is quicksort better than mergesort? QUESTION: I was asked this question during an interview. They're both O(nlogn) and yet most people use Quicksort instead of Mergesort. Why is that? ANSWER: Quicksort has O( n 2 ) worst-case runtime and O( n log n ) average case runtime. However, it’s superior to merge so...
[ "algorithm", "sorting", "language-agnostic", "quicksort", "mergesort" ]
409
328
234,258
29
0
2008-09-16T08:37:52.477000
2008-09-16T09:14:24.870000
70,405
70,436
Does C# have a String Tokenizer like Java's?
I'm doing simple string input parsing and I am in need of a string tokenizer. I am new to C# but have programmed Java, and it seems natural that C# should have a string tokenizer. Does it? Where is it? How do I use it?
You could use String.Split method. class ExampleClass { public ExampleClass() { string exampleString = "there is a cat"; // Split string on spaces. This will separate all the words in a string string[] words = exampleString.Split(' '); foreach (string word in words) { Console.WriteLine(word); // there // is // a // cat...
Does C# have a String Tokenizer like Java's? I'm doing simple string input parsing and I am in need of a string tokenizer. I am new to C# but have programmed Java, and it seems natural that C# should have a string tokenizer. Does it? Where is it? How do I use it?
TITLE: Does C# have a String Tokenizer like Java's? QUESTION: I'm doing simple string input parsing and I am in need of a string tokenizer. I am new to C# but have programmed Java, and it seems natural that C# should have a string tokenizer. Does it? Where is it? How do I use it? ANSWER: You could use String.Split me...
[ "c#", "string", "parsing" ]
71
121
147,173
9
0
2008-09-16T08:38:15.767000
2008-09-16T08:43:55.097000
70,417
81,072
Intermittent error when attempting to control another database
I have the following code: Dim obj As New Access.Application obj.OpenCurrentDatabase (CurrentProject.Path & "\Working.mdb") obj.Run "Routine" obj.CloseCurrentDatabase Set obj = Nothing The problem I'm experimenting is a pop-up that tells me Access can't set the focus on the other database. As you can see from the code,...
I've been able to reproduce the error in 'development'. "This action cannot be completed because the other application is busy. Choose 'Switch To' to activate...." I really can't see the rest of the message, as it is blinking very fast. I guess this error is due to 'switching' between the two databases. I hope that, by...
Intermittent error when attempting to control another database I have the following code: Dim obj As New Access.Application obj.OpenCurrentDatabase (CurrentProject.Path & "\Working.mdb") obj.Run "Routine" obj.CloseCurrentDatabase Set obj = Nothing The problem I'm experimenting is a pop-up that tells me Access can't set...
TITLE: Intermittent error when attempting to control another database QUESTION: I have the following code: Dim obj As New Access.Application obj.OpenCurrentDatabase (CurrentProject.Path & "\Working.mdb") obj.Run "Routine" obj.CloseCurrentDatabase Set obj = Nothing The problem I'm experimenting is a pop-up that tells m...
[ "vba", "ms-access" ]
2
1
9,880
3
0
2008-09-16T08:40:16.807000
2008-09-17T08:18:49.783000
70,450
70,536
Is it worth encrypting email addresses in the database?
I'm already using salted hashing to store passwords in my database, which means that I should be immune to rainbow table attacks. I had a thought, though: what if someone does get hold of my database? It contains the users' email addresses. I can't really hash these, because I'll be using them to send notification emai...
Bruce Schneier has a good response to this kind of problem. Cryptography is not the solution to your security problems. It might be part of the solution, or it might be part of the problem. In many situations, cryptography starts out by making the problem worse, and it isn't at all clear that using cryptography is an i...
Is it worth encrypting email addresses in the database? I'm already using salted hashing to store passwords in my database, which means that I should be immune to rainbow table attacks. I had a thought, though: what if someone does get hold of my database? It contains the users' email addresses. I can't really hash the...
TITLE: Is it worth encrypting email addresses in the database? QUESTION: I'm already using salted hashing to store passwords in my database, which means that I should be immune to rainbow table attacks. I had a thought, though: what if someone does get hold of my database? It contains the users' email addresses. I can...
[ "security", "email", "encryption" ]
58
65
25,885
11
0
2008-09-16T08:47:28.553000
2008-09-16T09:00:17.790000
70,453
70,507
Which Scripting language is best?
For writing scripts for process automation in Linux platform, which scripting language will be better, shell script, Perl, Python, or anything else? I am new to all of them. I am just thinking to which one to go for.
The answer is: Whatever best fits the job! My rule of thumb; Bash - for a short script that might need a for loop to do something repetitively. Perl - anything to do with some kind of text processing or file processing, especially if it's a one off. Just do a dirty nasty perl script and be done with it Python - If it's...
Which Scripting language is best? For writing scripts for process automation in Linux platform, which scripting language will be better, shell script, Perl, Python, or anything else? I am new to all of them. I am just thinking to which one to go for.
TITLE: Which Scripting language is best? QUESTION: For writing scripts for process automation in Linux platform, which scripting language will be better, shell script, Perl, Python, or anything else? I am new to all of them. I am just thinking to which one to go for. ANSWER: The answer is: Whatever best fits the job!...
[ "linux", "scripting" ]
25
50
82,968
21
0
2008-09-16T08:47:52.500000
2008-09-16T08:56:14.430000
70,455
70,525
Cross-server SQL
I want to port data from one server's database to another server's database. The databases are both on a different mssql 2005 server. Replication is probably not an option since the destination database is generated from scratch on a [time interval] basis. Preferebly I would do something like insert * from db1/table1 i...
I think what you want to do is create a linked server as per this webarchive snapshot of msdn article from 2015 or this article from learn.microsoft.com. You would then select using a 4 part object name eg: Select * From ServerName.DbName.SchemaName.TableName
Cross-server SQL I want to port data from one server's database to another server's database. The databases are both on a different mssql 2005 server. Replication is probably not an option since the destination database is generated from scratch on a [time interval] basis. Preferebly I would do something like insert * ...
TITLE: Cross-server SQL QUESTION: I want to port data from one server's database to another server's database. The databases are both on a different mssql 2005 server. Replication is probably not an option since the destination database is generated from scratch on a [time interval] basis. Preferebly I would do someth...
[ "sql", "sql-server", "t-sql", "linked-server", "cross-server" ]
35
40
62,649
8
0
2008-09-16T08:48:57.533000
2008-09-16T08:59:04.843000
70,471
70,535
(no) Properties in Java?
So, I have willfully kept myself a Java n00b until recently, and my first real exposure brought about a minor shock: Java does not have C# style properties! Ok, I can live with that. However, I can also swear that I have seen property getter/setter code in Java in one codebase, but I cannot remember where. How was that...
There is a "standard" pattern for getters and setters in Java, called Bean properties. Basically any method starting with get, taking no arguments and returning a value, is a property getter for a property named as the rest of the method name (with a lowercased start letter). Likewise set creates a setter of a void met...
(no) Properties in Java? So, I have willfully kept myself a Java n00b until recently, and my first real exposure brought about a minor shock: Java does not have C# style properties! Ok, I can live with that. However, I can also swear that I have seen property getter/setter code in Java in one codebase, but I cannot rem...
TITLE: (no) Properties in Java? QUESTION: So, I have willfully kept myself a Java n00b until recently, and my first real exposure brought about a minor shock: Java does not have C# style properties! Ok, I can live with that. However, I can also swear that I have seen property getter/setter code in Java in one codebase...
[ "java", "getter-setter" ]
56
64
55,089
14
0
2008-09-16T08:52:01.083000
2008-09-16T09:00:15.590000
70,482
70,594
How do you unit-test code that interacts with and instantiates third-party COM objects?
One of the biggest issues currently holding me back from diving full steam into unit testing is that a really large percentage of the code I write is heavily dependent on third-party COM objects from different sources that also tend to interact with each other (I'm writing add-ins for Microsoft Office using several hel...
The traditional approach says that your client code should use a wrapper, which is responsible for instantiating the COM object. This wrapper can then be easily mocked. Because you've got parts of your code instantiating the COM objects directly, this doesn't really fit. If you can change that code, you could use the f...
How do you unit-test code that interacts with and instantiates third-party COM objects? One of the biggest issues currently holding me back from diving full steam into unit testing is that a really large percentage of the code I write is heavily dependent on third-party COM objects from different sources that also tend...
TITLE: How do you unit-test code that interacts with and instantiates third-party COM objects? QUESTION: One of the biggest issues currently holding me back from diving full steam into unit testing is that a really large percentage of the code I write is heavily dependent on third-party COM objects from different sour...
[ "delphi", "unit-testing", "com", "mocking" ]
6
6
559
3
0
2008-09-16T08:53:33.547000
2008-09-16T09:10:44.160000
70,501
74,711
Exposing nested arrays to COM from .NET
I have a method in.NET (C#) which returns string[][]. When using RegAsm or TlbExp (from the.NET 2.0 SDK) to create a COM type library for the containing assembly, I get the following warning: WARNING: There is no marshaling support for nested arrays. This warning results in the method in question not being exported int...
Even if you were to return an Object (which maps to a Variant in COM Interop), that doesn't solve your problem. VB will be able to "hold" onto it and "pass it around", but it won't be able to do anything with it. Technically, there is no exact equivalent in VB for a string[][]. However, if your array is not "jagged" (t...
Exposing nested arrays to COM from .NET I have a method in.NET (C#) which returns string[][]. When using RegAsm or TlbExp (from the.NET 2.0 SDK) to create a COM type library for the containing assembly, I get the following warning: WARNING: There is no marshaling support for nested arrays. This warning results in the m...
TITLE: Exposing nested arrays to COM from .NET QUESTION: I have a method in.NET (C#) which returns string[][]. When using RegAsm or TlbExp (from the.NET 2.0 SDK) to create a COM type library for the containing assembly, I get the following warning: WARNING: There is no marshaling support for nested arrays. This warnin...
[ ".net", "com", "vb6", "marshalling", "tlbexp" ]
0
4
2,511
2
0
2008-09-16T08:55:38.737000
2008-09-16T17:17:41.540000
70,513
70,977
What is the easiest way to wrap a raw .aac file into a .m4a container
This question is overflow from the following question: How do I programmatically convert mp3 to an itunes-playable aac/m4a file? Anyway, I learned how to create an aac file and then i found out that an aac is not just an m4a file with a different file extension. In fact, I need to somehow wrap the aac into an m4a conta...
mp4box if you want a dedicated tool; its probably the easiest way to go. ffmpeg can do the job too.
What is the easiest way to wrap a raw .aac file into a .m4a container This question is overflow from the following question: How do I programmatically convert mp3 to an itunes-playable aac/m4a file? Anyway, I learned how to create an aac file and then i found out that an aac is not just an m4a file with a different fil...
TITLE: What is the easiest way to wrap a raw .aac file into a .m4a container QUESTION: This question is overflow from the following question: How do I programmatically convert mp3 to an itunes-playable aac/m4a file? Anyway, I learned how to create an aac file and then i found out that an aac is not just an m4a file wi...
[ "containers", "aac", "m4a" ]
23
5
30,281
4
0
2008-09-16T08:56:58.203000
2008-09-16T10:18:53.730000
70,524
70,617
How does a Rails developer talk to Flex front ends?
I'm looking at Rails development as a backend to a Flex application and am trying to figure out the communication layer between the Rails app and the Flash Player. All of the things I am finding suggest using SOAP web services to communicate. However, Flash supports AMF which is nice and fast (and native). Is there any...
There is WebORB or RubyAMF which you can use to respond in AMF from Rails, the approaches are a bit different for each one so it depends on your needs. RubyAMF is discussed in the closing chapters of the Flexible Rails eBook which is a good resource on using Rails with Flex.
How does a Rails developer talk to Flex front ends? I'm looking at Rails development as a backend to a Flex application and am trying to figure out the communication layer between the Rails app and the Flash Player. All of the things I am finding suggest using SOAP web services to communicate. However, Flash supports A...
TITLE: How does a Rails developer talk to Flex front ends? QUESTION: I'm looking at Rails development as a backend to a Flex application and am trying to figure out the communication layer between the Rails app and the Flash Player. All of the things I am finding suggest using SOAP web services to communicate. However...
[ "ruby-on-rails", "apache-flex" ]
3
3
1,122
7
0
2008-09-16T08:58:58.680000
2008-09-16T09:13:04.530000
70,528
70,900
Why are Python's 'private' methods not actually private?
Python gives us the ability to create 'private' methods and variables within a class by prepending double underscores to the name, like this: __myPrivateMethod(). How, then, can one explain this >>>> class MyClass:... def myPublicMethod(self):... print 'public method'... def __myPrivateMethod(self):... print 'this is p...
The name scrambling is used to ensure that subclasses don't accidentally override the private methods and attributes of their superclasses. It's not designed to prevent deliberate access from outside. For example: >>> class Foo(object):... def __init__(self):... self.__baz = 42... def foo(self):... print self.__baz... ...
Why are Python's 'private' methods not actually private? Python gives us the ability to create 'private' methods and variables within a class by prepending double underscores to the name, like this: __myPrivateMethod(). How, then, can one explain this >>>> class MyClass:... def myPublicMethod(self):... print 'public me...
TITLE: Why are Python's 'private' methods not actually private? QUESTION: Python gives us the ability to create 'private' methods and variables within a class by prepending double underscores to the name, like this: __myPrivateMethod(). How, then, can one explain this >>>> class MyClass:... def myPublicMethod(self):.....
[ "python", "encapsulation", "information-hiding" ]
841
711
597,304
12
0
2008-09-16T08:59:32.377000
2008-09-16T10:06:07.943000
70,529
70,657
Counting occurrences in Vim without marking the buffer changed
In order to know how many times a pattern exists in current buffer, I do::%s/pattern-here/pattern-here/g It gives the number of occurrences of the pattern, but is obviously cumbersome and also has the side-effect of setting the 'changed' status. Is there a more elegant way to count?
To avoid the substitution, leave the second pattern empty, and add the “n” flag::%s/pattern-here//gn This is described as an official tip.
Counting occurrences in Vim without marking the buffer changed In order to know how many times a pattern exists in current buffer, I do::%s/pattern-here/pattern-here/g It gives the number of occurrences of the pattern, but is obviously cumbersome and also has the side-effect of setting the 'changed' status. Is there a ...
TITLE: Counting occurrences in Vim without marking the buffer changed QUESTION: In order to know how many times a pattern exists in current buffer, I do::%s/pattern-here/pattern-here/g It gives the number of occurrences of the pattern, but is obviously cumbersome and also has the side-effect of setting the 'changed' s...
[ "vim" ]
121
181
38,170
6
0
2008-09-16T08:59:57.087000
2008-09-16T09:18:01.693000
70,537
71,087
Cheat single inheritance in Java?
I have heard there is a way to cheat single inheritance and implement multiple inheritance in Java. Does anyone know how to implement this(with out using interface)? Just out of curiosity;-)
Sure you can, but it's tricky and you should really consider if that's the way you want to go. The idea is to use scope-based inheritance coupled with type-based one. Which is type-talk for saying that for internal purposes, inner classes "inherit" methods and fields of the outer class. It's a bit like mixins, where th...
Cheat single inheritance in Java? I have heard there is a way to cheat single inheritance and implement multiple inheritance in Java. Does anyone know how to implement this(with out using interface)? Just out of curiosity;-)
TITLE: Cheat single inheritance in Java? QUESTION: I have heard there is a way to cheat single inheritance and implement multiple inheritance in Java. Does anyone know how to implement this(with out using interface)? Just out of curiosity;-) ANSWER: Sure you can, but it's tricky and you should really consider if that...
[ "java", "oop", "inheritance" ]
8
20
4,972
13
0
2008-09-16T09:00:27.040000
2008-09-16T10:37:58.537000
70,554
70,580
How to conduct blackbox testing on an AJAX application?
What's the best, crossplatform way to perform blackbox tests on AJAX web applications? Ideally, the solution should have the following attributes: Able to integrate into a continuous integration build loop Cross platform so I you can run it on Windows laptops and Linux continuous integration servers Easy way to script ...
Selenium might be what you're looking for: http://selenium.openqa.org/ It allows you to script actions and evaluate the results. It's open-source (Apache 2.0), cross platform, and has nice tools.
How to conduct blackbox testing on an AJAX application? What's the best, crossplatform way to perform blackbox tests on AJAX web applications? Ideally, the solution should have the following attributes: Able to integrate into a continuous integration build loop Cross platform so I you can run it on Windows laptops and ...
TITLE: How to conduct blackbox testing on an AJAX application? QUESTION: What's the best, crossplatform way to perform blackbox tests on AJAX web applications? Ideally, the solution should have the following attributes: Able to integrate into a continuous integration build loop Cross platform so I you can run it on Wi...
[ "java", ".net", "javascript", "ajax", "testing" ]
7
5
585
2
0
2008-09-16T09:03:43.193000
2008-09-16T09:09:10.777000
70,560
70,656
How do I compare phrases for similarity?
When entering a question, stackoverflow presents you with a list of questions that it thinks likely to cover the same topic. I have seen similar features on other sites or in other programs, too (Help file systems, for example), but I've never programmed something like this myself. Now I'm curious to know what sort of ...
One approach is the so called bag-of-words model. As you guessed, first you count how many times words appear in the text (usually called document in the NLP-lingo). Then you throw out the so called stop words, such as "the", "a", "or" and so on. You're left with words and word counts. Do this for a while and you get a...
How do I compare phrases for similarity? When entering a question, stackoverflow presents you with a list of questions that it thinks likely to cover the same topic. I have seen similar features on other sites or in other programs, too (Help file systems, for example), but I've never programmed something like this myse...
TITLE: How do I compare phrases for similarity? QUESTION: When entering a question, stackoverflow presents you with a list of questions that it thinks likely to cover the same topic. I have seen similar features on other sites or in other programs, too (Help file systems, for example), but I've never programmed someth...
[ "algorithm", "full-text-search" ]
12
12
5,054
5
0
2008-09-16T09:04:44.750000
2008-09-16T09:18:01.147000
70,573
70,598
What's the best online source to learn Perl?
I am new to any scripting language. But, still I worked on scripting a bit like tailoring other scripts to work for my purpose. For me, what is the best online resource to learn Perl?
If you already know a bit of perl, PerlMonks is a great online resource. You can ask questions in their Seekers of Perl Wisdom section and the answers are often of very high quality. Many people who keep up with the latest developments in Perl hang out there. As an added bonus, if you ask a clear question, many times t...
What's the best online source to learn Perl? I am new to any scripting language. But, still I worked on scripting a bit like tailoring other scripts to work for my purpose. For me, what is the best online resource to learn Perl?
TITLE: What's the best online source to learn Perl? QUESTION: I am new to any scripting language. But, still I worked on scripting a bit like tailoring other scripts to work for my purpose. For me, what is the best online resource to learn Perl? ANSWER: If you already know a bit of perl, PerlMonks is a great online r...
[ "perl" ]
22
33
25,370
11
0
2008-09-16T09:07:42.357000
2008-09-16T09:11:24.923000
70,577
70,616
Best online resource to learn Python?
I am new to any scripting language. But, Still I worked on scripting a bit like tailoring other scripts to work for my purpose. For me, What is the best online resource to learn Python? [Response Summary:] Some Online Resources: http://docs.python.org/tut/tut.html - Beginners http://diveintopython3.ep.io/ - Intermediat...
If you need to learn python from scratch - you can start here: http://docs.python.org/tut/tut.html - good begginers guide If you need to extend your knowledge - continue here http://diveintopython3.ep.io/ - good intermediate level book If you need perfect skills - complete this http://www.pythonchallenge.com/ - outstan...
Best online resource to learn Python? I am new to any scripting language. But, Still I worked on scripting a bit like tailoring other scripts to work for my purpose. For me, What is the best online resource to learn Python? [Response Summary:] Some Online Resources: http://docs.python.org/tut/tut.html - Beginners http:...
TITLE: Best online resource to learn Python? QUESTION: I am new to any scripting language. But, Still I worked on scripting a bit like tailoring other scripts to work for my purpose. For me, What is the best online resource to learn Python? [Response Summary:] Some Online Resources: http://docs.python.org/tut/tut.html...
[ "python" ]
28
25
70,523
21
0
2008-09-16T09:08:47.377000
2008-09-16T09:12:58.490000
70,579
79,022
HTML: Valid id attribute values?
When creating the id attributes for HTML elements, what rules are there for the value?
For HTML 4, the answer is technically: ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). HTML 5 is even more permissive, saying only that an id must contain at least one character and ma...
HTML: Valid id attribute values? When creating the id attributes for HTML elements, what rules are there for the value?
TITLE: HTML: Valid id attribute values? QUESTION: When creating the id attributes for HTML elements, what rules are there for the value? ANSWER: For HTML 4, the answer is technically: ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), un...
[ "html" ]
2,289
1,891
554,638
27
0
2008-09-16T09:08:52.527000
2008-09-17T01:42:42.433000
70,602
70,901
What is the minimum client footprint required to connect C# to an Oracle database?
I have successfully connected to an Oracle database (10g) from C# (Visual Studio 2008) by downloading and installing the client administration tools and Visual Studio 2008 on my laptop. The installation footprint for Oracle Client tools was over 200Mb, and quite long winded. Does anyone know what the minimum workable f...
You need an Oracle Client to connect to an Oracle database. The easiest way is to install the Oracle Data Access Components. To minimize the footprint, I suggest the following: Use the Microsoft provider for Oracle (System.Data.OracleClient), which ships with the framework. Download the Oracle Instant Client Package - ...
What is the minimum client footprint required to connect C# to an Oracle database? I have successfully connected to an Oracle database (10g) from C# (Visual Studio 2008) by downloading and installing the client administration tools and Visual Studio 2008 on my laptop. The installation footprint for Oracle Client tools ...
TITLE: What is the minimum client footprint required to connect C# to an Oracle database? QUESTION: I have successfully connected to an Oracle database (10g) from C# (Visual Studio 2008) by downloading and installing the client administration tools and Visual Studio 2008 on my laptop. The installation footprint for Or...
[ "c#", "oracle", "client" ]
71
71
33,672
8
0
2008-09-16T09:11:44.937000
2008-09-16T10:06:11.513000
70,614
70,765
What must I know to use GNU Screen properly?
I've just introduced a friend to GNU Screen and they're having a hard time getting used to it. That makes me think about the essential things he needs to know about the excellent Screen utility, the same things that you'd think worthwhile to teach someone, a beginner, from the ground up. What are some analogies and han...
I've been using Screen for over 10 years and probably use less than half the features. So it's definitely not necessary to learn all its features right away (and I wouldn't recommend trying). My day-to-day commands are: ^A ^W - window list, where am I ^A ^C - create new window ^A space - next window ^A p - previous win...
What must I know to use GNU Screen properly? I've just introduced a friend to GNU Screen and they're having a hard time getting used to it. That makes me think about the essential things he needs to know about the excellent Screen utility, the same things that you'd think worthwhile to teach someone, a beginner, from t...
TITLE: What must I know to use GNU Screen properly? QUESTION: I've just introduced a friend to GNU Screen and they're having a hard time getting used to it. That makes me think about the essential things he needs to know about the excellent Screen utility, the same things that you'd think worthwhile to teach someone, ...
[ "gnu-screen" ]
110
96
50,060
18
0
2008-09-16T09:12:43.920000
2008-09-16T09:39:03.983000
70,625
70,777
Refactoring two basic classes
How would you refactor these two classes to abstract out the similarities? An abstract class? Simple inheritance? What would the refactored class(es) look like? public class LanguageCode { /// /// Get the lowercase two-character ISO 639-1 language code. /// public readonly string Value; public LanguageCode(string lang...
Unless you have a strong reason for refactoring (because you are going to add more classes like those in near future) the penalty of changing the design for such a small and contrived example would overcome the gain in maintenance or overhead in this scenario. Anyhow here is a possible design based on generic and lambd...
Refactoring two basic classes How would you refactor these two classes to abstract out the similarities? An abstract class? Simple inheritance? What would the refactored class(es) look like? public class LanguageCode { /// /// Get the lowercase two-character ISO 639-1 language code. /// public readonly string Value; p...
TITLE: Refactoring two basic classes QUESTION: How would you refactor these two classes to abstract out the similarities? An abstract class? Simple inheritance? What would the refactored class(es) look like? public class LanguageCode { /// /// Get the lowercase two-character ISO 639-1 language code. /// public readonl...
[ "cultureinfo", "regioninfo" ]
1
0
321
7
0
2008-09-16T09:13:33.310000
2008-09-16T09:41:03.277000
70,643
72,091
Setting Excel Number Format via xlcFormatNumber in an xll
I'm trying to set the number format of a cell but the call to xlcFormatNumber fails leaving the cell number format as "General". I can successfully set the value of the cell using xlSet. XLOPER xRet; XLOPER xRef; //try to set the format of cell A1 xRef.xltype = xltypeSRef; xRef.val.sref.count = 1; xRef.val.sref.ref.rw...
Thanks to Simon Murphy for the answer:- Smurf on Spreadsheets //It is necessary to select the cell to apply the formatting to Excel4 (xlcSelect, 0, 1, &xRef); //Then we apply the formatting Excel4( xlcFormatNumber, 0, 1, &xFormat);
Setting Excel Number Format via xlcFormatNumber in an xll I'm trying to set the number format of a cell but the call to xlcFormatNumber fails leaving the cell number format as "General". I can successfully set the value of the cell using xlSet. XLOPER xRet; XLOPER xRef; //try to set the format of cell A1 xRef.xltype =...
TITLE: Setting Excel Number Format via xlcFormatNumber in an xll QUESTION: I'm trying to set the number format of a cell but the call to xlcFormatNumber fails leaving the cell number format as "General". I can successfully set the value of the cell using xlSet. XLOPER xRet; XLOPER xRef; //try to set the format of cel...
[ "c++", "excel", "xll" ]
4
6
2,159
1
0
2008-09-16T09:16:02.523000
2008-09-16T13:21:02.250000
70,653
70,915
Python Authentication API
I'm looking for a python library that will help me to create an authentication method for a desktop app I'm writing. I have found several method in web framework such as django or turbogears. I just want a kind of username-password association stored into a local file. I can write it by myself, but I'm really it alread...
Treat the following as pseudo-code.. try: from hashlib import sha as hasher except ImportError: # You could probably exclude the try/except bit, # but older Python distros dont have hashlib. try: import sha as hasher except ImportError: import md5 as hasher def hash_password(password): """Returns the hashed version of...
Python Authentication API I'm looking for a python library that will help me to create an authentication method for a desktop app I'm writing. I have found several method in web framework such as django or turbogears. I just want a kind of username-password association stored into a local file. I can write it by myself...
TITLE: Python Authentication API QUESTION: I'm looking for a python library that will help me to create an authentication method for a desktop app I'm writing. I have found several method in web framework such as django or turbogears. I just want a kind of username-password association stored into a local file. I can ...
[ "python", "authentication", "desktop" ]
6
0
10,571
6
0
2008-09-16T09:17:41.007000
2008-09-16T10:08:57.360000
70,668
70,740
VMWare Server: Best way to backup images
What is the best way to backup VMWare Servers (1.0.x)? The virtual machines in question are our development environment, and run isololated from the main network (so you can't just copy data from virtual to real servers). The image files are normally in use and locked when the server is running, so it is difficult to b...
VMWare server includes the command line tool "vmware-cmd", which can be used to perform virtually any operation that can be performed through the console. In this case you would simply add a "vmware-cmd susepend" to your script before starting your backup, and a "vmware-cmd start" after the backup is completed. We use ...
VMWare Server: Best way to backup images What is the best way to backup VMWare Servers (1.0.x)? The virtual machines in question are our development environment, and run isololated from the main network (so you can't just copy data from virtual to real servers). The image files are normally in use and locked when the s...
TITLE: VMWare Server: Best way to backup images QUESTION: What is the best way to backup VMWare Servers (1.0.x)? The virtual machines in question are our development environment, and run isololated from the main network (so you can't just copy data from virtual to real servers). The image files are normally in use and...
[ "backup", "vmware", "virtualization" ]
6
5
16,104
5
0
2008-09-16T09:21:16.147000
2008-09-16T09:33:43.620000
70,681
463,862
Python Psycopg error and connection handling (v MySQLdb)
Is there a way to make psycopg and postgres deal with errors without having to reestablish the connection, like MySQLdb? The commented version of the below works with MySQLdb, the comments make it work with Psycopg2: results = {'felicitas': 3, 'volumes': 8, 'acillevs': 1, 'mosaics': 13, 'perat\xe9': 1, 'representative'...
First of all you should let psycopg do the escaping for you by passing to the execute() method the parameters instead of doing the formatting yourself with '%'. That is: cur.execute("insert into resultstab values (%s, %s)", (item, results[item])) Note how we use "%s" as a marker even for non-string values and avoid quo...
Python Psycopg error and connection handling (v MySQLdb) Is there a way to make psycopg and postgres deal with errors without having to reestablish the connection, like MySQLdb? The commented version of the below works with MySQLdb, the comments make it work with Psycopg2: results = {'felicitas': 3, 'volumes': 8, 'acil...
TITLE: Python Psycopg error and connection handling (v MySQLdb) QUESTION: Is there a way to make psycopg and postgres deal with errors without having to reestablish the connection, like MySQLdb? The commented version of the below works with MySQLdb, the comments make it work with Psycopg2: results = {'felicitas': 3, '...
[ "python", "mysql", "psycopg2" ]
2
2
2,269
2
0
2008-09-16T09:22:36.847000
2009-01-21T01:43:57.897000
70,689
71,399
What is an efficient way to implement a singleton pattern in Java?
What is an efficient way to implement a singleton design pattern in Java?
Use an enum: public enum Foo { INSTANCE; } Joshua Bloch explained this approach in his Effective Java Reloaded talk at Google I/O 2008: link to video. Also see slides 30-32 of his presentation ( effective_java_reloaded.pdf ): The Right Way to Implement a Serializable Singleton public enum Elvis { INSTANCE; private fina...
What is an efficient way to implement a singleton pattern in Java? What is an efficient way to implement a singleton design pattern in Java?
TITLE: What is an efficient way to implement a singleton pattern in Java? QUESTION: What is an efficient way to implement a singleton design pattern in Java? ANSWER: Use an enum: public enum Foo { INSTANCE; } Joshua Bloch explained this approach in his Effective Java Reloaded talk at Google I/O 2008: link to video. A...
[ "java", "singleton", "design-patterns" ]
852
815
336,871
29
0
2008-09-16T09:24:28.447000
2008-09-16T11:31:57.173000
70,694
72,207
Task Scheduler Problem Starting MSSQLSERVER
I am trying to create a Task Scheduler task to start my SQL Server 2005 instance every morning, because something stops it every night. This is a temporary solution until I can diagnose the stoppage. I created a task to run under my admin user, and to start the program, cmd with the arguments /c net start mssqlserver. ...
I would recommend opening the Services MMC snap-in (just run services.msc), finding the service and modifying the properties of the service to restart automatically when the service fails. Open the Services MMC snap-in (run services.msc) Locate the service. If you installed a default instance of SQL Server 2005 that wo...
Task Scheduler Problem Starting MSSQLSERVER I am trying to create a Task Scheduler task to start my SQL Server 2005 instance every morning, because something stops it every night. This is a temporary solution until I can diagnose the stoppage. I created a task to run under my admin user, and to start the program, cmd w...
TITLE: Task Scheduler Problem Starting MSSQLSERVER QUESTION: I am trying to create a Task Scheduler task to start my SQL Server 2005 instance every morning, because something stops it every night. This is a temporary solution until I can diagnose the stoppage. I created a task to run under my admin user, and to start ...
[ "sql-server", "sql-server-2005", "scheduled-tasks" ]
1
1
2,047
2
0
2008-09-16T09:24:39.320000
2008-09-16T13:33:22.157000
70,705
99,954
How to write a linter?
In my day job I, and others on my team write a lot of hardware models in Verilog-AMS, a language supported primarily by commercial vendors and a few opensource simulator projects. One thing that would make supporting each others code more helpful would be a LINTER that would check our code for common problems and assis...
lex/flex and yacc/bison provide easy-to-use, well-understood lexer- and parser-generators, and I'd really recommend doing something like that as opposed to doing it procedurally in e.g. Perl. Regular expressions are powerful stuff for ripping apart strings with relatively-, but not totally-fixed structure. With any rea...
How to write a linter? In my day job I, and others on my team write a lot of hardware models in Verilog-AMS, a language supported primarily by commercial vendors and a few opensource simulator projects. One thing that would make supporting each others code more helpful would be a LINTER that would check our code for co...
TITLE: How to write a linter? QUESTION: In my day job I, and others on my team write a lot of hardware models in Verilog-AMS, a language supported primarily by commercial vendors and a few opensource simulator projects. One thing that would make supporting each others code more helpful would be a LINTER that would che...
[ "coding-style", "verilog", "syntax-checking" ]
25
19
18,345
7
0
2008-09-16T09:26:08.273000
2008-09-19T05:50:49.373000
70,721
71,493
Oracle Client Upgrade from 9 to 10
Last Friday where I work, an oracle client was upgarded and our IIS server from version 9 to version 10. Now that its on version 10, we are seeing a lot of connections being open up to the database. It is opening up so many connections that we cannot log onto the database using tools like PlSQL developer or Toad. We ne...
Which connection library are you using? OO4O, ODP, Other? I'm working from memories of old issues here, so the details are a little fuzzy. With OO4O there are two different ways to initialize the library. One tries to re-use connections more than the other. In ODP the default is to use connection pooling. Sometimes thi...
Oracle Client Upgrade from 9 to 10 Last Friday where I work, an oracle client was upgarded and our IIS server from version 9 to version 10. Now that its on version 10, we are seeing a lot of connections being open up to the database. It is opening up so many connections that we cannot log onto the database using tools ...
TITLE: Oracle Client Upgrade from 9 to 10 QUESTION: Last Friday where I work, an oracle client was upgarded and our IIS server from version 9 to version 10. Now that its on version 10, we are seeing a lot of connections being open up to the database. It is opening up so many connections that we cannot log onto the dat...
[ "oracle" ]
0
1
1,230
2
0
2008-09-16T09:30:02.040000
2008-09-16T11:48:36.277000