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
86,181
86,294
How do I enforce data integrity rules in my database?
I'm designing this collection of classes and abstract (MustInherit) classes… This is the database table where I'm going to store all this… As far as the Microsoft SQL Server database knows, those are all nullable ("Allow Nulls") columns. But really, that depends on the class stored there: LinkNode, HtmlPageNode, or Cod...
Use CHECK constraints on the table. These allow you to use any kind of boolean logic (including on other values in the table) to allow/reject the data. From the Books Online site: You can create a CHECK constraint with any logical (Boolean) expression that returns TRUE or FALSE based on the logical operators. For the p...
How do I enforce data integrity rules in my database? I'm designing this collection of classes and abstract (MustInherit) classes… This is the database table where I'm going to store all this… As far as the Microsoft SQL Server database knows, those are all nullable ("Allow Nulls") columns. But really, that depends on ...
TITLE: How do I enforce data integrity rules in my database? QUESTION: I'm designing this collection of classes and abstract (MustInherit) classes… This is the database table where I'm going to store all this… As far as the Microsoft SQL Server database knows, those are all nullable ("Allow Nulls") columns. But really...
[ "sql", "sql-server", "database", "database-design" ]
3
2
3,925
10
0
2008-09-17T18:32:30.290000
2008-09-17T18:46:53.940000
86,202
656,391
Internationalised labels in JSF/Facelets
Does Facelets have any features for neater or more readable internationalised user interface text labels that what you can otherwise do using JSF? For example, with plain JSF, using h:outputFormat is a very verbose way to interpolate variables in messages. Clarification: I know that I can add a message file entry that ...
You could create your own faces tag library to make it less verbose, something like: Then create the taglib in your view dir: /components/ph.taglib.xml http://peterhilton.com/core i18n i18n.xhtml create /components/i18n.xhtml You can probably find an elegant way of passing the arguments with a little research. Now regi...
Internationalised labels in JSF/Facelets Does Facelets have any features for neater or more readable internationalised user interface text labels that what you can otherwise do using JSF? For example, with plain JSF, using h:outputFormat is a very verbose way to interpolate variables in messages. Clarification: I know ...
TITLE: Internationalised labels in JSF/Facelets QUESTION: Does Facelets have any features for neater or more readable internationalised user interface text labels that what you can otherwise do using JSF? For example, with plain JSF, using h:outputFormat is a very verbose way to interpolate variables in messages. Clar...
[ "java", "jsf", "internationalization", "facelets" ]
5
3
4,666
7
0
2008-09-17T18:35:33.857000
2009-03-17T23:11:09.247000
86,204
86,338
How to conditionally enable actions in C# ASP.NET website
Using a configuration file I want to enable myself to turn on and off things like (third party) logging and using a cache in a C# website. The solution should not be restricted to logging and caching in particular but more general, so I can use it for other things as well. I have a configuration xml file in which I can...
I'm curious what kind of logging/caching statements you have? If you have some class that is doing WriteLog or StoreCahce or whatever... why not just put the if(logging) in the WriteLog method. It seems like if you put all of your logging caching related methods into once class and that class knew whether logging/cachi...
How to conditionally enable actions in C# ASP.NET website Using a configuration file I want to enable myself to turn on and off things like (third party) logging and using a cache in a C# website. The solution should not be restricted to logging and caching in particular but more general, so I can use it for other thin...
TITLE: How to conditionally enable actions in C# ASP.NET website QUESTION: Using a configuration file I want to enable myself to turn on and off things like (third party) logging and using a cache in a C# website. The solution should not be restricted to logging and caching in particular but more general, so I can use...
[ "c#" ]
1
2
297
6
0
2008-09-17T18:35:37.727000
2008-09-17T18:51:47.280000
86,211
86,227
File Replication Solutions
Thinking about a Windows-hosted build process that will periodically drop files to disk to be replicated to several other Windows Servers in the same datacenter. The other machines would run IIS, and serve those files to the masses. The total corpus size would be millions of files, 100's of GB of data. It'd have to dea...
I've used rsync scripts with good success for this type of work, 1000's of machines in our case. I believe there is an rsync server for windows, but I have not used it on anything other than Linux.
File Replication Solutions Thinking about a Windows-hosted build process that will periodically drop files to disk to be replicated to several other Windows Servers in the same datacenter. The other machines would run IIS, and serve those files to the masses. The total corpus size would be millions of files, 100's of G...
TITLE: File Replication Solutions QUESTION: Thinking about a Windows-hosted build process that will periodically drop files to disk to be replicated to several other Windows Servers in the same datacenter. The other machines would run IIS, and serve those files to the masses. The total corpus size would be millions of...
[ "file", "filesystems", "replication", "xcopy", "san" ]
0
1
653
4
0
2008-09-17T18:36:13.497000
2008-09-17T18:38:21.120000
86,219
87,159
Interfacing with telephony systems from *nix
Does anyone know of any 'standard' way to interface with a telephony system (think Cisco CCM) from a C/C++ app in *nix? I have used MS TAPI in the past but this is Windows only and don't want to go the jTAPI (Java) route, which seems to be the only option on the face of it. I want to monitor the phone system for loggin...
I have experience with two telephony standards TAPI, and CSTA, as far as I know there is no such agreement between vendors (e.g. Cisco, Nortel, NEC) regarding THE standard API. I would recommend looking at the availability of SMDR (Station Messaging Detail Recording) on the PBX platforms you are targeting, assuming tha...
Interfacing with telephony systems from *nix Does anyone know of any 'standard' way to interface with a telephony system (think Cisco CCM) from a C/C++ app in *nix? I have used MS TAPI in the past but this is Windows only and don't want to go the jTAPI (Java) route, which seems to be the only option on the face of it. ...
TITLE: Interfacing with telephony systems from *nix QUESTION: Does anyone know of any 'standard' way to interface with a telephony system (think Cisco CCM) from a C/C++ app in *nix? I have used MS TAPI in the past but this is Windows only and don't want to go the jTAPI (Java) route, which seems to be the only option o...
[ "c++", "unix", "cisco", "tapi" ]
1
1
511
3
0
2008-09-17T18:37:22.637000
2008-09-17T20:16:55.343000
86,220
86,610
Can I make Perl ithreads in Windows run concurrently?
I have a Perl script that I'm attempting to set up using Perl Threads (use threads). When I run simple tests everything works, but when I do my actual script (which has the threads running multiple SQL Plus sessions), each SQL Plus session runs in order (i.e., thread 1's sqlplus runs steps 1-5, then thread 2's sqlplus ...
A few possible explanations: Are you running this script on a multi-core processor or multi-processor machine? If you only have one CPU only one thread can use it at any time. Are there transactions or locks involved with steps 1-6 that would prevent it from being done concurrently? Are you certain you are using multip...
Can I make Perl ithreads in Windows run concurrently? I have a Perl script that I'm attempting to set up using Perl Threads (use threads). When I run simple tests everything works, but when I do my actual script (which has the threads running multiple SQL Plus sessions), each SQL Plus session runs in order (i.e., threa...
TITLE: Can I make Perl ithreads in Windows run concurrently? QUESTION: I have a Perl script that I'm attempting to set up using Perl Threads (use threads). When I run simple tests everything works, but when I do my actual script (which has the threads running multiple SQL Plus sessions), each SQL Plus session runs in ...
[ "perl", "multithreading", "concurrency" ]
2
4
1,049
3
0
2008-09-17T18:37:45.800000
2008-09-17T19:20:23.187000
86,262
86,297
LINQ to SQL in Visual Studio 2005
I normally run VS 2008 at home and LINQ is built in. At work we are still using VS 2005 and I have the opportunity to start a new project that I would like to use LINQ to SQL. After doing some searching all I could come up with was the MAY 2006 CTP of LINQ would have to be installed for LINQ to work in VS 2005. Does so...
You can reference System.Data.Linq.dll and System.Core.dll, and set your build target for C# 3.0 or the latest VB compiler, but everything else would have to be mapped manually (no designer support in VS2005 in LINQ to SQL RTM).
LINQ to SQL in Visual Studio 2005 I normally run VS 2008 at home and LINQ is built in. At work we are still using VS 2005 and I have the opportunity to start a new project that I would like to use LINQ to SQL. After doing some searching all I could come up with was the MAY 2006 CTP of LINQ would have to be installed fo...
TITLE: LINQ to SQL in Visual Studio 2005 QUESTION: I normally run VS 2008 at home and LINQ is built in. At work we are still using VS 2005 and I have the opportunity to start a new project that I would like to use LINQ to SQL. After doing some searching all I could come up with was the MAY 2006 CTP of LINQ would have ...
[ "linq", "linq-to-sql", "visual-studio-2005" ]
2
2
5,136
2
0
2008-09-17T18:43:43.057000
2008-09-17T18:47:00.427000
86,269
86,309
Why is setInterval calling a function with random arguments?
So, I am seeing a curious problem. If I have a function // counter wraps around to beginning eventually, omitted for clarity. var counter; cycleCharts(chartId) { // chartId should be undefined when called from setInterval console.log('chartId: ' + chartId); if(typeof chartId == 'undefined' || chartId < 0) { next = coun...
setInterval is feeding cycleCharts actual timing data ( so one can work out the actual time it ran and use to produce a less stilted response, mostly practical in animation ) you want var cycleId = setInterval(function(){ cycleCharts(); }, 10000); ( this behavior may not be standardized, so don't rely on it too heavily...
Why is setInterval calling a function with random arguments? So, I am seeing a curious problem. If I have a function // counter wraps around to beginning eventually, omitted for clarity. var counter; cycleCharts(chartId) { // chartId should be undefined when called from setInterval console.log('chartId: ' + chartId); i...
TITLE: Why is setInterval calling a function with random arguments? QUESTION: So, I am seeing a curious problem. If I have a function // counter wraps around to beginning eventually, omitted for clarity. var counter; cycleCharts(chartId) { // chartId should be undefined when called from setInterval console.log('chartI...
[ "javascript", "firefox" ]
3
4
789
3
0
2008-09-17T18:44:19.593000
2008-09-17T18:48:50.033000
86,278
89,443
Custom row source for combo box in continuous form in Access
I have searched around, and it seems that this is a limitation in MS Access, so I'm wondering what creative solutions other have found to this puzzle. If you have a continuous form and you want a field to be a combo box of options that are specific to that row, Access fails to deliver; the combo box row source is only ...
I also hate Access, but you must play with the cards you are dealt. Continuous forms are a wonderful thing in Access, until you run into any sort of complexity as is commonly the case, like in this instance. Here is what I would do when faced with this situation (and I have implemented similar workarounds before): Plac...
Custom row source for combo box in continuous form in Access I have searched around, and it seems that this is a limitation in MS Access, so I'm wondering what creative solutions other have found to this puzzle. If you have a continuous form and you want a field to be a combo box of options that are specific to that ro...
TITLE: Custom row source for combo box in continuous form in Access QUESTION: I have searched around, and it seems that this is a limitation in MS Access, so I'm wondering what creative solutions other have found to this puzzle. If you have a continuous form and you want a field to be a combo box of options that are s...
[ "ms-access" ]
16
17
52,914
13
0
2008-09-17T18:45:16.843000
2008-09-18T02:20:53.987000
86,292
86,341
How to check for valid xml in string input before calling .LoadXml()
I would much prefer to do this without catching an exception in LoadXml() and using this results as part of my logic. Any ideas for a solution that doesn't involve manually parsing the xml myself? I think VB has a return value of false for this function instead of throwing an XmlException. Xml input is provided from th...
Just catch the exception. The small overhead from catching an exception drowns compared to parsing the XML. If you want the function (for stylistic reasons, not for performance), implement it yourself: public class MyXmlDocument: XmlDocument { bool TryParseXml(string xml){ try{ ParseXml(xml); return true; }catch(XmlExc...
How to check for valid xml in string input before calling .LoadXml() I would much prefer to do this without catching an exception in LoadXml() and using this results as part of my logic. Any ideas for a solution that doesn't involve manually parsing the xml myself? I think VB has a return value of false for this functi...
TITLE: How to check for valid xml in string input before calling .LoadXml() QUESTION: I would much prefer to do this without catching an exception in LoadXml() and using this results as part of my logic. Any ideas for a solution that doesn't involve manually parsing the xml myself? I think VB has a return value of fal...
[ "c#", ".net", "xml", "exception" ]
45
69
104,453
5
0
2008-09-17T18:46:35.530000
2008-09-17T18:52:03.990000
86,302
86,437
What is the most effective tool you've used to track changes in a CVS repository?
I'm in Quality Assurance and use Fisheye to track checkins to CVS. What other options do people use? We have tens of thousands of files and have plans for migrating to Team Foundation Server's code management tool 'at some point' When we do that, there will be lots of information that will be available.
ViewVC provides a nice web interface to CVS (or SVN) and is reasonably easy to setup. It does not provide the same functionality as fisheye, however. I haven't tried the integration w/ a SQL DB backend though, I believe that will add some fisheye-like capabilities. CVSTrac also provides a web interface, wiki, ticket sy...
What is the most effective tool you've used to track changes in a CVS repository? I'm in Quality Assurance and use Fisheye to track checkins to CVS. What other options do people use? We have tens of thousands of files and have plans for migrating to Team Foundation Server's code management tool 'at some point' When we ...
TITLE: What is the most effective tool you've used to track changes in a CVS repository? QUESTION: I'm in Quality Assurance and use Fisheye to track checkins to CVS. What other options do people use? We have tens of thousands of files and have plans for migrating to Team Foundation Server's code management tool 'at so...
[ "cvs", "version-control" ]
1
2
231
3
0
2008-09-17T18:47:31.440000
2008-09-17T19:01:12.017000
86,324
86,340
Tool to reformat xml-comments (Visual Studio 2008)
does anyone know of a macro or add-on for VS 2008 which reformats xml-comments? There has been this really smart CommentReflower for the older version of VS, but I couldn't find a release supporting VS 2008. Any ideas? Thanks in advance! Matthias
I have used the SlickEdit tools in the past to help keep XML comments inline.
Tool to reformat xml-comments (Visual Studio 2008) does anyone know of a macro or add-on for VS 2008 which reformats xml-comments? There has been this really smart CommentReflower for the older version of VS, but I couldn't find a release supporting VS 2008. Any ideas? Thanks in advance! Matthias
TITLE: Tool to reformat xml-comments (Visual Studio 2008) QUESTION: does anyone know of a macro or add-on for VS 2008 which reformats xml-comments? There has been this really smart CommentReflower for the older version of VS, but I couldn't find a release supporting VS 2008. Any ideas? Thanks in advance! Matthias ANS...
[ "visual-studio-2008", "macros", "xml-comments", "add-on" ]
0
1
1,100
3
0
2008-09-17T18:49:46.007000
2008-09-17T18:52:02.600000
86,361
531,173
Designing a Yahoo Pipes inspired interface
I really like the interface for Yahoo Pipes ( http://pipes.yahoo.com/pipes/ ) and would like to create a similar interface for a different problem. Are there any libraries that would allow me to create an interface with the same basic look and feel? I especially like how the pipes behave and how they are not just strai...
WireIt is an open-source javascript library to create web wirable interfaces like Yahoo! Pipes for dataflow applications, visual programming languages or graphical modeling. Wireit uses the YUI library (2.6.0) for DOM and events manipulation, and excanvas for IE support of the canvas tag. It currently supports Firefox ...
Designing a Yahoo Pipes inspired interface I really like the interface for Yahoo Pipes ( http://pipes.yahoo.com/pipes/ ) and would like to create a similar interface for a different problem. Are there any libraries that would allow me to create an interface with the same basic look and feel? I especially like how the p...
TITLE: Designing a Yahoo Pipes inspired interface QUESTION: I really like the interface for Yahoo Pipes ( http://pipes.yahoo.com/pipes/ ) and would like to create a similar interface for a different problem. Are there any libraries that would allow me to create an interface with the same basic look and feel? I especia...
[ "interface", "widget", "graph-theory", "yahoo-pipes" ]
13
20
16,827
5
0
2008-09-17T18:53:39.273000
2009-02-10T05:45:28.050000
86,365
86,525
When is this VB6 member variable destroyed?
Suppose I have a class module clsMyClass with an object as a member variable. Listed below are two complete implementations of this very simple class. Implementation 1: Dim oObj As New clsObject Implementation 2: Dim oObj As clsObject Private Sub Class_Initialize() Set oObj = New clsObject End Sub Private Sub Class_T...
In implementation 1 the clsObject will not get instantiated until it is used. If it is never used, then the clsObject.Class_Initialize event will never fire. In implementation 2, the clsObject instance will be created at the same time that the clsMyClass is instantiated. The clsObject.Class_Initialize will always be ex...
When is this VB6 member variable destroyed? Suppose I have a class module clsMyClass with an object as a member variable. Listed below are two complete implementations of this very simple class. Implementation 1: Dim oObj As New clsObject Implementation 2: Dim oObj As clsObject Private Sub Class_Initialize() Set oObj ...
TITLE: When is this VB6 member variable destroyed? QUESTION: Suppose I have a class module clsMyClass with an object as a member variable. Listed below are two complete implementations of this very simple class. Implementation 1: Dim oObj As New clsObject Implementation 2: Dim oObj As clsObject Private Sub Class_Init...
[ "vb6" ]
8
5
372
3
0
2008-09-17T18:54:06.590000
2008-09-17T19:11:36.813000
86,402
86,459
How can I get Git to follow symlinks?
Is my best be going to be a shell script which replaces symlinks with copies, or is there another way of telling Git to follow symlinks? PS: I know it's not very secure, but I only want to do it in a few specific cases.
NOTE: This advice is now out-dated as per comment since Git 1.6.1. Git used to behave this way, and no longer does. Git by default attempts to store symlinks instead of following them (for compactness, and it's generally what people want). However, I accidentally managed to get it to add files beyond the symlink when t...
How can I get Git to follow symlinks? Is my best be going to be a shell script which replaces symlinks with copies, or is there another way of telling Git to follow symlinks? PS: I know it's not very secure, but I only want to do it in a few specific cases.
TITLE: How can I get Git to follow symlinks? QUESTION: Is my best be going to be a shell script which replaces symlinks with copies, or is there another way of telling Git to follow symlinks? PS: I know it's not very secure, but I only want to do it in a few specific cases. ANSWER: NOTE: This advice is now out-dated ...
[ "git", "symlink" ]
275
47
125,200
14
0
2008-09-17T18:57:36.097000
2008-09-17T19:03:00.607000
86,408
86,543
Select current date by default in ASP.Net Calendar control
Let's say I have an aspx page with this calendar control: Is there anything I can put in for SelectedDate to make it use the current date by default, without having to use the code-behind?
If you are already doing databinding: Will do it. This does require that somewhere you are doing a Page.DataBind() call (or a databind call on a parent control). If you are not doing that and you absolutely do not want any codebehind on the page, then you'll have to create a usercontrol that contains a calendar control...
Select current date by default in ASP.Net Calendar control Let's say I have an aspx page with this calendar control: Is there anything I can put in for SelectedDate to make it use the current date by default, without having to use the code-behind?
TITLE: Select current date by default in ASP.Net Calendar control QUESTION: Let's say I have an aspx page with this calendar control: Is there anything I can put in for SelectedDate to make it use the current date by default, without having to use the code-behind? ANSWER: If you are already doing databinding: Will do...
[ "asp.net", "calendar" ]
19
20
113,093
7
0
2008-09-17T18:58:39.417000
2008-09-17T19:13:55.073000
86,413
86,483
Creating a fixed width file in C#
What is the best way to create a fixed width file in C#. I have a bunch of fields with lengths to write out. Say 20,80.10,2 etc all left aligned. Is there an easy way to do this?
You can use string.Format to easily pad a value with spaces e.g. string a = String.Format("|{0,5}|{1,5}|{2,5}", 1, 20, 300); string b = String.Format("|{0,-5}|{1,-5}|{2,-5}", 1, 20, 300); // 'a' will be equal to "| 1| 20| 300|" // 'b' will be equal to "|1 |20 |300 |"
Creating a fixed width file in C# What is the best way to create a fixed width file in C#. I have a bunch of fields with lengths to write out. Say 20,80.10,2 etc all left aligned. Is there an easy way to do this?
TITLE: Creating a fixed width file in C# QUESTION: What is the best way to create a fixed width file in C#. I have a bunch of fields with lengths to write out. Say 20,80.10,2 etc all left aligned. Is there an easy way to do this? ANSWER: You can use string.Format to easily pad a value with spaces e.g. string a = Stri...
[ "c#" ]
38
55
50,864
12
0
2008-09-17T18:59:20.227000
2008-09-17T19:06:15.577000
86,417
93,218
Creating a workflow task generates an "Invalid field name" error
I have a custom (code-based) workflow, deployed in WSS via features in a.wsp file. The workflow is configured with a custom task content type (ie, the Workflow element contains a TaskListContentTypeId attribute). This content type's declaration contains a FormUrls element pointing to a custom task edit page. When the w...
It turns out that I was missing two things: My custom content type neeeded to be added to the workflow task list I needed to add an empty FieldRefs element to my content type definition; without it, the content type wasn't inheriting any workflow task fields.
Creating a workflow task generates an "Invalid field name" error I have a custom (code-based) workflow, deployed in WSS via features in a.wsp file. The workflow is configured with a custom task content type (ie, the Workflow element contains a TaskListContentTypeId attribute). This content type's declaration contains a...
TITLE: Creating a workflow task generates an "Invalid field name" error QUESTION: I have a custom (code-based) workflow, deployed in WSS via features in a.wsp file. The workflow is configured with a custom task content type (ie, the Workflow element contains a TaskListContentTypeId attribute). This content type's decl...
[ "sharepoint", "workflow", "wss" ]
2
2
2,562
2
0
2008-09-17T18:59:37.137000
2008-09-18T14:46:29.857000
86,426
86,456
Why JavaScript rather than a standard browser virtual machine?
Would it not make sense to support a set of languages (Java, Python, Ruby, etc.) by way of a standardized virtual machine hosted in the browser rather than requiring the use of a specialized language -- really, a specialized paradigm -- for client scripting only? To clarify the suggestion, a web page would contain byte...
Well, yes. Certainly if we had a time machine, going back and ensuring a lot of the Javascript features were designed differently would be a major pastime (that, and ensuring the people who designed IE's CSS engine never went into IT). But it's not going to happen, and we're stuck with it now. I suspect, in time, it wi...
Why JavaScript rather than a standard browser virtual machine? Would it not make sense to support a set of languages (Java, Python, Ruby, etc.) by way of a standardized virtual machine hosted in the browser rather than requiring the use of a specialized language -- really, a specialized paradigm -- for client scripting...
TITLE: Why JavaScript rather than a standard browser virtual machine? QUESTION: Would it not make sense to support a set of languages (Java, Python, Ruby, etc.) by way of a standardized virtual machine hosted in the browser rather than requiring the use of a specialized language -- really, a specialized paradigm -- fo...
[ "javascript" ]
169
28
17,343
32
0
2008-09-17T19:00:12.690000
2008-09-17T19:02:43.837000
86,428
86,771
What’s the best way to reload / refresh an iframe?
I would like to reload an using JavaScript. The best way I found until now was set the iframe’s src attribute to itself, but this isn’t very clean. Any ideas?
document.getElementById('some_frame_id').contentWindow.location.reload(); be careful, in Firefox, window.frames[] cannot be indexed by id, but by name or index
What’s the best way to reload / refresh an iframe? I would like to reload an using JavaScript. The best way I found until now was set the iframe’s src attribute to itself, but this isn’t very clean. Any ideas?
TITLE: What’s the best way to reload / refresh an iframe? QUESTION: I would like to reload an using JavaScript. The best way I found until now was set the iframe’s src attribute to itself, but this isn’t very clean. Any ideas? ANSWER: document.getElementById('some_frame_id').contentWindow.location.reload(); be carefu...
[ "javascript", "iframe" ]
318
300
615,082
24
0
2008-09-17T19:00:21.987000
2008-09-17T19:36:42.167000
86,435
86,482
Visual Basic 6 and UNC Paths
I'm receiving feedback from a developer that "The only way visual basic (6) can deal with a UNC path is to map it to a drive." Is this accurate? And, if so, what's the underlying issue and are there any alternatives other than a mapped drive?
Here is one way that works. Sub Main() Dim fs As New FileSystemObject ' Add Reference to Microsoft Scripting Runtime MsgBox fs.FileExists("\\server\folder\file.ext") End Sub
Visual Basic 6 and UNC Paths I'm receiving feedback from a developer that "The only way visual basic (6) can deal with a UNC path is to map it to a drive." Is this accurate? And, if so, what's the underlying issue and are there any alternatives other than a mapped drive?
TITLE: Visual Basic 6 and UNC Paths QUESTION: I'm receiving feedback from a developer that "The only way visual basic (6) can deal with a UNC path is to map it to a drive." Is this accurate? And, if so, what's the underlying issue and are there any alternatives other than a mapped drive? ANSWER: Here is one way that ...
[ "vb6", "unc" ]
5
3
9,929
7
0
2008-09-17T19:00:40.350000
2008-09-17T19:05:57.450000
86,474
86,522
Firing COM events in C++ - Synchronous or asynchronous?
I have an ActiveX control written using the MS ATL library and I am firing events via pDispatch->Invoke(..., DISPATCH_METHOD). The control will be used by a.NET client and my question is this - is the firing of the event a synchronous or asynchronous call? My concern is that, if synchronous, the application that handle...
It is synchronous from the point of view of the component generating the event. The control's thread of execution will call out into the receivers code and things are out of its control at that point. Clients receiving the events must make sure they return quickly. If they need to do some significant amount of work the...
Firing COM events in C++ - Synchronous or asynchronous? I have an ActiveX control written using the MS ATL library and I am firing events via pDispatch->Invoke(..., DISPATCH_METHOD). The control will be used by a.NET client and my question is this - is the firing of the event a synchronous or asynchronous call? My conc...
TITLE: Firing COM events in C++ - Synchronous or asynchronous? QUESTION: I have an ActiveX control written using the MS ATL library and I am firing events via pDispatch->Invoke(..., DISPATCH_METHOD). The control will be used by a.NET client and my question is this - is the firing of the event a synchronous or asynchro...
[ "c++", "com", "activex", "atl" ]
0
4
1,267
1
0
2008-09-17T19:04:40.540000
2008-09-17T19:11:06.593000
86,477
4,550,600
Does C# have an equivalent to JavaScript's encodeURIComponent()?
In JavaScript: encodeURIComponent("©√") == "%C2%A9%E2%88%9A" Is there an equivalent for C# applications? For escaping HTML characters I used: txtOut.Text = Regex.Replace(txtIn.Text, @"[\u0080-\uFFFF]", m => @"&#" + ((int)m.Value[0]).ToString() + ";"); But I'm not sure how to convert the match to the correct hexadecimal...
Uri.EscapeDataString or HttpUtility.UrlEncode is the correct way to escape a string meant to be part of a URL. Take for example the string "Stack Overflow": HttpUtility.UrlEncode("Stack Overflow") --> "Stack+Overflow" Uri.EscapeUriString("Stack Overflow") --> "Stack%20Overflow" Uri.EscapeDataString("Stack + Overflow") ...
Does C# have an equivalent to JavaScript's encodeURIComponent()? In JavaScript: encodeURIComponent("©√") == "%C2%A9%E2%88%9A" Is there an equivalent for C# applications? For escaping HTML characters I used: txtOut.Text = Regex.Replace(txtIn.Text, @"[\u0080-\uFFFF]", m => @"&#" + ((int)m.Value[0]).ToString() + ";"); But...
TITLE: Does C# have an equivalent to JavaScript's encodeURIComponent()? QUESTION: In JavaScript: encodeURIComponent("©√") == "%C2%A9%E2%88%9A" Is there an equivalent for C# applications? For escaping HTML characters I used: txtOut.Text = Regex.Replace(txtIn.Text, @"[\u0080-\uFFFF]", m => @"&#" + ((int)m.Value[0]).ToSt...
[ "c#", "javascript", ".net", "windows", "encoding" ]
164
282
140,427
7
0
2008-09-17T19:05:10.323000
2010-12-29T00:21:40.270000
86,479
97,384
ASP.net ACTK DragPanel Extender on PopupControlExtender with UpdatePanel does not drag after partial postback
I have a panel on an aspx page which contains an UpdatePanel. This panel is wrapped with both a PopUpControl Extender as well as a DragPanel Extender. Upon initial show everything works fine, the panel pops up and closes as expected and can be dragged around as well. There is a linkbutton within the UpdatePanel which t...
Take a look at when the drag panel extender and popup control extender actually extend your panel. Chances are those extenders work on an initialization event of the page. When the update panel fires and updates your page the original DOM element that was extended was replaced by the result of the update panel. Which m...
ASP.net ACTK DragPanel Extender on PopupControlExtender with UpdatePanel does not drag after partial postback I have a panel on an aspx page which contains an UpdatePanel. This panel is wrapped with both a PopUpControl Extender as well as a DragPanel Extender. Upon initial show everything works fine, the panel pops up ...
TITLE: ASP.net ACTK DragPanel Extender on PopupControlExtender with UpdatePanel does not drag after partial postback QUESTION: I have a panel on an aspx page which contains an UpdatePanel. This panel is wrapped with both a PopUpControl Extender as well as a DragPanel Extender. Upon initial show everything works fine, ...
[ "asp.net", "asp.net-ajax", "webforms" ]
0
1
1,868
1
0
2008-09-17T19:05:40.650000
2008-09-18T21:54:01.750000
86,487
104,366
What is the best documentation for snapshots and flow repositories in Spring Web Flow?
I'm looking for more and better documentation about snapshots, flow repositories, and flow state serialization in Spring Web Flow. Available docs I've found seem pretty sparse. "Spring in Action" doesn't talk about this. The Spring Web Flow Reference Manual does mention a couple flags here: http://static.springframewor...
did you try out any of these books? http://www.ervacon.com/products/swfbook/index.html -- from the original author of WebFlow? http://www.amazon.com/Expert-Spring-MVC-Web-Flow/dp/159059584X
What is the best documentation for snapshots and flow repositories in Spring Web Flow? I'm looking for more and better documentation about snapshots, flow repositories, and flow state serialization in Spring Web Flow. Available docs I've found seem pretty sparse. "Spring in Action" doesn't talk about this. The Spring W...
TITLE: What is the best documentation for snapshots and flow repositories in Spring Web Flow? QUESTION: I'm looking for more and better documentation about snapshots, flow repositories, and flow state serialization in Spring Web Flow. Available docs I've found seem pretty sparse. "Spring in Action" doesn't talk about ...
[ "java", "spring", "documentation", "spring-webflow" ]
3
2
892
1
0
2008-09-17T19:06:40.647000
2008-09-19T18:34:53.753000
86,491
86,523
How do I use RegisterClientScriptBlock to register JavaScript?
ASP.NET 2.0 provides the ClientScript.RegisterClientScriptBlock() method for registering JavaScript in an ASP.NET Page. The issue I'm having is passing the script when it's located in another directory. Specifically, the following syntax does not work: ClientScript.RegisterClientScriptBlock(this.GetType(), "scriptName"...
What you're after is: ClientScript.RegisterClientScriptInclude(this.GetType(), "scriptName", "../dir/subdir/scriptName.js")
How do I use RegisterClientScriptBlock to register JavaScript? ASP.NET 2.0 provides the ClientScript.RegisterClientScriptBlock() method for registering JavaScript in an ASP.NET Page. The issue I'm having is passing the script when it's located in another directory. Specifically, the following syntax does not work: Clie...
TITLE: How do I use RegisterClientScriptBlock to register JavaScript? QUESTION: ASP.NET 2.0 provides the ClientScript.RegisterClientScriptBlock() method for registering JavaScript in an ASP.NET Page. The issue I'm having is passing the script when it's located in another directory. Specifically, the following syntax d...
[ "javascript", "asp.net" ]
3
5
3,589
3
0
2008-09-17T19:07:01.800000
2008-09-17T19:11:09.870000
86,513
86,580
Why is using the JavaScript eval function a bad idea?
The eval function is a powerful and easy way to dynamically generate code, so what are the caveats?
Improper use of eval opens up your code for injection attacks Debugging can be more challenging (no line numbers, etc.) eval'd code executes slower (no opportunity to compile/cache eval'd code) Edit: As @Jeff Walden points out in comments, #3 is less true today than it was in 2008. However, while some caching of compil...
Why is using the JavaScript eval function a bad idea? The eval function is a powerful and easy way to dynamically generate code, so what are the caveats?
TITLE: Why is using the JavaScript eval function a bad idea? QUESTION: The eval function is a powerful and easy way to dynamically generate code, so what are the caveats? ANSWER: Improper use of eval opens up your code for injection attacks Debugging can be more challenging (no line numbers, etc.) eval'd code execute...
[ "javascript", "security", "eval" ]
586
415
292,645
25
0
2008-09-17T19:09:54.803000
2008-09-17T19:17:35.207000
86,515
86,605
Does anyone know the CVS command line options to get the details of the last check in?
I'm using CVS on Windows (with the WinCVS front end), and would like to add details of the last check in to the email from our automated build process, whenever a build fails, in order to make it easier to fix. I need to know the files that have changed, the user that changed them, and the comment. I've been trying to ...
Wow. I'd forgotten how hard this is to do. What I'd done before was a two stage process. Firstly, running cvs history -c -a -D "7 days ago" | gawk '{ print "$1 == \"" $6 "\" && $2 == \"" $8 "/" $7 "\" { print \"" $2 " " $3 " " $6 " " $5 " " $8 "/" $7 "\"; next }" }' > /tmp/$$.awk to gather information about all checkin...
Does anyone know the CVS command line options to get the details of the last check in? I'm using CVS on Windows (with the WinCVS front end), and would like to add details of the last check in to the email from our automated build process, whenever a build fails, in order to make it easier to fix. I need to know the fil...
TITLE: Does anyone know the CVS command line options to get the details of the last check in? QUESTION: I'm using CVS on Windows (with the WinCVS front end), and would like to add details of the last check in to the email from our automated build process, whenever a build fails, in order to make it easier to fix. I ne...
[ "continuous-integration", "build-automation", "cvs" ]
5
1
2,263
9
0
2008-09-17T19:10:13.977000
2008-09-17T19:19:46.340000
86,526
86,628
Can I make the Ant copy task OS-specific?
I have an Ant script that performs a copy operation using the 'copy' task. It was written for Windows, and has a hardcoded C:\ path as the 'todir' argument. I see the 'exec' task has an OS argument, is there a similar way to branch a copy based on OS?
I would recommend putting the path in a property, then setting the property conditionally based on the current OS. No foo.path set for this OS! As a side benefit, once it is in a property you can override it without editing the Ant script.
Can I make the Ant copy task OS-specific? I have an Ant script that performs a copy operation using the 'copy' task. It was written for Windows, and has a hardcoded C:\ path as the 'todir' argument. I see the 'exec' task has an OS argument, is there a similar way to branch a copy based on OS?
TITLE: Can I make the Ant copy task OS-specific? QUESTION: I have an Ant script that performs a copy operation using the 'copy' task. It was written for Windows, and has a hardcoded C:\ path as the 'todir' argument. I see the 'exec' task has an OS argument, is there a similar way to branch a copy based on OS? ANSWER:...
[ "ant", "copy" ]
19
31
13,206
6
0
2008-09-17T19:11:39.387000
2008-09-17T19:21:47.490000
86,531
88,805
JSF selectItem label formatting
Trying to keep all the presentation stuff in the xhtml on this project and I need to format some values in a selectItem tag have a BigDecimal value and need to make it look like currency. Is there anyway to apply a Inside a tag? Any way to do this or a work around that doesn't involve pushing this into the java code?
After doing some more research here I'm pretty convinced this isn't possible with the current implementation of JSF. There just isn't an opportunity to transform the value. http://java.sun.com/javaee/javaserverfaces/1.2/docs/tlddocs/f/selectItem.html The tld shows the itemLabel property as being a ValueExpression and t...
JSF selectItem label formatting Trying to keep all the presentation stuff in the xhtml on this project and I need to format some values in a selectItem tag have a BigDecimal value and need to make it look like currency. Is there anyway to apply a Inside a tag? Any way to do this or a work around that doesn't involve pu...
TITLE: JSF selectItem label formatting QUESTION: Trying to keep all the presentation stuff in the xhtml on this project and I need to format some values in a selectItem tag have a BigDecimal value and need to make it look like currency. Is there anyway to apply a Inside a tag? Any way to do this or a work around that ...
[ "java", "jsf" ]
4
4
4,159
3
0
2008-09-17T19:12:46.543000
2008-09-18T00:00:59.143000
86,534
86,887
Reading changes in a file in real-time using .NET
I have a.csv file that is frequently updated (about 20 to 30 times per minute). I want to insert the newly added lines to a database as soon as they are written to the file. The FileSystemWatcher class listens to the file system change notifications and can raise an event whenever there is a change in a specified file....
I've written something very similar. I used the FileSystemWatcher to get notifications about changes. I then used a FileStream to read the data (keeping track of my last position within the file and seeking to that before reading the new data). Then I add the read data to a buffer which automatically extracts complete ...
Reading changes in a file in real-time using .NET I have a.csv file that is frequently updated (about 20 to 30 times per minute). I want to insert the newly added lines to a database as soon as they are written to the file. The FileSystemWatcher class listens to the file system change notifications and can raise an eve...
TITLE: Reading changes in a file in real-time using .NET QUESTION: I have a.csv file that is frequently updated (about 20 to 30 times per minute). I want to insert the newly added lines to a database as soon as they are written to the file. The FileSystemWatcher class listens to the file system change notifications an...
[ ".net", "file", "filesystemwatcher" ]
3
3
6,964
6
0
2008-09-17T19:12:58.290000
2008-09-17T19:47:08.037000
86,539
93,402
How to Modify config file on clickonce deployment?
I have a application deployed through clickonce, but How can I modify the config file on the deployment server?. I mean, once the product is tested, it should be deployed in our production server, but need to modify some of the config parameters to consume production resources?. I heard we should use MageUI.exe, but st...
Yes, the best way to do it would probably be MageUI. Just open your manifests with MageUI, click Save and it should prompt you to resign the manifests. You have two options when signing manifests. You can use a self-certificate or purchase a certificate. Self certificates are easy to use but when the app is installed t...
How to Modify config file on clickonce deployment? I have a application deployed through clickonce, but How can I modify the config file on the deployment server?. I mean, once the product is tested, it should be deployed in our production server, but need to modify some of the config parameters to consume production r...
TITLE: How to Modify config file on clickonce deployment? QUESTION: I have a application deployed through clickonce, but How can I modify the config file on the deployment server?. I mean, once the product is tested, it should be deployed in our production server, but need to modify some of the config parameters to co...
[ ".net", "clickonce" ]
6
4
6,756
2
0
2008-09-17T19:13:32.143000
2008-09-18T15:06:13.103000
86,545
86,608
Is there a JavaScript PNG fix for IE6 that allows CSS background positioning?
I've seen a few fixes for allowing PNG images to have transparency in Internet Explorer 6, but I've yet to find one that also allows you to set the background position in CSS. If you use sprites, it's a deal-breaker. I've resorted to using GIF's (which are not as high quality), not using transparent images at all, or s...
Yes. Convert your images to use indexed pallets (png256). You can support transparency (just like gif), but not an alpha channel. You can do this using Irfanview and the pngout plugin, pngquant or pngnq. The YUI performance team also did a great presentation that covers this an many other image optimization concepts.
Is there a JavaScript PNG fix for IE6 that allows CSS background positioning? I've seen a few fixes for allowing PNG images to have transparency in Internet Explorer 6, but I've yet to find one that also allows you to set the background position in CSS. If you use sprites, it's a deal-breaker. I've resorted to using GI...
TITLE: Is there a JavaScript PNG fix for IE6 that allows CSS background positioning? QUESTION: I've seen a few fixes for allowing PNG images to have transparency in Internet Explorer 6, but I've yet to find one that also allows you to set the background position in CSS. If you use sprites, it's a deal-breaker. I've re...
[ "javascript", "css", "internet-explorer-6", "png", "transparency" ]
11
7
7,525
6
0
2008-09-17T19:14:06.557000
2008-09-17T19:20:06.637000
86,548
87,068
How do I protect my file data from disk corruption?
Recently, I read an article entitled "SATA vs. SCSI reliability". It mostly discusses the very high rate bit flipping in consumer SATA drives and concludes "A 56% chance that you can't read all the data from a particular disk now". Even Raid-5 can't save us as it must be constantly scanned for problems and if a disk do...
ZFS is a start. Many storage vendors provide 520B drives with extra data protection available as well. However, this only protects your data as soon as it enters the storage fabric. If it was corrupted at the host level, then you are hosed anyway. On the horizon are some promising standards-based solutions to this very...
How do I protect my file data from disk corruption? Recently, I read an article entitled "SATA vs. SCSI reliability". It mostly discusses the very high rate bit flipping in consumer SATA drives and concludes "A 56% chance that you can't read all the data from a particular disk now". Even Raid-5 can't save us as it must...
TITLE: How do I protect my file data from disk corruption? QUESTION: Recently, I read an article entitled "SATA vs. SCSI reliability". It mostly discusses the very high rate bit flipping in consumer SATA drives and concludes "A 56% chance that you can't read all the data from a particular disk now". Even Raid-5 can't ...
[ "filesystems", "storage", "corruption" ]
2
0
1,701
3
0
2008-09-17T19:14:15.637000
2008-09-17T20:05:53.983000
86,549
86,801
IndexOutOfRangeException in the Ajax.Net extensions framework
For some reason when I attempt to make a request to an Ajax.net web service with the ScriptService attribute set, an exception occurs deep inside the protocol class which I have no control over. Anyone seen this before? Here is the exact msg: System.IndexOutOfRangeException: Index was outside the bounds of the array. a...
Also make sure your web.config is setup properly for asp.net ajax: http://www.asp.net/AJAX/Documentation/Live/ConfiguringASPNETAJAX.aspx
IndexOutOfRangeException in the Ajax.Net extensions framework For some reason when I attempt to make a request to an Ajax.net web service with the ScriptService attribute set, an exception occurs deep inside the protocol class which I have no control over. Anyone seen this before? Here is the exact msg: System.IndexOut...
TITLE: IndexOutOfRangeException in the Ajax.Net extensions framework QUESTION: For some reason when I attempt to make a request to an Ajax.net web service with the ScriptService attribute set, an exception occurs deep inside the protocol class which I have no control over. Anyone seen this before? Here is the exact ms...
[ "c#", "ajax.net" ]
0
0
2,989
2
0
2008-09-17T19:14:21.017000
2008-09-17T19:39:04.407000
86,558
86,589
Best Permalinking for Rails
What do you think is the best way to create SEO friendly URLs (dynamically) in Rails?
Override the to_param method in your model classes so that the default numeric ID is replaced with a meaningful string. For example, this very question uses best-permalinking-for-rails in the URL. Ryan Bates has a Railscast on this topic.
Best Permalinking for Rails What do you think is the best way to create SEO friendly URLs (dynamically) in Rails?
TITLE: Best Permalinking for Rails QUESTION: What do you think is the best way to create SEO friendly URLs (dynamically) in Rails? ANSWER: Override the to_param method in your model classes so that the default numeric ID is replaced with a meaningful string. For example, this very question uses best-permalinking-for-...
[ "ruby-on-rails", "ruby", "seo", "permalinks" ]
4
6
1,623
7
0
2008-09-17T19:15:28.473000
2008-09-17T19:18:21.647000
86,561
86,576
Inlining C++ code
Is there any difference to the following code: class Foo { inline int SomeFunc() { return 42; } int AnotherFunc() { return 42; } }; Will both functions gets inlined? Does inline actually make any difference? Are there any rules on when you should or shouldn't inline code? I often use the AnotherFunc syntax (accessors f...
Both forms should be inlined in the exact same way. Inline is implicit for function bodies defined in a class definition.
Inlining C++ code Is there any difference to the following code: class Foo { inline int SomeFunc() { return 42; } int AnotherFunc() { return 42; } }; Will both functions gets inlined? Does inline actually make any difference? Are there any rules on when you should or shouldn't inline code? I often use the AnotherFunc s...
TITLE: Inlining C++ code QUESTION: Is there any difference to the following code: class Foo { inline int SomeFunc() { return 42; } int AnotherFunc() { return 42; } }; Will both functions gets inlined? Does inline actually make any difference? Are there any rules on when you should or shouldn't inline code? I often use...
[ "c++", "inline-functions" ]
9
16
3,207
9
0
2008-09-17T19:15:38.707000
2008-09-17T19:17:08.203000
86,562
86,614
What is "missing" in the Visual Studio 2008 Express Editions?
What is "missing" in the Visual Studio 2008 Express Editions? In particular, what functionality is not available? what restrictions are there on its use?
The major areas where Visual Studio Express lacks features compared to Visual Studio Professional: No add-ins/macros Some Win32 tools missing No Team Explorer support Limited refactoring support Debugging is much more limited (particularly problematic for server development is no remote debugging) Lack of support for s...
What is "missing" in the Visual Studio 2008 Express Editions? What is "missing" in the Visual Studio 2008 Express Editions? In particular, what functionality is not available? what restrictions are there on its use?
TITLE: What is "missing" in the Visual Studio 2008 Express Editions? QUESTION: What is "missing" in the Visual Studio 2008 Express Editions? In particular, what functionality is not available? what restrictions are there on its use? ANSWER: The major areas where Visual Studio Express lacks features compared to Visual...
[ "comparison", "visual-studio-express" ]
126
163
90,558
16
0
2008-09-17T19:15:41.967000
2008-09-17T19:20:49.940000
86,563
86,675
Linkbutton click event not running handler
I'm creating a custom drop down list with AJAX dropdownextender. Inside my drop panel I have linkbuttons for my options. --> And this works well. Now what I have to do is dynamically fill this dropdownlist. Here is my best attempt: private void fillRemitDDL() { //LinkButton Text="451 Stinky Place Drive North Nowhere, N...
I'm not sure what your setDDL method does in your script but it should fire if one of the link buttons is clicked. I think you might be better off just inserting a generic html anchor though instead of a.net linkbutton as you will have no reference to the control on the server side. Then you can handle the data excahng...
Linkbutton click event not running handler I'm creating a custom drop down list with AJAX dropdownextender. Inside my drop panel I have linkbuttons for my options. --> And this works well. Now what I have to do is dynamically fill this dropdownlist. Here is my best attempt: private void fillRemitDDL() { //LinkButton Te...
TITLE: Linkbutton click event not running handler QUESTION: I'm creating a custom drop down list with AJAX dropdownextender. Inside my drop panel I have linkbuttons for my options. --> And this works well. Now what I have to do is dynamically fill this dropdownlist. Here is my best attempt: private void fillRemitDDL()...
[ "c#", "events", "asp.net-ajax", "webforms" ]
1
1
3,824
3
0
2008-09-17T19:15:47.893000
2008-09-17T19:26:51.660000
86,582
92,193
Singleton: How should it be used
Edit: From another question I provided an answer that has links to a lot of questions/answers about singletons: More info about singletons here: So I have read the thread Singletons: good design or a crutch? And the argument still rages. I see Singletons as a Design Pattern (good and bad). The problem with Singleton is...
Answer: Use a Singleton if: You need to have one and only one object of a type in system Do not use a Singleton if: You want to save memory You want to try something new You want to show off how much you know Because everyone else is doing it (See cargo cult programmer in wikipedia) In user interface widgets It is supp...
Singleton: How should it be used Edit: From another question I provided an answer that has links to a lot of questions/answers about singletons: More info about singletons here: So I have read the thread Singletons: good design or a crutch? And the argument still rages. I see Singletons as a Design Pattern (good and ba...
TITLE: Singleton: How should it be used QUESTION: Edit: From another question I provided an answer that has links to a lot of questions/answers about singletons: More info about singletons here: So I have read the thread Singletons: good design or a crutch? And the argument still rages. I see Singletons as a Design Pa...
[ "c++", "design-patterns", "singleton" ]
321
201
215,430
24
0
2008-09-17T19:17:39.747000
2008-09-18T12:43:04.273000
86,604
94,216
Google Maps, Z Index and Drop Down Javascript menus
I've run on a little problem today: I have a JS drop down menu and when I inserted a GoogleMap... the Menu is rendered behind the Google Map... Any ideas on how to chance the z Index of the Google Map? Thanks!
If your problem happens in Internet Explorer, but it renders the way you'd expect in FireFox or Safari, this link was extraordinarily helpful for me with a similar problem. It appears to boil down to the idea that marking an element as "position:relative;" in CSS causes IE6&7 to mess with it's z-index relative to other...
Google Maps, Z Index and Drop Down Javascript menus I've run on a little problem today: I have a JS drop down menu and when I inserted a GoogleMap... the Menu is rendered behind the Google Map... Any ideas on how to chance the z Index of the Google Map? Thanks!
TITLE: Google Maps, Z Index and Drop Down Javascript menus QUESTION: I've run on a little problem today: I have a JS drop down menu and when I inserted a GoogleMap... the Menu is rendered behind the Google Map... Any ideas on how to chance the z Index of the Google Map? Thanks! ANSWER: If your problem happens in Inte...
[ "javascript", "html", "css", "google-maps", "z-index" ]
14
8
23,189
11
0
2008-09-17T19:19:42.627000
2008-09-18T16:34:22.360000
86,607
88,200
How do I correctly access static member classes?
I have two classes, and want to include a static instance of one class inside the other and access the static fields from the second class via the first. This is so I can have non-identical instances with the same name. Class A { public static package1.Foo foo; } Class B { public static package2.Foo foo; } //package1...
I agree with others that you're probably thinking about this the wrong way. With that out of the way, this may work for you if you are only accessing static members: public class A { public static class Foo extends package1.Foo {} } public class B { public static class Foo extends package2.Foo {} }
How do I correctly access static member classes? I have two classes, and want to include a static instance of one class inside the other and access the static fields from the second class via the first. This is so I can have non-identical instances with the same name. Class A { public static package1.Foo foo; } Class ...
TITLE: How do I correctly access static member classes? QUESTION: I have two classes, and want to include a static instance of one class inside the other and access the static fields from the second class via the first. This is so I can have non-identical instances with the same name. Class A { public static package1....
[ "java", "static" ]
4
1
10,855
5
0
2008-09-17T19:20:06.277000
2008-09-17T22:06:55.003000
86,636
86,666
Proper Logging in OOP context
Here is a problem I've struggled with ever since I first started learning object-oriented programming: how should one implement a logger in "proper" OOP code? By this, I mean an object that has a method that we want every other object in the code to be able to access; this method would output to console/file/whatever, ...
You do want to establish the logger as a global variable, because global variables are not bad. At least, they aren't inherently bad. A logger is a great example of the proper use of a globally accessible object. Read about the Singleton design pattern if you want more information.
Proper Logging in OOP context Here is a problem I've struggled with ever since I first started learning object-oriented programming: how should one implement a logger in "proper" OOP code? By this, I mean an object that has a method that we want every other object in the code to be able to access; this method would out...
TITLE: Proper Logging in OOP context QUESTION: Here is a problem I've struggled with ever since I first started learning object-oriented programming: how should one implement a logger in "proper" OOP code? By this, I mean an object that has a method that we want every other object in the code to be able to access; thi...
[ "language-agnostic", "oop", "logging" ]
9
14
3,999
16
0
2008-09-17T19:23:07.580000
2008-09-17T19:26:13.390000
86,653
1,823,885
How to "pretty" format JSON output
I would like my JSON output in Ruby on Rails to be "pretty" or nicely formatted. Right now, I call to_json and my JSON is all on one line. At times this can be difficult to see if there is a problem in the JSON output stream. Is there way to configure to make my JSON "pretty" or nicely formatted in Rails?
Use the pretty_generate() function, built into later versions of JSON. For example: require 'json' my_object = {:array => [1, 2, 3, {:sample => "hash"} ],:foo => "bar" } puts JSON.pretty_generate(my_object) Which gets you: { "array": [ 1, 2, 3, { "sample": "hash" } ], "foo": "bar" }
How to "pretty" format JSON output I would like my JSON output in Ruby on Rails to be "pretty" or nicely formatted. Right now, I call to_json and my JSON is all on one line. At times this can be difficult to see if there is a problem in the JSON output stream. Is there way to configure to make my JSON "pretty" or nicel...
TITLE: How to "pretty" format JSON output QUESTION: I would like my JSON output in Ruby on Rails to be "pretty" or nicely formatted. Right now, I call to_json and my JSON is all on one line. At times this can be difficult to see if there is a problem in the JSON output stream. Is there way to configure to make my JSON...
[ "ruby-on-rails", "ruby", "json", "pretty-print" ]
757
1,161
402,683
20
0
2008-09-17T19:25:17.310000
2009-12-01T03:50:35.753000
86,660
86,881
Different values of GetHashCode for inproc and stateserver session variables
I've recently inherited an application that makes very heavy use of session, including storing a lot of custom data objects in session. One of my first points of business with this application was to at least move the session data away from InProc, and off load it to either a stateserver or SQL Server. After I made all...
When you write does a lot of object comparisons using GetHashCode() i sense there is something horribly wrong with this code. The GetHashCode method does not guarantee, that the returned hash values should be in any way unique given two different objects. As far as GetHashCode is concerned, it can return 0 for all obje...
Different values of GetHashCode for inproc and stateserver session variables I've recently inherited an application that makes very heavy use of session, including storing a lot of custom data objects in session. One of my first points of business with this application was to at least move the session data away from In...
TITLE: Different values of GetHashCode for inproc and stateserver session variables QUESTION: I've recently inherited an application that makes very heavy use of session, including storing a lot of custom data objects in session. One of my first points of business with this application was to at least move the session...
[ "c#", "asp.net", "session" ]
0
2
835
3
0
2008-09-17T19:25:51.600000
2008-09-17T19:46:06.777000
86,669
86,944
What is the inversion of the Shunting Yard algorithm?
Dijkstra's Shunting Yard algorithm is used to parse an infix notation and generate RPN output. I am looking for the opposite, a way to turn RPN into highschool-math-class style infix notation, in order to represent RPN expressions from a database to lay users in an understandable way. Please save your time and don't co...
Since RPN is also known as postfix notation, I tried googling convert "postfix to infix" and got quite a few results. The first several have code examples, but I found the RubyQuiz entry particularly enlightening.
What is the inversion of the Shunting Yard algorithm? Dijkstra's Shunting Yard algorithm is used to parse an infix notation and generate RPN output. I am looking for the opposite, a way to turn RPN into highschool-math-class style infix notation, in order to represent RPN expressions from a database to lay users in an ...
TITLE: What is the inversion of the Shunting Yard algorithm? QUESTION: Dijkstra's Shunting Yard algorithm is used to parse an infix notation and generate RPN output. I am looking for the opposite, a way to turn RPN into highschool-math-class style infix notation, in order to represent RPN expressions from a database t...
[ "algorithm", "parsing" ]
13
8
2,325
2
0
2008-09-17T19:26:23.610000
2008-09-17T19:52:50.457000
86,684
86,960
TimeStamp in Control File
I have a script that takes a table name and generates a control file by querying all the columns/rows the table. This works fine for numeric and character data but fails on timestamp data so I need to adjust the script to output the timestamp data into the control in such a way that it can be read in properly. So essen...
You need to use to_date in your column listing as demonstrated here. Something like: LOAD DATA INFILE * INTO TABLE some_table FIELDS TERMINATED BY "," ( col1 col2 "to_date(:col2, 'YYYY-MM-DD HH24:MI:SS')" ) BEGINDATA foo,2008-09-17 13:00:00 bar,2008-09-17 13:30:05
TimeStamp in Control File I have a script that takes a table name and generates a control file by querying all the columns/rows the table. This works fine for numeric and character data but fails on timestamp data so I need to adjust the script to output the timestamp data into the control in such a way that it can be ...
TITLE: TimeStamp in Control File QUESTION: I have a script that takes a table name and generates a control file by querying all the columns/rows the table. This works fine for numeric and character data but fails on timestamp data so I need to adjust the script to output the timestamp data into the control in such a w...
[ "oracle", "sql-loader", "controlfile" ]
0
0
5,045
1
0
2008-09-17T19:27:33
2008-09-17T19:55:27.003000
86,685
104,316
Debugging LINQ to SQL SubmitChanges()
I am having a really hard time attempting to debug LINQ to SQL and submitting changes. I have been using http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx, which works great for debugging simple queries. I'm working in the DataContext Class for my project with the following snippet fro...
First, thanks everyone for the help, I finally found it. The solution was to drop the.dbml file from the project, add a blank.dbml file and repopulate it with the tables needed for my project from the 'Server Explorer'. I noticed a couple of things while I was doing this: There are a few tables in the system named with...
Debugging LINQ to SQL SubmitChanges() I am having a really hard time attempting to debug LINQ to SQL and submitting changes. I have been using http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx, which works great for debugging simple queries. I'm working in the DataContext Class for my ...
TITLE: Debugging LINQ to SQL SubmitChanges() QUESTION: I am having a really hard time attempting to debug LINQ to SQL and submitting changes. I have been using http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx, which works great for debugging simple queries. I'm working in the DataCon...
[ "linq", "linq-to-sql", "debugging" ]
21
8
28,782
19
0
2008-09-17T19:27:36.820000
2008-09-19T18:27:27.640000
86,710
87,782
Does DataGrid on CE 5.0 Compact Framework .NET support editing?
I am trying to get a DataGrid under CE 5.0 /.NET CF 2.0 that a user can edit. The document at http://msdn.microsoft.com/en-us/library/ms838165.aspx indicates that some environments do not support editing - As there is no native support for editing in the DataGrid control, this needs to be implemented manually Do I need...
No, it is not directly editable. MSDN has samples for using the DataGrid, including suggestions for data editing, for both Pocket PC and Smartphone devices. Either one would be a reasonable start for a generic CE device, but the general strategy is to determine which cell is active and place a textbox over it for editi...
Does DataGrid on CE 5.0 Compact Framework .NET support editing? I am trying to get a DataGrid under CE 5.0 /.NET CF 2.0 that a user can edit. The document at http://msdn.microsoft.com/en-us/library/ms838165.aspx indicates that some environments do not support editing - As there is no native support for editing in the D...
TITLE: Does DataGrid on CE 5.0 Compact Framework .NET support editing? QUESTION: I am trying to get a DataGrid under CE 5.0 /.NET CF 2.0 that a user can edit. The document at http://msdn.microsoft.com/en-us/library/ms838165.aspx indicates that some environments do not support editing - As there is no native support fo...
[ ".net", "compact-framework", "windows-ce" ]
3
2
7,772
5
0
2008-09-17T19:29:48.423000
2008-09-17T21:19:56.193000
86,763
119,465
Change .xla File with MSBuild
I'm trying to create a build script for my current project, which includes an Excel Add-in. The Add-in contains a VBProject with a file modGlobal with a variable version_Number. This number needs to be changed for every build. The exact steps: Open XLA document with Excel. Switch to VBEditor mode. (Alt+F11) Open VBProj...
An alternative way of handling versioning of an XLA file is to use a custom property in Document Properties. You can access and manipulate using COM as described here: http://support.microsoft.com/?kbid=224351. Advantages of this are: You can examine the version number without opening the XLA file You don't need Excel ...
Change .xla File with MSBuild I'm trying to create a build script for my current project, which includes an Excel Add-in. The Add-in contains a VBProject with a file modGlobal with a variable version_Number. This number needs to be changed for every build. The exact steps: Open XLA document with Excel. Switch to VBEdit...
TITLE: Change .xla File with MSBuild QUESTION: I'm trying to create a build script for my current project, which includes an Excel Add-in. The Add-in contains a VBProject with a file modGlobal with a variable version_Number. This number needs to be changed for every build. The exact steps: Open XLA document with Excel...
[ "excel", "msbuild", "build-automation", "xla", "vba" ]
4
3
5,120
3
0
2008-09-17T19:36:00.683000
2008-09-23T06:56:18.500000
86,766
90,627
How to properly handle exceptions when performing file io
Often I find myself interacting with files in some way but after writing the code I'm always uncertain how robust it actually is. The problem is that I'm not entirely sure how file related operations can fail and, therefore, the best way to handle exceptions. The simple solution would seem to be just to catch any IOExc...
...but is it possible to get a bit more fine-grained error messages. Yes. Go ahead and catch IOException, and use the Exception.ToString() method to get a relatively relevant error message to display. Note that the exceptions generated by the.NET Framework will supply these useful strings, but if you are going to throw...
How to properly handle exceptions when performing file io Often I find myself interacting with files in some way but after writing the code I'm always uncertain how robust it actually is. The problem is that I'm not entirely sure how file related operations can fail and, therefore, the best way to handle exceptions. Th...
TITLE: How to properly handle exceptions when performing file io QUESTION: Often I find myself interacting with files in some way but after writing the code I'm always uncertain how robust it actually is. The problem is that I'm not entirely sure how file related operations can fail and, therefore, the best way to han...
[ "c#", ".net", "exception", "file-io" ]
21
15
41,334
6
0
2008-09-17T19:36:11.870000
2008-09-18T07:03:21.767000
86,780
86,832
How to check if a String contains another String in a case insensitive manner in Java?
Say I have two strings, String s1 = "AbBaCca"; String s2 = "bac"; I want to perform a check returning that s2 is contained within s1. I can do this with: return s1.contains(s2); I am pretty sure that contains() is case sensitive, however I can't determine this for sure from reading the documentation. If it is then I su...
Yes, contains is case sensitive. You can use java.util.regex.Pattern with the CASE_INSENSITIVE flag for case insensitive matching: Pattern.compile(Pattern.quote(wantedStr), Pattern.CASE_INSENSITIVE).matcher(source).find(); EDIT: If s2 contains regex special characters (of which there are many) it's important to quote i...
How to check if a String contains another String in a case insensitive manner in Java? Say I have two strings, String s1 = "AbBaCca"; String s2 = "bac"; I want to perform a check returning that s2 is contained within s1. I can do this with: return s1.contains(s2); I am pretty sure that contains() is case sensitive, how...
TITLE: How to check if a String contains another String in a case insensitive manner in Java? QUESTION: Say I have two strings, String s1 = "AbBaCca"; String s2 = "bac"; I want to perform a check returning that s2 is contained within s1. I can do this with: return s1.contains(s2); I am pretty sure that contains() is c...
[ "java", "string" ]
467
353
551,937
19
0
2008-09-17T19:37:32.600000
2008-09-17T19:41:55.583000
86,793
980,971
How to avoid thousands of needless ListView.SelectedIndexChanged events?
If a user select all items in a.NET 2.0 ListView, the ListView will fire a SelectedIndexChanged event for every item, rather than firing an event to indicate that the selection has changed. If the user then clicks to select just one item in the list, the ListView will fire a SelectedIndexChanged event for every item th...
I took that and made it into a reusable class, making sure to dispose of the timer properly. I also reduced the interval to get a more responsive app. This control also doublebuffers to reduce flicker. public class DoublebufferedListView: System.Windows.Forms.ListView { private Timer m_changeDelayTimer = null; public D...
How to avoid thousands of needless ListView.SelectedIndexChanged events? If a user select all items in a.NET 2.0 ListView, the ListView will fire a SelectedIndexChanged event for every item, rather than firing an event to indicate that the selection has changed. If the user then clicks to select just one item in the li...
TITLE: How to avoid thousands of needless ListView.SelectedIndexChanged events? QUESTION: If a user select all items in a.NET 2.0 ListView, the ListView will fire a SelectedIndexChanged event for every item, rather than firing an event to indicate that the selection has changed. If the user then clicks to select just ...
[ ".net", "winforms", "listview", "selectedindexchanged" ]
17
13
9,087
14
0
2008-09-17T19:38:42.440000
2009-06-11T13:11:47.173000
86,797
88,063
Connecting delegate classes in Objective-C
I've got two controls in my Interface Builder file, and each of those controls I've created a separate delegate class for in code (Control1Delegate and Control2Delegate). I created two "Objects" in interface builder, made them of that type, and connected the controls to them as delegates. The delegates work just fine. ...
You can add outlets from either delegate to the other delegate. There are two ways to add an outlet to an object in IB (assuming you're using Xcode/IB version 3.0 or later: If you have not generated the code for your delegate classes yet, select the desired delegate, then open the "Object Identity" tab in the IB inspec...
Connecting delegate classes in Objective-C I've got two controls in my Interface Builder file, and each of those controls I've created a separate delegate class for in code (Control1Delegate and Control2Delegate). I created two "Objects" in interface builder, made them of that type, and connected the controls to them a...
TITLE: Connecting delegate classes in Objective-C QUESTION: I've got two controls in my Interface Builder file, and each of those controls I've created a separate delegate class for in code (Control1Delegate and Control2Delegate). I created two "Objects" in interface builder, made them of that type, and connected the ...
[ "objective-c", "cocoa", "interface-builder" ]
8
8
5,291
3
0
2008-09-17T19:38:53.500000
2008-09-17T21:51:37.100000
86,800
86,860
Is the syntax for the Wordpress style.css template element available anywhere?
I've recently embarked upon the grand voyage of Wordpress theming and I've been reading through the Wordpress documentation for how to write a theme. One thing I came across here was that the style.css file must contain a specific header in order to be used by the Wordpress engine. They give a brief example but I haven...
Based on http://codex.wordpress.org/Theme_Development: The following is an example of the first few lines of the stylesheet, called the style sheet header, for the Theme "Rose": /* Theme Name: Rose Theme URI: the-theme's-homepage Description: a-brief-description Author: your-name Author URI: your-URI Template: use-this...
Is the syntax for the Wordpress style.css template element available anywhere? I've recently embarked upon the grand voyage of Wordpress theming and I've been reading through the Wordpress documentation for how to write a theme. One thing I came across here was that the style.css file must contain a specific header in ...
TITLE: Is the syntax for the Wordpress style.css template element available anywhere? QUESTION: I've recently embarked upon the grand voyage of Wordpress theming and I've been reading through the Wordpress documentation for how to write a theme. One thing I came across here was that the style.css file must contain a s...
[ "wordpress", "wordpress-theming", "css" ]
3
7
3,130
2
0
2008-09-17T19:39:00.210000
2008-09-17T19:44:12.943000
86,849
86,922
Javascript array reference
If I have the following: {"hdrs": ["Make","Model","Year"], "data": [ {"Make":"Honda","Model":"Accord","Year":"2008"} {"Make":"Toyota","Model":"Corolla","Year":"2008"} {"Make":"Honda","Model":"Pilot","Year":"2008"}] } And I have a "hdrs" name (i.e. "Make"), how can I reference the data array instances? seems like data["...
I had to alter your code a little: var x = {"hdrs": ["Make","Model","Year"], "data": [ {"Make":"Honda","Model":"Accord","Year":"2008"}, {"Make":"Toyota","Model":"Corolla","Year":"2008"}, {"Make":"Honda","Model":"Pilot","Year":"2008"}] }; alert( x.data[0].Make ); EDIT: in response to your edit var x = {"hdrs": ["Make",...
Javascript array reference If I have the following: {"hdrs": ["Make","Model","Year"], "data": [ {"Make":"Honda","Model":"Accord","Year":"2008"} {"Make":"Toyota","Model":"Corolla","Year":"2008"} {"Make":"Honda","Model":"Pilot","Year":"2008"}] } And I have a "hdrs" name (i.e. "Make"), how can I reference the data array i...
TITLE: Javascript array reference QUESTION: If I have the following: {"hdrs": ["Make","Model","Year"], "data": [ {"Make":"Honda","Model":"Accord","Year":"2008"} {"Make":"Toyota","Model":"Corolla","Year":"2008"} {"Make":"Honda","Model":"Pilot","Year":"2008"}] } And I have a "hdrs" name (i.e. "Make"), how can I referenc...
[ "javascript", "json" ]
1
4
2,611
9
0
2008-09-17T19:43:16.923000
2008-09-17T19:49:56.703000
86,863
107,086
DB2 Transport Component is not registered correctly
I'm trying to test the DB2 adapter for BizTalk 2006 (not R2). While trying to configure an instance in an application, I get an error stating: DB2 Transport Component is not registered correctly The enivronment is 2 BizTalk servers sharing a messagebox. The DB2 adapter works fine on the first server. It is the second s...
When the "registered" word appears, I think about the registration of COM components, not the installation of.NET assemblies. The underlying driver the DB2 adapter uses is the Microsoft ODBC Driver for DB2. You may want to check if your ODBC DSN control panel shows up that particular driver for you to configure a DSN. ...
DB2 Transport Component is not registered correctly I'm trying to test the DB2 adapter for BizTalk 2006 (not R2). While trying to configure an instance in an application, I get an error stating: DB2 Transport Component is not registered correctly The enivronment is 2 BizTalk servers sharing a messagebox. The DB2 adapte...
TITLE: DB2 Transport Component is not registered correctly QUESTION: I'm trying to test the DB2 adapter for BizTalk 2006 (not R2). While trying to configure an instance in an application, I get an error stating: DB2 Transport Component is not registered correctly The enivronment is 2 BizTalk servers sharing a messageb...
[ "db2", "biztalk", "biztalk-2006" ]
0
0
560
1
0
2008-09-17T19:44:24.610000
2008-09-20T04:19:58.730000
86,901
958,857
Creating a fluid panel in GWT to fill the page?
I would like a panel in GWT to fill the page without actually having to set the size. Is there a way to do this? Currently I have the following: public class Main implements EntryPoint { public void onModuleLoad() { HorizontalSplitPanel split = new HorizontalSplitPanel(); //split.setSize("250px", "500px"); split.setSpl...
Google has answered the main part of your question in one of their FAQs: http://code.google.com/webtoolkit/doc/1.6/FAQ_UI.html#How_do_I_create_an_app_that_fills_the_page_vertically_when_the_b The primary point is that you can't set height to 100%, you must do something like this: final VerticalPanel vp = new VerticalPa...
Creating a fluid panel in GWT to fill the page? I would like a panel in GWT to fill the page without actually having to set the size. Is there a way to do this? Currently I have the following: public class Main implements EntryPoint { public void onModuleLoad() { HorizontalSplitPanel split = new HorizontalSplitPanel();...
TITLE: Creating a fluid panel in GWT to fill the page? QUESTION: I would like a panel in GWT to fill the page without actually having to set the size. Is there a way to do this? Currently I have the following: public class Main implements EntryPoint { public void onModuleLoad() { HorizontalSplitPanel split = new Horiz...
[ "java", "gwt" ]
18
19
25,788
8
0
2008-09-17T19:48:15.710000
2009-06-06T02:23:35.237000
86,907
86,953
How do I fix "501 Syntactically invalid HELO argument(s)"?
I'm using exim on both the sending and relay hosts, the sending host seems to offer: HELO foo_bar.example.com Response: 501 Syntactically invalid HELO argument(s)
Possibly a problem with underscores in the hostname? http://www.exim.org/lurker/message/20041124.113314.c44c83b2.en.html
How do I fix "501 Syntactically invalid HELO argument(s)"? I'm using exim on both the sending and relay hosts, the sending host seems to offer: HELO foo_bar.example.com Response: 501 Syntactically invalid HELO argument(s)
TITLE: How do I fix "501 Syntactically invalid HELO argument(s)"? QUESTION: I'm using exim on both the sending and relay hosts, the sending host seems to offer: HELO foo_bar.example.com Response: 501 Syntactically invalid HELO argument(s) ANSWER: Possibly a problem with underscores in the hostname? http://www.exim.or...
[ "email", "exim" ]
5
6
26,822
7
0
2008-09-17T19:48:29.453000
2008-09-17T19:54:44.820000
86,911
87,233
Converting SQL Result Sets to XML
I am looking for a tool that can serialize and/or transform SQL Result Sets into XML. Getting dumbed down XML generation from SQL result sets is simple and trivial, but that's not what I need. The solution has to be database neutral, and accepts only regular SQL query results (no db xml support used). A particular chal...
With SQL Server you really should consider using the FOR XML construct in the query. If you're using.Net, just use a DataAdapter to fill a dataset. Once it's in a dataset, just use its.WriteXML() method. That breaks your DB->object->XML rule, but it's really how things are done. You might be able to work something out ...
Converting SQL Result Sets to XML I am looking for a tool that can serialize and/or transform SQL Result Sets into XML. Getting dumbed down XML generation from SQL result sets is simple and trivial, but that's not what I need. The solution has to be database neutral, and accepts only regular SQL query results (no db xm...
TITLE: Converting SQL Result Sets to XML QUESTION: I am looking for a tool that can serialize and/or transform SQL Result Sets into XML. Getting dumbed down XML generation from SQL result sets is simple and trivial, but that's not what I need. The solution has to be database neutral, and accepts only regular SQL query...
[ "sql", "xml" ]
3
2
8,448
8
0
2008-09-17T19:48:47.270000
2008-09-17T20:25:19.490000
86,913
90,251
What's a good way to store raster data?
I have a variety of time-series data stored on a more-or-less georeferenced grid, e.g. one value per 0.2 degrees of latitude and longitude. Currently the data are stored in text files, so at day-of-year 251 you might see: 251 12.76 12.55 12.55 12.34 [etc., 200 more values...] 13.02 12.95 12.70 12.40 [etc., 200 more val...
I've assembled your comments here: I'd like to do all this "w/o writing my own file I/O code" I need access from "Java Ruby MATLAB" and "FORTRAN routines" When you add these up, you definitely don't want a new file format. Stick with the one you've got. If we can get you to relax your first requirement - ie, if you'd b...
What's a good way to store raster data? I have a variety of time-series data stored on a more-or-less georeferenced grid, e.g. one value per 0.2 degrees of latitude and longitude. Currently the data are stored in text files, so at day-of-year 251 you might see: 251 12.76 12.55 12.55 12.34 [etc., 200 more values...] 13....
TITLE: What's a good way to store raster data? QUESTION: I have a variety of time-series data stored on a more-or-less georeferenced grid, e.g. one value per 0.2 degrees of latitude and longitude. Currently the data are stored in text files, so at day-of-year 251 you might see: 251 12.76 12.55 12.55 12.34 [etc., 200 m...
[ "database", "geolocation", "time-series", "raster" ]
1
2
1,731
5
0
2008-09-17T19:49:04.973000
2008-09-18T05:20:25.523000
86,959
86,999
Same source code on two machines yield different executable behavior
Here's the scenario: A C# Windows Application project stored in SVN is used to create an executable. Normally, a build server handles the build process and creates builds at regular intervals which are used by testing. In this particular instance I was asked to modify a specific build and create the executable. I'm not...
The app uses the Regional Settings of the machine it's running on, and it looks like it is your problem. You can force a thread to use a specific culture by setting System.Threading.Thread.CurrentThread.CurrentCulture and System.Threading.Thread.CurrentThread.CurrentUICulture to a specific value.
Same source code on two machines yield different executable behavior Here's the scenario: A C# Windows Application project stored in SVN is used to create an executable. Normally, a build server handles the build process and creates builds at regular intervals which are used by testing. In this particular instance I wa...
TITLE: Same source code on two machines yield different executable behavior QUESTION: Here's the scenario: A C# Windows Application project stored in SVN is used to create an executable. Normally, a build server handles the build process and creates builds at regular intervals which are used by testing. In this partic...
[ ".net", "datetime", "compiler-construction" ]
1
5
954
9
0
2008-09-17T19:55:25.850000
2008-09-17T19:59:34.717000
86,963
87,080
How do I get a warning before killing a temporary buffer in Emacs?
More than once I've lost work by accidentally killing a temporary buffer in Emacs. Can I set up Emacs to give me a warning when I kill a buffer not associated with a file?
Make a function that will ask you whether you're sure when the buffer has been edited and is not associated with a file. Then add that function to the list kill-buffer-query-functions. Looking at the documentation for Buffer File Name you understand: a buffer is not visiting a file if and only if the variable buffer-fi...
How do I get a warning before killing a temporary buffer in Emacs? More than once I've lost work by accidentally killing a temporary buffer in Emacs. Can I set up Emacs to give me a warning when I kill a buffer not associated with a file?
TITLE: How do I get a warning before killing a temporary buffer in Emacs? QUESTION: More than once I've lost work by accidentally killing a temporary buffer in Emacs. Can I set up Emacs to give me a warning when I kill a buffer not associated with a file? ANSWER: Make a function that will ask you whether you're sure ...
[ "emacs" ]
8
12
441
2
0
2008-09-17T19:55:29.530000
2008-09-17T20:07:39.860000
86,971
86,989
Best way to update multi-gigabyte program (DVD fulfillment? Updater software?)
Two years ago, we shipped a multi-gigabyte Windows application, with lots of video files. Now we're looking to release a significant update, with approximately 1 gigabyte of new and changed data. We're currently looking at DVD fulfillment houses (like these folks, for example), which claim to be able to ship DVDs to ou...
BITS is a library from Microsoft for downloading files piece by piece using unused bandwidth. You can basically have your clients trickle-download the new video files. The problem, however, is that you'll have to update your program to utilize BITS first.
Best way to update multi-gigabyte program (DVD fulfillment? Updater software?) Two years ago, we shipped a multi-gigabyte Windows application, with lots of video files. Now we're looking to release a significant update, with approximately 1 gigabyte of new and changed data. We're currently looking at DVD fulfillment ho...
TITLE: Best way to update multi-gigabyte program (DVD fulfillment? Updater software?) QUESTION: Two years ago, we shipped a multi-gigabyte Windows application, with lots of video files. Now we're looking to release a significant update, with approximately 1 gigabyte of new and changed data. We're currently looking at ...
[ "windows", "download", "dvd", "updating" ]
2
1
335
3
0
2008-09-17T19:55:59.467000
2008-09-17T19:58:35.810000
86,977
87,943
Avoiding double-thunking with C++/CLI properties
I've read (in Nish Sivakumar's book C++/CLI In Action among other places) that you should use the __clrcall decorator on function calls to avoid double-thunking, in cases where you know that the method will never be called from unmanaged code. Nish also says that if the method signature contains any CLR types, then the...
@Mike B - Thanks for the tip on ildasm - I didn't know about that tool. It appears that I misread/misunderstood Nish - the __clrcall modifier and the double-thunking problem it eliminates only apply to methods of NATIVE classes. All methods of Managed classes are __clrcall by default - which seems obvious in retrospect...
Avoiding double-thunking with C++/CLI properties I've read (in Nish Sivakumar's book C++/CLI In Action among other places) that you should use the __clrcall decorator on function calls to avoid double-thunking, in cases where you know that the method will never be called from unmanaged code. Nish also says that if the ...
TITLE: Avoiding double-thunking with C++/CLI properties QUESTION: I've read (in Nish Sivakumar's book C++/CLI In Action among other places) that you should use the __clrcall decorator on function calls to avoid double-thunking, in cases where you know that the method will never be called from unmanaged code. Nish also...
[ ".net", "properties", "c++-cli" ]
2
3
1,437
1
0
2008-09-17T19:56:53.520000
2008-09-17T21:37:51
86,987
124,193
Oracle connection problem on Mac OSX: "Status : Failure -Test failed: Io exception: The Network Adapter could not establish the connection"
I'm trying this with Oracle SQL Developer and am on an Intel MacBook Pro. But I believe this same error happens with other clients. I can ping the server hosting the database fine so it appears not to be an actual network problem. Also, I believe I'm filling in the connection info correctly. It's something like this: h...
My problem turned out to be some kind of ACL problem. I needed to SSH tunnel in through a "blessed host". I put the following in my.ssh/config Host=blessedhost HostName=blessedhost.whatever.com User=alice Compression=yes Protocol=2 LocalForward=2202 oraclemachine.whatever.com:1521 Host=foo HostName=localhost Port=2202...
Oracle connection problem on Mac OSX: "Status : Failure -Test failed: Io exception: The Network Adapter could not establish the connection" I'm trying this with Oracle SQL Developer and am on an Intel MacBook Pro. But I believe this same error happens with other clients. I can ping the server hosting the database fine ...
TITLE: Oracle connection problem on Mac OSX: "Status : Failure -Test failed: Io exception: The Network Adapter could not establish the connection" QUESTION: I'm trying this with Oracle SQL Developer and am on an Intel MacBook Pro. But I believe this same error happens with other clients. I can ping the server hosting ...
[ "oracle", "macos" ]
2
0
6,993
3
0
2008-09-17T19:58:31.770000
2008-09-23T21:59:32.310000
86,992
87,051
How do you manage "pick lists" in a database
I have an application with multiple "pick list" entities, such as used to populate choices of dropdown selection boxes. These entities need to be stored in the database. How do one persist these entities in the database? Should I create a new table for each pick list? Is there a better solution?
Well, you could do something like this: PickListContent IdList IdPick Text 1 1 Apples 1 2 Oranges 1 3 Pears 2 1 Dogs 2 2 Cats and optionally.. PickList Id Description 1 Fruit 2 Pets
How do you manage "pick lists" in a database I have an application with multiple "pick list" entities, such as used to populate choices of dropdown selection boxes. These entities need to be stored in the database. How do one persist these entities in the database? Should I create a new table for each pick list? Is the...
TITLE: How do you manage "pick lists" in a database QUESTION: I have an application with multiple "pick list" entities, such as used to populate choices of dropdown selection boxes. These entities need to be stored in the database. How do one persist these entities in the database? Should I create a new table for each...
[ "database" ]
3
5
10,113
16
0
2008-09-17T19:58:50.567000
2008-09-17T20:04:26.030000
87,007
1,908,834
Screen capture doesn't work on MFC application in Vista
We've got some in-house applications built in MFC, with OpenGL drawing routines. They all use the same code to draw on the screen and either print the screen or save it to a JPEG file. Everything's been working fine in Windows XP, and I need to find a way to make them work on Vista. In three of our applications, everyt...
We eventually solved this by creating a different OpenGL context, and drawing everything to that. We gave up on the screen capture.
Screen capture doesn't work on MFC application in Vista We've got some in-house applications built in MFC, with OpenGL drawing routines. They all use the same code to draw on the screen and either print the screen or save it to a JPEG file. Everything's been working fine in Windows XP, and I need to find a way to make ...
TITLE: Screen capture doesn't work on MFC application in Vista QUESTION: We've got some in-house applications built in MFC, with OpenGL drawing routines. They all use the same code to draw on the screen and either print the screen or save it to a JPEG file. Everything's been working fine in Windows XP, and I need to f...
[ "visual-c++", "mfc", "windows-vista" ]
0
0
2,555
5
0
2008-09-17T20:00:08.317000
2009-12-15T16:56:50.600000
87,010
194,820
What are the best practices for using HTML with XML based languages like SVG?
From browsing on this site and elsewhere, I've learned that serving websites as XHTML at present is considered harmful. Delivering XHTML and serving it as application/xhtml+xml isn't supported by the majority of people browsing at present, delivering xhtml as text/html is at best a placebo for myself, and at worst a re...
In HTML you won't be able to insert SVG directly. You can embed SVG files with / and in cutting-edge browsers (Opera, Safari) also and CSS background-image. You can put SVG in data: URI to avoid using external files. Simple mathematical expressions can be written with help of Unicode and basic HTML/CSS (Opera 9.5 suppo...
What are the best practices for using HTML with XML based languages like SVG? From browsing on this site and elsewhere, I've learned that serving websites as XHTML at present is considered harmful. Delivering XHTML and serving it as application/xhtml+xml isn't supported by the majority of people browsing at present, de...
TITLE: What are the best practices for using HTML with XML based languages like SVG? QUESTION: From browsing on this site and elsewhere, I've learned that serving websites as XHTML at present is considered harmful. Delivering XHTML and serving it as application/xhtml+xml isn't supported by the majority of people brows...
[ "xhtml", "svg", "doctype", "mathml", "html4" ]
1
1
423
2
0
2008-09-17T20:00:27.723000
2008-10-11T23:24:45.900000
87,071
87,120
Attempting to update a user's "connect to:" home directory path in AD using C#
I have a small application I am working on that at one point needs to update a user's home directory path in AD under the profile tab where it allows you to map a drive letter to a particular path. The code I have put together so far sets the Home Folder Local path portion OK, but I'm trying to figure out the name for ...
You may need to set the HomeDrive property as well: DirectoryEntry deUser = new DirectoryEntry(findMeinAD(tbPNUID.Text)); deUser.InvokeSet("HomeDirectory", tbPFolderVerification.Text); deUser.InvokeSet("HomeDrive", "Z:"); deUser.CommitChanges();
Attempting to update a user's "connect to:" home directory path in AD using C# I have a small application I am working on that at one point needs to update a user's home directory path in AD under the profile tab where it allows you to map a drive letter to a particular path. The code I have put together so far sets th...
TITLE: Attempting to update a user's "connect to:" home directory path in AD using C# QUESTION: I have a small application I am working on that at one point needs to update a user's home directory path in AD under the profile tab where it allows you to map a drive letter to a particular path. The code I have put toget...
[ "c#", "active-directory" ]
1
3
2,353
1
0
2008-09-17T20:06:22.563000
2008-09-17T20:12:16.447000
87,101
6,097,639
How to SelectAll / SelectNone in .NET 2.0 ListView?
What is a good way to select all or select no items in a listview without using: foreach (ListViewItem item in listView1.Items) { item.Selected = true; } or foreach (ListViewItem item in listView1.Items) { item.Selected = false; } I know the underlying Win32 listview common control supports LVM_SETITEMSTATE message whi...
Wow this is old...:D SELECT ALL listView1.BeginUpdate(); foreach (ListViewItem i in listView1.Items) { i.Selected = true; } listView1.EndUpdate(); SELECT INVERSE listView1.BeginUpdate(); foreach (ListViewItem i in listView1.Items) { i.Selected =!i.Selected; } listView1.EndUpdate(); BeginUpdate and EndUpdate are used to...
How to SelectAll / SelectNone in .NET 2.0 ListView? What is a good way to select all or select no items in a listview without using: foreach (ListViewItem item in listView1.Items) { item.Selected = true; } or foreach (ListViewItem item in listView1.Items) { item.Selected = false; } I know the underlying Win32 listview ...
TITLE: How to SelectAll / SelectNone in .NET 2.0 ListView? QUESTION: What is a good way to select all or select no items in a listview without using: foreach (ListViewItem item in listView1.Items) { item.Selected = true; } or foreach (ListViewItem item in listView1.Items) { item.Selected = false; } I know the underlyi...
[ "listview", "selectall" ]
4
5
7,192
2
0
2008-09-17T20:10:38.293000
2011-05-23T13:10:19.523000
87,107
87,412
How do I fix 404.17 error on Win Server 2k8 and IIS7
I've setup a new.net 2.0 website on IIS 7 under Win Server 2k8 and when browsing to a page it gives me a 404.17 error, claiming that the file (default.aspx in this case) appears to be a script but is being handled by the static file handler. It SOUNDS like the module mappings for ASP.Net got messed up, but they look fi...
I had this problem on IIS6 one time when somehow the ASP.NET ISAPI stuff was broke. Running %windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i to recreate the settings took care of it.
How do I fix 404.17 error on Win Server 2k8 and IIS7 I've setup a new.net 2.0 website on IIS 7 under Win Server 2k8 and when browsing to a page it gives me a 404.17 error, claiming that the file (default.aspx in this case) appears to be a script but is being handled by the static file handler. It SOUNDS like the module...
TITLE: How do I fix 404.17 error on Win Server 2k8 and IIS7 QUESTION: I've setup a new.net 2.0 website on IIS 7 under Win Server 2k8 and when browsing to a page it gives me a 404.17 error, claiming that the file (default.aspx in this case) appears to be a script but is being handled by the static file handler. It SOUN...
[ "asp.net", "iis-7" ]
20
27
70,239
16
0
2008-09-17T20:11:10.273000
2008-09-17T20:38:57.867000
87,134
87,214
C# ListView mouse wheel scroll without focus
I'm making a WinForms app with a ListView set to detail so that several columns can be displayed. I'd like for this list to scroll when the mouse is over the control and the user uses the mouse scroll wheel. Right now, scrolling only happens when the ListView has focus. How can I make the ListView scroll even when it d...
You'll normally only get mouse/keyboard events to a window or control when it has focus. If you want to see them without focus then you're going to have to put in place a lower-level hook. Here is an example low level mouse hook
C# ListView mouse wheel scroll without focus I'm making a WinForms app with a ListView set to detail so that several columns can be displayed. I'd like for this list to scroll when the mouse is over the control and the user uses the mouse scroll wheel. Right now, scrolling only happens when the ListView has focus. How ...
TITLE: C# ListView mouse wheel scroll without focus QUESTION: I'm making a WinForms app with a ListView set to detail so that several columns can be displayed. I'd like for this list to scroll when the mouse is over the control and the user uses the mouse scroll wheel. Right now, scrolling only happens when the ListVi...
[ "c#", ".net", "listview", "scroll" ]
13
2
8,686
2
0
2008-09-17T20:13:56.973000
2008-09-17T20:22:39.030000
87,137
109,917
Sequence Diagram Reverse Engineering
I'm looking for a tool that will reverse engineer Java into a sequence diagram BUT also provides the ability to filter out calls to certain libraries. For example, the Netbeans IDE does a fantastic job of this but it includes all calls to String or Integer which clutter up the diagram to the point it is unusable. Any h...
I think jtracert is what you are looking for. It generates a sequence diagram from a running Java program. Also, because its output is a text description of the diagram (in the formats of several popular SD tools), you can use grep to filter for only the classes you are interested in.
Sequence Diagram Reverse Engineering I'm looking for a tool that will reverse engineer Java into a sequence diagram BUT also provides the ability to filter out calls to certain libraries. For example, the Netbeans IDE does a fantastic job of this but it includes all calls to String or Integer which clutter up the diagr...
TITLE: Sequence Diagram Reverse Engineering QUESTION: I'm looking for a tool that will reverse engineer Java into a sequence diagram BUT also provides the ability to filter out calls to certain libraries. For example, the Netbeans IDE does a fantastic job of this but it includes all calls to String or Integer which cl...
[ "java", "uml", "reverse-engineering", "sequence-diagram" ]
29
10
35,837
13
0
2008-09-17T20:14:13.730000
2008-09-21T01:14:53.270000
87,179
87,308
What are some good Module Development Solution/Environments/Best Practices for Dot Net Nuke Modules
I've been developing modules for DNN since version 2 and back then I was able to easily able to run my module as I developed it on my environment and still easily deploy my module as a DLL. When version 4 came out and used the web site solution (rather than the Web Application solution). It seems like there was somethi...
I have a few detailed blog postings about this on my blog site, mitchelsellers.com. I personally use the WAP development model and I do NOT check the DNN solution, or any core files into source control, as I do NOT modify the core for any of my clients. When working with multiple people we create a similar environment ...
What are some good Module Development Solution/Environments/Best Practices for Dot Net Nuke Modules I've been developing modules for DNN since version 2 and back then I was able to easily able to run my module as I developed it on my environment and still easily deploy my module as a DLL. When version 4 came out and us...
TITLE: What are some good Module Development Solution/Environments/Best Practices for Dot Net Nuke Modules QUESTION: I've been developing modules for DNN since version 2 and back then I was able to easily able to run my module as I developed it on my environment and still easily deploy my module as a DLL. When version...
[ "deployment", "dotnetnuke", "collaboration", "dotnetnuke-module" ]
4
3
543
2
0
2008-09-17T20:18:31.283000
2008-09-17T20:31:51.487000
87,184
87,478
What is the best way to localize a WPF application, sans LocBAML?
There seems to be no good way to localize a WPF application. MSDN seems to think that littering my XAML with x:Uid 's, generating CSV files, and then generating new assemblies (using their sample code!) is the answer. Worse, this process doesn't address how to localize images, binary blobs (say, PDF files), or strings ...
Not an expert here, but "littering" your xaml with x:Uids is not worse than "littering" your Windows Forms code with all the string table nonsense you have to do for localizing them. As far as I understand, WPF apps still support "all the Framework CLR resources including string tables, images, and so forth." which mea...
What is the best way to localize a WPF application, sans LocBAML? There seems to be no good way to localize a WPF application. MSDN seems to think that littering my XAML with x:Uid 's, generating CSV files, and then generating new assemblies (using their sample code!) is the answer. Worse, this process doesn't address ...
TITLE: What is the best way to localize a WPF application, sans LocBAML? QUESTION: There seems to be no good way to localize a WPF application. MSDN seems to think that littering my XAML with x:Uid 's, generating CSV files, and then generating new assemblies (using their sample code!) is the answer. Worse, this proces...
[ "wpf", "xaml", "localization", "globalization" ]
21
8
9,429
5
0
2008-09-17T20:19:17.227000
2008-09-17T20:44:39.240000
87,192
87,351
When would you need to use late static binding?
After reading this description of late static binding (LSB) I see pretty clearly what is going on. Now, under which sorts of circumstances might that be most useful or needed?
I needed LSB this for the following scenario: Imagine you're building a "mail processor" daemon that downloads the message from an email server, classifies it, parses it, saves it, and then does something, depending on the type of the message. Class hierarchy: you have a base Message class, with children "BouncedMessag...
When would you need to use late static binding? After reading this description of late static binding (LSB) I see pretty clearly what is going on. Now, under which sorts of circumstances might that be most useful or needed?
TITLE: When would you need to use late static binding? QUESTION: After reading this description of late static binding (LSB) I see pretty clearly what is going on. Now, under which sorts of circumstances might that be most useful or needed? ANSWER: I needed LSB this for the following scenario: Imagine you're building...
[ "php", "oop" ]
8
6
3,172
6
0
2008-09-17T20:20:32.560000
2008-09-17T20:34:53.740000
87,200
1,586,128
Mocking WebResponse's from a WebRequest
I have finally started messing around with creating some apps that work with RESTful web interfaces, however, I am concerned that I am hammering their servers every time I hit F5 to run a series of tests.. Basically, I need to get a series of web responses so I can test I am parsing the varying responses correctly, rat...
I found this question while looking to do exactly the same thing. Couldn't find an answer anywhere, but after a bit more digging found that the.Net Framework has built in support for this. You can register a factory object with WebRequest.RegisterPrefix which WebRequest.Create will call when using that prefix (or url)....
Mocking WebResponse's from a WebRequest I have finally started messing around with creating some apps that work with RESTful web interfaces, however, I am concerned that I am hammering their servers every time I hit F5 to run a series of tests.. Basically, I need to get a series of web responses so I can test I am pars...
TITLE: Mocking WebResponse's from a WebRequest QUESTION: I have finally started messing around with creating some apps that work with RESTful web interfaces, however, I am concerned that I am hammering their servers every time I hit F5 to run a series of tests.. Basically, I need to get a series of web responses so I ...
[ "xml", "web-services", "rest", "webrequest", "webresponse" ]
36
60
16,433
6
0
2008-09-17T20:21:04.133000
2009-10-18T21:50:01.580000
87,210
87,300
How do I choose a CMS/Portal solution for a small website(s)?
I currently maintain 3 websites all revolving around the same concept. 2 of them are WinForms applications where the website gives a few basic details, and download links. The third is a web application to query data. I also have a forum (SMF/TinyPortal) that has been serving as a tech support/news hub for the three si...
If you want to quickly compare features on CMS's, then take a look at CMS Matrix - has practically every cms known to man on there. Edit To be a little more precise, from the site CMSMatrix is the number one content management system comparison site on the Internet. It allows users to evaluate over 950 content manageme...
How do I choose a CMS/Portal solution for a small website(s)? I currently maintain 3 websites all revolving around the same concept. 2 of them are WinForms applications where the website gives a few basic details, and download links. The third is a web application to query data. I also have a forum (SMF/TinyPortal) tha...
TITLE: How do I choose a CMS/Portal solution for a small website(s)? QUESTION: I currently maintain 3 websites all revolving around the same concept. 2 of them are WinForms applications where the website gives a few basic details, and download links. The third is a web application to query data. I also have a forum (S...
[ "content-management-system", "comparison", "portal", "evaluation" ]
3
4
2,533
9
0
2008-09-17T20:22:12.430000
2008-09-17T20:31:04.750000
87,220
4,506,050
How does gcc implement stack unrolling for C++ exceptions on linux?
How does gcc implement stack unrolling for C++ exceptions on linux? In particular, how does it know which destructors to call when unrolling a frame (i.e., what kind of information is stored and where is it stored)?
See section 6.2 of the x86_64 ABI. This details the interface but not a lot of the underlying data. This is also independent of C++ and could conceivably be used for other purposes as well. There are primarily two sections of the ELF binary as emitted by gcc which are of interest for exception handling. They are.eh_fra...
How does gcc implement stack unrolling for C++ exceptions on linux? How does gcc implement stack unrolling for C++ exceptions on linux? In particular, how does it know which destructors to call when unrolling a frame (i.e., what kind of information is stored and where is it stored)?
TITLE: How does gcc implement stack unrolling for C++ exceptions on linux? QUESTION: How does gcc implement stack unrolling for C++ exceptions on linux? In particular, how does it know which destructors to call when unrolling a frame (i.e., what kind of information is stored and where is it stored)? ANSWER: See secti...
[ "c++", "exception", "gcc" ]
19
14
7,188
3
0
2008-09-17T20:23:42.490000
2010-12-22T03:59:47.773000
87,221
87,271
ASP.NET UrlRewriting and Constructing Page Links
So this post talked about how to actually implement url rewriting in an ASP.NET application to get "friendly urls". That works perfect and it is great for sending a user to a specific page, but does anyone know of a good solution for creating "Friendly" URLs inside your code when using one of the tools referenced? For ...
See System.Web.Routing Routing is a different from rewriting. Implementing this technique does require minor changes to your pages (namely, any code accessing querystring parameters will need to be modified), but it allows you to generate links based on the routes you define. It's used by ASP.NET MVC, but can be employ...
ASP.NET UrlRewriting and Constructing Page Links So this post talked about how to actually implement url rewriting in an ASP.NET application to get "friendly urls". That works perfect and it is great for sending a user to a specific page, but does anyone know of a good solution for creating "Friendly" URLs inside your ...
TITLE: ASP.NET UrlRewriting and Constructing Page Links QUESTION: So this post talked about how to actually implement url rewriting in an ASP.NET application to get "friendly urls". That works perfect and it is great for sending a user to a specific page, but does anyone know of a good solution for creating "Friendly"...
[ ".net", "url-rewriting", "friendly-url" ]
0
3
701
2
0
2008-09-17T20:23:54.050000
2008-09-17T20:28:03.337000
87,222
87,312
representing CRLF using Hex in C#
How do i represent CRLF using Hex in C#?
Since no one has actually given the answer requested, here it is: "\x0d\x0a"
representing CRLF using Hex in C# How do i represent CRLF using Hex in C#?
TITLE: representing CRLF using Hex in C# QUESTION: How do i represent CRLF using Hex in C#? ANSWER: Since no one has actually given the answer requested, here it is: "\x0d\x0a"
[ "c#" ]
22
54
54,229
3
0
2008-09-17T20:24:11.303000
2008-09-17T20:32:01.410000
87,224
87,311
Make git-svn work on Slackware 12.1
It is obviosly some Perl extensions. Perl version is 5.8.8. I found Error.pm, but now I'm looking for Core.pm. While we're at it: how do you guys search for those modules. I tried Google, but that didn't help much. Thanks. And finally, after I built everything, running:./Build install gives me: Running make install-lib...
It should be compatible. The CPAN Tester's matrix shows no failures for Perl 5.8.8 on any platform. Per the README, you can install it by doing: perl Makefile.pl make make test make install
Make git-svn work on Slackware 12.1 It is obviosly some Perl extensions. Perl version is 5.8.8. I found Error.pm, but now I'm looking for Core.pm. While we're at it: how do you guys search for those modules. I tried Google, but that didn't help much. Thanks. And finally, after I built everything, running:./Build instal...
TITLE: Make git-svn work on Slackware 12.1 QUESTION: It is obviosly some Perl extensions. Perl version is 5.8.8. I found Error.pm, but now I'm looking for Core.pm. While we're at it: how do you guys search for those modules. I tried Google, but that didn't help much. Thanks. And finally, after I built everything, runn...
[ "perl", "git-svn", "slackware" ]
1
1
2,908
8
0
2008-09-17T20:24:46.013000
2008-09-17T20:31:59.443000
87,230
87,455
How to edit sessions parameters on Oracle 10g XE?
default is 49 how to edit to higher?
You will need to issue the following command (connected as a user that has alter system privileges, sys will do it) alter system set sessions= numberofsessions scope=spfile; Have you been getting an ORA-12516 or ORA-12520 error? If so it's probably a good idea to increase the number of processes too alter system set pr...
How to edit sessions parameters on Oracle 10g XE? default is 49 how to edit to higher?
TITLE: How to edit sessions parameters on Oracle 10g XE? QUESTION: default is 49 how to edit to higher? ANSWER: You will need to issue the following command (connected as a user that has alter system privileges, sys will do it) alter system set sessions= numberofsessions scope=spfile; Have you been getting an ORA-125...
[ "database", "oracle" ]
1
4
4,737
2
0
2008-09-17T20:25:05.717000
2008-09-17T20:42:33.723000
87,245
87,334
In ASP.net Webforms how do you detect which Textbox someone pressed enter?
In ASP.net Webforms how do you detect which Textbox someone pressed enter? Please no Javascript answers. I need to handle it all in the code behind using VB.NET.
Why do you need to determine the which TextBox was pressed? Are you looking to see which TextBox was being focused so that you can trigger the proper button click event? If you are looking to do something like this, one trick I've done was to "group" the appropriate form elements within their own panel and then set the...
In ASP.net Webforms how do you detect which Textbox someone pressed enter? In ASP.net Webforms how do you detect which Textbox someone pressed enter? Please no Javascript answers. I need to handle it all in the code behind using VB.NET.
TITLE: In ASP.net Webforms how do you detect which Textbox someone pressed enter? QUESTION: In ASP.net Webforms how do you detect which Textbox someone pressed enter? Please no Javascript answers. I need to handle it all in the code behind using VB.NET. ANSWER: Why do you need to determine the which TextBox was press...
[ "asp.net", "webforms" ]
5
2
857
6
0
2008-09-17T20:26:20.720000
2008-09-17T20:33:14.697000
87,262
87,613
Mathematical analysis of a sound sample (as an array of numbers)
I need to find the frequency of a sample, stored (in vb) as an array of byte. Sample is a sine wave, known frequency, so I can check), but the numbers are a bit odd, and my maths-foo is weak. Full range of values 0-255. 99% of numbers are in range 235 to 245, but there are some outliers down to 0 and 1, and up to 255 i...
The FFT is probably the best answer, but if you really want to do it by your method, try this: To normalize, first make a histogram to count how many occurrances of each value from 0 to 255. Then throw out X percent of the values from each end with something like: for (i=lower=0;i< N*(X/100); lower++) i+=count[lower]; ...
Mathematical analysis of a sound sample (as an array of numbers) I need to find the frequency of a sample, stored (in vb) as an array of byte. Sample is a sine wave, known frequency, so I can check), but the numbers are a bit odd, and my maths-foo is weak. Full range of values 0-255. 99% of numbers are in range 235 to ...
TITLE: Mathematical analysis of a sound sample (as an array of numbers) QUESTION: I need to find the frequency of a sample, stored (in vb) as an array of byte. Sample is a sine wave, known frequency, so I can check), but the numbers are a bit odd, and my maths-foo is weak. Full range of values 0-255. 99% of numbers ar...
[ "vb.net", "audio", "audio-analysis" ]
11
7
3,229
7
0
2008-09-17T20:27:29.297000
2008-09-17T20:59:32.153000
87,290
90,666
How to embed audio/video on HTML page that plays on iPhone browser over GPRS
Although I don't have an iPhone to test this out, my colleague told me that embedded media files such as the one in the snippet below, only works when the iphone is connected over the WLAN connection or 3G, and does not work when connecting via GPRS. alternate text Is there an example URL with a media file, that will p...
The iPhone YouTube application automatically downloads lower quality video when connected via EDGE than when connected via Wi-Fi, because the network is much slower. That fact leads me to believe Apple would make the design decision to not bother downloading an MP3 over EDGE. The browser has no way to know in advance i...
How to embed audio/video on HTML page that plays on iPhone browser over GPRS Although I don't have an iPhone to test this out, my colleague told me that embedded media files such as the one in the snippet below, only works when the iphone is connected over the WLAN connection or 3G, and does not work when connecting vi...
TITLE: How to embed audio/video on HTML page that plays on iPhone browser over GPRS QUESTION: Although I don't have an iPhone to test this out, my colleague told me that embedded media files such as the one in the snippet below, only works when the iphone is connected over the WLAN connection or 3G, and does not work ...
[ "iphone", "html" ]
2
2
20,512
3
0
2008-09-17T20:29:57.683000
2008-09-18T07:15:13.937000
87,299
87,341
What is the most convincing command in Vim
I want to ditch my current editor. I feel I need something else. That do not expose my hands to the risk of RSI. I need to see why I should change editor. And it would be nice to believe, that I will be coding when I'm 80 years old. All the big guys out there are using Vim. The only Emacs guy I know are RMS. Paul Graha...
. (dot) - repeats the last editing action. Really handy when you need to perform a few similar edits.
What is the most convincing command in Vim I want to ditch my current editor. I feel I need something else. That do not expose my hands to the risk of RSI. I need to see why I should change editor. And it would be nice to believe, that I will be coding when I'm 80 years old. All the big guys out there are using Vim. Th...
TITLE: What is the most convincing command in Vim QUESTION: I want to ditch my current editor. I feel I need something else. That do not expose my hands to the risk of RSI. I need to see why I should change editor. And it would be nice to believe, that I will be coding when I'm 80 years old. All the big guys out there...
[ "vim", "editor" ]
12
26
3,607
16
0
2008-09-17T20:31:02.300000
2008-09-17T20:33:53.230000
87,317
87,622
Get list of XML attribute values in Python
I need to get a list of attribute values from child elements in Python. It's easiest to explain with an example. Given some XML like this: I want to be able to do something like: >>> getValues("CategoryA") ['a1', 'a2', 'a3'] >>> getValues("CategoryB") ['b1', 'b2', 'b3'] It looks like a job for XPath but I'm open to all...
I'm not really an old hand at Python, but here's an XPath solution using libxml2. import libxml2 DOC = """ """ doc = libxml2.parseDoc(DOC) def getValues(cat): return [attr.content for attr in doc.xpathEval("/elements/parent[@name='%s']/child/@value" % (cat))] print getValues("CategoryA") With result... ['a1', 'a2',...
Get list of XML attribute values in Python I need to get a list of attribute values from child elements in Python. It's easiest to explain with an example. Given some XML like this: I want to be able to do something like: >>> getValues("CategoryA") ['a1', 'a2', 'a3'] >>> getValues("CategoryB") ['b1', 'b2', 'b3'] It loo...
TITLE: Get list of XML attribute values in Python QUESTION: I need to get a list of attribute values from child elements in Python. It's easiest to explain with an example. Given some XML like this: I want to be able to do something like: >>> getValues("CategoryA") ['a1', 'a2', 'a3'] >>> getValues("CategoryB") ['b1', ...
[ "python", "xml", "xpath", "parent-child", "xml-attribute" ]
15
7
37,928
7
0
2008-09-17T20:32:04.373000
2008-09-17T21:00:32.977000
87,350
87,382
What are good grep tools for Windows?
Any recommendations on grep tools for Windows? Ideally ones that could leverage 64-bit OS. I'm aware of Cygwin, of course, and have also found PowerGREP, but I'm wondering if there are any hidden gems out there?
Based on recommendations in the comments, I've started using grepWin and it's fantastic and free. (I'm still a fan of PowerGREP, but I don't use it anymore.) I know you already mentioned it, but PowerGREP is awesome. Some of my favorite features are: Right-click on a folder to run PowerGREP on it Use regular expression...
What are good grep tools for Windows? Any recommendations on grep tools for Windows? Ideally ones that could leverage 64-bit OS. I'm aware of Cygwin, of course, and have also found PowerGREP, but I'm wondering if there are any hidden gems out there?
TITLE: What are good grep tools for Windows? QUESTION: Any recommendations on grep tools for Windows? Ideally ones that could leverage 64-bit OS. I'm aware of Cygwin, of course, and have also found PowerGREP, but I'm wondering if there are any hidden gems out there? ANSWER: Based on recommendations in the comments, I...
[ "windows", "grep" ]
288
221
578,918
28
0
2008-09-17T20:34:48.173000
2008-09-17T20:37:27.730000
87,355
91,534
TestDriven.Net doesn't find tests
I have a test project using MbUnit and TestDriven.Net. If I right-click on an individual test method and say "Run Tests" the test runs successfully. Same thing if I click on a file name in the solution explorer. However, if I right click and say run tests on the project or the solution, TestDriven.Net reports "0 Passed...
I had once similar problem. The problem was that I forgot to declare my test class with public modifier.
TestDriven.Net doesn't find tests I have a test project using MbUnit and TestDriven.Net. If I right-click on an individual test method and say "Run Tests" the test runs successfully. Same thing if I click on a file name in the solution explorer. However, if I right click and say run tests on the project or the solution...
TITLE: TestDriven.Net doesn't find tests QUESTION: I have a test project using MbUnit and TestDriven.Net. If I right-click on an individual test method and say "Run Tests" the test runs successfully. Same thing if I click on a file name in the solution explorer. However, if I right click and say run tests on the proje...
[ ".net", "unit-testing", "testing", "mbunit", "testdriven.net" ]
3
3
867
6
0
2008-09-17T20:35:12.120000
2008-09-18T10:42:50.800000
87,359
87,402
Can I pass a JavaScript variable to another browser window?
I have a page which spawns a popup browser window. I have a JavaScript variable in the parent browser window and I would like to pass it to the popped-up browser window. Is there a way to do this? I know this can be done across frames in the same browser window but I'm not sure if it can be done across browser windows.
Provided the windows are from the same security domain, and you have a reference to the other window, yes. Javascript's open() method returns a reference to the window created (or existing window if it reuses an existing one). Each window created in such a way gets a property applied to it "window.opener" pointing to t...
Can I pass a JavaScript variable to another browser window? I have a page which spawns a popup browser window. I have a JavaScript variable in the parent browser window and I would like to pass it to the popped-up browser window. Is there a way to do this? I know this can be done across frames in the same browser windo...
TITLE: Can I pass a JavaScript variable to another browser window? QUESTION: I have a page which spawns a popup browser window. I have a JavaScript variable in the parent browser window and I would like to pass it to the popped-up browser window. Is there a way to do this? I know this can be done across frames in the ...
[ "javascript", "browser" ]
75
46
167,162
14
0
2008-09-17T20:35:28.763000
2008-09-17T20:38:25.620000
87,372
87,846
Check if a class has a member function of a given signature
I'm asking for a template trick to detect if a class has a specific member function of a given signature. The problem is similar to the one cited here http://www.gotw.ca/gotw/071.htm but not the same: in the item of Sutter's book he answered to the question that a class C MUST PROVIDE a member function with a particula...
I'm not sure if I understand you correctly, but you may exploit SFINAE to detect function presence at compile-time. Example from my code (tests if class has member function size_t used_memory() const). template struct HasUsedMemoryMethod { template struct SFINAE {}; template static char Test(SFINAE *); template static ...
Check if a class has a member function of a given signature I'm asking for a template trick to detect if a class has a specific member function of a given signature. The problem is similar to the one cited here http://www.gotw.ca/gotw/071.htm but not the same: in the item of Sutter's book he answered to the question th...
TITLE: Check if a class has a member function of a given signature QUESTION: I'm asking for a template trick to detect if a class has a specific member function of a given signature. The problem is similar to the one cited here http://www.gotw.ca/gotw/071.htm but not the same: in the item of Sutter's book he answered ...
[ "c++", "c++11", "templates", "sfinae" ]
175
108
129,569
17
0
2008-09-17T20:36:43.160000
2008-09-17T21:27:29.683000
87,381
994,587
Resharper and ViEmu Keybindings ( and Visual Assist )
With ViEmu you really need to unbind a lot of resharpers keybindings to make it work well. Does anyone have what they think is a good set of keybindings that work well for resharper when using ViEmu? What I'm doing at the moment using the Visual Studio bindings from Resharper. Toasting all the conflicting ones with ViE...
You can also create mappings in ViEmu that will call the VS and R# actions. For example, I have these lines in my _viemurc file for commenting and uncommenting a selection: map gS:vsc Edit.CommentSelection map gS:vsc Edit.UncommentSelection The:vsc is for "visual studio command," and then you enter the exact text of th...
Resharper and ViEmu Keybindings ( and Visual Assist ) With ViEmu you really need to unbind a lot of resharpers keybindings to make it work well. Does anyone have what they think is a good set of keybindings that work well for resharper when using ViEmu? What I'm doing at the moment using the Visual Studio bindings from...
TITLE: Resharper and ViEmu Keybindings ( and Visual Assist ) QUESTION: With ViEmu you really need to unbind a lot of resharpers keybindings to make it work well. Does anyone have what they think is a good set of keybindings that work well for resharper when using ViEmu? What I'm doing at the moment using the Visual St...
[ "visual-studio", "resharper", "visual-assist", "viemu" ]
11
11
2,968
5
0
2008-09-17T20:37:21.160000
2009-06-15T05:26:18.983000
87,398
89,904
Using both 1.1 and 2.0 frameworks on Windows 2003 x64
So, much to my annoyance I discover (after lots of research), that when running 1.1 and 2.0 dot.net frameworks on a 64bit 2003 install, it removes the asp.net tab from the IIS properties. I've tried the registry hacks, I've tried registering 32bit versions of both frameworks, and no luck. My only work around is running...
Also, you might try running the 32-bit version of MMC. IIRC, MMC can only load extensions that are the same bit-ness as itself, and the.Net 2.0 extension is 32-bit only. That said, the tool you linked in your question is very useful for working around this issue as well.
Using both 1.1 and 2.0 frameworks on Windows 2003 x64 So, much to my annoyance I discover (after lots of research), that when running 1.1 and 2.0 dot.net frameworks on a 64bit 2003 install, it removes the asp.net tab from the IIS properties. I've tried the registry hacks, I've tried registering 32bit versions of both f...
TITLE: Using both 1.1 and 2.0 frameworks on Windows 2003 x64 QUESTION: So, much to my annoyance I discover (after lots of research), that when running 1.1 and 2.0 dot.net frameworks on a 64bit 2003 install, it removes the asp.net tab from the IIS properties. I've tried the registry hacks, I've tried registering 32bit ...
[ "asp.net", "iis", "windows-server-2003" ]
0
1
335
1
0
2008-09-17T20:38:16.400000
2008-09-18T04:03:04.880000
87,405
87,460
Different versions of C++ libraries
After compiling a simple C++ project using Visual Studio 2008 on vista, everything runs fine on the original vista machine and other vista computers. However, moving it over to an XP box results in an error message: "The application failed to start because the application configuration is incorrect". What do I have to ...
You need to install the Visual Studios 2008 runtime on the target computer: http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en Alternatively, you could also link the run time statically, in the project properties window go to: c++ -> Code Generation -> Runtime L...
Different versions of C++ libraries After compiling a simple C++ project using Visual Studio 2008 on vista, everything runs fine on the original vista machine and other vista computers. However, moving it over to an XP box results in an error message: "The application failed to start because the application configurati...
TITLE: Different versions of C++ libraries QUESTION: After compiling a simple C++ project using Visual Studio 2008 on vista, everything runs fine on the original vista machine and other vista computers. However, moving it over to an XP box results in an error message: "The application failed to start because the appli...
[ "c++", "windows", "windows-vista", "windows-xp" ]
2
6
1,838
5
0
2008-09-17T20:38:36.383000
2008-09-17T20:43:11.133000
87,411
94,774
Specifying Source for Debugging using Netbeans
Using the debugger in Netbeans 6.1, I'd like to step into a method of the JSF library (specifically method saveSerializedView of class StateManager), but I cannot figure out how to specify through the IDE the location of the source code for the JSF library. I'm even having trouble determining which jar file or files Ne...
This answer applies to Netbeans 6.1 circa September 2008: It sounds as if you need to explore the "Libraries" dialog. Select "Tools" from the menu bar and "Libraries" from the menu. If you select "JSF" on the left, you'll see an association of jar files, sources (currently none in my Netbeans 6.1) and javadoc (which sh...
Specifying Source for Debugging using Netbeans Using the debugger in Netbeans 6.1, I'd like to step into a method of the JSF library (specifically method saveSerializedView of class StateManager), but I cannot figure out how to specify through the IDE the location of the source code for the JSF library. I'm even having...
TITLE: Specifying Source for Debugging using Netbeans QUESTION: Using the debugger in Netbeans 6.1, I'd like to step into a method of the JSF library (specifically method saveSerializedView of class StateManager), but I cannot figure out how to specify through the IDE the location of the source code for the JSF librar...
[ "jsf", "netbeans" ]
5
6
5,632
4
0
2008-09-17T20:38:54.747000
2008-09-18T17:38:34.907000
87,422
87,439
Disabling Back button on the browser
I am writing an application that if the user hits back, it may resend the same information and mess up the flow and integrity of data. How do I disable it for users who are with and without javascript on?
It's not possible, sadly. However, consider your applications navigation model. Are you using Post/Redirect/Get PRG Model? http://en.wikipedia.org/wiki/Post/Redirect/Get? This model is more back button friendly than the Postback model.
Disabling Back button on the browser I am writing an application that if the user hits back, it may resend the same information and mess up the flow and integrity of data. How do I disable it for users who are with and without javascript on?
TITLE: Disabling Back button on the browser QUESTION: I am writing an application that if the user hits back, it may resend the same information and mess up the flow and integrity of data. How do I disable it for users who are with and without javascript on? ANSWER: It's not possible, sadly. However, consider your ap...
[ "browser", "back-button" ]
31
76
45,731
12
0
2008-09-17T20:39:23.450000
2008-09-17T20:41:01.073000
87,425
87,519
Is it safe to generally assume that toString() has a low cost?
Do you generally assume that toString() on any given object has a low cost (i.e. for logging)? I do. Is that assumption valid? If it has a high cost should that normally be changed? What are valid reasons to make a toString() method with a high cost? The only time that I get concerned about toString costs is when I kno...
The Java standard library seems to have been written with the intent of keeping the cost of toString calls very low. For example, Java arrays and collections have toString methods which do not iterate over their contents; to get a good string representation of these objects you must use either Arrays.toString or Collec...
Is it safe to generally assume that toString() has a low cost? Do you generally assume that toString() on any given object has a low cost (i.e. for logging)? I do. Is that assumption valid? If it has a high cost should that normally be changed? What are valid reasons to make a toString() method with a high cost? The on...
TITLE: Is it safe to generally assume that toString() has a low cost? QUESTION: Do you generally assume that toString() on any given object has a low cost (i.e. for logging)? I do. Is that assumption valid? If it has a high cost should that normally be changed? What are valid reasons to make a toString() method with a...
[ "c#", "java" ]
15
20
4,502
17
0
2008-09-17T20:39:29.113000
2008-09-17T20:48:17.250000
87,431
87,443
What are the major vulnerabilities of Redhat + Apache?
I am searching for a host for a new commercial website. Among other things, I'd like to know what the various OS - Webserver combinations have in terms of vulnerabilities. What are the vulnerabilities of Redhat + Apache?
See: http://httpd.apache.org/security/vulnerabilities_20.html
What are the major vulnerabilities of Redhat + Apache? I am searching for a host for a new commercial website. Among other things, I'd like to know what the various OS - Webserver combinations have in terms of vulnerabilities. What are the vulnerabilities of Redhat + Apache?
TITLE: What are the major vulnerabilities of Redhat + Apache? QUESTION: I am searching for a host for a new commercial website. Among other things, I'd like to know what the various OS - Webserver combinations have in terms of vulnerabilities. What are the vulnerabilities of Redhat + Apache? ANSWER: See: http://httpd...
[ "security" ]
0
2
422
6
0
2008-09-17T20:40:02.980000
2008-09-17T20:41:14.053000