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
48,680
48,719
Winforms c# - Set focus to first child control of TabPage
Say I have a Textbox nested within a TabControl. When the form loads, I would like to focus on that Textbox (by default the focus is set to the TabControl ). Simply calling textbox1.focus() in the Load event of the form does not appear to work. I have been able to focus it by doing the following: private void frmMainLo...
The following is the solution: private void frmMainLoad(object sender, EventArgs e) { ActiveControl = textBox1; } The better question would however be why... I'm not entirely sure what the answer to that one is. Edit: I suspect it is something to do with the fact that both the form, and the TabControl are containers, b...
Winforms c# - Set focus to first child control of TabPage Say I have a Textbox nested within a TabControl. When the form loads, I would like to focus on that Textbox (by default the focus is set to the TabControl ). Simply calling textbox1.focus() in the Load event of the form does not appear to work. I have been able ...
TITLE: Winforms c# - Set focus to first child control of TabPage QUESTION: Say I have a Textbox nested within a TabControl. When the form loads, I would like to focus on that Textbox (by default the focus is set to the TabControl ). Simply calling textbox1.focus() in the Load event of the form does not appear to work....
[ "c#", ".net", "winforms", "focus" ]
20
47
45,442
6
0
2008-09-07T18:57:24.980000
2008-09-07T19:47:36.060000
48,688
90,648
How to save persistent objects databound to a DataLayoutControl (DevExpress tools)?
I have a small form displaying the DataLayoutControl component. If I use a GridControl the objects get saved. If I use the DataLayoutControl (which shows them individually) they do not get saved after they are changed. The underlying object is changed after the user interface edits, but doesn't get saved. How can I ena...
You should have a Session and an XPCollection on the form where the DataLayoutControl is. You should hook XPCollection with Session. You select the right class for the XPCollection and maybe add some criterial that make the XPCollection return zero records. Hook XPCollection to the DataLayoutControl. Then you should pr...
How to save persistent objects databound to a DataLayoutControl (DevExpress tools)? I have a small form displaying the DataLayoutControl component. If I use a GridControl the objects get saved. If I use the DataLayoutControl (which shows them individually) they do not get saved after they are changed. The underlying ob...
TITLE: How to save persistent objects databound to a DataLayoutControl (DevExpress tools)? QUESTION: I have a small form displaying the DataLayoutControl component. If I use a GridControl the objects get saved. If I use the DataLayoutControl (which shows them individually) they do not get saved after they are changed....
[ ".net", "devexpress", "xpo" ]
3
3
2,479
1
0
2008-09-07T19:07:50.337000
2008-09-18T07:09:42.297000
48,733
50,509
How to maintain Hibernate cache consistency running two Java applications?
Our design has one jvm that is a jboss/webapp (read/write) that is used to maintain the data via hibernate (using jpa) to the db. The model has 10-15 persistent classes with 3-5 levels of depth in the relationships. We then have a separate jvm that is the server using this data. As it is running continuously we just ha...
A Hibernate session loads all data it reads from the DB into what they call the first-level cache. Once a row is loaded from the DB, any subsequent fetches for a row with the same PK will return the data from this cache. Furthermore, Hibernate gaurentees reference equality for objects with the same PK in a single Sessi...
How to maintain Hibernate cache consistency running two Java applications? Our design has one jvm that is a jboss/webapp (read/write) that is used to maintain the data via hibernate (using jpa) to the db. The model has 10-15 persistent classes with 3-5 levels of depth in the relationships. We then have a separate jvm t...
TITLE: How to maintain Hibernate cache consistency running two Java applications? QUESTION: Our design has one jvm that is a jboss/webapp (read/write) that is used to maintain the data via hibernate (using jpa) to the db. The model has 10-15 persistent classes with 3-5 levels of depth in the relationships. We then hav...
[ "java", "hibernate", "caching" ]
10
14
12,817
4
0
2008-09-07T20:09:11.390000
2008-09-08T19:45:49.880000
48,744
48,826
Finding the phone numbers in 50,000 HTML pages
How do you find the phone numbers in 50,000 HTML pages? Jeff Attwood posted 5 Questions for programmers applying for jobs: In an effort to make life simpler for phone screeners, I've put together this list of Five Essential Questions that you need to ask during an SDE screen. They won't guarantee that your candidate wi...
egrep "(([0-9]{1,2}.)?[0-9]{3}.[0-9]{3}.[0-9]{4})". -R --include='*.html'
Finding the phone numbers in 50,000 HTML pages How do you find the phone numbers in 50,000 HTML pages? Jeff Attwood posted 5 Questions for programmers applying for jobs: In an effort to make life simpler for phone screeners, I've put together this list of Five Essential Questions that you need to ask during an SDE scre...
TITLE: Finding the phone numbers in 50,000 HTML pages QUESTION: How do you find the phone numbers in 50,000 HTML pages? Jeff Attwood posted 5 Questions for programmers applying for jobs: In an effort to make life simpler for phone screeners, I've put together this list of Five Essential Questions that you need to ask ...
[ "regex", "algorithm", "language-agnostic" ]
20
26
21,543
8
0
2008-09-07T20:18:50.633000
2008-09-07T21:53:17.523000
48,755
48,759
When should a method be static?
In addition, are there any performance advantages to static methods over instance methods? I came across the following recently: http://www.cafeaulait.org/course/week4/22.html: When should a method be static? Neither reads from nor writes to instance fields Independent of the state of the object Mathematical methods th...
Make methods static when they are not part of the instance. Don't sweat the micro-optimisations. You might find you have lots of private methods that could be static but you always call from instance methods (or each other). In that case it doesn't really matter that much. However, if you want to actually be able to te...
When should a method be static? In addition, are there any performance advantages to static methods over instance methods? I came across the following recently: http://www.cafeaulait.org/course/week4/22.html: When should a method be static? Neither reads from nor writes to instance fields Independent of the state of th...
TITLE: When should a method be static? QUESTION: In addition, are there any performance advantages to static methods over instance methods? I came across the following recently: http://www.cafeaulait.org/course/week4/22.html: When should a method be static? Neither reads from nor writes to instance fields Independent ...
[ "language-agnostic", "static" ]
35
24
17,269
8
0
2008-09-07T20:28:46.680000
2008-09-07T20:33:39.663000
48,757
48,837
Unhandled exceptions filter in a windows service
I am creating a windows service and want to know best practices for this. In all my windows Program I have a form that asks the user if he wants to report the error and if he answers yes I created a case in FogBugz. What should I do in a windows service.
You could also have a system tray representation of the service which would show a small notification about any errors and ask the user whether they want it reported or not. I think that it is still better to be able to give the user the choice whenever you are sending 'out' data from their computer.
Unhandled exceptions filter in a windows service I am creating a windows service and want to know best practices for this. In all my windows Program I have a form that asks the user if he wants to report the error and if he answers yes I created a case in FogBugz. What should I do in a windows service.
TITLE: Unhandled exceptions filter in a windows service QUESTION: I am creating a windows service and want to know best practices for this. In all my windows Program I have a form that asks the user if he wants to report the error and if he answers yes I created a case in FogBugz. What should I do in a windows service...
[ ".net", "exception", "windows-services" ]
3
1
400
2
0
2008-09-07T20:32:40.117000
2008-09-07T22:11:32.050000
48,772
48,778
How do I create a foreign key in SQL Server?
I have never "hand-coded" object creation code for SQL Server and foreign key decleration is seemingly different between SQL Server and Postgres. Here is my sql so far: drop table exams; drop table question_bank; drop table anwser_bank; create table exams ( exam_id uniqueidentifier primary key, exam_name varchar(50), ...
create table question_bank ( question_id uniqueidentifier primary key, question_exam_id uniqueidentifier not null, question_text varchar(1024) not null, question_point_value decimal, constraint fk_questionbank_exams foreign key (question_exam_id) references exams (exam_id) );
How do I create a foreign key in SQL Server? I have never "hand-coded" object creation code for SQL Server and foreign key decleration is seemingly different between SQL Server and Postgres. Here is my sql so far: drop table exams; drop table question_bank; drop table anwser_bank; create table exams ( exam_id uniqueid...
TITLE: How do I create a foreign key in SQL Server? QUESTION: I have never "hand-coded" object creation code for SQL Server and foreign key decleration is seemingly different between SQL Server and Postgres. Here is my sql so far: drop table exams; drop table question_bank; drop table anwser_bank; create table exams ...
[ "sql", "sql-server", "t-sql" ]
262
209
480,970
11
0
2008-09-07T20:49:56.440000
2008-09-07T20:57:59.120000
48,773
48,792
Adding extra information to a custom exception
I've created a custom exception for a very specific problem that can go wrong. I receive data from another system, and I raise the exception if it bombs while trying to parse that data. In my custom exception, I added a field called "ResponseData", so I can track exactly what my code couldn't handle. In custom exceptio...
You shouldn't fill.Message with debug information, but rather with a concise, helpful piece of text. http://msdn.microsoft.com/en-us/library/system.exception.message.aspx The text of Message should completely describe the error and should, when possible, explain how to correct it. The value of the Message property is i...
Adding extra information to a custom exception I've created a custom exception for a very specific problem that can go wrong. I receive data from another system, and I raise the exception if it bombs while trying to parse that data. In my custom exception, I added a field called "ResponseData", so I can track exactly w...
TITLE: Adding extra information to a custom exception QUESTION: I've created a custom exception for a very specific problem that can go wrong. I receive data from another system, and I raise the exception if it bombs while trying to parse that data. In my custom exception, I added a field called "ResponseData", so I c...
[ "c#", ".net", "exception", "elmah" ]
13
7
11,840
6
0
2008-09-07T20:50:00.717000
2008-09-07T21:14:13.967000
48,774
64,106
Boolean Expressions in Shell Scripts
What's the "right" way to do the following as a boolean expression? for i in `ls $1/resources`; do if [ $i!= "database.db" ] then if [ $i!= "tiles" ] then if [ $i!= "map.pdf" ] then if [ $i!= "map.png" ] then svn export -q $1/resources/$i../MyProject/Resources/$i...
The other solutions have a couple of common mistakes: http://www.pixelbeat.org/programming/shell_script_mistakes.html for i in $(ls...) is redundant/problematic just do: for i in $1/resources*; do... [ $i!= file1 -a $1!= file2 ] This actually has 2 problems. a. The $i is not quoted, hence names with spaces will cause i...
Boolean Expressions in Shell Scripts What's the "right" way to do the following as a boolean expression? for i in `ls $1/resources`; do if [ $i!= "database.db" ] then if [ $i!= "tiles" ] then if [ $i!= "map.pdf" ] then if [ $i!= "map.png" ] then svn export -q $1/resources/$i../MyProject/Resources/$i...
TITLE: Boolean Expressions in Shell Scripts QUESTION: What's the "right" way to do the following as a boolean expression? for i in `ls $1/resources`; do if [ $i!= "database.db" ] then if [ $i!= "tiles" ] then if [ $i!= "map.pdf" ] then if [ $i!= "map.png" ] then svn export -q $1/resources/$i../MyProject/Resources/$i.....
[ "bash", "shell", "expression" ]
11
11
19,537
5
0
2008-09-07T20:51:35.470000
2008-09-15T15:47:04.653000
48,777
48,806
Python: No module named core.exceptions
I'm trying to get Google AppEngine to work on my Debian box and am getting the following error when I try to access my page:: No module named core.exceptions The same app works fine for me when I run it on my other Ubuntu box, so I know it's not a problem with the app itself. However, I need to get it working on this D...
core.exceptions is part of django; what version of django do you have installed? The AppEngine comes with the appropriate version for whatever release you've downloaded (in the lib/django directory). It can be installed by going to that directory and running python setup.py install
Python: No module named core.exceptions I'm trying to get Google AppEngine to work on my Debian box and am getting the following error when I try to access my page:: No module named core.exceptions The same app works fine for me when I run it on my other Ubuntu box, so I know it's not a problem with the app itself. How...
TITLE: Python: No module named core.exceptions QUESTION: I'm trying to get Google AppEngine to work on my Debian box and am getting the following error when I try to access my page:: No module named core.exceptions The same app works fine for me when I run it on my other Ubuntu box, so I know it's not a problem with t...
[ "python", "google-app-engine" ]
6
6
2,740
1
0
2008-09-07T20:57:16.923000
2008-09-07T21:28:54.350000
48,782
60,327
TinyMCE vs Xinha
I have to choose an online WYSIWYG editor. I'm pending between TinyMCE and Xinha. My application is developed in Asp.Net 3.5. Could you help me with with some pros and cons?
Haven't tried Xihna myself, but I have experience with TinyMCE and FCKeditor. In my company we switched to TinyMce (from FCKeditor) due to the superior support for pasting from word documents and the (relatively easy to work with) plugin architecture which we used to add some custom modules (links browser, simple file ...
TinyMCE vs Xinha I have to choose an online WYSIWYG editor. I'm pending between TinyMCE and Xinha. My application is developed in Asp.Net 3.5. Could you help me with with some pros and cons?
TITLE: TinyMCE vs Xinha QUESTION: I have to choose an online WYSIWYG editor. I'm pending between TinyMCE and Xinha. My application is developed in Asp.Net 3.5. Could you help me with with some pros and cons? ANSWER: Haven't tried Xihna myself, but I have experience with TinyMCE and FCKeditor. In my company we switche...
[ "html", "editor", "tinymce", "wysiwyg" ]
4
5
5,033
7
0
2008-09-07T21:00:06.153000
2008-09-13T04:23:22.987000
48,805
48,809
How do you access browser history?
Some e-Marketing tools claim to choose which web page to display based on where you were before. That is, if you've been browsing truck sites and then go to Ford.com, your first page would be of the Ford Explorer. I know you can get the immediate preceding page with HTTP_REFERRER, but how do you know where they were 6 ...
Javascript this should get you started: http://www.dicabrio.com/javascript/steal-history.php There are more nefarius means to: http://ha.ckers.org/blog/20070228/steal-browser-history-without-javascript/ Edit:I wanted to add that although this works it is a sleazy marketing teqnique and an invasion of privacy.
How do you access browser history? Some e-Marketing tools claim to choose which web page to display based on where you were before. That is, if you've been browsing truck sites and then go to Ford.com, your first page would be of the Ford Explorer. I know you can get the immediate preceding page with HTTP_REFERRER, but...
TITLE: How do you access browser history? QUESTION: Some e-Marketing tools claim to choose which web page to display based on where you were before. That is, if you've been browsing truck sites and then go to Ford.com, your first page would be of the Ford Explorer. I know you can get the immediate preceding page with ...
[ "browser-history" ]
28
27
40,505
4
0
2008-09-07T21:26:29.693000
2008-09-07T21:34:59.047000
48,844
48,976
Is the Mono Developer Support from Novell worth it?
My company are thinking about using Mono for an upcoming product, so we were thinking about the $12,995 Mono Kickstart support from Novell. Anybody here used it, is it worth it?
if i were you i'd probably start the project and then only if i needed support for mono buy the product. that way if you dont need it you wont be wasting the $13k.
Is the Mono Developer Support from Novell worth it? My company are thinking about using Mono for an upcoming product, so we were thinking about the $12,995 Mono Kickstart support from Novell. Anybody here used it, is it worth it?
TITLE: Is the Mono Developer Support from Novell worth it? QUESTION: My company are thinking about using Mono for an upcoming product, so we were thinking about the $12,995 Mono Kickstart support from Novell. Anybody here used it, is it worth it? ANSWER: if i were you i'd probably start the project and then only if i...
[ "mono" ]
4
4
332
1
0
2008-09-07T22:24:27.027000
2008-09-08T01:33:01.067000
48,864
48,917
What is this Icarus thing that comes with MbUnit?
I've had to install MbUnit multiple times now and it keeps coming with something called the Gallilo Icarus GUI Test Runner I have tried using it thinking it was just an update to the MbUnit GUI but it won't detect my MbUnit tests and sometimes won't even open the assemblies properly. Perhaps I'm just overlooking it but...
According to a blog entry MbUnit v3 and Gallio alpha 1, So whats going on here, Gallio is a neutral test platform that is an off shoot from the work we had done on MbUnit v3. Gallio is both a common framework and a set of runners for testing tools. MbUnit v3 uses Gallio as its native test platform, Gallio can also as J...
What is this Icarus thing that comes with MbUnit? I've had to install MbUnit multiple times now and it keeps coming with something called the Gallilo Icarus GUI Test Runner I have tried using it thinking it was just an update to the MbUnit GUI but it won't detect my MbUnit tests and sometimes won't even open the assemb...
TITLE: What is this Icarus thing that comes with MbUnit? QUESTION: I've had to install MbUnit multiple times now and it keeps coming with something called the Gallilo Icarus GUI Test Runner I have tried using it thinking it was just an update to the MbUnit GUI but it won't detect my MbUnit tests and sometimes won't ev...
[ "unit-testing", "testing", "tdd", "automated-tests", "mbunit" ]
1
2
1,039
1
0
2008-09-07T22:51:42.420000
2008-09-08T00:10:38.097000
48,872
48,879
Why/when should you use nested classes in .net? Or shouldn't you?
In Kathleen Dollard's 2008 blog post, she presents an interesting reason to use nested classes in.net. However, she also mentions that FxCop doesn't like nested classes. I'm assuming that the people writing FxCop rules aren't stupid, so there must be reasoning behind that position, but I haven't been able to find it.
Use a nested class when the class you are nesting is only useful to the enclosing class. For instance, nested classes allow you to write something like (simplified): public class SortedMap { private class TreeNode { TreeNode left; TreeNode right; } } You can make a complete definition of your class in one place, you do...
Why/when should you use nested classes in .net? Or shouldn't you? In Kathleen Dollard's 2008 blog post, she presents an interesting reason to use nested classes in.net. However, she also mentions that FxCop doesn't like nested classes. I'm assuming that the people writing FxCop rules aren't stupid, so there must be rea...
TITLE: Why/when should you use nested classes in .net? Or shouldn't you? QUESTION: In Kathleen Dollard's 2008 blog post, she presents an interesting reason to use nested classes in.net. However, she also mentions that FxCop doesn't like nested classes. I'm assuming that the people writing FxCop rules aren't stupid, so...
[ ".net", "class", "nested", "fxcop" ]
106
110
54,035
14
0
2008-09-07T23:01:20.073000
2008-09-07T23:12:43.133000
48,877
48,900
Choosing between Ajax, Flex and Silverlight
Ajax, Flex and Silverlight are a few ways to make more interactive web applications. What kinds of factors would you consider when deciding which to use for a new web application? Does any one of them offer better cross-platform compatibility, performance, developer tools or community support?
Here's a quick rundown of each area (with lots of helpful links): Cross-platform compatibility Ajax works in any modern browser that can run JavaScript. Flex requires Flash or anything else that can handle SWF s but, once that's installed, it's a total freeride as far as compatibility. Silverlight is tricky and misunde...
Choosing between Ajax, Flex and Silverlight Ajax, Flex and Silverlight are a few ways to make more interactive web applications. What kinds of factors would you consider when deciding which to use for a new web application? Does any one of them offer better cross-platform compatibility, performance, developer tools or ...
TITLE: Choosing between Ajax, Flex and Silverlight QUESTION: Ajax, Flex and Silverlight are a few ways to make more interactive web applications. What kinds of factors would you consider when deciding which to use for a new web application? Does any one of them offer better cross-platform compatibility, performance, d...
[ "ajax", "silverlight", "apache-flex" ]
11
13
1,534
5
0
2008-09-07T23:09:31.160000
2008-09-07T23:38:25.117000
48,905
125,852
Fundeps and GADTs: When is type checking decidable?
I was reading a research paper about Haskell and how HList is implemented and wondering when the techniques described are and are not decidable for the type checker. Also, because you can do similar things with GADTs, I was wondering if GADT type checking is always decidable. I would prefer citations if you have them s...
I believe GADT type checking is always decidable; it's inference which is undecidable, as it requires higher order unification. But a GADT type checker is a restricted form of the proof checkers you see in eg. Coq, where the constructors build up the proof term. For example, the classic example of embedding lambda calc...
Fundeps and GADTs: When is type checking decidable? I was reading a research paper about Haskell and how HList is implemented and wondering when the techniques described are and are not decidable for the type checker. Also, because you can do similar things with GADTs, I was wondering if GADT type checking is always de...
TITLE: Fundeps and GADTs: When is type checking decidable? QUESTION: I was reading a research paper about Haskell and how HList is implemented and wondering when the techniques described are and are not decidable for the type checker. Also, because you can do similar things with GADTs, I was wondering if GADT type che...
[ "haskell", "type-inference", "type-systems", "gadt" ]
16
9
1,234
2
0
2008-09-07T23:46:50.963000
2008-09-24T07:35:45.513000
48,908
48,929
How Do Sockets Work in C?
I am a bit confused about socket programming in C. You create a socket, bind it to an interface and an IP address and get it to listen. I found a couple of web resources on that, and understood it fine. In particular, I found an article Network programming under Unix systems to be very informative. What confuses me is ...
Short answer is that you have to do all the heavy lifting yourself. You can be notified that there is data available to be read, but you won't know how many bytes are available. In most IP protocols that use variable length packets, there will be a header with a known fixed length prepended to the packet. This header w...
How Do Sockets Work in C? I am a bit confused about socket programming in C. You create a socket, bind it to an interface and an IP address and get it to listen. I found a couple of web resources on that, and understood it fine. In particular, I found an article Network programming under Unix systems to be very informa...
TITLE: How Do Sockets Work in C? QUESTION: I am a bit confused about socket programming in C. You create a socket, bind it to an interface and an IP address and get it to listen. I found a couple of web resources on that, and understood it fine. In particular, I found an article Network programming under Unix systems ...
[ "c", "sockets", "network-programming" ]
21
17
7,338
4
0
2008-09-08T00:00:32.020000
2008-09-08T00:27:17.370000
48,916
48,971
Multi-threaded splash screen in C#?
I want a splash screen to show while the application is loading. I have a form with a system tray control tied to it. I want the splash screen to display while this form loads, which takes a bit of time since it's accessing a web service API to populate some drop-downs. I also want to do some basic testing for dependen...
Well, for a ClickOnce app that I deployed in the past, we used the Microsoft.VisualBasic namespace to handle the splash screen threading. You can reference and use the Microsoft.VisualBasic assembly from C# in.NET 2.0 and it provides a lot of nice services. Have the main form inherit from Microsoft.VisualBasic.WindowsF...
Multi-threaded splash screen in C#? I want a splash screen to show while the application is loading. I have a form with a system tray control tied to it. I want the splash screen to display while this form loads, which takes a bit of time since it's accessing a web service API to populate some drop-downs. I also want t...
TITLE: Multi-threaded splash screen in C#? QUESTION: I want a splash screen to show while the application is loading. I have a form with a system tray control tied to it. I want the splash screen to display while this form loads, which takes a bit of time since it's accessing a web service API to populate some drop-do...
[ "c#", ".net", "winforms", "multithreading", "splash-screen" ]
62
46
45,815
12
0
2008-09-08T00:10:07.490000
2008-09-08T01:28:03.933000
48,931
49,434
How to read bound hover callback functions in jQuery
I used jQuery to set hover callbacks for elements on my page. I'm now writing a module which needs to temporarily set new hover behaviour for some elements. The new module has no access to the original code for the hover functions. I want to store the old hover functions before I set new ones so I can restore them when...
Calling an event bind method (such as hover ) does not delete old event handlers, only adds your new events, so your idea of 'restoring' the old event functions wouldn't work, as it wouldn't delete your events. You can add your own events, and then remove them without affecting any other events then use Event namespaci...
How to read bound hover callback functions in jQuery I used jQuery to set hover callbacks for elements on my page. I'm now writing a module which needs to temporarily set new hover behaviour for some elements. The new module has no access to the original code for the hover functions. I want to store the old hover funct...
TITLE: How to read bound hover callback functions in jQuery QUESTION: I used jQuery to set hover callbacks for elements on my page. I'm now writing a module which needs to temporarily set new hover behaviour for some elements. The new module has no access to the original code for the hover functions. I want to store t...
[ "javascript", "jquery", "callback" ]
5
4
6,144
4
0
2008-09-08T00:29:58.330000
2008-09-08T10:35:30.263000
48,933
48,952
How do I list loaded plugins in Vim?
Does anybody know of a way to list up the "loaded plugins" in Vim? I know I should be keeping track of this kind of stuff myself but it would always be nice to be able to check the current status.
Not a VIM user myself, so forgive me if this is totally offbase. But according to what I gather from the following VIM Tips site: " where was an option set:scriptnames: list all plugins, _vimrcs loaded (super):verbose set history?: reveals value of history and where set:function: list functions:func SearchCompl: List p...
How do I list loaded plugins in Vim? Does anybody know of a way to list up the "loaded plugins" in Vim? I know I should be keeping track of this kind of stuff myself but it would always be nice to be able to check the current status.
TITLE: How do I list loaded plugins in Vim? QUESTION: Does anybody know of a way to list up the "loaded plugins" in Vim? I know I should be keeping track of this kind of stuff myself but it would always be nice to be able to check the current status. ANSWER: Not a VIM user myself, so forgive me if this is totally off...
[ "vim", "plugins" ]
336
417
151,142
6
0
2008-09-08T00:32:56.030000
2008-09-08T01:02:10.017000
48,934
48,938
In Delphi 7, why can I assign a value to a const?
I copied some Delphi code from one project to another, and found that it doesn't compile in the new project, though it did in the old one. The code looks something like this: procedure TForm1.CalculateGP(..) const Price: money = 0; begin... Price:= 1.0;... end; So in the new project, Delphi complains that "left side ca...
You need to turn assignable typed constants on. Project -> Options -> Compiler -> Assignable typed Constants Also you can add {$J+} or {$WRITEABLECONST ON} to the pas file, which is probably better, since it'll work even if you move the file to another project.
In Delphi 7, why can I assign a value to a const? I copied some Delphi code from one project to another, and found that it doesn't compile in the new project, though it did in the old one. The code looks something like this: procedure TForm1.CalculateGP(..) const Price: money = 0; begin... Price:= 1.0;... end; So in th...
TITLE: In Delphi 7, why can I assign a value to a const? QUESTION: I copied some Delphi code from one project to another, and found that it doesn't compile in the new project, though it did in the old one. The code looks something like this: procedure TForm1.CalculateGP(..) const Price: money = 0; begin... Price:= 1.0...
[ "delphi", "constants" ]
21
30
8,728
4
0
2008-09-08T00:34:45.560000
2008-09-08T00:46:42.083000
48,935
49,171
How can I register a global hot key to say CTRL+SHIFT+(LETTER) using WPF and .NET 3.5?
I'm building an application in C# using WPF. How can I bind to some keys? Also, how can I bind to the Windows key?
I'm not sure of what you mean by "global" here, but here it goes (I'm assuming you mean a command at the application level, for example, Save All that can be triggered from anywhere by Ctrl + Shift + S.) You find the global UIElement of your choice, for example, the top level window which is the parent of all the contr...
How can I register a global hot key to say CTRL+SHIFT+(LETTER) using WPF and .NET 3.5? I'm building an application in C# using WPF. How can I bind to some keys? Also, how can I bind to the Windows key?
TITLE: How can I register a global hot key to say CTRL+SHIFT+(LETTER) using WPF and .NET 3.5? QUESTION: I'm building an application in C# using WPF. How can I bind to some keys? Also, how can I bind to the Windows key? ANSWER: I'm not sure of what you mean by "global" here, but here it goes (I'm assuming you mean a c...
[ "c#", ".net", "wpf", "windows", "hotkeys" ]
53
28
73,324
11
0
2008-09-08T00:35:47.477000
2008-09-08T04:36:33.417000
48,947
50,596
How do I implement a callback in PHP?
How are callbacks written in PHP?
The manual uses the terms "callback" and "callable" interchangeably, however, "callback" traditionally refers to a string or array value that acts like a function pointer, referencing a function or class method for future invocation. This has allowed some elements of functional programming since PHP 4. The flavors are:...
How do I implement a callback in PHP? How are callbacks written in PHP?
TITLE: How do I implement a callback in PHP? QUESTION: How are callbacks written in PHP? ANSWER: The manual uses the terms "callback" and "callable" interchangeably, however, "callback" traditionally refers to a string or array value that acts like a function pointer, referencing a function or class method for future...
[ "php" ]
192
177
137,008
9
0
2008-09-08T00:53:34.360000
2008-09-08T20:29:04.563000
48,984
49,136
Is there a way to make WatiN click a link before the page finishes loading
We're using WatiN for testing our UI, but one page (which is unfortunately not under our teams control) takes forever to finish loading. Is there a way to get WatiN to click a link on the page before the page finishes rendering completely?
Here's the code we found to work: IE browser = new IE(....); browser.Button("SlowPageLoadingButton").ClickNoWait(); Link continueLink = browser.Link(Find.ByText("linktext")); continueLink.WaitUntilExists(); continueLink.Click();
Is there a way to make WatiN click a link before the page finishes loading We're using WatiN for testing our UI, but one page (which is unfortunately not under our teams control) takes forever to finish loading. Is there a way to get WatiN to click a link on the page before the page finishes rendering completely?
TITLE: Is there a way to make WatiN click a link before the page finishes loading QUESTION: We're using WatiN for testing our UI, but one page (which is unfortunately not under our teams control) takes forever to finish loading. Is there a way to get WatiN to click a link on the page before the page finishes rendering...
[ "unit-testing", "automated-tests", "watin" ]
6
11
4,892
2
0
2008-09-08T01:42:20.577000
2008-09-08T03:53:36.843000
48,993
49,454
Linking combo box (JQuery preferrably)
I am wondering if anyone has any experience using a JQuery plugin that converts a html Blah combo box into something (probably a div) where selecting an item acts the same as clicking a link. I guess you could probably use javascript to handle a selection event (my javascript knowledge is a little in disrepair at the m...
The simple solution is to use $("#mySelect").change(function() { document.location = this.value; }); This creates an onchange event on the select box that redirects you to the url stored in the value field of the selected option.
Linking combo box (JQuery preferrably) I am wondering if anyone has any experience using a JQuery plugin that converts a html Blah combo box into something (probably a div) where selecting an item acts the same as clicking a link. I guess you could probably use javascript to handle a selection event (my javascript know...
TITLE: Linking combo box (JQuery preferrably) QUESTION: I am wondering if anyone has any experience using a JQuery plugin that converts a html Blah combo box into something (probably a div) where selecting an item acts the same as clicking a link. I guess you could probably use javascript to handle a selection event (...
[ "javascript", "jquery", "html", "drop-down-menu" ]
5
8
13,785
4
0
2008-09-08T01:51:01.100000
2008-09-08T10:53:42.327000
49,011
49,233
REST how to handle query parameters when put to resource?
I have a REST data service where I want to allow the users to create new items with HTTP PUT using different formats like json,xml,csv. I'm unsure how to best handle the format specification in the url: PUT /ressource/ID/json PUT /ressource/ID/xml or PUT /ressource/ID?format=json PUT /ressource/ID?format=xml So what is...
A general principle of RESTful web services is to use the features built-in to HTTP, when applicable. In this case, you can indicate the format of your PUT request's content by setting the Content-Type header to application/json or application/xml.
REST how to handle query parameters when put to resource? I have a REST data service where I want to allow the users to create new items with HTTP PUT using different formats like json,xml,csv. I'm unsure how to best handle the format specification in the url: PUT /ressource/ID/json PUT /ressource/ID/xml or PUT /ressou...
TITLE: REST how to handle query parameters when put to resource? QUESTION: I have a REST data service where I want to allow the users to create new items with HTTP PUT using different formats like json,xml,csv. I'm unsure how to best handle the format specification in the url: PUT /ressource/ID/json PUT /ressource/ID/...
[ "html", "rest" ]
4
15
7,176
1
0
2008-09-08T02:08:07.253000
2008-09-08T06:24:48.353000
49,035
49,056
What does the const operator mean when used with a method in C++?
Given a declaration like this: class A { public: void Foo() const; }; What does it mean? Google turns up this: Member functions should be declared with the const keyword after them if they can operate on a const (this) object. If the function is not declared const, in can not be applied to a const object, and the compi...
Consider a variation of your class A. class A { public: void Foo() const; void Moo(); private: int m_nState; // Could add mutable keyword if desired int GetState() const { return m_nState; } void SetState(int val) { m_nState = val; } }; const A *A1 = new A(); A *A2 = new A(); A1->Foo(); // OK A2->Foo(); // OK A1->M...
What does the const operator mean when used with a method in C++? Given a declaration like this: class A { public: void Foo() const; }; What does it mean? Google turns up this: Member functions should be declared with the const keyword after them if they can operate on a const (this) object. If the function is not decl...
TITLE: What does the const operator mean when used with a method in C++? QUESTION: Given a declaration like this: class A { public: void Foo() const; }; What does it mean? Google turns up this: Member functions should be declared with the const keyword after them if they can operate on a const (this) object. If the fu...
[ "c++" ]
8
12
5,338
7
0
2008-09-08T02:20:19.847000
2008-09-08T02:37:08.667000
49,046
49,055
Different sizeof results
Why does n not equal to 8 in the following function? void foo(char cvalue[8]) { int n = sizeof (cvalue); } But n does equal to 8 in this version of the function: void bar() { char cvalue[8]; int n = sizeof (cvalue); }
Because you can't pass entire arrays as function parameters in C. You're actually passing a pointer to it; the brackets are syntactic sugar. There are no guarantees the array you're pointing to has size 8, since you could pass this function any character pointer you want. // These all do the same thing void foo(char cv...
Different sizeof results Why does n not equal to 8 in the following function? void foo(char cvalue[8]) { int n = sizeof (cvalue); } But n does equal to 8 in this version of the function: void bar() { char cvalue[8]; int n = sizeof (cvalue); }
TITLE: Different sizeof results QUESTION: Why does n not equal to 8 in the following function? void foo(char cvalue[8]) { int n = sizeof (cvalue); } But n does equal to 8 in this version of the function: void bar() { char cvalue[8]; int n = sizeof (cvalue); } ANSWER: Because you can't pass entire arrays as function p...
[ "c++", "c", "sizeof" ]
17
48
1,181
4
0
2008-09-08T02:31:38.553000
2008-09-08T02:35:55.923000
49,066
49,766
Renaming the containing project folder in VS.net under TFS
I have a vs.net project, and after some refactoring, have modified the name of the project. How can I easily rename the underlying windows folder name to match this new project name under a TFS controlled project and solution? Note, I used to be able to do by fiddling with things in the background using SourceSafe...
Just right click on the folder in TFS, and select Rename. Once you commit the rename, TFS will make the changes on disk for you. As Kevin pointed out, you will want to make sure that everything is checked in, because TFS will remove the old folder and everything in it, and pull down the renamed folder with the current ...
Renaming the containing project folder in VS.net under TFS I have a vs.net project, and after some refactoring, have modified the name of the project. How can I easily rename the underlying windows folder name to match this new project name under a TFS controlled project and solution? Note, I used to be able to do by f...
TITLE: Renaming the containing project folder in VS.net under TFS QUESTION: I have a vs.net project, and after some refactoring, have modified the name of the project. How can I easily rename the underlying windows folder name to match this new project name under a TFS controlled project and solution? Note, I used to ...
[ "visual-studio-2008", "visual-studio-2005", "tfs", "directory" ]
68
20
46,273
6
0
2008-09-08T02:45:54.887000
2008-09-08T14:06:23.767000
49,089
49,163
Where WCF and ADO.Net Data services stand?
I am bit confused about ADO.Net Data Services. Is it just meant for creating RESTful web services? I know WCF started in the SOAP world but now I hear it has good support for REST. Same goes for ADO.Net data services where you can make it work in an RPC model if you cannot look at everything from a resource oriented vi...
In my view ADO.Net data services is for creating restful services that are closely aligned with your domain model, that is the models themselves are published rather then say some form of DTO etc. Using it for RPC style services seems like a bad fit, though unfortunately even some very basic features like being able to...
Where WCF and ADO.Net Data services stand? I am bit confused about ADO.Net Data Services. Is it just meant for creating RESTful web services? I know WCF started in the SOAP world but now I hear it has good support for REST. Same goes for ADO.Net data services where you can make it work in an RPC model if you cannot loo...
TITLE: Where WCF and ADO.Net Data services stand? QUESTION: I am bit confused about ADO.Net Data Services. Is it just meant for creating RESTful web services? I know WCF started in the SOAP world but now I hear it has good support for REST. Same goes for ADO.Net data services where you can make it work in an RPC model...
[ "wcf", "web-services", "ado.net", "rest" ]
5
2
2,220
3
0
2008-09-08T02:59:53.633000
2008-09-08T04:21:09.167000
49,098
49,130
Can cout alter variables somehow?
So I have a function that looks something like this: float function(){ float x = SomeValue; return x / SomeOtherValue; } At some point, this function overflows and returns a really large negative value. To try and track down exactly where this was happening, I added a cout statement so that the function looked like thi...
Welcome to the wonderful world of floating point. The answer you get will likely depend on the floating point model you compiled the code with. This happens because of the difference between the IEEE spec and the hardware the code is running on. Your CPU likely has 80 bit floating point registers that get use to hold t...
Can cout alter variables somehow? So I have a function that looks something like this: float function(){ float x = SomeValue; return x / SomeOtherValue; } At some point, this function overflows and returns a really large negative value. To try and track down exactly where this was happening, I added a cout statement so...
TITLE: Can cout alter variables somehow? QUESTION: So I have a function that looks something like this: float function(){ float x = SomeValue; return x / SomeOtherValue; } At some point, this function overflows and returns a really large negative value. To try and track down exactly where this was happening, I added a...
[ "c++", "floating-point", "cout", "cpu-registers", "floating-point-precision" ]
9
18
2,451
5
0
2008-09-08T03:02:27.683000
2008-09-08T03:43:10.770000
49,107
50,755
What's the cleanest way to simulate pass-by-reference in Actionscript 3.0?
Actionscript 3.0 (and I assume Javascript and ECMAScript in general) lacks pass-by-reference for native types like ints. As a result I'm finding getting values back from a function really clunky. What's the normal pattern to work around this? For example, is there a clean way to implement swap( intA, intB ) in Actionsc...
I Believe the best you can do is pass a container object as an argument to a function and change the values of some properties in that object: function swapAB(aValuesContainer:Object):void { if (!(aValuesContainer.hasOwnProperty("a") && aValuesContainer.hasOwnProperty("b"))) throw new ArgumentError("aValuesContainer mu...
What's the cleanest way to simulate pass-by-reference in Actionscript 3.0? Actionscript 3.0 (and I assume Javascript and ECMAScript in general) lacks pass-by-reference for native types like ints. As a result I'm finding getting values back from a function really clunky. What's the normal pattern to work around this? Fo...
TITLE: What's the cleanest way to simulate pass-by-reference in Actionscript 3.0? QUESTION: Actionscript 3.0 (and I assume Javascript and ECMAScript in general) lacks pass-by-reference for native types like ints. As a result I'm finding getting values back from a function really clunky. What's the normal pattern to wo...
[ "actionscript-3" ]
13
7
10,833
8
0
2008-09-08T03:07:35.630000
2008-09-08T21:38:45.817000
49,134
49,142
What's the best .NET library for OpenID and ASP.NET MVC?
I'm looking at using OpenID for my authentication scheme and wanted to know what the best.NET library is to use for MVC specific applications? thx
.Net OpenID project is the best library to use right now that I know of. I think SO used it also. The source includes a sample ASP.NET MVC project using the library. Scott Hanselman did a post on how to use the.Net OpenID project inside of ASP.NET MVC.
What's the best .NET library for OpenID and ASP.NET MVC? I'm looking at using OpenID for my authentication scheme and wanted to know what the best.NET library is to use for MVC specific applications? thx
TITLE: What's the best .NET library for OpenID and ASP.NET MVC? QUESTION: I'm looking at using OpenID for my authentication scheme and wanted to know what the best.NET library is to use for MVC specific applications? thx ANSWER: .Net OpenID project is the best library to use right now that I know of. I think SO used ...
[ ".net", "asp.net-mvc", "authentication", "openid" ]
30
18
2,508
4
0
2008-09-08T03:50:23.153000
2008-09-08T03:57:04.933000
49,137
49,148
Calling python from a c++ program for distribution
I would like to call python script files from my c++ program. I am not sure that the people I will distribute to will have python installed.
Boost has a python interface library which could help you. Boost.Python
Calling python from a c++ program for distribution I would like to call python script files from my c++ program. I am not sure that the people I will distribute to will have python installed.
TITLE: Calling python from a c++ program for distribution QUESTION: I would like to call python script files from my c++ program. I am not sure that the people I will distribute to will have python installed. ANSWER: Boost has a python interface library which could help you. Boost.Python
[ "c++", "python", "embedded-language" ]
69
39
126,917
7
0
2008-09-08T03:53:39.560000
2008-09-08T04:01:10.447000
49,138
49,182
Storing MD5 Hash in SQL Server
In SQL Server would a varbinary(16) be the most efficient way of storing an MD5 hash? Won't be doing anything with it except returning it in a linq query.
Based on the documentation on MSDN and my experience, binary is better, since the md5 hash does not vary in size. The size for a binary data type is n bytes, so the size of the data. The size of a varbinary data type is n bytes + 2 bytes on top of the size of the data.
Storing MD5 Hash in SQL Server In SQL Server would a varbinary(16) be the most efficient way of storing an MD5 hash? Won't be doing anything with it except returning it in a linq query.
TITLE: Storing MD5 Hash in SQL Server QUESTION: In SQL Server would a varbinary(16) be the most efficient way of storing an MD5 hash? Won't be doing anything with it except returning it in a linq query. ANSWER: Based on the documentation on MSDN and my experience, binary is better, since the md5 hash does not vary in...
[ "sql-server", "md5" ]
13
16
10,698
2
0
2008-09-08T03:54:15.440000
2008-09-08T04:56:17.287000
49,146
49,155
How can I make an EXE file from a Python program?
I've used several modules to make EXEs for Python, but I'm not sure if I'm doing it right. How should I go about this, and why? Please base your answers on personal experience, and provide references where necessary.
Auto PY to EXE - A.py to.exe converter using a simple graphical interface built using Eel and PyInstaller in Python. py2exe is probably what you want, but it only works on Windows. PyInstaller works on Windows and Linux. Py2app works on the Mac.
How can I make an EXE file from a Python program? I've used several modules to make EXEs for Python, but I'm not sure if I'm doing it right. How should I go about this, and why? Please base your answers on personal experience, and provide references where necessary.
TITLE: How can I make an EXE file from a Python program? QUESTION: I've used several modules to make EXEs for Python, but I'm not sure if I'm doing it right. How should I go about this, and why? Please base your answers on personal experience, and provide references where necessary. ANSWER: Auto PY to EXE - A.py to.e...
[ "python", "exe", "executable" ]
117
98
307,511
7
0
2008-09-08T03:59:57.937000
2008-09-08T04:10:45.947000
49,147
49,153
How do I create a MessageBox in C#?
I have just installed C# for the first time, and at first glance it appears to be very similar to VB6. I decided to start off by trying to make a 'Hello, World!' UI Edition. I started in the Form Designer and made a button named "Click Me!" proceeded to double-click it and typed in MessageBox("Hello, World!"); I receiv...
MessageBox.Show also returns a DialogResult, which if you put some buttons on there, means you can have it returned what the user clicked. Most of the time I write something like if (MessageBox.Show("Do you want to continue?", "Question", MessageBoxButtons.YesNo) == MessageBoxResult.Yes) { //some interesting behaviour ...
How do I create a MessageBox in C#? I have just installed C# for the first time, and at first glance it appears to be very similar to VB6. I decided to start off by trying to make a 'Hello, World!' UI Edition. I started in the Form Designer and made a button named "Click Me!" proceeded to double-click it and typed in M...
TITLE: How do I create a MessageBox in C#? QUESTION: I have just installed C# for the first time, and at first glance it appears to be very similar to VB6. I decided to start off by trying to make a 'Hello, World!' UI Edition. I started in the Form Designer and made a button named "Click Me!" proceeded to double-click...
[ "c#", ".net" ]
23
49
131,883
8
0
2008-09-08T04:00:54.860000
2008-09-08T04:08:48.633000
49,156
49,205
Importing JavaScript in JSP tags
I have a.tag file that requires a JavaScript library (as in a.js file). Currently I am just remembering to import the.js file in every JSP that uses the tag but this is a bit cumbersome and prone to error. Is there a way to do the importing of the.js inside the JSP tag? (for caching reasons I would want the.js to be a ...
There is no reason you cannot have a script tag in the body, even though it is preferable for it to be in the head. Just emit the script tag before you emit your tag's markup. The only thing to consider is that you do not want to include the script more than once if you use the jsp tag on the page more than once. The w...
Importing JavaScript in JSP tags I have a.tag file that requires a JavaScript library (as in a.js file). Currently I am just remembering to import the.js file in every JSP that uses the tag but this is a bit cumbersome and prone to error. Is there a way to do the importing of the.js inside the JSP tag? (for caching rea...
TITLE: Importing JavaScript in JSP tags QUESTION: I have a.tag file that requires a JavaScript library (as in a.js file). Currently I am just remembering to import the.js file in every JSP that uses the tag but this is a bit cumbersome and prone to error. Is there a way to do the importing of the.js inside the JSP tag...
[ "javascript", "java", "jsp", "jsp-tags" ]
8
6
3,748
2
0
2008-09-08T04:11:21.467000
2008-09-08T05:37:56.483000
49,158
55,744
GreaseMonkey script to auto login using HTTP authentication
I've got quite a few GreaseMonkey scripts that I wrote at my work which automatically log me into the internal sites we have here. I've managed to write a script for nearly each one of these sites except for our time sheet application, which uses HTTP authentication. Is there a way I can use GreaseMonkey to log me into...
It is possible to log in using HTTP authentication by setting the "Authorization" HTTP header, with the value of this header set to the string "basic username:password", but with the "username:password" portion of the string Base 64 encoded. http://frontier.userland.com/stories/storyReader$2159 A bit of researching fou...
GreaseMonkey script to auto login using HTTP authentication I've got quite a few GreaseMonkey scripts that I wrote at my work which automatically log me into the internal sites we have here. I've managed to write a script for nearly each one of these sites except for our time sheet application, which uses HTTP authenti...
TITLE: GreaseMonkey script to auto login using HTTP authentication QUESTION: I've got quite a few GreaseMonkey scripts that I wrote at my work which automatically log me into the internal sites we have here. I've managed to write a script for nearly each one of these sites except for our time sheet application, which ...
[ "javascript", "http", "authentication", "greasemonkey", "http-authentication" ]
7
6
28,017
4
0
2008-09-08T04:11:48.830000
2008-09-11T03:18:58.447000
49,164
49,169
How do I turn a python program into an .egg file?
How do I turn a python program into an.egg file?
Setuptools is the software that creates.egg files. It's an extension of the distutils package in the standard library. The process involves creating a setup.py file, then python setup.py bdist_egg creates an.egg package.
How do I turn a python program into an .egg file? How do I turn a python program into an.egg file?
TITLE: How do I turn a python program into an .egg file? QUESTION: How do I turn a python program into an.egg file? ANSWER: Setuptools is the software that creates.egg files. It's an extension of the distutils package in the standard library. The process involves creating a setup.py file, then python setup.py bdist_e...
[ "python", "deployment", "egg" ]
21
15
9,362
3
0
2008-09-08T04:21:22.020000
2008-09-08T04:33:39.930000
49,166
49,186
Connecting to registry remotely, and getting exceptions
I've inherited a hoary old piece of code (by hoary, I mean warty with lots of undocumented bug fixes than WTF-y) and there's one part that's giving me a bit of trouble. Here's how it connects to the remote registry to get the add/remove programs key: try { remoteKey = RegistryKey.OpenRemoteBaseKey( RegistryHive.LocalMa...
John's pointer to MSDN answered what UnauthorizedAccessException is for - it only appears when you try to access a key remotely, using OpenRemoteBaseKey. We're a little wary about changing the security context on the computer - I've found a reference here about using WMI (which we're already using for the vast majority...
Connecting to registry remotely, and getting exceptions I've inherited a hoary old piece of code (by hoary, I mean warty with lots of undocumented bug fixes than WTF-y) and there's one part that's giving me a bit of trouble. Here's how it connects to the remote registry to get the add/remove programs key: try { remoteK...
TITLE: Connecting to registry remotely, and getting exceptions QUESTION: I've inherited a hoary old piece of code (by hoary, I mean warty with lots of undocumented bug fixes than WTF-y) and there's one part that's giving me a bit of trouble. Here's how it connects to the remote registry to get the add/remove programs ...
[ "c#", "windows", "exception" ]
0
0
1,230
3
0
2008-09-08T04:24:37.410000
2008-09-08T05:00:45.670000
49,168
49,172
How can I embed Perl inside a C++ application?
I would like to call Perl script files from my c++ program. I am not sure that the people I will distribute to will have Perl installed. Basically I'm looking for a.lib file that I can use that has an Apache like distribution license.
You can embed perl into your app. Perl Embedding by John Quillan C++ wrapper around Perl C API
How can I embed Perl inside a C++ application? I would like to call Perl script files from my c++ program. I am not sure that the people I will distribute to will have Perl installed. Basically I'm looking for a.lib file that I can use that has an Apache like distribution license.
TITLE: How can I embed Perl inside a C++ application? QUESTION: I would like to call Perl script files from my c++ program. I am not sure that the people I will distribute to will have Perl installed. Basically I'm looking for a.lib file that I can use that has an Apache like distribution license. ANSWER: You can emb...
[ "c++", "perl" ]
7
16
9,541
3
0
2008-09-08T04:29:51.033000
2008-09-08T04:42:23.607000
49,183
49,191
MFC: MessageBox during a Drag-Drop
I need to display an error message on rejecting a drop in my application. I tried this in the OnDrop() but then the source application hangs until my message box is dismissed. How can I do that?
You can always call PostMessage with a private message in the WM_APP range and in the message handler show the error. That way you show the error after the drag and drop operation is really over and there is no danger of messing up anything.
MFC: MessageBox during a Drag-Drop I need to display an error message on rejecting a drop in my application. I tried this in the OnDrop() but then the source application hangs until my message box is dismissed. How can I do that?
TITLE: MFC: MessageBox during a Drag-Drop QUESTION: I need to display an error message on rejecting a drop in my application. I tried this in the OnDrop() but then the source application hangs until my message box is dismissed. How can I do that? ANSWER: You can always call PostMessage with a private message in the W...
[ "mfc", "drag-and-drop" ]
1
2
736
3
0
2008-09-08T04:57:32.197000
2008-09-08T05:11:56.093000
49,194
49,197
ASP.NET MVC Preview 4 - Stop Url.RouteUrl() etc. using existing parameters
I have an action like this: public class News: System.Web.Mvc.Controller { public ActionResult Archive(int year) { / *** / } } With a route like this: routes.MapRoute( "News-Archive", "News.mvc/Archive/{year}", new { controller = "News", action = "Archive" } ); The URL that I am on is: News.mvc/Archive/2008 I have a fo...
You have a couple problems, I think. First, your route doesn't have a default value for "year", so the URL "/News.mvc/Archive" is actually not valid for routing purposes. Second, you're expect form values to show up as route parameters, but that's not how HTML works. If you use a plain form with a select and a submit, ...
ASP.NET MVC Preview 4 - Stop Url.RouteUrl() etc. using existing parameters I have an action like this: public class News: System.Web.Mvc.Controller { public ActionResult Archive(int year) { / *** / } } With a route like this: routes.MapRoute( "News-Archive", "News.mvc/Archive/{year}", new { controller = "News", action ...
TITLE: ASP.NET MVC Preview 4 - Stop Url.RouteUrl() etc. using existing parameters QUESTION: I have an action like this: public class News: System.Web.Mvc.Controller { public ActionResult Archive(int year) { / *** / } } With a route like this: routes.MapRoute( "News-Archive", "News.mvc/Archive/{year}", new { controller...
[ "c#", "asp.net-mvc", "forms", "routes" ]
5
2
5,550
3
0
2008-09-08T05:18:12.147000
2008-09-08T05:25:58.417000
49,195
49,202
What language should I learn as a bridge to C (and derivatives)
The first language I learnt was PHP, but I have more recently picked up Python. As these are all 'high-level' languages, I have found them a bit difficult to pick up. I also tried to learn Objective-C but I gave up. So, what language should I learn to bridge between Python to C
It's not clear why you need a bridge language. Why don't you start working with C directly? C is a very simple language itself. I think that hardest part for C learner is pointers and everything else related to memory management. Also C lang is oriented on structured programming, so you will need to learn how to implem...
What language should I learn as a bridge to C (and derivatives) The first language I learnt was PHP, but I have more recently picked up Python. As these are all 'high-level' languages, I have found them a bit difficult to pick up. I also tried to learn Objective-C but I gave up. So, what language should I learn to brid...
TITLE: What language should I learn as a bridge to C (and derivatives) QUESTION: The first language I learnt was PHP, but I have more recently picked up Python. As these are all 'high-level' languages, I have found them a bit difficult to pick up. I also tried to learn Objective-C but I gave up. So, what language shou...
[ "python", "c" ]
4
15
919
14
0
2008-09-08T05:23:35.957000
2008-09-08T05:34:02.920000
49,196
49,198
Storing third-party libraries in source control
Should libraries that the application relies on be stored in source control? One part of me says it should and another part say's no. It feels wrong to add a 20mb library that dwarfs the entire app just because you rely on a couple of functions from it (albeit rather heavily). Should you just store the jar/dll or maybe...
store everything you will need to build the project 10 years from now.I store the entire zip distribution of any library, just in case Edit for 2017: This answer did not age well:-). If you are still using something old like ant or make, the above still applies. If you use something more modern like maven or graddle (o...
Storing third-party libraries in source control Should libraries that the application relies on be stored in source control? One part of me says it should and another part say's no. It feels wrong to add a 20mb library that dwarfs the entire app just because you rely on a couple of functions from it (albeit rather heav...
TITLE: Storing third-party libraries in source control QUESTION: Should libraries that the application relies on be stored in source control? One part of me says it should and another part say's no. It feels wrong to add a 20mb library that dwarfs the entire app just because you rely on a couple of functions from it (...
[ "version-control" ]
87
53
21,351
17
0
2008-09-08T05:25:01.367000
2008-09-08T05:28:00.050000
49,211
345,696
How can I use a key blob generated from Win32 CryptoAPI in my .NET application?
I have an existing application that is written in C++ for Windows. This application uses the Win32 CryptoAPI to generate a TripleDES session key for encrypting/decrypting data. We're using the exponent of one trick to export the session key out as a blob, which allows the blob to be stored somewhere in a decrypted form...
Intro I'm Finally getting around to posting the solution. I hope it provides some help to others out there that might be doing similar type things. There really isn't much reference to doing this elsewhere. Prerequisites In order for a lot of this to make sense it's necessary to read the exponent of one trick, which al...
How can I use a key blob generated from Win32 CryptoAPI in my .NET application? I have an existing application that is written in C++ for Windows. This application uses the Win32 CryptoAPI to generate a TripleDES session key for encrypting/decrypting data. We're using the exponent of one trick to export the session key...
TITLE: How can I use a key blob generated from Win32 CryptoAPI in my .NET application? QUESTION: I have an existing application that is written in C++ for Windows. This application uses the Win32 CryptoAPI to generate a TripleDES session key for encrypting/decrypting data. We're using the exponent of one trick to expo...
[ ".net", "c++", "encryption", "cryptography", "cryptoapi" ]
2
5
4,119
2
0
2008-09-08T05:42:23.290000
2008-12-06T01:26:28.080000
49,214
49,218
Populating a list of integers in .NET
I need a list of integers from 1 to x where x is set by the user. I could build it with a for loop eg assuming x is an integer set previously: List iList = new List (); for (int i = 1; i <= x; i++) { iList.Add(i); } This seems dumb, surely there's a more elegant way to do this, something like the PHP range method
If you're using.Net 3.5, Enumerable.Range is what you need. Generates a sequence of integral numbers within a specified range.
Populating a list of integers in .NET I need a list of integers from 1 to x where x is set by the user. I could build it with a for loop eg assuming x is an integer set previously: List iList = new List (); for (int i = 1; i <= x; i++) { iList.Add(i); } This seems dumb, surely there's a more elegant way to do this, som...
TITLE: Populating a list of integers in .NET QUESTION: I need a list of integers from 1 to x where x is set by the user. I could build it with a for loop eg assuming x is an integer set previously: List iList = new List (); for (int i = 1; i <= x; i++) { iList.Add(i); } This seems dumb, surely there's a more elegant w...
[ "c#", ".net", "list", "integer" ]
88
102
50,137
4
0
2008-09-08T05:45:34
2008-09-08T05:49:40.043000
49,220
49,221
How can I map a list of strings to my entity using NHibernate?
I've got two tables in my database: Articles and Tags The Tags tables consist of ArticleID (foreign key) and a Tag (varchar). Now I need to map an articles tags into a readonly collection on Article entity, either using IList Tags or ReadOnlyCollection Tags. I've consulted the NHibernate reference material, but I can't...
The type of collection to use in your mapping depends on how you want to represent the collection in code. The settings map like so: The maps directly to an IList. The maps directly to an IDictionary. The maps to an IList. A does not completely comply with the IList interface because the Add() method is not guaranteed ...
How can I map a list of strings to my entity using NHibernate? I've got two tables in my database: Articles and Tags The Tags tables consist of ArticleID (foreign key) and a Tag (varchar). Now I need to map an articles tags into a readonly collection on Article entity, either using IList Tags or ReadOnlyCollection Tags...
TITLE: How can I map a list of strings to my entity using NHibernate? QUESTION: I've got two tables in my database: Articles and Tags The Tags tables consist of ArticleID (foreign key) and a Tag (varchar). Now I need to map an articles tags into a readonly collection on Article entity, either using IList Tags or ReadO...
[ "nhibernate" ]
2
5
2,501
1
0
2008-09-08T05:51:35.483000
2008-09-08T05:57:37
49,226
49,256
128 bit data encryption using Java
I need to store some sensitive data by encrypting it with atleast 128 bit key. I investigated into javax.crypto package and found that there are certain Cipher names, like PBEWithMD5AndDES or PBEWithSHA1AndDESede which provides encryption upto 56 bit and 80 bit ( http://en.wikipedia.org/wiki/DESede ). I referred other ...
Use Advanced Encryption Standard (AES). It supports Key lengths of 128, 192, or 256 bits. The algorithm is simple. The Sun Java website has a section explaining how to do AES encryption in Java. From Wikipedia...... the Advanced Encryption Standard (AES), also known as Rijndael, is a block cipher adopted as an encrypti...
128 bit data encryption using Java I need to store some sensitive data by encrypting it with atleast 128 bit key. I investigated into javax.crypto package and found that there are certain Cipher names, like PBEWithMD5AndDES or PBEWithSHA1AndDESede which provides encryption upto 56 bit and 80 bit ( http://en.wikipedia.o...
TITLE: 128 bit data encryption using Java QUESTION: I need to store some sensitive data by encrypting it with atleast 128 bit key. I investigated into javax.crypto package and found that there are certain Cipher names, like PBEWithMD5AndDES or PBEWithSHA1AndDESede which provides encryption upto 56 bit and 80 bit ( htt...
[ "java", "cryptography" ]
5
8
9,758
6
0
2008-09-08T06:13:19.863000
2008-09-08T07:01:45.567000
49,251
49,531
Crash reporting in C for Linux
Following this question: Good crash reporting library in c# Is there any library like CrashRpt.dll that does the same on Linux? That is, generate a failure report including a core dump and any necessary environment and notify the developer about it? Edit: This seems to be a duplicate of this question
See Getting stack traces on Unix systems, automatically on Stack Overflow.
Crash reporting in C for Linux Following this question: Good crash reporting library in c# Is there any library like CrashRpt.dll that does the same on Linux? That is, generate a failure report including a core dump and any necessary environment and notify the developer about it? Edit: This seems to be a duplicate of t...
TITLE: Crash reporting in C for Linux QUESTION: Following this question: Good crash reporting library in c# Is there any library like CrashRpt.dll that does the same on Linux? That is, generate a failure report including a core dump and any necessary environment and notify the developer about it? Edit: This seems to b...
[ "c", "linux", "crashrpt" ]
4
3
3,260
7
0
2008-09-08T06:53:06.040000
2008-09-08T11:51:17.257000
49,252
49,255
ruby method names
For a project I am working on in ruby I am overriding the method_missing method so that I can set variables using a method call like this, similar to setting variables in an ActiveRecord object: Object.variable_name= 'new value' However, after implementing this I found out that many of the variable names have periods (...
Don't do it! Trying to create identifiers that are not valid in your language is not a good idea. If you really want to set variables like that, use attribute macros: attr_writer:bar attr_reader:baz attr_accessor:foo Okay, now that you have been warned, here's how to do it. Just return another instance of the same clas...
ruby method names For a project I am working on in ruby I am overriding the method_missing method so that I can set variables using a method call like this, similar to setting variables in an ActiveRecord object: Object.variable_name= 'new value' However, after implementing this I found out that many of the variable na...
TITLE: ruby method names QUESTION: For a project I am working on in ruby I am overriding the method_missing method so that I can set variables using a method call like this, similar to setting variables in an ActiveRecord object: Object.variable_name= 'new value' However, after implementing this I found out that many ...
[ "ruby" ]
2
9
2,984
3
0
2008-09-08T06:54:26.723000
2008-09-08T06:58:22.673000
49,258
49,266
What is the cleanest way to direct wxWidgets to always use wxFileConfig?
I am writing my first serious wxWidgets program. I'd like to use the wxConfig facility to make the program's user options persistent. However I don't want wxConfigBase to automatically use the Windows registry. Even though I'm initially targeting Windows, I'd prefer to use a configuration (eg.ini) file. Does anyone kno...
According to the source of wx/config.h file, all you need is to define the wxUSE_CONFIG_NATIVE symbol to 0 in your project and then it will always use wxFileConfig.
What is the cleanest way to direct wxWidgets to always use wxFileConfig? I am writing my first serious wxWidgets program. I'd like to use the wxConfig facility to make the program's user options persistent. However I don't want wxConfigBase to automatically use the Windows registry. Even though I'm initially targeting ...
TITLE: What is the cleanest way to direct wxWidgets to always use wxFileConfig? QUESTION: I am writing my first serious wxWidgets program. I'd like to use the wxConfig facility to make the program's user options persistent. However I don't want wxConfigBase to automatically use the Windows registry. Even though I'm in...
[ "c++", "wxwidgets" ]
2
2
1,256
2
0
2008-09-08T07:08:26.643000
2008-09-08T07:27:38.280000
49,260
49,265
Deploying a project using LINQ to SQL
I am working on a winforms application using LINQ to SQL - and am building the app using a SQL Express instance on my workstation. The final installation of the project will be on a proper SQL Server 2005. The database has the same name, and all tables are identical but the hostname is different. The only way I have fo...
If I understand your problem correctly, you simply change the database's connection string in your app.config / web.config. Edit, post clarification: You have the connection strings stored somewhere. They might be in the app.config of your server. Still, you get them from somewhere and that somewhere may be in an app.c...
Deploying a project using LINQ to SQL I am working on a winforms application using LINQ to SQL - and am building the app using a SQL Express instance on my workstation. The final installation of the project will be on a proper SQL Server 2005. The database has the same name, and all tables are identical but the hostnam...
TITLE: Deploying a project using LINQ to SQL QUESTION: I am working on a winforms application using LINQ to SQL - and am building the app using a SQL Express instance on my workstation. The final installation of the project will be on a proper SQL Server 2005. The database has the same name, and all tables are identic...
[ "linq-to-sql", "deployment" ]
1
1
2,136
4
0
2008-09-08T07:15:17.217000
2008-09-08T07:26:04.667000
49,263
50,110
Approximate string matching algorithms
Here at work, we often need to find a string from the list of strings that is the closest match to some other input string. Currently, we are using Needleman-Wunsch algorithm. The algorithm often returns a lot of false-positives (if we set the minimum-score too low), sometimes it doesn't find a match when it should (wh...
OK, Needleman-Wunsch(NW) is a classic end-to-end ("global") aligner from the bioinformatics literature. It was long ago available as "align" and "align0" in the FASTA package. The difference was that the "0" version wasn't as biased about avoiding end-gapping, which often allowed favoring high-quality internal matches ...
Approximate string matching algorithms Here at work, we often need to find a string from the list of strings that is the closest match to some other input string. Currently, we are using Needleman-Wunsch algorithm. The algorithm often returns a lot of false-positives (if we set the minimum-score too low), sometimes it ...
TITLE: Approximate string matching algorithms QUESTION: Here at work, we often need to find a string from the list of strings that is the closest match to some other input string. Currently, we are using Needleman-Wunsch algorithm. The algorithm often returns a lot of false-positives (if we set the minimum-score too l...
[ "algorithm", "string" ]
46
32
33,603
7
0
2008-09-08T07:21:20.323000
2008-09-08T16:39:52.667000
49,267
49,410
Embedded custom-tag in dynamic content (nested tag) not rendering
Embedded custom-tag in dynamic content (nested tag) not rendering. I have a page that pulls dynamic content from a javabean and passes the list of objects to a custom tag for processing into html. Within each object is a bunch of html to be output that contains a second custom tag that I would like to also be rendered....
Just using JSP is not enough. You should do soimething like JspFragment body = getJspBody(); StringWriter stringWriter = new StringWriter(); StringBuffer buff = stringWriter.getBuffer(); buff.append(" "); body.invoke(stringWriter); buff.append(" "); out.println(stringWriter); to get inner tags rendered (example is for ...
Embedded custom-tag in dynamic content (nested tag) not rendering Embedded custom-tag in dynamic content (nested tag) not rendering. I have a page that pulls dynamic content from a javabean and passes the list of objects to a custom tag for processing into html. Within each object is a bunch of html to be output that c...
TITLE: Embedded custom-tag in dynamic content (nested tag) not rendering QUESTION: Embedded custom-tag in dynamic content (nested tag) not rendering. I have a page that pulls dynamic content from a javabean and passes the list of objects to a custom tag for processing into html. Within each object is a bunch of html t...
[ "java", "jsp", "jstl", "custom-tag" ]
0
1
2,139
2
0
2008-09-08T07:28:36.173000
2008-09-08T10:12:37.353000
49,269
49,289
Reading default application settings in C#
I have a number of application settings (in user scope) for my custom grid control. Most of them are color settings. I have a form where the user can customize these colors and I want to add a button for reverting to default color settings. How can I read the default settings? For example: I have a user setting named C...
@ozgur, Settings.Default.Properties["property"].DefaultValue // initial value from config file Example: string foo = Settings.Default.Foo; // Foo = "Foo" by default Settings.Default.Foo = "Boo"; Settings.Default.Save(); string modifiedValue = Settings.Default.Foo; // modifiedValue = "Boo" string originalValue = Setting...
Reading default application settings in C# I have a number of application settings (in user scope) for my custom grid control. Most of them are color settings. I have a form where the user can customize these colors and I want to add a button for reverting to default color settings. How can I read the default settings?...
TITLE: Reading default application settings in C# QUESTION: I have a number of application settings (in user scope) for my custom grid control. Most of them are color settings. I have a form where the user can customize these colors and I want to add a button for reverting to default color settings. How can I read the...
[ "c#", ".net", "winforms", "application-settings" ]
30
42
46,634
7
0
2008-09-08T07:30:47.930000
2008-09-08T07:55:30.397000
49,274
49,282
Safe integer parsing in Ruby
I have a string, say '123', and I want to convert it to the integer 123. I know you can simply do some_string.to_i, but that converts 'lolipops' to 0, which is not the effect I have in mind. I want it to blow up in my face when I try to convert something invalid, with a nice and painful Exception. Otherwise, I can't di...
Ruby has this functionality built in: Integer('1001') # => 1001 Integer('1001 nights') # ArgumentError: invalid value for Integer: "1001 nights" As noted in answer by Joseph Pecoraro, you might want to watch for strings that are valid non-decimal numbers, such as those starting with 0x for hex and 0b for binary, and po...
Safe integer parsing in Ruby I have a string, say '123', and I want to convert it to the integer 123. I know you can simply do some_string.to_i, but that converts 'lolipops' to 0, which is not the effect I have in mind. I want it to blow up in my face when I try to convert something invalid, with a nice and painful Exc...
TITLE: Safe integer parsing in Ruby QUESTION: I have a string, say '123', and I want to convert it to the integer 123. I know you can simply do some_string.to_i, but that converts 'lolipops' to 0, which is not the effect I have in mind. I want it to blow up in my face when I try to convert something invalid, with a ni...
[ "ruby", "string", "exception", "integer", "string-parsing" ]
169
244
99,366
8
0
2008-09-08T07:41:00.293000
2008-09-08T07:49:16.170000
49,302
49,311
How to Identify Postback event in Page_Load
We have some legacy code that needs to identify in the Page_Load which event caused the postback. At the moment this is implemented by checking the Request data like this... if (Request.Form["__EVENTTARGET"]!= null && (Request.Form["__EVENTTARGET"].IndexOf("BaseGrid") > -1 // BaseGrid event ( e.g. sort) || Request.Form...
This should get you the control that caused the postback: public static Control GetPostBackControl(Page page) { Control control = null; string ctrlname = page.Request.Params.Get("__EVENTTARGET"); if (ctrlname!= null && ctrlname!= string.Empty) { control = page.FindControl(ctrlname); } else { foreach (string ctl in pag...
How to Identify Postback event in Page_Load We have some legacy code that needs to identify in the Page_Load which event caused the postback. At the moment this is implemented by checking the Request data like this... if (Request.Form["__EVENTTARGET"]!= null && (Request.Form["__EVENTTARGET"].IndexOf("BaseGrid") > -1 //...
TITLE: How to Identify Postback event in Page_Load QUESTION: We have some legacy code that needs to identify in the Page_Load which event caused the postback. At the moment this is implemented by checking the Request data like this... if (Request.Form["__EVENTTARGET"]!= null && (Request.Form["__EVENTTARGET"].IndexOf("...
[ "c#", "asp.net" ]
5
7
8,035
3
0
2008-09-08T08:19:47.063000
2008-09-08T08:29:01.067000
49,330
49,423
VS 2005 & 2008 library linking
Is it correct to link a static library (.lib) compiled with VS 2005 with a program which is compiled with VS 2008? Both library and my program are written in C++. This program is run on Windows Mobile 6 Professional emulator. This seems to work, there are no linking errors. However the program crashes during startup be...
VS2005 and VS2008 use different STL implementations. When the VS2005 code returns a vector, the object has memory layout different from what VS2008 expects. That should be the reason for the broken values you see in the returned date. As a rule of thumb, you should always compile all C++ modules of a project with the s...
VS 2005 & 2008 library linking Is it correct to link a static library (.lib) compiled with VS 2005 with a program which is compiled with VS 2008? Both library and my program are written in C++. This program is run on Windows Mobile 6 Professional emulator. This seems to work, there are no linking errors. However the pr...
TITLE: VS 2005 & 2008 library linking QUESTION: Is it correct to link a static library (.lib) compiled with VS 2005 with a program which is compiled with VS 2008? Both library and my program are written in C++. This program is run on Windows Mobile 6 Professional emulator. This seems to work, there are no linking erro...
[ "visual-studio-2008", "visual-c++", "visual-studio-2005", "linker" ]
4
12
2,165
3
0
2008-09-08T08:44:10.937000
2008-09-08T10:24:23.363000
49,334
53,405
Querying collections of value type in the Criteria API in Hibernate
In my database, I have an entity table (let's call it Entity). Each entity can have a number of entity types, and the set of entity types is static. Therefore, there is a connecting table that contains rows of the entity id and the name of the entity type. In my code, EntityType is an enum, and Entity is a Hibernate-ma...
HQL: select entity from Entity entity where:type = some elements(entity.types) I think that you can also write it like: select entity from Entity entity where:type in(entity.types)
Querying collections of value type in the Criteria API in Hibernate In my database, I have an entity table (let's call it Entity). Each entity can have a number of entity types, and the set of entity types is static. Therefore, there is a connecting table that contains rows of the entity id and the name of the entity t...
TITLE: Querying collections of value type in the Criteria API in Hibernate QUESTION: In my database, I have an entity table (let's call it Entity). Each entity can have a number of entity types, and the set of entity types is static. Therefore, there is a connecting table that contains rows of the entity id and the na...
[ "hibernate", "enums", "hql" ]
0
1
2,121
2
0
2008-09-08T08:46:36.610000
2008-09-10T04:14:44.810000
49,346
49,381
How to prevent a hyperlink from linking
Is it possible to prevent an asp.net Hyperlink control from linking, i.e. so that it appears as a label, without actually having to replace the control with a label? Maybe using CSS or setting an attribute? I know that marking it as disabled works but then it gets displayed differently (greyed out). To clarify my point...
This sounds like a job for JQuery. Just give a specific class name to all of the HyperLink controls that you want the URLs removed and then apply the following JQuery snippet to the bottom of your page: $(document).ready(function() { $('a.NoLink').removeAttr('href') }); All of the HyperLink controls with the class name...
How to prevent a hyperlink from linking Is it possible to prevent an asp.net Hyperlink control from linking, i.e. so that it appears as a label, without actually having to replace the control with a label? Maybe using CSS or setting an attribute? I know that marking it as disabled works but then it gets displayed diffe...
TITLE: How to prevent a hyperlink from linking QUESTION: Is it possible to prevent an asp.net Hyperlink control from linking, i.e. so that it appears as a label, without actually having to replace the control with a label? Maybe using CSS or setting an attribute? I know that marking it as disabled works but then it ge...
[ "asp.net", "css" ]
5
6
4,725
12
0
2008-09-08T09:07:39.303000
2008-09-08T09:40:32.393000
49,352
49,398
How to make cruisecontrol only build one project at a time
I have just set up cruise control.net on our build server, and I am unable to find a setting to tell it to only build one project at a time. Any ideas?
If you are using CruiseControl 1.3 or later you can use an Integration Queue These allow you to control which projects can be built concurrently and which must be serialized.
How to make cruisecontrol only build one project at a time I have just set up cruise control.net on our build server, and I am unable to find a setting to tell it to only build one project at a time. Any ideas?
TITLE: How to make cruisecontrol only build one project at a time QUESTION: I have just set up cruise control.net on our build server, and I am unable to find a setting to tell it to only build one project at a time. Any ideas? ANSWER: If you are using CruiseControl 1.3 or later you can use an Integration Queue These...
[ "build-automation", "cruisecontrol.net" ]
3
5
745
1
0
2008-09-08T09:16:30.750000
2008-09-08T09:56:40.560000
49,368
49,373
CSS2 Attribute Selectors with Regex
CSS Attribute selectors allow the selection of elements based on attribute values. Unfortunately, I've not used them in years (mainly because they're not supported by all modern browsers). However, I remember distinctly that I was able to use them to adorn all external links with an icon, by using a code similar to the...
As for CSS 2.1, see http://www.w3.org/TR/CSS21/selector.html#attribute-selectors Executive summary: Attribute selectors may match in four ways: [att] Match when the element sets the "att" attribute, whatever the value of the attribute. [att=val] Match when the element's "att" attribute value is exactly "val". [att~=va...
CSS2 Attribute Selectors with Regex CSS Attribute selectors allow the selection of elements based on attribute values. Unfortunately, I've not used them in years (mainly because they're not supported by all modern browsers). However, I remember distinctly that I was able to use them to adorn all external links with an ...
TITLE: CSS2 Attribute Selectors with Regex QUESTION: CSS Attribute selectors allow the selection of elements based on attribute values. Unfortunately, I've not used them in years (mainly because they're not supported by all modern browsers). However, I remember distinctly that I was able to use them to adorn all exter...
[ "css", "css-selectors" ]
31
34
35,722
3
0
2008-09-08T09:30:29.077000
2008-09-08T09:32:56.373000
49,378
60,694
Deploy MySQL Server + DB with .Net application
HI All, We have a.Net 2.0 application which has a MySQL backend. We want to be able to deploy MySQl and the DB when we install the application and im trying to find the best solution. The current setup is to copy the required files to a folder on the local machine and then perform a "NET START" commands to install and ...
Not sure where you're at in the project, but if it's a simple and small database you might consider converting it to SQLite. It's not ideal for Client/Server operations, but if it's low volume/transactions it might work.
Deploy MySQL Server + DB with .Net application HI All, We have a.Net 2.0 application which has a MySQL backend. We want to be able to deploy MySQl and the DB when we install the application and im trying to find the best solution. The current setup is to copy the required files to a folder on the local machine and then...
TITLE: Deploy MySQL Server + DB with .Net application QUESTION: HI All, We have a.Net 2.0 application which has a MySQL backend. We want to be able to deploy MySQl and the DB when we install the application and im trying to find the best solution. The current setup is to copy the required files to a folder on the loca...
[ ".net", "mysql", "database", "deployment", "installation" ]
9
5
6,395
4
0
2008-09-08T09:38:22.600000
2008-09-13T17:04:59.600000
49,379
49,428
How to lock compiled Java classes to prevent decompilation?
How do I lock compiled Java classes to prevent decompilation? I know this must be very well discussed topic on the Internet, but I could not come to any conclusion after referring them. Many people do suggest obfuscator, but they just do renaming of classes, methods, and fields with tough-to-remember character sequence...
Some of the more advanced Java bytecode obfuscators do much more than just class name mangling. Zelix KlassMaster, for example, can also scramble your code flow in a way that makes it really hard to follow and works as an excellent code optimizer... Also many of the obfuscators are also able to scramble your string con...
How to lock compiled Java classes to prevent decompilation? How do I lock compiled Java classes to prevent decompilation? I know this must be very well discussed topic on the Internet, but I could not come to any conclusion after referring them. Many people do suggest obfuscator, but they just do renaming of classes, m...
TITLE: How to lock compiled Java classes to prevent decompilation? QUESTION: How do I lock compiled Java classes to prevent decompilation? I know this must be very well discussed topic on the Internet, but I could not come to any conclusion after referring them. Many people do suggest obfuscator, but they just do rena...
[ "java", "jvm", "decompiling" ]
105
103
96,921
9
0
2008-09-08T09:38:58.607000
2008-09-08T10:29:19.013000
49,382
49,530
What are the preferred conventions in naming attributes, methods and classes in different languages?
Are the naming conventions similar in different languages? If not, what are the differences?
As others have said, things vary a lot, but here's a rough overview of the most commonly used naming conventions in various languages: lowercase, lowercase_with_underscores: Commonly used for local variables and function names (typical C syntax). UPPERCASE, UPPERCASE_WITH_UNDERSCORES: Commonly used for constants and va...
What are the preferred conventions in naming attributes, methods and classes in different languages? Are the naming conventions similar in different languages? If not, what are the differences?
TITLE: What are the preferred conventions in naming attributes, methods and classes in different languages? QUESTION: Are the naming conventions similar in different languages? If not, what are the differences? ANSWER: As others have said, things vary a lot, but here's a rough overview of the most commonly used namin...
[ "programming-languages", "naming" ]
1
2
682
6
0
2008-09-08T09:40:55.217000
2008-09-08T11:46:53.430000
49,402
49,540
Creating batch jobs in PowerShell
Imagine a DOS style.cmd file which is used to launch interdependent windowed applications in the right order. Example: 1) Launch a server application by calling an exe with parameters. 2) Wait for the server to become initialized (or a fixed amount of time). 3) Launch client application by calling an exe with parameter...
Remember that PowerShell can access.Net objects. The Start-Sleep as suggested by Blair Conrad can be replaced by a call to WaitForInputIdle of the server process so you know when the server is ready before starting the client. $sp = get-process server-application $sp.WaitForInputIdle() You could also use Process.Start ...
Creating batch jobs in PowerShell Imagine a DOS style.cmd file which is used to launch interdependent windowed applications in the right order. Example: 1) Launch a server application by calling an exe with parameters. 2) Wait for the server to become initialized (or a fixed amount of time). 3) Launch client applicatio...
TITLE: Creating batch jobs in PowerShell QUESTION: Imagine a DOS style.cmd file which is used to launch interdependent windowed applications in the right order. Example: 1) Launch a server application by calling an exe with parameters. 2) Wait for the server to become initialized (or a fixed amount of time). 3) Launch...
[ "powershell", "batch-file" ]
5
5
3,598
3
0
2008-09-08T10:06:06.903000
2008-09-08T12:00:05.800000
49,403
49,409
How do you parse a filename in bash?
I have a filename in a format like: system-source-yyyymmdd.dat I'd like to be able to parse out the different bits of the filename using the "-" as a delimiter.
You can use the cut command to get at each of the 3 'fields', e.g.: $ echo "system-source-yyyymmdd.dat" | cut -d'-' -f2 source "-d" specifies the delimiter, "-f" specifies the number of the field you require
How do you parse a filename in bash? I have a filename in a format like: system-source-yyyymmdd.dat I'd like to be able to parse out the different bits of the filename using the "-" as a delimiter.
TITLE: How do you parse a filename in bash? QUESTION: I have a filename in a format like: system-source-yyyymmdd.dat I'd like to be able to parse out the different bits of the filename using the "-" as a delimiter. ANSWER: You can use the cut command to get at each of the 3 'fields', e.g.: $ echo "system-source-yyyym...
[ "bash", "shell", "parsing", "tokenize", "cut" ]
27
32
42,388
6
0
2008-09-08T10:07:03.903000
2008-09-08T10:11:32.130000
49,404
49,414
SQL Query to get latest price
I have a table containing prices for a lot of different "things" in a MS SQL 2005 table. There are hundreds of records per thing per day and the different things gets price updates at different times. ID uniqueidentifier not null, ThingID int NOT NULL, PriceDateTime datetime NOT NULL, Price decimal(18,4) NOT NULL I nee...
I think the only solution with your table structure is to work with a subquery: SELECT * FROM Thing WHERE ID IN (SELECT max(ID) FROM Thing WHERE ThingID IN (1,2,3,4) GROUP BY ThingID) (Given the highest ID also means the newest price) However I suggest you add a "IsCurrent" column that is 0 if it's not the latest price...
SQL Query to get latest price I have a table containing prices for a lot of different "things" in a MS SQL 2005 table. There are hundreds of records per thing per day and the different things gets price updates at different times. ID uniqueidentifier not null, ThingID int NOT NULL, PriceDateTime datetime NOT NULL, Pric...
TITLE: SQL Query to get latest price QUESTION: I have a table containing prices for a lot of different "things" in a MS SQL 2005 table. There are hundreds of records per thing per day and the different things gets price updates at different times. ID uniqueidentifier not null, ThingID int NOT NULL, PriceDateTime datet...
[ "sql", "sql-server", "sql-server-2005" ]
12
20
36,717
10
0
2008-09-08T10:07:28.677000
2008-09-08T10:16:28.780000
49,416
49,443
GSM Modems, PCs, SMS and Telephone Calls
What all would be the requirements for the following scenario: A GSM modem connected to a PC running a web based (ASP.NET) application. In the application the user selects a phone number from a list of phone nos. When he clicks on a button named the PC should call the selected phone number. When the person on the phone...
I'll pick some points of your very broad question and answer them. Note that there are other points where others may be of more help... First, a GSM modem is probably not the way you'd want to go as they usually don't allow for concurrency. So unless you just want one user at the time to use your service, you'd probabl...
GSM Modems, PCs, SMS and Telephone Calls What all would be the requirements for the following scenario: A GSM modem connected to a PC running a web based (ASP.NET) application. In the application the user selects a phone number from a list of phone nos. When he clicks on a button named the PC should call the selected p...
TITLE: GSM Modems, PCs, SMS and Telephone Calls QUESTION: What all would be the requirements for the following scenario: A GSM modem connected to a PC running a web based (ASP.NET) application. In the application the user selects a phone number from a list of phone nos. When he clicks on a button named the PC should c...
[ "asp.net" ]
0
1
1,916
3
0
2008-09-08T10:17:39.543000
2008-09-08T10:39:47.350000
49,426
49,460
How do you manage your app when the database goes offline?
Take a.Net Winforms App.. mix in a flakey wireless network connection, stir with a few users who like to simply pull the blue plug out occasionally and for good measure, add a Systems Admin that decides to reboot the SQL server box without warning now and again just to keep everyone on their toes. What are the suggesti...
Answer depends on type of your application. There are applications that can work offline - Microsoft Outlook for example. Such applications doesn't treat connectivity exceptions as critical, they can save your work locally and synchronize it later. Another applications such as online games will treat communication prob...
How do you manage your app when the database goes offline? Take a.Net Winforms App.. mix in a flakey wireless network connection, stir with a few users who like to simply pull the blue plug out occasionally and for good measure, add a Systems Admin that decides to reboot the SQL server box without warning now and again...
TITLE: How do you manage your app when the database goes offline? QUESTION: Take a.Net Winforms App.. mix in a flakey wireless network connection, stir with a few users who like to simply pull the blue plug out occasionally and for good measure, add a Systems Admin that decides to reboot the SQL server box without war...
[ ".net", "sql-server", "error-handling" ]
6
3
1,137
6
0
2008-09-08T10:25:47.323000
2008-09-08T10:59:27.007000
49,430
57,774
Animation Extender Problems
I have just started working with the AnimationExtender. I am using it to show a new div with a list gathered from a database when a button is pressed. The problem is the button needs to do a postback to get this list as I don't want to make the call to the database unless it's needed. The postback however stops the ani...
The flow you are seeing is something like this: Click on button AnimationExtender catches action and call clickOn callback linkPostback starts asynchronous request for page and then returns flow to AnimationExtender Animation begins pageRequest returns and calls playAnimation, which starts the animation again I think t...
Animation Extender Problems I have just started working with the AnimationExtender. I am using it to show a new div with a list gathered from a database when a button is pressed. The problem is the button needs to do a postback to get this list as I don't want to make the call to the database unless it's needed. The po...
TITLE: Animation Extender Problems QUESTION: I have just started working with the AnimationExtender. I am using it to show a new div with a list gathered from a database when a button is pressed. The problem is the button needs to do a postback to get this list as I don't want to make the call to the database unless i...
[ "c#", "animationextender" ]
2
1
3,389
2
0
2008-09-08T10:29:53.943000
2008-09-11T22:09:33.987000
49,431
49,539
Trigger UpdatePanel on mouse over (as tooltip)
I need to display additional information, like a tooltip, but it's a lot of info (about 500 - 600 characters) on the items in a RadioButtonList. I now trigger the update on a PanelUpdate when the user selects an item in the RadioButtonList, using OnSelectedIndexChanged and AutoPostBack. What I would like to do, is trig...
You could try setting an AsyncPostBackTrigger on the updatePanel to watch the value of a hidden field. Then in the javascript onMouseHover event, increment the hidden value. This would fire the AsyncPostBackTrigger, updating the UpdatePanel.
Trigger UpdatePanel on mouse over (as tooltip) I need to display additional information, like a tooltip, but it's a lot of info (about 500 - 600 characters) on the items in a RadioButtonList. I now trigger the update on a PanelUpdate when the user selects an item in the RadioButtonList, using OnSelectedIndexChanged and...
TITLE: Trigger UpdatePanel on mouse over (as tooltip) QUESTION: I need to display additional information, like a tooltip, but it's a lot of info (about 500 - 600 characters) on the items in a RadioButtonList. I now trigger the update on a PanelUpdate when the user selects an item in the RadioButtonList, using OnSelect...
[ "asp.net", "javascript", "asp.net-ajax" ]
3
1
1,192
1
0
2008-09-08T10:30:47.920000
2008-09-08T11:59:28.907000
49,442
89,185
When to create Interface Builder plug-in for custom view?
When do you recommend integrating a custom view into Interface Builder with a plug-in? When skimming through Apple's Interface Builder Plug-In Programming Guide I found: Are your custom objects going to be used by only one application? Do your custom objects rely on state information found only in your application? Wou...
It's perfectly reasonable to push the view and controller classes that your application uses out into a separate framework — embedded in your application wrapper — for which you also produce an Interface Builder plug-in. Among other reasons, classes that are commonly used in your application can then be configured at t...
When to create Interface Builder plug-in for custom view? When do you recommend integrating a custom view into Interface Builder with a plug-in? When skimming through Apple's Interface Builder Plug-In Programming Guide I found: Are your custom objects going to be used by only one application? Do your custom objects rel...
TITLE: When to create Interface Builder plug-in for custom view? QUESTION: When do you recommend integrating a custom view into Interface Builder with a plug-in? When skimming through Apple's Interface Builder Plug-In Programming Guide I found: Are your custom objects going to be used by only one application? Do your ...
[ "objective-c", "cocoa", "macos", "interface-builder" ]
9
9
3,694
2
0
2008-09-08T10:39:44.950000
2008-09-18T01:26:31.450000
49,450
49,483
How do I export (and then import) a Subversion repository?
I'm just about wrapped up on a project where I was using a commercial SVN provider to store the source code. The web host the customer ultimately picked includes a repository as part of the hosting package, so, now that the project is over, I'd like to relocate the repository to their web host and discontinue the comme...
If you want to move the repository and keep history, you'll probably need filesystem access on both hosts. The simplest solution, if your backend is FSFS (the default on recent versions), is to make a filesystem copy of the entire repository folder. If you have a Berkley DB backend, if you're not sure of what your back...
How do I export (and then import) a Subversion repository? I'm just about wrapped up on a project where I was using a commercial SVN provider to store the source code. The web host the customer ultimately picked includes a repository as part of the hosting package, so, now that the project is over, I'd like to relocate...
TITLE: How do I export (and then import) a Subversion repository? QUESTION: I'm just about wrapped up on a project where I was using a commercial SVN provider to store the source code. The web host the customer ultimately picked includes a repository as part of the hosting package, so, now that the project is over, I'...
[ "svn" ]
86
70
157,324
11
0
2008-09-08T10:50:39.587000
2008-09-08T11:11:30.987000
49,456
53,044
How to recover a deleted branch in TFS?
I deleted a branch in TFS and just found out that I need the changes that were on it. How do I recover the branch or the changes done on it?
Specifically in Visual Studio go to "Tools-Options" then Select "Source Control-visual Studio Team Founation Server" and check the "Show deleted items in the Source Control explorer". Having done that - you can then right click a folder and say "Undelete"
How to recover a deleted branch in TFS? I deleted a branch in TFS and just found out that I need the changes that were on it. How do I recover the branch or the changes done on it?
TITLE: How to recover a deleted branch in TFS? QUESTION: I deleted a branch in TFS and just found out that I need the changes that were on it. How do I recover the branch or the changes done on it? ANSWER: Specifically in Visual Studio go to "Tools-Options" then Select "Source Control-visual Studio Team Founation Ser...
[ "version-control", "tfs" ]
35
60
13,718
2
0
2008-09-08T10:55:58.763000
2008-09-09T22:25:44.183000
49,458
49,526
What's the state of play with "Visual Inheritance"
We have an application that has to be flexible in how it displays it's main form to the user - depending on the user, the form should be slightly different, maybe an extra button here or there, or some other nuance. In order to stop writing code to explicitly remove or add controls etc, I turned to visual inheritance t...
I thought they had more or less sorted the desktop designer issues in 2005. Have you tried the usual culprits? No abstract control types No constructor arguments in any form Initialisation moved to Form_Load as opposed to the Ctor No controls in the same project as the usercontrol/form that they are put inside Close al...
What's the state of play with "Visual Inheritance" We have an application that has to be flexible in how it displays it's main form to the user - depending on the user, the form should be slightly different, maybe an extra button here or there, or some other nuance. In order to stop writing code to explicitly remove or...
TITLE: What's the state of play with "Visual Inheritance" QUESTION: We have an application that has to be flexible in how it displays it's main form to the user - depending on the user, the form should be slightly different, maybe an extra button here or there, or some other nuance. In order to stop writing code to ex...
[ "visual-studio", "winforms", "forms", "visual-inheritance" ]
8
6
1,250
6
0
2008-09-08T10:58:06.513000
2008-09-08T11:43:39.397000
49,461
49,479
VB.NET FormatNumber equivalent in C#?
Is there a C# equivalent for the VB.NET FormatNumber function? I.e.: JSArrayString += "^" + (String)FormatNumber(inv.RRP * oCountry.ExchangeRate, 2);
In both C# and VB.NET you can use either the.ToString() function or the String.Format() method to format the text. Using the.ToString() method your example could be written as: JSArrayString += "^" + (inv.RRP * oCountry.ExchangeRate).ToString("#0.00") Alternatively using the String.Format() it could written as: JSArray...
VB.NET FormatNumber equivalent in C#? Is there a C# equivalent for the VB.NET FormatNumber function? I.e.: JSArrayString += "^" + (String)FormatNumber(inv.RRP * oCountry.ExchangeRate, 2);
TITLE: VB.NET FormatNumber equivalent in C#? QUESTION: Is there a C# equivalent for the VB.NET FormatNumber function? I.e.: JSArrayString += "^" + (String)FormatNumber(inv.RRP * oCountry.ExchangeRate, 2); ANSWER: In both C# and VB.NET you can use either the.ToString() function or the String.Format() method to format ...
[ "c#", ".net", "vb.net" ]
5
10
16,462
4
0
2008-09-08T10:59:34.433000
2008-09-08T11:08:46.737000
49,473
49,498
Is Bouncy Castle API Thread Safe?
Is Bouncy Castle API Thread Safe? Especially, org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher org.bouncycastle.crypto.paddings.PKCS7Padding org.bouncycastle.crypto.engines.AESFastEngine org.bouncycastle.crypto.modes.CBCBlockCipher I am planning to write a singleton Spring bean for basic level cryptography su...
It really does not matter if the API/Code is thread safe. CBC encryption in itself is not thread safe. Some terminology - E(X) = Enctrypt message X D(X) = Dectrypt X. (Note that D(E(X)) = X) IV = Initialization vector. A random sequence to bootstrap the CBC algorithm CBC = Cipher block chaining. A really simple CBC imp...
Is Bouncy Castle API Thread Safe? Is Bouncy Castle API Thread Safe? Especially, org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher org.bouncycastle.crypto.paddings.PKCS7Padding org.bouncycastle.crypto.engines.AESFastEngine org.bouncycastle.crypto.modes.CBCBlockCipher I am planning to write a singleton Spring be...
TITLE: Is Bouncy Castle API Thread Safe? QUESTION: Is Bouncy Castle API Thread Safe? Especially, org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher org.bouncycastle.crypto.paddings.PKCS7Padding org.bouncycastle.crypto.engines.AESFastEngine org.bouncycastle.crypto.modes.CBCBlockCipher I am planning to write a s...
[ "java", "cryptography", "bouncycastle" ]
12
13
5,292
2
0
2008-09-08T11:04:13.190000
2008-09-08T11:23:51.583000
49,500
49,504
Apache rewrite based on subdomain
I'm trying to redirect requests for a wildcard domain to a sub-directory. ie. something.blah.example.com --> blah.example.com/something I don't know how to get the subdomain name to use in the rewrite rule. Final Solution: RewriteCond %{HTTP_HOST}!^blah\.example\.com RewriteCond %{HTTP_HOST} ^([^.]+) RewriteRule ^(.*) ...
You should have a look at the URL Rewriting Guide from the apache documentation. The following is untested, but it should to the trick: RewriteCond %{HTTP_HOST} ^([^.]+)\.blah\.domain\.com$ RewriteRule ^/(.*)$ http://blah.domain.com/%1/$1 [L,R] This only works if the subdomain contains no dots. Otherwise, you'd have to...
Apache rewrite based on subdomain I'm trying to redirect requests for a wildcard domain to a sub-directory. ie. something.blah.example.com --> blah.example.com/something I don't know how to get the subdomain name to use in the rewrite rule. Final Solution: RewriteCond %{HTTP_HOST}!^blah\.example\.com RewriteCond %{HTTP...
TITLE: Apache rewrite based on subdomain QUESTION: I'm trying to redirect requests for a wildcard domain to a sub-directory. ie. something.blah.example.com --> blah.example.com/something I don't know how to get the subdomain name to use in the rewrite rule. Final Solution: RewriteCond %{HTTP_HOST}!^blah\.example\.com ...
[ "apache", "redirect", "mod-rewrite", "subdomain", "wildcard-subdomain" ]
32
36
41,752
3
0
2008-09-08T11:24:42.563000
2008-09-08T11:30:27.947000
49,510
49,512
How do you set your Cocoa application as the default web browser?
How do you set your Cocoa application as the default web browser? I want to create an application that is launched by default when the user clicks on an HTTP or HTTPS link in other applications (Mail, iChat etc.).
There are four steps to making an app that can act as the default web browser. The first three steps allow your app to act as a role handler for the relevant URL schemes (HTTP and HTTPS) and the final step makes it the default role handler for those schemes. 1) Add the URL schemes your app can handle to your applicatio...
How do you set your Cocoa application as the default web browser? How do you set your Cocoa application as the default web browser? I want to create an application that is launched by default when the user clicks on an HTTP or HTTPS link in other applications (Mail, iChat etc.).
TITLE: How do you set your Cocoa application as the default web browser? QUESTION: How do you set your Cocoa application as the default web browser? I want to create an application that is launched by default when the user clicks on an HTTP or HTTPS link in other applications (Mail, iChat etc.). ANSWER: There are fou...
[ "objective-c", "cocoa" ]
39
81
14,719
4
0
2008-09-08T11:32:29.503000
2008-09-08T11:33:41.763000
49,511
49,523
Using a wiki as a central development project repository
I have played with the idea of using a wiki (MediaWiki) to centralize all project information for a development project. This was done using extensions that pull information from SVN (using SVNKit ) and by linking to Bugzilla to extract work assigned to a developer or work remaining for a release. Examples: would retur...
I think this would be extremly useful. Depending on the size of a project team members come and go. And a wiki is a good tool to keep the history and the "spirit" of a project available to new team members. I did that in many projects, and though the projects were already finished, all the informations are available. O...
Using a wiki as a central development project repository I have played with the idea of using a wiki (MediaWiki) to centralize all project information for a development project. This was done using extensions that pull information from SVN (using SVNKit ) and by linking to Bugzilla to extract work assigned to a develop...
TITLE: Using a wiki as a central development project repository QUESTION: I have played with the idea of using a wiki (MediaWiki) to centralize all project information for a development project. This was done using extensions that pull information from SVN (using SVNKit ) and by linking to Bugzilla to extract work ass...
[ "svn", "integration", "wiki", "projects", "bugzilla" ]
7
3
1,385
5
0
2008-09-08T11:32:49.517000
2008-09-08T11:38:13.187000
49,547
2,068,407
How do we control web page caching, across all browsers?
Our investigations have shown us that not all browsers respect the HTTP cache directives in a uniform manner. For security reasons we do not want certain pages in our application to be cached, ever, by the web browser. This must work for at least the following browsers: Internet Explorer 6+ Firefox 1.5+ Safari 3+ Opera...
Introduction The correct minimum set of headers that works across all mentioned clients (and proxies): Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache Expires: 0 The Cache-Control is per the HTTP 1.1 spec for clients and proxies (and implicitly required by some clients next to Expires ). The Pragma ...
How do we control web page caching, across all browsers? Our investigations have shown us that not all browsers respect the HTTP cache directives in a uniform manner. For security reasons we do not want certain pages in our application to be cached, ever, by the web browser. This must work for at least the following br...
TITLE: How do we control web page caching, across all browsers? QUESTION: Our investigations have shown us that not all browsers respect the HTTP cache directives in a uniform manner. For security reasons we do not want certain pages in our application to be cached, ever, by the web browser. This must work for at leas...
[ "http", "caching", "https", "http-headers", "cross-browser" ]
1,894
3,145
1,274,723
30
0
2008-09-08T12:08:49.213000
2010-01-14T23:50:18.593000
49,551
49,609
LINQ and Database Permissions
I'm still trying to get my head around LINQ and accessing a SQL Database. I was always taught that you should only have execute permissions of stored procedures to your data. You should never have select / insert / update / delete. (This is because of performance and security) To get the data out of LINQ you obviously ...
1) We're programmers, not DBA fascists. If your requirements state that the database must be locked down 100%, Linq is not for you. I'm not a DBA, so I believe that most of the performance/security hype is just that. Linq is for me. 2) You can do joins with linq. @Philippe: Linq automatically transforms evaluations int...
LINQ and Database Permissions I'm still trying to get my head around LINQ and accessing a SQL Database. I was always taught that you should only have execute permissions of stored procedures to your data. You should never have select / insert / update / delete. (This is because of performance and security) To get the d...
TITLE: LINQ and Database Permissions QUESTION: I'm still trying to get my head around LINQ and accessing a SQL Database. I was always taught that you should only have execute permissions of stored procedures to your data. You should never have select / insert / update / delete. (This is because of performance and secu...
[ "linq-to-sql", "permissions" ]
2
2
1,726
4
0
2008-09-08T12:15:05.563000
2008-09-08T12:49:51.393000
49,562
63,996
Where do I start designing a Custom Control that contains child objects?
I think this is a fun engineering-level question. I need to design a control which displays a line chart. What I want to be able to do is use a designer to add multiple Pens which actually describe the data and presentation so that it ends up with Xaml something along these lines:... My first thought is to extend Items...
I would go with Chart as an ItemsControl and its ItemsPanel be a Canvas(For some light use I would go with Grid as ItemsPanel). And each Pen will be a CustomControl derived from PolyLine class. Does that make any sense?
Where do I start designing a Custom Control that contains child objects? I think this is a fun engineering-level question. I need to design a control which displays a line chart. What I want to be able to do is use a designer to add multiple Pens which actually describe the data and presentation so that it ends up with...
TITLE: Where do I start designing a Custom Control that contains child objects? QUESTION: I think this is a fun engineering-level question. I need to design a control which displays a line chart. What I want to be able to do is use a designer to add multiple Pens which actually describe the data and presentation so th...
[ "wpf", "xaml" ]
2
2
640
3
0
2008-09-08T12:22:31.457000
2008-09-15T15:34:23.933000
49,564
49,590
How to implement file upload progress bar on web?
I would like display something more meaningful that animated gif while users upload file to my web application. What possibilities do I have? Edit: I am using.Net but I don't mind if somebody shows me platform agnostic version.
Here are a couple of versions of what you're looking for for some common JavaScript toolkits. Mootools - http://digitarald.de/project/fancyupload/ Extjs - http://extjs.com/learn/Extension:UploadForm
How to implement file upload progress bar on web? I would like display something more meaningful that animated gif while users upload file to my web application. What possibilities do I have? Edit: I am using.Net but I don't mind if somebody shows me platform agnostic version.
TITLE: How to implement file upload progress bar on web? QUESTION: I would like display something more meaningful that animated gif while users upload file to my web application. What possibilities do I have? Edit: I am using.Net but I don't mind if somebody shows me platform agnostic version. ANSWER: Here are a coup...
[ ".net", "javascript", "ajax" ]
19
5
20,671
7
0
2008-09-08T12:24:25.103000
2008-09-08T12:41:40.880000
49,582
49,585
Re-Running Database Development Scripts
In our current database development evironment we have automated build procceses check all the sql code out of svn create database scripts and apply them to the various development/qa databases. This is all well and good, and is a tremdous improvement over what we did in the past, but we have a problem with rerunning s...
I'm not sure how best to approach the problem in your specific environment, but I'd suggest reading up on Rail's migrations feature for some inspiration on how to get started. http://wiki.rubyonrails.org/rails/pages/UnderstandingMigrations
Re-Running Database Development Scripts In our current database development evironment we have automated build procceses check all the sql code out of svn create database scripts and apply them to the various development/qa databases. This is all well and good, and is a tremdous improvement over what we did in the past...
TITLE: Re-Running Database Development Scripts QUESTION: In our current database development evironment we have automated build procceses check all the sql code out of svn create database scripts and apply them to the various development/qa databases. This is all well and good, and is a tremdous improvement over what ...
[ "sql-server", "database", "version-control", "sdlc" ]
2
2
589
6
0
2008-09-08T12:34:47.763000
2008-09-08T12:38:15.147000
49,596
49,620
String initialization with and without explicit trailing terminator
What is the difference between char str1[32] = "\0"; and char str2[32] = "";
Since you already declared the sizes, the two declarations are exactly equal. However, if you do not specify the sizes, you can see that the first declaration makes a larger string: char a[] = "a\0"; char b[] = "a"; printf("%i %i\n", sizeof(a), sizeof(b)); prints 3 2 This is because a ends with two nulls (the explicit...
String initialization with and without explicit trailing terminator What is the difference between char str1[32] = "\0"; and char str2[32] = "";
TITLE: String initialization with and without explicit trailing terminator QUESTION: What is the difference between char str1[32] = "\0"; and char str2[32] = ""; ANSWER: Since you already declared the sizes, the two declarations are exactly equal. However, if you do not specify the sizes, you can see that the first d...
[ "c" ]
15
23
9,989
4
0
2008-09-08T12:45:16.660000
2008-09-08T12:53:59.167000
49,599
49,654
Binding custom functions to DOM events in prototype?
Jquery has a great language construct that looks like this: $(document).ready(function() { $("a").click(function() { alert("Hello world!"); }); }); As you might guess this, once the document has loaded, binds a custom function to the onClick event of all a tags. The question is, how can I achieve this same kind of beha...
Prototype 1.6 provides the dom:loaded event on document: document.observe("dom:loaded", function() { $$('a').each(function(elem) { elem.observe("click", function() { alert("Hello World"); }); }); }); I also use the each iterator on the array returned by $$().
Binding custom functions to DOM events in prototype? Jquery has a great language construct that looks like this: $(document).ready(function() { $("a").click(function() { alert("Hello world!"); }); }); As you might guess this, once the document has loaded, binds a custom function to the onClick event of all a tags. The ...
TITLE: Binding custom functions to DOM events in prototype? QUESTION: Jquery has a great language construct that looks like this: $(document).ready(function() { $("a").click(function() { alert("Hello world!"); }); }); As you might guess this, once the document has loaded, binds a custom function to the onClick event o...
[ "javascript", "dom", "prototypejs" ]
3
8
8,078
3
0
2008-09-08T12:46:08.873000
2008-09-08T13:03:10.877000
49,601
49,606
Is there a barebones Windows version control system that's suitable for only one guy?
I'm trying to find a source control for my own personal use that's as simple as possible. The main feature I need is being able to read/pull a past version of my code. I am the only developer. I've looked at a lot of different version control systems, but they all seem way more complicated than I need. I need one that'...
Subversion is great -- you can run the server yourself or use something like assembla.com to host your code (although that exposes it to the network). There are numerous gui applications like tortoise svn that would allow you to interact w/ the source control repo
Is there a barebones Windows version control system that's suitable for only one guy? I'm trying to find a source control for my own personal use that's as simple as possible. The main feature I need is being able to read/pull a past version of my code. I am the only developer. I've looked at a lot of different version...
TITLE: Is there a barebones Windows version control system that's suitable for only one guy? QUESTION: I'm trying to find a source control for my own personal use that's as simple as possible. The main feature I need is being able to read/pull a past version of my code. I am the only developer. I've looked at a lot of...
[ "windows", "version-control" ]
33
40
21,491
26
0
2008-09-08T12:46:57.670000
2008-09-08T12:49:13.780000
49,602
49,604
How to limit result set size for arbitrary query in Ingres?
In Oracle, the number of rows returned in an arbitrary query can be limited by filtering on the "virtual" rownum column. Consider the following example, which will return, at most, 10 rows. SELECT * FROM all_tables WHERE rownum <= 10 Is there a simple, generic way to do something similar in Ingres?
Blatantly changing my answer. "Limit 10" works for MySql and others, Ingres uses Select First 10 * from myTable Ref
How to limit result set size for arbitrary query in Ingres? In Oracle, the number of rows returned in an arbitrary query can be limited by filtering on the "virtual" rownum column. Consider the following example, which will return, at most, 10 rows. SELECT * FROM all_tables WHERE rownum <= 10 Is there a simple, generic...
TITLE: How to limit result set size for arbitrary query in Ingres? QUESTION: In Oracle, the number of rows returned in an arbitrary query can be limited by filtering on the "virtual" rownum column. Consider the following example, which will return, at most, 10 rows. SELECT * FROM all_tables WHERE rownum <= 10 Is there...
[ "sql", "oracle", "ingres" ]
4
6
7,828
4
0
2008-09-08T12:47:26.780000
2008-09-08T12:48:50.520000
49,630
49,687
Problems with mouseout event
I'm using JavaScript to hide an image and show some text thats hidden under it. But, when the text is shown if you scroll over it, it fires the mouseout event on the container, that then hides the text and shows the image again, and it just goes into a weird loop. The html looks like this: some content some more conten...
I'd give the container div: position: relative; and add a third div in the container (should be the last child of the container) with: position: absolute; top: 0; bottom: 0; left: 0; right: 0; and catch the mouseover and mouseout events on this div instead. Because it has no child elements, you shouldn't get spurious m...
Problems with mouseout event I'm using JavaScript to hide an image and show some text thats hidden under it. But, when the text is shown if you scroll over it, it fires the mouseout event on the container, that then hides the text and shows the image again, and it just goes into a weird loop. The html looks like this: ...
TITLE: Problems with mouseout event QUESTION: I'm using JavaScript to hide an image and show some text thats hidden under it. But, when the text is shown if you scroll over it, it fires the mouseout event on the container, that then hides the text and shows the image again, and it just goes into a weird loop. The html...
[ "javascript", "html", "events", "scriptaculous" ]
6
5
6,385
6
0
2008-09-08T12:55:33.890000
2008-09-08T13:20:28.900000
49,652
70,367
Are there any good automated test suites for Perl?
Can someone suggest some good automated test suite framework for Perl?
It really depends on what you're trying to do, but here's some background for much of this. First, you would generally write your test programs with Test::More or Test::Simple as the core testing program: use Test::More tests => 2; is 3, 3, 'basic equality should work'; ok!0, '... and zero should be false'; Internally...
Are there any good automated test suites for Perl? Can someone suggest some good automated test suite framework for Perl?
TITLE: Are there any good automated test suites for Perl? QUESTION: Can someone suggest some good automated test suite framework for Perl? ANSWER: It really depends on what you're trying to do, but here's some background for much of this. First, you would generally write your test programs with Test::More or Test::Si...
[ "perl", "testing" ]
9
24
2,913
14
0
2008-09-08T13:01:08.387000
2008-09-16T08:30:52.367000
49,662
49,666
Software evaluation licensing
My company is looking to start distributing some software we developed and would like to be able to let people try the software out before buying. We'd also like to make sure it can't be copied and distributed to our customers' customers. One model we've seen is tying a license to a MAC address so the software will onl...
I'd suggest you take the pieces of information you want in the key, and hash it with md5, and then just take the first X characters (where X is a key length you think is manageable). Cryptographically, it's far from perfect, but this is the sort of area where you want to put in the minimum amount of effort which will s...
Software evaluation licensing My company is looking to start distributing some software we developed and would like to be able to let people try the software out before buying. We'd also like to make sure it can't be copied and distributed to our customers' customers. One model we've seen is tying a license to a MAC ad...
TITLE: Software evaluation licensing QUESTION: My company is looking to start distributing some software we developed and would like to be able to let people try the software out before buying. We'd also like to make sure it can't be copied and distributed to our customers' customers. One model we've seen is tying a l...
[ "licensing" ]
13
8
11,305
10
0
2008-09-08T13:06:22.273000
2008-09-08T13:09:12.983000
49,663
49,679
Where can I find thorough DCOM documentation?
I work on an application that uses DCOM to communicate between what are essentially several peers; in the course of normal use, instances on separate machines serve a variety of objects to one another. Historically, for this to work we have used some magic incantations, chief among which is that on every machine the us...
Programming Windows Security by Keith Brown includes a thorough discussion of DCOM security. I can highly recommend this book.
Where can I find thorough DCOM documentation? I work on an application that uses DCOM to communicate between what are essentially several peers; in the course of normal use, instances on separate machines serve a variety of objects to one another. Historically, for this to work we have used some magic incantations, chi...
TITLE: Where can I find thorough DCOM documentation? QUESTION: I work on an application that uses DCOM to communicate between what are essentially several peers; in the course of normal use, instances on separate machines serve a variety of objects to one another. Historically, for this to work we have used some magic...
[ "windows", "security", "rpc", "dcom" ]
2
1
603
2
0
2008-09-08T13:06:32.880000
2008-09-08T13:15:14.967000
49,664
519,435
Sources of inspiration for navigation breadcrumbs
I'm looking for sources of inspiration and/or design patterns for navigation 'breadcrumbs'. So far I have found the breadcrumb collection on Pattern Tap. Does anyone know of any other sources?
http://www.greepit.com/2009/02/06/breadcrumb-inspiration-for-designers/
Sources of inspiration for navigation breadcrumbs I'm looking for sources of inspiration and/or design patterns for navigation 'breadcrumbs'. So far I have found the breadcrumb collection on Pattern Tap. Does anyone know of any other sources?
TITLE: Sources of inspiration for navigation breadcrumbs QUESTION: I'm looking for sources of inspiration and/or design patterns for navigation 'breadcrumbs'. So far I have found the breadcrumb collection on Pattern Tap. Does anyone know of any other sources? ANSWER: http://www.greepit.com/2009/02/06/breadcrumb-inspi...
[ "html", "css", "design-patterns", "navigation" ]
8
2
2,387
8
0
2008-09-08T13:07:58.197000
2009-02-06T07:29:34.240000
49,699
65,731
Anyone know of Objective-J syntax highlighting in vi?
I have been looking at the new Objective-J / Cappuccino javascript framework from 280North. They provide plug-ins for SubEthaEdit and TextMate to handle syntax highlighting, but I primarily use vi. Does anyone know of a way to get Objective-J syntax highlighting in vi, or a good way to convert whatever format the other...
The Objective-J Tools package ( http://cappuccino.org/download ) and the source on github now include a vim highlight module.
Anyone know of Objective-J syntax highlighting in vi? I have been looking at the new Objective-J / Cappuccino javascript framework from 280North. They provide plug-ins for SubEthaEdit and TextMate to handle syntax highlighting, but I primarily use vi. Does anyone know of a way to get Objective-J syntax highlighting in ...
TITLE: Anyone know of Objective-J syntax highlighting in vi? QUESTION: I have been looking at the new Objective-J / Cappuccino javascript framework from 280North. They provide plug-ins for SubEthaEdit and TextMate to handle syntax highlighting, but I primarily use vi. Does anyone know of a way to get Objective-J synta...
[ "javascript", "vi", "cappuccino", "objective-j" ]
10
7
2,904
4
0
2008-09-08T13:23:50.373000
2008-09-15T19:03:16.210000
49,718
49,733
Templates In VB
I've got some VB code (actually VBA) which is basically the same except for the type on which it operates. Since I think the DRY principle is a good guiding principle for software development, I want to write one routine for all of the different types which need to be operated on. For example if I had two snippets of c...
There's nothing in VB6 that will do that. If you update to Visual Studio Tools for Office with.Net you can use generics: Function MyRoutine(Of O)(R As Delegate, newvalue As Object) As O Dim i As O = CType(r.Method.Invoke(Nothing, Nothing), O) 'you need another parameter to tell it which property to use' ' and then use...
Templates In VB I've got some VB code (actually VBA) which is basically the same except for the type on which it operates. Since I think the DRY principle is a good guiding principle for software development, I want to write one routine for all of the different types which need to be operated on. For example if I had t...
TITLE: Templates In VB QUESTION: I've got some VB code (actually VBA) which is basically the same except for the type on which it operates. Since I think the DRY principle is a good guiding principle for software development, I want to write one routine for all of the different types which need to be operated on. For ...
[ "vba", "templates" ]
2
1
1,661
1
0
2008-09-08T13:33:55.140000
2008-09-08T13:43:28.097000