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
26,843
26,862
New Project : MySQL or SQL 2005 Express
I am starting a new client/server project at work and I want to start using some of the newer technologies I've been reading about, LINQ and Generics being the main ones. Up until now I have been developing these types of applications with MySQL as clients were unwilling to pay the large licence costs for MSSQL. I have...
The answer to the question on any project in regards to what platform/technologies to use is: What does everyone know best? Yes express can still be downloaded. Will it fit your requirements? That depends on your requirements, of course. I have deployed MSSQL2005 Express on several enterprise level projects which I kne...
New Project : MySQL or SQL 2005 Express I am starting a new client/server project at work and I want to start using some of the newer technologies I've been reading about, LINQ and Generics being the main ones. Up until now I have been developing these types of applications with MySQL as clients were unwilling to pay t...
TITLE: New Project : MySQL or SQL 2005 Express QUESTION: I am starting a new client/server project at work and I want to start using some of the newer technologies I've been reading about, LINQ and Generics being the main ones. Up until now I have been developing these types of applications with MySQL as clients were ...
[ "mysql", "sql-server" ]
3
6
636
6
0
2008-08-25T20:45:47.603000
2008-08-25T20:52:14.530000
26,845
27,033
Do you use distributed version control?
I'd like to hear from people who are using distributed version control (aka distributed revision control, decentralized version control) and how they are finding it. What are you using, Mercurial, Darcs, Git, Bazaar? Are you still using it? If you've used client/server rcs in the past, are you finding it better, worse ...
I've been using Mercurial both at work and in my own personal projects, and I am really happy with it. The advantages I see are: Local version control. Sometimes I'm working on something, and I want to keep a version history on it, but I'm not ready to push it to the central repositories. With distributed VCS, I can ju...
Do you use distributed version control? I'd like to hear from people who are using distributed version control (aka distributed revision control, decentralized version control) and how they are finding it. What are you using, Mercurial, Darcs, Git, Bazaar? Are you still using it? If you've used client/server rcs in the...
TITLE: Do you use distributed version control? QUESTION: I'd like to hear from people who are using distributed version control (aka distributed revision control, decentralized version control) and how they are finding it. What are you using, Mercurial, Darcs, Git, Bazaar? Are you still using it? If you've used client...
[ "version-control", "dvcs", "revision" ]
37
30
2,988
18
0
2008-08-25T20:46:10.427000
2008-08-25T22:16:04.377000
26,854
129,235
guid REST URL for ado.net dataservice call?
Trying to use a guid as a resource id in a rest url but cant find any resource on how to. My best right now (not working though) is: http://localhost:49157/PhotogalleryDS.svc/gallery ('1d03beb3-6d63-498b-aad7-fab0b1480996') (I've tried duouble/single quotes. And also {guid....} with braces. Still no luck. i only get: ...
I figured it out! http://localhost:49157/PhotogalleryDS.svc/photo(guid '01231cc7-1e26-4f33-9fdf-fdf7015267dd') This is the way
guid REST URL for ado.net dataservice call? Trying to use a guid as a resource id in a rest url but cant find any resource on how to. My best right now (not working though) is: http://localhost:49157/PhotogalleryDS.svc/gallery ('1d03beb3-6d63-498b-aad7-fab0b1480996') (I've tried duouble/single quotes. And also {guid......
TITLE: guid REST URL for ado.net dataservice call? QUESTION: Trying to use a guid as a resource id in a rest url but cant find any resource on how to. My best right now (not working though) is: http://localhost:49157/PhotogalleryDS.svc/gallery ('1d03beb3-6d63-498b-aad7-fab0b1480996') (I've tried duouble/single quotes....
[ "rest", "wcf-data-services" ]
0
1
999
2
0
2008-08-25T20:48:17.240000
2008-09-24T19:14:15.677000
26,855
26,960
What's the fastest way to determine a full URL from a relative URL (given a base URL)
I'm currently using the module URI::URL to generate a full URL from a relative URL; however, it isn't running as fast as I'd like it to be. Does anyone know another way to do this that may be faster?
The following code should work. $uri = URI->new_abs( $str, $base_uri ) You should also take a look at the URI page on search.cpan.org.
What's the fastest way to determine a full URL from a relative URL (given a base URL) I'm currently using the module URI::URL to generate a full URL from a relative URL; however, it isn't running as fast as I'd like it to be. Does anyone know another way to do this that may be faster?
TITLE: What's the fastest way to determine a full URL from a relative URL (given a base URL) QUESTION: I'm currently using the module URI::URL to generate a full URL from a relative URL; however, it isn't running as fast as I'd like it to be. Does anyone know another way to do this that may be faster? ANSWER: The fol...
[ "regex", "performance", "perl", "uri", "perl-module" ]
4
3
465
5
0
2008-08-25T20:49:17.673000
2008-08-25T21:33:37.240000
26,857
26,881
How do you programmatically fill in a form and 'POST' a web page?
Using C# and ASP.NET I want to programmatically fill in some values (4 text boxes) on a web page (form) and then 'POST' those values. How do I do this? Edit: Clarification: There is a service (www.stopforumspam.com) where you can submit ip, username and email address on their 'add' page. I want to be able to create a l...
The code will look something like this: WebRequest req = WebRequest.Create("http://mysite/myform.aspx"); string postData = "item1=11111&item2=22222&Item3=33333"; byte[] send = Encoding.Default.GetBytes(postData); req.Method = "POST"; req.ContentType = "application/x-www-form-urlencoded"; req.ContentLength = send.Lengt...
How do you programmatically fill in a form and 'POST' a web page? Using C# and ASP.NET I want to programmatically fill in some values (4 text boxes) on a web page (form) and then 'POST' those values. How do I do this? Edit: Clarification: There is a service (www.stopforumspam.com) where you can submit ip, username and ...
TITLE: How do you programmatically fill in a form and 'POST' a web page? QUESTION: Using C# and ASP.NET I want to programmatically fill in some values (4 text boxes) on a web page (form) and then 'POST' those values. How do I do this? Edit: Clarification: There is a service (www.stopforumspam.com) where you can submit...
[ "c#", "asp.net" ]
37
49
105,351
6
0
2008-08-25T20:49:47.453000
2008-08-25T21:01:37.037000
26,863
26,868
How do I REALLY reset the Visual Studio window layout?
I had a plugin installed in Visual Studio 2008, and it created some extra dockable windows. I have uninstalled it, and I can't get rid of the windows it created - I close them, but they always come back. They're just empty windows now, since the plugin is no longer present, but nothing I've tried gets rid of them. I've...
Have you tried this? In Visual Studio go to Tools > Import and Export Settings > Reset all settings Be sure you back up your settings before you do this. I made the mistake of trying this to fix an issue and didn't realize it would undo all my appearance settings and toolbars as well. Took a lot of time to get back to ...
How do I REALLY reset the Visual Studio window layout? I had a plugin installed in Visual Studio 2008, and it created some extra dockable windows. I have uninstalled it, and I can't get rid of the windows it created - I close them, but they always come back. They're just empty windows now, since the plugin is no longer...
TITLE: How do I REALLY reset the Visual Studio window layout? QUESTION: I had a plugin installed in Visual Studio 2008, and it created some extra dockable windows. I have uninstalled it, and I can't get rid of the windows it created - I close them, but they always come back. They're just empty windows now, since the p...
[ "visual-studio" ]
134
165
149,618
12
0
2008-08-25T20:53:21.067000
2008-08-25T20:55:13.510000
26,875
26,921
Setting up a large Xcode project
I have a large exiting C++ project involving: 4 applications 50+ libraries 20+ third party libraries It all builds fine on Windows using VS8, Linux using QMake (project uses Qt a lot). I also build it on OS X using QMake but I was wanting to setup an Xcode project to handle it in an IDE. I'm struggling to setup proper ...
Step in to Xcode may be the book you're looking for. It's got a whole section devoted to using AppleScript to automate configuration includes. I've been going through the book myself on O'Reilly Safari as I've found myself in a situation similar to yourself!
Setting up a large Xcode project I have a large exiting C++ project involving: 4 applications 50+ libraries 20+ third party libraries It all builds fine on Windows using VS8, Linux using QMake (project uses Qt a lot). I also build it on OS X using QMake but I was wanting to setup an Xcode project to handle it in an IDE...
TITLE: Setting up a large Xcode project QUESTION: I have a large exiting C++ project involving: 4 applications 50+ libraries 20+ third party libraries It all builds fine on Windows using VS8, Linux using QMake (project uses Qt a lot). I also build it on OS X using QMake but I was wanting to setup an Xcode project to h...
[ "xcode" ]
2
3
1,304
1
0
2008-08-25T20:58:03.130000
2008-08-25T21:16:36.533000
26,877
26,884
Difference between wiring events with and without "new"
In C#, what is the difference (if any) between these two lines of code? tmrMain.Elapsed += new ElapsedEventHandler(tmrMain_Tick); and tmrMain.Elapsed += tmrMain_Tick; Both appear to work exactly the same. Does C# just assume you mean the former when you type the latter?
I did this static void Hook1() { someEvent += new EventHandler( Program_someEvent ); } static void Hook2() { someEvent += Program_someEvent; } And then ran ildasm over the code. The generated MSIL was exactly the same. So to answer your question, yes they are the same thing. The compiler is just inferring that you wan...
Difference between wiring events with and without "new" In C#, what is the difference (if any) between these two lines of code? tmrMain.Elapsed += new ElapsedEventHandler(tmrMain_Tick); and tmrMain.Elapsed += tmrMain_Tick; Both appear to work exactly the same. Does C# just assume you mean the former when you type the l...
TITLE: Difference between wiring events with and without "new" QUESTION: In C#, what is the difference (if any) between these two lines of code? tmrMain.Elapsed += new ElapsedEventHandler(tmrMain_Tick); and tmrMain.Elapsed += tmrMain_Tick; Both appear to work exactly the same. Does C# just assume you mean the former w...
[ "c#", "events", "syntax", "delegates" ]
14
26
3,554
6
0
2008-08-25T20:59:54.247000
2008-08-25T21:02:27.847000
26,879
26,924
Browser scrollbar
I have a website that is perfectely centered aligned. The CSS code works fine. The problem doesn't really have to do with CSS. I have headers for each page that perfectely match eachother. However, when the content gets larger, Opera and FireFox show a scrollbar at the left so you can scroll to the content not on the s...
I use html { overflow-y: scroll; } To standardize the scrollbar behavior in IE and FF
Browser scrollbar I have a website that is perfectely centered aligned. The CSS code works fine. The problem doesn't really have to do with CSS. I have headers for each page that perfectely match eachother. However, when the content gets larger, Opera and FireFox show a scrollbar at the left so you can scroll to the co...
TITLE: Browser scrollbar QUESTION: I have a website that is perfectely centered aligned. The CSS code works fine. The problem doesn't really have to do with CSS. I have headers for each page that perfectely match eachother. However, when the content gets larger, Opera and FireFox show a scrollbar at the left so you ca...
[ "browser" ]
0
9
1,080
6
0
2008-08-25T21:01:14.713000
2008-08-25T21:17:25.110000
26,897
27,006
Recommendations for Javascript Editor on Windows?
Are there any good recommendations anyone can provide for a good Javascript editor on Windows? I currently use combinations of FireBug and TextPad but would hate to miss out on the party if there are better options out there. Thanks.
In case you're a.Net programmer: VS 2008 has pretty great JS support including intellisense on dynamically added methods/properties and comfortable debugging.
Recommendations for Javascript Editor on Windows? Are there any good recommendations anyone can provide for a good Javascript editor on Windows? I currently use combinations of FireBug and TextPad but would hate to miss out on the party if there are better options out there. Thanks.
TITLE: Recommendations for Javascript Editor on Windows? QUESTION: Are there any good recommendations anyone can provide for a good Javascript editor on Windows? I currently use combinations of FireBug and TextPad but would hate to miss out on the party if there are better options out there. Thanks. ANSWER: In case y...
[ "javascript", "editor" ]
37
5
26,794
13
0
2008-08-25T21:06:49.053000
2008-08-25T22:02:23.927000
26,903
27,454
How can you require a constructor with no parameters for types implementing an interface?
Is there a way? I need all types that implement a specific interface to have a parameterless constructor, can it be done? I am developing the base code for other developers in my company to use in a specific project. There's a proccess which will create instances of types (in different threads) that perform certain tas...
Juan Manuel said: that's one of the reasons I don't understand why it cannot be a part of the contract in the interface It's an indirect mechanism. The generic allows you to "cheat" and send type information along with the interface. The critical thing to remember here is that the constraint isn't on the interface that...
How can you require a constructor with no parameters for types implementing an interface? Is there a way? I need all types that implement a specific interface to have a parameterless constructor, can it be done? I am developing the base code for other developers in my company to use in a specific project. There's a pro...
TITLE: How can you require a constructor with no parameters for types implementing an interface? QUESTION: Is there a way? I need all types that implement a specific interface to have a parameterless constructor, can it be done? I am developing the base code for other developers in my company to use in a specific proj...
[ "c#", ".net", "constructor", "interface", "oop" ]
10
5
5,036
10
0
2008-08-25T21:08:45.147000
2008-08-26T05:35:16.880000
26,904
27,828
Getting QMake to generate a proper .app
I have a large exiting C++ project involving: 4 applications 50+ libraries 20+ third party libraries The project uses QMake (part of Trolltech's Qt) to build the production version on Linux, but I've been playing around at building it on MacOS. I can build in on MacOS using QMake just fine but I'm having trouble produc...
I'm sure this could be of some great help for you: deployqt Hope this helps!
Getting QMake to generate a proper .app I have a large exiting C++ project involving: 4 applications 50+ libraries 20+ third party libraries The project uses QMake (part of Trolltech's Qt) to build the production version on Linux, but I've been playing around at building it on MacOS. I can build in on MacOS using QMake...
TITLE: Getting QMake to generate a proper .app QUESTION: I have a large exiting C++ project involving: 4 applications 50+ libraries 20+ third party libraries The project uses QMake (part of Trolltech's Qt) to build the production version on Linux, but I've been playing around at building it on MacOS. I can build in on...
[ "xcode", "qt", "qmake" ]
3
3
2,184
3
0
2008-08-25T21:08:45.553000
2008-08-26T12:00:19.607000
26,971
26,991
NHibernate vs LINQ to SQL
As someone who hasn't used either technology on real-world projects I wonder if anyone knows how these two complement each other and how much their functionalities overlap?
LINQ to SQL forces you to use the table-per-class pattern. The benefits of using this pattern are that it's quick and easy to implement and it takes very little effort to get your domain running based on an existing database structure. For simple applications, this is perfectly acceptable (and oftentimes even preferabl...
NHibernate vs LINQ to SQL As someone who hasn't used either technology on real-world projects I wonder if anyone knows how these two complement each other and how much their functionalities overlap?
TITLE: NHibernate vs LINQ to SQL QUESTION: As someone who hasn't used either technology on real-world projects I wonder if anyone knows how these two complement each other and how much their functionalities overlap? ANSWER: LINQ to SQL forces you to use the table-per-class pattern. The benefits of using this pattern ...
[ "linq", "nhibernate", "linq-to-sql", "orm" ]
117
113
34,774
9
0
2008-08-25T21:39:35.837000
2008-08-25T21:51:07.790000
26,984
27,064
What is the general rule of thumbs for creating an Exception in Java?
I have been in both situations: Creating too many custom Exceptions Using too many general Exception class In both cases the project started OK but soon became an overhead to maintain (and refactor). So what is the best practice regarding the creation of your own Exception classes?
The Java Specialists wrote a post about Exceptions in Java, and in it they list a few "best practices" for creating Exceptions, summarized below: Don't Write Own Exceptions (there are lots of useful Exceptions that are already part of the Java API) Write Useful Exceptions (if you have to write your own Exceptions, make...
What is the general rule of thumbs for creating an Exception in Java? I have been in both situations: Creating too many custom Exceptions Using too many general Exception class In both cases the project started OK but soon became an overhead to maintain (and refactor). So what is the best practice regarding the creatio...
TITLE: What is the general rule of thumbs for creating an Exception in Java? QUESTION: I have been in both situations: Creating too many custom Exceptions Using too many general Exception class In both cases the project started OK but soon became an overhead to maintain (and refactor). So what is the best practice reg...
[ "java", "exception" ]
23
22
14,928
8
0
2008-08-25T21:46:43.153000
2008-08-25T22:50:32.080000
27,009
29,545
How does one implement FxCop / static analysis on an existing code base
What are some of the strategies that are used when implementing FxCop / static analysis on existing code bases with existing violations? How can one most effectively reduce the static analysis violations?
Make liberal use of [SuppressMessage] attribute to begin with. At least at the beginning. Once you get the count to 0 via the attribute, you then put in a rule that new checkins may not introduce FxCop violations. Visual Studio 2008 has a nice code analysis feature that allows you to ensure that code analysis runs on e...
How does one implement FxCop / static analysis on an existing code base What are some of the strategies that are used when implementing FxCop / static analysis on existing code bases with existing violations? How can one most effectively reduce the static analysis violations?
TITLE: How does one implement FxCop / static analysis on an existing code base QUESTION: What are some of the strategies that are used when implementing FxCop / static analysis on existing code bases with existing violations? How can one most effectively reduce the static analysis violations? ANSWER: Make liberal use...
[ "static-analysis", "fxcop", "metrics" ]
5
13
1,765
4
0
2008-08-25T22:04:40.490000
2008-08-27T04:53:45.520000
27,018
27,269
Single responsiblity principle: granularity of the reason to change
When applying the Single Responsibility Principle and looking at a class's reason to change, how do you determine whether that reason too change is too granular, or not granular enough?
I don't know that there's a good answer to this one other than "apply your judgement, based on your experience." Failing that, get help, which I guess is what you're doing here;) Seriously, though, if you find that you're creating a gazillion classes to do what seems like a simple job, then you're probably being too gr...
Single responsiblity principle: granularity of the reason to change When applying the Single Responsibility Principle and looking at a class's reason to change, how do you determine whether that reason too change is too granular, or not granular enough?
TITLE: Single responsiblity principle: granularity of the reason to change QUESTION: When applying the Single Responsibility Principle and looking at a class's reason to change, how do you determine whether that reason too change is too granular, or not granular enough? ANSWER: I don't know that there's a good answer...
[ "oop" ]
4
1
481
2
0
2008-08-25T22:09:23.253000
2008-08-26T02:13:39.487000
27,020
27,139
Alternating coloring groups of rows in Excel
I have an Excel Spreadsheet like this id | data for id | more data for id id | data for id id | data for id | more data for id | even more data for id id | data for id | more data for id id | data for id id | data for id | more data for id Now I want to group the data of one id by alternating the background color of th...
I think this does what you are looking for. Flips color when the cell in column A changes value. Runs until there is no value in column B. Public Sub HighLightRows() Dim i As Integer i = 1 Dim c As Integer c = 3 'red Do While (Cells(i, 2) <> "") If (Cells(i, 1) <> "") Then 'check for new ID If c = 3 Then c = 4 'green ...
Alternating coloring groups of rows in Excel I have an Excel Spreadsheet like this id | data for id | more data for id id | data for id id | data for id | more data for id | even more data for id id | data for id | more data for id id | data for id id | data for id | more data for id Now I want to group the data of one...
TITLE: Alternating coloring groups of rows in Excel QUESTION: I have an Excel Spreadsheet like this id | data for id | more data for id id | data for id id | data for id | more data for id | even more data for id id | data for id | more data for id id | data for id id | data for id | more data for id Now I want to gro...
[ "excel", "vba", "colors" ]
11
4
42,441
8
0
2008-08-25T22:11:30.770000
2008-08-26T00:03:06.243000
27,027
32,441
Best approaches to versioning Mac "bundle" files
So you know a lot of Mac apps use "bundles": It looks like a single file to your application, but it's actually a folder with many files inside. For a version control system to handle this, it needs to: check out all the files in a directory, so the app can modify them as necessary at checkin, commit files which have b...
For distributed SCM systems like git and mercurial shouldn't be a problem as Matthew mentioned. If you need to use a centralized SCM like Subversion or CVS, then you can zip up (archive) your bundles before checking them into source control. This can be painful and takes an extra step. There is a good blog post about t...
Best approaches to versioning Mac "bundle" files So you know a lot of Mac apps use "bundles": It looks like a single file to your application, but it's actually a folder with many files inside. For a version control system to handle this, it needs to: check out all the files in a directory, so the app can modify them a...
TITLE: Best approaches to versioning Mac "bundle" files QUESTION: So you know a lot of Mac apps use "bundles": It looks like a single file to your application, but it's actually a folder with many files inside. For a version control system to handle this, it needs to: check out all the files in a directory, so the app...
[ "macos", "version-control", "bundle" ]
6
1
1,977
4
0
2008-08-25T22:13:58.953000
2008-08-28T14:39:37.337000
27,030
27,212
Comparing Arrays of Objects in JavaScript
I want to compare 2 arrays of objects in JavaScript code. The objects have 8 total properties, but each object will not have a value for each, and the arrays are never going to be any larger than 8 items each, so maybe the brute force method of traversing each and then looking at the values of the 8 properties is the e...
EDIT: You cannot overload operators in current, common browser-based implementations of JavaScript interpreters. To answer the original question, one way you could do this, and mind you, this is a bit of a hack, simply serialize the two arrays to JSON and then compare the two JSON strings. That would simply tell you if...
Comparing Arrays of Objects in JavaScript I want to compare 2 arrays of objects in JavaScript code. The objects have 8 total properties, but each object will not have a value for each, and the arrays are never going to be any larger than 8 items each, so maybe the brute force method of traversing each and then looking ...
TITLE: Comparing Arrays of Objects in JavaScript QUESTION: I want to compare 2 arrays of objects in JavaScript code. The objects have 8 total properties, but each object will not have a value for each, and the arrays are never going to be any larger than 8 items each, so maybe the brute force method of traversing each...
[ "javascript", "arrays", "comparison", "array-of-dict" ]
116
71
409,287
18
0
2008-08-25T22:15:21.617000
2008-08-26T01:39:34.340000
27,034
27,098
Javascript: declaring a variable before the conditional result?
My JavaScript is pretty nominal, so when I saw this construction, I was kind of baffled: var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings"); shareProxiesPref.disabled = proxyTypePref.value!= 1; Isn't it better to do an if on proxyTypePref.value, and then declare the var inside the resu...
It depends on the context of this code. If it's running on page load, then it would be better to put this code in an if block. But, if this is part of a validation function, and the field switches between enabled and disabled throughout the life of the page, then this code sort of makes sense. It's important to remembe...
Javascript: declaring a variable before the conditional result? My JavaScript is pretty nominal, so when I saw this construction, I was kind of baffled: var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings"); shareProxiesPref.disabled = proxyTypePref.value!= 1; Isn't it better to do an if ...
TITLE: Javascript: declaring a variable before the conditional result? QUESTION: My JavaScript is pretty nominal, so when I saw this construction, I was kind of baffled: var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings"); shareProxiesPref.disabled = proxyTypePref.value!= 1; Isn't it b...
[ "javascript" ]
2
2
688
3
0
2008-08-25T22:16:10.227000
2008-08-25T23:14:03.753000
27,044
27,051
How can I set LANG to ascii?
I'm accessing an Ubuntu machine using PuTTY, and using gcc. The default LANG environment variable on this machine is set to en_NZ.UTF-8, which causes GCC to think PuTTY is capable of displaying UTF-8 text, which it doesn't seem to be. Maybe it's my font, I don't know - it does this: foo.c:1: error: expected â=â, â,â, â...
LANG=en_NZ is correct. However, you must make locale files for en_NZ. For Ubuntu, edit /var/lib/locales/supported.d/local and add en_NZ ISO-8859-1 to the file. If your system is another distribution (including Debian), the location will be different. Look at /usr/sbin/locale-gen and see where it stores this info. After...
How can I set LANG to ascii? I'm accessing an Ubuntu machine using PuTTY, and using gcc. The default LANG environment variable on this machine is set to en_NZ.UTF-8, which causes GCC to think PuTTY is capable of displaying UTF-8 text, which it doesn't seem to be. Maybe it's my font, I don't know - it does this: foo.c:1...
TITLE: How can I set LANG to ascii? QUESTION: I'm accessing an Ubuntu machine using PuTTY, and using gcc. The default LANG environment variable on this machine is set to en_NZ.UTF-8, which causes GCC to think PuTTY is capable of displaying UTF-8 text, which it doesn't seem to be. Maybe it's my font, I don't know - it ...
[ "linux", "bash", "utf-8" ]
2
4
7,497
3
0
2008-08-25T22:28:08.717000
2008-08-25T22:34:52.397000
27,065
27,505
Tool to read and display Java .class versions
Do any of you know of a tool that will search for.class files and then display their compiled versions? I know you can look at them individually in a hex editor but I have a lot of class files to look over (something in my giant application is compiling to Java6 for some reason).
Use the javap tool that comes with the JDK. The -verbose option will print the version number of the class file. > javap -verbose MyClass Compiled from "MyClass.java" public class MyClass SourceFile: "MyClass.java" minor version: 0 major version: 46... To only show the version: WINDOWS> javap -verbose MyClass | find "v...
Tool to read and display Java .class versions Do any of you know of a tool that will search for.class files and then display their compiled versions? I know you can look at them individually in a hex editor but I have a lot of class files to look over (something in my giant application is compiling to Java6 for some re...
TITLE: Tool to read and display Java .class versions QUESTION: Do any of you know of a tool that will search for.class files and then display their compiled versions? I know you can look at them individually in a hex editor but I have a lot of class files to look over (something in my giant application is compiling to...
[ "jvm-bytecode" ]
128
153
67,273
12
0
2008-08-25T22:52:02.667000
2008-08-26T07:16:23.953000
27,071
27,326
Pointer to Pointer Managed C++
I have an old C library with a function that takes a void**: oldFunction(void** pStuff); I'm trying to call this function from managed C++ (m_pStuff is a member of the parent ref class of type void*): oldFunction( static_cast ( &m_pStuff ) ); This gives me the following error from Visual Studio: error C2440: 'static_ca...
EDIT: Fixed answer, see below. Really you need to know what oldFunction is going to be doing with pStuff. If pStuff is a pointer to some unmanaged data you can try wrapping the definition of m_pStuff with: #pragma unmanaged void* m_pStuff #pragma managed This will make the pointer unmanaged which can then be passed i...
Pointer to Pointer Managed C++ I have an old C library with a function that takes a void**: oldFunction(void** pStuff); I'm trying to call this function from managed C++ (m_pStuff is a member of the parent ref class of type void*): oldFunction( static_cast ( &m_pStuff ) ); This gives me the following error from Visual ...
TITLE: Pointer to Pointer Managed C++ QUESTION: I have an old C library with a function that takes a void**: oldFunction(void** pStuff); I'm trying to call this function from managed C++ (m_pStuff is a member of the parent ref class of type void*): oldFunction( static_cast ( &m_pStuff ) ); This gives me the following ...
[ "pointers", "managed-c++" ]
1
1
6,324
2
0
2008-08-25T22:55:48.213000
2008-08-26T03:06:46.177000
27,077
28,262
Is there any way to prevent find from digging down recursively into subdirectories?
When I do: $ find / It searches the entire system. How do I prevent that? (This question comes from an " answer " to another question.)
G'day, Just wanted to expand on the suggestion from Jon to use -prune. It isn't the easiest of find options to use, for example to just search in the current directory the find command looks like: find. \( -type d! -name. -prune \) -o \( \) this will stop find from descending into sub-directories within this directory....
Is there any way to prevent find from digging down recursively into subdirectories? When I do: $ find / It searches the entire system. How do I prevent that? (This question comes from an " answer " to another question.)
TITLE: Is there any way to prevent find from digging down recursively into subdirectories? QUESTION: When I do: $ find / It searches the entire system. How do I prevent that? (This question comes from an " answer " to another question.) ANSWER: G'day, Just wanted to expand on the suggestion from Jon to use -prune. It...
[ "bash", "unix", "shell", "ksh" ]
4
4
4,262
5
0
2008-08-25T22:58:43.683000
2008-08-26T14:55:46.377000
27,095
27,552
The Google Calculator Glitch, could float vs. double be a possible reason?
With Google's newfound inability to do math correctly (check it! according to Google 500,000,000,000,002 - 500,000,000,000,001 = 0 ), I figured I'd try the following in C to run a little theory. int main() { char* a = "399999999999999"; char* b = "399999999999998"; float da = atof(a); float db = atof(b); printf("%s -...
In C#, try (double.maxvalue == (double.maxvalue - 100)), you'll get true but that's what it is supposed to be. Thinking about it, you have 64 bit representing a number greater than 2^64 ( double.maxvalue ), so inaccuracy is expected.
The Google Calculator Glitch, could float vs. double be a possible reason? With Google's newfound inability to do math correctly (check it! according to Google 500,000,000,000,002 - 500,000,000,000,001 = 0 ), I figured I'd try the following in C to run a little theory. int main() { char* a = "399999999999999"; char* b ...
TITLE: The Google Calculator Glitch, could float vs. double be a possible reason? QUESTION: With Google's newfound inability to do math correctly (check it! according to Google 500,000,000,000,002 - 500,000,000,000,001 = 0 ), I figured I'd try the following in C to run a little theory. int main() { char* a = "39999999...
[ "c", "math", "google-search" ]
6
2
2,623
7
0
2008-08-25T23:09:30.363000
2008-08-26T08:19:56.813000
27,108
27,130
Perfmon File Analysis Tools
I have a bunch of perfmon files that have captured information over a period of time. Whats the best tool to crunch this information? Idealy I'd like to be able to see avg stats per hour for the object counters that have been monitored.
Perhaps look into using LogParser. It depends on how the info was logged (Perfmon doesn't lack flexibility) If they're CSV you can even use the ODBC Text drivers and run queries against them! (performance would be 'intriguing') And here's the obligatory link to a CodingHorror article on the topic;-)
Perfmon File Analysis Tools I have a bunch of perfmon files that have captured information over a period of time. Whats the best tool to crunch this information? Idealy I'd like to be able to see avg stats per hour for the object counters that have been monitored.
TITLE: Perfmon File Analysis Tools QUESTION: I have a bunch of perfmon files that have captured information over a period of time. Whats the best tool to crunch this information? Idealy I'd like to be able to see avg stats per hour for the object counters that have been monitored. ANSWER: Perhaps look into using LogP...
[ "performance", "logfile-analysis" ]
7
4
18,159
4
0
2008-08-25T23:21:43.597000
2008-08-25T23:51:18.470000
27,129
27,168
Charting library for Java and .Net
Can anyone recommend a library for chart generation (bar charts, pie charts etc.) which runs on both Java and.Net?
ChartDirector is fantastic and supports more than just Java and.NET.
Charting library for Java and .Net Can anyone recommend a library for chart generation (bar charts, pie charts etc.) which runs on both Java and.Net?
TITLE: Charting library for Java and .Net QUESTION: Can anyone recommend a library for chart generation (bar charts, pie charts etc.) which runs on both Java and.Net? ANSWER: ChartDirector is fantastic and supports more than just Java and.NET.
[ "java", ".net", "charts" ]
1
7
1,554
7
0
2008-08-25T23:51:06.630000
2008-08-26T00:48:26.727000
27,138
2,151,866
iPhone app that access the Core Location framework over web
I was wondering if I could access the iPhones Core Location framework over a website? My goal is to build a webapp/website that the iPhone would browse to, then upload its current GPS location. This would be a simple site primary for friends/family so we could locate each other. I can have them manually enter lng/lat b...
Why not simply use W3C GeoLocation API available in mobile Safari? This will work on ipod touch as well (suburb precision). It's literally 10 lines of code and the javascript will work without change on Firefox 3.5. Far easier than scrape some third party website.
iPhone app that access the Core Location framework over web I was wondering if I could access the iPhones Core Location framework over a website? My goal is to build a webapp/website that the iPhone would browse to, then upload its current GPS location. This would be a simple site primary for friends/family so we could...
TITLE: iPhone app that access the Core Location framework over web QUESTION: I was wondering if I could access the iPhones Core Location framework over a website? My goal is to build a webapp/website that the iPhone would browse to, then upload its current GPS location. This would be a simple site primary for friends/...
[ "iphone", "gps", "web-applications" ]
3
4
3,747
4
0
2008-08-26T00:01:55.607000
2010-01-28T02:19:17.140000
27,148
27,156
merge rss feeds
I want to merge multiple rss feeds into a single feed, removing any duplicates. Specifically, I'm interested in merging the feeds for the tags I'm interested in. [A quick search turned up some promising links, which I don't have time to visit at the moment] Broadly speaking, the ideal would be a reader that would list ...
Have you heard of Yahoo's Pipes. Its an interactive feed aggregator and manipulator. List of 'hot pipes' to subscribe to, and ability to create your own (yahoo account required). I played with it during beta back in the day, however I had a blast. Its really fun and easy to aggregate different feeds and you can add log...
merge rss feeds I want to merge multiple rss feeds into a single feed, removing any duplicates. Specifically, I'm interested in merging the feeds for the tags I'm interested in. [A quick search turned up some promising links, which I don't have time to visit at the moment] Broadly speaking, the ideal would be a reader ...
TITLE: merge rss feeds QUESTION: I want to merge multiple rss feeds into a single feed, removing any duplicates. Specifically, I'm interested in merging the feeds for the tags I'm interested in. [A quick search turned up some promising links, which I don't have time to visit at the moment] Broadly speaking, the ideal ...
[ "rss", "feed" ]
6
17
3,659
6
0
2008-08-26T00:17:27.393000
2008-08-26T00:22:20.127000
27,153
140,191
Development resources for Mono on PS3
I have been considering taking the plunge and installing Linux on my Playstation 3. As C# is my current language of choice, the next logical step would be to install Mono. I have done a little research and found that http://psubuntu.com/wiki/InstallationInstructions has instruction on installing Ubuntu and links to dow...
Just found this posting from Miguel de Icaza's blog. Promising that as recently as Feb 2008 he was looking into this. As he is a member of the SO community now, I hope he can shed some further light on the topic.
Development resources for Mono on PS3 I have been considering taking the plunge and installing Linux on my Playstation 3. As C# is my current language of choice, the next logical step would be to install Mono. I have done a little research and found that http://psubuntu.com/wiki/InstallationInstructions has instruction...
TITLE: Development resources for Mono on PS3 QUESTION: I have been considering taking the plunge and installing Linux on my Playstation 3. As C# is my current language of choice, the next logical step would be to install Mono. I have done a little research and found that http://psubuntu.com/wiki/InstallationInstructio...
[ "c#", "mono", "playstation" ]
4
3
4,327
2
0
2008-08-26T00:19:00.947000
2008-09-26T15:23:35.283000
27,195
27,196
Can fogbugz track case dependencies?
Can fogbugz track case dependencies?
Yes and no. Cases can be linked to each other, but if you're looking for a tree of cases (prerequisites and such), you need FogBugz 7 or later. If you're using FogBugz 7.3 or greater, you can now use the Case Dependency Plugin, which was released in April 2011.
Can fogbugz track case dependencies? Can fogbugz track case dependencies?
TITLE: Can fogbugz track case dependencies? QUESTION: Can fogbugz track case dependencies? ANSWER: Yes and no. Cases can be linked to each other, but if you're looking for a tree of cases (prerequisites and such), you need FogBugz 7 or later. If you're using FogBugz 7.3 or greater, you can now use the Case Dependency...
[ "fogbugz" ]
9
9
2,061
4
0
2008-08-26T01:17:25.673000
2008-08-26T01:19:50.147000
27,206
27,344
What are the benefits of using partitions with the Enterprise edition of SQL 2005
I'm comparing between two techniques to create partitioned tables in SQL 2005. Use partitioned views with a standard version of SQL 2005 (described here ) Use the built in partition in the Enterprise edition of SQL 2005 (described here ) Given that the enterprise edition is much more expensive, I would like to know wha...
searchdotnet rulz! check this out: http://www.eggheadcafe.com/forumarchives/SQLServerdatawarehouse/Dec2005/post25052042.asp Updated: that link is dead. So here's a better one http://msdn.microsoft.com/en-us/library/ms345146(SQL.90).aspx#sql2k5parti_topic6 From above: Some of the performance and manageability benefits (...
What are the benefits of using partitions with the Enterprise edition of SQL 2005 I'm comparing between two techniques to create partitioned tables in SQL 2005. Use partitioned views with a standard version of SQL 2005 (described here ) Use the built in partition in the Enterprise edition of SQL 2005 (described here ) ...
TITLE: What are the benefits of using partitions with the Enterprise edition of SQL 2005 QUESTION: I'm comparing between two techniques to create partitioned tables in SQL 2005. Use partitioned views with a standard version of SQL 2005 (described here ) Use the built in partition in the Enterprise edition of SQL 2005 ...
[ "sql", "sql-server-2005", "partitioning" ]
2
0
611
2
0
2008-08-26T01:29:27.423000
2008-08-26T03:23:23.843000
27,219
27,259
Keeping key value pairs together in HTML <select/> with jQuery?
Given a select with multiple option's in jQuery. $select = $(" "); $select.append(" Jason ") //Key = 1.append(" John ") //Key = 32.append(" Paul ") //Key = 423 How should the key be stored and retrieved? The ID may be an OK place but would not be guaranteed unique if I had multiple select's sharing values (and other sc...
Like lucas said the value attribute is what you need. Using your code it would look something like this ( I added an id attribute to the select to make it fit ): $select = $(' '); $select.append(' Jason ') //Key = 1.append(' John ') //Key = 32.append(' Paul ') //Key = 423 jQuery lets you get the value using the val() m...
Keeping key value pairs together in HTML <select/> with jQuery? Given a select with multiple option's in jQuery. $select = $(" "); $select.append(" Jason ") //Key = 1.append(" John ") //Key = 32.append(" Paul ") //Key = 423 How should the key be stored and retrieved? The ID may be an OK place but would not be guarantee...
TITLE: Keeping key value pairs together in HTML <select/> with jQuery? QUESTION: Given a select with multiple option's in jQuery. $select = $(" "); $select.append(" Jason ") //Key = 1.append(" John ") //Key = 32.append(" Paul ") //Key = 423 How should the key be stored and retrieved? The ID may be an OK place but woul...
[ "javascript", "jquery", "html" ]
8
17
15,572
3
0
2008-08-26T01:46:27.273000
2008-08-26T02:07:27.940000
27,222
27,236
DOM manipulation in PHP
I am looking for good methods of manipulating HTML in PHP. For example, the problem I currently have is dealing with malformed HTML. I am getting input that looks something like this: This is some text As you noticed, the HTML is missing closing tags. I could use regex or an XML Parser to solve this problem. However, i...
PHP has a PECL extension that gives you access to the features of HTML Tidy. Tidy is a pretty powerful library that should be able to take code like that and close tags in an intelligent manner. I use it to clean up malformed XML and HTML sent to me by a classified ad system prior to import.
DOM manipulation in PHP I am looking for good methods of manipulating HTML in PHP. For example, the problem I currently have is dealing with malformed HTML. I am getting input that looks something like this: This is some text As you noticed, the HTML is missing closing tags. I could use regex or an XML Parser to solve ...
TITLE: DOM manipulation in PHP QUESTION: I am looking for good methods of manipulating HTML in PHP. For example, the problem I currently have is dealing with malformed HTML. I am getting input that looks something like this: This is some text As you noticed, the HTML is missing closing tags. I could use regex or an XM...
[ "php", "html", "dom" ]
10
11
8,857
4
0
2008-08-26T01:47:29.813000
2008-08-26T01:55:30.730000
27,240
27,389
Why aren't Enumerations Iterable?
In Java 5 and above you have the foreach loop, which works magically on anything that implements Iterable: for (Object o: list) { doStuff(o); } However, Enumerable still does not implement Iterable, meaning that to iterate over an Enumeration you must do the following: for(; e.hasMoreElements();) { doStuff(e.nextElemen...
Enumeration hasn't been modified to support Iterable because it's an interface not a concrete class (like Vector, which was modifed to support the Collections interface). If Enumeration was changed to support Iterable it would break a bunch of people's code.
Why aren't Enumerations Iterable? In Java 5 and above you have the foreach loop, which works magically on anything that implements Iterable: for (Object o: list) { doStuff(o); } However, Enumerable still does not implement Iterable, meaning that to iterate over an Enumeration you must do the following: for(; e.hasMoreE...
TITLE: Why aren't Enumerations Iterable? QUESTION: In Java 5 and above you have the foreach loop, which works magically on anything that implements Iterable: for (Object o: list) { doStuff(o); } However, Enumerable still does not implement Iterable, meaning that to iterate over an Enumeration you must do the following...
[ "java", "enumeration", "iterable" ]
69
41
21,475
6
0
2008-08-26T01:57:51.427000
2008-08-26T03:55:26.963000
27,242
27,254
Where can I learn jQuery? Is it worth it?
I've had a lot of good experiences learning about web development on w3schools.com. It's hit or miss, I know, but the PHP and CSS sections specifically have proven very useful for reference. Anyway, I was wondering if there was a similar site for jQuery. I'm interested in learning, but I need it to be online/searchable...
Rick Strahl and Matt Berseth's blogs both tipped me into jQuery and man am I glad they did. jQuery completely changes a) your client programming perspective, b) the grief it causes it you, and c) how much fun it can be! http://www.west-wind.com/weblog/ http://mattberseth.com/ I used the book jQuery in Action http://www...
Where can I learn jQuery? Is it worth it? I've had a lot of good experiences learning about web development on w3schools.com. It's hit or miss, I know, but the PHP and CSS sections specifically have proven very useful for reference. Anyway, I was wondering if there was a similar site for jQuery. I'm interested in learn...
TITLE: Where can I learn jQuery? Is it worth it? QUESTION: I've had a lot of good experiences learning about web development on w3schools.com. It's hit or miss, I know, but the PHP and CSS sections specifically have proven very useful for reference. Anyway, I was wondering if there was a similar site for jQuery. I'm i...
[ "javascript", "jquery", "review" ]
126
44
28,858
14
0
2008-08-26T01:58:23.093000
2008-08-26T02:05:41.173000
27,243
27,323
NHibernate 1.2 to 2.0 migration
What kinds of considerations are there for migrating an application from NHibernate 1.2 to 2.0? What are breaking changes vs. recommended changes? Are there mapping issues?
Breaking changes in NHibernate 2.0 If you have good test coverage it's busywork. Edit: We upgraded this morning. There is nothing major. You have to Flush() the session after you delete. The Expression namespace got renamed to Criterion. All these are covered in the link above. Mappings need no change. It's quite trans...
NHibernate 1.2 to 2.0 migration What kinds of considerations are there for migrating an application from NHibernate 1.2 to 2.0? What are breaking changes vs. recommended changes? Are there mapping issues?
TITLE: NHibernate 1.2 to 2.0 migration QUESTION: What kinds of considerations are there for migrating an application from NHibernate 1.2 to 2.0? What are breaking changes vs. recommended changes? Are there mapping issues? ANSWER: Breaking changes in NHibernate 2.0 If you have good test coverage it's busywork. Edit: W...
[ "nhibernate" ]
6
8
3,202
2
0
2008-08-26T01:59:00.457000
2008-08-26T03:04:08.333000
27,247
27,276
Could you recommend some guides about Epoll on Linux
I need to know about Epoll On linux System. Could you recommend manual or guides about epoll library? need more detailed guides. it's better to have some examples. help me. and Thank you for reading.
Here's an introduction to Epoll, a pretty basic tutorial: http://blog.kovyrin.net/2006/04/13/epoll-asynchronous-network-programming/ A more complete example can be found here: https://banu.com/blog/2/how-to-use-epoll-a-complete-example-in-c/ Also, the man pages
Could you recommend some guides about Epoll on Linux I need to know about Epoll On linux System. Could you recommend manual or guides about epoll library? need more detailed guides. it's better to have some examples. help me. and Thank you for reading.
TITLE: Could you recommend some guides about Epoll on Linux QUESTION: I need to know about Epoll On linux System. Could you recommend manual or guides about epoll library? need more detailed guides. it's better to have some examples. help me. and Thank you for reading. ANSWER: Here's an introduction to Epoll, a prett...
[ "c++", "linux", "epoll" ]
29
19
36,451
2
0
2008-08-26T02:00:15.820000
2008-08-26T02:19:03.140000
27,253
418,595
Is there a tool for reformatting C# code?
I am looking for a (preferably) command-line tool that can reformat the C# source code on a directory tree. Ideally, I should be able to customize the formatting. Bonus points if the tool can be run on Mono (or Linux).
You could also try NArrange to reformat your code. The formatting options it supports are still pretty limited, but it can process an entire directory and is a command-line tool. Also, NArrange runs under Mono.
Is there a tool for reformatting C# code? I am looking for a (preferably) command-line tool that can reformat the C# source code on a directory tree. Ideally, I should be able to customize the formatting. Bonus points if the tool can be run on Mono (or Linux).
TITLE: Is there a tool for reformatting C# code? QUESTION: I am looking for a (preferably) command-line tool that can reformat the C# source code on a directory tree. Ideally, I should be able to customize the formatting. Bonus points if the tool can be run on Mono (or Linux). ANSWER: You could also try NArrange to r...
[ "c#", "code-formatting" ]
11
5
4,039
10
0
2008-08-26T02:04:30.817000
2009-01-06T23:21:57.443000
27,258
27,270
ASP.NET JavaScript Callbacks Without Full PostBacks?
I'm about to start a fairly Ajax heavy feature in my company's application. What I need to do is make an Ajax callback every few minutes a user has been on the page. I don't need to do any DOM updates before, after, or during the callbacks. I don't need any information from the page, just from a site cookie which shoul...
If you don't want to create a blank page, you could call a IHttpHandler (ashx) file: public class RSSHandler: IHttpHandler { public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/xml"; string sXml = BuildXMLString(); //not showing this function, //but it creates the XML string context...
ASP.NET JavaScript Callbacks Without Full PostBacks? I'm about to start a fairly Ajax heavy feature in my company's application. What I need to do is make an Ajax callback every few minutes a user has been on the page. I don't need to do any DOM updates before, after, or during the callbacks. I don't need any informati...
TITLE: ASP.NET JavaScript Callbacks Without Full PostBacks? QUESTION: I'm about to start a fairly Ajax heavy feature in my company's application. What I need to do is make an Ajax callback every few minutes a user has been on the page. I don't need to do any DOM updates before, after, or during the callbacks. I don't ...
[ "asp.net", "javascript", "ajax" ]
6
6
4,710
9
0
2008-08-26T02:07:25.630000
2008-08-26T02:14:36.237000
27,266
27,280
Avoid traffic shaping by using ssh on port 443
I heard that if you use port 443 (the port usually used for https) for ssh, the encrypted packets look the same to your isp. Could this be a way to avoid traffic shaping/throttling?
I'm not sure it's true that any given ssh packet "looks" the same as any given https packet. However, over their lifetime they don't behave the same way. The session set up and tear down don't look alike (SSH offer a plain text banner during initial connect, for one thing). Also, typically wouldn't an https session be ...
Avoid traffic shaping by using ssh on port 443 I heard that if you use port 443 (the port usually used for https) for ssh, the encrypted packets look the same to your isp. Could this be a way to avoid traffic shaping/throttling?
TITLE: Avoid traffic shaping by using ssh on port 443 QUESTION: I heard that if you use port 443 (the port usually used for https) for ssh, the encrypted packets look the same to your isp. Could this be a way to avoid traffic shaping/throttling? ANSWER: I'm not sure it's true that any given ssh packet "looks" the sam...
[ "linux", "ssh", "https", "trafficshaping" ]
6
5
6,361
3
0
2008-08-26T02:11:52.750000
2008-08-26T02:21:48.187000
27,292
27,298
What is the best solution for maintaining backup and revision control on live websites?
What is the best solution for maintaining backup and revision control on live websites? As part of my job I work with several live websites. We need an efficient means of maintaining backups of the live folders over time. Additionally, updating these sites can be a pain, especially if a change happens to break in the l...
You can still use SVN, but instead of doing a checkout on your live environment, do an export, that way no.svn directories will be created. The downside, of course, is that no code changes on your live environment can take place. This is a good thing. As a general rule, code changes on production systems should never b...
What is the best solution for maintaining backup and revision control on live websites? What is the best solution for maintaining backup and revision control on live websites? As part of my job I work with several live websites. We need an efficient means of maintaining backups of the live folders over time. Additional...
TITLE: What is the best solution for maintaining backup and revision control on live websites? QUESTION: What is the best solution for maintaining backup and revision control on live websites? As part of my job I work with several live websites. We need an efficient means of maintaining backups of the live folders ove...
[ "version-control", "backup", "hosting" ]
3
4
1,114
4
0
2008-08-26T02:32:39.783000
2008-08-26T02:37:51.423000
27,294
27,310
Abstract Factory Design Pattern
I'm working on an internal project for my company, and part of the project is to be able to parse various "Tasks" from an XML file into a collection of tasks to be ran later. Because each type of Task has a multitude of different associated fields, I decided it would be best to represent each type of Task with a sepera...
I use reflection to do this. You can make a factory that basically expands without you having to add any extra code. make sure you have "using System.Reflection", place the following code in your instantiation method. public Task CreateTask(XmlElement elem) { if (elem!= null) { try { Assembly a = typeof(Task).Assembly ...
Abstract Factory Design Pattern I'm working on an internal project for my company, and part of the project is to be able to parse various "Tasks" from an XML file into a collection of tasks to be ran later. Because each type of Task has a multitude of different associated fields, I decided it would be best to represent...
TITLE: Abstract Factory Design Pattern QUESTION: I'm working on an internal project for my company, and part of the project is to be able to parse various "Tasks" from an XML file into a collection of tasks to be ran later. Because each type of Task has a multitude of different associated fields, I decided it would be...
[ "c#", "design-patterns", "factory" ]
21
12
5,051
10
0
2008-08-26T02:35:30.993000
2008-08-26T02:45:00.907000
27,303
27,478
Databind RenderTransform Scaling in Silverlight 2 Beta 2
Anyone know if it's possible to databind the ScaleX and ScaleY of a render transform in Silverlight 2 Beta 2? Binding transforms is possible in WPF - But I'm getting an error when setting up my binding in Silverlight through XAML. Perhaps it's possible to do it through code? I want to bind the ScaleX and ScaleY of the ...
ScaleTransform doesn't have a data context so most likely the binding is looking for SelectedDive.Visibility off it's self and not finding it. There is much in Silverlight xaml and databinding that is different from WPF... Anyway to solve this you will want to set up the binding in code**, or manually listen for the Pr...
Databind RenderTransform Scaling in Silverlight 2 Beta 2 Anyone know if it's possible to databind the ScaleX and ScaleY of a render transform in Silverlight 2 Beta 2? Binding transforms is possible in WPF - But I'm getting an error when setting up my binding in Silverlight through XAML. Perhaps it's possible to do it t...
TITLE: Databind RenderTransform Scaling in Silverlight 2 Beta 2 QUESTION: Anyone know if it's possible to databind the ScaleX and ScaleY of a render transform in Silverlight 2 Beta 2? Binding transforms is possible in WPF - But I'm getting an error when setting up my binding in Silverlight through XAML. Perhaps it's p...
[ "silverlight", "data-binding" ]
1
1
3,222
7
0
2008-08-26T02:40:08.017000
2008-08-26T06:15:17.267000
27,345
27,352
How do I install the php_gd2 extension in MAMP on a Mac?
I'm running MAMP 1.7.2 on a Mac and I'd like to install the extension php_gd2. How do I do this? I know that on Windows using WAMP I'd simply select the php_gd2 entry in the extensions menu to activate it. How is it done when using MAMP? I know that I can do it using MacPorts but I'd prefer not to make any changes to m...
You shouldn't need to install the extension. I have 1.7.2 installed and running right now and it has GD bundled (2.0.34 compatible). From the MAMP start page, click on phpinfo and you should see a GD section.
How do I install the php_gd2 extension in MAMP on a Mac? I'm running MAMP 1.7.2 on a Mac and I'd like to install the extension php_gd2. How do I do this? I know that on Windows using WAMP I'd simply select the php_gd2 entry in the extensions menu to activate it. How is it done when using MAMP? I know that I can do it u...
TITLE: How do I install the php_gd2 extension in MAMP on a Mac? QUESTION: I'm running MAMP 1.7.2 on a Mac and I'd like to install the extension php_gd2. How do I do this? I know that on Windows using WAMP I'd simply select the php_gd2 entry in the extensions menu to activate it. How is it done when using MAMP? I know ...
[ "php", "mamp" ]
6
12
14,033
2
0
2008-08-26T03:23:34.170000
2008-08-26T03:33:39.340000
27,359
27,371
RSync only if filesystem is mounted
I want to setup a cron job to rsync a remote system to a backup partition, something like: bash -c 'rsync -avz --delete --exclude=proc --exclude=sys root@remote1:/ /mnt/remote1/' I would like to be able to "set it and forget it" but what if /mnt/remote1 becomes unmounted? (After a reboot or something) I'd like to error...
if cut -d' ' -f2 /proc/mounts | grep '^/mnt/remote1$' >/dev/null; then rsync -avz... fi Get the list of mounted partitions from /proc/mounts, only match /mnt/remote1 (and if it is mounted, send grep's output to /dev/null ), then run your rsync job. Recent grep s have a -q option that you can use instead of sending the ...
RSync only if filesystem is mounted I want to setup a cron job to rsync a remote system to a backup partition, something like: bash -c 'rsync -avz --delete --exclude=proc --exclude=sys root@remote1:/ /mnt/remote1/' I would like to be able to "set it and forget it" but what if /mnt/remote1 becomes unmounted? (After a re...
TITLE: RSync only if filesystem is mounted QUESTION: I want to setup a cron job to rsync a remote system to a backup partition, something like: bash -c 'rsync -avz --delete --exclude=proc --exclude=sys root@remote1:/ /mnt/remote1/' I would like to be able to "set it and forget it" but what if /mnt/remote1 becomes unmo...
[ "bash", "backup", "system-administration", "rsync" ]
9
5
9,231
6
0
2008-08-26T03:37:53.463000
2008-08-26T03:43:59.753000
27,381
27,391
Should websites expand on window resize?
I'm asking this question purely from a usability standpoint! Should a website expand/stretch to fill the viewing area when you resize a browser window? I know for sure there are the obvious cons: Wide columns of text are hard to read. Writing html/css using percents can be a pain. It makes you vulnerable to having your...
Raw HTML does just that. Are you changing your data so that it doesn't render so good in random sized windows? In the olden days, everyone had VGA screens. Now, that resolution is most uncommon. Who knows what resolutions are going to be common in the future? And why expect a certain minimum width or height? From a usa...
Should websites expand on window resize? I'm asking this question purely from a usability standpoint! Should a website expand/stretch to fill the viewing area when you resize a browser window? I know for sure there are the obvious cons: Wide columns of text are hard to read. Writing html/css using percents can be a pai...
TITLE: Should websites expand on window resize? QUESTION: I'm asking this question purely from a usability standpoint! Should a website expand/stretch to fill the viewing area when you resize a browser window? I know for sure there are the obvious cons: Wide columns of text are hard to read. Writing html/css using per...
[ "html", "css", "browser", "usability" ]
7
11
2,084
15
0
2008-08-26T03:52:06.723000
2008-08-26T03:57:04.010000
27,435
27,440
MySQL vs PostgreSQL for Web Applications
I am working on a web application using Python (Django) and would like to know whether MySQL or PostgreSQL would be more suitable when deploying for production. In one podcast Joel said that he had some problems with MySQL and the data wasn't consistent. I would like to know whether someone had any such problems. Also ...
A note to future readers: The text below was last edited in August 2008. That's nearly 11 years ago as of this edit. Software can change rapidly from version to version, so before you go choosing a DBMS based on the advice below, do some research to see if it's still accurate. Check for newer answers below. Better? MyS...
MySQL vs PostgreSQL for Web Applications I am working on a web application using Python (Django) and would like to know whether MySQL or PostgreSQL would be more suitable when deploying for production. In one podcast Joel said that he had some problems with MySQL and the data wasn't consistent. I would like to know whe...
TITLE: MySQL vs PostgreSQL for Web Applications QUESTION: I am working on a web application using Python (Django) and would like to know whether MySQL or PostgreSQL would be more suitable when deploying for production. In one podcast Joel said that he had some problems with MySQL and the data wasn't consistent. I woul...
[ "mysql", "postgresql" ]
135
129
74,206
10
0
2008-08-26T05:05:35.610000
2008-08-26T05:14:50.690000
27,442
27,448
Is there a rake task for backing up the data in your database?
Is there a rake task for backing up the data in your database? I already have my schema backed up, but I want to make a backup of the data. It's a small MySQL database.
The below script is a simplified version taken from eycap, specifically from this file. set:dbuser "user" set:dbhost "host" set:database "db" namespace:db do desc "Get the database password from user" task:get_password do set(:dbpass) do Capistrano::CLI.ui.ask "Enter mysql password: " end end task:backup_name,:only =...
Is there a rake task for backing up the data in your database? Is there a rake task for backing up the data in your database? I already have my schema backed up, but I want to make a backup of the data. It's a small MySQL database.
TITLE: Is there a rake task for backing up the data in your database? QUESTION: Is there a rake task for backing up the data in your database? I already have my schema backed up, but I want to make a backup of the data. It's a small MySQL database. ANSWER: The below script is a simplified version taken from eycap, sp...
[ "mysql", "ruby-on-rails", "ruby", "database", "rake" ]
5
5
2,094
7
0
2008-08-26T05:20:41.393000
2008-08-26T05:28:39.190000
27,455
27,459
Does Mono support System.Drawing and System.Drawing.Printing?
I'm attempting to use Mono to load a bitmap and print it on Linux but I'm getting an exception. Does Mono support printing on Linux? The code/exception are below: EDIT: No longer getting the exception, but I'm still curious what kind of support there is. Leaving the code for posterity or something. private void btnPrin...
From the Mono docs, I think yes: Managed.Windows.Forms (aka System.Windows.Forms): A complete and cross platform, System.Drawing based Winforms implementation. It also useful if you run the Mono Migration Analyzer first.
Does Mono support System.Drawing and System.Drawing.Printing? I'm attempting to use Mono to load a bitmap and print it on Linux but I'm getting an exception. Does Mono support printing on Linux? The code/exception are below: EDIT: No longer getting the exception, but I'm still curious what kind of support there is. Lea...
TITLE: Does Mono support System.Drawing and System.Drawing.Printing? QUESTION: I'm attempting to use Mono to load a bitmap and print it on Linux but I'm getting an exception. Does Mono support printing on Linux? The code/exception are below: EDIT: No longer getting the exception, but I'm still curious what kind of sup...
[ "c#", ".net", "linux", "printing", "mono" ]
10
7
9,909
2
0
2008-08-26T05:36:17.407000
2008-08-26T05:44:57.543000
27,472
27,473
Timeout not being honoured in connection string
I have a long running SQL statement that I want to run, and no matter what I put in the "timeout=" clause of my connection string, it always seems to end after 30 seconds. I'm just using SqlHelper.ExecuteNonQuery() to execute it, and letting it take care of opening connections, etc. Is there something else that could b...
What are you using to set the timeout in your connection string? From memory that's "ConnectionTimeout" and only affects the time it takes to actually connect to the server. Each individual command has a separate "CommandTimeout" which would be what you're looking for. Not sure how SqlHelper implements that though.
Timeout not being honoured in connection string I have a long running SQL statement that I want to run, and no matter what I put in the "timeout=" clause of my connection string, it always seems to end after 30 seconds. I'm just using SqlHelper.ExecuteNonQuery() to execute it, and letting it take care of opening connec...
TITLE: Timeout not being honoured in connection string QUESTION: I have a long running SQL statement that I want to run, and no matter what I put in the "timeout=" clause of my connection string, it always seems to end after 30 seconds. I'm just using SqlHelper.ExecuteNonQuery() to execute it, and letting it take care...
[ "sql-server", "database", "timeout" ]
29
44
40,230
2
0
2008-08-26T06:06:06.557000
2008-08-26T06:08:57.877000
27,474
27,491
Email SMTP validator
I need to send hundreds of newsletters, but would like to check first if email exists on server. It's called SMTP validation, at least I think so, based on my research on Internet. There's several libraries that can do that, and also a page with open-source code in ASP Classic ( http://www.coveryourasp.com/ValidateEmai...
Be aware that most MTAs (Mail Transfer Agent) will have the VRFY command turned off for spam protection reasons, they'll probably even block you if you try several RCPT TO in a row (see http://www.spamresource.com/2007/01/whatever-happened-to-vrfy.html ). So even if you find a library to do that verification, it won't ...
Email SMTP validator I need to send hundreds of newsletters, but would like to check first if email exists on server. It's called SMTP validation, at least I think so, based on my research on Internet. There's several libraries that can do that, and also a page with open-source code in ASP Classic ( http://www.coveryou...
TITLE: Email SMTP validator QUESTION: I need to send hundreds of newsletters, but would like to check first if email exists on server. It's called SMTP validation, at least I think so, based on my research on Internet. There's several libraries that can do that, and also a page with open-source code in ASP Classic ( h...
[ "validation", "email" ]
18
21
51,166
7
0
2008-08-26T06:10:01.367000
2008-08-26T06:47:39.843000
27,482
27,548
Commenting on LaTeX PDF documents with PDF reader
Im currently writing my bachelor thesis with latex and using TexnicCenter. I want to be able to send my generated pdf file to people and they should be able to write comments. It seems like commenting is not allowed by default, how do I change this? I am using straight to PDF with pdflatex and acrobat reader 9 to read ...
I think your problem is that acrobat reader doesn't allow commenting on documents not produced by abode approved products, which I don't think pdflatex would be. You should look at the free PDF-XChange Viewer which allows you to comment and annotate the text. Its a portable windows app ( download ), so doesn't need to ...
Commenting on LaTeX PDF documents with PDF reader Im currently writing my bachelor thesis with latex and using TexnicCenter. I want to be able to send my generated pdf file to people and they should be able to write comments. It seems like commenting is not allowed by default, how do I change this? I am using straight ...
TITLE: Commenting on LaTeX PDF documents with PDF reader QUESTION: Im currently writing my bachelor thesis with latex and using TexnicCenter. I want to be able to send my generated pdf file to people and they should be able to write comments. It seems like commenting is not allowed by default, how do I change this? I ...
[ "pdf", "latex", "comments", "rights-management", "texnic-center" ]
17
10
9,691
5
0
2008-08-26T06:24:16.763000
2008-08-26T08:11:51.200000
27,492
27,501
C++ Memory management
I've learned in College that you always have to free your unused Objects but not how you actually do it. For example structuring your code right and so on. Are there any general rules on how to handle pointers in C++? I'm currently not allowed to use boost. I have to stick to pure c++ because the framework I'm using fo...
I have worked with the embedded Symbian OS, which had an excellent system in place for this, based entirely on developer conventions. Only one object will ever own a pointer. By default this is the creator. Ownership can be passed on. To indicate passing of ownership, the object is passed as a pointer in the method sig...
C++ Memory management I've learned in College that you always have to free your unused Objects but not how you actually do it. For example structuring your code right and so on. Are there any general rules on how to handle pointers in C++? I'm currently not allowed to use boost. I have to stick to pure c++ because the ...
TITLE: C++ Memory management QUESTION: I've learned in College that you always have to free your unused Objects but not how you actually do it. For example structuring your code right and so on. Are there any general rules on how to handle pointers in C++? I'm currently not allowed to use boost. I have to stick to pur...
[ "c++", "memory", "pointers" ]
8
14
6,989
8
0
2008-08-26T06:50:32.550000
2008-08-26T07:08:26.610000
27,499
27,541
What is Multiversion Concurrency Control (MVCC) and who supports it?
Recently Jeff has posted regarding his trouble with database deadlocks related to reading. Multiversion Concurrency Control (MVCC) claims to solve this problem. What is it, and what databases support it? updated: these support it (which others?) oracle postgresql
Oracle has had an excellent multi version control system in place since very long(at least since oracle 8.0) Following should help. User A starts a transaction and is updating 1000 rows with some value At Time T1 User B reads the same 1000 rows at time T2. User A updates row 543 with value Y (original value X) User B r...
What is Multiversion Concurrency Control (MVCC) and who supports it? Recently Jeff has posted regarding his trouble with database deadlocks related to reading. Multiversion Concurrency Control (MVCC) claims to solve this problem. What is it, and what databases support it? updated: these support it (which others?) oracl...
TITLE: What is Multiversion Concurrency Control (MVCC) and who supports it? QUESTION: Recently Jeff has posted regarding his trouble with database deadlocks related to reading. Multiversion Concurrency Control (MVCC) claims to solve this problem. What is it, and what databases support it? updated: these support it (wh...
[ "database", "deadlock", "terminology" ]
49
42
37,471
15
0
2008-08-26T07:04:21.657000
2008-08-26T08:04:44.073000
27,509
416,327
Detecting an undefined object property
How do I check if an object property in JavaScript is undefined?
The usual way to check if the value of a property is the special value undefined, is: if(o.myProperty === undefined) { alert("myProperty value is the special value `undefined`"); } To check if an object does not actually have such a property, and will therefore return undefined by default when you try to access it: if(...
Detecting an undefined object property How do I check if an object property in JavaScript is undefined?
TITLE: Detecting an undefined object property QUESTION: How do I check if an object property in JavaScript is undefined? ANSWER: The usual way to check if the value of a property is the special value undefined, is: if(o.myProperty === undefined) { alert("myProperty value is the special value `undefined`"); } To check...
[ "javascript", "object", "undefined", "object-property" ]
3,218
2,940
1,496,816
49
0
2008-08-26T07:25:08.083000
2009-01-06T12:27:41.587000
27,532
27,536
Generating gradients programmatically?
Given 2 rgb colors and a rectangular area, I'd like to generate a basic linear gradient between the colors. I've done a quick search and the only thing I've been able to find is this blog entry, but the example code seems to be missing, or at least it was as of this posting. Anything helps, algorithms, code examples, w...
you want an interpolation between the first and the second colour. Interpolating colours is easy by calculating the same interpolation for each of its components (R, G, B). There are many ways to interpolate. The easiest is to use linear interpolation: just take percentage p of the first colour and percentage 1 - p of ...
Generating gradients programmatically? Given 2 rgb colors and a rectangular area, I'd like to generate a basic linear gradient between the colors. I've done a quick search and the only thing I've been able to find is this blog entry, but the example code seems to be missing, or at least it was as of this posting. Anyth...
TITLE: Generating gradients programmatically? QUESTION: Given 2 rgb colors and a rectangular area, I'd like to generate a basic linear gradient between the colors. I've done a quick search and the only thing I've been able to find is this blog entry, but the example code seems to be missing, or at least it was as of t...
[ "java", "colors", "rgb", "gradient" ]
33
44
50,969
5
0
2008-08-26T07:57:06.773000
2008-08-26T08:00:29.183000
27,535
33,940
ASP.NET AJAX and PageRequestManagerParserErrorException
Has anyone run into this error message before when using a timer on an ASP.NET page to update a DataGrid every x seconds? Searching google yielded this blog entry and many more but nothing that seems to apply to me yet. The full text of the error message below: Sys.WebForms.PageRequestManagerParserErrorException: The m...
The RoleProvider sets a cookie to cache role information in a cookie. When the cookie resets during an asynch post back from AJAX, you will get this error. The solution is to either set the cookieTimeout in the roleManager section of your web.config to a very large number of minutes, or set the cacheRolesInCookie=false...
ASP.NET AJAX and PageRequestManagerParserErrorException Has anyone run into this error message before when using a timer on an ASP.NET page to update a DataGrid every x seconds? Searching google yielded this blog entry and many more but nothing that seems to apply to me yet. The full text of the error message below: Sy...
TITLE: ASP.NET AJAX and PageRequestManagerParserErrorException QUESTION: Has anyone run into this error message before when using a timer on an ASP.NET page to update a DataGrid every x seconds? Searching google yielded this blog entry and many more but nothing that seems to apply to me yet. The full text of the error...
[ "asp.net" ]
1
2
567
3
0
2008-08-26T07:59:57.827000
2008-08-29T04:03:30.443000
27,562
27,693
Oracle write to file
I am running oracle and have a query which pulls some results from the database. I would like to write the results as a text file. How would I go about doing this? My prefered way would be by using UTL_FILE. Would some one have an example of how to do this?
If you are using PL/SQL then you can use the UTL_FILE package, the difference from using sql+ spool is that the files are written to the server file system. UTL_FILE has a number of limitations so an alternative on the server side would be to use Java stored procedures.
Oracle write to file I am running oracle and have a query which pulls some results from the database. I would like to write the results as a text file. How would I go about doing this? My prefered way would be by using UTL_FILE. Would some one have an example of how to do this?
TITLE: Oracle write to file QUESTION: I am running oracle and have a query which pulls some results from the database. I would like to write the results as a text file. How would I go about doing this? My prefered way would be by using UTL_FILE. Would some one have an example of how to do this? ANSWER: If you are usi...
[ "oracle" ]
5
4
62,329
5
0
2008-08-26T08:32:51.103000
2008-08-26T10:17:37.340000
27,567
42,689
Where can I learn more about PyPy's translation function?
I've been having a hard time trying to understand PyPy's translation. It looks like something absolutely revolutionary from simply reading the description, however I'm hard-pressed to find good documentation on actually translating a real world piece of code to something such as LLVM. Does such a thing exist? The offic...
This document seems to go into quite a bit of detail (and I think a complete description is out of scope for a stackoverflow answer): http://codespeak.net/pypy/dist/pypy/doc/translation.html The general idea of translating from one language to another isn't particularly revolutionary, but it has only recently been gain...
Where can I learn more about PyPy's translation function? I've been having a hard time trying to understand PyPy's translation. It looks like something absolutely revolutionary from simply reading the description, however I'm hard-pressed to find good documentation on actually translating a real world piece of code to ...
TITLE: Where can I learn more about PyPy's translation function? QUESTION: I've been having a hard time trying to understand PyPy's translation. It looks like something absolutely revolutionary from simply reading the description, however I'm hard-pressed to find good documentation on actually translating a real world...
[ "python", "translation", "pypy" ]
11
6
1,303
5
0
2008-08-26T08:40:28.853000
2008-09-03T21:52:46.640000
27,568
36,972
Assembler IDE/Simulator for beginner
I'd like to learn how to program in Assembler. I've done a bit of assembly before (during my A-Level Computing course) but that was very definitely a simplified 'pseudo-assembler'. I've borrowed my Dad's old Z80 Assembler reference manual, and that seems quite interesting so if possible I'd like to have a go with Z80 a...
I've found a few bits of software that suggest they might do this - but they either refuse to compile, or don't seem to work properly. Has anyone got any suggestions? Write one. You're best off picking a nice, simple instruction set (Z80 should be perfect). I remember doing this as a first-year undergraduate exercise -...
Assembler IDE/Simulator for beginner I'd like to learn how to program in Assembler. I've done a bit of assembly before (during my A-Level Computing course) but that was very definitely a simplified 'pseudo-assembler'. I've borrowed my Dad's old Z80 Assembler reference manual, and that seems quite interesting so if poss...
TITLE: Assembler IDE/Simulator for beginner QUESTION: I'd like to learn how to program in Assembler. I've done a bit of assembly before (during my A-Level Computing course) but that was very definitely a simplified 'pseudo-assembler'. I've borrowed my Dad's old Z80 Assembler reference manual, and that seems quite inte...
[ "simulator", "assembly" ]
20
12
45,396
16
0
2008-08-26T08:40:39.803000
2008-08-31T17:11:41.253000
27,570
27,584
Find number of files with a specific extension, in all subdirectories
Is there a way to find the number of files of a specific type without having to loop through all results inn a Directory.GetFiles() or similar method? I am looking for something like this: int ComponentCount = MagicFindFileCount(@"c:\windows\system32", "*.dll"); I know that I can make a recursive function to call Direc...
You should use the Directory.GetFiles(path, searchPattern, SearchOption) overload of Directory.GetFiles(). Path specifies the path, searchPattern specifies your wildcards (e.g., *, *.format) and SearchOption provides the option to include subdirectories. The Length property of the return array of this search will provi...
Find number of files with a specific extension, in all subdirectories Is there a way to find the number of files of a specific type without having to loop through all results inn a Directory.GetFiles() or similar method? I am looking for something like this: int ComponentCount = MagicFindFileCount(@"c:\windows\system32...
TITLE: Find number of files with a specific extension, in all subdirectories QUESTION: Is there a way to find the number of files of a specific type without having to loop through all results inn a Directory.GetFiles() or similar method? I am looking for something like this: int ComponentCount = MagicFindFileCount(@"c...
[ "c#", "file", "recursion" ]
20
37
43,385
7
0
2008-08-26T08:42:25.463000
2008-08-26T08:53:42.380000
27,572
764,188
JavaServiceWrapper on 64bit linux, any problems?
We've been using the 32bit linux version of the JavaServiceWrapper for quite a while now and it's working perfectly. We are now considering also using it on 64bit linux systems. There are downloads for 64bit binaries on the website, but looking into Makefile for the 64bit version I found the following comment, though: ...
I've had it running in production on 64-bit red hat without any trouble for the last year or so.
JavaServiceWrapper on 64bit linux, any problems? We've been using the 32bit linux version of the JavaServiceWrapper for quite a while now and it's working perfectly. We are now considering also using it on 64bit linux systems. There are downloads for 64bit binaries on the website, but looking into Makefile for the 64bi...
TITLE: JavaServiceWrapper on 64bit linux, any problems? QUESTION: We've been using the 32bit linux version of the JavaServiceWrapper for quite a while now and it's working perfectly. We are now considering also using it on 64bit linux systems. There are downloads for 64bit binaries on the website, but looking into Mak...
[ "java", "daemon" ]
2
1
417
3
0
2008-08-26T08:43:37.457000
2009-04-18T20:58:06.200000
27,581
27,609
What issues should be considered when overriding equals and hashCode in Java?
What issues / pitfalls must be considered when overriding equals and hashCode?
The theory (for the language lawyers and the mathematically inclined): equals() ( javadoc ) must define an equivalence relation (it must be reflexive, symmetric, and transitive ). In addition, it must be consistent (if the objects are not modified, then it must keep returning the same value). Furthermore, o.equals(null...
What issues should be considered when overriding equals and hashCode in Java? What issues / pitfalls must be considered when overriding equals and hashCode?
TITLE: What issues should be considered when overriding equals and hashCode in Java? QUESTION: What issues / pitfalls must be considered when overriding equals and hashCode? ANSWER: The theory (for the language lawyers and the mathematically inclined): equals() ( javadoc ) must define an equivalence relation (it must...
[ "java", "overriding", "equals", "hashcode" ]
616
1,478
608,425
11
0
2008-08-26T08:50:26.223000
2008-08-26T09:12:42.910000
27,598
170,414
How can I make "jconsole" work with Websphere 6.1?
I've deployed some Managed Beans on WebSphere 6.1 and I've managed to invoke them through a standalone client, but when I try to use the application "jconsole" distributed with the standard JDK can can't make it works. Has anyone achieved to connect the jconsole with WAS 6.1? IBM WebSphere 6.1 it's supossed to support ...
WebSphere's support for JMX is crap. Particularly, if you need to connect to any secured JMX beans. Here's an interesting tidbit, their own implementation of jConsole will not connect to their own JVM. I have had a PMR open with IBM for over a year to fix this issue, and have gotten nothing but the runaround. They clea...
How can I make "jconsole" work with Websphere 6.1? I've deployed some Managed Beans on WebSphere 6.1 and I've managed to invoke them through a standalone client, but when I try to use the application "jconsole" distributed with the standard JDK can can't make it works. Has anyone achieved to connect the jconsole with W...
TITLE: How can I make "jconsole" work with Websphere 6.1? QUESTION: I've deployed some Managed Beans on WebSphere 6.1 and I've managed to invoke them through a standalone client, but when I try to use the application "jconsole" distributed with the standard JDK can can't make it works. Has anyone achieved to connect t...
[ "java", "websphere", "jmx", "mbeans" ]
3
5
15,208
7
0
2008-08-26T09:03:21.077000
2008-10-04T14:23:15.823000
27,599
68,096
'Reliable' SMS Unicode & GSM Encoding in PHP
( Updated a little ) I'm not very experienced with internationalization using PHP, it must be said, and a deal of searching didn't really provide the answers I was looking for. I'm in need of working out a reliable way to convert only 'relevant' text to Unicode to send in an SMS message, using PHP (just temporarily, wh...
To deal with it conceptually before getting into mechanisms, and apologies if any of this is obvious, a string can be defined as a sequence of Unicode characters, Unicode being a database that gives an id number known as a code point to every character you might need to work with. GSM-338 contains a subset of the Unico...
'Reliable' SMS Unicode & GSM Encoding in PHP ( Updated a little ) I'm not very experienced with internationalization using PHP, it must be said, and a deal of searching didn't really provide the answers I was looking for. I'm in need of working out a reliable way to convert only 'relevant' text to Unicode to send in an...
TITLE: 'Reliable' SMS Unicode & GSM Encoding in PHP QUESTION: ( Updated a little ) I'm not very experienced with internationalization using PHP, it must be said, and a deal of searching didn't really provide the answers I was looking for. I'm in need of working out a reliable way to convert only 'relevant' text to Uni...
[ "php", "unicode", "sms", "gsm" ]
18
9
22,634
6
0
2008-08-26T09:04:19.357000
2008-09-16T00:03:36.953000
27,621
27,625
Unix shell file copy flattening folder structure
On the UNIX bash shell (specifically Mac OS X Leopard) what would be the simplest way to copy every file having a specific extension from a folder hierarchy (including subdirectories) to the same destination folder (without subfolders)? Obviously there is the problem of having duplicates in the source hierarchy. I woul...
In bash: find /foo -iname '*.txt' -exec cp \{\} /dest/ \; find will find all the files under the path /foo matching the wildcard *.txt, case insensitively (That's what -iname means). For each file, find will execute cp {} /dest/, with the found file in place of {}.
Unix shell file copy flattening folder structure On the UNIX bash shell (specifically Mac OS X Leopard) what would be the simplest way to copy every file having a specific extension from a folder hierarchy (including subdirectories) to the same destination folder (without subfolders)? Obviously there is the problem of ...
TITLE: Unix shell file copy flattening folder structure QUESTION: On the UNIX bash shell (specifically Mac OS X Leopard) what would be the simplest way to copy every file having a specific extension from a folder hierarchy (including subdirectories) to the same destination folder (without subfolders)? Obviously there ...
[ "unix", "shell" ]
44
63
24,784
5
0
2008-08-26T09:22:34.510000
2008-08-26T09:26:18.137000
27,622
41,046
How to enable the TRACE macro in Release mode?
The TRACE macro can be used to output diagnostic messages to the debugger when the code is compiled in Debug mode. I need the same messages while in Release mode. Is there a way to achieve this? (Please do not waste your time discussing why I should not be using TRACE in Release mode:-)
Actually, the TRACE macro is a lot more flexible than OutputDebugString. It takes a printf() style format string and parameter list whereas OutputDebugString just takes a single string. In order to implement the full TRACE functionality in release mode you need to do something like this: void trace(const char* format,....
How to enable the TRACE macro in Release mode? The TRACE macro can be used to output diagnostic messages to the debugger when the code is compiled in Debug mode. I need the same messages while in Release mode. Is there a way to achieve this? (Please do not waste your time discussing why I should not be using TRACE in R...
TITLE: How to enable the TRACE macro in Release mode? QUESTION: The TRACE macro can be used to output diagnostic messages to the debugger when the code is compiled in Debug mode. I need the same messages while in Release mode. Is there a way to achieve this? (Please do not waste your time discussing why I should not b...
[ "mfc", "macros", "trace" ]
15
8
16,114
5
0
2008-08-26T09:22:40.047000
2008-09-03T02:11:11.033000
27,640
27,811
Integrating Qt into legacy MFC applications
We currently maintain a suit of MFC applications that are fairly well designed, however the user interface is beginning to look tired and a lot of the code is in need quite a bit of refactoring to tidy up some duplication and/or performance problems. We make use of quite a few custom controls that handle all their own ...
In my company, we are currently using Qt and are very happy with it. I personnally never had to move a MFC-app into using the Qt framework, but here is something which might be of some interest for you: Qt/MFC Migration Framework Qt/MFC Migration Framework It's part of Qt-Solutions, so this means you'll have to buy a Q...
Integrating Qt into legacy MFC applications We currently maintain a suit of MFC applications that are fairly well designed, however the user interface is beginning to look tired and a lot of the code is in need quite a bit of refactoring to tidy up some duplication and/or performance problems. We make use of quite a fe...
TITLE: Integrating Qt into legacy MFC applications QUESTION: We currently maintain a suit of MFC applications that are fairly well designed, however the user interface is beginning to look tired and a lot of the code is in need quite a bit of refactoring to tidy up some duplication and/or performance problems. We make...
[ "c++", "qt", "mfc" ]
9
8
6,929
4
0
2008-08-26T09:37:52.320000
2008-08-26T11:50:35.247000
27,655
27,661
Cannot delete, a file with that name may already exist
This is starting to vex me. I recently decided to clear out my FTP, and stumbled across an old Wordpress install I forgot I had (oh yes, very security conscious me). Anyway, for some reason deleting the directory failed so I investigated to see what was causing the blockage and I've narrowed it down to a file in wp-con...
First of all, try emailing your webhost either for SSH-access or to remove the symlink for you. If you get SSH-access, use: unlink index.php Or if neither works: Create a PHP file there (for instance remove.php) that contains: Then open that file in your browser, afterwards remove the remove.php file.
Cannot delete, a file with that name may already exist This is starting to vex me. I recently decided to clear out my FTP, and stumbled across an old Wordpress install I forgot I had (oh yes, very security conscious me). Anyway, for some reason deleting the directory failed so I investigated to see what was causing the...
TITLE: Cannot delete, a file with that name may already exist QUESTION: This is starting to vex me. I recently decided to clear out my FTP, and stumbled across an old Wordpress install I forgot I had (oh yes, very security conscious me). Anyway, for some reason deleting the directory failed so I investigated to see wh...
[ "file", "ftp", "symlink" ]
1
2
677
1
0
2008-08-26T09:50:51.070000
2008-08-26T09:55:10.967000
27,674
619,685
Dynamic top down list of controls in WindowsForms and C#?
In our project, SharpWired, we're trying to create a download component similar to the download windows in Firefox or Safari. That is, one single top down list of downloads which are custom controls containing progress bars, buttons and what not. The requirements are that there should be one single list, with one eleme...
If you don't want to use databinding (via the DataRepeater control, as mentioned above), you could use a regular Panel control and set its AutoScroll property to true (to enable scrollbars). Then, you could manually add your custom controls, and set the Dock property of each one to Top.
Dynamic top down list of controls in WindowsForms and C#? In our project, SharpWired, we're trying to create a download component similar to the download windows in Firefox or Safari. That is, one single top down list of downloads which are custom controls containing progress bars, buttons and what not. The requirement...
TITLE: Dynamic top down list of controls in WindowsForms and C#? QUESTION: In our project, SharpWired, we're trying to create a download component similar to the download windows in Firefox or Safari. That is, one single top down list of downloads which are custom controls containing progress bars, buttons and what no...
[ "c#", ".net", "winforms", "user-interface", "user-controls" ]
4
2
2,629
2
0
2008-08-26T10:03:24.787000
2009-03-06T17:25:35.450000
27,695
1,066,304
How to "unversion" a file in either svn and/or git
It happens to me all the time. I accidentally version a file, I do not want to be versioned (i.e. developer/machine specific config-files). If I commit this file, I will mess up the paths on all the other developer machines - they will be unhappy. If I do delete the file from versioning, it will be deleted from the oth...
SVN version 1.5 supports removing/deleting a file from a repository with out losing the local file taken from http://subversion.tigris.org/svn_1.5_releasenotes.html New --keep-local option retains path after delete.. Delete (remove) now takes a --keep-local option to retain its targets locally, so paths will not be rem...
How to "unversion" a file in either svn and/or git It happens to me all the time. I accidentally version a file, I do not want to be versioned (i.e. developer/machine specific config-files). If I commit this file, I will mess up the paths on all the other developer machines - they will be unhappy. If I do delete the fi...
TITLE: How to "unversion" a file in either svn and/or git QUESTION: It happens to me all the time. I accidentally version a file, I do not want to be versioned (i.e. developer/machine specific config-files). If I commit this file, I will mess up the paths on all the other developer machines - they will be unhappy. If ...
[ "svn", "git", "version-control", "versioning" ]
80
35
57,898
15
0
2008-08-26T10:20:41.407000
2009-06-30T21:59:45.613000
27,700
27,749
C++ : Opening a file in non exclusive mode
I have to develop an application which parses a log file and sends specific data to a server. It has to run on both Linux and Windows. The problem appears when I want to test the log rolling system (which appends.1 to the name of the creates a new one with the same name). On Windows (haven't tested yet on Linux) I can'...
Is there a way to open file in a non-exclusive way, Yes, using Win32, passing the various FILE_SHARE_Xxxx flags to CreateFile. is it cross platform? No, it requires platform-specific code. Due to annoying backwards compatibility concerns (DOS applications, being single-tasking, assume that nothing can delete a file out...
C++ : Opening a file in non exclusive mode I have to develop an application which parses a log file and sends specific data to a server. It has to run on both Linux and Windows. The problem appears when I want to test the log rolling system (which appends.1 to the name of the creates a new one with the same name). On W...
TITLE: C++ : Opening a file in non exclusive mode QUESTION: I have to develop an application which parses a log file and sends specific data to a server. It has to run on both Linux and Windows. The problem appears when I want to test the log rolling system (which appends.1 to the name of the creates a new one with th...
[ "c++", "windows", "linux", "filesystems" ]
6
3
7,652
5
0
2008-08-26T10:24:10.680000
2008-08-26T11:02:41.227000
27,726
27,751
What are some instances in which expression trees are useful?
I completely understand the concept of expression trees, but I am having a hard time trying to find situations in which they are useful. Is there a specific instance in which expression trees can be applied? Or is it only useful as a transport mechanism for code? I feel like I am missing something here. Thanks!
Or is it only useful as a transport mechanism for code? It's useful as an execution mechanism for code. Using the interpreter pattern, expression trees can directly be interpreted. This is useful because it's very easy and fast to implement. Such interpreters are ubiquitous and used even in cases that don't seem to “in...
What are some instances in which expression trees are useful? I completely understand the concept of expression trees, but I am having a hard time trying to find situations in which they are useful. Is there a specific instance in which expression trees can be applied? Or is it only useful as a transport mechanism for ...
TITLE: What are some instances in which expression trees are useful? QUESTION: I completely understand the concept of expression trees, but I am having a hard time trying to find situations in which they are useful. Is there a specific instance in which expression trees can be applied? Or is it only useful as a transp...
[ "c#", "expression" ]
11
6
1,534
3
0
2008-08-26T10:45:59.927000
2008-08-26T11:03:34.687000
27,729
28,512
Flex tools for Mac
I'm starting developing with Flex on my Mac but i don't find good tools to ease the development (apart from Flex Builder). What is your favourite choice for Flex development on Mac?
TextMate + the Flex and ActionScript 3 bundles is a great combo. Throw in ProjectPlus and you have an almost full featured development environment. What's missing is visual design tools (which I'm sceptical of anyway), debugger (the command line version isn't very easy to work with) and a profiler. I've long used TextM...
Flex tools for Mac I'm starting developing with Flex on my Mac but i don't find good tools to ease the development (apart from Flex Builder). What is your favourite choice for Flex development on Mac?
TITLE: Flex tools for Mac QUESTION: I'm starting developing with Flex on my Mac but i don't find good tools to ease the development (apart from Flex Builder). What is your favourite choice for Flex development on Mac? ANSWER: TextMate + the Flex and ActionScript 3 bundles is a great combo. Throw in ProjectPlus and yo...
[ "apache-flex", "macos" ]
6
6
3,801
3
0
2008-08-26T10:48:04.710000
2008-08-26T16:15:41.053000
27,733
27,854
So what am I missing with this here WPF?
Background: I have a little video playing app with a UI inspired by the venerable Sasami2k, just updated to use VMR9 (i.e. Direct3D9 with DirectShow) and be less unstable. Currently, it's a C++ app using raw Win32, through necessity: none of the various toolkits are worth a damn. WPF, in particular, was not possible, d...
And I seem to be completely overlooking where the system tells me about resizes. Likewise the hit testing. For the resizing you're indeed missing the SizeChanged event. AFAIK there is sadly no OnSizeChanging, OnLocationChanging and OnStateChanging event on a Window in.NET I saw that one, but as far as I can tell it onl...
So what am I missing with this here WPF? Background: I have a little video playing app with a UI inspired by the venerable Sasami2k, just updated to use VMR9 (i.e. Direct3D9 with DirectShow) and be less unstable. Currently, it's a C++ app using raw Win32, through necessity: none of the various toolkits are worth a damn...
TITLE: So what am I missing with this here WPF? QUESTION: Background: I have a little video playing app with a UI inspired by the venerable Sasami2k, just updated to use VMR9 (i.e. Direct3D9 with DirectShow) and be less unstable. Currently, it's a C++ app using raw Win32, through necessity: none of the various toolkit...
[ "wpf", "winapi" ]
1
1
1,938
4
0
2008-08-26T10:51:34.390000
2008-08-26T12:12:58.407000
27,742
27,750
Finding the crash dump files for a C# app
An app I'm writing always crashes on a clients computer, but I don't get an exception description, or a stack trace. The only thing I get is a crash report that windows wants to send to Microsoft. I would like to get that dump file and investigate it myself, but I cannot find it. When I "View the contents of the error ...
You can use the Windows debugging tools to view the crash dump. To get the most use out of it, you'll need an exact copy of the symbols for that application (i.e. same version). Have a look at Tess's blog for tutorials on how to use the Windows debugging tools. I refer to her blog constantly whenever I'm in need of ana...
Finding the crash dump files for a C# app An app I'm writing always crashes on a clients computer, but I don't get an exception description, or a stack trace. The only thing I get is a crash report that windows wants to send to Microsoft. I would like to get that dump file and investigate it myself, but I cannot find i...
TITLE: Finding the crash dump files for a C# app QUESTION: An app I'm writing always crashes on a clients computer, but I don't get an exception description, or a stack trace. The only thing I get is a crash report that windows wants to send to Microsoft. I would like to get that dump file and investigate it myself, b...
[ "c#", "crash", "memory-dump" ]
12
8
8,426
2
0
2008-08-26T10:56:37.717000
2008-08-26T11:03:32.957000
27,743
31,556
How do I gracefully shut down a Mongrel web server
My RubyOnRails app is set up with the usual pack of mongrels behind Apache configuration. We've noticed that our Mongrel web server memory usage can grow quite large on certain operations and we'd really like to be able to dynamically do a graceful restart of selected Mongrel processes at any time. However, for reasons...
I've done a little more investigation into the Mongrel source and it turns out that Mongrel installs a signal handler to catch an standard process kill (TERM) and do a graceful shutdown, so I don't need a special procedure after all. You can see this working from the log output you get when killing a Mongrel while it's...
How do I gracefully shut down a Mongrel web server My RubyOnRails app is set up with the usual pack of mongrels behind Apache configuration. We've noticed that our Mongrel web server memory usage can grow quite large on certain operations and we'd really like to be able to dynamically do a graceful restart of selected ...
TITLE: How do I gracefully shut down a Mongrel web server QUESTION: My RubyOnRails app is set up with the usual pack of mongrels behind Apache configuration. We've noticed that our Mongrel web server memory usage can grow quite large on certain operations and we'd really like to be able to dynamically do a graceful re...
[ "ruby-on-rails", "ruby", "mongrel" ]
4
12
3,610
6
0
2008-08-26T10:59:50.517000
2008-08-28T02:38:06.320000
27,745
27,755
Getting parts of a URL (Regex)
Given the URL (single line): http://test.example.com/dir/subdir/file.html How can I extract the following parts using regular expressions: The Subdomain (test) The Domain (example.com) The path without the file (/dir/subdir/) The file (file.html) The path with the file (/dir/subdir/file.html) The URL without the path (...
A single regex to parse and breakup a full URL including query parameters and anchors e.g. https://www.google.com/dir/1/2/search.html?arg=0-a&arg1=1-b&arg3-c#hash ^((http[s]?|ftp):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+[^#?\s]+)(.*)?(#[\w\-]+)?$ RexEx positions: url: RegExp['$&'], protocol:RegExp.$2, host:RegExp.$3, p...
Getting parts of a URL (Regex) Given the URL (single line): http://test.example.com/dir/subdir/file.html How can I extract the following parts using regular expressions: The Subdomain (test) The Domain (example.com) The path without the file (/dir/subdir/) The file (file.html) The path with the file (/dir/subdir/file.h...
TITLE: Getting parts of a URL (Regex) QUESTION: Given the URL (single line): http://test.example.com/dir/subdir/file.html How can I extract the following parts using regular expressions: The Subdomain (test) The Domain (example.com) The path without the file (/dir/subdir/) The file (file.html) The path with the file (...
[ "regex", "language-agnostic", "url" ]
164
171
332,581
30
0
2008-08-26T11:01:37.267000
2008-08-26T11:06:09.173000
27,757
27,773
How can I discover the "path" of an embedded resource?
I am storing a PNG as an embedded resource in an assembly. From within the same assembly I have some code like this: Bitmap image = new Bitmap(typeof(MyClass), "Resources.file.png"); The file, named "file.png" is stored in the "Resources" folder (within Visual Studio), and is marked as an embedded resource. The code fa...
This will get you a string array of all the resources: System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames();
How can I discover the "path" of an embedded resource? I am storing a PNG as an embedded resource in an assembly. From within the same assembly I have some code like this: Bitmap image = new Bitmap(typeof(MyClass), "Resources.file.png"); The file, named "file.png" is stored in the "Resources" folder (within Visual Stud...
TITLE: How can I discover the "path" of an embedded resource? QUESTION: I am storing a PNG as an embedded resource in an assembly. From within the same assembly I have some code like this: Bitmap image = new Bitmap(typeof(MyClass), "Resources.file.png"); The file, named "file.png" is stored in the "Resources" folder (...
[ "c#", ".net", "resources" ]
121
218
159,442
5
0
2008-08-26T11:08:48.933000
2008-08-26T11:21:34.333000
27,758
27,825
Notify Developer of a "DO NOT USE" Method
OK, I know what you're thinking, "why write a method you do not want people to use?" Right? Well, in short, I have a class that needs to be serialized to XML. In order for the XmlSerializer to do its magic, the class must have a default, empty constructor: public class MyClass { public MyClass() { // required for xml s...
If a class is [Serialisable] (i.e. it can be copied around the place as needed) the param-less constructor is needed to deserialise. I'm guessing that you want to force your code's access to pass defaults for your properties to a parameterised constructor. Basically you're saying that it's OK for the XmlSerializer to m...
Notify Developer of a "DO NOT USE" Method OK, I know what you're thinking, "why write a method you do not want people to use?" Right? Well, in short, I have a class that needs to be serialized to XML. In order for the XmlSerializer to do its magic, the class must have a default, empty constructor: public class MyClass ...
TITLE: Notify Developer of a "DO NOT USE" Method QUESTION: OK, I know what you're thinking, "why write a method you do not want people to use?" Right? Well, in short, I have a class that needs to be serialized to XML. In order for the XmlSerializer to do its magic, the class must have a default, empty constructor: pub...
[ ".net", "attributes" ]
34
17
11,973
14
0
2008-08-26T11:09:30.820000
2008-08-26T11:58:55.040000
27,774
29,690
Using VLOOKUP in an array formula on Google Spreadsheets
Effectively I want to give numeric scores to alphabetic grades and sum them. In Excel, putting the LOOKUP function into an array formula works: {=SUM(LOOKUP(grades, scoringarray))} With the VLOOKUP function this does not work (only gets the score for the first grade). Google Spreadsheets does not appear to have the LOO...
I still can't see the formulae in your example (just values), but that is exactly what I'm trying to do in terms of the result; obviously I can already do it "by the side" and sum separately - the key for me is doing it in one cell. I have looked at it again this morning - using the MATCH function for the lookup works ...
Using VLOOKUP in an array formula on Google Spreadsheets Effectively I want to give numeric scores to alphabetic grades and sum them. In Excel, putting the LOOKUP function into an array formula works: {=SUM(LOOKUP(grades, scoringarray))} With the VLOOKUP function this does not work (only gets the score for the first gr...
TITLE: Using VLOOKUP in an array formula on Google Spreadsheets QUESTION: Effectively I want to give numeric scores to alphabetic grades and sum them. In Excel, putting the LOOKUP function into an array formula works: {=SUM(LOOKUP(grades, scoringarray))} With the VLOOKUP function this does not work (only gets the scor...
[ "google-sheets", "gs-vlookup" ]
2
0
18,028
5
0
2008-08-26T11:21:52.553000
2008-08-27T07:55:09.423000
27,779
29,443
MFC resources / links
I am about to reenter the MFC world after years away for a new job. What resources to people recommend for refreshing the memory? I have been doing mainly C# recently. Also any MFC centric websites or blogs that people recommend?
For blogs: Your best bet would be the Visual C++ Team Blog. For books: Programming Windows with MFC is one of the best book on the subject. For tutorials: Simply search google for various tutorials on MFC.
MFC resources / links I am about to reenter the MFC world after years away for a new job. What resources to people recommend for refreshing the memory? I have been doing mainly C# recently. Also any MFC centric websites or blogs that people recommend?
TITLE: MFC resources / links QUESTION: I am about to reenter the MFC world after years away for a new job. What resources to people recommend for refreshing the memory? I have been doing mainly C# recently. Also any MFC centric websites or blogs that people recommend? ANSWER: For blogs: Your best bet would be the Vis...
[ "c++", "c", "mfc" ]
13
5
2,934
7
0
2008-08-26T11:28:43.113000
2008-08-27T03:15:43.947000
27,784
35,967
Web server statics repository -or- ZFS vs. NTFS
My goal is to maintain a web file server separately from my main ASP.NET application server for better scalability. The web file server will store a lot of files downloaded by users. So the question is: Is it worth to adopt FreeBSD + Apache + ZFS, or will good old IIS be сonvenient enough?
It all depends on your skill level and how much load you are getting on your servers. If you have spare (physical) resources and have the technical skills and experience to maintain production machines running different operating systems, I'd recommend going running lighttpd on either Linux or FreeBSD. A light OS insta...
Web server statics repository -or- ZFS vs. NTFS My goal is to maintain a web file server separately from my main ASP.NET application server for better scalability. The web file server will store a lot of files downloaded by users. So the question is: Is it worth to adopt FreeBSD + Apache + ZFS, or will good old IIS be ...
TITLE: Web server statics repository -or- ZFS vs. NTFS QUESTION: My goal is to maintain a web file server separately from my main ASP.NET application server for better scalability. The web file server will store a lot of files downloaded by users. So the question is: Is it worth to adopt FreeBSD + Apache + ZFS, or wil...
[ "windows", "bsd" ]
0
1
583
3
0
2008-08-26T11:32:57.613000
2008-08-30T13:57:37.530000
27,818
478,654
How can I manage OSGi build dependencies?
We've embedded an OSGi runtime (Equinox) into out custom client-server application to facilitate plugin development and so far things are going great. We've been using Eclipse to build plugins due to the built-in manifest editor, dependency management, and export wizard. Using Eclipse to manager builds isn't very condu...
Closing out some old questions... Our setup was not conducive to maven due to lack of network connectivity and timing. I know there are offline maven setups, but it was all too much given the time. Hopefully we'll get to use a proper setup when we've got time to reorganize the build process. The solution involved Ant, ...
How can I manage OSGi build dependencies? We've embedded an OSGi runtime (Equinox) into out custom client-server application to facilitate plugin development and so far things are going great. We've been using Eclipse to build plugins due to the built-in manifest editor, dependency management, and export wizard. Using ...
TITLE: How can I manage OSGi build dependencies? QUESTION: We've embedded an OSGi runtime (Equinox) into out custom client-server application to facilitate plugin development and so far things are going great. We've been using Eclipse to build plugins due to the built-in manifest editor, dependency management, and exp...
[ "dependencies", "osgi", "build" ]
11
1
8,944
8
0
2008-08-26T11:54:35.283000
2009-01-26T01:44:39.053000
27,832
27,858
How can I reverse engineer a DirectShow graph?
I have a DirectShow graph to render MPEG2/4 movies from a network stream. When I assemble the graph by connecting the pins manually it doesn't render. But when I call Render on the GraphBuilder it renders fine. Obviously there is some setup step that I'm not performing on some filter in the graph that GraphBuilder is p...
You can watch the graph you created using GraphEdit, a tool from the DirectShow SDK. In GraphEdit, select File->Connect to remote Graph... In order to find your graph in the list, you have to register it in the running object table: void AddToRot( IUnknown *pUnkGraph, DWORD *pdwRegister ) { IMoniker* pMoniker; IRunning...
How can I reverse engineer a DirectShow graph? I have a DirectShow graph to render MPEG2/4 movies from a network stream. When I assemble the graph by connecting the pins manually it doesn't render. But when I call Render on the GraphBuilder it renders fine. Obviously there is some setup step that I'm not performing on ...
TITLE: How can I reverse engineer a DirectShow graph? QUESTION: I have a DirectShow graph to render MPEG2/4 movies from a network stream. When I assemble the graph by connecting the pins manually it doesn't render. But when I call Render on the GraphBuilder it renders fine. Obviously there is some setup step that I'm ...
[ "video", "directx", "directshow", "mpeg" ]
15
14
6,268
7
0
2008-08-26T12:02:08.400000
2008-08-26T12:15:13.160000
27,835
27,895
Does MS-SQL support in-memory tables?
Recently, I started changing some of our applications to support MS SQL Server as an alternative back end. One of the compatibility issues I ran into is the use of MySQL's CREATE TEMPORARY TABLE to create in-memory tables that hold data for very fast access during a session with no need for permanent storage. What is t...
@Keith This is a common misconception: Table variables are NOT necessarily stored in memory. In fact SQL Server decides whether to keep the variable in memory or to spill it to TempDB. There is no reliable way (at least in SQL Server 2005) to ensure that table data is kept in memory. For more detailed info look here
Does MS-SQL support in-memory tables? Recently, I started changing some of our applications to support MS SQL Server as an alternative back end. One of the compatibility issues I ran into is the use of MySQL's CREATE TEMPORARY TABLE to create in-memory tables that hold data for very fast access during a session with no...
TITLE: Does MS-SQL support in-memory tables? QUESTION: Recently, I started changing some of our applications to support MS SQL Server as an alternative back end. One of the compatibility issues I ran into is the use of MySQL's CREATE TEMPORARY TABLE to create in-memory tables that hold data for very fast access during...
[ "mysql", "sql-server", "rdbms", "portability" ]
17
13
32,056
8
0
2008-08-26T12:03:44.013000
2008-08-26T12:29:08.850000
27,836
29,585
Is there a Box Plot graph available for Reporting Services 2005?
Is there a Box Plot graph, or box and whisker graph available for Reporting Services 2005? From the looks of the documentation there doesn't seem to be one out of the box; so I am wondering if there is a third party that has the graph, or a way to build my own?
There definitely isn't a Box Plot built into SSRS 2005, though it's possible that 2008 has one. SSRS 2005 does have a robust extension model. If you can implement a chart in System.Drawing/GDI+, you can make it into a custom report item for SSRS. There are a few third-party vendors with fairly feature-rich products, bu...
Is there a Box Plot graph available for Reporting Services 2005? Is there a Box Plot graph, or box and whisker graph available for Reporting Services 2005? From the looks of the documentation there doesn't seem to be one out of the box; so I am wondering if there is a third party that has the graph, or a way to build m...
TITLE: Is there a Box Plot graph available for Reporting Services 2005? QUESTION: Is there a Box Plot graph, or box and whisker graph available for Reporting Services 2005? From the looks of the documentation there doesn't seem to be one out of the box; so I am wondering if there is a third party that has the graph, o...
[ "sql", "reporting-services", "graph" ]
1
2
1,703
4
0
2008-08-26T12:04:15.633000
2008-08-27T05:23:45.760000
27,850
28,217
What are models for storing tree structures and what are their characteristics?
So far I have encountered adjacency list, nested sets and nested intervals as models for storing tree structures in a database. I know these well enough and have migrated trees from one to another. What are other popular models? What are their characteristics? What are good resources (books, web, etc) on this topic? I'...
The seminal resource for this are chapters 28-30 of SQL for Smarties. (I've recommended this book so much I figure Celko owes me royalties by now!)
What are models for storing tree structures and what are their characteristics? So far I have encountered adjacency list, nested sets and nested intervals as models for storing tree structures in a database. I know these well enough and have migrated trees from one to another. What are other popular models? What are th...
TITLE: What are models for storing tree structures and what are their characteristics? QUESTION: So far I have encountered adjacency list, nested sets and nested intervals as models for storing tree structures in a database. I know these well enough and have migrated trees from one to another. What are other popular m...
[ "data-structures", "modeling" ]
5
1
271
2
0
2008-08-26T12:11:05.010000
2008-08-26T14:35:13.760000
27,853
245,175
ModalPopupExtender adding scrollbars in SharePoint
Whenever I show a ModalPopupExtender on my Sharepoint site, the popup shown creates both horizontal and vertical scrollbars. If you scroll all the way to the end of the page, the scrollbar refreshes, and there is more page to scroll through. Basically, I think the popup is setting its bounds beyond the end of the page....
I assume the TargetControl is of sufficient size to hold everything you put in it? If so, try: Set CSS overflow:hidden; If the target control is a Panel, set scrollbars="none". Otherwise, put it in a panel and try it.
ModalPopupExtender adding scrollbars in SharePoint Whenever I show a ModalPopupExtender on my Sharepoint site, the popup shown creates both horizontal and vertical scrollbars. If you scroll all the way to the end of the page, the scrollbar refreshes, and there is more page to scroll through. Basically, I think the popu...
TITLE: ModalPopupExtender adding scrollbars in SharePoint QUESTION: Whenever I show a ModalPopupExtender on my Sharepoint site, the popup shown creates both horizontal and vertical scrollbars. If you scroll all the way to the end of the page, the scrollbar refreshes, and there is more page to scroll through. Basically...
[ "sharepoint", "modalpopupextender" ]
0
1
2,074
2
0
2008-08-26T12:12:23.603000
2008-10-28T22:54:00.910000
27,889
28,346
How to get SpecUnit to run within a TeamCity CI build
I am trying to get SpecUnit to run in a continuous integration build using Nant. At the moment the files are in the correct place but no output is generated from SpecUnit.Report.exe. Here is the relevant task from the nant build script: Please note: ${specunit.exe} is the full path to where “SpecUnit.Report.exe” is loc...
You need to specify the full path to the assembly argument I think...
How to get SpecUnit to run within a TeamCity CI build I am trying to get SpecUnit to run in a continuous integration build using Nant. At the moment the files are in the correct place but no output is generated from SpecUnit.Report.exe. Here is the relevant task from the nant build script: Please note: ${specunit.exe} ...
TITLE: How to get SpecUnit to run within a TeamCity CI build QUESTION: I am trying to get SpecUnit to run in a continuous integration build using Nant. At the moment the files are in the correct place but no output is generated from SpecUnit.Report.exe. Here is the relevant task from the nant build script: Please note...
[ "c#", "nant", "teamcity" ]
0
0
383
1
0
2008-08-26T12:26:10.620000
2008-08-26T15:21:19.577000
27,894
64,891
What's the difference between a temp table and table variable in SQL Server?
In SQL Server 2005, we can create similar tables in two different ways. We can use a table variable: declare @tmp table (Col1 int, Col2 int); Or we can use a temporary table: create table #tmp (Col1 int, Col2 int); What are the differences between these two? I have read conflicting opinions on whether @tmp still uses t...
There are a few differences between Temporary Tables (#tmp) and Table Variables (@tmp), although using tempdb isn't one of them, as spelt out in the MSDN link below. As a rule of thumb, for small to medium volumes of data and simple usage scenarios you should use table variables. (This is an overly broad guideline with...
What's the difference between a temp table and table variable in SQL Server? In SQL Server 2005, we can create similar tables in two different ways. We can use a table variable: declare @tmp table (Col1 int, Col2 int); Or we can use a temporary table: create table #tmp (Col1 int, Col2 int); What are the differences bet...
TITLE: What's the difference between a temp table and table variable in SQL Server? QUESTION: In SQL Server 2005, we can create similar tables in two different ways. We can use a table variable: declare @tmp table (Col1 int, Col2 int); Or we can use a temporary table: create table #tmp (Col1 int, Col2 int); What are t...
[ "sql-server", "temp-tables", "table-variable" ]
427
422
422,492
13
0
2008-08-26T12:27:30.337000
2008-09-15T17:24:40.610000
27,899
5,040,105
Is there a way to have index.html functionality with content hosted on S3?
Is there a way to make S3 default to an index.html page? E.g.: My bucket object listing: /index.html /favicon.ico /images/logo.gif A call to www.example.com/ index.html works great! But if one were to call www.example.com/ we'd either get a 403 or a REST object listing XML document depending on how bucket-level ACL was...
Amazon S3 now supports Index Documents The index document for a bucket can be set to something like index.html. When accessing the root of the site or a sub-directory containing a document of that name that document is returned. It is extremely easy to do using the aws cli: aws s3 website $MY_BUCKET_NAME --index-docume...
Is there a way to have index.html functionality with content hosted on S3? Is there a way to make S3 default to an index.html page? E.g.: My bucket object listing: /index.html /favicon.ico /images/logo.gif A call to www.example.com/ index.html works great! But if one were to call www.example.com/ we'd either get a 403 ...
TITLE: Is there a way to have index.html functionality with content hosted on S3? QUESTION: Is there a way to make S3 default to an index.html page? E.g.: My bucket object listing: /index.html /favicon.ico /images/logo.gif A call to www.example.com/ index.html works great! But if one were to call www.example.com/ we'd...
[ "amazon-s3", "amazon-web-services" ]
39
37
31,349
7
0
2008-08-26T12:30:19.253000
2011-02-18T10:22:32.553000
27,916
28,519
SQL Server - testing the database
What tools are people using for testing SQL Server databases? By this I mean all parts of the database: configuration tables column type stored procedures constraints Most likely, there is not one tool to do it all.
How do you mean "Test the database"? If you are testing foreign keys, a simply script to insert invalid data is all you should need. Testing a database could imply a great number of issues. Does it have all the tables? Are the tables correct? Are the indexes in place? Did the latest updates get applied? Has the data be...
SQL Server - testing the database What tools are people using for testing SQL Server databases? By this I mean all parts of the database: configuration tables column type stored procedures constraints Most likely, there is not one tool to do it all.
TITLE: SQL Server - testing the database QUESTION: What tools are people using for testing SQL Server databases? By this I mean all parts of the database: configuration tables column type stored procedures constraints Most likely, there is not one tool to do it all. ANSWER: How do you mean "Test the database"? If you...
[ "sql-server", "unit-testing" ]
3
1
592
2
0
2008-08-26T12:42:12.203000
2008-08-26T16:17:42.843000
27,921
27,938
What is the "best" way to create a thumbnail using ASP.NET?
Story: The user uploads an image that will be added to a photo gallery. As part of the upload process, we need to A) store the image on the web server's hard drive and B) store a thumbnail of the image on the web server's hard drive. "Best" here is defined as Relatively easy to implement, understand, and maintain Resul...
I suppose your best solution would be using the GetThumbnailImage from the.NET Image class. // Example in C#, should be quite alike in ASP.NET // Assuming filename as the uploaded file using ( Image bigImage = new Bitmap( filename ) ) { // Algorithm simplified for purpose of example. int height = bigImage.Height / 10; ...
What is the "best" way to create a thumbnail using ASP.NET? Story: The user uploads an image that will be added to a photo gallery. As part of the upload process, we need to A) store the image on the web server's hard drive and B) store a thumbnail of the image on the web server's hard drive. "Best" here is defined as ...
TITLE: What is the "best" way to create a thumbnail using ASP.NET? QUESTION: Story: The user uploads an image that will be added to a photo gallery. As part of the upload process, we need to A) store the image on the web server's hard drive and B) store a thumbnail of the image on the web server's hard drive. "Best" h...
[ "asp.net", "image", "thumbnails" ]
23
15
28,148
6
0
2008-08-26T12:47:35.123000
2008-08-26T12:53:53.800000
27,928
27,943
Calculate distance between two latitude-longitude points? (Haversine formula)
How do I calculate the distance between two points specified by latitude and longitude? For clarification, I'd like the distance in kilometers; the points use the WGS84 system and I'd like to understand the relative accuracies of the approaches available.
This link might be helpful to you, as it details the use of the Haversine formula to calculate the distance. Excerpt: This script [in Javascript] calculates great-circle distances between the two points – that is, the shortest distance over the earth’s surface – using the ‘Haversine’ formula. function getDistanceFromLa...
Calculate distance between two latitude-longitude points? (Haversine formula) How do I calculate the distance between two points specified by latitude and longitude? For clarification, I'd like the distance in kilometers; the points use the WGS84 system and I'd like to understand the relative accuracies of the approach...
TITLE: Calculate distance between two latitude-longitude points? (Haversine formula) QUESTION: How do I calculate the distance between two points specified by latitude and longitude? For clarification, I'd like the distance in kilometers; the points use the WGS84 system and I'd like to understand the relative accuraci...
[ "algorithm", "math", "maps", "latitude-longitude", "haversine" ]
1,160
1,381
1,186,651
49
0
2008-08-26T12:50:45.647000
2008-08-26T12:55:53.030000
27,931
27,988
Dynamic Element Names
I want to transform an XML document. The source XML looks like this: 2007 2006 2005 I want to turn that into: The following line of code isn't working: The output is a series of elements that look like this: < NewTag >. (Without the spaces...) "//Element/Year", "./Element/Year", and "//svc:Element/Year" don't work eith...
Probably namespace issues and maybe one with current context. For source (with added namespace declaration to make it well-formed xml) 2007 2006 2005 the stylesheet will give you the output you need. Note that svc:Element needs to be selected using namespace prefixed and that the context when generating the new tags is...
Dynamic Element Names I want to transform an XML document. The source XML looks like this: 2007 2006 2005 I want to turn that into: The following line of code isn't working: The output is a series of elements that look like this: < NewTag >. (Without the spaces...) "//Element/Year", "./Element/Year", and "//svc:Element...
TITLE: Dynamic Element Names QUESTION: I want to transform an XML document. The source XML looks like this: 2007 2006 2005 I want to turn that into: The following line of code isn't working: The output is a series of elements that look like this: < NewTag >. (Without the spaces...) "//Element/Year", "./Element/Year", ...
[ "xml", "xslt", "namespaces" ]
14
13
24,757
1
0
2008-08-26T12:51:55.583000
2008-08-26T13:12:30.917000
27,942
27,963
Is it worth it to learn a dialect of assembly?
My goals are focused on software application development, and maybe web application development, but most likely desktop applications. I'm embarking on a path to becoming more familiar with C/C++, but should I go much lower than that, into assembly? Or would I not have a benefit for my long-term goals?
It's probably not going to have a whole lot of benefit unless you have a direct application for it. If you're going for general knowledge, C/C++ is a fine place to start. That said, the challenges that assembly poses are very interesting and it requires a pretty different mindset to get things done. I spent a little ti...
Is it worth it to learn a dialect of assembly? My goals are focused on software application development, and maybe web application development, but most likely desktop applications. I'm embarking on a path to becoming more familiar with C/C++, but should I go much lower than that, into assembly? Or would I not have a b...
TITLE: Is it worth it to learn a dialect of assembly? QUESTION: My goals are focused on software application development, and maybe web application development, but most likely desktop applications. I'm embarking on a path to becoming more familiar with C/C++, but should I go much lower than that, into assembly? Or wo...
[ "assembly" ]
4
1
1,454
11
0
2008-08-26T12:54:57.103000
2008-08-26T13:02:39.643000
27,948
28,068
Which resolution to target for a Mobile App?
When desinging UI for mobile apps in general which resolution could be considered safe as a general rule of thumb. My interest lies specifically in web based apps. The iPhone has a pretty high resolution for a hand held, and the Nokia E Series seem to oriented differently. Is 240×320 still considered safe?
Not enough information... You say you're targeting a "Mobile App" but the reality is that mobile could mean anything from a cell phone with 128x128 resolution to a MID with 800x600 resolution. There is no "safe" resolution for such a wide range, and if you're truly targeting all of them you need to design a custom inte...
Which resolution to target for a Mobile App? When desinging UI for mobile apps in general which resolution could be considered safe as a general rule of thumb. My interest lies specifically in web based apps. The iPhone has a pretty high resolution for a hand held, and the Nokia E Series seem to oriented differently. I...
TITLE: Which resolution to target for a Mobile App? QUESTION: When desinging UI for mobile apps in general which resolution could be considered safe as a general rule of thumb. My interest lies specifically in web based apps. The iPhone has a pretty high resolution for a hand held, and the Nokia E Series seem to orien...
[ "mobile", "web-applications" ]
1
3
2,739
3
0
2008-08-26T12:57:42.167000
2008-08-26T13:45:07.420000
27,952
28,230
How do I change the locations of source files in a symbols file (pdb)
Basically what I want to do it this: a pdb file contains a location of source files (e.g. C:\dev\proj1\helloworld.cs ). Is it possible to modify that pdb file so that it contains a different location (e.g. \more\differenter\location\proj1\helloworld.cs )?
You can use the source indexing feature of the Debugging Tools for Windows, which will save references to the appropriate revisions of the files in your source repository as an alternate stream in the PDB file.
How do I change the locations of source files in a symbols file (pdb) Basically what I want to do it this: a pdb file contains a location of source files (e.g. C:\dev\proj1\helloworld.cs ). Is it possible to modify that pdb file so that it contains a different location (e.g. \more\differenter\location\proj1\helloworld....
TITLE: How do I change the locations of source files in a symbols file (pdb) QUESTION: Basically what I want to do it this: a pdb file contains a location of source files (e.g. C:\dev\proj1\helloworld.cs ). Is it possible to modify that pdb file so that it contains a different location (e.g. \more\differenter\location...
[ "debugging", "symbols", "pdb-files" ]
26
12
12,747
4
0
2008-08-26T12:58:31.073000
2008-08-26T14:41:07.130000