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
111,683
111,704
How do you automate some routine actions for improving productivity?
Every morning, after logging into your machine, you do a variety of routine stuffs. The list can include stuffs like opening/checking your email clients, rss readers, launching visual studio, running some business apps, typing some replies, getting latest version from Source Control, compiling, connecting to a differen...
A favorite way is to leave the computer on at night or better, if it's a laptop, put it to sleep. Running a web browsing virtual machine in VMware or similar works also, you can set the VM start along with the machine and save its state on shutdown, so your web pages and email client stay open. This works for developme...
How do you automate some routine actions for improving productivity? Every morning, after logging into your machine, you do a variety of routine stuffs. The list can include stuffs like opening/checking your email clients, rss readers, launching visual studio, running some business apps, typing some replies, getting la...
TITLE: How do you automate some routine actions for improving productivity? QUESTION: Every morning, after logging into your machine, you do a variety of routine stuffs. The list can include stuffs like opening/checking your email clients, rss readers, launching visual studio, running some business apps, typing some r...
[ "automation" ]
7
3
1,223
8
0
2008-09-21T18:45:01.483000
2008-09-21T18:51:09.610000
111,686
111,713
DropShadowBitmapEffect Doesn't work on TextBlock
Does anyone know why the DropShadowBitmapEffect and the EmbossBitmapEffect won't work on a TextBlock (not textBOX) in WPF? OuterGlow, Blur and Bevel seem to work fine. The transparent background brush is apparently not the answer because you can get a dropshadow with a null background brush. The default softness on a d...
Bitmap effects work by looking at the post-rendered pixels and running standard image manipulation on them. It should only be dependent on the color of the pixels. I wonder if their algorithms don't work well on white. Try changing the color to see if that has an effect -- if it does, you might want to try putting a bl...
DropShadowBitmapEffect Doesn't work on TextBlock Does anyone know why the DropShadowBitmapEffect and the EmbossBitmapEffect won't work on a TextBlock (not textBOX) in WPF? OuterGlow, Blur and Bevel seem to work fine. The transparent background brush is apparently not the answer because you can get a dropshadow with a n...
TITLE: DropShadowBitmapEffect Doesn't work on TextBlock QUESTION: Does anyone know why the DropShadowBitmapEffect and the EmbossBitmapEffect won't work on a TextBlock (not textBOX) in WPF? OuterGlow, Blur and Bevel seem to work fine. The transparent background brush is apparently not the answer because you can get a d...
[ "wpf", "bitmapeffect" ]
0
2
1,836
2
0
2008-09-21T18:45:42.760000
2008-09-21T18:52:25.723000
111,687
111,724
Ruby - Ensure Syslog Gets Closed
Is it absolutely critical that I always close Syslog when I'm done using it? Is there a huge negative impact from not doing so? If it turns out that I definitely need to, what's a good way to do it? I'm opening Syslog in my class constructor and I don't see a way to do class destructors in Ruby, and currently have some...
The open method accepts a block. Do something like this: class Foo def do_something Syslog.open do # work with the syslog here end end end
Ruby - Ensure Syslog Gets Closed Is it absolutely critical that I always close Syslog when I'm done using it? Is there a huge negative impact from not doing so? If it turns out that I definitely need to, what's a good way to do it? I'm opening Syslog in my class constructor and I don't see a way to do class destructors...
TITLE: Ruby - Ensure Syslog Gets Closed QUESTION: Is it absolutely critical that I always close Syslog when I'm done using it? Is there a huge negative impact from not doing so? If it turns out that I definitely need to, what's a good way to do it? I'm opening Syslog in my class constructor and I don't see a way to do...
[ "ruby", "syslog" ]
1
2
997
2
0
2008-09-21T18:46:01.637000
2008-09-21T18:54:33.707000
111,700
111,742
6502 CPU Emulation
It's the weekend, so I relax from spending all week programming by writing a hobby project. I wrote the framework of a MOS 6502 CPU emulator yesterday, the registers, stack, memory and all the opcodes are implemented. (Link to source below) I can manually run a series of operations in the debugger I wrote, but I'd like...
The opcode takes one byte, and the operands are in the following bytes. Check out the byte size column here, for instance.
6502 CPU Emulation It's the weekend, so I relax from spending all week programming by writing a hobby project. I wrote the framework of a MOS 6502 CPU emulator yesterday, the registers, stack, memory and all the opcodes are implemented. (Link to source below) I can manually run a series of operations in the debugger I ...
TITLE: 6502 CPU Emulation QUESTION: It's the weekend, so I relax from spending all week programming by writing a hobby project. I wrote the framework of a MOS 6502 CPU emulator yesterday, the registers, stack, memory and all the opcodes are implemented. (Link to source below) I can manually run a series of operations ...
[ "emulation", "machine-code", "6502" ]
21
13
7,145
7
0
2008-09-21T18:50:06.320000
2008-09-21T18:59:56.733000
111,707
112,256
Zero SQL deadlock by design - any coding patterns?
I am encountering very infrequent yet annoying SQL deadlocks on a.NET 2.0 webapp running on top of MS SQL Server 2005. In the past, we have been dealing with the SQL deadlocks in the very empirical way - basically tweaking the queries until it work. Yet, I found this approach very unsatisfactory: time consuming and unr...
Writing deadlock-proof code is really hard. Even when you access the tables in the same order you may still get deadlocks [1]. I wrote a post on my blog that elaborates through some approaches that will help you avoid and resolve deadlock situations. If you want to ensure two statements/transactions will never deadlock...
Zero SQL deadlock by design - any coding patterns? I am encountering very infrequent yet annoying SQL deadlocks on a.NET 2.0 webapp running on top of MS SQL Server 2005. In the past, we have been dealing with the SQL deadlocks in the very empirical way - basically tweaking the queries until it work. Yet, I found this a...
TITLE: Zero SQL deadlock by design - any coding patterns? QUESTION: I am encountering very infrequent yet annoying SQL deadlocks on a.NET 2.0 webapp running on top of MS SQL Server 2005. In the past, we have been dealing with the SQL deadlocks in the very empirical way - basically tweaking the queries until it work. Y...
[ "sql", "sql-server", "design-patterns", "deadlock" ]
32
21
8,493
10
0
2008-09-21T18:51:23.387000
2008-09-21T21:41:25.333000
111,744
151,740
How do you "preview" user actions like resize or editing in GoDiagrams?
The GoDiagram object model has a GoDocument. GoViews have a reference to a GoDocument. If the user does any modification on the diagramming surface, a GoDocument.Changed event is raised with the relevant information in the event arguments. I would like to be notified when some user-actions happen, so that I can confer ...
JFYI... The component-vendor recommendation is to subclass and override appropriate methods for this. Override the bool CanXXX() method, raise a cancelable custom event. If the subscriber returns false, bail out ( return false to abort the user action ) of CanXXX. No built-in mechanism for this in GoDiagrams. For examp...
How do you "preview" user actions like resize or editing in GoDiagrams? The GoDiagram object model has a GoDocument. GoViews have a reference to a GoDocument. If the user does any modification on the diagramming surface, a GoDocument.Changed event is raised with the relevant information in the event arguments. I would ...
TITLE: How do you "preview" user actions like resize or editing in GoDiagrams? QUESTION: The GoDiagram object model has a GoDocument. GoViews have a reference to a GoDocument. If the user does any modification on the diagramming surface, a GoDocument.Changed event is raised with the relevant information in the event a...
[ "winforms", "controls" ]
2
2
210
2
0
2008-09-21T19:01:21.333000
2008-09-30T04:19:48.590000
111,756
128,118
Web interface tool for debian repository?
What is the web interface tool that Debian or Ubuntu use for publicizing their custom repositories on the web? Like packages.debian.org Is such tool open sourced, so that it could be re-used for a custom repository?
The scripts that manage the archive are open source, they're in a debian package called dak. I don't think this includes the web pages, but I'm not sure. I'd suggest emailling ftpmaster@debian.org or debian-www@lists.debian.org and asking. Parsing the packages file is indeed very straightforward but there's still a lot...
Web interface tool for debian repository? What is the web interface tool that Debian or Ubuntu use for publicizing their custom repositories on the web? Like packages.debian.org Is such tool open sourced, so that it could be re-used for a custom repository?
TITLE: Web interface tool for debian repository? QUESTION: What is the web interface tool that Debian or Ubuntu use for publicizing their custom repositories on the web? Like packages.debian.org Is such tool open sourced, so that it could be re-used for a custom repository? ANSWER: The scripts that manage the archive...
[ "web-applications", "debian", "packaging" ]
1
2
2,340
3
0
2008-09-21T19:04:27.223000
2008-09-24T16:13:23.740000
111,763
111,783
Where can I learn about proven methods for sharing cryptographic keys?
Suppose that a group wants to encrypt some information, then share the encryption key among the group members in a way that requires the consensus of the group to decrypt the information. I'm interested in a variety of scenarios where the breadth of consensus ranges from unanimity to an absolute majority. A useful tech...
I have always been fascinated by this secret sharing technique. I've seen code implementing it on the internet, but have never seen actual applications. Shamir's secret sharing The wikipedia article links to some actual code, as well as the original academic article.
Where can I learn about proven methods for sharing cryptographic keys? Suppose that a group wants to encrypt some information, then share the encryption key among the group members in a way that requires the consensus of the group to decrypt the information. I'm interested in a variety of scenarios where the breadth of...
TITLE: Where can I learn about proven methods for sharing cryptographic keys? QUESTION: Suppose that a group wants to encrypt some information, then share the encryption key among the group members in a way that requires the consensus of the group to decrypt the information. I'm interested in a variety of scenarios wh...
[ "security", "language-agnostic", "encryption", "key-management" ]
10
10
1,025
5
0
2008-09-21T19:06:23.350000
2008-09-21T19:13:26.670000
111,769
111,779
How to install a masked package in Gentoo 2008?
I searched the net and handbook, but I only managed to learn what is the masked package, and not how to install it. I did find some commands, but they don't seem to work on 2008 (looking at it, it seems those are for earlier versions). I have something like this: localhost ~ # emerge flamerobin Calculating dependencies...
Simply mkdir /etc/portage and edit as mentioned here: http://gentoo-wiki.com/TIP_Dealing_with_masked_packages#But_you_want_to_install_the_package_anyway...
How to install a masked package in Gentoo 2008? I searched the net and handbook, but I only managed to learn what is the masked package, and not how to install it. I did find some commands, but they don't seem to work on 2008 (looking at it, it seems those are for earlier versions). I have something like this: localhos...
TITLE: How to install a masked package in Gentoo 2008? QUESTION: I searched the net and handbook, but I only managed to learn what is the masked package, and not how to install it. I did find some commands, but they don't seem to work on 2008 (looking at it, it seems those are for earlier versions). I have something l...
[ "installation", "gentoo" ]
3
2
11,180
3
0
2008-09-21T19:07:23.957000
2008-09-21T19:10:21.297000
111,785
111,811
Datagridview virtual model combobox
how can you dynamically add items to a combobox using the datagridview virtual mode?
Well, I assume you are working with a very large set of data, and thus are using virtual mode to implement your own data binding. If that is the case here is a link that demonstrates the process: http://msdn.microsoft.com/en-us/library/2b177d6d.aspx It primarily involves implementing an event handler for the CellValueN...
Datagridview virtual model combobox how can you dynamically add items to a combobox using the datagridview virtual mode?
TITLE: Datagridview virtual model combobox QUESTION: how can you dynamically add items to a combobox using the datagridview virtual mode? ANSWER: Well, I assume you are working with a very large set of data, and thus are using virtual mode to implement your own data binding. If that is the case here is a link that de...
[ "c#", "datagridview", "combobox" ]
1
1
1,725
1
0
2008-09-21T19:15:15.230000
2008-09-21T19:25:54.487000
111,792
111,803
How would you format multiple properties when using Property Initialization? (.Net)
For example: root.Nodes.Add(new TNode() { Foo1 = bar1, Foo2 = bar2, Foo3 = bar3 }); or: root.Nodes.Add(new TNode() { Foo1 = bar1, Foo2 = bar2, Foo3 = bar3 });
I've done it both ways.. IMO it depends on the complexity of the initialization. If it is simple 2 or 3 properties I will initialize on one line generally, but if i'm setting up an object with values for insertion into a database or something that has alot of properties i'll break it out like your second example. Incom...
How would you format multiple properties when using Property Initialization? (.Net) For example: root.Nodes.Add(new TNode() { Foo1 = bar1, Foo2 = bar2, Foo3 = bar3 }); or: root.Nodes.Add(new TNode() { Foo1 = bar1, Foo2 = bar2, Foo3 = bar3 });
TITLE: How would you format multiple properties when using Property Initialization? (.Net) QUESTION: For example: root.Nodes.Add(new TNode() { Foo1 = bar1, Foo2 = bar2, Foo3 = bar3 }); or: root.Nodes.Add(new TNode() { Foo1 = bar1, Foo2 = bar2, Foo3 = bar3 }); ANSWER: I've done it both ways.. IMO it depends on the com...
[ ".net", "formatting", "coding-style", "convention" ]
2
2
151
3
0
2008-09-21T19:20:55.873000
2008-09-21T19:24:10.110000
111,812
111,926
Best practice for naming convention of UI controls for referencing in code-behind?
What is the best practice for naming UI controls (textboxes, drop-downs, etc.) on forms and reports for reference in the code-behind pages? I develop a lot of reports and forms in my office. I have several web applications providing about 80+ "live" reports being generated from various and multiple data sources (Access...
The main product I work on at work uses the txt_ pnl_ etc prefixes. This does work, though it is a bit of a pain at times when switching something that just hides/shows controls from say, a tr to a panel because you have to rename it. What I've started doing in new projects, is naming my UI controls with a ui prefix; f...
Best practice for naming convention of UI controls for referencing in code-behind? What is the best practice for naming UI controls (textboxes, drop-downs, etc.) on forms and reports for reference in the code-behind pages? I develop a lot of reports and forms in my office. I have several web applications providing abou...
TITLE: Best practice for naming convention of UI controls for referencing in code-behind? QUESTION: What is the best practice for naming UI controls (textboxes, drop-downs, etc.) on forms and reports for reference in the code-behind pages? I develop a lot of reports and forms in my office. I have several web applicati...
[ "naming-conventions", "report" ]
7
7
10,811
7
0
2008-09-21T19:26:01.587000
2008-09-21T20:04:28.157000
111,814
111,823
What is the best way to improve ASP.NET/C# compilation speed?
UPDATE: Focus your answers on hardware solutions please. What hardware/tools/add-in are you using to improve ASP.NET compilation and first execution speed? We are looking at solid state hard drives to speed things up, but the prices are really high right now. I have two 7200rpm harddrives in RAID 0 right now and I'm no...
One of the important things to do is keeping projects of not-so-often changed assemblies unloaded. When a change occurs, load it, compile and unload again. It makes huge differences in large solutions.
What is the best way to improve ASP.NET/C# compilation speed? UPDATE: Focus your answers on hardware solutions please. What hardware/tools/add-in are you using to improve ASP.NET compilation and first execution speed? We are looking at solid state hard drives to speed things up, but the prices are really high right now...
TITLE: What is the best way to improve ASP.NET/C# compilation speed? QUESTION: UPDATE: Focus your answers on hardware solutions please. What hardware/tools/add-in are you using to improve ASP.NET compilation and first execution speed? We are looking at solid state hard drives to speed things up, but the prices are rea...
[ "c#", ".net", "asp.net" ]
7
10
5,128
9
0
2008-09-21T19:26:25.720000
2008-09-21T19:29:49.597000
111,817
111,967
What is the easiest way to upgrade a large C# winforms app to WPF
I work on a large C# application (approximately 450,000 lines of code), we constantly have problems with desktop heap and GDI handle leaks. WPF solves these issues, but I don't know what is the best way to upgrade (I expect this is going to take a long time). The application has only a few forms but these can contain m...
You can start by creating a WPF host. Then you can use the control to host your current application. Then, I suggest creating a library of your new controls in WPF. One at a time, you can create the controls (I suggest making them custom controls, not usercontrols). Within the style for each control, you can start with...
What is the easiest way to upgrade a large C# winforms app to WPF I work on a large C# application (approximately 450,000 lines of code), we constantly have problems with desktop heap and GDI handle leaks. WPF solves these issues, but I don't know what is the best way to upgrade (I expect this is going to take a long t...
TITLE: What is the easiest way to upgrade a large C# winforms app to WPF QUESTION: I work on a large C# application (approximately 450,000 lines of code), we constantly have problems with desktop heap and GDI handle leaks. WPF solves these issues, but I don't know what is the best way to upgrade (I expect this is goin...
[ "c#", ".net", "wpf", "upgrade" ]
14
12
4,318
5
0
2008-09-21T19:27:29.990000
2008-09-21T20:16:07.597000
111,854
111,898
GWT-EXT - What is the best way to widgets to a specific ContentPanel after an event?
first post don't hurt me:) I am using a BorderLayout with the usual North, West, Center, South Panels. On the West ContentPanel, I've got a Tree. If an event ( OnClick )occurs I want a particular dialog box displayed on the Center ContentPanel. What is the best way for me to do this? Currently I'm using a function call...
The way you are doing it is intuitive and works, but will start causing hell when the application grows, because different parts of the application are strongly coupled. The solutions to this problems are the MVC design pattern and the observer design pattern. Ideally, using the MVC pattern, you don't want any widget t...
GWT-EXT - What is the best way to widgets to a specific ContentPanel after an event? first post don't hurt me:) I am using a BorderLayout with the usual North, West, Center, South Panels. On the West ContentPanel, I've got a Tree. If an event ( OnClick )occurs I want a particular dialog box displayed on the Center Cont...
TITLE: GWT-EXT - What is the best way to widgets to a specific ContentPanel after an event? QUESTION: first post don't hurt me:) I am using a BorderLayout with the usual North, West, Center, South Panels. On the West ContentPanel, I've got a Tree. If an event ( OnClick )occurs I want a particular dialog box displayed ...
[ "gwt", "gwt-ext" ]
0
1
1,118
1
0
2008-09-21T19:38:45.207000
2008-09-21T19:52:57.653000
111,866
112,519
Best way to remove from NSMutableArray while iterating?
In Cocoa, if I want to loop through an NSMutableArray and remove multiple objects that fit a certain criteria, what's the best way to do this without restarting the loop each time I remove an object? Thanks, Edit: Just to clarify - I was looking for the best way, e.g. something more elegant than manually updating the i...
For clarity I like to make an initial loop where I collect the items to delete. Then I delete them. Here's a sample using Objective-C 2.0 syntax: NSMutableArray *discardedItems = [NSMutableArray array]; for (SomeObjectClass *item in originalArrayOfItems) { if ([item shouldBeDiscarded]) [discardedItems addObject:item];...
Best way to remove from NSMutableArray while iterating? In Cocoa, if I want to loop through an NSMutableArray and remove multiple objects that fit a certain criteria, what's the best way to do this without restarting the loop each time I remove an object? Thanks, Edit: Just to clarify - I was looking for the best way, ...
TITLE: Best way to remove from NSMutableArray while iterating? QUESTION: In Cocoa, if I want to loop through an NSMutableArray and remove multiple objects that fit a certain criteria, what's the best way to do this without restarting the loop each time I remove an object? Thanks, Edit: Just to clarify - I was looking ...
[ "objective-c", "cocoa" ]
199
392
153,674
20
0
2008-09-21T19:43:20.500000
2008-09-21T23:23:49.080000
111,868
508,306
What is your latest useful Perl one-liner (or a pipe involving Perl)?
The one-liner should: solve a real-world problem not be extensively cryptic (should be easy to understand and reproduce) be worth the time it takes to write it (should not be too clever) I'm looking for practical tips and tricks (complementary examples for perldoc perlrun ).
All one-liners from the answers collected in one place: perl -pe's/([\d.]+)/localtime $1/e;' access.log ack $(ls t/lib/TestPM/|awk -F'.' '{print $1}'|xargs perl -e 'print join "|" => @ARGV') aggtests/ t -l perl -e'while(<*.avi>) { s/avi$/srt/; rename <*.srt>, $_ }' find. -name '*.whatever' | perl -lne unlink tail -F /v...
What is your latest useful Perl one-liner (or a pipe involving Perl)? The one-liner should: solve a real-world problem not be extensively cryptic (should be easy to understand and reproduce) be worth the time it takes to write it (should not be too clever) I'm looking for practical tips and tricks (complementary exampl...
TITLE: What is your latest useful Perl one-liner (or a pipe involving Perl)? QUESTION: The one-liner should: solve a real-world problem not be extensively cryptic (should be easy to understand and reproduce) be worth the time it takes to write it (should not be too clever) I'm looking for practical tips and tricks (co...
[ "shell", "perl", "command-line" ]
16
8
14,541
24
0
2008-09-21T19:43:29.250000
2009-02-03T18:26:48.130000
111,910
111,915
source control with VB2005 Express
Can anyone suggest a good source control system that interfaces with VB2005 Express? As the Express editions of Visual Studio do not allow add-ins does this mean that I will not be able to integrate source control into the IDE? I'm used to the check-in/check-out process of SourceSafe integrated into VB6. Can anyone rec...
TortoiseSVN is a good choice. Although it won't integrate into the IDE (because of the plug-in problem you mentioned), it's really solid in the Explorer right-button menu. Also consider Vault from SourceGear. If you're used to SourceSafe, Vault will be easier to learn; Vault was specifically designed for ex-SourceSafe ...
source control with VB2005 Express Can anyone suggest a good source control system that interfaces with VB2005 Express? As the Express editions of Visual Studio do not allow add-ins does this mean that I will not be able to integrate source control into the IDE? I'm used to the check-in/check-out process of SourceSafe ...
TITLE: source control with VB2005 Express QUESTION: Can anyone suggest a good source control system that interfaces with VB2005 Express? As the Express editions of Visual Studio do not allow add-ins does this mean that I will not be able to integrate source control into the IDE? I'm used to the check-in/check-out proc...
[ "vb.net", "version-control" ]
3
4
477
5
0
2008-09-21T19:58:01.370000
2008-09-21T20:00:04.547000
111,927
112,220
How to access the HttpServerUtility.MapPath method in a Thread or Timer?
I use a System.Timers.Timer in my Asp.Net application and I need to use the HttpServerUtility.MapPath method which seems to be only available via HttpContext.Current.Server.MapPath. The problem is that HttpContext.Current is null when the Timer.Elapsed event fires. Is there another way to get a reference to a HttpServe...
It's possible to use HostingEnvironment.MapPath() instead of HttpContext.Current.Server.MapPath() I haven't tried it yet in a thread or timer event though. Some (non viable) solutions I considered; The only method I care about on HttpServerUtility is MapPath. So as an alternative I could use AppDomain.CurrentDomain.Bas...
How to access the HttpServerUtility.MapPath method in a Thread or Timer? I use a System.Timers.Timer in my Asp.Net application and I need to use the HttpServerUtility.MapPath method which seems to be only available via HttpContext.Current.Server.MapPath. The problem is that HttpContext.Current is null when the Timer.El...
TITLE: How to access the HttpServerUtility.MapPath method in a Thread or Timer? QUESTION: I use a System.Timers.Timer in my Asp.Net application and I need to use the HttpServerUtility.MapPath method which seems to be only available via HttpContext.Current.Server.MapPath. The problem is that HttpContext.Current is null...
[ ".net", "asp.net", "timer", "httpcontext" ]
91
144
41,129
6
0
2008-09-21T20:04:51.120000
2008-09-21T21:19:40.347000
111,933
111,972
Why shouldn't I use "Hungarian Notation"?
I know what Hungarian refers to - giving information about a variable, parameter, or type as a prefix to its name. Everyone seems to be rabidly against it, even though in some cases it seems to be a good idea. If I feel that useful information is being imparted, why shouldn't I put it right there where it's available? ...
Most people use Hungarian notation in a wrong way and are getting wrong results. Read this excellent article by Joel Spolsky: Making Wrong Code Look Wrong. In short, Hungarian Notation where you prefix your variable names with their type (string) (Systems Hungarian) is bad because it's useless. Hungarian Notation as it...
Why shouldn't I use "Hungarian Notation"? I know what Hungarian refers to - giving information about a variable, parameter, or type as a prefix to its name. Everyone seems to be rabidly against it, even though in some cases it seems to be a good idea. If I feel that useful information is being imparted, why shouldn't I...
TITLE: Why shouldn't I use "Hungarian Notation"? QUESTION: I know what Hungarian refers to - giving information about a variable, parameter, or type as a prefix to its name. Everyone seems to be rabidly against it, even though in some cases it seems to be a good idea. If I feel that useful information is being imparte...
[ "language-agnostic", "naming-conventions", "hungarian-notation" ]
122
174
155,529
37
0
2008-09-21T20:08:53.497000
2008-09-21T20:18:55.623000
111,934
111,974
How do I find out the size of a Canvas text object in tkinter?
I want to create some text in a canvas: myText = self.canvas.create_text(5, 5, anchor=NW, text="TEST") Now how do I find the width and height of myText?
bounds = self.canvas.bbox(myText) # returns a tuple like (x1, y1, x2, y2) width = bounds[2] - bounds[0] height = bounds[3] - bounds[1] See the TkInter reference.
How do I find out the size of a Canvas text object in tkinter? I want to create some text in a canvas: myText = self.canvas.create_text(5, 5, anchor=NW, text="TEST") Now how do I find the width and height of myText?
TITLE: How do I find out the size of a Canvas text object in tkinter? QUESTION: I want to create some text in a canvas: myText = self.canvas.create_text(5, 5, anchor=NW, text="TEST") Now how do I find the width and height of myText? ANSWER: bounds = self.canvas.bbox(myText) # returns a tuple like (x1, y1, x2, y2) wid...
[ "python", "tkinter", "tkinter-canvas" ]
11
22
11,057
2
0
2008-09-21T20:08:56.943000
2008-09-21T20:19:34.297000
111,954
111,966
Using Python's ftplib to get a directory listing, portably
You can use ftplib for full FTP support in Python. However the preferred way of getting a directory listing is: # File: ftplib-example-1.py import ftplib ftp = ftplib.FTP("www.python.org") ftp.login("anonymous", "ftplib-example-1") data = [] ftp.dir(data.append) ftp.quit() for line in data: print "-", line Which ...
Try using ftp.nlst(dir). However, note that if the folder is empty, it might throw an error: files = [] try: files = ftp.nlst() except ftplib.error_perm as resp: if str(resp) == "550 No files found": print "No files in this directory" else: raise for f in files: print f
Using Python's ftplib to get a directory listing, portably You can use ftplib for full FTP support in Python. However the preferred way of getting a directory listing is: # File: ftplib-example-1.py import ftplib ftp = ftplib.FTP("www.python.org") ftp.login("anonymous", "ftplib-example-1") data = [] ftp.dir(data.ap...
TITLE: Using Python's ftplib to get a directory listing, portably QUESTION: You can use ftplib for full FTP support in Python. However the preferred way of getting a directory listing is: # File: ftplib-example-1.py import ftplib ftp = ftplib.FTP("www.python.org") ftp.login("anonymous", "ftplib-example-1") data = [...
[ "python", "ftp", "portability" ]
76
149
154,137
7
0
2008-09-21T20:13:18.477000
2008-09-21T20:15:59.517000
111,983
112,025
array.array versus numpy.array
If you are creating a 1d array in Python, is there any benefit to using the NumPy package?
It all depends on what you plan to do with the array. If all you're doing is creating arrays of simple data types and doing I/O, the array module will do just fine. If, on the other hand, you want to do any kind of numerical calculations, the array module doesn't provide any help with that. NumPy (and SciPy ) give you ...
array.array versus numpy.array If you are creating a 1d array in Python, is there any benefit to using the NumPy package?
TITLE: array.array versus numpy.array QUESTION: If you are creating a 1d array in Python, is there any benefit to using the NumPy package? ANSWER: It all depends on what you plan to do with the array. If all you're doing is creating arrays of simple data types and doing I/O, the array module will do just fine. If, on...
[ "python", "arrays", "numpy" ]
76
79
49,972
3
0
2008-09-21T20:23:02.027000
2008-09-21T20:31:39.667000
111,985
112,050
What are the cons of a web based application
I am going to write a database application for the camp I work for. I am thinking about writing it in C# with a Windows GUI interface but using a browser as the application is seeming more and more appelaing for various reasons. What I am wondering is why someone would not choose to write an application as a web applic...
There are plenty of cons: Speed and responsiveness tend to be significantly worse Complicated UI widgets (such as tree controls) are harder to do Rendering graphics of any kind is pretty tricky, 3D graphics is even harder You have to mess around with logins A centralised server means clients always need network access ...
What are the cons of a web based application I am going to write a database application for the camp I work for. I am thinking about writing it in C# with a Windows GUI interface but using a browser as the application is seeming more and more appelaing for various reasons. What I am wondering is why someone would not c...
TITLE: What are the cons of a web based application QUESTION: I am going to write a database application for the camp I work for. I am thinking about writing it in C# with a Windows GUI interface but using a browser as the application is seeming more and more appelaing for various reasons. What I am wondering is why s...
[ "database", "web-applications", "browser" ]
4
9
5,122
13
0
2008-09-21T20:23:42.010000
2008-09-21T20:40:36.727000
112,010
122,492
How to enable inno-db support on MySql 5 installed above MySql 4?
How to enable inno-db support on installed instance of MySql? I have installed mysql-5.0.67-win32. 'InnoDB' is 'DISABLED' when executing 'show engines'. According to documentation MySql is compiled with support of inno-db (From doc: A value of DISABLED occurs either because the server was started with an option that di...
I have resolved the problem. In short: I was not able to dump databases on MySql4 and restore it on MySql5 due to some strange syntactic errors when importing data. I tried after installation to override MySql5 databases with old ones, including database 'mysql'. It works ok but I was not able to enable inno-db support...
How to enable inno-db support on MySql 5 installed above MySql 4? How to enable inno-db support on installed instance of MySql? I have installed mysql-5.0.67-win32. 'InnoDB' is 'DISABLED' when executing 'show engines'. According to documentation MySql is compiled with support of inno-db (From doc: A value of DISABLED o...
TITLE: How to enable inno-db support on MySql 5 installed above MySql 4? QUESTION: How to enable inno-db support on installed instance of MySql? I have installed mysql-5.0.67-win32. 'InnoDB' is 'DISABLED' when executing 'show engines'. According to documentation MySql is compiled with support of inno-db (From doc: A v...
[ "mysql", "innodb" ]
2
0
14,348
6
0
2008-09-21T20:29:08.737000
2008-09-23T17:34:15.973000
112,036
115,926
Creating a column of RadioButtons in Adobe Flex
I'm using the AdvancedDataGrid widget and I want two columns to be radio buttons, where each column is it's own RadioButtonGroup. I thought I had all the necessary mxxml, but I'm running into a strange behavior issue. When I scroll up and down, the button change values! The selected button becomes deselected, and unsel...
What's happening here is that Flex only creates itemRenderer instances for the visible columns. When you scroll around, those instances get recycled. So if you scroll down, the RadioButton object that was drawing the first column of the first row may now have changed to instead be drawing the first column of the sevent...
Creating a column of RadioButtons in Adobe Flex I'm using the AdvancedDataGrid widget and I want two columns to be radio buttons, where each column is it's own RadioButtonGroup. I thought I had all the necessary mxxml, but I'm running into a strange behavior issue. When I scroll up and down, the button change values! T...
TITLE: Creating a column of RadioButtons in Adobe Flex QUESTION: I'm using the AdvancedDataGrid widget and I want two columns to be radio buttons, where each column is it's own RadioButtonGroup. I thought I had all the necessary mxxml, but I'm running into a strange behavior issue. When I scroll up and down, the butto...
[ "apache-flex" ]
0
1
11,770
2
0
2008-09-21T20:35:21.357000
2008-09-22T16:29:40.923000
112,046
112,059
How to deal with pair programming issues?
Some members of the team are having problems programming together. Different gender, different culture, different age. How to deal with those problems? - Do not pair them together, or - Pair them together and let them come to a "golden middle"
Pair programming is based on the idea that the interaction of two programmers adds value. If this is not true, change the pairs... let them choose. Programming should be fun!
How to deal with pair programming issues? Some members of the team are having problems programming together. Different gender, different culture, different age. How to deal with those problems? - Do not pair them together, or - Pair them together and let them come to a "golden middle"
TITLE: How to deal with pair programming issues? QUESTION: Some members of the team are having problems programming together. Different gender, different culture, different age. How to deal with those problems? - Do not pair them together, or - Pair them together and let them come to a "golden middle" ANSWER: Pair pr...
[ "agile", "pair-programming" ]
15
17
2,032
9
0
2008-09-21T20:38:07.670000
2008-09-21T20:41:47.520000
112,055
112,135
What does %~d0 mean in a Windows batch file?
I'm looking at a batch file which defines the following variables: set _SCRIPT_DRIVE=%~d0 set _SCRIPT_PATH=%~p0 What do %~d0 or %~p0 actually mean? Is there a set of well-known values for things like current directory, drive, parameters to a script? Are there any other similar shortcuts I could use?
The magic variables % n contains the arguments used to invoke the file: %0 is the path to the bat-file itself, %1 is the first argument after, %2 is the second and so on. Since the arguments are often file paths, there is some additional syntax to extract parts of the path. ~d is drive, ~p is the path (without drive), ...
What does %~d0 mean in a Windows batch file? I'm looking at a batch file which defines the following variables: set _SCRIPT_DRIVE=%~d0 set _SCRIPT_PATH=%~p0 What do %~d0 or %~p0 actually mean? Is there a set of well-known values for things like current directory, drive, parameters to a script? Are there any other simil...
TITLE: What does %~d0 mean in a Windows batch file? QUESTION: I'm looking at a batch file which defines the following variables: set _SCRIPT_DRIVE=%~d0 set _SCRIPT_PATH=%~p0 What do %~d0 or %~p0 actually mean? Is there a set of well-known values for things like current directory, drive, parameters to a script? Are the...
[ "windows", "batch-file" ]
417
629
433,766
9
0
2008-09-21T20:41:19.190000
2008-09-21T20:57:34.050000
112,064
112,088
What is an invariant?
The word seems to get used in a number of contexts. The best I can figure is that they mean a variable that can't change. Isn't that what constants/finals (darn you Java!) are for?
An invariant is more "conceptual" than a variable. In general, it's a property of the program state that is always true. A function or method that ensures that the invariant holds is said to maintain the invariant. For instance, a binary search tree might have the invariant that for every node, the key of the node's le...
What is an invariant? The word seems to get used in a number of contexts. The best I can figure is that they mean a variable that can't change. Isn't that what constants/finals (darn you Java!) are for?
TITLE: What is an invariant? QUESTION: The word seems to get used in a number of contexts. The best I can figure is that they mean a variable that can't change. Isn't that what constants/finals (darn you Java!) are for? ANSWER: An invariant is more "conceptual" than a variable. In general, it's a property of the prog...
[ "language-agnostic", "invariants" ]
197
279
50,458
13
0
2008-09-21T20:42:21.060000
2008-09-21T20:48:21.030000
112,085
112,100
Is this C++ structure initialization trick safe?
Instead of having to remember to initialize a simple 'C' structure, I might derive from it and zero it in the constructor like this: struct MY_STRUCT { int n1; int n2; }; class CMyStruct: public MY_STRUCT { public: CMyStruct() { memset(this, 0, sizeof(MY_STRUCT)); } }; This trick is often used to initialize Win32 stru...
PREAMBLE: While my answer is still Ok, I find litb's answer quite superior to mine because: It teaches me a trick that I did not know (litb's answers usually have this effect, but this is the first time I write it down) It answers exactly the question (that is, initializing the original struct's part to zero) So please...
Is this C++ structure initialization trick safe? Instead of having to remember to initialize a simple 'C' structure, I might derive from it and zero it in the constructor like this: struct MY_STRUCT { int n1; int n2; }; class CMyStruct: public MY_STRUCT { public: CMyStruct() { memset(this, 0, sizeof(MY_STRUCT)); } }; ...
TITLE: Is this C++ structure initialization trick safe? QUESTION: Instead of having to remember to initialize a simple 'C' structure, I might derive from it and zero it in the constructor like this: struct MY_STRUCT { int n1; int n2; }; class CMyStruct: public MY_STRUCT { public: CMyStruct() { memset(this, 0, sizeof(...
[ "c++", "data-structures" ]
31
19
33,985
16
0
2008-09-21T20:46:37.947000
2008-09-21T20:51:02.990000
112,093
112,106
Background color stretches accross entire width of ul
I have a simple list I am using for a horizontal menu: Menu Home Forum When I add a background color to the selected class, only the text gets the color, I want it to stretch the entire distance of the section. Hope this makes sense.
The a element is an inline element, meaning it only applies to the text it encloses. If you want the background color to stretch across horizontally, apply the selected class to a block level element. Applying the class to the li element should work fine. Alternatively, you could add this to the selected class' CSS: di...
Background color stretches accross entire width of ul I have a simple list I am using for a horizontal menu: Menu Home Forum When I add a background color to the selected class, only the text gets the color, I want it to stretch the entire distance of the section. Hope this makes sense.
TITLE: Background color stretches accross entire width of ul QUESTION: I have a simple list I am using for a horizontal menu: Menu Home Forum When I add a background color to the selected class, only the text gets the color, I want it to stretch the entire distance of the section. Hope this makes sense. ANSWER: The a...
[ "css" ]
4
11
10,484
5
0
2008-09-21T20:49:44.163000
2008-09-21T20:51:51.677000
112,112
112,128
Javascript interpreter to replace Python
In terms of quick dynamically typed languages, I'm really starting to like Javascript, as I use it a lot for web projects, especially because it uses the same syntax as Actionscript (flash). It would be an ideal language for shell scripting, making it easier to move code from the front and back end of a site, and less ...
Of course, in Windows, the JavaScript interpreter is shipped with the OS. Just run cscript or wscript against any.js file.
Javascript interpreter to replace Python In terms of quick dynamically typed languages, I'm really starting to like Javascript, as I use it a lot for web projects, especially because it uses the same syntax as Actionscript (flash). It would be an ideal language for shell scripting, making it easier to move code from th...
TITLE: Javascript interpreter to replace Python QUESTION: In terms of quick dynamically typed languages, I'm really starting to like Javascript, as I use it a lot for web projects, especially because it uses the same syntax as Actionscript (flash). It would be an ideal language for shell scripting, making it easier to...
[ "javascript", "shell", "scripting" ]
22
10
10,705
12
0
2008-09-21T20:52:55.823000
2008-09-21T20:56:57
112,121
112,324
Should I prefix my method with "get" or "load" when communicating with a web service?
I'm writing a desktop application that communicates with a web service. Would you name all web-service functions that that fetch data Load XXXX, since they take a while to execute. Or would you use Get XXXX, for instance when getting just a single object.
Use MyObject.GetXXXX() when the method returns XXXX. Use MyObject.LoadXXXX() when XXXX will be loaded into MyObject, in other words, when MyObject keeps control of XXXX. The same applies to webservices, I guess.
Should I prefix my method with "get" or "load" when communicating with a web service? I'm writing a desktop application that communicates with a web service. Would you name all web-service functions that that fetch data Load XXXX, since they take a while to execute. Or would you use Get XXXX, for instance when getting ...
TITLE: Should I prefix my method with "get" or "load" when communicating with a web service? QUESTION: I'm writing a desktop application that communicates with a web service. Would you name all web-service functions that that fetch data Load XXXX, since they take a while to execute. Or would you use Get XXXX, for inst...
[ "web-services", "naming-conventions" ]
1
11
803
6
0
2008-09-21T20:55:38.767000
2008-09-21T22:11:48.507000
112,131
112,170
How long does it really take to do something?
I mean name off a programming project you did and how long it took, please. The boss has never complained but I sometimes feel like things take too long. But this could be because I am impatient as well. Let me know your experiences for comparison. I've also noticed that things always seem to take longer, sometimes muc...
It is best to simply time yourself, record your estimates and determine the average percent you're off. Given that, as long as you are consistent, you can appropriately estimate actual times based on when you believed you'd get it done. It's not simply to determine how bad you are at estimating, but rather to take into...
How long does it really take to do something? I mean name off a programming project you did and how long it took, please. The boss has never complained but I sometimes feel like things take too long. But this could be because I am impatient as well. Let me know your experiences for comparison. I've also noticed that th...
TITLE: How long does it really take to do something? QUESTION: I mean name off a programming project you did and how long it took, please. The boss has never complained but I sometimes feel like things take too long. But this could be because I am impatient as well. Let me know your experiences for comparison. I've al...
[ "project-management", "time-management" ]
4
7
1,231
8
0
2008-09-21T20:57:07.407000
2008-09-21T21:08:00.063000
112,154
112,363
Searching for regex patterns on a 30GB XML dataset. Making use of 16gb of memory
I currently have a Java SAX parser that is extracting some info from a 30GB XML file. Presently it is: reading each XML node storing it into a string object, running some regexex on the string storing the results to the database For several million elements. I'm running this on a computer with 16GB of memory, but the m...
First, try to find out what's slowing you down. How much faster is the parser when you parse from memory? Does using a BufferedInputStream with a large size help? Is it easy to split up the XML file? In general, shuffling through 30 GiB of any kind of data will take some time, since you have to load it from the hard dr...
Searching for regex patterns on a 30GB XML dataset. Making use of 16gb of memory I currently have a Java SAX parser that is extracting some info from a 30GB XML file. Presently it is: reading each XML node storing it into a string object, running some regexex on the string storing the results to the database For severa...
TITLE: Searching for regex patterns on a 30GB XML dataset. Making use of 16gb of memory QUESTION: I currently have a Java SAX parser that is extracting some info from a 30GB XML file. Presently it is: reading each XML node storing it into a string object, running some regexex on the string storing the results to the d...
[ "java", "xml" ]
3
2
774
10
0
2008-09-21T21:04:07.357000
2008-09-21T22:28:40.557000
112,158
112,355
is the + operator less performant than StringBuffer.append()
On my team, we usually do string concatentation like this: var url = // some dynamically generated URL var sb = new StringBuffer(); sb.append(" click here "); Obviously the following is much more readable: var url = // some dynamically generated URL var sb = " click here "; But the JS experts claim that the + operator ...
Internet Explorer is the only browser which really suffers from this in today's world. (Versions 5, 6, and 7 were dog slow. 8 does not show the same degradation.) What's more, IE gets slower and slower the longer your string is. If you have long strings to concatenate then definitely use an array.join technique. (Or so...
is the + operator less performant than StringBuffer.append() On my team, we usually do string concatentation like this: var url = // some dynamically generated URL var sb = new StringBuffer(); sb.append(" click here "); Obviously the following is much more readable: var url = // some dynamically generated URL var sb = ...
TITLE: is the + operator less performant than StringBuffer.append() QUESTION: On my team, we usually do string concatentation like this: var url = // some dynamically generated URL var sb = new StringBuffer(); sb.append(" click here "); Obviously the following is much more readable: var url = // some dynamically gener...
[ "javascript", "string", "concatenation" ]
91
46
202,112
13
0
2008-09-21T21:04:34.720000
2008-09-21T22:26:10.077000
112,162
112,226
How do I get my Twitter feed to integrate with a blog (with individual comment threads)?
I would like to create a blog where my Twitter updates essentially create blog posts, with a comment thread. If there isn't blog software that does this right now (I did some searching but couldn't find the commenting aspect) what would be the simplest approach and starting blog software to do this? Potentially an alte...
If you would like to use Wordpress, you can use the Twitter Tools plugin. "Pull your tweets into your blog and create new tweets on blog posts and from within WordPress." Each tweet/blog post would automatically have comments enabled. Good luck man, Brian Gianforcaro
How do I get my Twitter feed to integrate with a blog (with individual comment threads)? I would like to create a blog where my Twitter updates essentially create blog posts, with a comment thread. If there isn't blog software that does this right now (I did some searching but couldn't find the commenting aspect) what ...
TITLE: How do I get my Twitter feed to integrate with a blog (with individual comment threads)? QUESTION: I would like to create a blog where my Twitter updates essentially create blog posts, with a comment thread. If there isn't blog software that does this right now (I did some searching but couldn't find the commen...
[ "twitter", "comments", "customization", "blogs" ]
1
2
657
2
0
2008-09-21T21:05:21.037000
2008-09-21T21:24:53.533000
112,169
112,213
Google Chrome broke ShellExecute()?
For years I've been using ShellExecute() API to launch the default web browser from within my applications. Like this: ShellExecute( hwnd, _T("open"), _T("http://www.winability.com/home/"), NULL, NULL, SW_NORMAL ); It's been working fine until a couple of weeks ago, when Google released its Chrome browser. Now, if Chro...
Here is the code that works across all browsers. The trick is to call WinExec if ShellExecute fails. HINSTANCE GotoURL(LPCTSTR url, int showcmd) { TCHAR key[MAX_PATH + MAX_PATH]; // First try ShellExecute() HINSTANCE result = 0; CString strURL = url; if ( strURL.Find(".htm") <0 && strURL.Find("http") <0 ) result = S...
Google Chrome broke ShellExecute()? For years I've been using ShellExecute() API to launch the default web browser from within my applications. Like this: ShellExecute( hwnd, _T("open"), _T("http://www.winability.com/home/"), NULL, NULL, SW_NORMAL ); It's been working fine until a couple of weeks ago, when Google relea...
TITLE: Google Chrome broke ShellExecute()? QUESTION: For years I've been using ShellExecute() API to launch the default web browser from within my applications. Like this: ShellExecute( hwnd, _T("open"), _T("http://www.winability.com/home/"), NULL, NULL, SW_NORMAL ); It's been working fine until a couple of weeks ago,...
[ ".net", "google-chrome", "shellexecute" ]
2
4
3,498
2
0
2008-09-21T21:07:57.677000
2008-09-21T21:17:31.803000
112,190
112,305
php.ini & SMTP= - how do you pass username & password
My ISP account requires that I send a username & password for outbound SMTP mail. How do I get PHP to use this when executing php.mail()? The php.ini file only contains entries for the server (SMTP= ) and From: (sendmail_from= ).
PHP mail() command does not support authentication. Your options: PHPMailer - Tutorial PEAR - Tutorial Custom functions - See various solutions in the notes section: http://php.net/manual/en/ref.mail.php
php.ini & SMTP= - how do you pass username & password My ISP account requires that I send a username & password for outbound SMTP mail. How do I get PHP to use this when executing php.mail()? The php.ini file only contains entries for the server (SMTP= ) and From: (sendmail_from= ).
TITLE: php.ini & SMTP= - how do you pass username & password QUESTION: My ISP account requires that I send a username & password for outbound SMTP mail. How do I get PHP to use this when executing php.mail()? The php.ini file only contains entries for the server (SMTP= ) and From: (sendmail_from= ). ANSWER: PHP mail(...
[ "php", "smtp", "email" ]
71
40
333,338
10
0
2008-09-21T21:11:35.013000
2008-09-21T22:02:10.883000
112,197
112,211
What is the best way to return multiple tags from a Rails Helper?
I want to create a hidden field and create a link in one helper and then output both to my erb. <%= my_cool_helper "something", form %> Should out put the results of link_to "something", a_path form.hidden_field "something".tableize,:value => "something" What would the definition of the helper look like? The details of...
There are several ways to do this. Remember that the existing rails helpers like link_to, etc, just output strings. You can concatenate the strings together and return that (which is what I do most of the time, if things are simple). EG: link_to( "something", something_path ) + #NOTE THE PLUS FOR STRING CONCAT form.hid...
What is the best way to return multiple tags from a Rails Helper? I want to create a hidden field and create a link in one helper and then output both to my erb. <%= my_cool_helper "something", form %> Should out put the results of link_to "something", a_path form.hidden_field "something".tableize,:value => "something"...
TITLE: What is the best way to return multiple tags from a Rails Helper? QUESTION: I want to create a hidden field and create a link in one helper and then output both to my erb. <%= my_cool_helper "something", form %> Should out put the results of link_to "something", a_path form.hidden_field "something".tableize,:va...
[ "ruby-on-rails", "ruby", "helper" ]
29
26
8,064
6
0
2008-09-21T21:12:55.697000
2008-09-21T21:17:15.813000
112,224
112,593
Click through transparency for Visual C# Window Forms?
I made a panel and set it to fill the screen, now I can see the windows under it but I want it to be click through, meaning they could click a file or see a tool tip of another object through the transparency. RE: This may be too obvious, but have you tried sending the panel to the back by right clicking and choosing "...
Creating a top level form that is transparent is very easy. Just make it fill the screen, or required area, and define it to have a TransparenyKey color and BackColor of the same value. Getting it to ignore the mouse is simple enough, you just need to override the WndProc and tell the WM_HITTEST that all mouse position...
Click through transparency for Visual C# Window Forms? I made a panel and set it to fill the screen, now I can see the windows under it but I want it to be click through, meaning they could click a file or see a tool tip of another object through the transparency. RE: This may be too obvious, but have you tried sending...
TITLE: Click through transparency for Visual C# Window Forms? QUESTION: I made a panel and set it to fill the screen, now I can see the windows under it but I want it to be click through, meaning they could click a file or see a tool tip of another object through the transparency. RE: This may be too obvious, but have...
[ "c#", "visual-studio", "forms", "transparency" ]
14
22
15,066
2
0
2008-09-21T21:21:12.963000
2008-09-21T23:54:24.047000
112,227
173,678
Consistently retrieve "From" email addresses across Outlook versions
I am working a standalone c# desktop application that sends out documents and then imports them from Outlook when they are sent back. The application picks up the emails from a specified folder processes them and then saves the senders name plus other stuff to a database. This works well for Outlook 2003 and 2007 which...
I'm using the Outlook Redemption solution in a C# production code. It works beautifully. With it, you can get the SenderID of a mail message (IRDOMail), and from there, you can use the GetAddressEntryFromID() method of the IRDOSession object.
Consistently retrieve "From" email addresses across Outlook versions I am working a standalone c# desktop application that sends out documents and then imports them from Outlook when they are sent back. The application picks up the emails from a specified folder processes them and then saves the senders name plus other...
TITLE: Consistently retrieve "From" email addresses across Outlook versions QUESTION: I am working a standalone c# desktop application that sends out documents and then imports them from Outlook when they are sent back. The application picks up the emails from a specified folder processes them and then saves the sende...
[ "c#", ".net", "outlook", "ms-office" ]
1
1
1,421
4
0
2008-09-21T21:25:23.733000
2008-10-06T09:28:02.673000
112,248
112,350
Building a web search engine
I've always been interested in developing a web search engine. What's a good place to start? I've heard of Lucene, but I'm not a big Java guy. Any other good resources or open source projects? I understand it's a huge under-taking, but that's part of the appeal. I'm not looking to create the next Google, just something...
There are several parts to a search engine. Broadly speaking, in a hopelessly general manner (folks, feel free to edit if you feel you can add better descriptions, links, etc): The crawler. This is the part that goes through the web, grabs the pages, and stores information about them into some central data store. In ad...
Building a web search engine I've always been interested in developing a web search engine. What's a good place to start? I've heard of Lucene, but I'm not a big Java guy. Any other good resources or open source projects? I understand it's a huge under-taking, but that's part of the appeal. I'm not looking to create th...
TITLE: Building a web search engine QUESTION: I've always been interested in developing a web search engine. What's a good place to start? I've heard of Lucene, but I'm not a big Java guy. Any other good resources or open source projects? I understand it's a huge under-taking, but that's part of the appeal. I'm not lo...
[ "search", "search-engine" ]
39
58
12,991
9
0
2008-09-21T21:35:49.137000
2008-09-21T22:24:35.400000
112,263
112,337
How do I overlap widgets with the Tkinter pack geometry manager?
I want to put a Canvas with an image in my window, and then I want to pack widgets on top of it, so the Canvas acts as a background. Is it possible to have two states for the pack manager: one for one set of widgets and another for another set?
The answer to your specific question is no. You can't have two states or otherwise use pack two different ways in the same parent. However, what I think you want to accomplish is simple. Use the built-in features of the canvas to create an image item that is part of the canvas, then pack things into the canvas as if it...
How do I overlap widgets with the Tkinter pack geometry manager? I want to put a Canvas with an image in my window, and then I want to pack widgets on top of it, so the Canvas acts as a background. Is it possible to have two states for the pack manager: one for one set of widgets and another for another set?
TITLE: How do I overlap widgets with the Tkinter pack geometry manager? QUESTION: I want to put a Canvas with an image in my window, and then I want to pack widgets on top of it, so the Canvas acts as a background. Is it possible to have two states for the pack manager: one for one set of widgets and another for anoth...
[ "python", "tkinter", "geometry", "pack" ]
2
2
3,394
4
0
2008-09-21T21:45:05.217000
2008-09-21T22:19:09.813000
112,276
112,290
Directory Modification Monitoring
I'm building a C# application that will monitor a specified directory for changes and additions and storing the information in a database. I would like to avoid checking each individual file for modifications, but I'm not sure if I can completely trust the file access time. What would be the best method to use for gett...
Hmm... interesting question. Initially I'd point you at the FileSystemWatcher class. If you are going to have it work, however, on user request, then it would seem you might need to store off the directory info initially and then compare each time the user requests. I'd probably go with a FileSystemWatcher and just sto...
Directory Modification Monitoring I'm building a C# application that will monitor a specified directory for changes and additions and storing the information in a database. I would like to avoid checking each individual file for modifications, but I'm not sure if I can completely trust the file access time. What would ...
TITLE: Directory Modification Monitoring QUESTION: I'm building a C# application that will monitor a specified directory for changes and additions and storing the information in a database. I would like to avoid checking each individual file for modifications, but I'm not sure if I can completely trust the file access...
[ "c#", "file", "directory", "filesystems" ]
6
1
3,617
4
0
2008-09-21T21:50:26.200000
2008-09-21T21:55:50.167000
112,277
112,302
Best introduction to C++ template metaprogramming?
Static metaprogramming (aka "template metaprogramming") is a great C++ technique that allows the execution of programs at compile-time. A light bulb went off in my head as soon as I read this canonical metaprogramming example: #include using namespace std; template< int n > struct factorial { enum { ret = factorial< n...
[Answering my own question] The best introductions I've found so far are chapter 10, "Static Metaprogramming in C++" from Generative Programming, Methods, Tools, and Applications by Krzysztof Czarnecki and Ulrich W. Eisenecker, ISBN-13: 9780201309775; and chapter 17, "Metaprograms" of C++ Templates: The Complete Guide ...
Best introduction to C++ template metaprogramming? Static metaprogramming (aka "template metaprogramming") is a great C++ technique that allows the execution of programs at compile-time. A light bulb went off in my head as soon as I read this canonical metaprogramming example: #include using namespace std; template< i...
TITLE: Best introduction to C++ template metaprogramming? QUESTION: Static metaprogramming (aka "template metaprogramming") is a great C++ technique that allows the execution of programs at compile-time. A light bulb went off in my head as soon as I read this canonical metaprogramming example: #include using namespace...
[ "c++", "templates", "metaprogramming" ]
122
121
68,084
8
0
2008-09-21T21:50:36.573000
2008-09-21T21:59:49.127000
112,318
112,434
SharePoint 2007 performance issues
I don't expect a straightforward silver bullet answer to this, but what are the best practices for ensuring good performance for SharePoint 2007 sites? We've a few sites for our intranet, and it generally is thought to run slow. There's plenty of memory and processor power in the servers, but the pages just don't 'snap...
Andrew Connell's latest book (Professional SharePoint 2007 Web Content Management Development) has an entire chapter dedicated to imporving performance of SharePoint sites. Key topics it covers are Caching, Limiting page load (particularly how to remove CORE.js if it's not needed), working with Disposable objects and h...
SharePoint 2007 performance issues I don't expect a straightforward silver bullet answer to this, but what are the best practices for ensuring good performance for SharePoint 2007 sites? We've a few sites for our intranet, and it generally is thought to run slow. There's plenty of memory and processor power in the serv...
TITLE: SharePoint 2007 performance issues QUESTION: I don't expect a straightforward silver bullet answer to this, but what are the best practices for ensuring good performance for SharePoint 2007 sites? We've a few sites for our intranet, and it generally is thought to run slow. There's plenty of memory and processor...
[ "performance", "sharepoint" ]
2
3
5,471
9
0
2008-09-21T22:09:18.433000
2008-09-21T22:49:07.557000
112,396
112,409
How do I remove the passphrase for the SSH key without having to create a new key?
I set a passphrase when creating a new SSH key on my laptop. But, as I realise now, this is quite painful when you are trying to commit ( Git and SVN ) to a remote location over SSH many times in an hour. One way I can think of is, delete my SSH keys and create new. Is there a way to remove the passphrase, while still ...
Short answer: $ ssh-keygen -p This will then prompt you to enter the keyfile location, the old passphrase, and the new passphrase (which can be left blank to have no passphrase). If you would like to do it all on one line without prompts do: $ ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile] Important...
How do I remove the passphrase for the SSH key without having to create a new key? I set a passphrase when creating a new SSH key on my laptop. But, as I realise now, this is quite painful when you are trying to commit ( Git and SVN ) to a remote location over SSH many times in an hour. One way I can think of is, delet...
TITLE: How do I remove the passphrase for the SSH key without having to create a new key? QUESTION: I set a passphrase when creating a new SSH key on my laptop. But, as I realise now, this is quite painful when you are trying to commit ( Git and SVN ) to a remote location over SSH many times in an hour. One way I can ...
[ "unix", "ssh", "passwords", "openssh", "passphrase" ]
1,563
2,833
721,212
11
0
2008-09-21T22:39:02.527000
2008-09-21T22:42:09.353000
112,412
2,403,173
Using Visual Studio 2008 to Assemble, Link, Debug, and Execute MASM 6.11 Assembly Code
I would like to use Visual Studio 2008 to the greatest extent possible while effectively compiling/linking/building/etc code as if all these build processes were being done by the tools provided with MASM 6.11. The exact version of MASM does not matter, so long as it's within the 6.x range, as that is what my college i...
There is a MASM rules file located at (32-bit system remove (x86) ): C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\VCProjectDefaults\masm.rules Copy that file to your project directory, and add it to the Custom Build Rules for your project. Then "Modify Rule File...", select the MASM build rule and "Modify Buil...
Using Visual Studio 2008 to Assemble, Link, Debug, and Execute MASM 6.11 Assembly Code I would like to use Visual Studio 2008 to the greatest extent possible while effectively compiling/linking/building/etc code as if all these build processes were being done by the tools provided with MASM 6.11. The exact version of M...
TITLE: Using Visual Studio 2008 to Assemble, Link, Debug, and Execute MASM 6.11 Assembly Code QUESTION: I would like to use Visual Studio 2008 to the greatest extent possible while effectively compiling/linking/building/etc code as if all these build processes were being done by the tools provided with MASM 6.11. The ...
[ "visual-studio", "visual-studio-2008", "assembly", "compilation", "masm" ]
6
4
9,820
6
0
2008-09-21T22:42:42.923000
2010-03-08T17:16:51.080000
112,433
113,560
Should I use #define, enum or const?
In a C++ project I'm working on, I have a flag kind of value which can have four values. Those four flags can be combined. Flags describe the records in database and can be: new record deleted record modified record existing record Now, for each record I wish to keep this attribute, so I could use an enum: enum { xNew,...
Combine the strategies to reduce the disadvantages of a single approach. I work in embedded systems so the following solution is based on the fact that integer and bitwise operators are fast, low memory & low in flash usage. Place the enum in a namespace to prevent the constants from polluting the global namespace. nam...
Should I use #define, enum or const? In a C++ project I'm working on, I have a flag kind of value which can have four values. Those four flags can be combined. Flags describe the records in database and can be: new record deleted record modified record existing record Now, for each record I wish to keep this attribute,...
TITLE: Should I use #define, enum or const? QUESTION: In a C++ project I'm working on, I have a flag kind of value which can have four values. Those four flags can be combined. Flags describe the records in database and can be: new record deleted record modified record existing record Now, for each record I wish to ke...
[ "c++", "enums", "bit-manipulation", "c-preprocessor" ]
130
91
70,412
15
0
2008-09-21T22:49:05.373000
2008-09-22T07:09:14.143000
112,482
112,515
What is the difference between "lang" and "type" attributes in a script tag?
For
Per the HTML 4.01 Spec: type: This attribute specifies the scripting language of the element's contents and overrides the default scripting language. The scripting language is specified as a content type (e.g., "text/javascript"). Authors must supply a value for this attribute. There is no default value for this attrib...
What is the difference between "lang" and "type" attributes in a script tag? For
TITLE: What is the difference between "lang" and "type" attributes in a script tag? QUESTION: For ANSWER: Per the HTML 4.01 Spec: type: This attribute specifies the scripting language of the element's contents and overrides the default scripting language. The scripting language is specified as a content type (e.g., "...
[ "html", "scripting" ]
15
31
6,811
7
0
2008-09-21T23:08:21.067000
2008-09-21T23:22:40.550000
112,503
112,542
How do I remove objects from an array in Java?
Given an array of n Objects, let's say it is an array of strings, and it has the following values: foo[0] = "a"; foo[1] = "cc"; foo[2] = "a"; foo[3] = "dd"; What do I have to do to delete/remove all the strings/objects equal to "a" in the array?
[If you want some ready-to-use code, please scroll to my "Edit3" (after the cut). The rest is here for posterity.] To flesh out Dustman's idea: List list = new ArrayList (Arrays.asList(array)); list.removeAll(Arrays.asList("a")); array = list.toArray(array); Edit: I'm now using Arrays.asList instead of Collections.sing...
How do I remove objects from an array in Java? Given an array of n Objects, let's say it is an array of strings, and it has the following values: foo[0] = "a"; foo[1] = "cc"; foo[2] = "a"; foo[3] = "dd"; What do I have to do to delete/remove all the strings/objects equal to "a" in the array?
TITLE: How do I remove objects from an array in Java? QUESTION: Given an array of n Objects, let's say it is an array of strings, and it has the following values: foo[0] = "a"; foo[1] = "cc"; foo[2] = "a"; foo[3] = "dd"; What do I have to do to delete/remove all the strings/objects equal to "a" in the array? ANSWER: ...
[ "java", "arrays", "data-structures", "data-manipulation" ]
91
115
386,833
20
0
2008-09-21T23:16:27.397000
2008-09-21T23:30:33.667000
112,517
112,553
How to build interface for such enum
I have the following enum: public enum Status implements StringEnum{ ONLINE("on"),OFFLINE("off"); private String status = null; private Status(String status) { this.status = status; } public String toString() { return this.status; } public static Status find(String value) { for(Status status: Status.values()) { if...
It's not possible to specify either constructors or static methods in an interface. For a good, concise explanation, check out this article: No static methods in interfaces
How to build interface for such enum I have the following enum: public enum Status implements StringEnum{ ONLINE("on"),OFFLINE("off"); private String status = null; private Status(String status) { this.status = status; } public String toString() { return this.status; } public static Status find(String value) { for...
TITLE: How to build interface for such enum QUESTION: I have the following enum: public enum Status implements StringEnum{ ONLINE("on"),OFFLINE("off"); private String status = null; private Status(String status) { this.status = status; } public String toString() { return this.status; } public static Status find(S...
[ "java", "interface", "enums" ]
4
6
5,766
3
0
2008-09-21T23:23:30.003000
2008-09-21T23:33:56.140000
112,523
112,552
Calculate text diffs in PHP
Are there any libraries (3rd party or built-in) in PHP to calculate text diffs?
What sort of diffs? File diffs? There is array_diff() which acts on arrays. Then there is also xdiff, which "enables you to create and apply patch files containing differences between different revisions of files.". The latter acts on files or strings. Edit: I should add xdiff doesn't appear to be out in a release yet....
Calculate text diffs in PHP Are there any libraries (3rd party or built-in) in PHP to calculate text diffs?
TITLE: Calculate text diffs in PHP QUESTION: Are there any libraries (3rd party or built-in) in PHP to calculate text diffs? ANSWER: What sort of diffs? File diffs? There is array_diff() which acts on arrays. Then there is also xdiff, which "enables you to create and apply patch files containing differences between d...
[ "php", "diff" ]
16
7
26,538
8
0
2008-09-21T23:25:20.497000
2008-09-21T23:33:23.847000
112,532
112,563
List all words in a dictionary that start with <user input>
How would a go about making a program where the user enters a string, and the program generates a list of words beginning with that string? Ex: User: "abd" Program:abdicate, abdomen, abduct... Thanks! Edit: I'm using python, but I assume that this is a fairly language-independent problem.
If you on a debian[-like] machine, #!/bin/bash echo -n "Enter a word: " read input grep "^$input" /usr/share/dict/words Takes all of 0.040s on my P200.
List all words in a dictionary that start with <user input> How would a go about making a program where the user enters a string, and the program generates a list of words beginning with that string? Ex: User: "abd" Program:abdicate, abdomen, abduct... Thanks! Edit: I'm using python, but I assume that this is a fairly ...
TITLE: List all words in a dictionary that start with <user input> QUESTION: How would a go about making a program where the user enters a string, and the program generates a list of words beginning with that string? Ex: User: "abd" Program:abdicate, abdomen, abduct... Thanks! Edit: I'm using python, but I assume that...
[ "python", "list", "dictionary" ]
7
6
7,892
16
0
2008-09-21T23:28:06.980000
2008-09-21T23:37:53.133000
112,551
112,576
SQL Server Priority Ordering
I have a table that contains tasks and I want to give these an explicit ordering based on the priority of the task. The only way I can think to do this is via an unique int column that indexes where the task is in term of the priority (i.e. 1 is top 1000 is low). The problem is that say I wanted to update task and set ...
Use a real number value as the priority. You can always slide in a value between two existing values with something like newPri = task1Pri + (task2Pri - task1Pri)/2 where Task1 has the lower priority numeric value (which is probably the higher piority). Corin points out that min and max priorities would have to be calc...
SQL Server Priority Ordering I have a table that contains tasks and I want to give these an explicit ordering based on the priority of the task. The only way I can think to do this is via an unique int column that indexes where the task is in term of the priority (i.e. 1 is top 1000 is low). The problem is that say I w...
TITLE: SQL Server Priority Ordering QUESTION: I have a table that contains tasks and I want to give these an explicit ordering based on the priority of the task. The only way I can think to do this is via an unique int column that indexes where the task is in term of the priority (i.e. 1 is top 1000 is low). The probl...
[ "sql-server", "data-structures" ]
6
7
2,572
5
0
2008-09-21T23:32:30.013000
2008-09-21T23:44:39.657000
112,564
112,860
How do I use genshi.builder to programmatically build an HTML document?
I recently discovered the genshi.builder module. It reminds me of Divmod Nevow's Stan module. How would one use genshi.builder.tag to build an HTML document with a particular doctype? Or is this even a good thing to do? If not, what is the right way?
It's not possible to build an entire page using just genshi.builder.tag -- you would need to perform some surgery on the resulting stream to insert the doctype. Besides, the resulting code would look horrific. The recommended way to use Genshi is to use a separate template file, generate a stream from it, and then rend...
How do I use genshi.builder to programmatically build an HTML document? I recently discovered the genshi.builder module. It reminds me of Divmod Nevow's Stan module. How would one use genshi.builder.tag to build an HTML document with a particular doctype? Or is this even a good thing to do? If not, what is the right wa...
TITLE: How do I use genshi.builder to programmatically build an HTML document? QUESTION: I recently discovered the genshi.builder module. It reminds me of Divmod Nevow's Stan module. How would one use genshi.builder.tag to build an HTML document with a particular doctype? Or is this even a good thing to do? If not, wh...
[ "python", "html", "templates", "genshi" ]
5
6
1,632
2
0
2008-09-21T23:37:58.983000
2008-09-22T02:12:07.880000
112,582
112,595
C101: the best way to fill an array from user input?
I'm having a hard time understanding and therefore managing arrays and indexes manually in C. These are my two classic approaches but they doesn't seem to work as they keep looping when the condition is reached: #include #define MAX 255 int main(){ int arr[MAX]={0}; int idx=0; /* Approach #1 */ printf("Enter elemen...
arr[idx] <= MAX should be idx < MAX unless you are checking the item instead of the index. You are also always checking the "next" element for -1 (arr[idx]!= -1) because you are incrementing idx prior to checking your added value. so if you had arr[idx-1]!= -1 you would be fine.
C101: the best way to fill an array from user input? I'm having a hard time understanding and therefore managing arrays and indexes manually in C. These are my two classic approaches but they doesn't seem to work as they keep looping when the condition is reached: #include #define MAX 255 int main(){ int arr[MAX]={0}...
TITLE: C101: the best way to fill an array from user input? QUESTION: I'm having a hard time understanding and therefore managing arrays and indexes manually in C. These are my two classic approaches but they doesn't seem to work as they keep looping when the condition is reached: #include #define MAX 255 int main(){...
[ "c", "arrays", "indexing" ]
1
1
10,366
8
0
2008-09-21T23:49:01.267000
2008-09-21T23:54:32.797000
112,601
113,095
Select Element in a Namespace with XPath
I want to select the topmost element in a document that has a given namespace (prefix). More specifically: I have XML documents that either start with /html/body (in the XHTML namespace) or with one of several elements in a particular namespace. I effectively want to strip out /html/body and just return the body conten...
In XPath 2.0 and XQuery 1.0 you can test against the namespace prefix using the in-scope-prefixes() function in a predicate. e.g. //*[in-scope-prefixes(.)='html'] If you cant use v2, in XPath 1.0 you can use the namespace-uri() function to test against the namespace itself. e.g. //*[namespace-uri()='http://www.w3c.org/...
Select Element in a Namespace with XPath I want to select the topmost element in a document that has a given namespace (prefix). More specifically: I have XML documents that either start with /html/body (in the XHTML namespace) or with one of several elements in a particular namespace. I effectively want to strip out /...
TITLE: Select Element in a Namespace with XPath QUESTION: I want to select the topmost element in a document that has a given namespace (prefix). More specifically: I have XML documents that either start with /html/body (in the XHTML namespace) or with one of several elements in a particular namespace. I effectively w...
[ "xml", "xpath", "namespaces" ]
12
10
13,028
2
0
2008-09-21T23:59:47.637000
2008-09-22T03:54:45.997000
112,603
112,705
What is 'JNI Global reference'
I am using jProfiler to find memory leaks in a Java swing application. I have identified instances of a JFrame which keeps growing in count. This frame is opened, and then closed. Using jProfiler, and viewing the Paths to GC Root there is only one reference, 'JNI Global reference'. What does this mean? Why is it hangin...
Wikipedia has a good overview of Java Native Interface, essentially it allows communication between Java and native operating system libraries writen in other languages. JNI global references are prone to memory leaks, as they are not automatically garbage collected, and the programmer must explicitly free them. If you...
What is 'JNI Global reference' I am using jProfiler to find memory leaks in a Java swing application. I have identified instances of a JFrame which keeps growing in count. This frame is opened, and then closed. Using jProfiler, and viewing the Paths to GC Root there is only one reference, 'JNI Global reference'. What d...
TITLE: What is 'JNI Global reference' QUESTION: I am using jProfiler to find memory leaks in a Java swing application. I have identified instances of a JFrame which keeps growing in count. This frame is opened, and then closed. Using jProfiler, and viewing the Paths to GC Root there is only one reference, 'JNI Global ...
[ "java", "swing", "jprofiler" ]
34
19
30,121
3
0
2008-09-22T00:01:13.547000
2008-09-22T00:52:29.553000
112,612
112,737
Are C++ non-type parameters to (function) templates ordered?
I am hosting SpiderMonkey in a current project and would like to have template functions generate some of the simple property get/set methods, eg: template JSBool JS_DLL_CALLBACK WriteProp(JSContext* cx, JSObject* obj, jsval id, jsval* vp) { if (TClassImpl* pImpl = (TClassImpl*)::JS_GetInstancePrivate(cx, obj, &TClassI...
Pretty sure VC++ has "issues" here. Comeau and g++ 4.2 are both happy with the following program: struct X { int i; void* p; }; template void foo(X* t) { t->*P = 0; } template void foo(X* t) { t->*P = 0; } int main() { X x; foo<&X::i>(&x); foo<&X::p>(&x); } VC++ 2008SP1, however, is having none of it. I haven't the ...
Are C++ non-type parameters to (function) templates ordered? I am hosting SpiderMonkey in a current project and would like to have template functions generate some of the simple property get/set methods, eg: template JSBool JS_DLL_CALLBACK WriteProp(JSContext* cx, JSObject* obj, jsval id, jsval* vp) { if (TClassImpl* p...
TITLE: Are C++ non-type parameters to (function) templates ordered? QUESTION: I am hosting SpiderMonkey in a current project and would like to have template functions generate some of the simple property get/set methods, eg: template JSBool JS_DLL_CALLBACK WriteProp(JSContext* cx, JSObject* obj, jsval id, jsval* vp) {...
[ "c++", "templates", "overloading" ]
5
3
1,673
3
0
2008-09-22T00:06:37.027000
2008-09-22T01:08:42.260000
112,613
112,753
git instaweb gives 403 Forbidden - No projects found
running git instaweb in my repository opens a page that says "403 Forbidden - No projects found". What am I missing?
looks like the debian install of git sets $projectroot globally in a way that confuses instaweb. I removed the $projectroot line from /etc/gitweb.conf and the error went away.
git instaweb gives 403 Forbidden - No projects found running git instaweb in my repository opens a page that says "403 Forbidden - No projects found". What am I missing?
TITLE: git instaweb gives 403 Forbidden - No projects found QUESTION: running git instaweb in my repository opens a page that says "403 Forbidden - No projects found". What am I missing? ANSWER: looks like the debian install of git sets $projectroot globally in a way that confuses instaweb. I removed the $projectroot...
[ "git", "http-status-code-403", "instaweb" ]
7
17
6,309
6
0
2008-09-22T00:06:38.637000
2008-09-22T01:15:37.830000
112,625
112,645
== vs. Object.Equals(object) in .NET
So, when I was a comparative novice to the novice I am right now, I used to think that these two things were syntactic sugar for each other, i.e. that using one over the other was simply a personal preference. Over time, I'm come to find that these two are not the same thing, even in a default implementation (see this ...
MSDN has clear and solid descriptions of both things. object.Equals method operator == Overloadable Operators Guidelines for Overriding Equals() and Operator == Is this a good thing, what are the differences, and when/why should you use one over the other? How can it be "good" or "bad" thing? One - method, another - op...
== vs. Object.Equals(object) in .NET So, when I was a comparative novice to the novice I am right now, I used to think that these two things were syntactic sugar for each other, i.e. that using one over the other was simply a personal preference. Over time, I'm come to find that these two are not the same thing, even i...
TITLE: == vs. Object.Equals(object) in .NET QUESTION: So, when I was a comparative novice to the novice I am right now, I used to think that these two things were syntactic sugar for each other, i.e. that using one over the other was simply a personal preference. Over time, I'm come to find that these two are not the ...
[ ".net" ]
53
17
52,043
9
0
2008-09-22T00:15:10.627000
2008-09-22T00:23:06.553000
112,643
112,668
How can I dynamically create a selector at runtime with Objective-C?
I know how to create a SEL at compile time using @selector(MyMethodName:) but what I want to do is create a selector dynamically from an NSString. Is this even possible? What I can do: SEL selector = @selector(doWork:); [myobj respondsToSelector:selector]; What I want to do: (pseudo code, this obviously doesn't work) S...
I'm not an Objective-C programmer, merely a sympathizer, but maybe NSSelectorFromString is what you need. It's mentioned explicity in the Runtime Reference that you can use it to convert a string to a selector.
How can I dynamically create a selector at runtime with Objective-C? I know how to create a SEL at compile time using @selector(MyMethodName:) but what I want to do is create a selector dynamically from an NSString. Is this even possible? What I can do: SEL selector = @selector(doWork:); [myobj respondsToSelector:selec...
TITLE: How can I dynamically create a selector at runtime with Objective-C? QUESTION: I know how to create a SEL at compile time using @selector(MyMethodName:) but what I want to do is create a selector dynamically from an NSString. Is this even possible? What I can do: SEL selector = @selector(doWork:); [myobj respon...
[ "objective-c", "cocoa", "dynamic" ]
94
180
48,717
4
0
2008-09-22T00:22:32.467000
2008-09-22T00:34:43.403000
112,663
114,256
Comparison of embedded operating systems?
I've been involved in embedded operating systems of one flavor or another, and have generally had to work with whatever the legacy system had. Now I have the chance to start from scratch on a new embedded project. The primary constraints on the system are: It needs a web-based interface. Inputs are required to be proce...
It all depends on how much time was allocated for your team has to learn a "new" RTOS. Are there any reasons you don't want to use something that people already have experience with? I have plenty of experience with vxWorks and I like it, but disregard my opinion as I work for WindRiver. uC/OS II has the advantage of b...
Comparison of embedded operating systems? I've been involved in embedded operating systems of one flavor or another, and have generally had to work with whatever the legacy system had. Now I have the chance to start from scratch on a new embedded project. The primary constraints on the system are: It needs a web-based ...
TITLE: Comparison of embedded operating systems? QUESTION: I've been involved in embedded operating systems of one flavor or another, and have generally had to work with whatever the legacy system had. Now I have the chance to start from scratch on a new embedded project. The primary constraints on the system are: It ...
[ "operating-system", "embedded", "threadx" ]
11
5
13,072
11
0
2008-09-22T00:31:53.550000
2008-09-22T11:02:49.243000
112,664
118,071
Connect to SQL Server from cygwin window times out, from DOS prompt works
I can connect to my SQL Server database via sqlcmd from a DOS command window, but not from a Cygwin window. From DOS: F:\Cygnus>sqlcmd -Q "select 'a test'" -S.\SQLEXPRESS a test (1 rows affected) F:\Cygnus> ==================================================== From Cygwin: $ sqlcmd -Q "select 'a test'" -S.\SQLEXPRESS HR...
The backslash is being eaten by cygwin's bash shell. Try doubling it: sqlcmd -Q "select 'a test'" -S.\\SQLEXPRESS
Connect to SQL Server from cygwin window times out, from DOS prompt works I can connect to my SQL Server database via sqlcmd from a DOS command window, but not from a Cygwin window. From DOS: F:\Cygnus>sqlcmd -Q "select 'a test'" -S.\SQLEXPRESS a test (1 rows affected) F:\Cygnus> =======================================...
TITLE: Connect to SQL Server from cygwin window times out, from DOS prompt works QUESTION: I can connect to my SQL Server database via sqlcmd from a DOS command window, but not from a Cygwin window. From DOS: F:\Cygnus>sqlcmd -Q "select 'a test'" -S.\SQLEXPRESS a test (1 rows affected) F:\Cygnus> =====================...
[ "sql-server", "cygwin", "sqlcmd" ]
4
8
6,264
3
0
2008-09-22T00:32:58.947000
2008-09-22T22:46:43.170000
112,676
113,128
Restore a SQL Server database from single instance to cluster
I need to transfer a database from a SQL Server instance test server to a production environment that is clustered. But SQL Server doesn't allow you to use backup/restore to do it from single instance to cluster. I'm talking about a Microsoft CRM complex database here. Your help is greatly appreciated.
Have a look at the Microsoft SQL Server Database Publishing Wizard: SQL Server Database Publishing Wizard enables the deployment of SQL Server databases into a hosted environment on either a SQL Server 2000 or 2005 server. It generates a single SQL script file which can be used to recreate a database (both schema and d...
Restore a SQL Server database from single instance to cluster I need to transfer a database from a SQL Server instance test server to a production environment that is clustered. But SQL Server doesn't allow you to use backup/restore to do it from single instance to cluster. I'm talking about a Microsoft CRM complex dat...
TITLE: Restore a SQL Server database from single instance to cluster QUESTION: I need to transfer a database from a SQL Server instance test server to a production environment that is clustered. But SQL Server doesn't allow you to use backup/restore to do it from single instance to cluster. I'm talking about a Microso...
[ "sql-server-2005" ]
3
1
2,837
1
0
2008-09-22T00:40:27.167000
2008-09-22T04:08:12.173000
112,695
112,719
Friendly url scheme?
One of the many things that's been lacking from my scraper service that I set up last week are pretty URLs. Right now the user parameter is being passed into the script with?u=, which is a symptom of a lazy hack (which the script admittedly is). However, I've been thinking about redoing it and I'd like to get some feed...
I'd be gently inclined toward leading with the userid -- option #2 -- since (what exists of) the directory structure is two different functions over a user's data. It's the user's chart, and the user's update. It's a pretty minor point, though, without knowing if there's plans for significant expansion of the functiona...
Friendly url scheme? One of the many things that's been lacking from my scraper service that I set up last week are pretty URLs. Right now the user parameter is being passed into the script with?u=, which is a symptom of a lazy hack (which the script admittedly is). However, I've been thinking about redoing it and I'd ...
TITLE: Friendly url scheme? QUESTION: One of the many things that's been lacking from my scraper service that I set up last week are pretty URLs. Right now the user parameter is being passed into the script with?u=, which is a symptom of a lazy hack (which the script admittedly is). However, I've been thinking about r...
[ "url", "friendly-url", "semantics" ]
3
5
1,121
9
0
2008-09-22T00:48:38.283000
2008-09-22T00:57:23.350000
112,698
112,713
py2exe - generate single executable file
I thought I heard that py2exe was able to do this, but I never figured it out. Has anyone successfully done this? Can I see your setup.py file, and what command line options you used? Basically I'm thinking of it giving me a single executable file that does something like unzips itself to maybe /temp and runs.
PyInstaller will create a single.exe file with no dependencies; use the --onefile option. It does this by packing all the needed shared libs into the executable, and unpacking them before it runs, just as you describe (EDIT: py2exe also has this feature, see minty's answer ) I use the version of PyInstaller from svn, s...
py2exe - generate single executable file I thought I heard that py2exe was able to do this, but I never figured it out. Has anyone successfully done this? Can I see your setup.py file, and what command line options you used? Basically I'm thinking of it giving me a single executable file that does something like unzips...
TITLE: py2exe - generate single executable file QUESTION: I thought I heard that py2exe was able to do this, but I never figured it out. Has anyone successfully done this? Can I see your setup.py file, and what command line options you used? Basically I'm thinking of it giving me a single executable file that does som...
[ "python", "packaging", "py2exe" ]
154
114
202,126
8
0
2008-09-22T00:49:12.153000
2008-09-22T00:55:46.240000
112,707
112,906
How do I enable multimode emacs to program PHP without messing up my indents?
Whenever I indent HTML in PHP mode, emacs (22.1.1, basic install on Redaht Linux over Putty-SSH) pops up a frame and tells me to get MUMODE or somesuch extra add-on. I installed PHP Mode without a big hassle, but I don't know how to get this multi-mode rolling. I'd like to know 2 things How to install and configure mul...
If you're running emacs 22, you should just be able to run: M-x nxhtml-mumamo when editing an html document. You might want to add it to your auto-mode-alist to get it to automatically load for html docs. See here for more info: http://www.emacswiki.org/cgi-bin/wiki/MuMaMo http://www.emacswiki.org/cgi-bin/wiki/PhpMode
How do I enable multimode emacs to program PHP without messing up my indents? Whenever I indent HTML in PHP mode, emacs (22.1.1, basic install on Redaht Linux over Putty-SSH) pops up a frame and tells me to get MUMODE or somesuch extra add-on. I installed PHP Mode without a big hassle, but I don't know how to get this ...
TITLE: How do I enable multimode emacs to program PHP without messing up my indents? QUESTION: Whenever I indent HTML in PHP mode, emacs (22.1.1, basic install on Redaht Linux over Putty-SSH) pops up a frame and tells me to get MUMODE or somesuch extra add-on. I installed PHP Mode without a big hassle, but I don't kno...
[ "php", "emacs" ]
5
4
4,371
3
0
2008-09-22T00:53:15.840000
2008-09-22T02:39:48.330000
112,721
112,746
Combining Scriptaculous and jQuery in a Rails application
I've got the following situation A rails application that makes use of rjs / Scriptaculous to offer AJAX functionality Lot of nice javascript written using jQuery (for a separate application) I want to combine the two and use my jQuery based functionality in my Rails application, but I'm worried about jQuery and Script...
jQuery.noConflict(); Then use jQuery instead of $ to refer to jQuery. e.g., jQuery('div.foo').doSomething() If you need to adapt jQuery code that uses $, you can surround it with this: (function($) {...your code here... })(jQuery);
Combining Scriptaculous and jQuery in a Rails application I've got the following situation A rails application that makes use of rjs / Scriptaculous to offer AJAX functionality Lot of nice javascript written using jQuery (for a separate application) I want to combine the two and use my jQuery based functionality in my ...
TITLE: Combining Scriptaculous and jQuery in a Rails application QUESTION: I've got the following situation A rails application that makes use of rjs / Scriptaculous to offer AJAX functionality Lot of nice javascript written using jQuery (for a separate application) I want to combine the two and use my jQuery based fu...
[ "javascript", "jquery", "ruby-on-rails", "ruby", "scriptaculous" ]
4
15
6,419
3
0
2008-09-22T00:58:25.157000
2008-09-22T01:11:07.153000
112,727
112,986
How to avoid the dangers of optimisation when designing for the unknown?
A two parter: 1) Say you're designing a new type of application and you're in the process of coming up with new algorithms to express the concepts and content -- does it make sense to attempt to actively not consider optimisation techniques at that stage, even if in the back of your mind you fear it might end up as O(N...
I say all the following not because I think you don't already know it, but to provide moral support while you suppress your inner critic:-) The key is to retain sanity. If you find yourself writing a Theta(N!) algorithm which is expected to scale, then you're crazy. You'll have to throw it away, so you might as well st...
How to avoid the dangers of optimisation when designing for the unknown? A two parter: 1) Say you're designing a new type of application and you're in the process of coming up with new algorithms to express the concepts and content -- does it make sense to attempt to actively not consider optimisation techniques at tha...
TITLE: How to avoid the dangers of optimisation when designing for the unknown? QUESTION: A two parter: 1) Say you're designing a new type of application and you're in the process of coming up with new algorithms to express the concepts and content -- does it make sense to attempt to actively not consider optimisation...
[ "optimization" ]
4
7
640
14
0
2008-09-22T00:59:59.317000
2008-09-22T03:09:46.293000
112,730
508,683
How do I join two tables in a third n..n (hasAndBelongsToMany) relationship in CakePHP?
I have a n...n structure for two tables, makes and models. So far no problem. In a third table ( products ) like: id make_id model_id... My problem is creating a view for products of one specifi make inside my ProductsController containing just that's make models: I thought this could work: var $uses = array('Make', 'M...
The solution can be achieved with the use of the with operation in habtm array on the model. Using with you can define the "middle" table like: $habtm = "... 'with' => 'MakeModel',... "; And internally, in the Model or Controller, you can issue conditions to the find method. See: http://www.cricava.com/blogs/index.php?...
How do I join two tables in a third n..n (hasAndBelongsToMany) relationship in CakePHP? I have a n...n structure for two tables, makes and models. So far no problem. In a third table ( products ) like: id make_id model_id... My problem is creating a view for products of one specifi make inside my ProductsController con...
TITLE: How do I join two tables in a third n..n (hasAndBelongsToMany) relationship in CakePHP? QUESTION: I have a n...n structure for two tables, makes and models. So far no problem. In a third table ( products ) like: id make_id model_id... My problem is creating a view for products of one specifi make inside my Prod...
[ "cakephp", "has-and-belongs-to-many", "model-driven" ]
0
0
2,192
5
0
2008-09-22T01:03:14.303000
2009-02-03T20:00:54.697000
112,738
113,134
How does boost bind work behind the scenes in general?
Without spending a long time reviewing the boost source code, could someone give me a quick rundown of how boost bind is implemented?
I like this piece of the bind source: template class bind_t { public: typedef bind_t this_type; bind_t(F f, L const & l): f_(f), l_(l) {} #define BOOST_BIND_RETURN return #include #undef BOOST_BIND_RETURN }; Tells you almost all you need to know, really. The bind_template header expands to a list of inline operator...
How does boost bind work behind the scenes in general? Without spending a long time reviewing the boost source code, could someone give me a quick rundown of how boost bind is implemented?
TITLE: How does boost bind work behind the scenes in general? QUESTION: Without spending a long time reviewing the boost source code, could someone give me a quick rundown of how boost bind is implemented? ANSWER: I like this piece of the bind source: template class bind_t { public: typedef bind_t this_type; bind_t...
[ "c++", "boost", "boost-bind" ]
33
25
12,192
3
0
2008-09-22T01:09:15.350000
2008-09-22T04:10:20.280000
112,739
112,751
Shortest Root to Leaf Path
What is the easiest way, preferably using recursion, to find the shortest root-to-leaf path in a BST (Binary Search Tree). Java prefered, pseudocode okay. Thanks!
General description: Use a Breadth-first search (BFS) as opposed to a Depth-first search (DFS). Find the first node with no children. Using a DFS you might get lucky on some input trees (but there is no way to know you got lucky so you still need to search the whole tree), but using the BFS method is much faster and yo...
Shortest Root to Leaf Path What is the easiest way, preferably using recursion, to find the shortest root-to-leaf path in a BST (Binary Search Tree). Java prefered, pseudocode okay. Thanks!
TITLE: Shortest Root to Leaf Path QUESTION: What is the easiest way, preferably using recursion, to find the shortest root-to-leaf path in a BST (Binary Search Tree). Java prefered, pseudocode okay. Thanks! ANSWER: General description: Use a Breadth-first search (BFS) as opposed to a Depth-first search (DFS). Find th...
[ "algorithm", "recursion", "binary-tree", "breadth-first-search" ]
13
17
15,566
5
0
2008-09-22T01:09:26.223000
2008-09-22T01:12:44.577000
112,768
112,819
How would one log into a phpBB3 forum through a Python script using urllib, urllib2 and ClientCookie?
(ClientCookie is a module for (automatic) cookie-handling: http://wwwsearch.sourceforge.net/ClientCookie ) # I encode the data I'll be sending: data = urllib.urlencode({'username': 'mandark', 'password': 'deedee'}) # And I send it and read the page: page = ClientCookie.urlopen('http://www.forum.com/ucp.php?mode=login'...
Have you tried fetching the login page first? I would suggest using Tamper Data to have a peek at exactly what's being sent when you request the login page and then log in normally using a web browser from a fresh start, with no initial cookies in place, so that your script can replicate it exactly. That's the approach...
How would one log into a phpBB3 forum through a Python script using urllib, urllib2 and ClientCookie? (ClientCookie is a module for (automatic) cookie-handling: http://wwwsearch.sourceforge.net/ClientCookie ) # I encode the data I'll be sending: data = urllib.urlencode({'username': 'mandark', 'password': 'deedee'}) # ...
TITLE: How would one log into a phpBB3 forum through a Python script using urllib, urllib2 and ClientCookie? QUESTION: (ClientCookie is a module for (automatic) cookie-handling: http://wwwsearch.sourceforge.net/ClientCookie ) # I encode the data I'll be sending: data = urllib.urlencode({'username': 'mandark', 'passwor...
[ "python", "post", "urllib" ]
3
2
2,950
2
0
2008-09-22T01:28:57.547000
2008-09-22T01:54:20.483000
112,770
113,820
How do you re-attach a subversion local copy to a different remote?
Our subversion repository has been moved to a new host, and we have old applications that connect to that host. We CANNOT add an alias for the new server with the old name, how can we re-connect our checked out clients to the new repository?
Example: svn switch --relocate \ http://svn.example.com/path/to/repository/path/within/repository \ http://svnnew.example.com/new/repository/path/within/repository One thing which is to remember, lets assume you checked out the project "path/within/repository" then you have to go to the root of your working copy, and e...
How do you re-attach a subversion local copy to a different remote? Our subversion repository has been moved to a new host, and we have old applications that connect to that host. We CANNOT add an alias for the new server with the old name, how can we re-connect our checked out clients to the new repository?
TITLE: How do you re-attach a subversion local copy to a different remote? QUESTION: Our subversion repository has been moved to a new host, and we have old applications that connect to that host. We CANNOT add an alias for the new server with the old name, how can we re-connect our checked out clients to the new repo...
[ "svn" ]
17
18
7,007
3
0
2008-09-22T01:31:03.627000
2008-09-22T08:37:48.127000
112,775
112,800
Possible to use multiple/nested MySQLi statements?
Is it possible to have a MySQLi prepared statement within the fetch() call of a previous statement? If not, what's the best way around it? Example code: if($stmt = $link->prepare("SELECT item FROM data WHERE id =?")) { $stmt->bind_param("i", $id); $stmt->execute(); $stmt->bind_result($item); while( $stmt->fetch() ) { /...
You should be able to do that, although you make have to start a second connection.
Possible to use multiple/nested MySQLi statements? Is it possible to have a MySQLi prepared statement within the fetch() call of a previous statement? If not, what's the best way around it? Example code: if($stmt = $link->prepare("SELECT item FROM data WHERE id =?")) { $stmt->bind_param("i", $id); $stmt->execute(); $st...
TITLE: Possible to use multiple/nested MySQLi statements? QUESTION: Is it possible to have a MySQLi prepared statement within the fetch() call of a previous statement? If not, what's the best way around it? Example code: if($stmt = $link->prepare("SELECT item FROM data WHERE id =?")) { $stmt->bind_param("i", $id); $st...
[ "php", "mysql", "mysqli" ]
12
1
7,917
3
0
2008-09-22T01:32:47.290000
2008-09-22T01:47:19.313000
112,780
112,840
Conflicting desires in Database Design, with fields of two similar functions
Okay, so I'm making a table right now for "Box Items". Now, a Box Item, depending on what it's being used for/the status of the item, may end up being related to a "Shipping" box or a "Returns" box. A Box Item may be defective:if it is, a flag will be set in the Box Item's row (IsDefective), and the Box Item will be pu...
I'm with Psychotic Venom and mattlant. Going the polymorphic route (having to figure out which table your foreign key points to based on the contents of another field) is going to be a pain. Coding the constraints for that maybe tough (I'm not sure most databases would support that natively, I think you'd have to use a...
Conflicting desires in Database Design, with fields of two similar functions Okay, so I'm making a table right now for "Box Items". Now, a Box Item, depending on what it's being used for/the status of the item, may end up being related to a "Shipping" box or a "Returns" box. A Box Item may be defective:if it is, a flag...
TITLE: Conflicting desires in Database Design, with fields of two similar functions QUESTION: Okay, so I'm making a table right now for "Box Items". Now, a Box Item, depending on what it's being used for/the status of the item, may end up being related to a "Shipping" box or a "Returns" box. A Box Item may be defectiv...
[ "database", "database-design", "normalizing", "database-relations" ]
1
3
396
7
0
2008-09-22T01:37:01.523000
2008-09-22T02:03:56.637000
112,786
112,832
PHP performance considerations?
I'm building a PHP site, but for now the only PHP I'm using is a half-dozen or so includes on certain pages. (I will probably use some database queries eventually.) Are simple include() statements a concern for speed or scaling, as opposed to static HTML? What kinds of things tend to cause a site to bog down?
Strictly speaking, straight HTML will always serve faster than a server-side approach since the server doesn't have to do any interpretation of the code. To answer the bigger question, there are a number of things that will cause your site to bog down; there's just no specific threshold for when your code is causing th...
PHP performance considerations? I'm building a PHP site, but for now the only PHP I'm using is a half-dozen or so includes on certain pages. (I will probably use some database queries eventually.) Are simple include() statements a concern for speed or scaling, as opposed to static HTML? What kinds of things tend to cau...
TITLE: PHP performance considerations? QUESTION: I'm building a PHP site, but for now the only PHP I'm using is a half-dozen or so includes on certain pages. (I will probably use some database queries eventually.) Are simple include() statements a concern for speed or scaling, as opposed to static HTML? What kinds of ...
[ "php", "performance", "scalability" ]
2
3
1,065
7
0
2008-09-22T01:41:42.183000
2008-09-22T02:01:21.340000
112,796
112,808
How to view contents of NSDictionary variable in Xcode debugger?
Is there a way to view the key/value pairs of a NSDictionary variable through the Xcode debugger? Here's the extent of information when it is fully expanded in the variable window: Variable Value Summary jsonDict 0x45c540 4 key/value pairs NSObject {...} isa 0xa06e0720 I was expecting it to show me each element of the ...
In the gdb window you can use po to inspect the object. given: NSMutableDictionary* dict = [[NSMutableDictionary alloc] init]; [dict setObject:@"foo" forKey:@"bar"]; [dict setObject:@"fiz" forKey:@"buz"]; setting a breakpoint after the objects are added you can inspect what is in the dictionary (gdb) po dict { bar = fo...
How to view contents of NSDictionary variable in Xcode debugger? Is there a way to view the key/value pairs of a NSDictionary variable through the Xcode debugger? Here's the extent of information when it is fully expanded in the variable window: Variable Value Summary jsonDict 0x45c540 4 key/value pairs NSObject {...} ...
TITLE: How to view contents of NSDictionary variable in Xcode debugger? QUESTION: Is there a way to view the key/value pairs of a NSDictionary variable through the Xcode debugger? Here's the extent of information when it is fully expanded in the variable window: Variable Value Summary jsonDict 0x45c540 4 key/value pai...
[ "objective-c", "cocoa", "xcode", "debugging" ]
85
140
62,589
7
0
2008-09-22T01:45:38.663000
2008-09-22T01:51:12.440000
112,802
112,886
MD5 routines that are GLib friendly?
Does anyone know of an MD5/SHA1/etc routine that is easily used with GLib (i.e. you can give it a GIOChannel, etc)?
Unless you have a very good reason, use glib's built-in MD5, SHA1, and SHA256 implementations with GChecksum. It doesn't have a built-in function to construct a checksum from an IO stream, but you can write a simple one in 10 lines, and you'd need to write a complex one yourself anyway.
MD5 routines that are GLib friendly? Does anyone know of an MD5/SHA1/etc routine that is easily used with GLib (i.e. you can give it a GIOChannel, etc)?
TITLE: MD5 routines that are GLib friendly? QUESTION: Does anyone know of an MD5/SHA1/etc routine that is easily used with GLib (i.e. you can give it a GIOChannel, etc)? ANSWER: Unless you have a very good reason, use glib's built-in MD5, SHA1, and SHA256 implementations with GChecksum. It doesn't have a built-in fun...
[ "c", "linux", "glib" ]
6
6
1,631
2
0
2008-09-22T01:48:27.500000
2008-09-22T02:26:08.003000
112,812
113,990
Accessing URL parameters in Oracle Forms / OC4J
How do I access parameters passed into an Oracle Form via a URL. Eg given the url: http://example.com/forms90/f90servlet?config=cust&form= 'a_form'&p1=something&p2=else This will launch the 'a_form' form, using the 'cust' configuration, but I can't work how (or even if it's possible) to access p1 (with value of 'someth...
Within Forms you can refer to the parameters p1 an p2 as follows::PARAMETER.p1:PARAMETER.p2 e.g. if:PARAMETER.p1 = 'something' then do_something; end if;
Accessing URL parameters in Oracle Forms / OC4J How do I access parameters passed into an Oracle Form via a URL. Eg given the url: http://example.com/forms90/f90servlet?config=cust&form= 'a_form'&p1=something&p2=else This will launch the 'a_form' form, using the 'cust' configuration, but I can't work how (or even if it...
TITLE: Accessing URL parameters in Oracle Forms / OC4J QUESTION: How do I access parameters passed into an Oracle Form via a URL. Eg given the url: http://example.com/forms90/f90servlet?config=cust&form= 'a_form'&p1=something&p2=else This will launch the 'a_form' form, using the 'cust' configuration, but I can't work ...
[ "oracle", "forms", "url", "parameters", "oracleforms" ]
3
1
7,647
2
0
2008-09-22T01:52:20.987000
2008-09-22T09:35:47.643000
112,818
113,838
Displaying the current authenticated Sharepoint user from an asp.net Page Viewer Web Part
I am creating a standalone asp.net page that needs to be embedded into a sharepoint site using the Page Viewer Web Part. The asp.net page is published to the same server on a different port, giving me the URL to embed. The requirement is that after a user is authenticated using Sharepoint authentication, they navigate ...
If you want to retrieve the currently authenticated user from the SharePoint context, you need to remain within the SharePoint context. This means hosting your custom web application within SharePoint (see http://msdn.microsoft.com/en-us/library/cc297200.aspx ). Then from your custom application reference Microsoft.Sha...
Displaying the current authenticated Sharepoint user from an asp.net Page Viewer Web Part I am creating a standalone asp.net page that needs to be embedded into a sharepoint site using the Page Viewer Web Part. The asp.net page is published to the same server on a different port, giving me the URL to embed. The require...
TITLE: Displaying the current authenticated Sharepoint user from an asp.net Page Viewer Web Part QUESTION: I am creating a standalone asp.net page that needs to be embedded into a sharepoint site using the Page Viewer Web Part. The asp.net page is published to the same server on a different port, giving me the URL to ...
[ "asp.net", "sharepoint", "authentication", "web-parts" ]
5
7
24,118
4
0
2008-09-22T01:54:18.720000
2008-09-22T08:44:49.997000
112,831
112,834
How to get a stack trace when C++ program crashes? (using msvc8/2005)
Sometimes my c++ program crashes in debug mode, and what I got is a message box saying that an assertion failed in some of the internal memory management routines (accessing unallocated memory etc.). But I don't know where that was called from, because I didn't get any stack trace. How do I get a stack trace or at leas...
If you have a crash, you can get information about where the crash happened whether you have a debug or a release build. And you can see the call stack even if you are on a computer that does not have the source code. To do this you need to use the PDB file that was built with your EXE. Put the PDB file inside the same...
How to get a stack trace when C++ program crashes? (using msvc8/2005) Sometimes my c++ program crashes in debug mode, and what I got is a message box saying that an assertion failed in some of the internal memory management routines (accessing unallocated memory etc.). But I don't know where that was called from, becau...
TITLE: How to get a stack trace when C++ program crashes? (using msvc8/2005) QUESTION: Sometimes my c++ program crashes in debug mode, and what I got is a message box saying that an assertion failed in some of the internal memory management routines (accessing unallocated memory etc.). But I don't know where that was ...
[ "c++", "debugging", "visual-studio-2005", "stack-trace" ]
10
7
12,480
7
0
2008-09-22T02:01:15.520000
2008-09-22T02:02:31.243000
112,839
112,853
How to resolve a conflict with git-svn?
What is the best way to resolve a conflict when doing a git svn rebase, and the git branch you are on becomes "(no-branch)"?
You can use git mergetool to view and edit the conflicts in the usual fashion. Once you are sure the conflicts are resolved do git rebase --continue to continue the rebase, or if you don't want to include that revision do git rebase --skip
How to resolve a conflict with git-svn? What is the best way to resolve a conflict when doing a git svn rebase, and the git branch you are on becomes "(no-branch)"?
TITLE: How to resolve a conflict with git-svn? QUESTION: What is the best way to resolve a conflict when doing a git svn rebase, and the git branch you are on becomes "(no-branch)"? ANSWER: You can use git mergetool to view and edit the conflicts in the usual fashion. Once you are sure the conflicts are resolved do g...
[ "git", "svn", "merge", "conflict" ]
54
27
20,180
2
0
2008-09-22T02:03:55.593000
2008-09-22T02:08:32.320000
112,854
127,892
What does either Java GUI editor offer for rapid development and maintainability (i.e., Eclipse/SWT and Netbeans/Matisse)?
Between Eclipse/SWT or Netbeans/Matisse, what does either Java GUI editor give you in terms of rapid development and maintainability?
You are really asking two different questions: SWT vs Swing, and Eclipse GUI Editor vs Netbeans GUI Editor (Matisse). First, the difference between SWT and Swing is that they are two fundamentally different GUI libraries. This akin to asking the difference between Tk and Win32, or Java Swing vs.NET Forms (not to say th...
What does either Java GUI editor offer for rapid development and maintainability (i.e., Eclipse/SWT and Netbeans/Matisse)? Between Eclipse/SWT or Netbeans/Matisse, what does either Java GUI editor give you in terms of rapid development and maintainability?
TITLE: What does either Java GUI editor offer for rapid development and maintainability (i.e., Eclipse/SWT and Netbeans/Matisse)? QUESTION: Between Eclipse/SWT or Netbeans/Matisse, what does either Java GUI editor give you in terms of rapid development and maintainability? ANSWER: You are really asking two different ...
[ "java", "eclipse", "user-interface", "netbeans" ]
0
5
2,762
5
0
2008-09-22T02:08:35.097000
2008-09-24T15:30:53.640000
112,866
112,887
Database schema for hierarchical groups
I'm working on a database design for groups hierarchy used as the foundation of a larger system. Each group can contain other groups, and also 'devices' as leaf objects (nothing goes below device). The database being used is MS SQL 2005. (Though working in MS SQL 2000 would be a bonus; a solution requiring MS SQL 2008 ...
I'd recommend you actually construct the easiest-to-maintain way (the "standard" parent/child setup) and run at least some basic benchmarks on it. You'd be surprised what a database engine can do with the proper indexing, especially if your dataset can fit into memory. Assuming 6 attributes per group, 2000 groups, and ...
Database schema for hierarchical groups I'm working on a database design for groups hierarchy used as the foundation of a larger system. Each group can contain other groups, and also 'devices' as leaf objects (nothing goes below device). The database being used is MS SQL 2005. (Though working in MS SQL 2000 would be a ...
TITLE: Database schema for hierarchical groups QUESTION: I'm working on a database design for groups hierarchy used as the foundation of a larger system. Each group can contain other groups, and also 'devices' as leaf objects (nothing goes below device). The database being used is MS SQL 2005. (Though working in MS SQ...
[ "sql-server", "database", "database-design" ]
6
3
4,628
4
0
2008-09-22T02:17:24.983000
2008-09-22T02:26:12.963000
112,883
112,912
Change Style/Look of Asp:CheckBox using CSS
I want to change the standard "3D" look of the standard asp.net checkbox to say solid 1px. If I try to apply the styling to the Border for example it does just that - draws the standard checkbox with a border around it - which is valid I guess. Anyway, is there a way to change how the actual textbox is styled?
I think the best way to make CheckBox looks really different is not to use checkbox control at all. Better use your own images for checked/unchecked state on-top of hyperlink or image element. Cheers.
Change Style/Look of Asp:CheckBox using CSS I want to change the standard "3D" look of the standard asp.net checkbox to say solid 1px. If I try to apply the styling to the Border for example it does just that - draws the standard checkbox with a border around it - which is valid I guess. Anyway, is there a way to chang...
TITLE: Change Style/Look of Asp:CheckBox using CSS QUESTION: I want to change the standard "3D" look of the standard asp.net checkbox to say solid 1px. If I try to apply the styling to the Border for example it does just that - draws the standard checkbox with a border around it - which is valid I guess. Anyway, is th...
[ "asp.net", "css", "checkbox" ]
11
6
75,965
10
0
2008-09-22T02:24:58.757000
2008-09-22T02:41:23.927000
112,892
112,900
Monthly Birthday SQL Query
How would retrieve all customer's birthdays for a given month in SQL? What about MySQL? I was thinking of using the following with SQL server. select c.name from cust c where datename(m,c.birthdate) = datename(m,@suppliedDate) order by c.name
don't forget the 29th February... SELECT c.name FROM cust c WHERE ( MONTH(c.birthdate) = MONTH(@suppliedDate) AND DAY(c.birthdate) = DAY(@suppliedDate) ) OR ( MONTH(c.birthdate) = 2 AND DAY(c.birthdate) = 29 AND MONTH(@suppliedDate) = 3 AND DAY(@suppliedDate) = 1 AND (YEAR(@suppliedDate) % 4 = 0) AND ((YEAR(@suppliedDa...
Monthly Birthday SQL Query How would retrieve all customer's birthdays for a given month in SQL? What about MySQL? I was thinking of using the following with SQL server. select c.name from cust c where datename(m,c.birthdate) = datename(m,@suppliedDate) order by c.name
TITLE: Monthly Birthday SQL Query QUESTION: How would retrieve all customer's birthdays for a given month in SQL? What about MySQL? I was thinking of using the following with SQL server. select c.name from cust c where datename(m,c.birthdate) = datename(m,@suppliedDate) order by c.name ANSWER: don't forget the 29th F...
[ "sql", "mysql" ]
1
5
12,595
5
0
2008-09-22T02:31:10.253000
2008-09-22T02:36:15.390000
112,897
113,073
Determining the size of a file larger than 4GB
The code currently does this and the fgetpos does handle files larger than 4GB but the seek returns an error, so any idea how to seek to the end of a file > 4GB? fpos_t currentpos; sok=fseek(fp,0,SEEK_END); assert(sok==0,"Seek error!"); fgetpos(fp,&currentpos); m_filesize=currentpos;
If you're in Windows, you want GetFileSizeEx (MSDN). The return value is a 64bit int. On linux stat64 (manpage) is correct. fstat if you're working with a FILE*.
Determining the size of a file larger than 4GB The code currently does this and the fgetpos does handle files larger than 4GB but the seek returns an error, so any idea how to seek to the end of a file > 4GB? fpos_t currentpos; sok=fseek(fp,0,SEEK_END); assert(sok==0,"Seek error!"); fgetpos(fp,&currentpos); m_filesiz...
TITLE: Determining the size of a file larger than 4GB QUESTION: The code currently does this and the fgetpos does handle files larger than 4GB but the seek returns an error, so any idea how to seek to the end of a file > 4GB? fpos_t currentpos; sok=fseek(fp,0,SEEK_END); assert(sok==0,"Seek error!"); fgetpos(fp,&curr...
[ "c++", "c", "fseek", "fgetpos" ]
8
6
3,472
6
0
2008-09-22T02:34:09.997000
2008-09-22T03:41:09.510000
112,926
112,957
How can you change the Visual Studio IDE profile?
Can the Visual Studio IDE profile be changed without clearing all VS settings?
Tools -> Import and Export Settings.. -> [X] Import Selected... -> Save Current -> Choose options you wish to change
How can you change the Visual Studio IDE profile? Can the Visual Studio IDE profile be changed without clearing all VS settings?
TITLE: How can you change the Visual Studio IDE profile? QUESTION: Can the Visual Studio IDE profile be changed without clearing all VS settings? ANSWER: Tools -> Import and Export Settings.. -> [X] Import Selected... -> Save Current -> Choose options you wish to change
[ "visual-studio" ]
11
16
7,779
1
0
2008-09-22T02:48:57.980000
2008-09-22T02:59:29.873000
112,940
113,016
What are the statistics of HTML vs. Text email usage
What the latest figures are on people viewing their emails in text only mode vs. HTML? Wikipedia and it's source both seem to reference this research from 2006 which is an eternity ago in internet terms. An issue with combining both HTML and text based emails is taking a disproportionate amount of time to resolve given...
As with web browser usage statistics, it depends entirely on the audience. I have access to a bit of data on this subject and it seems that text-only email use is very low (for non-technical audiences, at least). <0.1% up to ~6% depending on demographic. It's not that much effort to do both (especially if you can find ...
What are the statistics of HTML vs. Text email usage What the latest figures are on people viewing their emails in text only mode vs. HTML? Wikipedia and it's source both seem to reference this research from 2006 which is an eternity ago in internet terms. An issue with combining both HTML and text based emails is taki...
TITLE: What are the statistics of HTML vs. Text email usage QUESTION: What the latest figures are on people viewing their emails in text only mode vs. HTML? Wikipedia and it's source both seem to reference this research from 2006 which is an eternity ago in internet terms. An issue with combining both HTML and text ba...
[ "email" ]
1
3
1,401
1
0
2008-09-22T02:52:26.070000
2008-09-22T03:19:42.167000
112,941
112,949
Create program installer in Visual Studio 2005?
I'm a web-guy stuck in "application world" in VS 2005. I created my windows forms program and want to give my end users the ability to install it (and some of it's resources) into a standard Program Files/App Directory location along with a start menu/desktop launcher. The help files don't give any instructions (that I...
You're looking for a "Setup Project" which should be under the "Other Project Types" -> "Setup and Deployment" category in the "New Project" dialog.
Create program installer in Visual Studio 2005? I'm a web-guy stuck in "application world" in VS 2005. I created my windows forms program and want to give my end users the ability to install it (and some of it's resources) into a standard Program Files/App Directory location along with a start menu/desktop launcher. Th...
TITLE: Create program installer in Visual Studio 2005? QUESTION: I'm a web-guy stuck in "application world" in VS 2005. I created my windows forms program and want to give my end users the ability to install it (and some of it's resources) into a standard Program Files/App Directory location along with a start menu/de...
[ "c#", "visual-studio", "winforms" ]
7
12
9,068
6
0
2008-09-22T02:52:45.913000
2008-09-22T02:54:09.527000
112,946
112,961
Accessing files across the windows network with near MAX_PATH length
I'm using C++ and accessing a UNC path across the network. This path is slightly greater than MAX_PATH. So I cannot obtain a file handle. But if I run the program on the computer in question, the path is not greater than MAX_PATH. So I can get a file handle. If I rename the file to have less characters (minus length of...
I recall that there is some feature like using \\?\ at the start of the path to get around the MAX_PATH limit. Here is a reference on MSDN: http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx For remote machines, you would use a path name such as: \\?\unc\server\share\path\file. The \\?\unc\ is the special pre...
Accessing files across the windows network with near MAX_PATH length I'm using C++ and accessing a UNC path across the network. This path is slightly greater than MAX_PATH. So I cannot obtain a file handle. But if I run the program on the computer in question, the path is not greater than MAX_PATH. So I can get a file ...
TITLE: Accessing files across the windows network with near MAX_PATH length QUESTION: I'm using C++ and accessing a UNC path across the network. This path is slightly greater than MAX_PATH. So I cannot obtain a file handle. But if I run the program on the computer in question, the path is not greater than MAX_PATH. So...
[ "c++", "windows", "visual-c++", "lan", "unc" ]
3
10
3,392
2
0
2008-09-22T02:53:12.480000
2008-09-22T03:01:35.487000
112,964
113,005
How do I add another run level (level 7) in Ubuntu?
Ubuntu has 8 run levels (0-6 and S), I want to add the run level 7. I have done the following: 1.- Created the folder /etc/rc7.d/, which contains some symbolic links to /etc/init.d/ 2.- Created the file /etc/event.d/rc7 This is its content: # rc7 - runlevel 7 compatibility # # This task runs the old sysv-rc runlevel 7 ...
You cannot; the runlevels are hardcoded into the utilities. But why do you need to? Runlevel 4 is essentially unused. And while it's not the best idea, you could repurpose either runlevel 3 or runlevel 5 depending on if you always/never use X. Note that some *nix systems have support for more than 6 runlevels, but Linu...
How do I add another run level (level 7) in Ubuntu? Ubuntu has 8 run levels (0-6 and S), I want to add the run level 7. I have done the following: 1.- Created the folder /etc/rc7.d/, which contains some symbolic links to /etc/init.d/ 2.- Created the file /etc/event.d/rc7 This is its content: # rc7 - runlevel 7 compatib...
TITLE: How do I add another run level (level 7) in Ubuntu? QUESTION: Ubuntu has 8 run levels (0-6 and S), I want to add the run level 7. I have done the following: 1.- Created the folder /etc/rc7.d/, which contains some symbolic links to /etc/init.d/ 2.- Created the file /etc/event.d/rc7 This is its content: # rc7 - r...
[ "ubuntu", "upstart", "runlevel" ]
0
2
2,001
2
0
2008-09-22T03:01:41.663000
2008-09-22T03:15:10.210000
112,969
113,008
What are some resources for learning to write specifications?
At work I am responsible for writing specifications quite often and I am also the person who insisted on getting specifications in the first place. The problem is I am unsure how specifications should look and what they should contain. A lot of the time when my boss is writing the specifications (we are both inexperien...
The most important part of development documentation in my opinion, is having the correct person do it. Requirements Docs - Users + Business Analyst Functional Spec - Business Analyst + developer Technical Spec (how the functionality will actually be implemented) - Sr. Developer / Architect Time estimates for schedulin...
What are some resources for learning to write specifications? At work I am responsible for writing specifications quite often and I am also the person who insisted on getting specifications in the first place. The problem is I am unsure how specifications should look and what they should contain. A lot of the time when...
TITLE: What are some resources for learning to write specifications? QUESTION: At work I am responsible for writing specifications quite often and I am also the person who insisted on getting specifications in the first place. The problem is I am unsure how specifications should look and what they should contain. A lo...
[ "specifications" ]
10
11
919
5
0
2008-09-22T03:04:00.207000
2008-09-22T03:16:05.653000
112,970
112,980
Python - When to use file vs open
What's the difference between file and open in Python? When should I use which one? (Say I'm in 2.5)
You should always use open(). As the documentation states: When opening a file, it's preferable to use open() instead of invoking this constructor directly. file is more suited to type testing (for example, writing "isinstance(f, file)"). Also, file() has been removed since Python 3.0.
Python - When to use file vs open What's the difference between file and open in Python? When should I use which one? (Say I'm in 2.5)
TITLE: Python - When to use file vs open QUESTION: What's the difference between file and open in Python? When should I use which one? (Say I'm in 2.5) ANSWER: You should always use open(). As the documentation states: When opening a file, it's preferable to use open() instead of invoking this constructor directly. f...
[ "python", "file" ]
141
157
92,233
6
0
2008-09-22T03:04:14.543000
2008-09-22T03:07:44.503000
112,975
112,984
Relative path in web config
How can I have a relative path in the web.config file. This value is not in the connection string so I cannot use |DataDirectory| (I think), so what can I do?
What is the relative path for? Are you talking about a physical directory path or a url path? Edit: I needed to do something similar for one of my projects. I needed to locate a config file that was stored in a certain folder. While the web.config file itself does not provide anything special for this, you can take a p...
Relative path in web config How can I have a relative path in the web.config file. This value is not in the connection string so I cannot use |DataDirectory| (I think), so what can I do?
TITLE: Relative path in web config QUESTION: How can I have a relative path in the web.config file. This value is not in the connection string so I cannot use |DataDirectory| (I think), so what can I do? ANSWER: What is the relative path for? Are you talking about a physical directory path or a url path? Edit: I need...
[ "c#", ".net", "path", "web-config", "relative-path" ]
2
1
6,593
1
0
2008-09-22T03:05:58.157000
2008-09-22T03:08:52.783000
113,007
113,011
Writing to the windows logs in Python
Is it possible to write to the windows logs in python?
Yes, just use Windows Python Extension, as stated here. import win32evtlogutil win32evtlogutil.ReportEvent(ApplicationName, EventID, EventCategory, EventType, Inserts, Data, SID)
Writing to the windows logs in Python Is it possible to write to the windows logs in python?
TITLE: Writing to the windows logs in Python QUESTION: Is it possible to write to the windows logs in python? ANSWER: Yes, just use Windows Python Extension, as stated here. import win32evtlogutil win32evtlogutil.ReportEvent(ApplicationName, EventID, EventCategory, EventType, Inserts, Data, SID)
[ "python", "windows", "logging" ]
15
20
7,942
1
0
2008-09-22T03:15:31.723000
2008-09-22T03:16:58.957000