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
143,215
143,352
How to display text using Quartz on the iPhone?
I've been trying to display text using a Quartz context, but no matter what I've tried I simply haven't had luck getting the text to display (I'm able to display all sorts of other Quartz objects though). Anybody knows what I might be doing wrong? example: -(void)drawRect:(CGRect)rect { // Drawing code CGContextRef con...
Here is a fragment of code that I'm using. UIColor *mainTextColor = [UIColor whiteColor]; [mainTextColor set]; drawTextLjust(@"Sample Text", 8, 50, 185, 18, 16); And: static void drawTextLjust(NSString* text, CGFloat y, CGFloat left, CGFloat right, int maxFontSize, int minFontSize) { CGPoint point = CGPointMake(left, y...
How to display text using Quartz on the iPhone? I've been trying to display text using a Quartz context, but no matter what I've tried I simply haven't had luck getting the text to display (I'm able to display all sorts of other Quartz objects though). Anybody knows what I might be doing wrong? example: -(void)drawRect...
TITLE: How to display text using Quartz on the iPhone? QUESTION: I've been trying to display text using a Quartz context, but no matter what I've tried I simply haven't had luck getting the text to display (I'm able to display all sorts of other Quartz objects though). Anybody knows what I might be doing wrong? exampl...
[ "iphone", "cocoa-touch", "quartz-2d" ]
7
7
8,984
2
0
2008-09-27T08:10:34.317000
2008-09-27T10:04:29.770000
143,233
143,239
How to redirect data to stdin within a single executable?
I am using cxxtest as the test framework for my C++ classes, and would like to figure out a way to simulate sending data to classes which would normally expect to receive it from standard input. I have several different files which I would like to send to the classes during different tests, so redirection from the comm...
The appropriate method is to rewrite your classes so that they are testable. They should accept as a parameter the handle, stream or file from which they are supposed to read data - in your test framework, you can then mock in the stream or supply the path to the file containing the test data.
How to redirect data to stdin within a single executable? I am using cxxtest as the test framework for my C++ classes, and would like to figure out a way to simulate sending data to classes which would normally expect to receive it from standard input. I have several different files which I would like to send to the cl...
TITLE: How to redirect data to stdin within a single executable? QUESTION: I am using cxxtest as the test framework for my C++ classes, and would like to figure out a way to simulate sending data to classes which would normally expect to receive it from standard input. I have several different files which I would like...
[ "c++" ]
4
10
2,974
5
0
2008-09-27T08:32:33.173000
2008-09-27T08:35:18.360000
143,234
143,282
Lua = operator as print
In Lua, using the = operator without an l-value seems to be equivalent to a print(r-value), here are a few examples run in the Lua standalone interpreter: > = a nil > a = 8 > = a 8 > = 'hello' hello > = print function: 003657C8 And so on... My question is: where can I find a detailed description of this use for the = o...
Quoting the man page: In interactive mode... If a line starts with '=', then lua displays the values of all the expressions in the remainder of the line. The expressions must be separated by commas.
Lua = operator as print In Lua, using the = operator without an l-value seems to be equivalent to a print(r-value), here are a few examples run in the Lua standalone interpreter: > = a nil > a = 8 > = a 8 > = 'hello' hello > = print function: 003657C8 And so on... My question is: where can I find a detailed description...
TITLE: Lua = operator as print QUESTION: In Lua, using the = operator without an l-value seems to be equivalent to a print(r-value), here are a few examples run in the Lua standalone interpreter: > = a nil > a = 8 > = a 8 > = 'hello' hello > = print function: 003657C8 And so on... My question is: where can I find a de...
[ "lua" ]
5
15
1,397
4
0
2008-09-27T08:33:07.227000
2008-09-27T09:09:05.330000
143,281
143,317
Silverlight controls in ASP.NET application
I need my ASP.NET web application to use silverlight controls in my web page. Please let me know how to use them. Do i need to add any reference for them in my Visual Studio 2005. Framework 2.0 and ASP.NET 2.0 application environment.
A nice post over here which takes care of your problem. Cheers.
Silverlight controls in ASP.NET application I need my ASP.NET web application to use silverlight controls in my web page. Please let me know how to use them. Do i need to add any reference for them in my Visual Studio 2005. Framework 2.0 and ASP.NET 2.0 application environment.
TITLE: Silverlight controls in ASP.NET application QUESTION: I need my ASP.NET web application to use silverlight controls in my web page. Please let me know how to use them. Do i need to add any reference for them in my Visual Studio 2005. Framework 2.0 and ASP.NET 2.0 application environment. ANSWER: A nice post ov...
[ "asp.net", "silverlight" ]
1
1
953
1
0
2008-09-27T09:07:10.267000
2008-09-27T09:40:22.557000
143,285
143,298
How much memory do Enums take?
For example if I have an Enum with two cases, does it make take more memory than a boolean? Languages: Java, C++
In Java, an enum is a full-blown class: Java programming language enum types are much more powerful than their counterparts in other languages. The enum declaration defines a class (called an enum type). The enum class body can include methods and other fields. In order to see the actual size of each enum, let's make a...
How much memory do Enums take? For example if I have an Enum with two cases, does it make take more memory than a boolean? Languages: Java, C++
TITLE: How much memory do Enums take? QUESTION: For example if I have an Enum with two cases, does it make take more memory than a boolean? Languages: Java, C++ ANSWER: In Java, an enum is a full-blown class: Java programming language enum types are much more powerful than their counterparts in other languages. The e...
[ "java", "c++", "memory", "enums" ]
56
54
36,095
12
0
2008-09-27T09:15:15.333000
2008-09-27T09:23:20.337000
143,296
144,625
Pseudo class :hover does not work in IE7
I've got such a simple code: Foo Bar and this CSS:.div1{ position: relative; }.div1.div3 { position: absolute; top: 30px; left: 0px; width: 250px; display: none; }.div1:hover.div3 { display: block; }.div2{ width: 200px; height: 30px; background: red; }.div4 { background-color: green; color: #000; }.div5 {} The problem ...
IE7 won't allow you to apply:hover pseudo-classes to non-anchor elements unless you explicitly specify a doctype. Just add a doctype declaration to your page and it should work perfectly. More on IE7/quirks mode can be found on this blog post.
Pseudo class :hover does not work in IE7 I've got such a simple code: Foo Bar and this CSS:.div1{ position: relative; }.div1.div3 { position: absolute; top: 30px; left: 0px; width: 250px; display: none; }.div1:hover.div3 { display: block; }.div2{ width: 200px; height: 30px; background: red; }.div4 { background-color: g...
TITLE: Pseudo class :hover does not work in IE7 QUESTION: I've got such a simple code: Foo Bar and this CSS:.div1{ position: relative; }.div1.div3 { position: absolute; top: 30px; left: 0px; width: 250px; display: none; }.div1:hover.div3 { display: block; }.div2{ width: 200px; height: 30px; background: red; }.div4 { b...
[ "html", "css", "internet-explorer-7" ]
11
25
19,317
3
0
2008-09-27T09:23:08.417000
2008-09-27T22:26:02.607000
143,341
143,689
Are there any frameworks for handling database requests in swing applications?
I believe any programmer who has been dealing with database requests in a gui application has run into some or all of the following problems: Your GUI freezes because you call database layer from within the event dispatch thread When you have multiple windows/panels/jframes where user can start a db request your perfor...
Such a thing should be found in Netbeans for example. See RequestProcessor. But in simpler cases this is not required. Last time I need something like thread scheduling and control I simply used new concurrency packages included in J5 (I used J6). With its ExecutorFactory-ies you can simply achieve basic control over t...
Are there any frameworks for handling database requests in swing applications? I believe any programmer who has been dealing with database requests in a gui application has run into some or all of the following problems: Your GUI freezes because you call database layer from within the event dispatch thread When you hav...
TITLE: Are there any frameworks for handling database requests in swing applications? QUESTION: I believe any programmer who has been dealing with database requests in a gui application has run into some or all of the following problems: Your GUI freezes because you call database layer from within the event dispatch t...
[ "java", "database", "multithreading", "swing" ]
4
1
649
3
0
2008-09-27T09:53:01.857000
2008-09-27T14:07:57.890000
143,367
143,368
Recommended HTML formatter script/utility?
Simple question - I've got a bucketload of cruddy html pages to clean up and I'm looking for a open source or freeware script/utility to remove any junk and reformat them into nicely laid out consistent code. Any recommendations? If it's relevant I generally manipulate HTML inside Dreamweaver - but by editing the code ...
I don't think it plugs into Dreamweaver but whenever i need html cleaned up HTML Tidy is my go to guy
Recommended HTML formatter script/utility? Simple question - I've got a bucketload of cruddy html pages to clean up and I'm looking for a open source or freeware script/utility to remove any junk and reformat them into nicely laid out consistent code. Any recommendations? If it's relevant I generally manipulate HTML in...
TITLE: Recommended HTML formatter script/utility? QUESTION: Simple question - I've got a bucketload of cruddy html pages to clean up and I'm looking for a open source or freeware script/utility to remove any junk and reformat them into nicely laid out consistent code. Any recommendations? If it's relevant I generally ...
[ "html", "formatting", "dreamweaver" ]
4
21
10,058
11
0
2008-09-27T10:22:26.950000
2008-09-27T10:25:42.370000
143,374
143,383
CALL -151 What did it do on the APPLE ][
A long time ago I had an apple ][. I remember the command call – 151 But I can not remember what it did?
CALL -151 Enter the machine code monitor - http://www.skepticfiles.org/cowtext/apple/memorytx.htm Update: That link appears to be dead, here's a Wayback Machine alternative: http://web.archive.org/web/20090315100335/http://www.skepticfiles.org/cowtext/apple/memorytx.htm Here's the full article just in case Wayback goes...
CALL -151 What did it do on the APPLE ][ A long time ago I had an apple ][. I remember the command call – 151 But I can not remember what it did?
TITLE: CALL -151 What did it do on the APPLE ][ QUESTION: A long time ago I had an apple ][. I remember the command call – 151 But I can not remember what it did? ANSWER: CALL -151 Enter the machine code monitor - http://www.skepticfiles.org/cowtext/apple/memorytx.htm Update: That link appears to be dead, here's a Wa...
[ "command-line", "call", "8-bit", "apple-ii" ]
26
26
13,854
5
0
2008-09-27T10:31:01.907000
2008-09-27T10:37:13.857000
143,386
143,398
Servlet constructor and init() method
Why do we need an init() method in servlet? Can't we use the constructor to initialization?
Because Servlet is an interface, not an abstract class. Constructor arguments cannot be specified on an interface, so the ServletContext needs to be specified on a normal method signature. This allows the application server to know how to initialize any Servlet implementation properly. Another solution would have been ...
Servlet constructor and init() method Why do we need an init() method in servlet? Can't we use the constructor to initialization?
TITLE: Servlet constructor and init() method QUESTION: Why do we need an init() method in servlet? Can't we use the constructor to initialization? ANSWER: Because Servlet is an interface, not an abstract class. Constructor arguments cannot be specified on an interface, so the ServletContext needs to be specified on a...
[ "servlets", "init" ]
8
19
4,281
1
0
2008-09-27T10:39:02.043000
2008-09-27T10:53:22.133000
143,405
143,423
C# Interfaces. Implicit implementation versus Explicit implementation
What are the differences in implementing interfaces implicitly and explicitly in C#? When should you use implicit and when should you use explicit? Are there any pros and/or cons to one or the other? Microsoft's official guidelines (from first edition Framework Design Guidelines ) states that using explicit implementat...
Implicit is when you define your interface via a member on your class. Explicit is when you define methods within your class on the interface. I know that sounds confusing but here is what I mean: IList.CopyTo would be implicitly implemented as: public void CopyTo(Array array, int index) { throw new NotImplementedExcep...
C# Interfaces. Implicit implementation versus Explicit implementation What are the differences in implementing interfaces implicitly and explicitly in C#? When should you use implicit and when should you use explicit? Are there any pros and/or cons to one or the other? Microsoft's official guidelines (from first editio...
TITLE: C# Interfaces. Implicit implementation versus Explicit implementation QUESTION: What are the differences in implementing interfaces implicitly and explicitly in C#? When should you use implicit and when should you use explicit? Are there any pros and/or cons to one or the other? Microsoft's official guidelines ...
[ "c#", ".net", "interface" ]
683
525
170,472
13
0
2008-09-27T10:56:16.430000
2008-09-27T11:07:40.117000
143,420
149,417
How can I modify a saved Microsoft Access 2007 or 2010 Import Specification?
Does anyone know how to modify an existing import specification in Microsoft Access 2007 or 2010? In older versions there used to be an Advanced button presented during the import wizard that allowed you to select and edit an existing specification. I no longer see this feature but hope that it still exists and has jus...
I am able to use this feature on my machine using MS Access 2007. On the Ribbon, select External Data Select the "Text File" option This displays the Get External Data Wizard Specify the location of the file you wish to import Click OK. This displays the "Import Text Wizard" On the bottom of this dialog screen is the A...
How can I modify a saved Microsoft Access 2007 or 2010 Import Specification? Does anyone know how to modify an existing import specification in Microsoft Access 2007 or 2010? In older versions there used to be an Advanced button presented during the import wizard that allowed you to select and edit an existing specific...
TITLE: How can I modify a saved Microsoft Access 2007 or 2010 Import Specification? QUESTION: Does anyone know how to modify an existing import specification in Microsoft Access 2007 or 2010? In older versions there used to be an Advanced button presented during the import wizard that allowed you to select and edit an...
[ "ms-access" ]
45
47
179,935
10
0
2008-09-27T11:03:01.687000
2008-09-29T16:14:19.427000
143,429
143,439
What's the least useful comment you've ever seen?
We all know that commenting our code is an important part of coding style for making our code understandable to the next person who comes along, or even ourselves in 6 months or so. However, sometimes a comment just doesn't cut the mustard. I'm not talking about obvious jokes or vented frustraton, I'm talking about com...
Just the typical Comp Sci 101 type comments: $i = 0; //set i to 0 $i++; //use sneaky trick to add 1 to i! if ($i==$j) { // I made sure to use == rather than = here to avoid a bug That sort of thing.
What's the least useful comment you've ever seen? We all know that commenting our code is an important part of coding style for making our code understandable to the next person who comes along, or even ourselves in 6 months or so. However, sometimes a comment just doesn't cut the mustard. I'm not talking about obvious...
TITLE: What's the least useful comment you've ever seen? QUESTION: We all know that commenting our code is an important part of coding style for making our code understandable to the next person who comes along, or even ourselves in 6 months or so. However, sometimes a comment just doesn't cut the mustard. I'm not tal...
[ "coding-style", "comments" ]
20
112
30,391
101
0
2008-09-27T11:11:00.077000
2008-09-27T11:15:52.360000
143,485
143,567
implicit operator using interfaces
I have a generic class that I'm trying to implement implicit type casting for. While it mostly works, it won't work for interface casting. Upon further investigation, I found that there is a compiler error: "User-defined conversion from interface" that applies. While I understand that this should be enforced in some ca...
The reason you can't do this is because it is specifically forbidden in the C# language specification: Source: ECMA-334 Section 15.10.4 A class or struct is permitted to declare a conversion from a source type S to a target type T provided all of the following are true:... Neither S nor T is object or an interface-type...
implicit operator using interfaces I have a generic class that I'm trying to implement implicit type casting for. While it mostly works, it won't work for interface casting. Upon further investigation, I found that there is a compiler error: "User-defined conversion from interface" that applies. While I understand that...
TITLE: implicit operator using interfaces QUESTION: I have a generic class that I'm trying to implement implicit type casting for. While it mostly works, it won't work for interface casting. Upon further investigation, I found that there is a compiler error: "User-defined conversion from interface" that applies. While...
[ "c#", "generics", "compiler-construction", "casting", "implicit-conversion" ]
68
75
35,132
1
0
2008-09-27T12:02:16.647000
2008-09-27T12:37:48.963000
143,486
143,527
Unobtrusive JavaScript: <script> at the top or the bottom of the HTML code?
I've recently read the Yahoo manifesto Best Practices for Speeding Up Your Web Site. They recommend to put the JavaScript inclusion at the bottom of the HTML code when we can. But where exactly and when? Should we put it before closing or after? And above all, when should we still put it in the section?
There are two possibilities for truly unobtrusive scripts: including an external script file via a script tag in the head section including an external script file via a script tag at the bottom of the body (before ) The second one can be faster as the original Yahoo research showed some browsers try to load script fil...
Unobtrusive JavaScript: <script> at the top or the bottom of the HTML code? I've recently read the Yahoo manifesto Best Practices for Speeding Up Your Web Site. They recommend to put the JavaScript inclusion at the bottom of the HTML code when we can. But where exactly and when? Should we put it before closing or after...
TITLE: Unobtrusive JavaScript: <script> at the top or the bottom of the HTML code? QUESTION: I've recently read the Yahoo manifesto Best Practices for Speeding Up Your Web Site. They recommend to put the JavaScript inclusion at the bottom of the HTML code when we can. But where exactly and when? Should we put it befor...
[ "javascript", "performance", "optimization", "coding-style" ]
93
89
65,286
7
0
2008-09-27T12:02:28.037000
2008-09-27T12:17:27.827000
143,515
143,996
OCSP libraries for python / java / c?
Going back to my previous question on OCSP, does anybody know of "reliable" OCSP libraries for Python, Java and C? I need "client" OCSP functionality, as I'll be checking the status of Certs against an OCSP responder, so responder functionality is not that important. Thanks
Have you check pyOpenSSL.. am sure openssl supports ocsp and python binding may support it
OCSP libraries for python / java / c? Going back to my previous question on OCSP, does anybody know of "reliable" OCSP libraries for Python, Java and C? I need "client" OCSP functionality, as I'll be checking the status of Certs against an OCSP responder, so responder functionality is not that important. Thanks
TITLE: OCSP libraries for python / java / c? QUESTION: Going back to my previous question on OCSP, does anybody know of "reliable" OCSP libraries for Python, Java and C? I need "client" OCSP functionality, as I'll be checking the status of Certs against an OCSP responder, so responder functionality is not that importa...
[ "java", "python", "c", "ocsp" ]
5
1
3,159
3
0
2008-09-27T12:12:32.690000
2008-09-27T16:57:12.600000
143,523
143,544
x509 certificate parsing libraries for Java
Any recommended crypto libraries for Java. What I need is the ability to parse X.509 Certificates to extract the information contained in them. Thanks
In Java, java.security.cert.CertificateFactory. "A certificate factory for X.509 must return certificates that are an instance of java.security.cert.X509Certificate"
x509 certificate parsing libraries for Java Any recommended crypto libraries for Java. What I need is the ability to parse X.509 Certificates to extract the information contained in them. Thanks
TITLE: x509 certificate parsing libraries for Java QUESTION: Any recommended crypto libraries for Java. What I need is the ability to parse X.509 Certificates to extract the information contained in them. Thanks ANSWER: In Java, java.security.cert.CertificateFactory. "A certificate factory for X.509 must return certi...
[ "java", "certificate", "x509" ]
4
8
9,234
4
0
2008-09-27T12:16:00.653000
2008-09-27T12:26:28.353000
143,530
143,569
linker woes - undefined reference
I'm having a problem with my compiler telling me there is an 'undefined reference to' a function I want to use in a library. Let me share some info on the problem: I'm cross compiling with gcc for C. I am calling a library function which is accessed through an included header which includes another header, which contai...
It sounds like you are not compiling the.c file in the library to produce a.o file. The linker would look for the prototype's implementation in the.o file produced by compiling the library Does your build process compile the library.c file? Why do you call it a "library" if it's actually just source code?
linker woes - undefined reference I'm having a problem with my compiler telling me there is an 'undefined reference to' a function I want to use in a library. Let me share some info on the problem: I'm cross compiling with gcc for C. I am calling a library function which is accessed through an included header which inc...
TITLE: linker woes - undefined reference QUESTION: I'm having a problem with my compiler telling me there is an 'undefined reference to' a function I want to use in a library. Let me share some info on the problem: I'm cross compiling with gcc for C. I am calling a library function which is accessed through an include...
[ "gcc", "linker" ]
9
5
34,477
6
0
2008-09-27T12:18:49.400000
2008-09-27T12:38:57.777000
143,552
143,568
Comparing date ranges
In MySQL, If I have a list of date ranges (range-start and range-end). e.g. 10/06/1983 to 14/06/1983 15/07/1983 to 16/07/1983 18/07/1983 to 18/07/1983 And I want to check if another date range contains ANY of the ranges already in the list, how would I do that? e.g. 06/06/1983 to 18/06/1983 = IN LIST 10/06/1983 to 11/0...
This is a classical problem, and it's actually easier if you reverse the logic. Let me give you an example. I'll post one period of time here, and all the different variations of other periods that overlap in some way. |-------------------| compare to this one |---------| contained within |----------| contained within,...
Comparing date ranges In MySQL, If I have a list of date ranges (range-start and range-end). e.g. 10/06/1983 to 14/06/1983 15/07/1983 to 16/07/1983 18/07/1983 to 18/07/1983 And I want to check if another date range contains ANY of the ranges already in the list, how would I do that? e.g. 06/06/1983 to 18/06/1983 = IN L...
TITLE: Comparing date ranges QUESTION: In MySQL, If I have a list of date ranges (range-start and range-end). e.g. 10/06/1983 to 14/06/1983 15/07/1983 to 16/07/1983 18/07/1983 to 18/07/1983 And I want to check if another date range contains ANY of the ranges already in the list, how would I do that? e.g. 06/06/1983 to...
[ "sql", "mysql", "date" ]
128
482
67,246
10
0
2008-09-27T12:29:18.813000
2008-09-27T12:38:15.530000
143,554
143,605
firefox not opening - cron, ruby, firewatir
I have written a ruby script which opens up dlink admin page in firefox and does a ADSL connection or disconnection. I could run this script in the terminal without any problem. But if I put it as cron job, it doesn't fire up firefox. This is the entry I have in crontab # connect to dataone 55 17 * * * ruby /home/ragua...
You need to have a DISPLAY environment pointing at a valid X-server. This could either involve setting it to the value ":0.0" (without quotes), such that it refers to your local standard DISPLAY. There's a few things to keep in mind though: You could run an X virtual frame buffer (xvfb), so that Firefox simply uses tha...
firefox not opening - cron, ruby, firewatir I have written a ruby script which opens up dlink admin page in firefox and does a ADSL connection or disconnection. I could run this script in the terminal without any problem. But if I put it as cron job, it doesn't fire up firefox. This is the entry I have in crontab # con...
TITLE: firefox not opening - cron, ruby, firewatir QUESTION: I have written a ruby script which opens up dlink admin page in firefox and does a ADSL connection or disconnection. I could run this script in the terminal without any problem. But if I put it as cron job, it doesn't fire up firefox. This is the entry I hav...
[ "ruby", "firefox", "automation", "cron", "firewatir" ]
2
3
2,198
3
0
2008-09-27T12:30:47.703000
2008-09-27T12:58:09.947000
143,566
143,577
Software Synth Library for Java
I've been thinking a lot lately about a music-oriented project I'd like to work on. Kind of like a game... kind of like a studio workstation (FL Studio, Reason). I guess the best way to describe it would be: like "Guitar Hero", but with no canned tracks. All original music--composed by you, on the fly--but the software...
Have you checked out JFugue? It's an "open-source Java API for programming music without the complexities of MIDI". Additional information: Found a couple of other resources referenced in the JFugue documentation (pdf): Audio Synthesis Engine Project: open source version of Java’s MIDI synthesizer Gervill: open source ...
Software Synth Library for Java I've been thinking a lot lately about a music-oriented project I'd like to work on. Kind of like a game... kind of like a studio workstation (FL Studio, Reason). I guess the best way to describe it would be: like "Guitar Hero", but with no canned tracks. All original music--composed by y...
TITLE: Software Synth Library for Java QUESTION: I've been thinking a lot lately about a music-oriented project I'd like to work on. Kind of like a game... kind of like a studio workstation (FL Studio, Reason). I guess the best way to describe it would be: like "Guitar Hero", but with no canned tracks. All original mu...
[ "java", "audio" ]
13
7
5,674
4
0
2008-09-27T12:37:41.320000
2008-09-27T12:41:41.403000
143,571
143,576
Including Partials, ASP.NET MVC
I'm building my first ASP.NET MVC application and I am having some troubles with Partial Views. If I, as an example, want to put a "Footer" as a Partial I create an "MVC View User Control" in "/Views/Shared/Footer.ascx". (I leave it empty for now) What is the correct way for adding it to my Layout? I have tried: <%=Htm...
In this case don't use the <%= syntax. Just use the <% %> syntax. Then the first form in your examples should work. For more info, check here: http://bradwilson.typepad.com/blog/2008/08/partial-renderi.html
Including Partials, ASP.NET MVC I'm building my first ASP.NET MVC application and I am having some troubles with Partial Views. If I, as an example, want to put a "Footer" as a Partial I create an "MVC View User Control" in "/Views/Shared/Footer.ascx". (I leave it empty for now) What is the correct way for adding it to...
TITLE: Including Partials, ASP.NET MVC QUESTION: I'm building my first ASP.NET MVC application and I am having some troubles with Partial Views. If I, as an example, want to put a "Footer" as a Partial I create an "MVC View User Control" in "/Views/Shared/Footer.ascx". (I leave it empty for now) What is the correct wa...
[ "asp.net-mvc" ]
11
23
3,286
2
0
2008-09-27T12:39:05.077000
2008-09-27T12:41:21.280000
143,623
143,688
Binsor and log4net
I'm using Castle Windsor and Binsor to use dependency injection in my application. I'm no expert at either one. Usually I can figure out how to bend Windsor to my will, but I find Binsor much harder, especially since I haven't found any decent documentation for it. I'm trying to create a binsor configuration file where...
Aynede@Rahien is your friend here. He has many blog posts on using and configuring Binsor. For the special logger, you need to add it as a component and then explicitly set the logger property of the dependent component to the id of the special logger component.
Binsor and log4net I'm using Castle Windsor and Binsor to use dependency injection in my application. I'm no expert at either one. Usually I can figure out how to bend Windsor to my will, but I find Binsor much harder, especially since I haven't found any decent documentation for it. I'm trying to create a binsor confi...
TITLE: Binsor and log4net QUESTION: I'm using Castle Windsor and Binsor to use dependency injection in my application. I'm no expert at either one. Usually I can figure out how to bend Windsor to my will, but I find Binsor much harder, especially since I haven't found any decent documentation for it. I'm trying to cre...
[ "log4net", "castle-windsor", "binsor" ]
1
1
476
1
0
2008-09-27T13:11:03.127000
2008-09-27T14:07:35.707000
143,632
144,087
Crypto/X509 certificate parsing libraries for Python
Any recommended crypto libraries for Python. I know I've asked something similar in x509 certificate parsing libraries for Java, but I should've split the question in two. What I need is the ability to parse X.509 Certificates to extract the information contained in them. Looking around, I've found two options: Python ...
You might want to try keyczar as mentioned by me in your other post, since that library actually has implementations for both python and java. That would make it easier to use it in both contexts. A word of warning: I have not actually used this library 8(, so please take this with a grain of salt.
Crypto/X509 certificate parsing libraries for Python Any recommended crypto libraries for Python. I know I've asked something similar in x509 certificate parsing libraries for Java, but I should've split the question in two. What I need is the ability to parse X.509 Certificates to extract the information contained in ...
TITLE: Crypto/X509 certificate parsing libraries for Python QUESTION: Any recommended crypto libraries for Python. I know I've asked something similar in x509 certificate parsing libraries for Java, but I should've split the question in two. What I need is the ability to parse X.509 Certificates to extract the informa...
[ "python", "cryptography", "openssl", "x509" ]
6
3
10,107
4
0
2008-09-27T13:15:33.337000
2008-09-27T17:28:36.143000
143,633
143,662
Window styles / Minimal titlebar/borders
I'm looking for some kind of a resource (website) that would list all possible window/dialog frame styles and their respective combinations with images. I'm only really interested in Vista, as my software won't support older platforms anyway. I have a more specific case here too: I'm wondering if there are other ways t...
If it's Vista-only, you can try to use your own window decoration and use the Desktop Window Manager (DWM) API to still provide Aero Glass Theming. On the other hand, if you're targeting Vista and later, you'll most likely not have to deal with low resolutions. Don't think too much about a few pixels more or less.
Window styles / Minimal titlebar/borders I'm looking for some kind of a resource (website) that would list all possible window/dialog frame styles and their respective combinations with images. I'm only really interested in Vista, as my software won't support older platforms anyway. I have a more specific case here too...
TITLE: Window styles / Minimal titlebar/borders QUESTION: I'm looking for some kind of a resource (website) that would list all possible window/dialog frame styles and their respective combinations with images. I'm only really interested in Vista, as my software won't support older platforms anyway. I have a more spec...
[ "windows", "winapi", "coding-style", "window-style" ]
0
1
710
1
0
2008-09-27T13:15:35.770000
2008-09-27T13:41:26.707000
143,680
144,216
What's the best system for installing a Perl web app?
It seems that most of the installers for Perl are centered around installing Perl modules, not applications. Things like ExtUtils::MakeMaker and Module::Build are very well suited for modules, but require some additional work for Web Apps. Ideally it would be nice to be able to do the following after checking out the s...
What are your limitations for installing web apps? Can you log into the machine? Are all of the machines running the same thing? Are the people installing the web apps co-workers or random people from the general public? Are the people installing this sysadmins, programmers, web managers, or something else? Do you inst...
What's the best system for installing a Perl web app? It seems that most of the installers for Perl are centered around installing Perl modules, not applications. Things like ExtUtils::MakeMaker and Module::Build are very well suited for modules, but require some additional work for Web Apps. Ideally it would be nice t...
TITLE: What's the best system for installing a Perl web app? QUESTION: It seems that most of the installers for Perl are centered around installing Perl modules, not applications. Things like ExtUtils::MakeMaker and Module::Build are very well suited for modules, but require some additional work for Web Apps. Ideally ...
[ "perl", "web-applications", "installation" ]
11
6
615
4
0
2008-09-27T13:59:26.817000
2008-09-27T18:46:55.847000
143,681
143,685
What is the best method to gather data about the use of your application?
My company releases a small software product for which I've recently been taking over the development side. It is a C# Windows Forms application. One of the things I've noticed is that much of the information about how the software is used is filtered through my superiors and I get the feeling that I'm missing importan...
I would suggest you get your application to write its "usage information" somewhere and then, with the users permission, transmit it electronically every so often. Note the emphasis above. Depending on your jurisdiction, you could get into serious trouble transmitting any sort of data from someone else's computer witho...
What is the best method to gather data about the use of your application? My company releases a small software product for which I've recently been taking over the development side. It is a C# Windows Forms application. One of the things I've noticed is that much of the information about how the software is used is fil...
TITLE: What is the best method to gather data about the use of your application? QUESTION: My company releases a small software product for which I've recently been taking over the development side. It is a C# Windows Forms application. One of the things I've noticed is that much of the information about how the softw...
[ ".net", "winforms", "user-interface", "measurement" ]
5
3
1,340
5
0
2008-09-27T14:00:30.980000
2008-09-27T14:06:12.980000
143,692
143,700
What is the performance hit of using TLS with apache?
How much of a performance hit will running everything over TLS do to my server? I would assume this is completely ignorable in this day and age? I heard once that servers today could encrypt gigabytes of data per second, is that true? And if so, is it linearly scalable so that if top speed is 10GB/second, encrypting 1G...
Performance Analysis of TLS Web Servers (pdf), a paper written at Rice University, covered this topic back in 2002, and they came to this conclusion: Apache TLS without the AXL300 served between 149 hits/sec and 259 hits/sec for the CS trace, and between 147 hits/sec and 261 hits/sec for the Amazon trace. This confirms...
What is the performance hit of using TLS with apache? How much of a performance hit will running everything over TLS do to my server? I would assume this is completely ignorable in this day and age? I heard once that servers today could encrypt gigabytes of data per second, is that true? And if so, is it linearly scala...
TITLE: What is the performance hit of using TLS with apache? QUESTION: How much of a performance hit will running everything over TLS do to my server? I would assume this is completely ignorable in this day and age? I heard once that servers today could encrypt gigabytes of data per second, is that true? And if so, is...
[ "performance", "apache", "encryption", "ssl" ]
3
3
710
1
0
2008-09-27T14:17:20.130000
2008-09-27T14:27:11.727000
143,708
143,767
Is it possible that F# will be optimized more than other .Net languages in the future?
Is it possible that Microsoft will be able to make F# programs, either at VM execution time, or more likely at compile time, detect that a program was built with a functional language and automatically parallelize it better? Right now I believe there is no such effort to try and execute a program that was built as sing...
I think this is unlikely in the near future. And if it does happen, I think it would be more likely at the IL level (assembly rewriting) rather than language level (e.g. something specific to F#/compiler). It's an interesting question, and I expect that some fine minds have been looking at this and will continue to loo...
Is it possible that F# will be optimized more than other .Net languages in the future? Is it possible that Microsoft will be able to make F# programs, either at VM execution time, or more likely at compile time, detect that a program was built with a functional language and automatically parallelize it better? Right no...
TITLE: Is it possible that F# will be optimized more than other .Net languages in the future? QUESTION: Is it possible that Microsoft will be able to make F# programs, either at VM execution time, or more likely at compile time, detect that a program was built with a functional language and automatically parallelize i...
[ "f#", "functional-programming", "parallel-processing", "vectorization" ]
14
13
5,911
7
0
2008-09-27T14:33:39.467000
2008-09-27T15:05:00.997000
143,714
143,719
Is there any difference between "string" and 'string' in Python?
In PHP, a string enclosed in "double quotes" will be parsed for variables to replace whereas a string enclosed in 'single quotes' will not. In Python, does this also apply?
No: 2.4.1. String and Bytes literals...In plain English: Both types of literals can be enclosed in matching single quotes ( ' ) or double quotes ( " ). They can also be enclosed in matching groups of three single or double quotes (these are generally referred to as triple-quoted strings). The backslash ( \ ) character ...
Is there any difference between "string" and 'string' in Python? In PHP, a string enclosed in "double quotes" will be parsed for variables to replace whereas a string enclosed in 'single quotes' will not. In Python, does this also apply?
TITLE: Is there any difference between "string" and 'string' in Python? QUESTION: In PHP, a string enclosed in "double quotes" will be parsed for variables to replace whereas a string enclosed in 'single quotes' will not. In Python, does this also apply? ANSWER: No: 2.4.1. String and Bytes literals...In plain English...
[ "python", "string", "quotes", "double-quotes" ]
76
123
75,719
9
0
2008-09-27T14:39:01.980000
2008-09-27T14:41:59.103000
143,736
143,766
How do I access a MessageBox with white?
I have a simple message box in a WPF application that is launched as below: private void Button_Click(object sender, RoutedEventArgs e) { MessageBox.Show("Howdy", "Howdy"); } I can get white to click my button and launch the message box. UISpy shows it as a child of my window I couldn't work out the method to access it...
Found it! The window class has a MessageBox method that does the trick: var app = Application.Launch(@"c:\ApplicationPath.exe"); var window = app.GetWindow("Window1"); var helloButton = window.Get ("Hello"); Assert.IsNotNull(helloButton); helloButton.Click(); var messageBox = window.MessageBox("Howdy"); Assert.IsNotNul...
How do I access a MessageBox with white? I have a simple message box in a WPF application that is launched as below: private void Button_Click(object sender, RoutedEventArgs e) { MessageBox.Show("Howdy", "Howdy"); } I can get white to click my button and launch the message box. UISpy shows it as a child of my window I ...
TITLE: How do I access a MessageBox with white? QUESTION: I have a simple message box in a WPF application that is launched as below: private void Button_Click(object sender, RoutedEventArgs e) { MessageBox.Show("Howdy", "Howdy"); } I can get white to click my button and launch the message box. UISpy shows it as a chi...
[ "wpf", "testing", "integration-testing", "white-framework" ]
4
3
5,048
4
0
2008-09-27T14:48:51.973000
2008-09-27T15:04:37.833000
143,739
143,810
Font graphics routines
How do you do your own fonts? I don't want a heavyweight algorithm (freetype, truetype, adobe, etc) and would be fine with pre-rendered bitmap fonts. I do want anti-aliasing, and would like proportional fonts if possible. I've heard I can use Gimp to do the rendering (with some post processing?) I'm developing for an e...
In my old demo-scene days I often drew all characters in the font in one big bitmap image. In the code, I stored the (X,Y) coordinates of each character in the font, as well as the width of each character. The height was usually constant throughout the font. If space isn't an issue, you can put all characters in a grid...
Font graphics routines How do you do your own fonts? I don't want a heavyweight algorithm (freetype, truetype, adobe, etc) and would be fine with pre-rendered bitmap fonts. I do want anti-aliasing, and would like proportional fonts if possible. I've heard I can use Gimp to do the rendering (with some post processing?) ...
TITLE: Font graphics routines QUESTION: How do you do your own fonts? I don't want a heavyweight algorithm (freetype, truetype, adobe, etc) and would be fine with pre-rendered bitmap fonts. I do want anti-aliasing, and would like proportional fonts if possible. I've heard I can use Gimp to do the rendering (with some ...
[ "c", "fonts", "embedded", "rendering" ]
1
4
1,944
4
0
2008-09-27T14:50:44.620000
2008-09-27T15:25:54.880000
143,745
143,796
Refactoring "include file hell"
One thing that's really been making life difficult in getting up to speed on the codebase on an ASP classic project is that the include file situation is kind of a mess. I sometimes find the function I was looking for being included in an include file that is totally unrelated. Does anyone have any advice on how to ref...
There are a few basic things you can do when taking over a classic ASP application, but you will probably end up regretting doing them. Eliminate duplicate include files. Every classic ASP app I've ever seen has had 5 "login.asp" pages and 7 "datepicker.js" files and so forth. Hunt down and remove all the duplicates, a...
Refactoring "include file hell" One thing that's really been making life difficult in getting up to speed on the codebase on an ASP classic project is that the include file situation is kind of a mess. I sometimes find the function I was looking for being included in an include file that is totally unrelated. Does anyo...
TITLE: Refactoring "include file hell" QUESTION: One thing that's really been making life difficult in getting up to speed on the codebase on an ASP classic project is that the include file situation is kind of a mess. I sometimes find the function I was looking for being included in an include file that is totally un...
[ "asp-classic", "vbscript", "refactoring" ]
5
14
4,616
6
0
2008-09-27T14:53:47.297000
2008-09-27T15:19:59.340000
143,750
146,798
MySQL and data file encryption
Is there a way to encrypt the data file that mysql uses? I have a mysql server on an open machine, and I would like to encrypt the data file so even if someone copies the data files, they cannot read the data. Thanks
I am not sure what do you mean when you say that your machine is open. If people have access to the console, or to your account it is much harder of a task to encrypt the file. Did you look at Truecrypt? It works for most popular operating systems and allows to create a virtual encrypted partition, lock down a hard dri...
MySQL and data file encryption Is there a way to encrypt the data file that mysql uses? I have a mysql server on an open machine, and I would like to encrypt the data file so even if someone copies the data files, they cannot read the data. Thanks
TITLE: MySQL and data file encryption QUESTION: Is there a way to encrypt the data file that mysql uses? I have a mysql server on an open machine, and I would like to encrypt the data file so even if someone copies the data files, they cannot read the data. Thanks ANSWER: I am not sure what do you mean when you say t...
[ "mysql", "encryption" ]
15
5
27,189
6
0
2008-09-27T14:55:55.903000
2008-09-28T21:36:57.177000
143,788
143,806
when to pass function arguments by reference and when by address?
Could anyone explain with some examples when it is better to call functions by reference and when it is better to call by address?
Pass your arguments to function using reference whenever possible. Passing arguments by reference eliminate the chance of them being NULL. If you want it to be possible to pass NULL value to a function then use pointer.
when to pass function arguments by reference and when by address? Could anyone explain with some examples when it is better to call functions by reference and when it is better to call by address?
TITLE: when to pass function arguments by reference and when by address? QUESTION: Could anyone explain with some examples when it is better to call functions by reference and when it is better to call by address? ANSWER: Pass your arguments to function using reference whenever possible. Passing arguments by referenc...
[ "c++", "pointers", "function", "reference" ]
3
2
747
3
0
2008-09-27T15:16:06.573000
2008-09-27T15:24:02.387000
143,792
144,027
Where to find beautiful PHP code to read?
As a way to find inspiration and improve my PHP skills, I am looking for some beautiful PHP source code to read, preferably an open source "standard" web site rather than a more tool-like project such as phpMyAdmin. So, where can I find some beautiful PHP code?
CodeIgniter code is beautiful. There are many projects written in CodeIgniter which are publically available and you can check out the source code. Have a look at the Getting started page of CodeIgniter's tutorial and read through. I can gaurantee you'll be inspired and want to fire up your IDE and get coding straight ...
Where to find beautiful PHP code to read? As a way to find inspiration and improve my PHP skills, I am looking for some beautiful PHP source code to read, preferably an open source "standard" web site rather than a more tool-like project such as phpMyAdmin. So, where can I find some beautiful PHP code?
TITLE: Where to find beautiful PHP code to read? QUESTION: As a way to find inspiration and improve my PHP skills, I am looking for some beautiful PHP source code to read, preferably an open source "standard" web site rather than a more tool-like project such as phpMyAdmin. So, where can I find some beautiful PHP code...
[ "php" ]
16
9
6,811
10
0
2008-09-27T15:18:55.863000
2008-09-27T17:14:08.083000
143,793
145,194
How do you Serialize ScriptObjects to JSON to save in Silverlight Isolated Storage?
According to this article Silverlight 2 Beta 2 supports the DataContractJsonSerializer object. But, when I try to use it VS says "Type 'DataContractJsonSerializer' is not defined". I have a method marked as ScriptableMember that gets called from JavaScript and is passed an Object. Inside this method I need to serialize...
Actually the answer is, the DataContractJsonSerializer is part of Silverlight 2 Beta 2, but you need to add a reference to System.ServiceModel.Web to your Silverlight project to use it. I didn't realize that you still needed to add dll references in Silverlight. I thought it automatically included everything in a simil...
How do you Serialize ScriptObjects to JSON to save in Silverlight Isolated Storage? According to this article Silverlight 2 Beta 2 supports the DataContractJsonSerializer object. But, when I try to use it VS says "Type 'DataContractJsonSerializer' is not defined". I have a method marked as ScriptableMember that gets ca...
TITLE: How do you Serialize ScriptObjects to JSON to save in Silverlight Isolated Storage? QUESTION: According to this article Silverlight 2 Beta 2 supports the DataContractJsonSerializer object. But, when I try to use it VS says "Type 'DataContractJsonSerializer' is not defined". I have a method marked as ScriptableM...
[ "javascript", "silverlight", "json", "isolatedstorage" ]
0
3
1,564
4
0
2008-09-27T15:18:58.687000
2008-09-28T04:09:48.553000
143,808
145,386
How to improve link performance for a large C++ application in VS2005
We have fairly large C++ application which is composed of about 60 projects in Visual Studio 2005. It currently takes 7 minutes to link in Release mode and I would like to try to reduce the time. Are there any tips for improving the link time? Most of the projects compile to static libraries, this makes testing easier ...
If you're using the /GL flag to enable Whole Program Optimization (WPO) or the /LTCG flag to enable Link Time Code Generation, turning them off will improve link times significantly, at the expense of some optimizations. Also, if you're using the /Z7 flag to put debug symbols in the.obj files, your static libraries are...
How to improve link performance for a large C++ application in VS2005 We have fairly large C++ application which is composed of about 60 projects in Visual Studio 2005. It currently takes 7 minutes to link in Release mode and I would like to try to reduce the time. Are there any tips for improving the link time? Most o...
TITLE: How to improve link performance for a large C++ application in VS2005 QUESTION: We have fairly large C++ application which is composed of about 60 projects in Visual Studio 2005. It currently takes 7 minutes to link in Release mode and I would like to try to reduce the time. Are there any tips for improving the...
[ "c++", "visual-studio-2005" ]
25
19
13,607
15
0
2008-09-27T15:24:26.880000
2008-09-28T06:54:48.483000
143,815
143,889
Determine if an HTML element's content overflows
Can I use JavaScript to check (irrespective of scrollbars) if an HTML element has overflowed its content? For example, a long div with small, fixed size, the overflow property set to visible, and no scrollbars on the element.
Normally, you can compare the client[Height|Width] with scroll[Height|Width] in order to detect this... but the values will be the same when overflow is visible. So, a detection routine must account for this: // Determines if the passed element is overflowing its bounds, // either vertically or horizontally. // Will te...
Determine if an HTML element's content overflows Can I use JavaScript to check (irrespective of scrollbars) if an HTML element has overflowed its content? For example, a long div with small, fixed size, the overflow property set to visible, and no scrollbars on the element.
TITLE: Determine if an HTML element's content overflows QUESTION: Can I use JavaScript to check (irrespective of scrollbars) if an HTML element has overflowed its content? For example, a long div with small, fixed size, the overflow property set to visible, and no scrollbars on the element. ANSWER: Normally, you can ...
[ "javascript", "html", "css" ]
184
277
108,360
5
0
2008-09-27T15:29:46.070000
2008-09-27T15:55:03.500000
143,822
143,834
Ruby: character to ascii from a string
this wiki page gave a general idea of how to convert a single char to ascii http://en.wikibooks.org/wiki/Ruby_Programming/ASCII But say if I have a string and I wanted to get each character's ascii from it, what do i need to do? "string".each_byte do |c| $char = c.chr $ascii =?char puts $ascii end It doesn't work becau...
The c variable already contains the char code! "string".each_byte do |c| puts c end yields 115 116 114 105 110 103
Ruby: character to ascii from a string this wiki page gave a general idea of how to convert a single char to ascii http://en.wikibooks.org/wiki/Ruby_Programming/ASCII But say if I have a string and I wanted to get each character's ascii from it, what do i need to do? "string".each_byte do |c| $char = c.chr $ascii =?cha...
TITLE: Ruby: character to ascii from a string QUESTION: this wiki page gave a general idea of how to convert a single char to ascii http://en.wikibooks.org/wiki/Ruby_Programming/ASCII But say if I have a string and I wanted to get each character's ascii from it, what do i need to do? "string".each_byte do |c| $char = ...
[ "ruby", "ascii" ]
36
58
116,101
7
0
2008-09-27T15:34:01.053000
2008-09-27T15:37:24.587000
143,847
143,863
Best way to find if an item is in a JavaScript array?
What is the best way to find if an object is in an array? This is the best way I know: function include(arr, obj) { for (var i = 0; i < arr.length; i++) { if (arr[i] == obj) return true; } } console.log(include([1, 2, 3, 4], 3)); // true console.log(include([1, 2, 3, 4], 6)); // undefined
As of ECMAScript 2016 you can use includes() arr.includes(obj); If you want to support IE or other older browsers: function include(arr,obj) { return (arr.indexOf(obj)!= -1); } EDIT: This will not work on IE6, 7 or 8 though. The best workaround is to define it yourself if it's not present: Mozilla's (ECMA-262) version:...
Best way to find if an item is in a JavaScript array? What is the best way to find if an object is in an array? This is the best way I know: function include(arr, obj) { for (var i = 0; i < arr.length; i++) { if (arr[i] == obj) return true; } } console.log(include([1, 2, 3, 4], 3)); // true console.log(include(...
TITLE: Best way to find if an item is in a JavaScript array? QUESTION: What is the best way to find if an object is in an array? This is the best way I know: function include(arr, obj) { for (var i = 0; i < arr.length; i++) { if (arr[i] == obj) return true; } } console.log(include([1, 2, 3, 4], 3)); // true co...
[ "javascript", "arrays" ]
838
768
1,168,821
8
0
2008-09-27T15:41:12.783000
2008-09-27T15:45:32.117000
143,850
143,853
How does Multiple C++ Threads execute on a class method
let's say we have a c++ class like: class MyClass { void processArray( ) { int i; for (i=0;i<255;i++) { // do something with values in the array } } } and one instance of the class like: MyClass myInstance; and 2 threads which call the processArray method of that instance (depending on how system executes threads, prob...
i is allocated on the stack. Since each thread has its own separate stack, each thread gets its own copy of i.
How does Multiple C++ Threads execute on a class method let's say we have a c++ class like: class MyClass { void processArray( ) { int i; for (i=0;i<255;i++) { // do something with values in the array } } } and one instance of the class like: MyClass myInstance; and 2 threads which call the processArray method of that ...
TITLE: How does Multiple C++ Threads execute on a class method QUESTION: let's say we have a c++ class like: class MyClass { void processArray( ) { int i; for (i=0;i<255;i++) { // do something with values in the array } } } and one instance of the class like: MyClass myInstance; and 2 threads which call the processArr...
[ "c++", "multithreading" ]
2
15
2,928
4
0
2008-09-27T15:42:29.440000
2008-09-27T15:43:23.887000
143,855
144,186
Do you use code generation tools?
Do you use code-generation tools (aside from those used to generate proxies and from designers built-in to visual studio)? What part(s) of your application do you generate? Do you typically roll your own generator? If so, what type of generator do you write (asp templates, coddom etc.). If not, what 3rd party tools do ...
I'm in the philosophical camp that considers code generators to be "wrong", because they indicate something that should be made part of the language. But it's been a big part of the Pragmatic Programmer's ethic to write code that writes code, and in practice code generation works well if the generated code is hidden by...
Do you use code generation tools? Do you use code-generation tools (aside from those used to generate proxies and from designers built-in to visual studio)? What part(s) of your application do you generate? Do you typically roll your own generator? If so, what type of generator do you write (asp templates, coddom etc.)...
TITLE: Do you use code generation tools? QUESTION: Do you use code-generation tools (aside from those used to generate proxies and from designers built-in to visual studio)? What part(s) of your application do you generate? Do you typically roll your own generator? If so, what type of generator do you write (asp templ...
[ ".net", "visual-studio", "code-generation" ]
10
9
5,244
18
0
2008-09-27T15:43:36.647000
2008-09-27T18:21:58.917000
143,856
143,901
Is there a .NET library for universal audio file decoding?
Do you know of any.NET library which can decode several types of audio files? Ideally, it should be platform agnostic, so it can be used with.NET and Mono - on Windows and *NIX. I already tortured Google searching for a library which meets my needs, but unfortunately I could not find anything. So before writing a lot o...
There is the ffmpeg library and utilities that converts audio and video formats. Then, couple with the FFmpeg.NET library, you can do the encoding/decoding in.NET. All the formats you mentioned are supported.
Is there a .NET library for universal audio file decoding? Do you know of any.NET library which can decode several types of audio files? Ideally, it should be platform agnostic, so it can be used with.NET and Mono - on Windows and *NIX. I already tortured Google searching for a library which meets my needs, but unfortu...
TITLE: Is there a .NET library for universal audio file decoding? QUESTION: Do you know of any.NET library which can decode several types of audio files? Ideally, it should be platform agnostic, so it can be used with.NET and Mono - on Windows and *NIX. I already tortured Google searching for a library which meets my ...
[ ".net", "audio", "mono" ]
8
3
1,979
4
0
2008-09-27T15:43:40.687000
2008-09-27T16:00:29.087000
143,872
143,946
What is the fastest way to insert data into an Oracle table?
I am writing a data conversion in PL/SQL that processes data and loads it into a table. According to the PL/SQL Profiler, one of the slowest parts of the conversion is the actual insert into the target table. The table has a single index. To prepare the data for load, I populate a variable using the rowtype of the tabl...
It's much better to insert a few hundred rows at a time, using PL/SQL tables and FORALL to bind into insert statement. For details on this see here. Also be careful with how you construct the PL/SQL tables. If at all possible, prefer to instead do all your transforms directly in SQL using "INSERT INTO t1 SELECT..." as ...
What is the fastest way to insert data into an Oracle table? I am writing a data conversion in PL/SQL that processes data and loads it into a table. According to the PL/SQL Profiler, one of the slowest parts of the conversion is the actual insert into the target table. The table has a single index. To prepare the data ...
TITLE: What is the fastest way to insert data into an Oracle table? QUESTION: I am writing a data conversion in PL/SQL that processes data and loads it into a table. According to the PL/SQL Profiler, one of the slowest parts of the conversion is the actual insert into the target table. The table has a single index. To...
[ "oracle", "plsql" ]
12
16
70,187
8
0
2008-09-27T15:49:58.270000
2008-09-27T16:28:55.180000
143,898
144,105
Java EE and Grails: Communication with WebServices? Which framework?
Hy, I'm developing a Grails app which has to communicate with an existing Java EE application (built with EJB2). Both the "legacy" app and the new Grails app will offer services and consume them. For intercompatibility reasons, I'm thinking of communicating using WebServices. Now I'm wondering which frameworks I should...
If both the Grails and EJB applications live on the same LAN then there is nothing wrong with using RMI. Its the default way of talking to EJB's, is native to Java and is supported in Grails. If you need to use Web Services then your container will have built in support for exposing the EJB's as Web Services (assuming ...
Java EE and Grails: Communication with WebServices? Which framework? Hy, I'm developing a Grails app which has to communicate with an existing Java EE application (built with EJB2). Both the "legacy" app and the new Grails app will offer services and consume them. For intercompatibility reasons, I'm thinking of communi...
TITLE: Java EE and Grails: Communication with WebServices? Which framework? QUESTION: Hy, I'm developing a Grails app which has to communicate with an existing Java EE application (built with EJB2). Both the "legacy" app and the new Grails app will offer services and consume them. For intercompatibility reasons, I'm t...
[ "web-services", "grails", "jakarta-ee", "remoting", "ejb" ]
3
3
1,174
1
0
2008-09-27T15:59:05.533000
2008-09-27T17:35:46.283000
143,925
144,063
How do you run a single test/spec file in RSpec?
I want to be able to run a single spec file's tests — for the one file I'm editing, for example. rake spec executes all the specs. My project is not a Rails project, so rake spec:doc doesn't work. Don't know if this matters, but here is my directory structure../Rakefile./lib./lib/cushion.rb./lib/cushion./lib/cushion/do...
Or you can skip rake and use the 'rspec' command: bundle exec rspec path/to/spec/file.rb In your case I think as long as your./spec/db_spec.rb file includes the appropriate helpers, it should work fine. If you're using an older version of rspec it is: bundle exec spec path/to/spec/file.rb
How do you run a single test/spec file in RSpec? I want to be able to run a single spec file's tests — for the one file I'm editing, for example. rake spec executes all the specs. My project is not a Rails project, so rake spec:doc doesn't work. Don't know if this matters, but here is my directory structure../Rakefile....
TITLE: How do you run a single test/spec file in RSpec? QUESTION: I want to be able to run a single spec file's tests — for the one file I'm editing, for example. rake spec executes all the specs. My project is not a Rails project, so rake spec:doc doesn't work. Don't know if this matters, but here is my directory str...
[ "ruby", "testing", "rspec" ]
323
441
270,680
15
0
2008-09-27T16:11:52.647000
2008-09-27T17:20:10.347000
143,926
148,290
Wrap a SQL Reporting Matrix
I have a matrix in SQL reporting and I would like it to print on an A4 page. If the matrix has less than 4 columns then it fits but for more than 4 columns I would like the matrix to wrap and show only 4 columns per page. Is this possible? I am using SQL Reporting 2005 in localmode.
I found a work around: First I added a field to my datasource called column count. Because the datasource is built in a business object it was easy for me to tell how many columns of data there is. Next I created a list on my report and moved my matrix into the list. I made the group expression =Ceiling(Fields!ColumnCo...
Wrap a SQL Reporting Matrix I have a matrix in SQL reporting and I would like it to print on an A4 page. If the matrix has less than 4 columns then it fits but for more than 4 columns I would like the matrix to wrap and show only 4 columns per page. Is this possible? I am using SQL Reporting 2005 in localmode.
TITLE: Wrap a SQL Reporting Matrix QUESTION: I have a matrix in SQL reporting and I would like it to print on an A4 page. If the matrix has less than 4 columns then it fits but for more than 4 columns I would like the matrix to wrap and show only 4 columns per page. Is this possible? I am using SQL Reporting 2005 in l...
[ "sql-server", "sql-server-2005", "reporting-services" ]
1
4
4,031
5
0
2008-09-27T16:13:18.477000
2008-09-29T11:15:54.480000
143,936
143,981
What is the best web based application to access a database
Sometimes we deploy applications behind customer firewall and we need read only access to their DB for debugging issues as sometimes their IT people are not SQL savvy. We want to bundle our application with some web based application that will expose the database and allow us to fire adhoc SQL queries and show their ou...
If you want the database behind a firewall, and believe me, you do want your database behind a firewall, see if you can have a VPN for going directly into the box. Once you are on the VPN, you can use whichever management tool you currently use for managing the database. So if you use SQL Server, you can connect via th...
What is the best web based application to access a database Sometimes we deploy applications behind customer firewall and we need read only access to their DB for debugging issues as sometimes their IT people are not SQL savvy. We want to bundle our application with some web based application that will expose the datab...
TITLE: What is the best web based application to access a database QUESTION: Sometimes we deploy applications behind customer firewall and we need read only access to their DB for debugging issues as sometimes their IT people are not SQL savvy. We want to bundle our application with some web based application that wil...
[ "java", "sql", "database" ]
3
5
1,507
4
0
2008-09-27T16:23:24.257000
2008-09-27T16:46:09.303000
143,938
144,303
Delphi OTA and RTTI bug
I'm writing a Delphi expert. I need to be able to write a value to a property on a property which is an object. E.g. I have a GroupBox on the form and I want to edit the Margins.Left property. I'm using the following procedure to do it but if gives an AV on the marked line. The procedure takes a component from the (pro...
Margins.xyzzy are all Integer properties, not Int64 properties, so you need to use GetOrdProp/SetOrdProp to read and modify them. SetInt64Prop assumes it's a 64-bit property, and tries calling the property setter function with a 64-bit parameter. As the property setter is expecting a 32-bit parameter, it fails to clean...
Delphi OTA and RTTI bug I'm writing a Delphi expert. I need to be able to write a value to a property on a property which is an object. E.g. I have a GroupBox on the form and I want to edit the Margins.Left property. I'm using the following procedure to do it but if gives an AV on the marked line. The procedure takes a...
TITLE: Delphi OTA and RTTI bug QUESTION: I'm writing a Delphi expert. I need to be able to write a value to a property on a property which is an object. E.g. I have a GroupBox on the form and I want to edit the Margins.Left property. I'm using the following procedure to do it but if gives an AV on the marked line. The...
[ "delphi", "plugins", "rtti" ]
3
3
862
2
0
2008-09-27T16:24:51.180000
2008-09-27T19:37:32.997000
143,947
144,085
In-memory LINQ performance
More than about LINQ to [insert your favorite provider here], this question is about searching or filtering in-memory collections. I know LINQ (or searching/filtering extension methods) works in objects implementing IEnumerable or IEnumerable. The question is: because of the nature of enumeration, is every query comple...
Even with parallelisation, it's still O(n). The constant factor would be different (depending on your number of cores) but as n varied the total time would still vary linearly. Of course, you could write your own implementations of the various LINQ operators over your own data types, but they'd only be appropriate in v...
In-memory LINQ performance More than about LINQ to [insert your favorite provider here], this question is about searching or filtering in-memory collections. I know LINQ (or searching/filtering extension methods) works in objects implementing IEnumerable or IEnumerable. The question is: because of the nature of enumera...
TITLE: In-memory LINQ performance QUESTION: More than about LINQ to [insert your favorite provider here], this question is about searching or filtering in-memory collections. I know LINQ (or searching/filtering extension methods) works in objects implementing IEnumerable or IEnumerable. The question is: because of the...
[ "c#", "linq", "performance", "complexity-theory" ]
8
5
4,887
3
0
2008-09-27T16:29:07.300000
2008-09-27T17:28:03.603000
143,969
144,121
Is there a S.M.A.R.T. Library for .NET or Java?
I asked a somewhat related question but I want it to make it more concrete and 'programming' oriented, so here it goes: Does any body know, if there is a.NET, JAVA or any other Framework, library,.jar file or what ever: to access S.M.A.R.T. Statistics? Thanks!
You can get SMART statistics from.Net via the System.Management and WMI class "MSStorageDriver_ATAPISmartData". Here is a short example that I created for you. Start a new console project and add a reference to the System.Management assembly, then paste this into Program.cs: using System; using System.Collections.Gener...
Is there a S.M.A.R.T. Library for .NET or Java? I asked a somewhat related question but I want it to make it more concrete and 'programming' oriented, so here it goes: Does any body know, if there is a.NET, JAVA or any other Framework, library,.jar file or what ever: to access S.M.A.R.T. Statistics? Thanks!
TITLE: Is there a S.M.A.R.T. Library for .NET or Java? QUESTION: I asked a somewhat related question but I want it to make it more concrete and 'programming' oriented, so here it goes: Does any body know, if there is a.NET, JAVA or any other Framework, library,.jar file or what ever: to access S.M.A.R.T. Statistics? T...
[ "java", ".net", "hardware", "disk-smart" ]
3
5
1,650
1
0
2008-09-27T16:40:39.473000
2008-09-27T17:41:32.667000
143,971
144,136
When should TAGs be preferred over BRANCHING and vice versa (in CVS)?
I think title should be good enough.
Tags Think of it as a snapshot in time. I want to be able to go back to that exact point. However, it will never change. You do not do a checkin on a tagged element. Things that can get tagged: Releases (major and minor) Patches sent to customers Bug fixes Milestones (alpha, beta, etc...) Successful Daily build Branche...
When should TAGs be preferred over BRANCHING and vice versa (in CVS)? I think title should be good enough.
TITLE: When should TAGs be preferred over BRANCHING and vice versa (in CVS)? QUESTION: I think title should be good enough. ANSWER: Tags Think of it as a snapshot in time. I want to be able to go back to that exact point. However, it will never change. You do not do a checkin on a tagged element. Things that can get ...
[ "version-control", "comparison", "cvs" ]
5
3
220
4
0
2008-09-27T16:42:00.093000
2008-09-27T17:52:46.150000
143,973
143,982
Where would you use C# Runtime Compilation?
I happened upon a brief discussion recently on another site about C# runtime compilation recently while searching for something else and thought the idea was interesting. Have you ever used this? I'm trying to determine how/when one might use this and what problem it solves. I'd be very interested in hearing how you've...
Typically, I see this used in cases where you are currently using Reflection and need to optimize for performance. For example, instead of using reflection to call method X, you generate a Dynamic Method at runtime to do this for you.
Where would you use C# Runtime Compilation? I happened upon a brief discussion recently on another site about C# runtime compilation recently while searching for something else and thought the idea was interesting. Have you ever used this? I'm trying to determine how/when one might use this and what problem it solves. ...
TITLE: Where would you use C# Runtime Compilation? QUESTION: I happened upon a brief discussion recently on another site about C# runtime compilation recently while searching for something else and thought the idea was interesting. Have you ever used this? I'm trying to determine how/when one might use this and what p...
[ "c#", "optimization", "runtime-compilation" ]
11
7
4,375
7
0
2008-09-27T16:42:52.010000
2008-09-27T16:46:20.007000
143,997
144,069
Is casting the same thing as converting?
In Jesse Liberty's Learning C# book, he says "Objects of one type can be converted into objects of another type. This is called casting." If you investigate the IL generated from the code below, you can clearly see that the casted assignment isn't doing the same thing as the converted assignment. In the former, you can...
The simple answer is: it depends. For value types, casting will involve genuinely converting it to a different type. For instance: float f = 1.5f; int i = (int) f; // Conversion When the casting expression unboxes, the result (assuming it works) is usually just a copy of what was in the box, with the same type. There a...
Is casting the same thing as converting? In Jesse Liberty's Learning C# book, he says "Objects of one type can be converted into objects of another type. This is called casting." If you investigate the IL generated from the code below, you can clearly see that the casted assignment isn't doing the same thing as the con...
TITLE: Is casting the same thing as converting? QUESTION: In Jesse Liberty's Learning C# book, he says "Objects of one type can be converted into objects of another type. This is called casting." If you investigate the IL generated from the code below, you can clearly see that the casted assignment isn't doing the sam...
[ "c#", "clr", "casting" ]
48
18
7,213
11
0
2008-09-27T16:57:56.903000
2008-09-27T17:21:33.197000
144,001
144,073
Choosing a database type
When would you use a bigtabe/simpledb database vs a Relational database?
Relational databases give you a lot more layout and query flexibility, and are easier to use, but you also end up with more pain if you later need to partition your data if it won't fit on a single database server/cluster. BigTable and similar things scale essentially infinitely, but do so by not offering a bunch of re...
Choosing a database type When would you use a bigtabe/simpledb database vs a Relational database?
TITLE: Choosing a database type QUESTION: When would you use a bigtabe/simpledb database vs a Relational database? ANSWER: Relational databases give you a lot more layout and query flexibility, and are easier to use, but you also end up with more pain if you later need to partition your data if it won't fit on a sing...
[ "architecture", "relational", "amazon-simpledb", "bigtable" ]
4
7
1,834
2
0
2008-09-27T16:59:45.387000
2008-09-27T17:22:37.547000
144,046
144,887
How to incorporate Interactive Ruby into my development process?
I am trying to find a better way to integrate IRB with my normal ruby devleopment. Currently I rarely use IRB with my code. I only use it to verify syntax or to try something small. I know I can load my own code into ruby as a require 'mycode' but this usually doesn't mesh with my programming style. Sometimes the varia...
Install the ruby-debug gem. Of course, require it inside your app (only in development/test mode). Now you can write 'debugger' where you want to stop execution. Once your app stop at your breakpoint, you can type 'help' to know about all commands. One of them is 'irb'. It starts an IRB session in which you have access...
How to incorporate Interactive Ruby into my development process? I am trying to find a better way to integrate IRB with my normal ruby devleopment. Currently I rarely use IRB with my code. I only use it to verify syntax or to try something small. I know I can load my own code into ruby as a require 'mycode' but this us...
TITLE: How to incorporate Interactive Ruby into my development process? QUESTION: I am trying to find a better way to integrate IRB with my normal ruby devleopment. Currently I rarely use IRB with my code. I only use it to verify syntax or to try something small. I know I can load my own code into ruby as a require 'm...
[ "ruby", "debugging", "irb" ]
6
10
1,850
5
0
2008-09-27T17:17:27.653000
2008-09-28T00:44:40.853000
144,049
990,201
Recommended IRC server (ircd) for a small site?
The situation: I want to play around with IRC bots as general communications interfaces to other code I am investigating. The server hardware would be old and low-memory, but running on a relatively up-to-date Debian GNU/Linux install. I don't expect more than a hundred users at a time, tops, and probably in the single...
During the past couple days I have been coding a bot with Python and IRCLib. Since I am coding the communication interface I needed to see the raw data transfered between the server and the client. So, I needed an IRC server which would support that. At first I was using IRCD, and it was totally fine. But after a while...
Recommended IRC server (ircd) for a small site? The situation: I want to play around with IRC bots as general communications interfaces to other code I am investigating. The server hardware would be old and low-memory, but running on a relatively up-to-date Debian GNU/Linux install. I don't expect more than a hundred u...
TITLE: Recommended IRC server (ircd) for a small site? QUESTION: The situation: I want to play around with IRC bots as general communications interfaces to other code I am investigating. The server hardware would be old and low-memory, but running on a relatively up-to-date Debian GNU/Linux install. I don't expect mor...
[ "linux", "comparison", "irc" ]
11
6
22,497
4
0
2008-09-27T17:17:54.237000
2009-06-13T07:13:02.947000
144,058
604,581
Eclipse Ganymede not validating JSPs properly
I just installed Ganymede and am exploring an old project in it. All of my JSPs are giving me weird validation errors. I'm seeing stuff like - Syntax error on token "}", delete this token Syntax error on token "catch", Identifier expected Syntax error, insert "Finally" to complete TryStatement I'm doing best practice s...
I have just downloaded Ganymede 3.4.2 and added WTP 3.0.4 to it and this error has gone for me.
Eclipse Ganymede not validating JSPs properly I just installed Ganymede and am exploring an old project in it. All of my JSPs are giving me weird validation errors. I'm seeing stuff like - Syntax error on token "}", delete this token Syntax error on token "catch", Identifier expected Syntax error, insert "Finally" to c...
TITLE: Eclipse Ganymede not validating JSPs properly QUESTION: I just installed Ganymede and am exploring an old project in it. All of my JSPs are giving me weird validation errors. I'm seeing stuff like - Syntax error on token "}", delete this token Syntax error on token "catch", Identifier expected Syntax error, ins...
[ "java", "eclipse", "validation", "jsp", "ganymede" ]
7
3
15,563
8
0
2008-09-27T17:19:32.173000
2009-03-03T00:07:05.173000
144,088
144,127
How to pass page's meta tags in ASP.NET MVC?
I'm playing with ASP.NET MVC for the last few days and was able to build a small site. Everything works great. Now, I need to pass the page's META tags (title, description, keywords, etc.) via the ViewData. (i'm using a master page). How you're dealing with this? Thank you in advance.
Here is how I am currently doing it... In the masterpage, I have a content place holder with a default title, description and keywords: Default Title And then in the page, you can override all this content: Page Specific Title This should give you an idea on how to set it up. Now you can put this information in your Vi...
How to pass page's meta tags in ASP.NET MVC? I'm playing with ASP.NET MVC for the last few days and was able to build a small site. Everything works great. Now, I need to pass the page's META tags (title, description, keywords, etc.) via the ViewData. (i'm using a master page). How you're dealing with this? Thank you i...
TITLE: How to pass page's meta tags in ASP.NET MVC? QUESTION: I'm playing with ASP.NET MVC for the last few days and was able to build a small site. Everything works great. Now, I need to pass the page's META tags (title, description, keywords, etc.) via the ViewData. (i'm using a master page). How you're dealing with...
[ "asp.net-mvc", "master-pages" ]
9
20
7,403
2
0
2008-09-27T17:29:17.593000
2008-09-27T17:45:31.657000
144,109
144,148
SQL Server normalization tactic: varchar vs int Identity
I'm just wondering what the optimal solution is here. Say I have a normalized database. The primary key of the whole system is a varchar. What I'm wondering is should I relate this varchar to an int for normalization or leave it? It's simpler to leave as a varchar, but it might be more optimal For instance I can have P...
Can you really use names as primary keys? Isn't there a high risk of several people with the same name? If you really are so lucky that your name attribute can be used as primary key, then - by all means - use that. Often, though, you will have to make something up, like a customer_id, etc. And finally: "NAME" is a res...
SQL Server normalization tactic: varchar vs int Identity I'm just wondering what the optimal solution is here. Say I have a normalized database. The primary key of the whole system is a varchar. What I'm wondering is should I relate this varchar to an int for normalization or leave it? It's simpler to leave as a varcha...
TITLE: SQL Server normalization tactic: varchar vs int Identity QUESTION: I'm just wondering what the optimal solution is here. Say I have a normalized database. The primary key of the whole system is a varchar. What I'm wondering is should I relate this varchar to an int for normalization or leave it? It's simpler to...
[ "sql", "sql-server", "database-design", "optimization", "normalization" ]
2
7
6,253
7
0
2008-09-27T17:37:39.977000
2008-09-27T17:59:44.417000
144,117
144,140
Any free Text To Speech for browsers?
Wondering if there is any Text to Speech software available as a plug in for IE or Firefox.
WebAnywhere is a university project aimed at creating a site that allows you to use text to speech from any browser at any location, without installing anything or using any plugins. You can try it out and see for yourself. I was pretty impressed with it when I first heard of it.
Any free Text To Speech for browsers? Wondering if there is any Text to Speech software available as a plug in for IE or Firefox.
TITLE: Any free Text To Speech for browsers? QUESTION: Wondering if there is any Text to Speech software available as a plug in for IE or Firefox. ANSWER: WebAnywhere is a university project aimed at creating a site that allows you to use text to speech from any browser at any location, without installing anything or...
[ "text-to-speech" ]
12
12
20,902
7
0
2008-09-27T17:40:30.890000
2008-09-27T17:54:23.010000
144,118
179,916
JAXB Binding Customization
While trying to generate classes from a xsd, i got this error: java.lang.IllegalArgumentException: Illegal class inheritance loop. Outer class OrderPropertyList may not subclass from inner class: OrderPropertyList My xsd define a element to group a unbounded element like this: And my customization binding follows as sp...
I believe what you need to to is set: This will generate standalone classes instead of nested classes. Doing is a redundant binding, since orderPropertyList will map by default to OrderPropertyList. The name of the package includes the outer class name it is nested in by default, so you're not changing that. Also, if y...
JAXB Binding Customization While trying to generate classes from a xsd, i got this error: java.lang.IllegalArgumentException: Illegal class inheritance loop. Outer class OrderPropertyList may not subclass from inner class: OrderPropertyList My xsd define a element to group a unbounded element like this: And my customiz...
TITLE: JAXB Binding Customization QUESTION: While trying to generate classes from a xsd, i got this error: java.lang.IllegalArgumentException: Illegal class inheritance loop. Outer class OrderPropertyList may not subclass from inner class: OrderPropertyList My xsd define a element to group a unbounded element like thi...
[ "xml", "xsd", "jaxb" ]
4
14
36,153
5
0
2008-09-27T17:40:45.663000
2008-10-07T19:15:49.677000
144,134
144,141
C Compatibility Between Integers and Characters
How does C handle converting between integers and characters? Say you've declared an integer variable and ask the user for a number but they input a string instead. What would happen?
The user input is treated as a string that needs to be converted to an int using atoi or another conversion function. Atoi will return 0 if the string cannot be interptreted as a number because it contains letters or other non-numeric characters. You can read a bit more at the atoi documentation on MSDN - http://msdn.m...
C Compatibility Between Integers and Characters How does C handle converting between integers and characters? Say you've declared an integer variable and ask the user for a number but they input a string instead. What would happen?
TITLE: C Compatibility Between Integers and Characters QUESTION: How does C handle converting between integers and characters? Say you've declared an integer variable and ask the user for a number but they input a string instead. What would happen? ANSWER: The user input is treated as a string that needs to be conver...
[ "c", "compatibility" ]
1
6
1,174
5
0
2008-09-27T17:51:15.467000
2008-09-27T17:55:51.167000
144,147
144,182
Traversing negative Array indeces in JScript
I have a sparse array in Jscript, with non-null elements occuring at both negative and positive indices. When I try to use a for in loop, it doesn't traverse the array from the lowest (negative) index to the highest positive index. Instead it returns the array in the order that I added the elements. Enumeration doesn't...
Technically, "A" isn't in the Array at all since you can't have a negative index. It is just a member of the arrName object. If you check the arrName.length you will see that it is 21 (0,1,2,...,20) Why don't you use a plain object instead (as a hashtable). Something like this should work:
Traversing negative Array indeces in JScript I have a sparse array in Jscript, with non-null elements occuring at both negative and positive indices. When I try to use a for in loop, it doesn't traverse the array from the lowest (negative) index to the highest positive index. Instead it returns the array in the order t...
TITLE: Traversing negative Array indeces in JScript QUESTION: I have a sparse array in Jscript, with non-null elements occuring at both negative and positive indices. When I try to use a for in loop, it doesn't traverse the array from the lowest (negative) index to the highest positive index. Instead it returns the ar...
[ "javascript", "arrays", "sparse-matrix" ]
3
9
1,680
2
0
2008-09-27T17:59:39.020000
2008-09-27T18:18:35.947000
144,151
144,173
How do I prevent Excel from rendering the spreadsheet as my macro calculates it?
My macro updates a large spreadsheet with numbers, but it runs very slowly as excel is rendering the result as it computes it. How do I stop excel from rendering the output until the macro is complete?
I use both of the proposed solutions: Application.ScreenUpdating = False Application.Calculation = xlCalculationManual......... Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = True
How do I prevent Excel from rendering the spreadsheet as my macro calculates it? My macro updates a large spreadsheet with numbers, but it runs very slowly as excel is rendering the result as it computes it. How do I stop excel from rendering the output until the macro is complete?
TITLE: How do I prevent Excel from rendering the spreadsheet as my macro calculates it? QUESTION: My macro updates a large spreadsheet with numbers, but it runs very slowly as excel is rendering the result as it computes it. How do I stop excel from rendering the output until the macro is complete? ANSWER: I use both...
[ "excel" ]
8
16
5,078
5
0
2008-09-27T18:01:48.903000
2008-09-27T18:11:49.177000
144,166
144,198
How would you handle a very large vector in Ruby?
I'm planning to write a program in Ruby to analyse some data which has come back from an online questionnaire. There are hundreds of thousands of responses, and each respondent answers about 200 questions. Each question is multiple-choice, so there are a fixed number of possible responses to each. The intention is to u...
First thing that comes to mind: Storing it in Memory can be absolutely reasonable for processing purposes. Lets say you reserve one byte for each answer, you have a million responses and 200 questions, then you have a 200 MB array. Not small but definitely not memory exhausting on a modern desktop, even with a 32 bit O...
How would you handle a very large vector in Ruby? I'm planning to write a program in Ruby to analyse some data which has come back from an online questionnaire. There are hundreds of thousands of responses, and each respondent answers about 200 questions. Each question is multiple-choice, so there are a fixed number of...
TITLE: How would you handle a very large vector in Ruby? QUESTION: I'm planning to write a program in Ruby to analyse some data which has come back from an online questionnaire. There are hundreds of thousands of responses, and each respondent answers about 200 questions. Each question is multiple-choice, so there are...
[ "mysql", "ruby" ]
3
3
378
5
0
2008-09-27T18:07:50.153000
2008-09-27T18:26:47.830000
144,167
144,187
How to format Oracle SQL text-only select output
I am using Oracle SQL (in SQLDeveloper, so I don't have access to SQLPLUS commands such as COLUMN) to execute a query that looks something like this: select assigner_staff_id as staff_id, active_flag, assign_date, complete_date, mod_date from work where assigner_staff_id = '2096'; The results it give me look something ...
What are you using to get the results? The output you pasted looks like it's coming from SQL*PLUS. It may be that whatever tool you are using to generate the results has some method of modifying the output. By default Oracle outputs columns based upon the width of the title or the width of the column data which ever is...
How to format Oracle SQL text-only select output I am using Oracle SQL (in SQLDeveloper, so I don't have access to SQLPLUS commands such as COLUMN) to execute a query that looks something like this: select assigner_staff_id as staff_id, active_flag, assign_date, complete_date, mod_date from work where assigner_staff_id...
TITLE: How to format Oracle SQL text-only select output QUESTION: I am using Oracle SQL (in SQLDeveloper, so I don't have access to SQLPLUS commands such as COLUMN) to execute a query that looks something like this: select assigner_staff_id as staff_id, active_flag, assign_date, complete_date, mod_date from work where...
[ "sql", "oracle", "formatting" ]
5
2
57,735
6
0
2008-09-27T18:07:54.350000
2008-09-27T18:22:56.327000
144,175
145,423
User Privileges
Why does a user needs privileges over his own schema to create packages and triggers?
Are you asking why users need particular priviliges (i.e. CREATE TABLE, CREATE PROCEDURE, etc) in order to create particular types of objects in their own schema? If so, the natural answer would be that good security begins with the principle of least privilege-- that is, a user should only have those privileges that t...
User Privileges Why does a user needs privileges over his own schema to create packages and triggers?
TITLE: User Privileges QUESTION: Why does a user needs privileges over his own schema to create packages and triggers? ANSWER: Are you asking why users need particular priviliges (i.e. CREATE TABLE, CREATE PROCEDURE, etc) in order to create particular types of objects in their own schema? If so, the natural answer wo...
[ "oracle", "privileges" ]
1
2
789
3
0
2008-09-27T18:12:58.067000
2008-09-28T07:30:11.050000
144,176
144,189
Fastest way to convert a possibly-null-terminated ascii byte[] to a string?
I need to convert a (possibly) null terminated array of ascii bytes to a string in C# and the fastest way I've found to do it is by using my UnsafeAsciiBytesToString method shown below. This method uses the String.String(sbyte*) constructor which contains a warning in it's remarks: "The value parameter is assumed to po...
Any reason not to use the String(sbyte*, int, int) constructor? If you've worked out which portion of the buffer you need, the rest should be simple: public static string UnsafeAsciiBytesToString(byte[] buffer, int offset, int length) { unsafe { fixed (byte* pAscii = buffer) { return new String((sbyte*)pAscii, offset, ...
Fastest way to convert a possibly-null-terminated ascii byte[] to a string? I need to convert a (possibly) null terminated array of ascii bytes to a string in C# and the fastest way I've found to do it is by using my UnsafeAsciiBytesToString method shown below. This method uses the String.String(sbyte*) constructor whi...
TITLE: Fastest way to convert a possibly-null-terminated ascii byte[] to a string? QUESTION: I need to convert a (possibly) null terminated array of ascii bytes to a string in C# and the fastest way I've found to do it is by using my UnsafeAsciiBytesToString method shown below. This method uses the String.String(sbyte...
[ "c#", ".net", "string", "ascii" ]
26
15
37,014
10
0
2008-09-27T18:13:37.627000
2008-09-27T18:23:43.047000
144,193
144,812
AS3/PureMVC Best Practices? Best code examples of well architected projects?
I am a AS3 novice learning PureMVC and want to write code following best practices so that any other AS3 developer can pick up my code and easily understand what I did, I am tempted to do stuff as I would in JavaScript or Asp.Net/C#, but I have a feeling that might not be the best approach. Thoughts? Links?
I found that reading through the docs helped me get a clear definition of each of the parts to PureMVC. On top of that I downloaded the source for the demos and added them in Flex Builder so I could look through them easily and see how they were constructed to get an idea of how I should construct my project. One thing...
AS3/PureMVC Best Practices? Best code examples of well architected projects? I am a AS3 novice learning PureMVC and want to write code following best practices so that any other AS3 developer can pick up my code and easily understand what I did, I am tempted to do stuff as I would in JavaScript or Asp.Net/C#, but I hav...
TITLE: AS3/PureMVC Best Practices? Best code examples of well architected projects? QUESTION: I am a AS3 novice learning PureMVC and want to write code following best practices so that any other AS3 developer can pick up my code and easily understand what I did, I am tempted to do stuff as I would in JavaScript or Asp...
[ "apache-flex", "flash", "actionscript-3", "puremvc" ]
1
1
3,315
2
0
2008-09-27T18:25:33.777000
2008-09-28T00:06:50.587000
144,200
407,832
How do I deploy an ADF business component?
How do I deploy an ADF business component to the middle tier and call it using RMI? I just cannot find any good documentation on this!
Select the ADF BC application module and use your right button to create a business components deployment and select EJB session bean. This will create different EAR files which you can deploy. That's all.
How do I deploy an ADF business component? How do I deploy an ADF business component to the middle tier and call it using RMI? I just cannot find any good documentation on this!
TITLE: How do I deploy an ADF business component? QUESTION: How do I deploy an ADF business component to the middle tier and call it using RMI? I just cannot find any good documentation on this! ANSWER: Select the ADF BC application module and use your right button to create a business components deployment and selec...
[ "java", "oracle", "jakarta-ee", "oracle-adf" ]
3
3
734
2
0
2008-09-27T18:28:17.407000
2009-01-02T19:43:39.337000
144,201
144,212
Has anyone found a good set of python plugins for vim -- specifically module completion?
I'm looking for a suite of plugins that can help me finally switch over to vim full-time. Right now I'm using Komodo with some good success, but their vim bindings have enough little errors that I'm tired of it. What I do love in Komodo, though, is the code completion. So, here's what I'm looking for (ordered by import...
Here you can find some info about this. It covers code completion, having a list of classes and functions in open files. I haven't got around to do a full configuration for vim, since I don't use Python primarily, but I have the same interests in transforming vim in a better Python IDE. Edit: The original site is down,...
Has anyone found a good set of python plugins for vim -- specifically module completion? I'm looking for a suite of plugins that can help me finally switch over to vim full-time. Right now I'm using Komodo with some good success, but their vim bindings have enough little errors that I'm tired of it. What I do love in K...
TITLE: Has anyone found a good set of python plugins for vim -- specifically module completion? QUESTION: I'm looking for a suite of plugins that can help me finally switch over to vim full-time. Right now I'm using Komodo with some good success, but their vim bindings have enough little errors that I'm tired of it. W...
[ "python", "vim", "code-completion" ]
22
17
9,136
9
0
2008-09-27T18:28:42.507000
2008-09-27T18:42:39.540000
144,210
144,267
How can I be sure the whole MySQL DB is loaded in memory?
I am running a mysql server. I would like to somehow make sure that the whole DB is loaded into the ram as I heard it would be alot faster. Is this true? and how do I vertify it?
If you are using InnoDB, then you can set innodb_buffer_pool_size to be at least as large as your data and indexes. Then as you access data, it will be cached into memory and all subsequent accesses will occur via memory. If you wanted to pre-cache the data, you could do some of your common queries, or full table/index...
How can I be sure the whole MySQL DB is loaded in memory? I am running a mysql server. I would like to somehow make sure that the whole DB is loaded into the ram as I heard it would be alot faster. Is this true? and how do I vertify it?
TITLE: How can I be sure the whole MySQL DB is loaded in memory? QUESTION: I am running a mysql server. I would like to somehow make sure that the whole DB is loaded into the ram as I heard it would be alot faster. Is this true? and how do I vertify it? ANSWER: If you are using InnoDB, then you can set innodb_buffer_...
[ "mysql", "innodb" ]
2
6
2,327
4
0
2008-09-27T18:40:31.370000
2008-09-27T19:21:42.473000
144,218
144,573
Significant figures in the decimal module
So I've decided to try to solve my physics homework by writing some python scripts to solve problems for me. One problem that I'm running into is that significant figures don't always seem to come out properly. For example this handles significant figures properly: from decimal import Decimal >>> Decimal('1.0') + Decim...
Changing the decimal working precision to 2 digits is not a good idea, unless you absolutely only are going to perform a single operation. You should always perform calculations at higher precision than the level of significance, and only round the final result. If you perform a long sequence of calculations and round ...
Significant figures in the decimal module So I've decided to try to solve my physics homework by writing some python scripts to solve problems for me. One problem that I'm running into is that significant figures don't always seem to come out properly. For example this handles significant figures properly: from decimal...
TITLE: Significant figures in the decimal module QUESTION: So I've decided to try to solve my physics homework by writing some python scripts to solve problems for me. One problem that I'm running into is that significant figures don't always seem to come out properly. For example this handles significant figures prop...
[ "python", "floating-point", "decimal", "physics", "significance" ]
5
8
9,428
6
0
2008-09-27T18:47:54.020000
2008-09-27T22:00:35.570000
144,226
144,245
Do CSS ems always represent the font size?
From what I know, the em keyword in CSS means the current size of a font. So if you put 1.2 em, it means 120% of the font height. It doesn't seem right though that em is used for setting the width of divs etc like YUI grids does: margin-right:24.0769em;*margin-right:23.62em; Everytime I read about em, I forget what it ...
Historically it is the width of an "M" in the font. Hence the name! In CSS2.1 it is defined to be the same as the font-size. In many cases it seems more natural to use em rather than points or pixels, because it is relative to the font size. For example you might define a text-column to have a width of 40em. If you lat...
Do CSS ems always represent the font size? From what I know, the em keyword in CSS means the current size of a font. So if you put 1.2 em, it means 120% of the font height. It doesn't seem right though that em is used for setting the width of divs etc like YUI grids does: margin-right:24.0769em;*margin-right:23.62em; E...
TITLE: Do CSS ems always represent the font size? QUESTION: From what I know, the em keyword in CSS means the current size of a font. So if you put 1.2 em, it means 120% of the font height. It doesn't seem right though that em is used for setting the width of divs etc like YUI grids does: margin-right:24.0769em;*margi...
[ "css", "font-size" ]
4
11
750
5
0
2008-09-27T18:54:57.153000
2008-09-27T19:03:20.473000
144,237
154,338
Platform for ad-supported shareware
Folks, I'm working on a little piece of rich client software that I'd like to distribute for free. That is, I'd still like to make money on it, but I'd like the revenue to come from advertising. Do you know of an advertising platform that works well for client apps? I'd like the ads to be completely unobtrusive (like G...
It's true that using Google Adsense would be against TOS, but you could roll your own ad-engine. For instance, you could create an Amazon affiliate account, and show books that match keywords in your little advertising space. (anyone who clicked on the book and bought would earn you money per sale) Anything affiliate-b...
Platform for ad-supported shareware Folks, I'm working on a little piece of rich client software that I'd like to distribute for free. That is, I'd still like to make money on it, but I'd like the revenue to come from advertising. Do you know of an advertising platform that works well for client apps? I'd like the ads ...
TITLE: Platform for ad-supported shareware QUESTION: Folks, I'm working on a little piece of rich client software that I'd like to distribute for free. That is, I'd still like to make money on it, but I'd like the revenue to come from advertising. Do you know of an advertising platform that works well for client apps?...
[ "ads", "shareware" ]
4
6
519
4
0
2008-09-27T19:01:56.810000
2008-09-30T18:30:11.480000
144,246
144,299
What are the consequences of not closing database connection after an error?
I have an application that is causing a lot of headaches. It's a.NET app connecting to SQL Server 2005 via a web service. The program has grid that is filled by a long running stored procedure that is prone to timing out. In the case when it does time out and a SqlException is thrown, there is no execption handling to ...
Since a SqlConnection closes while disposing i usually use this syntax using (SqlConnection conn = new SqlConnection()) { // SqlCode here }
What are the consequences of not closing database connection after an error? I have an application that is causing a lot of headaches. It's a.NET app connecting to SQL Server 2005 via a web service. The program has grid that is filled by a long running stored procedure that is prone to timing out. In the case when it d...
TITLE: What are the consequences of not closing database connection after an error? QUESTION: I have an application that is causing a lot of headaches. It's a.NET app connecting to SQL Server 2005 via a web service. The program has grid that is filled by a long running stored procedure that is prone to timing out. In ...
[ ".net", "sql", "sql-server", "sql-server-2005", "web-services" ]
7
5
4,336
7
0
2008-09-27T19:04:37.723000
2008-09-27T19:36:58.037000
144,250
694,139
How to get the RGB values for a pixel on an image on the iphone
I am writing an iPhone application and need to essentially implement something equivalent to the 'eyedropper' tool in photoshop, where you can touch a point on the image and capture the RGB values for the pixel in question to determine and match its color. Getting the UIImage is the easy part, but is there a way to con...
A little more detail... I posted earlier this evening with a consolidation and small addition to what had been said on this page - that can be found at the bottom of this post. I am editing the post at this point, however, to post what I propose is (at least for my requirements, which include modifying pixel data) a be...
How to get the RGB values for a pixel on an image on the iphone I am writing an iPhone application and need to essentially implement something equivalent to the 'eyedropper' tool in photoshop, where you can touch a point on the image and capture the RGB values for the pixel in question to determine and match its color....
TITLE: How to get the RGB values for a pixel on an image on the iphone QUESTION: I am writing an iPhone application and need to essentially implement something equivalent to the 'eyedropper' tool in photoshop, where you can touch a point on the image and capture the RGB values for the pixel in question to determine an...
[ "iphone", "cocoa-touch", "image", "bitmap" ]
38
38
55,517
8
0
2008-09-27T19:07:48.370000
2009-03-29T05:20:23.770000
144,254
144,280
Getting started with Android
So, I'll be getting my T-Mobile G1 within a month or so, and I'm excited to start developing for it. Has anyone started using it yet? Is there a dev wiki or anything set up for it yet?
Google's android groups This is probably the best place to go. However, a good search on google will most likely take you to one of these discussion anyways. Here, you can discuss about your difficulties possibly with the core developers too. Anddev.org They're probably the most active groups so far (as of Sun, April 2...
Getting started with Android So, I'll be getting my T-Mobile G1 within a month or so, and I'm excited to start developing for it. Has anyone started using it yet? Is there a dev wiki or anything set up for it yet?
TITLE: Getting started with Android QUESTION: So, I'll be getting my T-Mobile G1 within a month or so, and I'm excited to start developing for it. Has anyone started using it yet? Is there a dev wiki or anything set up for it yet? ANSWER: Google's android groups This is probably the best place to go. However, a good ...
[ "android" ]
47
27
5,108
7
0
2008-09-27T19:13:21.277000
2008-09-27T19:30:52.013000
144,261
144,866
Memory leak detection tools
Does Apple's Xcode development environment provide any tools for memory leak detection? I am especially interested in tools that apply to the iPhone SDK. Currently my favourite platform for hobby programming projects Documentations/tutorials for said tools would be very helpful.
There is one specifically called Leaks and like a previous poster said, the easiest way to run it is straight from Xcode: run -> Start with Performance Tool -> Leaks It seems very good at detecting memory leaks, and was easy for a Non-C Head like me to figure out.
Memory leak detection tools Does Apple's Xcode development environment provide any tools for memory leak detection? I am especially interested in tools that apply to the iPhone SDK. Currently my favourite platform for hobby programming projects Documentations/tutorials for said tools would be very helpful.
TITLE: Memory leak detection tools QUESTION: Does Apple's Xcode development environment provide any tools for memory leak detection? I am especially interested in tools that apply to the iPhone SDK. Currently my favourite platform for hobby programming projects Documentations/tutorials for said tools would be very hel...
[ "iphone", "xcode", "memory-management", "memory-leaks" ]
64
66
80,556
11
0
2008-09-27T19:17:08.443000
2008-09-28T00:32:47.920000
144,274
1,683,084
Alternative to phpUnderControl - is it the best?
I am searching for a good system for PHP, which does UnitTesting, Subversion, Coding Standards. I would love to hear your suggestions and which one is the best and why. I will be running it on a debian server so anything which runs on mac or windows servers would be out of the question.
I second Hudson for CI and PHP. I have written a tutorial on setting it up if you are interested. Edit: My tutorial is out of date. I highly recommend: http://jenkins-php.org/
Alternative to phpUnderControl - is it the best? I am searching for a good system for PHP, which does UnitTesting, Subversion, Coding Standards. I would love to hear your suggestions and which one is the best and why. I will be running it on a debian server so anything which runs on mac or windows servers would be out ...
TITLE: Alternative to phpUnderControl - is it the best? QUESTION: I am searching for a good system for PHP, which does UnitTesting, Subversion, Coding Standards. I would love to hear your suggestions and which one is the best and why. I will be running it on a debian server so anything which runs on mac or windows ser...
[ "php", "version-control", "continuous-integration" ]
11
5
5,838
5
0
2008-09-27T19:25:22.277000
2009-11-05T19:50:32.447000
144,277
144,284
Is the mono .NET project included in latest release of most popular linux distros?
I'm wondering if mono.net is included in the default installation of Ubuntu, Kubuntu, and Fedora, and other popular distros? If so, does anyone have a good reason why NOT to use it to develop a new GUI application targeted mainly for linux?
It is included in Fedora, Ubuntu, Mandriva, Debian and OpenSUSE. The only major OS that does not include it is RHEL, but packages are available for it as a separate download. Additionally, you can bundle Mono with your application into a single binary if you need to (not recommended, but always possible). GUI-wise Mono...
Is the mono .NET project included in latest release of most popular linux distros? I'm wondering if mono.net is included in the default installation of Ubuntu, Kubuntu, and Fedora, and other popular distros? If so, does anyone have a good reason why NOT to use it to develop a new GUI application targeted mainly for lin...
TITLE: Is the mono .NET project included in latest release of most popular linux distros? QUESTION: I'm wondering if mono.net is included in the default installation of Ubuntu, Kubuntu, and Fedora, and other popular distros? If so, does anyone have a good reason why NOT to use it to develop a new GUI application targe...
[ ".net", "linux", "mono" ]
10
15
887
5
0
2008-09-27T19:29:16.260000
2008-09-27T19:34:41.083000
144,283
147,302
What is the difference between varchar and nvarchar?
Is it just that nvarchar supports multibyte characters? If that is the case, is there really any point, other than storage concerns, to using varchars?
An nvarchar column can store any Unicode data. A varchar column is restricted to an 8-bit codepage. Some people think that varchar should be used because it takes up less space. I believe this is not the correct answer. Codepage incompatabilities are a pain, and Unicode is the cure for codepage problems. With cheap dis...
What is the difference between varchar and nvarchar? Is it just that nvarchar supports multibyte characters? If that is the case, is there really any point, other than storage concerns, to using varchars?
TITLE: What is the difference between varchar and nvarchar? QUESTION: Is it just that nvarchar supports multibyte characters? If that is the case, is there really any point, other than storage concerns, to using varchars? ANSWER: An nvarchar column can store any Unicode data. A varchar column is restricted to an 8-bi...
[ "sql-server", "varchar", "nvarchar" ]
1,704
2,131
1,540,810
22
0
2008-09-27T19:34:00.273000
2008-09-29T02:16:22.780000
144,285
144,336
State of C++ Standard
I haven't kept up lately with the C++ world. Exactly where do things stand these days regarding the standard? Is TR1 adopted? Is there a TR2? How do these relate to C++0x? Are the subsumed? Has a decision been reached on threading yet?
You can find an extensive article about the upcoming C++0x on wikipedia and the current state of C++ evolution here. It is also worth giving a look at the current GNU implementation in gcc
State of C++ Standard I haven't kept up lately with the C++ world. Exactly where do things stand these days regarding the standard? Is TR1 adopted? Is there a TR2? How do these relate to C++0x? Are the subsumed? Has a decision been reached on threading yet?
TITLE: State of C++ Standard QUESTION: I haven't kept up lately with the C++ world. Exactly where do things stand these days regarding the standard? Is TR1 adopted? Is there a TR2? How do these relate to C++0x? Are the subsumed? Has a decision been reached on threading yet? ANSWER: You can find an extensive article a...
[ "c++", "standards" ]
2
8
807
3
0
2008-09-27T19:34:56.573000
2008-09-27T19:55:42.983000
144,309
144,907
What is the best MPI implementation
I have to implement MPI system in a cluster. If anyone here has any experience with MPI (MPICH/OpenMPI), I'd like to know which is better and how the performance can be boosted on a cluster of x86_64 boxes.
MPICH has been around a lot longer. It's extremely portable and you'll find years worth of tips and tricks online. It's a safe bet and it's probably compatible with more MPI programs out there. OpenMPI is newer. While it's not quite as portable, it supports the most common platforms really well. Most people seem to thi...
What is the best MPI implementation I have to implement MPI system in a cluster. If anyone here has any experience with MPI (MPICH/OpenMPI), I'd like to know which is better and how the performance can be boosted on a cluster of x86_64 boxes.
TITLE: What is the best MPI implementation QUESTION: I have to implement MPI system in a cluster. If anyone here has any experience with MPI (MPICH/OpenMPI), I'd like to know which is better and how the performance can be boosted on a cluster of x86_64 boxes. ANSWER: MPICH has been around a lot longer. It's extremely...
[ "parallel-processing", "mpi" ]
25
21
16,020
4
0
2008-09-27T19:40:17.637000
2008-09-28T00:59:56.277000
144,319
150,651
What do you use to test your browser extension / BHO?
What are the best approaches / tools to test browser extensions? In my case I work on an IE Browser Helper Object (C#) which has a small UI of its own and a good deal of database interaction. Up till now we've used automated unit tests for testing our model/business objects but manual testing for the UI/scenario testin...
We used to use Selenium, but then we switched over to Webius SWExplorerAutomation (SWEA). A benefit of using Webius is that we can generate c#, wrap them in nunit tests, and compile the tests into.NET assemblies to integrate into our build scripts. The downside is that they are specific to Internet Explorer, but it giv...
What do you use to test your browser extension / BHO? What are the best approaches / tools to test browser extensions? In my case I work on an IE Browser Helper Object (C#) which has a small UI of its own and a good deal of database interaction. Up till now we've used automated unit tests for testing our model/business...
TITLE: What do you use to test your browser extension / BHO? QUESTION: What are the best approaches / tools to test browser extensions? In my case I work on an IE Browser Helper Object (C#) which has a small UI of its own and a good deal of database interaction. Up till now we've used automated unit tests for testing ...
[ "internet-explorer", "testing", "selenium", "bho" ]
3
1
1,129
2
0
2008-09-27T19:47:51.833000
2008-09-29T21:02:37.550000
144,321
147,796
Searching/reading another file from awk based on current file's contents, is it possible?
I'm processing a huge file with (GNU) awk, (other available tools are: Linux shell tools, some old (>5.0) version of Perl, but can't install modules). My problem: if some field1, field2, field3 contain X, Y, Z I must search for a file in another directory which contains field4, and field5 on one line, and insert some d...
Let me start out by saying that your problem description isn't really that helpful. Next time, please just be more specific: You might be missing out on much better solutions. So from your description, I understand you have two files which contain whitespace-separated data. In the first file, you want to match the firs...
Searching/reading another file from awk based on current file's contents, is it possible? I'm processing a huge file with (GNU) awk, (other available tools are: Linux shell tools, some old (>5.0) version of Perl, but can't install modules). My problem: if some field1, field2, field3 contain X, Y, Z I must search for a ...
TITLE: Searching/reading another file from awk based on current file's contents, is it possible? QUESTION: I'm processing a huge file with (GNU) awk, (other available tools are: Linux shell tools, some old (>5.0) version of Perl, but can't install modules). My problem: if some field1, field2, field3 contain X, Y, Z I ...
[ "perl", "search", "shell", "awk", "command-line-interface" ]
2
2
1,516
4
0
2008-09-27T19:49:02.377000
2008-09-29T07:19:02.943000
144,324
144,500
OpenID retrofitting and can I trust where sensitive data is involved?
I am considering adding OpenID to our customer facing admin and control panel areas... 1 - Associating OpenID's With Existing Accounts For customers that already have accounts with us, I'm thinking they would need to login using their existing account number that we issue and then I'd have a mechanism to associate thei...
It seems to me that a lot of the arguments against OpenID are either made out of ignorance or by people with an axe to grind. For example, the document you link to complains that identifying yourself with a URI is "dehumanising and more than a little frightening". Is that a legitimate complaint, or something written by...
OpenID retrofitting and can I trust where sensitive data is involved? I am considering adding OpenID to our customer facing admin and control panel areas... 1 - Associating OpenID's With Existing Accounts For customers that already have accounts with us, I'm thinking they would need to login using their existing accoun...
TITLE: OpenID retrofitting and can I trust where sensitive data is involved? QUESTION: I am considering adding OpenID to our customer facing admin and control panel areas... 1 - Associating OpenID's With Existing Accounts For customers that already have accounts with us, I'm thinking they would need to login using the...
[ "security", "openid" ]
2
5
178
2
0
2008-09-27T19:50:04.603000
2008-09-27T21:15:23.837000
144,339
144,374
What would the best tool to create a natural DSL in Java?
A couple of days ago, I read a blog entry ( http://ayende.com/Blog/archive/2008/09/08/Implementing-generic-natural-language-DSL.aspx ) where the author discuss the idea of a generic natural language DSL parser using.NET. The brilliant part of his idea, in my opinion, is that the text is parsed and matched against class...
Considering the complexity of lexing and parsing, I don't know if I'd want to code all that by hand. ANTLR isn't that hard to pickup and I think it is worthing looking into based on your problem. If you use a parse grammar to build and abstract syntax tree from the input, its pretty easy to then process that AST with a...
What would the best tool to create a natural DSL in Java? A couple of days ago, I read a blog entry ( http://ayende.com/Blog/archive/2008/09/08/Implementing-generic-natural-language-DSL.aspx ) where the author discuss the idea of a generic natural language DSL parser using.NET. The brilliant part of his idea, in my opi...
TITLE: What would the best tool to create a natural DSL in Java? QUESTION: A couple of days ago, I read a blog entry ( http://ayende.com/Blog/archive/2008/09/08/Implementing-generic-natural-language-DSL.aspx ) where the author discuss the idea of a generic natural language DSL parser using.NET. The brilliant part of h...
[ "java", "dsl", "nlp", "parsing" ]
18
27
13,959
6
0
2008-09-27T19:56:12.700000
2008-09-27T20:17:09.093000
144,344
144,396
How to store directory / hierarchy / tree structure in the database?
How do i store a directory / hierarchy / tree structure in the database? Namely MSSQL Server. @olavk: Doesn't look like you've seen my own answer. The way i use is way better than recursive queries:) p.p.s. This is the way to go!
There are many ways to store hierarchies in SQL databases. Which one to choose depends on which DBMS product you use, and how the data will be used. As you have used the MSSQL2005 tag, I think you should start considering the "Adjacency List" model; if you find that it doesn't perform well for your application, then ha...
How to store directory / hierarchy / tree structure in the database? How do i store a directory / hierarchy / tree structure in the database? Namely MSSQL Server. @olavk: Doesn't look like you've seen my own answer. The way i use is way better than recursive queries:) p.p.s. This is the way to go!
TITLE: How to store directory / hierarchy / tree structure in the database? QUESTION: How do i store a directory / hierarchy / tree structure in the database? Namely MSSQL Server. @olavk: Doesn't look like you've seen my own answer. The way i use is way better than recursive queries:) p.p.s. This is the way to go! AN...
[ "sql-server", "sql-server-2005", "database-design", "tree-structure" ]
67
24
62,371
8
0
2008-09-27T19:59:24.923000
2008-09-27T20:27:59.067000
144,359
145,138
What are the best practices for designing a RESTful public API on Rails?
Rails comes with RESTful resources out of the box, but do you use those for your actual public API? If so, how would you accomplish versioning of your API i.e. example.com/api/v2/foo/bar?
Typically, APIs for my applications are indeed built on the same resources that make up the HTML interface. For some (not me), that might be just using the code that comes out of the scaffold generator—but regardless of whether I write it custom or let the generator handle it, there are very few instances where I expos...
What are the best practices for designing a RESTful public API on Rails? Rails comes with RESTful resources out of the box, but do you use those for your actual public API? If so, how would you accomplish versioning of your API i.e. example.com/api/v2/foo/bar?
TITLE: What are the best practices for designing a RESTful public API on Rails? QUESTION: Rails comes with RESTful resources out of the box, but do you use those for your actual public API? If so, how would you accomplish versioning of your API i.e. example.com/api/v2/foo/bar? ANSWER: Typically, APIs for my applicati...
[ "ruby-on-rails", "api", "rest" ]
9
11
3,135
1
0
2008-09-27T20:08:19.660000
2008-09-28T03:30:45.527000
144,360
144,460
Simple basic explanation of a Distributed Hash Table (DHT)
Could any one give an explanation on how a DHT works? Nothing too heavy, just the basics.
Ok, they're fundamentally a pretty simple idea. A DHT gives you a dictionary-like interface, but the nodes are distributed across the network. The trick with DHTs is that the node that gets to store a particular key is found by hashing that key, so in effect your hash-table buckets are now independent nodes in a networ...
Simple basic explanation of a Distributed Hash Table (DHT) Could any one give an explanation on how a DHT works? Nothing too heavy, just the basics.
TITLE: Simple basic explanation of a Distributed Hash Table (DHT) QUESTION: Could any one give an explanation on how a DHT works? Nothing too heavy, just the basics. ANSWER: Ok, they're fundamentally a pretty simple idea. A DHT gives you a dictionary-like interface, but the nodes are distributed across the network. T...
[ "theory", "p2p", "dht" ]
194
263
80,503
4
0
2008-09-27T20:08:25.043000
2008-09-27T20:59:46.060000
144,380
144,617
Ruby: How to break a potentially unicode string into bytes
I'm writing a game which is taking user input and rendering it on-screen. The engine I'm using for this is entirely unicode-friendly, so I'd like to keep that if at all possible. The problem is that the rendering loop looks like this: "string".each_byte do |c| render_this_letter(c) end I don't know a whole lot about i1...
Unfortunately ruby 1.8.x has poor unicode support. It's being addressed in 1.9. But in the mean time, libraries like this one ( http://snippets.dzone.com/posts/show/4527 ) are a good solution. Using the linked library, your code would look something like this: "unicode_string".each_utf8_char do |u| render_unicode_lette...
Ruby: How to break a potentially unicode string into bytes I'm writing a game which is taking user input and rendering it on-screen. The engine I'm using for this is entirely unicode-friendly, so I'd like to keep that if at all possible. The problem is that the rendering loop looks like this: "string".each_byte do |c| ...
TITLE: Ruby: How to break a potentially unicode string into bytes QUESTION: I'm writing a game which is taking user input and rendering it on-screen. The engine I'm using for this is entirely unicode-friendly, so I'd like to keep that if at all possible. The problem is that the rendering loop looks like this: "string"...
[ "ruby", "unicode", "utf-8" ]
1
2
2,922
2
0
2008-09-27T20:20:56.510000
2008-09-27T22:23:26.030000
144,392
144,917
Is there a tool that will look at my Java code, and suggest a good package structure?
I have a large codebase, and I'd like to refactor the package structure so that classes which interact heavily go in the same package. It seems that it should be possible to create a tool that could look at the interactions between classes, and then group together those classes that interact heavily. These groupings mi...
Structure Analysis for Java is an Eclipse plugin that does some dependency analysis: http://stan4j.com/
Is there a tool that will look at my Java code, and suggest a good package structure? I have a large codebase, and I'd like to refactor the package structure so that classes which interact heavily go in the same package. It seems that it should be possible to create a tool that could look at the interactions between cl...
TITLE: Is there a tool that will look at my Java code, and suggest a good package structure? QUESTION: I have a large codebase, and I'd like to refactor the package structure so that classes which interact heavily go in the same package. It seems that it should be possible to create a tool that could look at the inter...
[ "java", "refactoring" ]
5
1
1,155
6
0
2008-09-27T20:26:55.187000
2008-09-28T01:05:08.963000
144,421
144,443
Do you know a good Java RSS/Feed Generator?
I'm searching a small Java based RSS/Feed Generator, something like the FeedCreator.class.php library, any suggestions?, thanks!
There's the Rome framework as well http://rometools.github.io/rome/ Does RSS and Atom
Do you know a good Java RSS/Feed Generator? I'm searching a small Java based RSS/Feed Generator, something like the FeedCreator.class.php library, any suggestions?, thanks!
TITLE: Do you know a good Java RSS/Feed Generator? QUESTION: I'm searching a small Java based RSS/Feed Generator, something like the FeedCreator.class.php library, any suggestions?, thanks! ANSWER: There's the Rome framework as well http://rometools.github.io/rome/ Does RSS and Atom
[ "java", "rss", "generator", "feed" ]
5
11
6,723
4
0
2008-09-27T20:38:11.510000
2008-09-27T20:52:27.433000
144,425
144,517
Collapsable Drop Down List Box in HTML
Is there any sort of free control which does what the Occupation field does on http://monster.ca? That is allow for grouping of the options in a drop down box with expandable sections? I just learned about the optgroup tag which is close to what I want, but not quite.
You can't do this with a traditional control, and I doubt there are ready-made components that fit the bill. If you do want to make this yourself, and don't want to buy into a toolkit like extjs or dojo (which would probably make it easiest to build this), I can recommend the following tree library, as it is very simpl...
Collapsable Drop Down List Box in HTML Is there any sort of free control which does what the Occupation field does on http://monster.ca? That is allow for grouping of the options in a drop down box with expandable sections? I just learned about the optgroup tag which is close to what I want, but not quite.
TITLE: Collapsable Drop Down List Box in HTML QUESTION: Is there any sort of free control which does what the Occupation field does on http://monster.ca? That is allow for grouping of the options in a drop down box with expandable sections? I just learned about the optgroup tag which is close to what I want, but not q...
[ "html", "css" ]
2
0
3,068
4
0
2008-09-27T20:40:54.387000
2008-09-27T21:30:28.607000
144,435
144,437
What's the best way to serialize data in a language-independent binary format?
I'm looking into a mechanism for serialize data to be passed over a socket or shared-memory in a language-independent mechanism. I'm reluctant to use XML since this data is going to be very structured, and encoding/decoding speed is vital. Having a good C API that's liberally licensed is important, but ideally there sh...
Given your requirements, I would go with Google Protocol Buffers. It sounds like it's ideally suited to your application.
What's the best way to serialize data in a language-independent binary format? I'm looking into a mechanism for serialize data to be passed over a socket or shared-memory in a language-independent mechanism. I'm reluctant to use XML since this data is going to be very structured, and encoding/decoding speed is vital. H...
TITLE: What's the best way to serialize data in a language-independent binary format? QUESTION: I'm looking into a mechanism for serialize data to be passed over a socket or shared-memory in a language-independent mechanism. I'm reluctant to use XML since this data is going to be very structured, and encoding/decoding...
[ "c", "language-agnostic", "serialization", "asn.1" ]
16
11
5,631
10
0
2008-09-27T20:46:12.067000
2008-09-27T20:47:58.147000
144,439
144,441
Building a directory string from component parts in C#
If i have lots of directory names either as literal strings or contained in variables, what is the easiest way of combining these to make a complete path? I know of Path.Combine but this only takes 2 string parameters, i need a solution that can take any number number of directory parameters. e.g: string folder1 = "foo...
Does C# support unlimited args in methods? Yes, have a look at the params keyword. Will make it easy to write a function that just calls Path.Combine the appropriate number of times, like this (untested): string CombinePaths(params string[] parts) { string result = String.Empty; foreach (string s in parts) { result = P...
Building a directory string from component parts in C# If i have lots of directory names either as literal strings or contained in variables, what is the easiest way of combining these to make a complete path? I know of Path.Combine but this only takes 2 string parameters, i need a solution that can take any number num...
TITLE: Building a directory string from component parts in C# QUESTION: If i have lots of directory names either as literal strings or contained in variables, what is the easiest way of combining these to make a complete path? I know of Path.Combine but this only takes 2 string parameters, i need a solution that can t...
[ "c#", "filesystems", "string-building" ]
6
15
5,357
4
0
2008-09-27T20:49:25.117000
2008-09-27T20:50:46.267000
144,448
144,462
Python PostgreSQL modules. Which is best?
I've seen a number of postgresql modules for python like pygresql, pypgsql, psyco. Most of them are Python DB API 2.0 compliant, some are not being actively developed anymore. Which module do you recommend? Why?
psycopg2 seems to be the most popular. I've never had any trouble with it. There's actually a pure Python interface for PostgreSQL too, called bpgsql. I wouldn't recommend it over psycopg2, but it's recently become capable enough to support Django and is useful if you can't compile C modules.
Python PostgreSQL modules. Which is best? I've seen a number of postgresql modules for python like pygresql, pypgsql, psyco. Most of them are Python DB API 2.0 compliant, some are not being actively developed anymore. Which module do you recommend? Why?
TITLE: Python PostgreSQL modules. Which is best? QUESTION: I've seen a number of postgresql modules for python like pygresql, pypgsql, psyco. Most of them are Python DB API 2.0 compliant, some are not being actively developed anymore. Which module do you recommend? Why? ANSWER: psycopg2 seems to be the most popular. ...
[ "python", "postgresql", "module" ]
30
21
19,462
6
0
2008-09-27T20:55:04.730000
2008-09-27T21:00:21.393000