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
66,382
66,710
Is it possible to cache a value evaluated in a lambda expression?
In the ContainsIngredients method in the following code, is it possible to cache the p.Ingredients value instead of explicitly referencing it several times? This is a fairly trivial example that I just cooked up for illustrative purposes, but the code I'm working on references values deep inside p eg. p.InnerObject.Exp...
Can't you simply write your boolean expression in a separate static function which you call from your lambda - passing p.Ingredients as a parameter... private static bool IsIngredientPresent(IngredientBag i, string ingredientType, string ingredient) { return i!= null && i.Contains(ingredientType) && i.Get(ingredientTyp...
Is it possible to cache a value evaluated in a lambda expression? In the ContainsIngredients method in the following code, is it possible to cache the p.Ingredients value instead of explicitly referencing it several times? This is a fairly trivial example that I just cooked up for illustrative purposes, but the code I'...
TITLE: Is it possible to cache a value evaluated in a lambda expression? QUESTION: In the ContainsIngredients method in the following code, is it possible to cache the p.Ingredients value instead of explicitly referencing it several times? This is a fairly trivial example that I just cooked up for illustrative purpose...
[ "c#", "linq", "lambda", "predicate" ]
4
2
4,866
5
0
2008-09-15T20:04:37.717000
2008-09-15T20:39:08.770000
66,402
66,565
faster Math.exp() via JNI?
I need to calculate Math.exp() from java very frequently, is it possible to get a native version to run faster than java 's Math.exp()?? I tried just jni + C, but it's slower than just plain java.
+1 to writing your own exp() implementation. That is, if this is really a bottle-neck in your application. If you can deal with a little inaccuracy, there are a number of extremely efficient exponent estimation algorithms out there, some of them dating back centuries. As I understand it, Java's exp() implementation is ...
faster Math.exp() via JNI? I need to calculate Math.exp() from java very frequently, is it possible to get a native version to run faster than java 's Math.exp()?? I tried just jni + C, but it's slower than just plain java.
TITLE: faster Math.exp() via JNI? QUESTION: I need to calculate Math.exp() from java very frequently, is it possible to get a native version to run faster than java 's Math.exp()?? I tried just jni + C, but it's slower than just plain java. ANSWER: +1 to writing your own exp() implementation. That is, if this is real...
[ "java", "c", "optimization", "java-native-interface" ]
10
12
5,029
15
0
2008-09-15T20:06:16.293000
2008-09-15T20:22:54.770000
66,420
66,434
How do you launch the JavaScript debugger in Google Chrome?
When using Google Chrome, I want to debug some JavaScript code. How can I do that?
Windows: CTRL - SHIFT - J OR F12 Mac: ⌥ - ⌘ - J Also available through the wrench menu (Tools > JavaScript Console):
How do you launch the JavaScript debugger in Google Chrome? When using Google Chrome, I want to debug some JavaScript code. How can I do that?
TITLE: How do you launch the JavaScript debugger in Google Chrome? QUESTION: When using Google Chrome, I want to debug some JavaScript code. How can I do that? ANSWER: Windows: CTRL - SHIFT - J OR F12 Mac: ⌥ - ⌘ - J Also available through the wrench menu (Tools > JavaScript Console):
[ "javascript", "google-chrome", "debugging", "google-chrome-devtools" ]
444
320
732,506
15
0
2008-09-15T20:07:21.330000
2008-09-15T20:08:22.120000
66,423
66,481
Can a servlet determine if the posted data is multipart/form-data?
I have a servlet that is used for many different actions, used in the Front Controller pattern. Does anyone know if it is possible to tell if the data posted back to it is enctype="multipart/form-data"? I can't read the request parameters until I decide this, so I can't dispatch the request to the proper controller. An...
Yes, the Content-type header in the user agent's request should include multipart/form-data as described in (at least) the HTML4 spec: http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2
Can a servlet determine if the posted data is multipart/form-data? I have a servlet that is used for many different actions, used in the Front Controller pattern. Does anyone know if it is possible to tell if the data posted back to it is enctype="multipart/form-data"? I can't read the request parameters until I decide...
TITLE: Can a servlet determine if the posted data is multipart/form-data? QUESTION: I have a servlet that is used for many different actions, used in the Front Controller pattern. Does anyone know if it is possible to tell if the data posted back to it is enctype="multipart/form-data"? I can't read the request paramet...
[ "java", "servlets", "multipartform-data", "front-controller" ]
11
17
17,888
7
0
2008-09-15T20:07:32.700000
2008-09-15T20:13:58.147000
66,446
66,577
What is the best OpenGL java binding?
I am trying to achieve better performance for my Java SWT application, and I just found out it is possible to use OpenGL in SWT. It seems there are more than one Java binding for OpenGL. Which one do you prefer? Note that I have never used OpenGL before, and that the application needs to work on Windows, Linux and Mac ...
JOGL My reasons can be quoted off the previously linked site: JOGL provides full access to the APIs in the OpenGL 2.0 specification as well as nearly all vendor extensions, and integrates with the AWT and Swing widget sets. Also if you want to have some fun learning and poking around, Processing is an excellent way to ...
What is the best OpenGL java binding? I am trying to achieve better performance for my Java SWT application, and I just found out it is possible to use OpenGL in SWT. It seems there are more than one Java binding for OpenGL. Which one do you prefer? Note that I have never used OpenGL before, and that the application ne...
TITLE: What is the best OpenGL java binding? QUESTION: I am trying to achieve better performance for my Java SWT application, and I just found out it is possible to use OpenGL in SWT. It seems there are more than one Java binding for OpenGL. Which one do you prefer? Note that I have never used OpenGL before, and that ...
[ "java", "user-interface", "opengl", "performance", "swt" ]
17
9
13,915
6
0
2008-09-15T20:09:44.693000
2008-09-15T20:24:14.580000
66,455
86,170
Is there an easy way to change the behavior of a Java/Swing control when it gets focus?
For most GUI's I've used, when a control that contains text gets the focus, the entire contents of the control are selected. This means if you just start typing, you completely replace the former contents. Example: You have spin control that is initialized with the value zero. You tab to it and type "1" The value in th...
After reading the replies so far (Thanks!) I passed the outermost JPanel to the following method: void addTextFocusSelect(JComponent component){ if(component instanceof JTextComponent){ component.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent event) { super.focusGained(event); JTextC...
Is there an easy way to change the behavior of a Java/Swing control when it gets focus? For most GUI's I've used, when a control that contains text gets the focus, the entire contents of the control are selected. This means if you just start typing, you completely replace the former contents. Example: You have spin con...
TITLE: Is there an easy way to change the behavior of a Java/Swing control when it gets focus? QUESTION: For most GUI's I've used, when a control that contains text gets the focus, the entire contents of the control are selected. This means if you just start typing, you completely replace the former contents. Example:...
[ "java", "user-interface", "swing" ]
7
1
1,073
5
0
2008-09-15T20:10:56.873000
2008-09-17T18:30:40.780000
66,475
66,595
How can I get Column number of the cursor in a TextBox in C#?
I've got a multiline textBox that I would like to have a label on the form displaying the current line and column position of, as Visual Studio does. I know I can get the line # with GetLineFromCharIndex, but how can I get the column # on that line? (I really want the Cursor Position on that line, not 'column', per se)
int line = textbox.GetLineFromCharIndex(textbox.SelectionStart); int column = textbox.SelectionStart - textbox.GetFirstCharIndexFromLine(line);
How can I get Column number of the cursor in a TextBox in C#? I've got a multiline textBox that I would like to have a label on the form displaying the current line and column position of, as Visual Studio does. I know I can get the line # with GetLineFromCharIndex, but how can I get the column # on that line? (I reall...
TITLE: How can I get Column number of the cursor in a TextBox in C#? QUESTION: I've got a multiline textBox that I would like to have a label on the form displaying the current line and column position of, as Visual Studio does. I know I can get the line # with GetLineFromCharIndex, but how can I get the column # on t...
[ "c#", "windows", "user-interface" ]
7
12
3,530
3
0
2008-09-15T20:12:57.900000
2008-09-15T20:26:27.430000
66,486
67,050
How do I stub data for designers when using Expression Blend and Visual Studio?
We are trying out Visual Studio 2008 and Expression Blend on a new project. The goal is to clearly define the role of the developer and designer as separate, but reap the benefit of the developer being able to directly consume the XAML produced by the designer. For the most part this has worked great, and I really like...
I would suggest reading this blog. The final method seems to work well, your test data shows up in Blend very nicely. Just keep in mind that you have to compile the DLL before it will display the data.
How do I stub data for designers when using Expression Blend and Visual Studio? We are trying out Visual Studio 2008 and Expression Blend on a new project. The goal is to clearly define the role of the developer and designer as separate, but reap the benefit of the developer being able to directly consume the XAML prod...
TITLE: How do I stub data for designers when using Expression Blend and Visual Studio? QUESTION: We are trying out Visual Studio 2008 and Expression Blend on a new project. The goal is to clearly define the role of the developer and designer as separate, but reap the benefit of the developer being able to directly con...
[ "wpf", "visual-studio-2008", "xaml", "expression-blend" ]
4
4
604
2
0
2008-09-15T20:14:39.347000
2008-09-15T21:16:10.960000
66,504
66,569
Java VNC Libraries
Are there any VNC Libraries for Java, I need to build a JSP/Servlet based VNC server, to allow user to share their desktops with helpdesk. I've seen jVNC, but i'd like to build it myself, for a University project. In particular, I'm looking for Java Libraries that I can use inside another servlet based application. Unf...
have you looked at the tightVNC source? It is fairly terse http://www.tightvnc.com/download.html
Java VNC Libraries Are there any VNC Libraries for Java, I need to build a JSP/Servlet based VNC server, to allow user to share their desktops with helpdesk. I've seen jVNC, but i'd like to build it myself, for a University project. In particular, I'm looking for Java Libraries that I can use inside another servlet bas...
TITLE: Java VNC Libraries QUESTION: Are there any VNC Libraries for Java, I need to build a JSP/Servlet based VNC server, to allow user to share their desktops with helpdesk. I've seen jVNC, but i'd like to build it myself, for a University project. In particular, I'm looking for Java Libraries that I can use inside a...
[ "java", "vnc" ]
5
5
5,946
1
0
2008-09-15T20:16:35.410000
2008-09-15T20:23:20.057000
66,518
66,586
Flip an Image horizontally
I need to flip an image so that a character faces in the right direction. This needs to be done "on the fly' as they say. The issue I am having is that with Gif images, I seem to lose the transparency. (The background goes white) Below is the code: (Alternatively someone could send me to a good example) $img = imagecre...
Shouldn't this: imagecolortransparent($img, imagecolorallocate($img, 0, 0, 0)); imagealphablending($img, false); imagesavealpha($img, true);...be this: imagecolortransparent($temp, imagecolorallocate($img, 0, 0, 0)); imagealphablending($temp, false); imagesavealpha($temp, true); Note you should be calling these functio...
Flip an Image horizontally I need to flip an image so that a character faces in the right direction. This needs to be done "on the fly' as they say. The issue I am having is that with Gif images, I seem to lose the transparency. (The background goes white) Below is the code: (Alternatively someone could send me to a go...
TITLE: Flip an Image horizontally QUESTION: I need to flip an image so that a character faces in the right direction. This needs to be done "on the fly' as they say. The issue I am having is that with Gif images, I seem to lose the transparency. (The background goes white) Below is the code: (Alternatively someone cou...
[ "php" ]
1
2
4,179
3
0
2008-09-15T20:17:52.160000
2008-09-15T20:25:24.170000
66,525
85,778
Does anybody know how to correctly install ANTLR to work with .Net?
Can ANTLR output C# using StringTemplate or any text I want it to like Yacc/Bison or does it only output to java? From the examples I've looked at it appears to be a very java centric tool.
The ANTLR IDE has option by which you can switch between Java and C# code generation. Better, consult this article (the Specifying Code Generation section): http://www.antlr2.org/doc/csharp-runtime.html
Does anybody know how to correctly install ANTLR to work with .Net? Can ANTLR output C# using StringTemplate or any text I want it to like Yacc/Bison or does it only output to java? From the examples I've looked at it appears to be a very java centric tool.
TITLE: Does anybody know how to correctly install ANTLR to work with .Net? QUESTION: Can ANTLR output C# using StringTemplate or any text I want it to like Yacc/Bison or does it only output to java? From the examples I've looked at it appears to be a very java centric tool. ANSWER: The ANTLR IDE has option by which y...
[ "antlr" ]
1
1
442
4
0
2008-09-15T20:18:31.410000
2008-09-17T17:47:35.237000
66,528
66,697
Java EE SqlResultSetMapping Syntax
I have the following Java 6 code: Query q = em.createNativeQuery( "select T.* " + "from Trip T join Itinerary I on (T.itinerary_id=I.id) " + "where I.launchDate between:start and:end " + "or ADDDATE(I.launchDate, I.equipmentPullDayOfTrip) between:start and:end", "TripResults" ); q.setParameter( "start", range.getStart...
The Hibernate annotations docs ( http://www.hibernate.org/hib_docs/annotations/reference/en/html_single/ ) suggest that this should be a class-level annotation rather than occurring inline within your code. And indeed when I paste that code into my IDE and move it around, the compile errors are present when the annotat...
Java EE SqlResultSetMapping Syntax I have the following Java 6 code: Query q = em.createNativeQuery( "select T.* " + "from Trip T join Itinerary I on (T.itinerary_id=I.id) " + "where I.launchDate between:start and:end " + "or ADDDATE(I.launchDate, I.equipmentPullDayOfTrip) between:start and:end", "TripResults" ); q.se...
TITLE: Java EE SqlResultSetMapping Syntax QUESTION: I have the following Java 6 code: Query q = em.createNativeQuery( "select T.* " + "from Trip T join Itinerary I on (T.itinerary_id=I.id) " + "where I.launchDate between:start and:end " + "or ADDDATE(I.launchDate, I.equipmentPullDayOfTrip) between:start and:end", "Tri...
[ "java", "syntax", "jpa", "jakarta-ee" ]
3
1
9,697
2
0
2008-09-15T20:18:56.450000
2008-09-15T20:37:09.337000
66,542
1,685,449
How do I run Oracle plsql procedure from Lisp?
How do I get started?
I have found the easiest way to achieve this by using Clojure. Here is the example code: (ns example (:require [clojure.contrib.sql:as sql]) (:import [java.sql Types])) (def devdb {:classname "oracle.jdbc.driver.OracleDriver":subprotocol "oracle":subname "thin:username/password@localhost:1509:devdb":create true}) (defn...
How do I run Oracle plsql procedure from Lisp? How do I get started?
TITLE: How do I run Oracle plsql procedure from Lisp? QUESTION: How do I get started? ANSWER: I have found the easiest way to achieve this by using Clojure. Here is the example code: (ns example (:require [clojure.contrib.sql:as sql]) (:import [java.sql Types])) (def devdb {:classname "oracle.jdbc.driver.OracleDriver...
[ "oracle", "stored-procedures", "plsql", "lisp", "clojure" ]
4
5
2,245
3
0
2008-09-15T20:20:18.800000
2009-11-06T04:37:41.407000
66,606
66,617
What package includes AB the Apache Server Benchmarking Tool in Ubuntu
I'm trying to find ab - Apache HTTP server benchmarking tool for Ubuntu, I'm hoping there's a package I can install for it. I decided I need to do some simple load testing on my applications.
% sudo apt-get install apache2-utils The command-not-found package in Ubuntu provides some slick functionality where if you type a command that can't be resolved to an executable (or bash function or whatever) it will query your apt sources and find a package that contains the binary you tried to execute. So, in this c...
What package includes AB the Apache Server Benchmarking Tool in Ubuntu I'm trying to find ab - Apache HTTP server benchmarking tool for Ubuntu, I'm hoping there's a package I can install for it. I decided I need to do some simple load testing on my applications.
TITLE: What package includes AB the Apache Server Benchmarking Tool in Ubuntu QUESTION: I'm trying to find ab - Apache HTTP server benchmarking tool for Ubuntu, I'm hoping there's a package I can install for it. I decided I need to do some simple load testing on my applications. ANSWER: % sudo apt-get install apache2...
[ "linux", "apache", "ubuntu" ]
86
131
38,783
2
0
2008-09-15T20:27:54.757000
2008-09-15T20:29:06.533000
66,610
66,667
How can I create a site in php and have it generate a static version?
For a particular project I have, no server side code is allowed. How can I create the web site in php (with includes, conditionals, etc) and then have that converted into a static html site that I can give to the client? Update: Thanks to everyone who suggested wget. That's what I used. I should have specified that I w...
If you have a Linux system available to you use wget: wget -k -K -E -r -l 10 -p -N -F -nH http://website.com/ Options -k: convert links to relative -K: keep an original versions of files without the conversions made by wget -E: rename html files to.html (if they don’t already have an htm(l) extension) -r: recursive… of...
How can I create a site in php and have it generate a static version? For a particular project I have, no server side code is allowed. How can I create the web site in php (with includes, conditionals, etc) and then have that converted into a static html site that I can give to the client? Update: Thanks to everyone wh...
TITLE: How can I create a site in php and have it generate a static version? QUESTION: For a particular project I have, no server side code is allowed. How can I create the web site in php (with includes, conditionals, etc) and then have that converted into a static html site that I can give to the client? Update: Tha...
[ "php", "html", "wget" ]
21
45
12,303
11
0
2008-09-15T20:28:08.080000
2008-09-15T20:34:31.433000
66,622
66,655
Threadsafe foreach enumeration of lists
I need to enumerate though generic IList<> of objects. The contents of the list may change, as in being added or removed by other threads, and this will kill my enumeration with a "Collection was modified; enumeration operation may not execute." What is a good way of doing threadsafe foreach on a IList<>? prefferably w...
Cloning the list is the easiest and best way, because it ensures your list won't change out from under you. If the list is simply too large to clone, consider putting a lock around it that must be taken before reading/writing to it.
Threadsafe foreach enumeration of lists I need to enumerate though generic IList<> of objects. The contents of the list may change, as in being added or removed by other threads, and this will kill my enumeration with a "Collection was modified; enumeration operation may not execute." What is a good way of doing thread...
TITLE: Threadsafe foreach enumeration of lists QUESTION: I need to enumerate though generic IList<> of objects. The contents of the list may change, as in being added or removed by other threads, and this will kill my enumeration with a "Collection was modified; enumeration operation may not execute." What is a good w...
[ "c#", "multithreading" ]
11
12
19,336
11
0
2008-09-15T20:29:54.770000
2008-09-15T20:33:15.137000
66,635
66,683
Namespaces in C#
I am using an ASP.NET MVC project and everytime I add a class to a folder it makes really long namespaces. Example: Project = Tully.Saps.Data Folder = DataAccess/Interfaces Namespace = Tully.Saps.Data.DataAccess.Interfaces Folder = DataAccess/MbNetRepositories Namespace = Tully.Saps.Data.DataAccess.MbNetRepositories Q...
Leave them alone and add the usings. You're asking for trouble manually changing things like that (harder to debug, inconsistent with other projects, et cetera).
Namespaces in C# I am using an ASP.NET MVC project and everytime I add a class to a folder it makes really long namespaces. Example: Project = Tully.Saps.Data Folder = DataAccess/Interfaces Namespace = Tully.Saps.Data.DataAccess.Interfaces Folder = DataAccess/MbNetRepositories Namespace = Tully.Saps.Data.DataAccess.Mb...
TITLE: Namespaces in C# QUESTION: I am using an ASP.NET MVC project and everytime I add a class to a folder it makes really long namespaces. Example: Project = Tully.Saps.Data Folder = DataAccess/Interfaces Namespace = Tully.Saps.Data.DataAccess.Interfaces Folder = DataAccess/MbNetRepositories Namespace = Tully.Saps....
[ "c#" ]
3
1
2,567
6
0
2008-09-15T20:31:28.230000
2008-09-15T20:35:34.957000
66,636
66,847
Decorating a parent class method
I would like to make a child class that has a method of the parent class where the method is a 'classmethod' in the child class but not in the parent class. Essentially, I am trying to accomplish the following: class foo(Object): def meth1(self, val): self.value = val class bar(foo): meth1 = classmethod(foo.meth1)
I'm also not entirely sure what the exact behaviour you want is, but assuming its that you want bar.meth1(42) to be equivalent to foo.meth1 being a classmethod of bar (with "self" being the class), then you can acheive this with: def convert_to_classmethod(method): return classmethod(method.im_func) class bar(foo): me...
Decorating a parent class method I would like to make a child class that has a method of the parent class where the method is a 'classmethod' in the child class but not in the parent class. Essentially, I am trying to accomplish the following: class foo(Object): def meth1(self, val): self.value = val class bar(foo): m...
TITLE: Decorating a parent class method QUESTION: I would like to make a child class that has a method of the parent class where the method is a 'classmethod' in the child class but not in the parent class. Essentially, I am trying to accomplish the following: class foo(Object): def meth1(self, val): self.value = val ...
[ "python", "oop", "inheritance" ]
1
4
965
3
0
2008-09-15T20:31:33.750000
2008-09-15T20:53:20.190000
66,643
66,705
Fail fast finally clause in Java
Is there a way to detect, from within the finally clause, that an exception is in the process of being thrown? See the example below: try { // code that may or may not throw an exception } finally { SomeCleanupFunctionThatThrows(); // if currently executing an exception, exit the program, // otherwise just let the exce...
Set a flag variable, then check for it in the finally clause, like so: boolean exceptionThrown = true; try { mightThrowAnException(); exceptionThrown = false; } finally { if (exceptionThrown) { // Whatever you want to do } }
Fail fast finally clause in Java Is there a way to detect, from within the finally clause, that an exception is in the process of being thrown? See the example below: try { // code that may or may not throw an exception } finally { SomeCleanupFunctionThatThrows(); // if currently executing an exception, exit the progra...
TITLE: Fail fast finally clause in Java QUESTION: Is there a way to detect, from within the finally clause, that an exception is in the process of being thrown? See the example below: try { // code that may or may not throw an exception } finally { SomeCleanupFunctionThatThrows(); // if currently executing an exceptio...
[ "java", "exception", "fault-tolerance" ]
5
14
1,147
5
0
2008-09-15T20:31:53.330000
2008-09-15T20:38:26.153000
66,649
1,303,599
Google Maps style scrolling anyone?
I am looking for some JavaScript plugin (preferably jQuery) to be able to scroll through an image, in the same way that Google Maps works. I can make the image draggable but then I see the whole image while dragging even if the parent div is overflow:hidden. Any help would be greatly appreciated!
I may be a little late to the party, but I was just looking for the same thing. What I stumbled upon is scrollview for jquery, it works perfect and does exactly this google maps-like drag-to-scroll for overflowed divs.
Google Maps style scrolling anyone? I am looking for some JavaScript plugin (preferably jQuery) to be able to scroll through an image, in the same way that Google Maps works. I can make the image draggable but then I see the whole image while dragging even if the parent div is overflow:hidden. Any help would be greatly...
TITLE: Google Maps style scrolling anyone? QUESTION: I am looking for some JavaScript plugin (preferably jQuery) to be able to scroll through an image, in the same way that Google Maps works. I can make the image draggable but then I see the whole image while dragging even if the parent div is overflow:hidden. Any hel...
[ "javascript", "jquery", "ajax" ]
19
3
11,056
7
0
2008-09-15T20:32:19.677000
2009-08-20T02:06:07.117000
66,654
69,675
Setting movie metadata with QTKit
I'm trying to convert old QuickTime framework code to the 64-bit Cocoa-based QTKit on OS X, which means that I can't drop down to the straight C function calls at any time. Specifically, I'm trying to find a way to write QuickTime VR movies with QTKit, as they require some special metadata to set the display controller...
If you have to delve down into the C APIs, you might tackle the limitation to 32-bit builds by moving the QuickTime specific code into a separate, 32-bit process. We do this on Windows and it works quite well...
Setting movie metadata with QTKit I'm trying to convert old QuickTime framework code to the 64-bit Cocoa-based QTKit on OS X, which means that I can't drop down to the straight C function calls at any time. Specifically, I'm trying to find a way to write QuickTime VR movies with QTKit, as they require some special meta...
TITLE: Setting movie metadata with QTKit QUESTION: I'm trying to convert old QuickTime framework code to the 64-bit Cocoa-based QTKit on OS X, which means that I can't drop down to the straight C function calls at any time. Specifically, I'm trying to find a way to write QuickTime VR movies with QTKit, as they require...
[ "objective-c", "macos", "quicktime", "qtkit" ]
4
2
1,405
2
0
2008-09-15T20:33:09.300000
2008-09-16T05:52:49.377000
66,668
66,721
Problem with unicode String literal in unit test
I have a JUnit test that tests adding Strings to a Dictionary custom type. Everything works fine for everyone else on a Linux/Windows machine, however, being the first dev in my shop on a mac, this unit test fails for me. The offending lines are where unicode string literals are used: dict.add( "Su字/会意pin", "Su字/会意pin"...
In the flags for the javac compiler, set the -encoding flag, so in your case you'd mark it as javac -encoding UTF-8
Problem with unicode String literal in unit test I have a JUnit test that tests adding Strings to a Dictionary custom type. Everything works fine for everyone else on a Linux/Windows machine, however, being the first dev in my shop on a mac, this unit test fails for me. The offending lines are where unicode string lite...
TITLE: Problem with unicode String literal in unit test QUESTION: I have a JUnit test that tests adding Strings to a Dictionary custom type. Everything works fine for everyone else on a Linux/Windows machine, however, being the first dev in my shop on a mac, this unit test fails for me. The offending lines are where u...
[ "java", "macos", "unicode", "encoding" ]
1
4
1,452
1
0
2008-09-15T20:34:40.263000
2008-09-15T20:40:30.907000
66,677
66,780
Simple/lightweight alternative to GNU Mailman?
I'm looking for a dead simple mailing list (unix friendly). Robustness, fine-grained configurability, "enterprise-readiness" (whatever that means) are not requirements. I just need to set up a tiny mailing list for a few friends. Rather than hack something up myself, I was wondering if anybody knows of anything already...
Mailman is one of the simplest mailing list packages I've come across, so if Mailman is more than you want to deal with I'd suggest just adding an entry into /etc/aliases for your mailing list. Of course you have to manage it by hand, but you said it's only for a few friends so that may not be a problem. Just create an...
Simple/lightweight alternative to GNU Mailman? I'm looking for a dead simple mailing list (unix friendly). Robustness, fine-grained configurability, "enterprise-readiness" (whatever that means) are not requirements. I just need to set up a tiny mailing list for a few friends. Rather than hack something up myself, I was...
TITLE: Simple/lightweight alternative to GNU Mailman? QUESTION: I'm looking for a dead simple mailing list (unix friendly). Robustness, fine-grained configurability, "enterprise-readiness" (whatever that means) are not requirements. I just need to set up a tiny mailing list for a few friends. Rather than hack somethin...
[ "mailing-list", "mailman" ]
16
6
10,208
3
0
2008-09-15T20:35:17.657000
2008-09-15T20:47:05.040000
66,687
163,405
Any successful profibus communications from .NET?
Has anyone successfully talked profibus from a.NET application? If you did, what device/card did you use to accomplish this, what was the application, and did you use any kind of preexisting or available code?
We've not used Profibus, but have used DeviceNET (another CAN based protocol), Ethernet/IP and ControlNet which all have similar challenges. We've been doing this since the late 1990's and therefore rely mainly on our own generated code using off-the-shelf hardware. The companies that have shown longevity during that p...
Any successful profibus communications from .NET? Has anyone successfully talked profibus from a.NET application? If you did, what device/card did you use to accomplish this, what was the application, and did you use any kind of preexisting or available code?
TITLE: Any successful profibus communications from .NET? QUESTION: Has anyone successfully talked profibus from a.NET application? If you did, what device/card did you use to accomplish this, what was the application, and did you use any kind of preexisting or available code? ANSWER: We've not used Profibus, but have...
[ "communication", "plc", "industrial" ]
6
8
7,410
3
0
2008-09-15T20:35:48.857000
2008-10-02T16:51:34.897000
66,727
3,613,335
Error Tolerant HTML/XML/SGML parsing in PHP
I have a bunch of legacy documents that are HTML-like. As in, they look like HTML, but have additional made up tags that aren't a part of HTML This is an example of a fake tag I need to parse these files. PHP is the only only tool available. The documents don't come close to being well formed XML. My original thought w...
You can suppress warnings with libxml_use_internal_errors, while loading the document. Eg.: libxml_use_internal_errors(true); $doc = new DomDocument(); $doc->loadHTML(" This is an example of a fake tag "); libxml_use_internal_errors(false); If, for some reason, you need access to the warnings, use libxml_get_errors
Error Tolerant HTML/XML/SGML parsing in PHP I have a bunch of legacy documents that are HTML-like. As in, they look like HTML, but have additional made up tags that aren't a part of HTML This is an example of a fake tag I need to parse these files. PHP is the only only tool available. The documents don't come close to ...
TITLE: Error Tolerant HTML/XML/SGML parsing in PHP QUESTION: I have a bunch of legacy documents that are HTML-like. As in, they look like HTML, but have additional made up tags that aren't a part of HTML This is an example of a fake tag I need to parse these files. PHP is the only only tool available. The documents do...
[ "php", "html", "xml", "parsing" ]
5
7
5,006
6
0
2008-09-15T20:41:28.983000
2010-08-31T21:22:45.777000
66,730
67,743
How do I create a new signal in pygtk
I've created a python object, but I want to send signals on it. I made it inherit from gobject.GObject, but there doesn't seem to be any way to create a new signal on my object.
You can also define signals inside the class definition: class MyGObjectClass(gobject.GObject): __gsignals__ = { "some-signal": (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, (object, )), } The contents of the tuple are the the same as the three last arguments to gobject.signal_new.
How do I create a new signal in pygtk I've created a python object, but I want to send signals on it. I made it inherit from gobject.GObject, but there doesn't seem to be any way to create a new signal on my object.
TITLE: How do I create a new signal in pygtk QUESTION: I've created a python object, but I want to send signals on it. I made it inherit from gobject.GObject, but there doesn't seem to be any way to create a new signal on my object. ANSWER: You can also define signals inside the class definition: class MyGObjectClass...
[ "python", "gtk", "pygtk", "gobject" ]
7
11
3,263
3
0
2008-09-15T20:41:58.500000
2008-09-15T22:52:27.343000
66,731
66,755
Unhandled exception logging for Windows Forms
Is there anything like ELMAH for Windows Forms? I'm looking for a standard way to process unhandled exceptions and grab a screenshot and other environment information before packaging that up for support.
The very same Jeff Atwood coded a nice solution (albeit in VB.NET) which I had to modify and "fix" but that I am happily using since then. You can view his solution Here
Unhandled exception logging for Windows Forms Is there anything like ELMAH for Windows Forms? I'm looking for a standard way to process unhandled exceptions and grab a screenshot and other environment information before packaging that up for support.
TITLE: Unhandled exception logging for Windows Forms QUESTION: Is there anything like ELMAH for Windows Forms? I'm looking for a standard way to process unhandled exceptions and grab a screenshot and other environment information before packaging that up for support. ANSWER: The very same Jeff Atwood coded a nice sol...
[ ".net", "winforms", "exception", "logging" ]
14
9
3,368
3
0
2008-09-15T20:42:04.710000
2008-09-15T20:44:52.423000
66,743
67,130
IMAP4 server for .NET
Are there any free (non-GPL) libraries for.NET that provide IMAP4 server side functionality? E.g. handles the socket level and message handshaking so that an IMAP4 client (such as outlook) can retrieve, read, edit and/or delete messages. I am not trying to connect to an IMAP4 server, I'd like the assistance to implemen...
I know I'm answering my own question, but after yet more searching I think I may have found something matching my needs: NMail Features NMail is a 100%.net application. A Windows installer and setup wizard. ASP.net Webmail. An ASP.net administration site. IMAP Server Features Support for ACLs. NTLM authentication (Secu...
IMAP4 server for .NET Are there any free (non-GPL) libraries for.NET that provide IMAP4 server side functionality? E.g. handles the socket level and message handshaking so that an IMAP4 client (such as outlook) can retrieve, read, edit and/or delete messages. I am not trying to connect to an IMAP4 server, I'd like the ...
TITLE: IMAP4 server for .NET QUESTION: Are there any free (non-GPL) libraries for.NET that provide IMAP4 server side functionality? E.g. handles the socket level and message handshaking so that an IMAP4 client (such as outlook) can retrieve, read, edit and/or delete messages. I am not trying to connect to an IMAP4 ser...
[ ".net", "imap", "mail-server" ]
0
2
829
3
0
2008-09-15T20:43:25.017000
2008-09-15T21:25:21.017000
66,750
66,784
How to control the capitalization of month and day names returned by DateFormat?
Here is a quick test program: public static void main( String[] args ) { Date date = Calendar.getInstance().getTime(); System.out.println("Months:"); printDate( "MMMM", "en", date ); printDate( "MMMM", "es", date ); printDate( "MMMM", "fr", date ); printDate( "MMMM", "de", date ); System.out.println("Days:"); printDa...
Not all languages share english capitalization rules. I guess you'd need to alter the data used by the API, but your non-english clients might not appreciate it... about.com on french capitalization
How to control the capitalization of month and day names returned by DateFormat? Here is a quick test program: public static void main( String[] args ) { Date date = Calendar.getInstance().getTime(); System.out.println("Months:"); printDate( "MMMM", "en", date ); printDate( "MMMM", "es", date ); printDate( "MMMM", "fr...
TITLE: How to control the capitalization of month and day names returned by DateFormat? QUESTION: Here is a quick test program: public static void main( String[] args ) { Date date = Calendar.getInstance().getTime(); System.out.println("Months:"); printDate( "MMMM", "en", date ); printDate( "MMMM", "es", date ); prin...
[ "java", "date", "internationalization" ]
22
18
24,919
4
0
2008-09-15T20:44:02.300000
2008-09-15T20:47:23.853000
66,759
66,816
Are there any advantages compiling for .NET Framework 3.5 instead of 2.0?
Are there any advantages compiling for.NET Framework 3.5 instead of 2.0? For example less memory consumption, faster startup, better performance... Personally I don't think so however, I may have missed something. Edits Of course there are more features in the 3.5 framework, but these are not the focus of this question...
There's a difference between compiling and targeting. Compiling the code with the (for example) C# 3.0 compiler will probably give you a boost on performance (very little one anyway) as some optimization for the generated IL code migh have been included. It also allows you to use some of the new features like automatic...
Are there any advantages compiling for .NET Framework 3.5 instead of 2.0? Are there any advantages compiling for.NET Framework 3.5 instead of 2.0? For example less memory consumption, faster startup, better performance... Personally I don't think so however, I may have missed something. Edits Of course there are more f...
TITLE: Are there any advantages compiling for .NET Framework 3.5 instead of 2.0? QUESTION: Are there any advantages compiling for.NET Framework 3.5 instead of 2.0? For example less memory consumption, faster startup, better performance... Personally I don't think so however, I may have missed something. Edits Of cours...
[ ".net", "optimization", "compiler-construction", "frameworks" ]
10
5
4,185
8
0
2008-09-15T20:45:11.720000
2008-09-15T20:50:24.640000
66,770
67,678
Why is RSpec so slow under Rails?
Whenever I run rspec tests for my Rails application it takes forever and a day of overhead before it actually starts running tests. Why is rspec so slow? Is there a way to speed up Rails' initial load or single out the part of my Rails app I need (e.g. ActiveRecord stuff only) so it doesn't load absolutely everything t...
You should be able to to speed up your script/spec calls by running script/spec_server in a separate terminal window, then adding the additional -X parameter to your spec calls.
Why is RSpec so slow under Rails? Whenever I run rspec tests for my Rails application it takes forever and a day of overhead before it actually starts running tests. Why is rspec so slow? Is there a way to speed up Rails' initial load or single out the part of my Rails app I need (e.g. ActiveRecord stuff only) so it do...
TITLE: Why is RSpec so slow under Rails? QUESTION: Whenever I run rspec tests for my Rails application it takes forever and a day of overhead before it actually starts running tests. Why is rspec so slow? Is there a way to speed up Rails' initial load or single out the part of my Rails app I need (e.g. ActiveRecord st...
[ "ruby-on-rails", "ruby", "rspec" ]
47
22
14,855
11
0
2008-09-15T20:46:06.307000
2008-09-15T22:38:59.903000
66,776
66,778
Where is a good place to start with making an application in .NET that communicates through OPC?
Where is a good place to start with making an application in.NET that communicates through OPC?
You can find a good article and a library to start with here: http://www.codeproject.com/KB/COM/opcdotnet.aspx
Where is a good place to start with making an application in .NET that communicates through OPC? Where is a good place to start with making an application in.NET that communicates through OPC?
TITLE: Where is a good place to start with making an application in .NET that communicates through OPC? QUESTION: Where is a good place to start with making an application in.NET that communicates through OPC? ANSWER: You can find a good article and a library to start with here: http://www.codeproject.com/KB/COM/opcd...
[ "automation", "communication", "plc", "opc", "industrial" ]
5
6
1,174
5
0
2008-09-15T20:46:31.063000
2008-09-15T20:47:02.450000
66,800
66,824
Promising alternatives to make?
I've been using make and makefiles for many many years, and although the concept is sound, the implementation has something to be desired. Has anyone found any good alternatives to make that don't overcomplicate the problem?
check out SCons. For example Doom 3 and Blender make uses of it.
Promising alternatives to make? I've been using make and makefiles for many many years, and although the concept is sound, the implementation has something to be desired. Has anyone found any good alternatives to make that don't overcomplicate the problem?
TITLE: Promising alternatives to make? QUESTION: I've been using make and makefiles for many many years, and although the concept is sound, the implementation has something to be desired. Has anyone found any good alternatives to make that don't overcomplicate the problem? ANSWER: check out SCons. For example Doom 3 ...
[ "build-automation", "makefile" ]
103
36
65,698
12
0
2008-09-15T20:49:05.550000
2008-09-15T20:51:09.727000
66,810
130,940
Custom style with Qt
Has anybody experience in building a custom style in Qt? What I have in my mind is a complete new style that affects all kind of widgets. I have seen some examples in the web for a custom combo box. But I have no idea how much time and code it takes to build a "complete" new custom style... maybe someone can give me a ...
I have developed a "new" style that changed the appearance of much of an application. It did take some time, and quite a bit of experimentation. I also derived my style from the generic windows style, to allow it to handle some of the stuff I didn't want to mess with. All told, I think it took me a week to get most of ...
Custom style with Qt Has anybody experience in building a custom style in Qt? What I have in my mind is a complete new style that affects all kind of widgets. I have seen some examples in the web for a custom combo box. But I have no idea how much time and code it takes to build a "complete" new custom style... maybe s...
TITLE: Custom style with Qt QUESTION: Has anybody experience in building a custom style in Qt? What I have in my mind is a complete new style that affects all kind of widgets. I have seen some examples in the web for a custom combo box. But I have no idea how much time and code it takes to build a "complete" new custo...
[ "qt", "widget" ]
5
3
6,108
5
0
2008-09-15T20:49:59.807000
2008-09-25T01:17:10.640000
66,819
67,321
Best way to represent a parameterized enum in C#?
Are there any good solutions to represent a parameterized enum in C# 3.0? I am looking for something like OCaml or Haxe has. I can only think of class hierarchy with a simple enum field for easy switching for now, maybe there are better ideas? See Ocaml example below in one of the replies, a Haxe code follows: enum Tre...
Not being familiar with OCaml or Haxe, and not being clever enough to understand the other explanations, I went and looked up the Haxe enum documentation - the 'Enum Type Parameters' bit at the bottom seems to be the relevant part. My understanding based on that is as follows: A 'normal' enum is basically a value which...
Best way to represent a parameterized enum in C#? Are there any good solutions to represent a parameterized enum in C# 3.0? I am looking for something like OCaml or Haxe has. I can only think of class hierarchy with a simple enum field for easy switching for now, maybe there are better ideas? See Ocaml example below in...
TITLE: Best way to represent a parameterized enum in C#? QUESTION: Are there any good solutions to represent a parameterized enum in C# 3.0? I am looking for something like OCaml or Haxe has. I can only think of class hierarchy with a simple enum field for easy switching for now, maybe there are better ideas? See Ocam...
[ "c#", "enums", "ocaml", "haxe" ]
1
7
3,375
4
0
2008-09-15T20:50:38.260000
2008-09-15T21:46:23.337000
66,837
66,865
When is a CDATA section necessary within a script tag?
Are CDATA tags ever necessary in script tags and if so when? In other words, when and where is this: preferable to this:
A CDATA section is required if you need your document to parse as XML (e.g. when an XHTML page is interpreted as XML) and you want to be able to write literal i<10 and a && b instead of i<10 and a && b, as XHTML will parse the JavaScript code as parsed character data as opposed to character data by default. This is not...
When is a CDATA section necessary within a script tag? Are CDATA tags ever necessary in script tags and if so when? In other words, when and where is this: preferable to this:
TITLE: When is a CDATA section necessary within a script tag? QUESTION: Are CDATA tags ever necessary in script tags and if so when? In other words, when and where is this: preferable to this: ANSWER: A CDATA section is required if you need your document to parse as XML (e.g. when an XHTML page is interpreted as XML)...
[ "javascript", "html", "xhtml", "cdata" ]
968
603
387,756
15
0
2008-09-15T20:52:14.700000
2008-09-15T20:54:44.943000
66,840
68,981
Integration of JavaScript and JMS
Where can I find a guide for integrating JavaScript and JMS (Java Messaging Service)? I would like a best practice or established technology that allows me to directly or indirectly receive messages from a topic and update a site based on the message. I was thinking of creating two components, a servlet for the Web mod...
I think this is your answer. Looks like it is baked in to ActiveMQ. I tried the examples and they seem to work. http://activemq.apache.org/ajax.html
Integration of JavaScript and JMS Where can I find a guide for integrating JavaScript and JMS (Java Messaging Service)? I would like a best practice or established technology that allows me to directly or indirectly receive messages from a topic and update a site based on the message. I was thinking of creating two com...
TITLE: Integration of JavaScript and JMS QUESTION: Where can I find a guide for integrating JavaScript and JMS (Java Messaging Service)? I would like a best practice or established technology that allows me to directly or indirectly receive messages from a topic and update a site based on the message. I was thinking o...
[ "java", "javascript", "jms", "ejb", "activemq-classic" ]
3
3
12,426
4
0
2008-09-15T20:52:23.200000
2008-09-16T02:42:43.827000
66,870
66,937
How do I run a program as nobody?
I want a user-privileged (not root) process to launch new processes as user nobody. I've tried a straight call to setuid that fails with -1 EPERM on Ubuntu 8.04: #include #include int main() { setuid(65534); while (1); return 0; } How should I do this instead?
You will require assistance and a lot of trust from your system administrator. Ordinary users are not able to run the executable of their choice on behalf on other users, period. She may add your application to /etc/sudoers with proper settings and you'll be able to run it as with sudo -u nobody. This will work for bot...
How do I run a program as nobody? I want a user-privileged (not root) process to launch new processes as user nobody. I've tried a straight call to setuid that fails with -1 EPERM on Ubuntu 8.04: #include #include int main() { setuid(65534); while (1); return 0; } How should I do this instead?
TITLE: How do I run a program as nobody? QUESTION: I want a user-privileged (not root) process to launch new processes as user nobody. I've tried a straight call to setuid that fails with -1 EPERM on Ubuntu 8.04: #include #include int main() { setuid(65534); while (1); return 0; } How should I do this instead? ANSWER...
[ "c", "linux", "security", "ubuntu" ]
16
20
28,604
5
0
2008-09-15T20:55:36.143000
2008-09-15T21:02:26.190000
66,875
66,942
Java applet cached forever, not downloading new version?
We have a case where clients seem to be eternally caching versions of applets. We're making use of the tag correctly within our tag, or so we think. We went from a version string of 7.1.0.40 to 7.1.0.42 and this triggered a download for only about half of our clients. It doesn't seem to matter which version of the JRE ...
Unfortunately, different versions of the Java Plug-In have different caching behaviors. Setting your Cache-Control and Last-Modified HTTP headers is the ideal solution, but it only works under the most recent versions of the JRE. The only solution GUARANTEED to work is to rename your application jars when their version...
Java applet cached forever, not downloading new version? We have a case where clients seem to be eternally caching versions of applets. We're making use of the tag correctly within our tag, or so we think. We went from a version string of 7.1.0.40 to 7.1.0.42 and this triggered a download for only about half of our cli...
TITLE: Java applet cached forever, not downloading new version? QUESTION: We have a case where clients seem to be eternally caching versions of applets. We're making use of the tag correctly within our tag, or so we think. We went from a version string of 7.1.0.40 to 7.1.0.42 and this triggered a download for only abo...
[ "java", "caching", "applet" ]
6
9
11,640
3
0
2008-09-15T20:56:06.017000
2008-09-15T21:02:57.577000
66,880
66,988
How to test credit card interactions?
After reading this answer, I wonder if there's a way to get a "testing" credit card number. One that you can experiment with but that doesn't actually charge anything.
MasterCard: 5431111111111111 Amex: 341111111111111 Discover: 6011601160116611 American Express (15 digits) 378282246310005 American Express (15 digits) 371449635398431 American Express Corporate (15 digits) 378734493671000 Diners Club (14 digits) 30569309025904 Diners Club (14 digits) 38520000023237 Discover (16 digits...
How to test credit card interactions? After reading this answer, I wonder if there's a way to get a "testing" credit card number. One that you can experiment with but that doesn't actually charge anything.
TITLE: How to test credit card interactions? QUESTION: After reading this answer, I wonder if there's a way to get a "testing" credit card number. One that you can experiment with but that doesn't actually charge anything. ANSWER: MasterCard: 5431111111111111 Amex: 341111111111111 Discover: 6011601160116611 American ...
[ "testing", "credit-card" ]
12
28
8,056
4
0
2008-09-15T20:56:32.520000
2008-09-15T21:08:49.183000
66,882
67,020
Simplest way to check if two integers have same sign?
Which is the simplest way to check if two integers have same sign? Is there any short bitwise trick to do this?
Here is a version that works in C/C++ that doesn't rely on integer sizes or have the overflow problem (i.e. x*y>=0 doesn't work) bool SameSign(int x, int y) { return (x >= 0) ^ (y < 0); } Of course, you can geek out and template: template bool SameSign(typename valueType x, typename valueType y) { return (x >= 0) ^ (y ...
Simplest way to check if two integers have same sign? Which is the simplest way to check if two integers have same sign? Is there any short bitwise trick to do this?
TITLE: Simplest way to check if two integers have same sign? QUESTION: Which is the simplest way to check if two integers have same sign? Is there any short bitwise trick to do this? ANSWER: Here is a version that works in C/C++ that doesn't rely on integer sizes or have the overflow problem (i.e. x*y>=0 doesn't work...
[ "integer", "bit-manipulation", "sign" ]
78
53
56,154
19
0
2008-09-15T20:57:04.390000
2008-09-15T21:12:14.310000
66,893
66,956
Tree data structure in C#
I was looking for a tree or graph data structure in C#, but I guess there isn't one provided. An Extensive Examination of Data Structures Using C# 2.0 a bit about why. Is there a convenient library which is commonly used to provide this functionality? Perhaps through a strategy pattern to solve the issues presented in ...
My best advice would be that there is no standard tree data structure because there are so many ways you could implement it that it would be impossible to cover all bases with one solution. The more specific a solution, the less likely it is applicable to any given problem. I even get annoyed with LinkedList - what if ...
Tree data structure in C# I was looking for a tree or graph data structure in C#, but I guess there isn't one provided. An Extensive Examination of Data Structures Using C# 2.0 a bit about why. Is there a convenient library which is commonly used to provide this functionality? Perhaps through a strategy pattern to solv...
TITLE: Tree data structure in C# QUESTION: I was looking for a tree or graph data structure in C#, but I guess there isn't one provided. An Extensive Examination of Data Structures Using C# 2.0 a bit about why. Is there a convenient library which is commonly used to provide this functionality? Perhaps through a strate...
[ "c#", "data-structures" ]
293
180
500,459
20
0
2008-09-15T20:58:20.037000
2008-09-15T21:04:39.600000
66,912
115,177
The <t:message> doesn't display properly when using <t:inputFileUpload> inside <t:PanelTabbedPane>
In a JSP page, I created a with some elements:,, etc. Also, I added some And I wanted to allow the user upload several files (one at a time) within the form (using ) At this point my code works fine. The headache comes when I try to put the form inside a (and thus of course, inside a ) I copied the structure shown in t...
Looks like it may be related a bug in myfaces. There is a newer version of myfaces and tomahawk that you might try. I would remove the subview functionality as a quick test - copy the detail.jsp page back into the main page. https://issues.apache.org/jira/browse/MYFACES-1807?page=com.atlassian.jira.plugin.system.issuet...
The <t:message> doesn't display properly when using <t:inputFileUpload> inside <t:PanelTabbedPane> In a JSP page, I created a with some elements:,, etc. Also, I added some And I wanted to allow the user upload several files (one at a time) within the form (using ) At this point my code works fine. The headache comes wh...
TITLE: The <t:message> doesn't display properly when using <t:inputFileUpload> inside <t:PanelTabbedPane> QUESTION: In a JSP page, I created a with some elements:,, etc. Also, I added some And I wanted to allow the user upload several files (one at a time) within the form (using ) At this point my code works fine. The...
[ "jsf" ]
1
0
5,754
2
0
2008-09-15T20:59:45.493000
2008-09-22T14:33:34.340000
66,921
67,019
Load a form without showing it
Short version: I want to trigger the Form_Load() event without making the form visible. This doesn't work because Show() ignores the current value of the Visible property: tasksForm.Visible = false; tasksForm.Show(); Long version: I have a WinForms application with two forms: main and tasks. The main form is always dis...
I totally agree with Rich B, you need to look at where you are placing your application logic rather than trying to cludge the WinForms mechanisms. All of those operations and data that your Tasks form is exposing should really be in a separate class say some kind of Application Controller or something held by your mai...
Load a form without showing it Short version: I want to trigger the Form_Load() event without making the form visible. This doesn't work because Show() ignores the current value of the Visible property: tasksForm.Visible = false; tasksForm.Show(); Long version: I have a WinForms application with two forms: main and tas...
TITLE: Load a form without showing it QUESTION: Short version: I want to trigger the Form_Load() event without making the form visible. This doesn't work because Show() ignores the current value of the Visible property: tasksForm.Visible = false; tasksForm.Show(); Long version: I have a WinForms application with two f...
[ "c#", "winforms" ]
11
6
22,990
8
0
2008-09-15T21:00:49.577000
2008-09-15T21:11:47.553000
66,922
77,072
What are some Search Servers out there?
I'm looking to find alternatives to Solr from the Apache Software Foundation. For those that don't know, Solr is an enterprise search server. A client application uses a web-services like interface to submit documents for indexing and also to perform search queries. Solr has other features built in like caching and rep...
I wrote a long post about my experiences and features of all the engines I listed below but I scrapped it because formatting is a pita. But quite simply if you don't want to shell out money Solr/Lucene or Fast (now MSSE) is really about the best you can do. Excluded because I have no experience of this product: Seamark...
What are some Search Servers out there? I'm looking to find alternatives to Solr from the Apache Software Foundation. For those that don't know, Solr is an enterprise search server. A client application uses a web-services like interface to submit documents for indexing and also to perform search queries. Solr has othe...
TITLE: What are some Search Servers out there? QUESTION: I'm looking to find alternatives to Solr from the Apache Software Foundation. For those that don't know, Solr is an enterprise search server. A client application uses a web-services like interface to submit documents for indexing and also to perform search quer...
[ "search", "full-text-search", "search-engine", "solr" ]
21
43
15,064
10
0
2008-09-15T21:01:02.323000
2008-09-16T21:03:56.410000
66,923
66,944
How do you tell whether a string is an IP or a hostname
So you have a String that is retrieved from an admin web UI (so it is definitely a String). How can you find out whether this string is an IP address or a hostname in Java? Update: I think I didn't make myself clear, I was more asking if there is anything in the Java SDK that I can use to distinguish between IPs and ho...
You can use a regular expression with this pattern: \b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b That will tell you if it's an IPv4 address.
How do you tell whether a string is an IP or a hostname So you have a String that is retrieved from an admin web UI (so it is definitely a String). How can you find out whether this string is an IP address or a hostname in Java? Update: I think I didn't make myself clear, I was more asking if there is anything in the J...
TITLE: How do you tell whether a string is an IP or a hostname QUESTION: So you have a String that is retrieved from an admin web UI (so it is definitely a String). How can you find out whether this string is an IP address or a hostname in Java? Update: I think I didn't make myself clear, I was more asking if there is...
[ "java", "ip-address", "hostname" ]
4
15
4,402
9
0
2008-09-15T21:01:02.480000
2008-09-15T21:03:07.967000
66,934
67,740
How do you place a textbox object over a specific Cell when automating Excel?
We are automating Excel using VB.Net, and trying to place multiple lines of text on an Excel worksheet that we can set to not print. Between these we would have printable reports. We can do this if we add textbox objects, and set the print object setting to false. (If you have another way, please direct me) The code to...
If you have the cell name or position, you can do: With ActiveSheet.Shapes.AddTextbox msoTextOrientationHorizontal,.Cells(3,2).Left,.Cells(3,2).Top,.Cells(3,2).Width,.Cells(3,2).Height End With This will add a textbox over cell B3. When B3 is resized, the textbox is also.
How do you place a textbox object over a specific Cell when automating Excel? We are automating Excel using VB.Net, and trying to place multiple lines of text on an Excel worksheet that we can set to not print. Between these we would have printable reports. We can do this if we add textbox objects, and set the print ob...
TITLE: How do you place a textbox object over a specific Cell when automating Excel? QUESTION: We are automating Excel using VB.Net, and trying to place multiple lines of text on an Excel worksheet that we can set to not print. Between these we would have printable reports. We can do this if we add textbox objects, an...
[ "excel", "automation" ]
4
9
8,307
2
0
2008-09-15T21:01:59.793000
2008-09-15T22:51:51.417000
66,964
66,983
How do I create a link to a footnote in HTML?
For example: This is main body of my content. I have a footnote link for this line [1]. Then, I have some more content. Some of it is interesting and it has some footnotes as well [2]. [1] Here is my first footnote. [2] Another footnote. So, if I click on the "[1]" link it directs the web page to the first footnote ref...
Give a container an id, then use # to refer to that Id. e.g. This is main body of my content. I have a footnote link for this line [1]. Then, I have some more content. Some of it is interesting and it has some footnotes as well [2]. [1] Here is my first footnote. [2] Another footnote.
How do I create a link to a footnote in HTML? For example: This is main body of my content. I have a footnote link for this line [1]. Then, I have some more content. Some of it is interesting and it has some footnotes as well [2]. [1] Here is my first footnote. [2] Another footnote. So, if I click on the "[1]" link it ...
TITLE: How do I create a link to a footnote in HTML? QUESTION: For example: This is main body of my content. I have a footnote link for this line [1]. Then, I have some more content. Some of it is interesting and it has some footnotes as well [2]. [1] Here is my first footnote. [2] Another footnote. So, if I click on ...
[ "html", "syntax" ]
39
57
62,910
10
0
2008-09-15T21:05:49.363000
2008-09-15T21:08:32.337000
66,986
67,098
Is there an Eclipse command to surround the current selection with parentheses?
Is there an Eclipse command to surround the current selection with parentheses? Creating a template is a decent workaround; it doesn't work with the "Surround With" functionality, because I want to parenthesize an expression, not an entire line, and that requires ${word_selection} rather than ${line_selection}. Is ther...
Maybe not the correct answer, but at least a workaround: define a Java template with the name "parenthesis" (or "pa") with the following: (${word_selection})${cursor} once the word is selected, ctrl - space + p + use the arrow keys to select the template I used this technique for boxing primary types in JDK 1.4.2 and i...
Is there an Eclipse command to surround the current selection with parentheses? Is there an Eclipse command to surround the current selection with parentheses? Creating a template is a decent workaround; it doesn't work with the "Surround With" functionality, because I want to parenthesize an expression, not an entire ...
TITLE: Is there an Eclipse command to surround the current selection with parentheses? QUESTION: Is there an Eclipse command to surround the current selection with parentheses? Creating a template is a decent workaround; it doesn't work with the "Surround With" functionality, because I want to parenthesize an expressi...
[ "eclipse", "keyboard-shortcuts" ]
27
36
13,203
2
0
2008-09-15T21:08:44.287000
2008-09-15T21:22:29.917000
67,000
67,298
Fast, Pixel Precision 2D Drawing API for Graphics App?
I woud like to create a cross-platform drawing program. The one requirement for writing my app is that I have pixel level precision over the canvas. For instance, I want to write my own line drawing algorithm rather than rely on someone elses. I do not want any form of anti-aliasing (again, pixel level control is requi...
I just this week put together some slides and demo code for doing 2d graphics using OpenGL from python using the library pyglet. Here's a representative post: Pyglet week 2, better vertex throughput (or 3D stuff using the same basic ideas ) It is very fast (relatively speaking, for python) I have managed to get around ...
Fast, Pixel Precision 2D Drawing API for Graphics App? I woud like to create a cross-platform drawing program. The one requirement for writing my app is that I have pixel level precision over the canvas. For instance, I want to write my own line drawing algorithm rather than rely on someone elses. I do not want any for...
TITLE: Fast, Pixel Precision 2D Drawing API for Graphics App? QUESTION: I woud like to create a cross-platform drawing program. The one requirement for writing my app is that I have pixel level precision over the canvas. For instance, I want to write my own line drawing algorithm rather than rely on someone elses. I d...
[ "graphics", "drawing", "2d" ]
6
5
9,689
5
0
2008-09-15T21:10:09.447000
2008-09-15T21:43:51.503000
67,009
67,064
google maps traffic info
Google maps in some region can serve traffic information showing the blocked roads and so on. I was wondering if there is any code example demonstrating how can I serve traffice information for my own region.
"Google Maps Hacks" has a hack, "Hack 30. Stay Out of Traffic Jams", on that. You can also find out how to get U.S. traffic info from John Resig's "Traffic Conditions Data" article.
google maps traffic info Google maps in some region can serve traffic information showing the blocked roads and so on. I was wondering if there is any code example demonstrating how can I serve traffice information for my own region.
TITLE: google maps traffic info QUESTION: Google maps in some region can serve traffic information showing the blocked roads and so on. I was wondering if there is any code example demonstrating how can I serve traffice information for my own region. ANSWER: "Google Maps Hacks" has a hack, "Hack 30. Stay Out of Traff...
[ "google-maps" ]
2
2
1,334
4
0
2008-09-15T21:10:36.760000
2008-09-15T21:18:38.897000
67,021
138,836
How do I export the Bazaar history of a subfolder
I'm coding a framework along with a project which uses this framework. The project is a Bazaar repository, with the framework in a subfolder below the project. I want to give the framework a Bazaar repository of its own. How do I do it?
You use the split command: bzr split sub_folder This creates an independant tree in the subfolder, which you can now export and work on separately.
How do I export the Bazaar history of a subfolder I'm coding a framework along with a project which uses this framework. The project is a Bazaar repository, with the framework in a subfolder below the project. I want to give the framework a Bazaar repository of its own. How do I do it?
TITLE: How do I export the Bazaar history of a subfolder QUESTION: I'm coding a framework along with a project which uses this framework. The project is a Bazaar repository, with the framework in a subfolder below the project. I want to give the framework a Bazaar repository of its own. How do I do it? ANSWER: You us...
[ "bazaar" ]
4
6
1,502
6
0
2008-09-15T21:12:17.820000
2008-09-26T11:18:26.910000
67,029
67,068
google maps providing directions in local language
I noticed that Google maps is providing directions in my local language (hungarian) when I am using google chrome, but English language directions when I am using it from IE. I would like to know how chrome figures this out and how can I write code that is always returning directions on the user's language.
HTTP requests` include an Accept-Language header which is set according to your locale preferences on most OS/browser combinations. Google uses a combination of that, the local domain you use (eg 'google.it', 'google.hu') and any preferences you set with the Preferences link in the home page to assign a language to you...
google maps providing directions in local language I noticed that Google maps is providing directions in my local language (hungarian) when I am using google chrome, but English language directions when I am using it from IE. I would like to know how chrome figures this out and how can I write code that is always retur...
TITLE: google maps providing directions in local language QUESTION: I noticed that Google maps is providing directions in my local language (hungarian) when I am using google chrome, but English language directions when I am using it from IE. I would like to know how chrome figures this out and how can I write code th...
[ "google-maps" ]
1
3
2,682
2
0
2008-09-15T21:13:04.523000
2008-09-15T21:18:56.977000
67,056
67,277
best library to do web-scraping
I would like to get data from from different webpages such as addresses of restaurants or dates of different events for a given location and so on. What is the best library I can use for extracting this data from a given set of sites?
If using python, take a good look at Beautiful Soup ( http://crummy.com/software/BeautifulSoup ). An extremely capable library, makes scraping a breeze.
best library to do web-scraping I would like to get data from from different webpages such as addresses of restaurants or dates of different events for a given location and so on. What is the best library I can use for extracting this data from a given set of sites?
TITLE: best library to do web-scraping QUESTION: I would like to get data from from different webpages such as addresses of restaurants or dates of different events for a given location and so on. What is the best library I can use for extracting this data from a given set of sites? ANSWER: If using python, take a go...
[ "language-agnostic", "class-library", "web-crawler" ]
12
10
7,998
13
0
2008-09-15T21:16:58.277000
2008-09-15T21:41:48.777000
67,063
67,229
Convention question: When do you use a Getter/Setter function rather than using a Property
It strikes me that Properties in C# should be use when trying to manipulate a field in the class. But when there's complex calculations or database involved, we should use a getter/setter. Is this correct? When do you use s/getter over properties?
The.NET design guidelines provide some answers to this question in the Properties vs. Methods section. Basically, properties have the same semantics as a field. You shouldn't let a property throw exceptions, properties shouldn't have side effects, order shouldn't matter, and properties should return relatively quickly....
Convention question: When do you use a Getter/Setter function rather than using a Property It strikes me that Properties in C# should be use when trying to manipulate a field in the class. But when there's complex calculations or database involved, we should use a getter/setter. Is this correct? When do you use s/gette...
TITLE: Convention question: When do you use a Getter/Setter function rather than using a Property QUESTION: It strikes me that Properties in C# should be use when trying to manipulate a field in the class. But when there's complex calculations or database involved, we should use a getter/setter. Is this correct? When ...
[ "c#" ]
15
20
2,157
9
0
2008-09-15T21:18:22.360000
2008-09-15T21:34:26.330000
67,082
67,594
What is the best epoll/kqueue/select equvalient on Windows?
What is Windows' best I/O event notification facility? By best I mean something that... doesn't have a limit on number of input file descriptors works on all file descriptors (disk files, sockets,...) provides various notification modes (edge triggered, limit triggered)
In Windows, async operations are done by file operation, not by descriptor. There are several ways to wait on file operations to complete asynchronously. For example, if you want to know when data is available on a network socket, issue an async read request on the socket and when it completes, the data was available a...
What is the best epoll/kqueue/select equvalient on Windows? What is Windows' best I/O event notification facility? By best I mean something that... doesn't have a limit on number of input file descriptors works on all file descriptors (disk files, sockets,...) provides various notification modes (edge triggered, limit ...
TITLE: What is the best epoll/kqueue/select equvalient on Windows? QUESTION: What is Windows' best I/O event notification facility? By best I mean something that... doesn't have a limit on number of input file descriptors works on all file descriptors (disk files, sockets,...) provides various notification modes (edge...
[ "windows", "io", "notifications", "epoll" ]
45
48
38,316
4
0
2008-09-15T21:20:26.287000
2008-09-15T22:23:39.067000
67,093
2,298,602
How do I rename a MySQL database (change schema name)?
How do I quickly rename a MySQL database (change its schema name)? Usually I just dump a database and re-import it with a new name. This is not an option for very big databases. Apparently RENAME {DATABASE | SCHEMA} db_name TO new_db_name; does bad things, exists only in a handful of versions, and is a bad idea overall...
For InnoDB, the following seems to work: create the new empty database, then rename each table in turn into the new database: RENAME TABLE old_db.table TO new_db.table; You will need to adjust the permissions after that. For scripting in a shell, you can use either of the following: mysql -u username -ppassword old_db ...
How do I rename a MySQL database (change schema name)? How do I quickly rename a MySQL database (change its schema name)? Usually I just dump a database and re-import it with a new name. This is not an option for very big databases. Apparently RENAME {DATABASE | SCHEMA} db_name TO new_db_name; does bad things, exists o...
TITLE: How do I rename a MySQL database (change schema name)? QUESTION: How do I quickly rename a MySQL database (change its schema name)? Usually I just dump a database and re-import it with a new name. This is not an option for very big databases. Apparently RENAME {DATABASE | SCHEMA} db_name TO new_db_name; does ba...
[ "mysql", "database", "innodb", "rename" ]
1,151
1,013
1,613,023
46
0
2008-09-15T21:22:00.090000
2010-02-19T18:17:41.447000
67,103
67,479
What is the best way to improve performance of NHibernate?
I have an application that uses NHibernate as its ORM and sometimes it experiences performance issues due to how the data is being accessed by it. What kind of things can be done to improve the performance of NHibernate? (Please limit to one recommendation per answer)
The first and most dramatic performance problem that you can run into with NHibernate is if you are creating a new session factory for every session you create. Only one session factory instance should be created for each application execution and all sessions should be created by that factory. Along those lines, you s...
What is the best way to improve performance of NHibernate? I have an application that uses NHibernate as its ORM and sometimes it experiences performance issues due to how the data is being accessed by it. What kind of things can be done to improve the performance of NHibernate? (Please limit to one recommendation per ...
TITLE: What is the best way to improve performance of NHibernate? QUESTION: I have an application that uses NHibernate as its ORM and sometimes it experiences performance issues due to how the data is being accessed by it. What kind of things can be done to improve the performance of NHibernate? (Please limit to one r...
[ ".net", "performance", "nhibernate", "orm", "data-access-layer" ]
62
54
30,417
12
0
2008-09-15T21:22:52.957000
2008-09-15T22:03:11.330000
67,104
67,523
Is Asp.net and Windows Workflow good combination?
I am implementing a quite simple state-machine order processing application. It is a e-commerce application with a few twists. The users of the application will not be editing workflows by themselves. Microsoft claims that asp.net and Windows Workflow is possible to combine. How hard is it to install and maintain a com...
Asp.net and WF get along just fine, and WF doesn't add much maintenance overhead. Whether or not this is the right design for you depends a lot on your needs. If you have a lot of event driven actions then WF might be worthwhile, otherwise the overhead of rolling your own tracking would probably add less complexity to ...
Is Asp.net and Windows Workflow good combination? I am implementing a quite simple state-machine order processing application. It is a e-commerce application with a few twists. The users of the application will not be editing workflows by themselves. Microsoft claims that asp.net and Windows Workflow is possible to com...
TITLE: Is Asp.net and Windows Workflow good combination? QUESTION: I am implementing a quite simple state-machine order processing application. It is a e-commerce application with a few twists. The users of the application will not be editing workflows by themselves. Microsoft claims that asp.net and Windows Workflow ...
[ "asp.net", "workflow" ]
2
2
867
3
0
2008-09-15T21:22:54.203000
2008-09-15T22:09:47.180000
67,117
77,892
Speeding up mysql dumps and imports
Are there any documented techniques for speeding up mySQL dumps and imports? This would include my.cnf settings, using ramdisks, etc. Looking only for documented techniques, preferably with benchmarks showing potential speed-up.
http://www.maatkit.org/ has a mk-parallel-dump and mk-parallel-restore If you’ve been wishing for multi-threaded mysqldump, wish no more. This tool dumps MySQL tables in parallel. It is a much smarter mysqldump that can either act as a wrapper for mysqldump (with sensible default behavior) or as a wrapper around SELECT...
Speeding up mysql dumps and imports Are there any documented techniques for speeding up mySQL dumps and imports? This would include my.cnf settings, using ramdisks, etc. Looking only for documented techniques, preferably with benchmarks showing potential speed-up.
TITLE: Speeding up mysql dumps and imports QUESTION: Are there any documented techniques for speeding up mySQL dumps and imports? This would include my.cnf settings, using ramdisks, etc. Looking only for documented techniques, preferably with benchmarks showing potential speed-up. ANSWER: http://www.maatkit.org/ has ...
[ "mysql", "backup", "restore" ]
50
15
63,286
11
0
2008-09-15T21:23:51.160000
2008-09-16T22:21:55.443000
67,127
67,411
Database functionality with WPF app: SQLite, SQL CE, other?
I want to extend a WPF application with database functionality. Which database engine would you suggest and why? SQLite, SQL CE, other?
Depending on the applications use, I would recommend using SQL Lite because it doesn't require you to install any other software (SQL CE or Express, etc. usually would require a separate install). A list of the most important benefits for SQL Lite from the provider link at the bottom of this post: SQLite is a small C l...
Database functionality with WPF app: SQLite, SQL CE, other? I want to extend a WPF application with database functionality. Which database engine would you suggest and why? SQLite, SQL CE, other?
TITLE: Database functionality with WPF app: SQLite, SQL CE, other? QUESTION: I want to extend a WPF application with database functionality. Which database engine would you suggest and why? SQLite, SQL CE, other? ANSWER: Depending on the applications use, I would recommend using SQL Lite because it doesn't require yo...
[ "wpf", "sqlite", "sql-server-ce" ]
33
23
22,370
6
0
2008-09-15T21:24:50.893000
2008-09-15T21:56:29.787000
67,151
74,553
How can one host Flash content in a WPF application and use transparency?
How can I go about hosting flash content inside a WPF form and still use transparency/alpha on my WPF window? Hosting a WinForms flash controls does not allow this.
Unless the control you use to display the Flash content is built in WPF, you will run in to these "airspace" issues. Every display technology from Win32 to WinForms used HWNDs "under the hood", but WPF uses DirectX. The Window Manager in Windows however, still only understands HWNDs, so WPF apps have one top-level HWND...
How can one host Flash content in a WPF application and use transparency? How can I go about hosting flash content inside a WPF form and still use transparency/alpha on my WPF window? Hosting a WinForms flash controls does not allow this.
TITLE: How can one host Flash content in a WPF application and use transparency? QUESTION: How can I go about hosting flash content inside a WPF form and still use transparency/alpha on my WPF window? Hosting a WinForms flash controls does not allow this. ANSWER: Unless the control you use to display the Flash conten...
[ "wpf", "flash" ]
2
2
2,655
4
0
2008-09-15T21:26:33.400000
2008-09-16T17:00:41.423000
67,154
68,237
Is it safe to manipulate objects that I created outside my thread if I don't explicitly access them on the thread which created them?
I am working on a cocoa software and in order to keep the GUI responsive during a massive data import (Core Data) I need to run the import outside the main thread. Is it safe to access those objects even if I created them in the main thread without using locks if I don't explicitly access those objects while the thread...
With Core Data, you should have a separate managed object context to use for your import thread, connected to the same coordinator and persistent store. You cannot simply throw objects created in a context used by the main thread into another thread and expect them to work. Furthermore, you cannot do your own locking f...
Is it safe to manipulate objects that I created outside my thread if I don't explicitly access them on the thread which created them? I am working on a cocoa software and in order to keep the GUI responsive during a massive data import (Core Data) I need to run the import outside the main thread. Is it safe to access t...
TITLE: Is it safe to manipulate objects that I created outside my thread if I don't explicitly access them on the thread which created them? QUESTION: I am working on a cocoa software and in order to keep the GUI responsive during a massive data import (Core Data) I need to run the import outside the main thread. Is i...
[ "cocoa", "multithreading", "macos", "core-data" ]
3
4
1,368
7
0
2008-09-15T21:27:03.273000
2008-09-16T00:27:08.787000
67,167
69,854
AxAcroPDF - Vista64 Class Not Registered Error
We have a WinForms application written in C# that uses the AxAcroPDFLib.AxAcroPDF component to load and print a PDF file. Has been working without any problems in Windows XP. I have moved my development environment to Vista 64 bit and now the application will not run (on Vista 64) unless I remove the AxAcroPDF componen...
You can't convert Adobe's ActiveX control to 64bit yourself, but you can force your application to run in 32bit mode by setting the platform target to x86. For instructions for your version of Visual Studio, see section 1.44 of Issues When Using Microsoft Visual Studio 2005
AxAcroPDF - Vista64 Class Not Registered Error We have a WinForms application written in C# that uses the AxAcroPDFLib.AxAcroPDF component to load and print a PDF file. Has been working without any problems in Windows XP. I have moved my development environment to Vista 64 bit and now the application will not run (on V...
TITLE: AxAcroPDF - Vista64 Class Not Registered Error QUESTION: We have a WinForms application written in C# that uses the AxAcroPDFLib.AxAcroPDF component to load and print a PDF file. Has been working without any problems in Windows XP. I have moved my development environment to Vista 64 bit and now the application ...
[ "64-bit", "activex", "adobe", "axacropdf" ]
8
14
12,536
3
0
2008-09-15T21:28:18.123000
2008-09-16T06:39:31.200000
67,174
78,553
Find memory leaks caused by smart pointers
Does anybody know a "technique" to discover memory leaks caused by smart pointers? I am currently working on a large project written in C++ that heavily uses smart pointers with reference counting. Obviously we have some memory leaks caused by smart pointers, that are still referenced somewhere in the code, so that the...
Note that one source of leaks with reference-counting smart pointers are pointers with circular dependancies. For example, A have a smart pointer to B, and B have a smart pointer to A. Neither A nor B will be destroyed. You will have to find, and then break the dependancies. If possible, use boost smart pointers, and u...
Find memory leaks caused by smart pointers Does anybody know a "technique" to discover memory leaks caused by smart pointers? I am currently working on a large project written in C++ that heavily uses smart pointers with reference counting. Obviously we have some memory leaks caused by smart pointers, that are still re...
TITLE: Find memory leaks caused by smart pointers QUESTION: Does anybody know a "technique" to discover memory leaks caused by smart pointers? I am currently working on a large project written in C++ that heavily uses smart pointers with reference counting. Obviously we have some memory leaks caused by smart pointers,...
[ "c++", "pointers", "memory-leaks", "smart-pointers" ]
20
19
11,766
12
0
2008-09-15T21:29:02.427000
2008-09-17T00:09:19.523000
67,180
72,987
mod_python/MySQL error on INSERT with a lot of data: "OperationalError: (2006, 'MySQL server has gone away')"
When doing an INSERT with a lot of data, ie: INSERT INTO table (mediumtext_field) VALUES ('...lots of text here: about 2MB worth...') MySQL returns "OperationalError: (2006, 'MySQL server has gone away')" This is happening within a minute of starting the script, so it is not a timeout issue. Also, mediumtext_field shou...
check the max_packet setting in your my.cnf file. this determines the largest amount of data you can send to your mysql server in a single statement. exceeding this values results in that error.
mod_python/MySQL error on INSERT with a lot of data: "OperationalError: (2006, 'MySQL server has gone away')" When doing an INSERT with a lot of data, ie: INSERT INTO table (mediumtext_field) VALUES ('...lots of text here: about 2MB worth...') MySQL returns "OperationalError: (2006, 'MySQL server has gone away')" This ...
TITLE: mod_python/MySQL error on INSERT with a lot of data: "OperationalError: (2006, 'MySQL server has gone away')" QUESTION: When doing an INSERT with a lot of data, ie: INSERT INTO table (mediumtext_field) VALUES ('...lots of text here: about 2MB worth...') MySQL returns "OperationalError: (2006, 'MySQL server has ...
[ "python", "mysql", "xampp", "mysql-error-2006" ]
0
1
1,075
1
0
2008-09-15T21:29:26.827000
2008-09-16T14:34:30.420000
67,209
67,353
How do you customize the copy/paste behavior in Visual Studio 2008?
How do you customize the Copy/Paste behavior in Visual Studio 2008? For example I create a new and then copy and paste it in the same file. VisualStudio pastes instead of the original text I copied. It is even more frustrating when I'm trying to copy a group of related div's that I would like to copy/paste several time...
Go into Tools > Options > Text Editor > HTML > Miscellaneous and uncheck "Auto ID elements on paste in Source view"
How do you customize the copy/paste behavior in Visual Studio 2008? How do you customize the Copy/Paste behavior in Visual Studio 2008? For example I create a new and then copy and paste it in the same file. VisualStudio pastes instead of the original text I copied. It is even more frustrating when I'm trying to copy a...
TITLE: How do you customize the copy/paste behavior in Visual Studio 2008? QUESTION: How do you customize the Copy/Paste behavior in Visual Studio 2008? For example I create a new and then copy and paste it in the same file. VisualStudio pastes instead of the original text I copied. It is even more frustrating when I'...
[ "visual-studio-2008", "copy-paste" ]
10
22
4,437
2
0
2008-09-15T21:32:35.790000
2008-09-15T21:49:57.040000
67,219
69,726
How do you prevent printing dialog when using Excel PrintOut method
When I use the PrintOut method to print a Worksheet object to a printer, the "Printing" dialog (showing filename, destination printer, pages printed and a Cancel button) is displayed even though I have set DisplayAlerts = False. The code below works in an Excel macro but the same thing happens if I use this code in a V...
When you say the "Printing" Dialog, I assume you mean the "Now printing xxx on " dialog rather than standard print dialog (select printer, number of copies, etc). Taking your example above & trying it out, that is the behaviour I saw - "Now printing..." was displayed briefly & then auto-closed. What you're trying to co...
How do you prevent printing dialog when using Excel PrintOut method When I use the PrintOut method to print a Worksheet object to a printer, the "Printing" dialog (showing filename, destination printer, pages printed and a Cancel button) is displayed even though I have set DisplayAlerts = False. The code below works in...
TITLE: How do you prevent printing dialog when using Excel PrintOut method QUESTION: When I use the PrintOut method to print a Worksheet object to a printer, the "Printing" dialog (showing filename, destination printer, pages printed and a Cancel button) is displayed even though I have set DisplayAlerts = False. The c...
[ "vba", "excel", "printing", "printdialog" ]
6
1
21,513
3
0
2008-09-15T21:33:26.240000
2008-09-16T06:09:57.370000
67,223
835,601
why might my pyglet vertex lists and batches be very slow on Windows?
I'm writing opengl code in python using the library pyglet. When I draw to the screen using pyglet.graphics.vertex_list or pyglet.graphics.batch objects, they are very slow (~0.1 fps) compared to plain old pyglet.graphics.draw() or just glVertex() calls, which are about 40fps for the same geometry. In Linux the vertex_...
Don't forget to invoke your pyglet scripts with 'python -O myscript.py', the '-O' flag can make a huge performance difference. See pyglet docs here and here.
why might my pyglet vertex lists and batches be very slow on Windows? I'm writing opengl code in python using the library pyglet. When I draw to the screen using pyglet.graphics.vertex_list or pyglet.graphics.batch objects, they are very slow (~0.1 fps) compared to plain old pyglet.graphics.draw() or just glVertex() ca...
TITLE: why might my pyglet vertex lists and batches be very slow on Windows? QUESTION: I'm writing opengl code in python using the library pyglet. When I draw to the screen using pyglet.graphics.vertex_list or pyglet.graphics.batch objects, they are very slow (~0.1 fps) compared to plain old pyglet.graphics.draw() or ...
[ "python", "opengl", "pyglet" ]
0
5
1,155
2
0
2008-09-15T21:33:41.260000
2009-05-07T16:09:19.857000
67,273
67,307
How do you iterate through every file/directory recursively in standard C++?
How do you iterate through every file/directory recursively in standard C++?
In standard C++, technically there is no way to do this since standard C++ has no conception of directories. If you want to expand your net a little bit, you might like to look at using Boost.FileSystem. This has been accepted for inclusion in TR2, so this gives you the best chance of keeping your implementation as clo...
How do you iterate through every file/directory recursively in standard C++? How do you iterate through every file/directory recursively in standard C++?
TITLE: How do you iterate through every file/directory recursively in standard C++? QUESTION: How do you iterate through every file/directory recursively in standard C++? ANSWER: In standard C++, technically there is no way to do this since standard C++ has no conception of directories. If you want to expand your net...
[ "c++", "filesystems" ]
170
104
235,668
19
0
2008-09-15T21:41:00.963000
2008-09-15T21:44:42.700000
67,275
69,489
Reading from a ZipInputStream into a ByteArrayOutputStream
I am trying to read a single file from a java.util.zip.ZipInputStream, and copy it into a java.io.ByteArrayOutputStream (so that I can then create a java.io.ByteArrayInputStream and hand that to a 3rd party library that will end up closing the stream, and I don't want my ZipInputStream getting closed). I'm probably mis...
Your loop looks valid - what does the following code (just on it's own) return? zipStream.read(tempBuffer) if it's returning -1, then the zipStream is closed before you get it, and all bets are off. It's time to use your debugger and make sure what's being passed to you is actually valid. When you call getNextEntry(), ...
Reading from a ZipInputStream into a ByteArrayOutputStream I am trying to read a single file from a java.util.zip.ZipInputStream, and copy it into a java.io.ByteArrayOutputStream (so that I can then create a java.io.ByteArrayInputStream and hand that to a 3rd party library that will end up closing the stream, and I don...
TITLE: Reading from a ZipInputStream into a ByteArrayOutputStream QUESTION: I am trying to read a single file from a java.util.zip.ZipInputStream, and copy it into a java.io.ByteArrayOutputStream (so that I can then create a java.io.ByteArrayInputStream and hand that to a 3rd party library that will end up closing the...
[ "java", "zipinputstream", "zipoutputstream" ]
20
9
54,503
10
0
2008-09-15T21:41:21.460000
2008-09-16T04:54:35.400000
67,299
67,500
Is Unit Testing worth the effort?
I am working to integrate unit testing into the development process on the team I work on and there are some sceptics. What are some good ways to convince the sceptical developers on the team of the value of Unit Testing? In my specific case we would be adding Unit Tests as we add functionality or fixed bugs. Unfortuna...
Every day in our office there is an exchange which goes something like this: "Man, I just love unit tests, I've just been able to make a bunch of changes to the way something works, and then was able to confirm I hadn't broken anything by running the test over it again..." The details change daily, but the sentiment do...
Is Unit Testing worth the effort? I am working to integrate unit testing into the development process on the team I work on and there are some sceptics. What are some good ways to convince the sceptical developers on the team of the value of Unit Testing? In my specific case we would be adding Unit Tests as we add func...
TITLE: Is Unit Testing worth the effort? QUESTION: I am working to integrate unit testing into the development process on the team I work on and there are some sceptics. What are some good ways to convince the sceptical developers on the team of the value of Unit Testing? In my specific case we would be adding Unit Te...
[ "unit-testing" ]
572
722
311,475
44
0
2008-09-15T21:44:00.410000
2008-09-15T22:06:22.743000
67,354
472,081
Dreaded iframe horizontal scroll bar can't be removed in IE?
I have an iframe. The content is wider than the width I am setting so the iframe gets a horizontal scroll bar. I can't increase the width of the iframe so I want to just remove the scroll bar. I tried setting the scroll property to "no" but that kills both scroll bars and I want the vertical one. I tried setting overfl...
scrolling="yes" horizontalscrolling="no" verticalscrolling="yes" Put that in your iFrame tag. You don't need to mess around with trying to format this in CSS.
Dreaded iframe horizontal scroll bar can't be removed in IE? I have an iframe. The content is wider than the width I am setting so the iframe gets a horizontal scroll bar. I can't increase the width of the iframe so I want to just remove the scroll bar. I tried setting the scroll property to "no" but that kills both sc...
TITLE: Dreaded iframe horizontal scroll bar can't be removed in IE? QUESTION: I have an iframe. The content is wider than the width I am setting so the iframe gets a horizontal scroll bar. I can't increase the width of the iframe so I want to just remove the scroll bar. I tried setting the scroll property to "no" but ...
[ "internet-explorer", "iframe" ]
19
44
47,827
6
0
2008-09-15T21:49:59.163000
2009-01-23T06:32:11.183000
67,368
67,396
How do you update a live, busy web site in the politest way possible?
When you roll out changes to a live web site, how do you go about checking that the live system is working correctly? Which tools do you use? Who does it? Do you block access to the site for the testing period? What amount of downtime is acceptable?
I tend to do all of my testing in another environment (not the live one!). This allows me to push the updates to the live site knowing that the code should be working ok, and I just do sanity testing on the live data - make sure I didn't forget a file somewhere, or had something weird go wrong. So proper testing in a t...
How do you update a live, busy web site in the politest way possible? When you roll out changes to a live web site, how do you go about checking that the live system is working correctly? Which tools do you use? Who does it? Do you block access to the site for the testing period? What amount of downtime is acceptable?
TITLE: How do you update a live, busy web site in the politest way possible? QUESTION: When you roll out changes to a live web site, how do you go about checking that the live system is working correctly? Which tools do you use? Who does it? Do you block access to the site for the testing period? What amount of downti...
[ "release-management", "high-availability" ]
17
14
5,357
13
0
2008-09-15T21:51:56.227000
2008-09-15T21:55:17.870000
67,370
67,530
Dynamically Create a generic type for template
I'm programming WCF using the ChannelFactory which expects a type in order to call the CreateChannel method. For example: IProxy proxy = ChannelFactory.CreateChannel(...); In my case I'm doing routing so I don't know what type my channel factory will be using. I can parse a message header to determine the type but I hi...
What you are looking for is MakeGenericType string elementTypeName = Console.ReadLine(); Type elementType = Type.GetType(elementTypeName); Type[] types = new Type[] { elementType }; Type listType = typeof(List<>); Type genericType = listType.MakeGenericType(types); IProxy proxy = (IProxy)Activator.CreateInstance(gener...
Dynamically Create a generic type for template I'm programming WCF using the ChannelFactory which expects a type in order to call the CreateChannel method. For example: IProxy proxy = ChannelFactory.CreateChannel(...); In my case I'm doing routing so I don't know what type my channel factory will be using. I can parse ...
TITLE: Dynamically Create a generic type for template QUESTION: I'm programming WCF using the ChannelFactory which expects a type in order to call the CreateChannel method. For example: IProxy proxy = ChannelFactory.CreateChannel(...); In my case I'm doing routing so I don't know what type my channel factory will be u...
[ "c#", "generics" ]
17
38
25,397
3
0
2008-09-15T21:52:15.553000
2008-09-15T22:10:28.023000
67,410
67,575
Why does sed fail with International characters and how to fix?
GNU sed version 4.1.5 seems to fail with International chars. Here is my input file: Gras Och Stenar Trad - From Moja to Minneapolis DVD [G2007DVD] 7812 | X Gras Och Stenar Trad - From Möja to Minneapolis DVD [G2007DVD] 7812 | Y (Note the umlaut in the second line.) And when I do sed 's/.*| //' < in I would expect to s...
I think the error occurs if the input encoding of the file is different from the preferred encoding of your environment. Example: in is UTF-8 $ LANG=de_DE.UTF-8 sed 's/.*| //' < in X Y $ LANG=de_DE.iso88591 sed 's/.*| //' < in X Y UTF-8 can safely be interpreted as ISO-8859-1, you'll get strange characters but apart fr...
Why does sed fail with International characters and how to fix? GNU sed version 4.1.5 seems to fail with International chars. Here is my input file: Gras Och Stenar Trad - From Moja to Minneapolis DVD [G2007DVD] 7812 | X Gras Och Stenar Trad - From Möja to Minneapolis DVD [G2007DVD] 7812 | Y (Note the umlaut in the sec...
TITLE: Why does sed fail with International characters and how to fix? QUESTION: GNU sed version 4.1.5 seems to fail with International chars. Here is my input file: Gras Och Stenar Trad - From Moja to Minneapolis DVD [G2007DVD] 7812 | X Gras Och Stenar Trad - From Möja to Minneapolis DVD [G2007DVD] 7812 | Y (Note the...
[ "linux", "internationalization", "sed", "character" ]
15
25
17,429
2
0
2008-09-15T21:56:26.650000
2008-09-15T22:18:29.733000
67,426
67,701
Dynamically sorted STL containers
I'm fairly new to the STL, so I was wondering whether there are any dynamically sortable containers? At the moment my current thinking is to use a vector in conjunction with the various sort algorithms, but I'm not sure whether there's a more appropriate selection given the (presumably) linear complexity of inserting e...
If you know you're going to be sorting on a single value ascending and descending, then set is your friend. Use a reverse iterator when you want to "sort" in the opposite direction. If your objects are complex and you're going to be sorting in many different ways based on the member fields within the objects, then you'...
Dynamically sorted STL containers I'm fairly new to the STL, so I was wondering whether there are any dynamically sortable containers? At the moment my current thinking is to use a vector in conjunction with the various sort algorithms, but I'm not sure whether there's a more appropriate selection given the (presumably...
TITLE: Dynamically sorted STL containers QUESTION: I'm fairly new to the STL, so I was wondering whether there are any dynamically sortable containers? At the moment my current thinking is to use a vector in conjunction with the various sort algorithms, but I'm not sure whether there's a more appropriate selection giv...
[ "c++", "stl", "containers" ]
11
10
22,242
12
0
2008-09-15T21:58:37.643000
2008-09-15T22:42:39.863000
67,454
72,180
Serving dynamically generated ZIP archives in Django
How to serve users a dynamically generated ZIP archive in Django? I'm making a site, where users can choose any combination of available books and download them as ZIP archive. I'm worried that generating such archives for each request would slow my server down to a crawl. I have also heard that Django doesn't currentl...
The solution is as follows. Use Python module zipfile to create zip archive, but as the file specify StringIO object (ZipFile constructor requires file-like object). Add files you want to compress. Then in your Django application return the content of StringIO object in HttpResponse with mimetype set to application/x-z...
Serving dynamically generated ZIP archives in Django How to serve users a dynamically generated ZIP archive in Django? I'm making a site, where users can choose any combination of available books and download them as ZIP archive. I'm worried that generating such archives for each request would slow my server down to a ...
TITLE: Serving dynamically generated ZIP archives in Django QUESTION: How to serve users a dynamically generated ZIP archive in Django? I'm making a site, where users can choose any combination of available books and download them as ZIP archive. I'm worried that generating such archives for each request would slow my...
[ "python", "django" ]
71
49
36,070
10
0
2008-09-15T22:00:31.540000
2008-09-16T13:30:56.950000
67,457
67,489
How might I display a web page in a window with a transparent background using C#?
How can I show a web page in a transparent window and have the white part of the web page also transparent.
If you're using a Browser control, there may be a property in it to change the background color to Transparent or to use Alpha channel layering. I'm not entirely sure how effective this would be, but it's worth a try. Another thing to consider would be to create a small parser for the web page's HTML you're trying to v...
How might I display a web page in a window with a transparent background using C#? How can I show a web page in a transparent window and have the white part of the web page also transparent.
TITLE: How might I display a web page in a window with a transparent background using C#? QUESTION: How can I show a web page in a transparent window and have the white part of the web page also transparent. ANSWER: If you're using a Browser control, there may be a property in it to change the background color to Tra...
[ "c#", ".net", "winforms", "webbrowser-control", "transparency" ]
0
1
503
2
0
2008-09-15T22:00:43.037000
2008-09-15T22:04:37.770000
67,492
68,036
What is the simplest way to initialize an Array of N numbers following a simple pattern?
Let's say the first N integers divisible by 3 starting with 9. I'm sure there is some one line solution using lambdas, I just don't know it that area of the language well enough yet.
Just to be different (and to avoid using a where statement) you could also do: var numbers = Enumerable.Range(0, n).Select(i => i * 3 + 9); Update This also has the benefit of not running out of numbers.
What is the simplest way to initialize an Array of N numbers following a simple pattern? Let's say the first N integers divisible by 3 starting with 9. I'm sure there is some one line solution using lambdas, I just don't know it that area of the language well enough yet.
TITLE: What is the simplest way to initialize an Array of N numbers following a simple pattern? QUESTION: Let's say the first N integers divisible by 3 starting with 9. I'm sure there is some one line solution using lambdas, I just don't know it that area of the language well enough yet. ANSWER: Just to be different ...
[ "c#" ]
4
5
663
7
0
2008-09-15T22:04:53.183000
2008-09-15T23:51:14.677000
67,516
68,040
Flex: How to add a tab close button for TabNavigator component
I'd like to have a TabNavigator component that has a close button for some of the tabs. How do I do that? It seems that the TabNavigator component does not allow (or I could not find) extensibility of this form. Help. Thanks
You should take a look at the SuperTabNavigator component from the FlexLib project: SuperTabNavigator example SuperTabNavigator documentation FlexLib Component list If you don't want all of the tabs to have close buttons (I understand from the question that you don't) it looks like you could use the setClosePolicyForTa...
Flex: How to add a tab close button for TabNavigator component I'd like to have a TabNavigator component that has a close button for some of the tabs. How do I do that? It seems that the TabNavigator component does not allow (or I could not find) extensibility of this form. Help. Thanks
TITLE: Flex: How to add a tab close button for TabNavigator component QUESTION: I'd like to have a TabNavigator component that has a close button for some of the tabs. How do I do that? It seems that the TabNavigator component does not allow (or I could not find) extensibility of this form. Help. Thanks ANSWER: You s...
[ "apache-flex", "actionscript-3" ]
7
9
14,352
2
0
2008-09-15T22:08:43.347000
2008-09-15T23:51:26.500000
67,518
69,920
Multiple tabs in Windows and gvim
I am trying to get the Edit with Vim context menu to open files in a new tab of the previously opened Gvim instance (if any). Currently, using Regedit I have modified this key: \HKEY-LOCAL-MACHINE\SOFTWARE\Vim\Gvim\path = "C:\Programs\Vim\vim72\gvim.exe" -p --remote-tab-silent "%*" The registry key type is REG_SZ. This...
Try setting it to: "C:\Programs\Vim \vim72\gvim.exe" -p --remote-tab-silent "%1" "%*" See: http://www.vim.org/tips/tip.php?tip_id=1314 EDIT: As pointed out by Thomas, vim.org tips moved to: http://vim.wikia.com/ See: http://vim.wikia.com/wiki/Add_open-in-tabs_context_menu_for_Windows
Multiple tabs in Windows and gvim I am trying to get the Edit with Vim context menu to open files in a new tab of the previously opened Gvim instance (if any). Currently, using Regedit I have modified this key: \HKEY-LOCAL-MACHINE\SOFTWARE\Vim\Gvim\path = "C:\Programs\Vim\vim72\gvim.exe" -p --remote-tab-silent "%*" The...
TITLE: Multiple tabs in Windows and gvim QUESTION: I am trying to get the Edit with Vim context menu to open files in a new tab of the previously opened Gvim instance (if any). Currently, using Regedit I have modified this key: \HKEY-LOCAL-MACHINE\SOFTWARE\Vim\Gvim\path = "C:\Programs\Vim\vim72\gvim.exe" -p --remote-t...
[ "windows", "vim", "tabs" ]
9
8
6,659
5
0
2008-09-15T22:09:39.520000
2008-09-16T06:54:38.120000
67,554
67,577
What's the best free C++ profiler for Windows?
I'm looking for a profiler in order to find the bottleneck in my C++ code. I'd like to find a free, non-intrusive, and good profiling tool. I'm a game developer, and I use PIX for Xbox 360 and found it very good, but it's not free. I know the Intel VTune, but it's not free either.
CodeXL has now superseded the End Of Line'd AMD Code Analyst and both are free, but not as advanced as VTune. There's also Sleepy, which is very simple, but does the job in many cases. Note: All three of the tools above are unmaintained since several years.
What's the best free C++ profiler for Windows? I'm looking for a profiler in order to find the bottleneck in my C++ code. I'd like to find a free, non-intrusive, and good profiling tool. I'm a game developer, and I use PIX for Xbox 360 and found it very good, but it's not free. I know the Intel VTune, but it's not free...
TITLE: What's the best free C++ profiler for Windows? QUESTION: I'm looking for a profiler in order to find the bottleneck in my C++ code. I'd like to find a free, non-intrusive, and good profiling tool. I'm a game developer, and I use PIX for Xbox 360 and found it very good, but it's not free. I know the Intel VTune,...
[ "c++", "windows", "profiling" ]
240
143
200,909
13
0
2008-09-15T22:15:11.363000
2008-09-15T22:18:51.870000
67,556
67,646
Getting multiple file sizes for a preloader
Alright, currently I have my SWF hitting a php file that will go and find all the files I specify to it, add their sizes together and return their combined sizes as one number. I then use this number with a ProgressEvent listener to determine the current percentage of files downloading for that particular section of th...
You could do an HTTP HEAD request to the server for the files. This will return the header info (including file size) but not the actual file. You could then make a GET request to load the files. http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html (Check out section 9.4 HEAD) What I would probably do is a two tier pr...
Getting multiple file sizes for a preloader Alright, currently I have my SWF hitting a php file that will go and find all the files I specify to it, add their sizes together and return their combined sizes as one number. I then use this number with a ProgressEvent listener to determine the current percentage of files d...
TITLE: Getting multiple file sizes for a preloader QUESTION: Alright, currently I have my SWF hitting a php file that will go and find all the files I specify to it, add their sizes together and return their combined sizes as one number. I then use this number with a ProgressEvent listener to determine the current per...
[ "flash", "actionscript-3" ]
1
2
1,369
4
0
2008-09-15T22:15:49.850000
2008-09-15T22:32:50.947000
67,557
67,623
How to Audit Database Activity without Performance and Scalability Issues?
I have a need to do auditing all database activity regardless of whether it came from application or someone issuing some sql via other means. So the auditing must be done at the database level. The database in question is Oracle. I looked at doing it via Triggers and also via something called Fine Grained Auditing tha...
I'm not sure if it's a mature enough approach for a production system, but I had quite a lot of success with monitoring database traffic using a network traffic sniffer. Send the raw data between the application and database off to another machine and decode and analyse it there. I used PostgreSQL, and decoding the tra...
How to Audit Database Activity without Performance and Scalability Issues? I have a need to do auditing all database activity regardless of whether it came from application or someone issuing some sql via other means. So the auditing must be done at the database level. The database in question is Oracle. I looked at do...
TITLE: How to Audit Database Activity without Performance and Scalability Issues? QUESTION: I have a need to do auditing all database activity regardless of whether it came from application or someone issuing some sql via other means. So the auditing must be done at the database level. The database in question is Orac...
[ "database", "performance", "oracle", "audit" ]
6
1
8,410
4
0
2008-09-15T22:15:59.257000
2008-09-15T22:28:57.697000
67,559
69,666
How do I fix a "broken" debugger in EclipseME (MTJ)?
How do I fix a broken debugger, one that just won't start, in EclipseME (now Mobile Tools Java)? (This question has an answer which will be transferred from another question soon)
The most annoying issue with EclipseME for me was the "broken" debugger, which just wouldn't start. This is covered in docs, but it took me about an hour to find this tip when I first installed EclipseME, and another hour when I returned to JavaME development a year later, so I decided to share this piece of knowledge ...
How do I fix a "broken" debugger in EclipseME (MTJ)? How do I fix a broken debugger, one that just won't start, in EclipseME (now Mobile Tools Java)? (This question has an answer which will be transferred from another question soon)
TITLE: How do I fix a "broken" debugger in EclipseME (MTJ)? QUESTION: How do I fix a broken debugger, one that just won't start, in EclipseME (now Mobile Tools Java)? (This question has an answer which will be transferred from another question soon) ANSWER: The most annoying issue with EclipseME for me was the "broke...
[ "eclipse", "debugging", "java-me", "mtj", "eclipseme" ]
1
4
1,083
2
0
2008-09-15T22:16:39.927000
2008-09-16T05:49:42.893000
67,561
67,605
Do fluent interfaces violate the Law of Demeter?
The wikipedia article about Law of Demeter says: The law can be stated simply as "use only one dot". However a simple example of a fluent interface may look like this: static void Main(string[] args) { new ZRLabs.Yael.Pipeline("cat.jpg").Rotate(90).Watermark("Monkey").RoundCorners(100, Color.Bisque).Save("test.png"); }...
Well, the short definition of the law shortens it too much. The real "law" (in reality advice on good API design) basically says: Only access objects you created yourself, or were passed to you as an argument. Do not access objects indirectly through other objects. Methods of fluent interfaces often return the object i...
Do fluent interfaces violate the Law of Demeter? The wikipedia article about Law of Demeter says: The law can be stated simply as "use only one dot". However a simple example of a fluent interface may look like this: static void Main(string[] args) { new ZRLabs.Yael.Pipeline("cat.jpg").Rotate(90).Watermark("Monkey").Ro...
TITLE: Do fluent interfaces violate the Law of Demeter? QUESTION: The wikipedia article about Law of Demeter says: The law can be stated simply as "use only one dot". However a simple example of a fluent interface may look like this: static void Main(string[] args) { new ZRLabs.Yael.Pipeline("cat.jpg").Rotate(90).Wate...
[ "language-agnostic", "oop", "api-design" ]
62
90
5,090
7
0
2008-09-15T22:16:52.420000
2008-09-15T22:26:51.650000
67,612
67,642
Find coordinates of every link in a page
In Javascript: How does one find the coordinates (x, y, height, width) of every link in a webpage?
Using jQuery, it's as simple as: $("a").each(function() { var link = $(this); var top = link.offset().top; var left = link.offset().left; var width = link.offset.width(); var height = link.offset.height(); });
Find coordinates of every link in a page In Javascript: How does one find the coordinates (x, y, height, width) of every link in a webpage?
TITLE: Find coordinates of every link in a page QUESTION: In Javascript: How does one find the coordinates (x, y, height, width) of every link in a webpage? ANSWER: Using jQuery, it's as simple as: $("a").each(function() { var link = $(this); var top = link.offset().top; var left = link.offset().left; var width = lin...
[ "javascript", "web", "hyperlink", "location" ]
2
3
3,864
4
0
2008-09-15T22:27:39.620000
2008-09-15T22:31:54.303000
67,621
67,637
How to Call a method via AJAX without causing the page to render at all?
I am working with ASP.net. I am trying to call a method that exists on the base class for the page I am using. I want to call this method via Javascript and do not require any rendering to be handled by ASP.net. What would be the easiest way to accomplish this. I have looked at PageMethods which for some reason are not...
It depends on what the method relies on, but assuming it is a static method or that it does not rely on the Page Lifecycle to work, you could expose a webservice endpoint and hit that with whichever Javascript calling mechanism you would like to use.
How to Call a method via AJAX without causing the page to render at all? I am working with ASP.net. I am trying to call a method that exists on the base class for the page I am using. I want to call this method via Javascript and do not require any rendering to be handled by ASP.net. What would be the easiest way to ac...
TITLE: How to Call a method via AJAX without causing the page to render at all? QUESTION: I am working with ASP.net. I am trying to call a method that exists on the base class for the page I am using. I want to call this method via Javascript and do not require any rendering to be handled by ASP.net. What would be the...
[ "asp.net", "ajax", "asp.net-ajax" ]
0
2
1,127
4
0
2008-09-15T22:28:36.480000
2008-09-15T22:31:28.330000
67,628
67,885
Deepzoom for WPF
Are there any ports to WPF of Silverlight's MultiScaleImage (aka DeepZoom)? Have Microsoft road-mapped this at all for WPF? I want to move from WinForms to WPF and require something like DeepZoom, using Silverlight isn't an option.
At the moment there is no port. However, DeepZoom is based on the technology found in the "World Wide Telescope" and the "Microsoft Photo Synth", so they have desktop versions of the technology running. I guess it would be safe to assume that Microsoft will be releasing a multi scale image control for WPF soon. If you ...
Deepzoom for WPF Are there any ports to WPF of Silverlight's MultiScaleImage (aka DeepZoom)? Have Microsoft road-mapped this at all for WPF? I want to move from WinForms to WPF and require something like DeepZoom, using Silverlight isn't an option.
TITLE: Deepzoom for WPF QUESTION: Are there any ports to WPF of Silverlight's MultiScaleImage (aka DeepZoom)? Have Microsoft road-mapped this at all for WPF? I want to move from WinForms to WPF and require something like DeepZoom, using Silverlight isn't an option. ANSWER: At the moment there is no port. However, Dee...
[ "wpf", "silverlight", "deepzoom" ]
10
5
6,349
2
0
2008-09-15T22:30:19.597000
2008-09-15T23:17:47.843000
67,629
67,651
What is "Client-only Framework subset" in Visual Studio 2008?
What does "Client-only Framework subset" in Visual Studio 2008 do?
You mean Client Profile? The.NET Framework Client Profile setup contains just those assemblies and files in the.NET Framework that are typically used for client application scenarios. For example: it includes Windows Forms, WPF, and WCF. It does not include ASP.NET and those libraries and components used primarily for ...
What is "Client-only Framework subset" in Visual Studio 2008? What does "Client-only Framework subset" in Visual Studio 2008 do?
TITLE: What is "Client-only Framework subset" in Visual Studio 2008? QUESTION: What does "Client-only Framework subset" in Visual Studio 2008 do? ANSWER: You mean Client Profile? The.NET Framework Client Profile setup contains just those assemblies and files in the.NET Framework that are typically used for client app...
[ ".net", "visual-studio-2008", ".net-client-profile" ]
10
9
6,758
1
0
2008-09-15T22:30:41.170000
2008-09-15T22:33:28.497000
67,631
67,692
How can I import a module dynamically given the full path?
How do I load a Python module given its full path? Note that the file can be anywhere in the filesystem where the user has access rights. See also: How to import a module given its name as string?
Let's have MyClass in module.name module defined at /path/to/file.py. Below is how we import MyClass from this module For Python 3.5+ use ( docs ): import importlib.util import sys spec = importlib.util.spec_from_file_location("module.name", "/path/to/file.py") foo = importlib.util.module_from_spec(spec) sys.modules["m...
How can I import a module dynamically given the full path? How do I load a Python module given its full path? Note that the file can be anywhere in the filesystem where the user has access rights. See also: How to import a module given its name as string?
TITLE: How can I import a module dynamically given the full path? QUESTION: How do I load a Python module given its full path? Note that the file can be anywhere in the filesystem where the user has access rights. See also: How to import a module given its name as string? ANSWER: Let's have MyClass in module.name mod...
[ "python", "python-import", "python-module" ]
1,793
1,772
1,480,911
38
0
2008-09-15T22:30:55.493000
2008-09-15T22:41:16.887000
67,640
2,676,281
Other than Xcode, are there any full functioned IDEs for Objective-C?
I know and have Xcode, but I was wondering if there were any other complete development environments that support Objective-C? I'm not looking for solutions with vim or emacs, nor editors like BBEdit that support syntax highlighting, but a full fledged IDE with: code completion compilation debugging refactoring Extra p...
I recently learned that Jetbrains the make of my favorite IDE (Idea) may support Objective-C (though it is unclear how much it will work for iPhone/iPad development). See the thread here for early discussion on this. In the last year or two, they have started adding additional language support both in their flagship ID...
Other than Xcode, are there any full functioned IDEs for Objective-C? I know and have Xcode, but I was wondering if there were any other complete development environments that support Objective-C? I'm not looking for solutions with vim or emacs, nor editors like BBEdit that support syntax highlighting, but a full fledg...
TITLE: Other than Xcode, are there any full functioned IDEs for Objective-C? QUESTION: I know and have Xcode, but I was wondering if there were any other complete development environments that support Objective-C? I'm not looking for solutions with vim or emacs, nor editors like BBEdit that support syntax highlighting...
[ "objective-c", "debugging", "ide" ]
12
14
24,100
10
0
2008-09-15T22:31:47.550000
2010-04-20T15:15:29.110000
67,647
76,266
How to convert a FLV file recorded with Red5 / FMS to MP3?
I'm looking for a way to extract the audio part of a FLV file. I'm recording from the user's microphone and the audio is encoded using the Nellymoser Asao Codec. This is the default codec and there's no way to change this.
ffMpeg is the way to go! It worked for me with SVN Rev 14277. The command I used is: ffmpeg -i source.flv -nv -f mp3 destination.mp3 GOTCHA: If you get this error message: Unsupported audio codec (n), check the FLV Spec in the Audio Tags section. ffMpeg can decode n=6 (Nellymoser). But for n=4 (Nellymoser 8-kHz mono) a...
How to convert a FLV file recorded with Red5 / FMS to MP3? I'm looking for a way to extract the audio part of a FLV file. I'm recording from the user's microphone and the audio is encoded using the Nellymoser Asao Codec. This is the default codec and there's no way to change this.
TITLE: How to convert a FLV file recorded with Red5 / FMS to MP3? QUESTION: I'm looking for a way to extract the audio part of a FLV file. I'm recording from the user's microphone and the audio is encoded using the Nellymoser Asao Codec. This is the default codec and there's no way to change this. ANSWER: ffMpeg is t...
[ "mp3", "flv" ]
1
6
3,547
4
0
2008-09-15T22:32:53.443000
2008-09-16T19:56:56.633000
67,659
67,793
Can a LINQ to SQL IsDiscriminator column NOT inherit?
I'm designing my database and LINQ To SQL ASP.NET web application. Imagine I have two types of pages: normal and root. Some pages are roots. Some pages are not. I have a Page database table and a RootPage database table: Page ---- PK PageId HtmlTitle PageHeading MetaDescription IsRoot RootPage -------- FK PK PageId Fa...
The problem here is that you are trying to split your class between two tables, RootPage and Page. Unfortunately LINQ to SQL only supports single table inheritence so this would not work. You would need to merge the two table definitions together and make the RootPage-specific fields nullable. e.g. Page ---- PK PageId ...
Can a LINQ to SQL IsDiscriminator column NOT inherit? I'm designing my database and LINQ To SQL ASP.NET web application. Imagine I have two types of pages: normal and root. Some pages are roots. Some pages are not. I have a Page database table and a RootPage database table: Page ---- PK PageId HtmlTitle PageHeading Met...
TITLE: Can a LINQ to SQL IsDiscriminator column NOT inherit? QUESTION: I'm designing my database and LINQ To SQL ASP.NET web application. Imagine I have two types of pages: normal and root. Some pages are roots. Some pages are not. I have a Page database table and a RootPage database table: Page ---- PK PageId HtmlTit...
[ ".net", "asp.net", "linq", "linq-to-sql", "inheritance" ]
2
2
792
1
0
2008-09-15T22:35:15.607000
2008-09-15T23:02:39.380000
67,665
67,667
IE7 CSS Scrolling Div Bug
I recently came across an IE7 only bug that I thought I'd share so when I come to this site 6 months from now to figure out the same thing, I'll have it on hand. I believe the easiest way to recreate this bug would be the following html in a page with a declared doctype (it works correctly in "quirks mode" / no-doctype...
The easiest fix would be to add position: relative; to the outer div. This will make IE7 work as intended. (See: http://rowanw.com/bugs/overflow_relative.htm ). EDIT: Cache version of the broken link on waybackmachine.org
IE7 CSS Scrolling Div Bug I recently came across an IE7 only bug that I thought I'd share so when I come to this site 6 months from now to figure out the same thing, I'll have it on hand. I believe the easiest way to recreate this bug would be the following html in a page with a declared doctype (it works correctly in ...
TITLE: IE7 CSS Scrolling Div Bug QUESTION: I recently came across an IE7 only bug that I thought I'd share so when I come to this site 6 months from now to figure out the same thing, I'll have it on hand. I believe the easiest way to recreate this bug would be the following html in a page with a declared doctype (it w...
[ "html", "css", "internet-explorer-7" ]
51
98
37,956
1
0
2008-09-15T22:36:00.737000
2008-09-15T22:36:28.770000
67,666
70,060
Backup/Restore database for oracle 10g testing using sqlplus or rman
Using Oracle 10g with our testing server what is the most efficient/easy way to backup and restore a database to a static point, assuming that you always want to go back to the given point once a backup has been created. A sample use case would be the following install and configure all software Modify data to the base...
You do not need to take a backup at your base time. Just enable flashback database, create a guaranteed restore point, run your tests and flashback to the previously created restore point. The steps for this would be: Startup the instance in mount mode. startup force mount; Create the restore point. create restore poin...
Backup/Restore database for oracle 10g testing using sqlplus or rman Using Oracle 10g with our testing server what is the most efficient/easy way to backup and restore a database to a static point, assuming that you always want to go back to the given point once a backup has been created. A sample use case would be the...
TITLE: Backup/Restore database for oracle 10g testing using sqlplus or rman QUESTION: Using Oracle 10g with our testing server what is the most efficient/easy way to backup and restore a database to a static point, assuming that you always want to go back to the given point once a backup has been created. A sample use...
[ "sql", "oracle", "backup", "oracle10g", "rman" ]
8
6
18,111
5
0
2008-09-15T22:36:02.720000
2008-09-16T07:25:47.093000
67,676
67,696
DataSet.Select and DateTime
How can I use.NET DataSet.Select method to search records that match a DateTime? What format should I use to enter my dates in?
The best method is dd MMM yyyy (ie 15 Sep 2008). This means there is no possiblity of getting it wrong for different Locals. ds.select(DBDate = '15 Sep 2008') You can use the DateFormat function to convert to long date format as well and this will work fine too.
DataSet.Select and DateTime How can I use.NET DataSet.Select method to search records that match a DateTime? What format should I use to enter my dates in?
TITLE: DataSet.Select and DateTime QUESTION: How can I use.NET DataSet.Select method to search records that match a DateTime? What format should I use to enter my dates in? ANSWER: The best method is dd MMM yyyy (ie 15 Sep 2008). This means there is no possiblity of getting it wrong for different Locals. ds.select(DB...
[ "c#", ".net", "dataset" ]
1
2
2,933
3
0
2008-09-15T22:38:26.550000
2008-09-15T22:41:44.657000
67,685
779,513
How to join webcam FLVs
I want my website to join some webcam recordings in FLV files (like this one). This needs to be done on Linux without user input. How do I do this? For simplicity's sake, I'll use the same flv as both inputs in hope of getting a flv that plays the same thing twice in a row. That should be easy enough, right? There's ev...
I thought it would be a nice learning exercise to rewrite it in Ruby. It was. Six months later and three gems later, here's the released product. I'll still be working a bit on it, but it works.
How to join webcam FLVs I want my website to join some webcam recordings in FLV files (like this one). This needs to be done on Linux without user input. How do I do this? For simplicity's sake, I'll use the same flv as both inputs in hope of getting a flv that plays the same thing twice in a row. That should be easy e...
TITLE: How to join webcam FLVs QUESTION: I want my website to join some webcam recordings in FLV files (like this one). This needs to be done on Linux without user input. How do I do this? For simplicity's sake, I'll use the same flv as both inputs in hope of getting a flv that plays the same thing twice in a row. Tha...
[ "linux", "flash", "ffmpeg", "webcam", "mencoder" ]
8
4
2,210
4
0
2008-09-15T22:39:47.827000
2009-04-22T22:23:52.107000
67,699
72,156
How do I clone all remote branches?
My master and development branches are tracked remotely on GitHub. How do I clone both these branches?
First, clone a remote Git repository and cd into it: $ git clone git://example.com/myproject $ cd myproject Next, look at the local branches in your repository: $ git branch * master But there are other branches hiding in your repository! See these using the -a flag: $ git branch -a * master remotes/origin/HEAD remotes...
How do I clone all remote branches? My master and development branches are tracked remotely on GitHub. How do I clone both these branches?
TITLE: How do I clone all remote branches? QUESTION: My master and development branches are tracked remotely on GitHub. How do I clone both these branches? ANSWER: First, clone a remote Git repository and cd into it: $ git clone git://example.com/myproject $ cd myproject Next, look at the local branches in your repos...
[ "git", "git-branch", "git-clone", "remote-branch" ]
4,782
5,183
1,780,652
48
0
2008-09-15T22:42:07.430000
2008-09-16T13:28:22.230000