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
133,698
133,724
Why does fatal error "LNK1104: cannot open file 'C:\Program.obj'" occur when I compile a C++ project in Visual Studio?
I've created a new C++ project in Visual Studio 2008. No code has been written yet; Only project settings have been changed. When I compile the project, I receive the following fatal error: fatal error LNK1104: cannot open file 'C:\Program.obj'
This particular issue is caused by specifying a dependency to a lib file that had spaces in its path. The path needs to be surrounded by quotes for the project to compile correctly. On the Configuration Properties -> Linker -> Input tab of the project’s properties, there is an Additional Dependencies property. This iss...
Why does fatal error "LNK1104: cannot open file 'C:\Program.obj'" occur when I compile a C++ project in Visual Studio? I've created a new C++ project in Visual Studio 2008. No code has been written yet; Only project settings have been changed. When I compile the project, I receive the following fatal error: fatal error...
TITLE: Why does fatal error "LNK1104: cannot open file 'C:\Program.obj'" occur when I compile a C++ project in Visual Studio? QUESTION: I've created a new C++ project in Visual Studio 2008. No code has been written yet; Only project settings have been changed. When I compile the project, I receive the following fatal ...
[ "visual-c++", "linker" ]
137
170
533,856
27
0
2008-09-25T14:29:48.550000
2008-09-25T14:33:01.647000
133,710
133,770
Ant and the available task - what if something is not available?
When I use the task, the property is only set to TRUE if the resource (say file) is available. If not, the property is undefined. When I print the value of the property, it gives true if the resource was available, but otherwise just prints the property name. Is there a way to set the property to some value if the reso...
You can use a condition in combination with not: http://ant.apache.org/manual/Tasks/condition.html
Ant and the available task - what if something is not available? When I use the task, the property is only set to TRUE if the resource (say file) is available. If not, the property is undefined. When I print the value of the property, it gives true if the resource was available, but otherwise just prints the property n...
TITLE: Ant and the available task - what if something is not available? QUESTION: When I use the task, the property is only set to TRUE if the resource (say file) is available. If not, the property is undefined. When I print the value of the property, it gives true if the resource was available, but otherwise just pri...
[ "java", "ant", "build" ]
6
16
21,280
3
0
2008-09-25T14:31:10.497000
2008-09-25T14:40:20.430000
133,719
134,323
How can I read a password from the command line in Ruby?
I am running Ruby and MySQL on a Windows box. I have some Ruby code that needs to connect to a MySQL database a perform a select. To connect to the database I need to provide the password among other things. The Ruby code can display a prompt requesting the password, the user types in the password and hits the Enter ke...
To answer my own question, and for the benefit of anyone else who would like to know, there is a Ruby gem called HighLine that you need. require 'rubygems' require 'highline/import' def get_password(prompt="Enter Password") ask(prompt) {|q| q.echo = false} end thePassword = get_password()
How can I read a password from the command line in Ruby? I am running Ruby and MySQL on a Windows box. I have some Ruby code that needs to connect to a MySQL database a perform a select. To connect to the database I need to provide the password among other things. The Ruby code can display a prompt requesting the passw...
TITLE: How can I read a password from the command line in Ruby? QUESTION: I am running Ruby and MySQL on a Windows box. I have some Ruby code that needs to connect to a MySQL database a perform a select. To connect to the database I need to provide the password among other things. The Ruby code can display a prompt re...
[ "ruby" ]
35
51
21,012
6
0
2008-09-25T14:32:33.007000
2008-09-25T16:19:52.967000
133,721
133,785
Move a file in CVS without resetting the revision number
Lately I've be moving source files around in our source tree. For example placing a bunch of files into a common assembly. I've been doing this my deleting the file from CVS and then adding it again in the new spot. The problem is the revision number of the file resets back to 1.1. Is there some simple way to move thin...
There is no way to move files around with client-only commands. You need access to the servers file system and can move the ",v" file in the repository to a new location. This will keep all history, since CVS records every revision and their comments in that one file. Keep in mind that files are moved into an "Attic" s...
Move a file in CVS without resetting the revision number Lately I've be moving source files around in our source tree. For example placing a bunch of files into a common assembly. I've been doing this my deleting the file from CVS and then adding it again in the new spot. The problem is the revision number of the file ...
TITLE: Move a file in CVS without resetting the revision number QUESTION: Lately I've be moving source files around in our source tree. For example placing a bunch of files into a common assembly. I've been doing this my deleting the file from CVS and then adding it again in the new spot. The problem is the revision n...
[ "version-control", "cvs" ]
10
10
12,336
6
0
2008-09-25T14:32:50.383000
2008-09-25T14:42:48.003000
133,772
133,816
How do I deserialize an XML file into a class with a read only property?
I've got a class that I'm using as a settings class that is serialized into an XML file that administrators can then edit to change settings in the application. (The settings are a little more complex than the App.config allows for.) I'm using the XmlSerializer class to deserialize the XML file, and I want it to be abl...
You have to use a mutable list type, like ArrayList (or IList IIRC).
How do I deserialize an XML file into a class with a read only property? I've got a class that I'm using as a settings class that is serialized into an XML file that administrators can then edit to change settings in the application. (The settings are a little more complex than the App.config allows for.) I'm using the...
TITLE: How do I deserialize an XML file into a class with a read only property? QUESTION: I've got a class that I'm using as a settings class that is serialized into an XML file that administrators can then edit to change settings in the application. (The settings are a little more complex than the App.config allows f...
[ "c#", ".net", "xml", "xml-serialization" ]
2
4
3,613
4
0
2008-09-25T14:40:28.120000
2008-09-25T14:46:26.903000
133,774
134,023
Concurrent Access to RRD (RRDTool)
I am using RRDTool ( http://oss.oetiker.ch/rrdtool/ ) as a graphing back-end for storing performance metrics. This is done via the RRDTool CLI from a Python script. My problem is that the script is multithreaded and each thread updates the RRD at a pretty rapid pace. Sometimes an update fails because one thread is acce...
An exclusive lock ought to be enough for this problem: Python doc page Use example Define your lock object at the main level, not at the thread level, and you're done. Edit in Response to comment: if you define your lock ( lock = new Lock() ) at the thread level, you will have one lock object per running thread, and yo...
Concurrent Access to RRD (RRDTool) I am using RRDTool ( http://oss.oetiker.ch/rrdtool/ ) as a graphing back-end for storing performance metrics. This is done via the RRDTool CLI from a Python script. My problem is that the script is multithreaded and each thread updates the RRD at a pretty rapid pace. Sometimes an upda...
TITLE: Concurrent Access to RRD (RRDTool) QUESTION: I am using RRDTool ( http://oss.oetiker.ch/rrdtool/ ) as a graphing back-end for storing performance metrics. This is done via the RRDTool CLI from a Python script. My problem is that the script is multithreaded and each thread updates the RRD at a pretty rapid pace....
[ "python", "rrdtool" ]
2
1
3,110
4
0
2008-09-25T14:40:55.420000
2008-09-25T15:32:22.893000
133,806
146,278
Is it possible to use Castle MonoRail Routing feature with IIS 5?
Do I have to go with IIS 6 or higher to use Castle MonoRail Routing feature? I know casini work but practically we not gonna deploy web app with casini, or do we?
Usually the configuration change required is to make requests for all file extensions go through the ASP.net filter (you can check the configuration for the.aspx extension in IIS). However, for requests for a particular virtual directory, rather than a specific file in that directory, IIS tries to validate that a direc...
Is it possible to use Castle MonoRail Routing feature with IIS 5? Do I have to go with IIS 6 or higher to use Castle MonoRail Routing feature? I know casini work but practically we not gonna deploy web app with casini, or do we?
TITLE: Is it possible to use Castle MonoRail Routing feature with IIS 5? QUESTION: Do I have to go with IIS 6 or higher to use Castle MonoRail Routing feature? I know casini work but practically we not gonna deploy web app with casini, or do we? ANSWER: Usually the configuration change required is to make requests fo...
[ "routes", "iis-5", "castle-monorail" ]
1
1
254
1
0
2008-09-25T14:45:08.357000
2008-09-28T17:17:31.483000
133,837
135,367
c++ boost lambda libraries
What might be the best way to start programming using boost lambda libraries.
Remaining within the boundaries of the C++ language and libraries, I would suggest first getting used to programming using STL algorithm function templates, as one the most common use you will have for boost::lambda is to replace functor classes with inlined expressions inlined. The library documentation itself gives y...
c++ boost lambda libraries What might be the best way to start programming using boost lambda libraries.
TITLE: c++ boost lambda libraries QUESTION: What might be the best way to start programming using boost lambda libraries. ANSWER: Remaining within the boundaries of the C++ language and libraries, I would suggest first getting used to programming using STL algorithm function templates, as one the most common use you ...
[ "c++", "functional-programming", "boost-lambda" ]
4
17
4,699
3
0
2008-09-25T15:00:10.273000
2008-09-25T19:17:18.063000
133,840
135,563
Why shouldn't Helpers have html in them?
I have heard that it's best not to actually have any html in your helpers; my question is, Why not? And furthermore, if you were trying to generate an html list or something like that, how can I avoid actual tags? Thanks! -fREW
My advice - if it's small pieces of HTML (a couple of tags) don't worry about it. More than that - think about partials (as pulling strings of html together in a helper is a pain that's what the views are good at). I regularly include HTML in my helpers (either directly or through calls to Rails methods like link_to). ...
Why shouldn't Helpers have html in them? I have heard that it's best not to actually have any html in your helpers; my question is, Why not? And furthermore, if you were trying to generate an html list or something like that, how can I avoid actual tags? Thanks! -fREW
TITLE: Why shouldn't Helpers have html in them? QUESTION: I have heard that it's best not to actually have any html in your helpers; my question is, Why not? And furthermore, if you were trying to generate an html list or something like that, how can I avoid actual tags? Thanks! -fREW ANSWER: My advice - if it's smal...
[ "ruby-on-rails", "ruby" ]
8
15
3,602
6
0
2008-09-25T15:00:38.850000
2008-09-25T19:48:27.053000
133,847
134,280
Responsibility without Authority is Meaningless - a technical-based solution?
My dad always says "Responsibility without Authority is meaningless". However, I find that as developers, we get stuck in situations all the time where we are: Responsible for ensuring the software is "bug free", but don't have the authority to implement a bug tracking system Responsible for hitting project deadlines, ...
All you can do is your best, don't feel as if the key to successful software is only in your hands, your part of a team and don't have to be responsible for all. Obviously you are in a environment that affects negatively your software, but can't change all his behavior so I recommend you start with yours, start working...
Responsibility without Authority is Meaningless - a technical-based solution? My dad always says "Responsibility without Authority is meaningless". However, I find that as developers, we get stuck in situations all the time where we are: Responsible for ensuring the software is "bug free", but don't have the authority ...
TITLE: Responsibility without Authority is Meaningless - a technical-based solution? QUESTION: My dad always says "Responsibility without Authority is meaningless". However, I find that as developers, we get stuck in situations all the time where we are: Responsible for ensuring the software is "bug free", but don't h...
[ "coding-style", "development-process" ]
4
4
2,355
8
0
2008-09-25T15:01:45.697000
2008-09-25T16:13:28.927000
133,883
133,926
Stop and Start a service via batch or cmd file?
How can I script a bat or cmd to stop and start a service reliably with error checking (or let me know that it wasn't successful for whatever reason)?
Use the SC (service control) command, it gives you a lot more options than just start & stop. DESCRIPTION: SC is a command line program used for communicating with the NT Service Controller and services. USAGE: sc [command] [service name]... The option has the form "\\ServerName" Further help on commands can be obtain...
Stop and Start a service via batch or cmd file? How can I script a bat or cmd to stop and start a service reliably with error checking (or let me know that it wasn't successful for whatever reason)?
TITLE: Stop and Start a service via batch or cmd file? QUESTION: How can I script a bat or cmd to stop and start a service reliably with error checking (or let me know that it wasn't successful for whatever reason)? ANSWER: Use the SC (service control) command, it gives you a lot more options than just start & stop. ...
[ "windows", "command-line", "batch-file", "cmd" ]
313
359
955,741
18
0
2008-09-25T15:09:22.607000
2008-09-25T15:15:44.213000
133,886
134,168
Efficiently match multiple regexes in Python
Lexical analyzers are quite easy to write when you have regexes. Today I wanted to write a simple general analyzer in Python, and came up with: import re import sys class Token(object): """ A simple Token structure. Contains the token type, value and position. """ def __init__(self, type, val, pos): self.type = type s...
You can merge all your regexes into one using the "|" operator and let the regex library do the work of discerning between tokens. Some care should be taken to ensure the preference of tokens (for example to avoid matching a keyword as an identifier).
Efficiently match multiple regexes in Python Lexical analyzers are quite easy to write when you have regexes. Today I wanted to write a simple general analyzer in Python, and came up with: import re import sys class Token(object): """ A simple Token structure. Contains the token type, value and position. """ def __ini...
TITLE: Efficiently match multiple regexes in Python QUESTION: Lexical analyzers are quite easy to write when you have regexes. Today I wanted to write a simple general analyzer in Python, and came up with: import re import sys class Token(object): """ A simple Token structure. Contains the token type, value and posit...
[ "python", "regex", "lexical-analysis" ]
17
8
10,265
6
0
2008-09-25T15:10:05.740000
2008-09-25T15:54:53.540000
133,887
133,907
Creating a multi-dimensional hashtable with generics in VB ASP.NET?
I need to create a multi-dimensional (nested) hashtable/dictionary so that I can use syntax like val = myHash("Key").("key") I know I need to use Generics but I can't figure out the correct syntax using VB in ASP.NET 2.0, there are plenty of c# examples on the net but they aren't helping much. Cheers!
OK, I'm better at C# than vb.net, but I'll give this a go.... Dim myHash as Dictionary(Of string, Dictionary(Of string, Integer));
Creating a multi-dimensional hashtable with generics in VB ASP.NET? I need to create a multi-dimensional (nested) hashtable/dictionary so that I can use syntax like val = myHash("Key").("key") I know I need to use Generics but I can't figure out the correct syntax using VB in ASP.NET 2.0, there are plenty of c# example...
TITLE: Creating a multi-dimensional hashtable with generics in VB ASP.NET? QUESTION: I need to create a multi-dimensional (nested) hashtable/dictionary so that I can use syntax like val = myHash("Key").("key") I know I need to use Generics but I can't figure out the correct syntax using VB in ASP.NET 2.0, there are pl...
[ "vb.net", "generics", "asp.net-2.0" ]
1
2
6,523
3
0
2008-09-25T15:10:14.740000
2008-09-25T15:13:35.730000
133,897
133,952
How do you find a point at a given perpendicular distance from a line?
I have a line that I draw in a window and I let the user drag it around. So, my line is defined by two points: (x1,y1) and (x2,y2). But now I would like to draw "caps" at the end of my line, that is, short perpendicular lines at each of my end points. The caps should be N pixels in length. Thus, to draw my "cap" line a...
You need to compute a unit vector that's perpendicular to the line segment. Avoid computing the slope because that can lead to divide by zero errors. dx = x1-x2 dy = y1-y2 dist = sqrt(dx*dx + dy*dy) dx /= dist dy /= dist x3 = x1 + (N/2)*dy y3 = y1 - (N/2)*dx x4 = x1 - (N/2)*dy y4 = y1 + (N/2)*dx
How do you find a point at a given perpendicular distance from a line? I have a line that I draw in a window and I let the user drag it around. So, my line is defined by two points: (x1,y1) and (x2,y2). But now I would like to draw "caps" at the end of my line, that is, short perpendicular lines at each of my end point...
TITLE: How do you find a point at a given perpendicular distance from a line? QUESTION: I have a line that I draw in a window and I let the user drag it around. So, my line is defined by two points: (x1,y1) and (x2,y2). But now I would like to draw "caps" at the end of my line, that is, short perpendicular lines at ea...
[ "algorithm", "math", "graphics", "geometry", "coordinates" ]
55
95
29,731
4
0
2008-09-25T15:12:19.807000
2008-09-25T15:22:17.083000
133,919
134,075
How best to integrate several systems?
Ok where I work we have a fairly substantial number of systems written over the last couple of decades that we maintain. The systems are diverse in that multiple operating systems (Linux, Solaris, Windows), Multiple Databases (Several Versions of oracle, sybase and mysql), and even multiple languages (C, C++, JSP, PHP,...
Integrating disparate systems is my day job. If I were you, I would go to great effort to avoid accessing System A's data from directly within System B. Updating System A's database from System B is extremely unwise. It is exactly the opposite of good practice to make your business logic so diffuse. You will end up reg...
How best to integrate several systems? Ok where I work we have a fairly substantial number of systems written over the last couple of decades that we maintain. The systems are diverse in that multiple operating systems (Linux, Solaris, Windows), Multiple Databases (Several Versions of oracle, sybase and mysql), and eve...
TITLE: How best to integrate several systems? QUESTION: Ok where I work we have a fairly substantial number of systems written over the last couple of decades that we maintain. The systems are diverse in that multiple operating systems (Linux, Solaris, Windows), Multiple Databases (Several Versions of oracle, sybase a...
[ "legacy-code", "system-integration" ]
9
8
7,931
6
0
2008-09-25T15:15:19.800000
2008-09-25T15:39:56.447000
133,925
133,997
JavaScript post request like a form submit
I'm trying to direct a browser to a different page. If I wanted a GET request, I might say document.location.href = 'http://example.com/q=a'; But the resource I'm trying to access won't respond properly unless I use a POST request. If this were not dynamically generated, I might use the HTML Then I would just submit th...
Dynamically create s in a form and submit it /** * sends a request to the specified url from a form. this will change the window location. * @param {string} path the path to send the post request to * @param {object} params the parameters to add to the url * @param {string} [method=post] the method to use on the form *...
JavaScript post request like a form submit I'm trying to direct a browser to a different page. If I wanted a GET request, I might say document.location.href = 'http://example.com/q=a'; But the resource I'm trying to access won't respond properly unless I use a POST request. If this were not dynamically generated, I mig...
TITLE: JavaScript post request like a form submit QUESTION: I'm trying to direct a browser to a different page. If I wanted a GET request, I might say document.location.href = 'http://example.com/q=a'; But the resource I'm trying to access won't respond properly unless I use a POST request. If this were not dynamicall...
[ "javascript", "forms", "post", "submit" ]
1,757
2,376
1,856,784
32
0
2008-09-25T15:15:43.510000
2008-09-25T15:28:53.073000
133,932
136,181
Should the Enter key always trigger the default button, no matter which child control has the focus
I have a form with a default OK button, and a Cancel button. I have a treeview with nodes that can be edited, i.e. you can double-click them or press F2 to open another form. Now, I've never liked that F2 shortcut, and now that I'm enabling treeview label edition, it's even worse. My first reaction when testing the for...
Absolutely no. The Enter key is often used to fire the default button but equally often not. For example, Enter generally means new line in a multiline textbox. Enter sounds like a good bet in this scenario. F2 tends to mean "Edit" in Windows. However, if this is a long-standing application you may just irritate users ...
Should the Enter key always trigger the default button, no matter which child control has the focus I have a form with a default OK button, and a Cancel button. I have a treeview with nodes that can be edited, i.e. you can double-click them or press F2 to open another form. Now, I've never liked that F2 shortcut, and n...
TITLE: Should the Enter key always trigger the default button, no matter which child control has the focus QUESTION: I have a form with a default OK button, and a Cancel button. I have a treeview with nodes that can be edited, i.e. you can double-click them or press F2 to open another form. Now, I've never liked that ...
[ "winforms" ]
1
1
1,174
2
0
2008-09-25T15:19:42.207000
2008-09-25T21:12:54.057000
133,935
133,994
Is there a way to have PHP print the data to a web browser in real time?
For example, if I have an echo statement, there's no guarantee that the browser might display it right away, might display a few dozen echo statements at once, and might wait until the entire page is done before displaying anything. Is there a way to have each echo appear in a browser as it is executed?
You can use flush() to force sending the buffer contents to the browser. You can enable implicit flushing with " ob_implicit_flush(true) ".
Is there a way to have PHP print the data to a web browser in real time? For example, if I have an echo statement, there's no guarantee that the browser might display it right away, might display a few dozen echo statements at once, and might wait until the entire page is done before displaying anything. Is there a way...
TITLE: Is there a way to have PHP print the data to a web browser in real time? QUESTION: For example, if I have an echo statement, there's no guarantee that the browser might display it right away, might display a few dozen echo statements at once, and might wait until the entire page is done before displaying anythi...
[ "php" ]
9
10
12,594
8
0
2008-09-25T15:19:51.067000
2008-09-25T15:28:13.433000
133,945
137,508
Castle-Windsor swapping service at runtime
Let say we defined an interface for tax service as ITaxService, and we got more than one implementation of TaxService (by region) however I wanted to attach a specific tax implementation to a specific customer from the spcific region. Will DI help in this scenario? How? "code snippet would be much appreciate"
Without knowing more, this seems like something suited to an implementation of a strategy pattern ( http://en.wikipedia.org/wiki/Strategy_pattern ). A Dependency Injection tool like Windsor could be used as a form of factory to determine the correct strategy (tax service) to use in a given situation (say, for example, ...
Castle-Windsor swapping service at runtime Let say we defined an interface for tax service as ITaxService, and we got more than one implementation of TaxService (by region) however I wanted to attach a specific tax implementation to a specific customer from the spcific region. Will DI help in this scenario? How? "code ...
TITLE: Castle-Windsor swapping service at runtime QUESTION: Let say we defined an interface for tax service as ITaxService, and we got more than one implementation of TaxService (by region) however I wanted to attach a specific tax implementation to a specific customer from the spcific region. Will DI help in this sce...
[ "dependency-injection", "runtime", "castle-windsor" ]
1
1
374
1
0
2008-09-25T15:21:34.667000
2008-09-26T02:59:28.217000
133,948
136,390
Sharing GDI handles between processes in Windows CE 6.0
I know that GDI handles are unique and process specific in 'Big Windows' but do they work the same way in Windows CE 6.0? For example: I've got a font management service that several other services and applications will be using. This service has a list of valid fonts and configurations for printing and displaying; Cre...
I believe you are correct, you cannot rely on HFONTs being safe to pass across processes. 'The reason I ask, is that I've seen HFONTs passed to another application through PostMessage work correctly, but I didn't think they were 'supposed' to.' They were not passed correctly, so there is no 'supposed to'. While HFONTs ...
Sharing GDI handles between processes in Windows CE 6.0 I know that GDI handles are unique and process specific in 'Big Windows' but do they work the same way in Windows CE 6.0? For example: I've got a font management service that several other services and applications will be using. This service has a list of valid f...
TITLE: Sharing GDI handles between processes in Windows CE 6.0 QUESTION: I know that GDI handles are unique and process specific in 'Big Windows' but do they work the same way in Windows CE 6.0? For example: I've got a font management service that several other services and applications will be using. This service has...
[ "c++", "windows-ce", "gdi" ]
0
1
1,102
1
0
2008-09-25T15:21:55.213000
2008-09-25T21:47:04.647000
133,953
368,475
Firing a SharePoint Workflow by updating a list item through List Webservice
I am developing, a simple SharePoint Sequential Workflow which should be bound to a document library. When associating the little workflow to a document library, I checked these options Allow this workflow to be manually started by an authenticated user with Edit Items Permissions. Start this workflow when a new item i...
Finally, we got through the support services processes at Microsoft and got a solution! First, Microsoft stated this to be a bug. It is a minor bug, because there is a good workaround, so it may take some longer time, until this bug will be fixed (the support technician said something with next service pack oder next v...
Firing a SharePoint Workflow by updating a list item through List Webservice I am developing, a simple SharePoint Sequential Workflow which should be bound to a document library. When associating the little workflow to a document library, I checked these options Allow this workflow to be manually started by an authenti...
TITLE: Firing a SharePoint Workflow by updating a list item through List Webservice QUESTION: I am developing, a simple SharePoint Sequential Workflow which should be bound to a document library. When associating the little workflow to a document library, I checked these options Allow this workflow to be manually star...
[ "web-services", "sharepoint", "workflow", "autostart" ]
16
11
16,273
4
0
2008-09-25T15:22:17.473000
2008-12-15T14:13:59.060000
133,956
153,453
Parsing XML With Single Quotes?
I am currently running into a problem where an element is coming back from my xml file with a single quote in it. This is causing xml_parse to break it up into multiple chunks, example: Get Wired, You're Hired! Is then enterpreted as 'Get Wired, You' being one object, the single quote being a second, and 're Hired!' as...
Why don't you use something like simplexml_load_file to parse your file easily?
Parsing XML With Single Quotes? I am currently running into a problem where an element is coming back from my xml file with a single quote in it. This is causing xml_parse to break it up into multiple chunks, example: Get Wired, You're Hired! Is then enterpreted as 'Get Wired, You' being one object, the single quote be...
TITLE: Parsing XML With Single Quotes? QUESTION: I am currently running into a problem where an element is coming back from my xml file with a single quote in it. This is causing xml_parse to break it up into multiple chunks, example: Get Wired, You're Hired! Is then enterpreted as 'Get Wired, You' being one object, t...
[ "php", "xml", "xml-parsing", "html-entities" ]
0
2
3,257
2
0
2008-09-25T15:23:05.583000
2008-09-30T15:03:05.253000
133,958
134,765
unlockbits, lockbits, and try-finally
I'm calling some code that uses the BitmapData class from.NET. I've hit something where I can't find a definitive answer on Googlespace. Because it seems that LockBits and UnlockBits must always be called in a pair, I'm using this: System.Drawing.Imaging.BitmapData tempImageData = tempImage.LockBits( new System.Drawing...
The try-finally pattern is correct. Since this is external code, you have no control over what exceptions are thrown, and the UnlockBits cleanup code needs to be executed regardless of what error has occurred.
unlockbits, lockbits, and try-finally I'm calling some code that uses the BitmapData class from.NET. I've hit something where I can't find a definitive answer on Googlespace. Because it seems that LockBits and UnlockBits must always be called in a pair, I'm using this: System.Drawing.Imaging.BitmapData tempImageData = ...
TITLE: unlockbits, lockbits, and try-finally QUESTION: I'm calling some code that uses the BitmapData class from.NET. I've hit something where I can't find a definitive answer on Googlespace. Because it seems that LockBits and UnlockBits must always be called in a pair, I'm using this: System.Drawing.Imaging.BitmapDat...
[ "c#", ".net" ]
7
7
3,025
3
0
2008-09-25T15:23:09.797000
2008-09-25T17:37:48.613000
133,964
134,685
In ASP.NET MVC, how to write model so checkbox in view corresponds to integer in database?
I have a database column "WantsReply" that logically holds a boolean (bit) but is unfortunately implemented as an integer. Any nonzero value means "yes" and zero means "no". If I write class Entry { [Column] public int WantsReply {get; set;} } in my model, and map it to a checkbox in the view using Html.CheckBox( "Want...
Instead of changing the type of the column property, why not map it to a new property? public partial class Entry { public bool WantsReplyAsBool { get { return WantsReply!= 0; } set { if (value) { WantsReply = 1; } else { WantsReply = 0; } } } } The integer property can be private, if you like. Use the bool property in...
In ASP.NET MVC, how to write model so checkbox in view corresponds to integer in database? I have a database column "WantsReply" that logically holds a boolean (bit) but is unfortunately implemented as an integer. Any nonzero value means "yes" and zero means "no". If I write class Entry { [Column] public int WantsReply...
TITLE: In ASP.NET MVC, how to write model so checkbox in view corresponds to integer in database? QUESTION: I have a database column "WantsReply" that logically holds a boolean (bit) but is unfortunately implemented as an integer. Any nonzero value means "yes" and zero means "no". If I write class Entry { [Column] pub...
[ "asp.net-mvc" ]
0
3
724
1
0
2008-09-25T15:24:12.430000
2008-09-25T17:24:01.907000
133,965
133,989
Find CRLF in Notepad++
How can I find/replace all CR/LF characters in Notepad++? I am looking for something equivalent to the ^p special character in Microsoft Word.
[\r\n]+ should work too Update March, 26th, 2012, release date of Notepad++ 6.0: OMG, it actually does work now!!! Original answer 2008 (Notepad++ 4.x) - 2009-2010-2011 (Notepad++ 5.x) Actually, no, it does not seem to work with regexp... But if you have Notepad++ 5.x, you can use the ' extended ' search mode and look ...
Find CRLF in Notepad++ How can I find/replace all CR/LF characters in Notepad++? I am looking for something equivalent to the ^p special character in Microsoft Word.
TITLE: Find CRLF in Notepad++ QUESTION: How can I find/replace all CR/LF characters in Notepad++? I am looking for something equivalent to the ^p special character in Microsoft Word. ANSWER: [\r\n]+ should work too Update March, 26th, 2012, release date of Notepad++ 6.0: OMG, it actually does work now!!! Original ans...
[ "regex", "notepad++" ]
339
432
646,712
19
0
2008-09-25T15:24:27.157000
2008-09-25T15:27:07.897000
133,973
134,149
How does "this" keyword work within a function?
I just came across an interesting situation in JavaScript. I have a class with a method that defines several objects using object-literal notation. Inside those objects, the this pointer is being used. From the behavior of the program, I have deduced that the this pointer is referring to the class on which the method w...
Cannibalized from another post of mine, here's more than you ever wanted to know about this. Before I start, here's the most important thing to keep in mind about Javascript, and to repeat to yourself when it doesn't make sense. Javascript does not have classes (ES6 class is syntactic sugar ). If something looks like a...
How does "this" keyword work within a function? I just came across an interesting situation in JavaScript. I have a class with a method that defines several objects using object-literal notation. Inside those objects, the this pointer is being used. From the behavior of the program, I have deduced that the this pointer...
TITLE: How does "this" keyword work within a function? QUESTION: I just came across an interesting situation in JavaScript. I have a class with a method that defines several objects using object-literal notation. Inside those objects, the this pointer is being used. From the behavior of the program, I have deduced tha...
[ "javascript", "this", "language-design", "language-features" ]
255
571
102,325
7
0
2008-09-25T15:25:50.960000
2008-09-25T15:52:39.677000
133,977
134,009
Is there .Net replacement for GetAsyncKeyState?
In VB6, I used a call to the Windows API, GetAsyncKeyState, to determine if the user has hit the ESC key to allow them to exit out of a long running loop. Declare Function GetAsyncKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer Is there an equivalent in pure.NET that does require a direct call to the API?
You can find the P/Invoke declaration for GetAsyncKeyState from http://pinvoke.net/default.aspx/user32/GetAsyncKeyState.html Here's the C# signature for example: [DllImport("user32.dll")] static extern short GetAsyncKeyState(int vKey);
Is there .Net replacement for GetAsyncKeyState? In VB6, I used a call to the Windows API, GetAsyncKeyState, to determine if the user has hit the ESC key to allow them to exit out of a long running loop. Declare Function GetAsyncKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer Is there an equivalent in pure.NET...
TITLE: Is there .Net replacement for GetAsyncKeyState? QUESTION: In VB6, I used a call to the Windows API, GetAsyncKeyState, to determine if the user has hit the ESC key to allow them to exit out of a long running loop. Declare Function GetAsyncKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer Is there an equi...
[ ".net", "winapi", "keyboard" ]
3
3
4,761
2
0
2008-09-25T15:25:59.087000
2008-09-25T15:30:18.047000
133,988
134,014
Synchronizing on String objects in Java
I have a webapp that I am in the middle of doing some load/performance testing on, particularily on a feature where we expect a few hundred users to be accessing the same page and hitting refresh about every 10 seconds on this page. One area of improvement that we found we could make with this function was to cache the...
Without putting my brain fully into gear, from a quick scan of what you say it looks as though you need to intern() your Strings: final String firstkey = "Data-" + email; final String key = firstkey.intern(); Two Strings with the same value are otherwise not necessarily the same object. Note that this may introduce a n...
Synchronizing on String objects in Java I have a webapp that I am in the middle of doing some load/performance testing on, particularily on a feature where we expect a few hundred users to be accessing the same page and hitting refresh about every 10 seconds on this page. One area of improvement that we found we could ...
TITLE: Synchronizing on String objects in Java QUESTION: I have a webapp that I am in the middle of doing some load/performance testing on, particularily on a feature where we expect a few hundred users to be accessing the same page and hitting refresh about every 10 seconds on this page. One area of improvement that ...
[ "java", "multithreading", "synchronization", "thread-safety", "synchronized" ]
61
49
63,964
21
0
2008-09-25T15:27:07.883000
2008-09-25T15:30:41.650000
133,999
134,163
What assemblies are loaded by default when you create a new ASP.NET 2.0 Web Application Project?
What assemblies are loaded by default when you create a new ASP.NET 2.0 Web Application Project?
Generate a list of loaded assemblies in the current application domain using AppDomain.GetAssemblies() to see everything that's loaded Assembly[] loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in loadedAssemblies) { Response.Write(assembly.FullName); Response.Write(" "); }
What assemblies are loaded by default when you create a new ASP.NET 2.0 Web Application Project? What assemblies are loaded by default when you create a new ASP.NET 2.0 Web Application Project?
TITLE: What assemblies are loaded by default when you create a new ASP.NET 2.0 Web Application Project? QUESTION: What assemblies are loaded by default when you create a new ASP.NET 2.0 Web Application Project? ANSWER: Generate a list of loaded assemblies in the current application domain using AppDomain.GetAssemblie...
[ "asp.net-2.0" ]
2
2
317
3
0
2008-09-25T15:29:25.380000
2008-09-25T15:54:07.583000
134,001
134,135
How can I load the contents of a text file into a batch file variable?
I need to be able to load the entire contents of a text file and load it into a variable for further processing. How can I do that? Here's what I did thanks to Roman Odaisky's answer. SetLocal EnableDelayedExpansion set content= for /F "delims=" %%i in (test.txt) do set content=!content! %%i echo %content% EndLocal
Use for, something along the lines of: set content= for /f "delims=" %%i in ('filename') do set content=%content% %%i Maybe you’ll have to do setlocal enabledelayedexpansion and/or use!content! rather than %content%. I can’t test, as I don’t have any MS Windows nearby (and I wish you the same:-). The best batch-file-bl...
How can I load the contents of a text file into a batch file variable? I need to be able to load the entire contents of a text file and load it into a variable for further processing. How can I do that? Here's what I did thanks to Roman Odaisky's answer. SetLocal EnableDelayedExpansion set content= for /F "delims=" %%i...
TITLE: How can I load the contents of a text file into a batch file variable? QUESTION: I need to be able to load the entire contents of a text file and load it into a variable for further processing. How can I do that? Here's what I did thanks to Roman Odaisky's answer. SetLocal EnableDelayedExpansion set content= fo...
[ "windows", "batch-file", "command-line", "cmd" ]
37
17
153,038
7
0
2008-09-25T15:29:36.630000
2008-09-25T15:49:57.733000
134,018
134,306
Problem with adding graphics to TLabel
I'm trying to create with Delphi a component inherited from TLabel, with some custom graphics added to it on TLabel.Paint. I want the graphics to be on left side of text, so I overrode GetClientRect: function TMyComponent.GetClientRect: TRect; begin result:= inherited GetClientRect; result.Left:= 20; end; This solution...
First excuse-me for my bad English. I think it is not a good idea change the ClientRect of the component. This property is used for many internal methods and procedures so you can accidentally change the functionality/operation of that component. I think that you can change the point to write the text (20 pixels in the...
Problem with adding graphics to TLabel I'm trying to create with Delphi a component inherited from TLabel, with some custom graphics added to it on TLabel.Paint. I want the graphics to be on left side of text, so I overrode GetClientRect: function TMyComponent.GetClientRect: TRect; begin result:= inherited GetClientRec...
TITLE: Problem with adding graphics to TLabel QUESTION: I'm trying to create with Delphi a component inherited from TLabel, with some custom graphics added to it on TLabel.Paint. I want the graphics to be on left side of text, so I overrode GetClientRect: function TMyComponent.GetClientRect: TRect; begin result:= inhe...
[ "delphi", "getclientrect", "tlabel" ]
2
4
966
2
0
2008-09-25T15:31:18.030000
2008-09-25T16:16:30.120000
134,029
209,172
wxwidgets setup.h "no such file"
A quick Google search of this issue shows it's common, I just can't for the life of me figure out the solution in my case. I have a straight forward install of wxWidgets 2.8.8 for Windows straight from the wxWidgets website. Whenever I try to compile anything (such as the sample app described in "First Programs for wxW...
wxWidgets is not built into useable libraries when you "install" the wxMSW installer. This is because there are so many configurable elements, which is precisely what the setup.h you refer to is for. If you just want to build it with default options as quickly as possible and move on, here is how: Start the "Visual Stu...
wxwidgets setup.h "no such file" A quick Google search of this issue shows it's common, I just can't for the life of me figure out the solution in my case. I have a straight forward install of wxWidgets 2.8.8 for Windows straight from the wxWidgets website. Whenever I try to compile anything (such as the sample app des...
TITLE: wxwidgets setup.h "no such file" QUESTION: A quick Google search of this issue shows it's common, I just can't for the life of me figure out the solution in my case. I have a straight forward install of wxWidgets 2.8.8 for Windows straight from the wxWidgets website. Whenever I try to compile anything (such as ...
[ "compiler-construction", "include", "wxwidgets", "codeblocks" ]
18
26
35,125
5
0
2008-09-25T15:33:07.040000
2008-10-16T15:55:02.750000
134,048
134,059
iPod touch for iPhone development
I am thinking about buying an iPod touch to make some money on developing apps for the iPhone. I like the concept of the App Store and had a quick look at it with iTunes. Looks like applications are categorized, to be iPhone OR iPod applications. Some apps which are free for the iPod seem to cost for iPhone users. What...
The iPod touch is missing: GPS Bluetooth (iPod Touch 4G has Bluetooth) Cellular network Camera (iPod Touch 4G has front and back cameras) Microphone (thanks John Topley ) (iPod Touch 4G has headset with microphone) Vibration The 1G is lacking a speaker On the plus side it weighs a bit less and is a bit smaller.. Other ...
iPod touch for iPhone development I am thinking about buying an iPod touch to make some money on developing apps for the iPhone. I like the concept of the App Store and had a quick look at it with iTunes. Looks like applications are categorized, to be iPhone OR iPod applications. Some apps which are free for the iPod s...
TITLE: iPod touch for iPhone development QUESTION: I am thinking about buying an iPod touch to make some money on developing apps for the iPhone. I like the concept of the App Store and had a quick look at it with iTunes. Looks like applications are categorized, to be iPhone OR iPod applications. Some apps which are f...
[ "iphone", "app-store", "ipod" ]
19
26
10,639
6
0
2008-09-25T15:35:44.943000
2008-09-25T15:37:53.737000
134,049
135,031
Database Duplicate Value Issue ( Filtering Based on Previous Value)
Earlier this week I ask a question about filtering out duplicate values in sequence at run time. Had some good answers but the amount of data I was going over was to slow and not feasible. Currently in our database, event values are not filtered. Resulting in duplicate data values (with varying timestamps). We need to ...
Here's an update solution. Performance will vary depending on indexes. DECLARE @MyTable TABLE ( DeviceName varchar(100), EventTime DateTime, OnOff int, GoodForRead int ) INSERT INTO @MyTable(DeviceName, OnOff, EventTime) SELECT 'F07331E4-26EC-41B6-BEC5-002AACA58337', 1, '2008-05-08 04:03:47.000' INSERT INTO @MyTable(D...
Database Duplicate Value Issue ( Filtering Based on Previous Value) Earlier this week I ask a question about filtering out duplicate values in sequence at run time. Had some good answers but the amount of data I was going over was to slow and not feasible. Currently in our database, event values are not filtered. Resul...
TITLE: Database Duplicate Value Issue ( Filtering Based on Previous Value) QUESTION: Earlier this week I ask a question about filtering out duplicate values in sequence at run time. Had some good answers but the amount of data I was going over was to slow and not feasible. Currently in our database, event values are n...
[ "sql", "performance", "triggers", "filtering", "duplicate-data" ]
1
0
370
2
0
2008-09-25T15:35:45.833000
2008-09-25T18:23:17.070000
134,052
134,146
Good ISAM library or other simple file manager for large files on Windows x64
We have some very large data files (5 gig to 1TB) where we need quick read/write access. Since we have a fixed record size it seems like some form of ISAM would be the way to go. But would be happy to hear other suggestions. Ideally the solution would have an Apache or LGPL style license but we will pay if we have to. ...
Give Berkeley DB a try. Opinions vary, but it's scalable, stable (if you use all necessary layers) and AFAIK runs well on x64 windows. Also portable to *nix and has C and Java API. Don't know about C# API.
Good ISAM library or other simple file manager for large files on Windows x64 We have some very large data files (5 gig to 1TB) where we need quick read/write access. Since we have a fixed record size it seems like some form of ISAM would be the way to go. But would be happy to hear other suggestions. Ideally the solut...
TITLE: Good ISAM library or other simple file manager for large files on Windows x64 QUESTION: We have some very large data files (5 gig to 1TB) where we need quick read/write access. Since we have a fixed record size it seems like some form of ISAM would be the way to go. But would be happy to hear other suggestions....
[ "c#", "windows", "file-io", "64-bit", "isam" ]
2
1
3,195
2
0
2008-09-25T15:36:20.763000
2008-09-25T15:52:22.800000
134,058
134,966
Alter a column length
I need to alter the length of a column column_length in say more than 500 tables and the tables might have no of records ranging from 10 records to 3 or 4 million records. The column may just be a normal column CREATE TABLE test(column_length varchar(10)) The column might contain non-clustered index on it. CREATE TABLE...
Yes you should be able to just modify the columns. From my experience it is faster to leave the index and primary key in place.
Alter a column length I need to alter the length of a column column_length in say more than 500 tables and the tables might have no of records ranging from 10 records to 3 or 4 million records. The column may just be a normal column CREATE TABLE test(column_length varchar(10)) The column might contain non-clustered ind...
TITLE: Alter a column length QUESTION: I need to alter the length of a column column_length in say more than 500 tables and the tables might have no of records ranging from 10 records to 3 or 4 million records. The column may just be a normal column CREATE TABLE test(column_length varchar(10)) The column might contain...
[ "sql-server" ]
3
2
2,611
2
0
2008-09-25T15:37:31.790000
2008-09-25T18:11:00.920000
134,063
134,084
Why are 'out' parameters in .NET a bad idea?
Why are 'out' parameters in.NET a bad idea? I was recently asked this, but I had no real answer besides it's simply unnecessarily complicating an application. What other reasons are there?
Well, they aren't a bad idea I think. Dictionary has a TryGetValue method which is a very good example why out parameters are sometimes a very nice thing to have. You should not overuse this feature of course, but it's not a bad idea per definition. Especially not in C# where you have to write down the out keyword in f...
Why are 'out' parameters in .NET a bad idea? Why are 'out' parameters in.NET a bad idea? I was recently asked this, but I had no real answer besides it's simply unnecessarily complicating an application. What other reasons are there?
TITLE: Why are 'out' parameters in .NET a bad idea? QUESTION: Why are 'out' parameters in.NET a bad idea? I was recently asked this, but I had no real answer besides it's simply unnecessarily complicating an application. What other reasons are there? ANSWER: Well, they aren't a bad idea I think. Dictionary has a TryG...
[ ".net" ]
41
64
21,364
23
0
2008-09-25T15:38:37.560000
2008-09-25T15:41:00.783000
134,064
136,315
"Reuse existing types" is ignored when adding a service reference
I am adding a service reference to one of my projects in Visual Studio 2008. On the "Service Reference Settings" screen I am selecting the default option which says "Reuse types in all referenced assemblies". I have referenced the project for which I want to reuse a type. That type is being passed in as a parameter to ...
I've answered my own question (I think). What I was trying to do was use a service reference to point to an existing ASP.NET web service, but reusing types is not supported for old school web services. It only works with WCF services. So I took the plunge and converted my web service to a true WCF service and now it wo...
"Reuse existing types" is ignored when adding a service reference I am adding a service reference to one of my projects in Visual Studio 2008. On the "Service Reference Settings" screen I am selecting the default option which says "Reuse types in all referenced assemblies". I have referenced the project for which I wan...
TITLE: "Reuse existing types" is ignored when adding a service reference QUESTION: I am adding a service reference to one of my projects in Visual Studio 2008. On the "Service Reference Settings" screen I am selecting the default option which says "Reuse types in all referenced assemblies". I have referenced the proje...
[ ".net", "visual-studio-2008", "web-services" ]
5
6
7,160
2
0
2008-09-25T15:38:41.147000
2008-09-25T21:35:21.273000
134,068
135,908
ListBox+WrapPanel arrow key navigation
I'm trying to achieve the equivalent of a WinForms ListView with its View property set to View.List. Visually, the following works fine. The file names in my Listbox go from top to bottom, and then wrap to a new column. Here's the basic XAML I'm working with: However, default arrow key navigation does not wrap. If the ...
It turns out that when it wraps around in my handling of the KeyDown event, selection changes to the correct item, but focus is on the old item. Here is the updated KeyDown eventhandler. Because of Binding, the Items collection returns my actual items rather than ListBoxItem s, so I have to do a call near the end to ge...
ListBox+WrapPanel arrow key navigation I'm trying to achieve the equivalent of a WinForms ListView with its View property set to View.List. Visually, the following works fine. The file names in my Listbox go from top to bottom, and then wrap to a new column. Here's the basic XAML I'm working with: However, default arro...
TITLE: ListBox+WrapPanel arrow key navigation QUESTION: I'm trying to achieve the equivalent of a WinForms ListView with its View property set to View.List. Visually, the following works fine. The file names in my Listbox go from top to bottom, and then wrap to a new column. Here's the basic XAML I'm working with: How...
[ "wpf", "listbox", "wrappanel" ]
5
8
8,948
2
0
2008-09-25T15:39:19.990000
2008-09-25T20:40:36.070000
134,086
134,101
What strategies and tools are useful for finding memory leaks in .NET?
I wrote C++ for 10 years. I encountered memory problems, but they could be fixed with a reasonable amount of effort. For the last couple of years I've been writing C#. I find I still get lots of memory problems. They're difficult to diagnose and fix due to the non-determinancy, and because the C# philosophy is that you...
I use Scitech's MemProfiler when I suspect a memory leak. So far, I have found it to be very reliable and powerful. It has saved my bacon on at least one occasion. The GC works very well in.NET IMO, but just like any other language or platform, if you write bad code, bad things happen.
What strategies and tools are useful for finding memory leaks in .NET? I wrote C++ for 10 years. I encountered memory problems, but they could be fixed with a reasonable amount of effort. For the last couple of years I've been writing C#. I find I still get lots of memory problems. They're difficult to diagnose and fix...
TITLE: What strategies and tools are useful for finding memory leaks in .NET? QUESTION: I wrote C++ for 10 years. I encountered memory problems, but they could be fixed with a reasonable amount of effort. For the last couple of years I've been writing C#. I find I still get lots of memory problems. They're difficult t...
[ "c#", ".net", "memory-management", "memory-leaks" ]
160
55
119,816
15
0
2008-09-25T15:41:32.280000
2008-09-25T15:43:44.177000
134,094
142,738
Developing N-Tier App. In what direction?
Assuming the you are implementing a user story that requires changes in all layers from UI (or service facade) to DB. In what direction do you move? From UI to Business Layer to Repository to DB? From DB to Repository to Business Layer to UI? It depends. (On what?)
The best answer I've seen to this sort of question was supplied by the Atomic Object guys and their Presenter First pattern. Basically it is an implementation of the MVP pattern, in which (as the name suggests) you start working from the Presenter. This provides you with a very light-weight object (since the presenter ...
Developing N-Tier App. In what direction? Assuming the you are implementing a user story that requires changes in all layers from UI (or service facade) to DB. In what direction do you move? From UI to Business Layer to Repository to DB? From DB to Repository to Business Layer to UI? It depends. (On what?)
TITLE: Developing N-Tier App. In what direction? QUESTION: Assuming the you are implementing a user story that requires changes in all layers from UI (or service facade) to DB. In what direction do you move? From UI to Business Layer to Repository to DB? From DB to Repository to Business Layer to UI? It depends. (On w...
[ "tdd", "n-tier-architecture" ]
4
3
904
4
0
2008-09-25T15:42:52.620000
2008-09-27T01:52:09.547000
134,103
332,458
How do you search the text of changelist descriptions in Perforce?
On occasion, I find myself wanting to search the text of changelist descriptions in Perforce. There doesn't appear to be a way to do this in P4V. I can do it by redirecting the output of the changes command to a file... p4 changes -l > p4changes.txt...(the -l switch tells it to dump the full text of the changelist desc...
When the submitted changelist pane has focus, a CTRL+F lets you do an arbitrary text search, which includes changelist descriptions. The only limitation is that it searches just those changelists that have been fetched from the server, so you may need to up the number retrieved. This is done via the "Number of changeli...
How do you search the text of changelist descriptions in Perforce? On occasion, I find myself wanting to search the text of changelist descriptions in Perforce. There doesn't appear to be a way to do this in P4V. I can do it by redirecting the output of the changes command to a file... p4 changes -l > p4changes.txt...(...
TITLE: How do you search the text of changelist descriptions in Perforce? QUESTION: On occasion, I find myself wanting to search the text of changelist descriptions in Perforce. There doesn't appear to be a way to do this in P4V. I can do it by redirecting the output of the changes command to a file... p4 changes -l >...
[ "perforce" ]
74
73
41,562
8
0
2008-09-25T15:44:09.213000
2008-12-01T22:26:26.420000
134,125
134,162
Positioning three divs with css
I have three divs: How would I define the CSS styles (without touching the HTML) to have the menu-div as the left column, the login-div in the right column and the content-div also in the right column but below the login-div. The width of every div is fixed, but the height isn't.
#menu { position:absolute; top:0; left:0; width:100px; } #content, #login { margin-left:120px; } Why this way? The menu coming last in the markup makes it tough. You might also be able to float both content and login right, and added a clear:right to content, but I think this might be your best bet. Without seeing the ...
Positioning three divs with css I have three divs: How would I define the CSS styles (without touching the HTML) to have the menu-div as the left column, the login-div in the right column and the content-div also in the right column but below the login-div. The width of every div is fixed, but the height isn't.
TITLE: Positioning three divs with css QUESTION: I have three divs: How would I define the CSS styles (without touching the HTML) to have the menu-div as the left column, the login-div in the right column and the content-div also in the right column but below the login-div. The width of every div is fixed, but the hei...
[ "html", "css", "layout" ]
4
6
3,993
2
0
2008-09-25T15:47:51.657000
2008-09-25T15:54:05.773000
134,131
140,864
ASP.NET MVC CTP5 Crashing IDE
I've recently installed the MVC CTP5 and VS is now crashing on me when I try to open an aspx, I get the following error in event viewer:.NET Runtime version 2.0.50727.3053 - Fatal Execution Engine Error (7A035E00) (80131506) I was able to find This post on the asp.net forums relating to the same issue but nobody has ha...
I had a problem with Power Commands and Preview 5. If you have Power Commands installed, try updating or uninstalling it to fix the issue.
ASP.NET MVC CTP5 Crashing IDE I've recently installed the MVC CTP5 and VS is now crashing on me when I try to open an aspx, I get the following error in event viewer:.NET Runtime version 2.0.50727.3053 - Fatal Execution Engine Error (7A035E00) (80131506) I was able to find This post on the asp.net forums relating to th...
TITLE: ASP.NET MVC CTP5 Crashing IDE QUESTION: I've recently installed the MVC CTP5 and VS is now crashing on me when I try to open an aspx, I get the following error in event viewer:.NET Runtime version 2.0.50727.3053 - Fatal Execution Engine Error (7A035E00) (80131506) I was able to find This post on the asp.net for...
[ "asp.net-mvc", "visual-studio-2008", "ide", "crash", "preview-5" ]
3
2
1,674
5
0
2008-09-25T15:49:07.127000
2008-09-26T17:39:16.610000
134,148
134,164
Do assemblies placed in the GAC gain full trust?
I've been hearing conflicting facts about this topic. What is correct?
You've been hearing conflicting views because it's a topic of great confusion, even among senior engineers. In short, simply placing an assembly in the GAC does implicitly give it full trust, but this can be overriden via security policy. EDIT1: Let me add that a common thought is if you don't trust an assembly fully, ...
Do assemblies placed in the GAC gain full trust? I've been hearing conflicting facts about this topic. What is correct?
TITLE: Do assemblies placed in the GAC gain full trust? QUESTION: I've been hearing conflicting facts about this topic. What is correct? ANSWER: You've been hearing conflicting views because it's a topic of great confusion, even among senior engineers. In short, simply placing an assembly in the GAC does implicitly g...
[ ".net", "security", "gac" ]
6
8
1,704
2
0
2008-09-25T15:52:30.287000
2008-09-25T15:54:12.047000
134,158
228,866
How would you sort 1 million 32-bit integers in 2MB of RAM?
Please, provide code examples in a language of your choice. Update: No constraints set on external storage. Example: Integers are received/sent via network. There is a sufficient space on local disk for intermediate results.
Sorting a million 32-bit integers in 2MB of RAM using Python by Guido van Rossum
How would you sort 1 million 32-bit integers in 2MB of RAM? Please, provide code examples in a language of your choice. Update: No constraints set on external storage. Example: Integers are received/sent via network. There is a sufficient space on local disk for intermediate results.
TITLE: How would you sort 1 million 32-bit integers in 2MB of RAM? QUESTION: Please, provide code examples in a language of your choice. Update: No constraints set on external storage. Example: Integers are received/sent via network. There is a sufficient space on local disk for intermediate results. ANSWER: Sorting ...
[ "algorithm", "language-agnostic", "google-moderator" ]
14
11
32,362
10
0
2008-09-25T15:53:47.070000
2008-10-23T07:38:20.207000
134,214
134,238
Create a method call in .NET based on a string value
Right now, I have code that looks something like this: Private Sub ShowReport(ByVal reportName As String) Select Case reportName Case "Security" Me.ShowSecurityReport() Case "Configuration" Me.ShowConfigurationReport() Case "RoleUsers" Me.ShowRoleUsersReport() Case Else pnlMessage.Visible = True litMessage.Text = "The ...
Type type = GetType(); MethodInfo method = type.GetMethod("Show"+reportName+"Report"); if (method!= null) { method.Invoke(this, null); } This is C#, should be easy enough to turn it into VB. If you need to pass parameter into the method, they can be added in the 2nd argument to Invoke.
Create a method call in .NET based on a string value Right now, I have code that looks something like this: Private Sub ShowReport(ByVal reportName As String) Select Case reportName Case "Security" Me.ShowSecurityReport() Case "Configuration" Me.ShowConfigurationReport() Case "RoleUsers" Me.ShowRoleUsersReport() Case E...
TITLE: Create a method call in .NET based on a string value QUESTION: Right now, I have code that looks something like this: Private Sub ShowReport(ByVal reportName As String) Select Case reportName Case "Security" Me.ShowSecurityReport() Case "Configuration" Me.ShowConfigurationReport() Case "RoleUsers" Me.ShowRoleUs...
[ ".net", "vb.net", "method-call" ]
10
18
19,086
12
0
2008-09-25T16:03:51.850000
2008-09-25T16:08:28.627000
134,224
204,993
Generating an Xml Serialization assembly as part of my build
This code produces a FileNotFoundException, but ultimately runs without issue: void ReadXml() { XmlSerializer serializer = new XmlSerializer(typeof(MyClass)); //... } Here is the exception: A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll Additional information: Could not load...
This is how I managed to do it by modifying the MSBUILD script in my.CSPROJ file: First, open your.CSPROJ file as a file rather than as a project. Scroll to the bottom of the file until you find this commented out code, just before the close of the Project tag: Now we just insert our own AfterBuild target to delete any...
Generating an Xml Serialization assembly as part of my build This code produces a FileNotFoundException, but ultimately runs without issue: void ReadXml() { XmlSerializer serializer = new XmlSerializer(typeof(MyClass)); //... } Here is the exception: A first chance exception of type 'System.IO.FileNotFoundException' oc...
TITLE: Generating an Xml Serialization assembly as part of my build QUESTION: This code produces a FileNotFoundException, but ultimately runs without issue: void ReadXml() { XmlSerializer serializer = new XmlSerializer(typeof(MyClass)); //... } Here is the exception: A first chance exception of type 'System.IO.FileNot...
[ "c#", "xml", "xml-serialization" ]
69
58
69,568
9
0
2008-09-25T16:06:16.540000
2008-10-15T14:45:18.973000
134,235
197,609
Is there any good Markdown Javascript library or control?
I want to build a site where the user can enter text and format it in Markdown. The reason I'd like a Javascript solution is because I want to display a live preview, just like on StackOverflow. My site is not targeted at developers, however, so an editor control would be ideal. I gather that on StackOverflow, the WMD ...
If you're not averse to using Ajax to generate the live preview, then another option is markItUp!. markItUp! is a universal markup-editor, and very flexible. It does provide an easy way of creating a markup editor, but unlike WMD, it doesn't provide its own live preview. I used markItUp!, along with a simple JSP (using...
Is there any good Markdown Javascript library or control? I want to build a site where the user can enter text and format it in Markdown. The reason I'd like a Javascript solution is because I want to display a live preview, just like on StackOverflow. My site is not targeted at developers, however, so an editor contro...
TITLE: Is there any good Markdown Javascript library or control? QUESTION: I want to build a site where the user can enter text and format it in Markdown. The reason I'd like a Javascript solution is because I want to display a live preview, just like on StackOverflow. My site is not targeted at developers, however, s...
[ "javascript", "controls", "markdown" ]
92
34
35,241
10
0
2008-09-25T16:08:10.453000
2008-10-13T13:43:14.530000
134,237
134,241
Why can't you use the keyword 'this' in a static method in .Net?
I'm trying to use the this keyword in a static method, but the compiler won't allow me to use it. Why not?
That's an easy one. The keyword 'this' returns a reference to the current instance of the class containing it. Static methods (or any static member) do not belong to a particular instance. They exist without creating an instance of the class. There is a much more in depth explanation of what static members are and why/...
Why can't you use the keyword 'this' in a static method in .Net? I'm trying to use the this keyword in a static method, but the compiler won't allow me to use it. Why not?
TITLE: Why can't you use the keyword 'this' in a static method in .Net? QUESTION: I'm trying to use the this keyword in a static method, but the compiler won't allow me to use it. Why not? ANSWER: That's an easy one. The keyword 'this' returns a reference to the current instance of the class containing it. Static met...
[ "c#", ".net" ]
32
67
43,180
8
0
2008-09-25T16:08:22.713000
2008-09-25T16:08:50.590000
134,244
134,449
Retrieving an Record Problem
Okay, that may not be the best subject... I am setting up an approval workflow within an application. I pass the username and the dollar amount to the subprocedure and figure out what workflow I need to use for the approval process. I thought I had this working until I try to handle the condition when the user hasn't b...
The solution that worked for me can be found at: http://archive.midrange.com/rpg400-l/200809/msg00509.html
Retrieving an Record Problem Okay, that may not be the best subject... I am setting up an approval workflow within an application. I pass the username and the dollar amount to the subprocedure and figure out what workflow I need to use for the approval process. I thought I had this working until I try to handle the con...
TITLE: Retrieving an Record Problem QUESTION: Okay, that may not be the best subject... I am setting up an approval workflow within an application. I pass the username and the dollar amount to the subprocedure and figure out what workflow I need to use for the approval process. I thought I had this working until I try...
[ "ibm-midrange", "rpgle" ]
0
2
169
1
0
2008-09-25T16:09:43.460000
2008-09-25T16:45:56.150000
134,245
135,851
Does Anyone Have Experience Creating an Occasionally-Connected Browser App With NHibernate?
We need to make our enterprise ASP.NET/NHibernate browser-based application able to function when connected to or disconnected from the customer's server. Has anyone done this? If so, how did you do it? (Technology, architecture, etc.) Background: We develop and sell an enterprise browser-based application used by cons...
Maybe you could operate some kind of offline version using a small version database (I hear good things about vistadb - http://www.vistadb.net/ which I believe does play well with NHibernate). With a syncing tool to copy data in when they are back on line. A click-once launcher could handle installation and integration...
Does Anyone Have Experience Creating an Occasionally-Connected Browser App With NHibernate? We need to make our enterprise ASP.NET/NHibernate browser-based application able to function when connected to or disconnected from the customer's server. Has anyone done this? If so, how did you do it? (Technology, architecture...
TITLE: Does Anyone Have Experience Creating an Occasionally-Connected Browser App With NHibernate? QUESTION: We need to make our enterprise ASP.NET/NHibernate browser-based application able to function when connected to or disconnected from the customer's server. Has anyone done this? If so, how did you do it? (Techno...
[ "nhibernate", "microsoft-sync-framework", "occasionallyconnected" ]
2
3
1,391
2
0
2008-09-25T16:10:03.457000
2008-09-25T20:32:20.833000
134,251
134,326
C# Exception Handling continue on error
I have a basic C# console application that reads a text file (CSV format) line by line and puts the data into a HashTable. The first CSV item in the line is the key (id num) and the rest of the line is the value. However I've discovered that my import file has a few duplicate keys that it shouldn't have. When I try to ...
if (myHashtable.ContainsKey(key)) duplicates.Add(key); else myHashtable.Add(key, value);
C# Exception Handling continue on error I have a basic C# console application that reads a text file (CSV format) line by line and puts the data into a HashTable. The first CSV item in the line is the key (id num) and the rest of the line is the value. However I've discovered that my import file has a few duplicate key...
TITLE: C# Exception Handling continue on error QUESTION: I have a basic C# console application that reads a text file (CSV format) line by line and puts the data into a HashTable. The first CSV item in the line is the key (id num) and the rest of the line is the value. However I've discovered that my import file has a...
[ "c#", "exception", "csv" ]
2
10
2,860
7
0
2008-09-25T16:10:27.077000
2008-09-25T16:20:10.487000
134,263
154,970
How can I configure Tomcat to always direct to index.jsp after login?
Currently Tomcat's login support redirects users back to where they initially were when the application figured out they weren't logged in. For this particular application I need to force them to always go back to index.jsp. I'm pretty sure this is a simple configuration option in the WAR's web.xml, but I haven't found...
A better solution would probably be to use a servlet filter. You could then check for j_username / j_password, and a successful login and redirect them where you wanted them to go.
How can I configure Tomcat to always direct to index.jsp after login? Currently Tomcat's login support redirects users back to where they initially were when the application figured out they weren't logged in. For this particular application I need to force them to always go back to index.jsp. I'm pretty sure this is a...
TITLE: How can I configure Tomcat to always direct to index.jsp after login? QUESTION: Currently Tomcat's login support redirects users back to where they initially were when the application figured out they weren't logged in. For this particular application I need to force them to always go back to index.jsp. I'm pre...
[ "tomcat", "jakarta-ee", "authentication" ]
0
2
3,083
2
0
2008-09-25T16:11:34.500000
2008-09-30T20:37:53.810000
134,266
134,319
How to interpret code metrics (calculated by SourceMonitor)
After reading the answers to the question "Calculate Code Metrics" I installed the tool SourceMonitor and calculated some metrics. But I have no idea how to interpret them. What's a "good" value for the metric "Percent Branch Statements" "Methods per Class" "Average Statements per Method" "Maximum Method or Function Co...
SourceMonitor is an awesome tool. "Methods Per Class" is useful to those who wish to ensure their classes follow good OO principles (too many methods indicates that a class could be taking on more than it should). "Average Statements per Method" is useful for a general feel of how big each method is. More useful to me ...
How to interpret code metrics (calculated by SourceMonitor) After reading the answers to the question "Calculate Code Metrics" I installed the tool SourceMonitor and calculated some metrics. But I have no idea how to interpret them. What's a "good" value for the metric "Percent Branch Statements" "Methods per Class" "A...
TITLE: How to interpret code metrics (calculated by SourceMonitor) QUESTION: After reading the answers to the question "Calculate Code Metrics" I installed the tool SourceMonitor and calculated some metrics. But I have no idea how to interpret them. What's a "good" value for the metric "Percent Branch Statements" "Met...
[ "metrics", "source-monitor" ]
15
16
11,417
2
0
2008-09-25T16:12:30.473000
2008-09-25T16:19:38.053000
134,284
134,436
How to receive UDP Multicast in VxWorks 5.5
I have been unable to receive UDP multicast under VxWorks 5.5. I've joined the multicast group: setsockopt(soc, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *) &ipMreq, sizeof (ipMreq)); Similar code on an adjacent Windows machine does receive multicast. I am able to send multicast from VxWorks; ifShow() indicates the interfac...
Are you checking the return value on the Join setsockopt() call to be sure it's actually succeeding? I had a specific problem with VxWorks 5.5 in the past where my multicast joins were failing when they shouldn't be. I believe we had to get new libraries from WindRiver to fix the issue. Edit: There is no specific trick...
How to receive UDP Multicast in VxWorks 5.5 I have been unable to receive UDP multicast under VxWorks 5.5. I've joined the multicast group: setsockopt(soc, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *) &ipMreq, sizeof (ipMreq)); Similar code on an adjacent Windows machine does receive multicast. I am able to send multicast f...
TITLE: How to receive UDP Multicast in VxWorks 5.5 QUESTION: I have been unable to receive UDP multicast under VxWorks 5.5. I've joined the multicast group: setsockopt(soc, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *) &ipMreq, sizeof (ipMreq)); Similar code on an adjacent Windows machine does receive multicast. I am able t...
[ "sockets", "vxworks" ]
2
1
3,213
1
0
2008-09-25T16:14:12.667000
2008-09-25T16:43:09.480000
134,295
134,310
Hiding the header on an Infragistics Winform UltraCombo
I've gone through just about every property I can think of, but haven't found a simple way to hide the header on a winform UltraCombo control from Infragistics. Headers make sense when I have multiple visible columns and whatnot, but sometimes it would be nice to hide it. To give a simple example, let's say I have a co...
works for us. This is on Infragistics NetAdvantage for.NET 2008.
Hiding the header on an Infragistics Winform UltraCombo I've gone through just about every property I can think of, but haven't found a simple way to hide the header on a winform UltraCombo control from Infragistics. Headers make sense when I have multiple visible columns and whatnot, but sometimes it would be nice to ...
TITLE: Hiding the header on an Infragistics Winform UltraCombo QUESTION: I've gone through just about every property I can think of, but haven't found a simple way to hide the header on a winform UltraCombo control from Infragistics. Headers make sense when I have multiple visible columns and whatnot, but sometimes it...
[ ".net", "winforms", "controls", "combobox", "infragistics" ]
5
3
9,282
2
0
2008-09-25T16:15:17.987000
2008-09-25T16:17:15.627000
134,298
134,345
How select the rest of the word in incremental search in Intellij IDEA?
When in incremental search mode in Intellij IDEA, is there a way to select the rest of the word. For example, suppose I want to find the word “handleReservationGranted”. I type Ctrl-f to enter incremental search mode, and start typing the letters “han”. Now suppose I have found the beginning of “handleReservationGrante...
Yes, you can use autocomplete during an incremental search. After you type "han", press CTRL-SPACE (autocomplete) and it will give you a list of potential matches in the file. Just pick "handleReservationsGranted" from the list and that will become your search term.
How select the rest of the word in incremental search in Intellij IDEA? When in incremental search mode in Intellij IDEA, is there a way to select the rest of the word. For example, suppose I want to find the word “handleReservationGranted”. I type Ctrl-f to enter incremental search mode, and start typing the letters “...
TITLE: How select the rest of the word in incremental search in Intellij IDEA? QUESTION: When in incremental search mode in Intellij IDEA, is there a way to select the rest of the word. For example, suppose I want to find the word “handleReservationGranted”. I type Ctrl-f to enter incremental search mode, and start ty...
[ "search", "ide", "intellij-idea", "incremental-search" ]
1
6
768
1
0
2008-09-25T16:15:32.400000
2008-09-25T16:24:00.960000
134,309
134,324
How can I browse my Tomcat localhost from another computer on the network?
I'm an IIS guy and know its as simple as just using the http://[computername]/path to webapp.. however, I can't seem to figure out how to make this possible for a JSP application I'm writing that runs under Tomcat. Is there a configuration setting I need to set somewhere?
You need to use the Port of Tomcat which is by default 8080. So you might want to access you localhost on machine A from machine B as http://A:8080/YourProject And Remember Unlike IIS, it is case sensitive.
How can I browse my Tomcat localhost from another computer on the network? I'm an IIS guy and know its as simple as just using the http://[computername]/path to webapp.. however, I can't seem to figure out how to make this possible for a JSP application I'm writing that runs under Tomcat. Is there a configuration setti...
TITLE: How can I browse my Tomcat localhost from another computer on the network? QUESTION: I'm an IIS guy and know its as simple as just using the http://[computername]/path to webapp.. however, I can't seem to figure out how to make this possible for a JSP application I'm writing that runs under Tomcat. Is there a c...
[ "jsp", "tomcat", "localhost" ]
22
21
86,549
10
0
2008-09-25T16:17:04.487000
2008-09-25T16:20:07.227000
134,314
134,397
Current standard compliance level of IronPython & IronRuby
Does anyone have some numbers on this? I am just looking for a percentage, a summary will be better. Standards compliance: How does the implementation stack up to the standard language specification? For those still unclear: I place emphasis on current. The IronPython link provided below has info that was last edited m...
The following sites usually have updates as to how their 'compliance' is progressing: IronPython - http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython http://www.codeplex.com/IronPython/Wiki/View.aspx?title=Regression%20Tests&referringTitle=More%20Information IronRuby - http://www.ironruby.net/ In fact from t...
Current standard compliance level of IronPython & IronRuby Does anyone have some numbers on this? I am just looking for a percentage, a summary will be better. Standards compliance: How does the implementation stack up to the standard language specification? For those still unclear: I place emphasis on current. The Iro...
TITLE: Current standard compliance level of IronPython & IronRuby QUESTION: Does anyone have some numbers on this? I am just looking for a percentage, a summary will be better. Standards compliance: How does the implementation stack up to the standard language specification? For those still unclear: I place emphasis o...
[ "ironpython", "ironruby" ]
4
3
362
4
0
2008-09-25T16:18:13.440000
2008-09-25T16:37:14.953000
134,321
134,509
Delphi: OpenFileDialog crashes with URL
Giving a URL to the TOpenFileDialog, the Execute method throws an exception: OpenDialog1.Filename:= 'http://www.osfi-bsif.gc.ca/app/DocRepository/1/eng/issues/terrorism/indstld_e.xls'; bResult:= OpenDialog1.Execute; But you are allowed to open files from a URL. Delphi 5
TOpenDialog is just a wrapper for the windows function GetOpenFileName in comdlg32.dll. function TOpenDialog.Execute(ParentWnd: HWND): Boolean; begin Result:= DoExecute(@GetOpenFileName, ParentWnd); end; Unfortunately the documentation for this function isn't that great. But I'm pretty sure it doesn't support http.
Delphi: OpenFileDialog crashes with URL Giving a URL to the TOpenFileDialog, the Execute method throws an exception: OpenDialog1.Filename:= 'http://www.osfi-bsif.gc.ca/app/DocRepository/1/eng/issues/terrorism/indstld_e.xls'; bResult:= OpenDialog1.Execute; But you are allowed to open files from a URL. Delphi 5
TITLE: Delphi: OpenFileDialog crashes with URL QUESTION: Giving a URL to the TOpenFileDialog, the Execute method throws an exception: OpenDialog1.Filename:= 'http://www.osfi-bsif.gc.ca/app/DocRepository/1/eng/issues/terrorism/indstld_e.xls'; bResult:= OpenDialog1.Execute; But you are allowed to open files from a URL. ...
[ "delphi", "url", "uri", "openfiledialog" ]
0
3
1,205
1
0
2008-09-25T16:19:48.397000
2008-09-25T16:55:03.600000
134,331
135,159
Error handling in PHP
I'm familiar with some of the basics, but what I would like to know more about is when and why error handling (including throwing exceptions) should be used in PHP, especially on a live site or web app. Is it something that can be overused and if so, what does overuse look like? Are there cases where it shouldn't be us...
One thing to add to what was said already is that it's paramount that you record any errors in your web application into a log. This way, as Jeff "Coding Horror" Atwood suggests, you'll know when your users are experiencing trouble with your app (instead of "asking them what's wrong"). To do this, I recommend the follo...
Error handling in PHP I'm familiar with some of the basics, but what I would like to know more about is when and why error handling (including throwing exceptions) should be used in PHP, especially on a live site or web app. Is it something that can be overused and if so, what does overuse look like? Are there cases wh...
TITLE: Error handling in PHP QUESTION: I'm familiar with some of the basics, but what I would like to know more about is when and why error handling (including throwing exceptions) should be used in PHP, especially on a live site or web app. Is it something that can be overused and if so, what does overuse look like? ...
[ "php", "error-handling" ]
31
32
8,602
10
0
2008-09-25T16:21:05.583000
2008-09-25T18:43:38.020000
134,338
134,416
Eclipse folder Referenced Libraries disappears
In Java projects in Eclipse version 3.4.1 sometimes the folder "Referenced Libraries" disappears from the "Project Explorer" view. All third party jars are shown directly in the root of the project folder. The project compiles and runs fine. It seems to be a GUI problem. How can I get this folder back?
First, bring up the "Package Explorer" view (instead of the "Project Explorer" view). Then, if the referenced.jar files still are visible in the root of the project, click on the little "down arrow" icon in the top-right corner of the Package Explorer view. In the context menu that appears, one of the items on the menu...
Eclipse folder Referenced Libraries disappears In Java projects in Eclipse version 3.4.1 sometimes the folder "Referenced Libraries" disappears from the "Project Explorer" view. All third party jars are shown directly in the root of the project folder. The project compiles and runs fine. It seems to be a GUI problem. H...
TITLE: Eclipse folder Referenced Libraries disappears QUESTION: In Java projects in Eclipse version 3.4.1 sometimes the folder "Referenced Libraries" disappears from the "Project Explorer" view. All third party jars are shown directly in the root of the project folder. The project compiles and runs fine. It seems to b...
[ "eclipse" ]
43
92
32,856
5
0
2008-09-25T16:23:34.860000
2008-09-25T16:39:40.907000
134,359
135,501
How do I determine program interupt in Windows Mobile
I have an game application I have written for Windows Mobile and I want to have a timer associated with the puzzle. If the program loses focus for any reason (call comes in, user switches programs, user hits the Windows button) then I want a pop up dialog box to cover the puzzle and the timer to stop. When the user clo...
Take a look at the article over at OpenNETCF's Community site on determining when a Form or Process changes.
How do I determine program interupt in Windows Mobile I have an game application I have written for Windows Mobile and I want to have a timer associated with the puzzle. If the program loses focus for any reason (call comes in, user switches programs, user hits the Windows button) then I want a pop up dialog box to cov...
TITLE: How do I determine program interupt in Windows Mobile QUESTION: I have an game application I have written for Windows Mobile and I want to have a timer associated with the puzzle. If the program loses focus for any reason (call comes in, user switches programs, user hits the Windows button) then I want a pop up...
[ "c#", "windows-mobile", "mobile" ]
2
2
141
2
0
2008-09-25T16:26:34.667000
2008-09-25T19:36:12.853000
134,378
144,015
Infopath doesn't render background colors/pictures w/ Outlook Task/Sharepoint
I am using Infopath forms to collect information to trigger my Windows Workflow sitting on Sharepoint 2007. The Infopath forms have logo's and branding which only show up on the Sharepoint portal but the infopath forms which are emailed when tasks are created during the workflow look different as in the background colo...
Figured out the issue here...InfoPath seems to cache the form on the client(seems to check for the form’s unique URN in the cache) which means that if you attempt to click on the email “Edit this task…” the new form is not downloaded, instead the InfoPath form from the cache is displayed. I am looking at a few ways int...
Infopath doesn't render background colors/pictures w/ Outlook Task/Sharepoint I am using Infopath forms to collect information to trigger my Windows Workflow sitting on Sharepoint 2007. The Infopath forms have logo's and branding which only show up on the Sharepoint portal but the infopath forms which are emailed when ...
TITLE: Infopath doesn't render background colors/pictures w/ Outlook Task/Sharepoint QUESTION: I am using Infopath forms to collect information to trigger my Windows Workflow sitting on Sharepoint 2007. The Infopath forms have logo's and branding which only show up on the Sharepoint portal but the infopath forms which...
[ "sharepoint", "outlook", "workflow", "infopath", "task" ]
1
3
1,786
1
0
2008-09-25T16:31:06.620000
2008-09-27T17:09:36.253000
134,379
134,401
Returning query results in predefined order
Is it possible to do a SELECT statement with a predetermined order, ie. selecting IDs 7,2,5,9 and 8 and returning them in that order, based on nothing more than the ID field? Both these statements return them in the same order: SELECT id FROM table WHERE id in (7,2,5,9,8) SELECT id FROM table WHERE id in (8,2,5,9,7)
I didn't think this was possible, but found a blog entry here that seems to do the type of thing you're after: SELECT id FROM table WHERE id in (7,2,5,9,8) ORDER BY FIND_IN_SET(id,"7,2,5,9,8"); will give different results to SELECT id FROM table WHERE id in (7,2,5,9,8) ORDER BY FIND_IN_SET(id,"8,2,5,9,7"); FIND_IN_SET ...
Returning query results in predefined order Is it possible to do a SELECT statement with a predetermined order, ie. selecting IDs 7,2,5,9 and 8 and returning them in that order, based on nothing more than the ID field? Both these statements return them in the same order: SELECT id FROM table WHERE id in (7,2,5,9,8) SEL...
TITLE: Returning query results in predefined order QUESTION: Is it possible to do a SELECT statement with a predetermined order, ie. selecting IDs 7,2,5,9 and 8 and returning them in that order, based on nothing more than the ID field? Both these statements return them in the same order: SELECT id FROM table WHERE id ...
[ "mysql", "sql-order-by" ]
16
37
8,784
11
0
2008-09-25T16:31:27.463000
2008-09-25T16:37:29.977000
134,387
135,290
Run Pylons controller as separate app?
I have a Pylons app where I would like to move some of the logic to a separate batch process. I've been running it under the main app for testing, but it is going to be doing a lot of work in the database, and I'd like it to be a separate process that will be running in the background constantly. The main pylons app wi...
I'm redacting my response and upvoting the other answer by Ben Bangert, as it's the correct one. I answered and have since learned the correct way (mentioned below). If you really want to, check out the history of this answer to see the wrong (but working) solution I originally proposed.
Run Pylons controller as separate app? I have a Pylons app where I would like to move some of the logic to a separate batch process. I've been running it under the main app for testing, but it is going to be doing a lot of work in the database, and I'd like it to be a separate process that will be running in the backgr...
TITLE: Run Pylons controller as separate app? QUESTION: I have a Pylons app where I would like to move some of the logic to a separate batch process. I've been running it under the main app for testing, but it is going to be doing a lot of work in the database, and I'd like it to be a separate process that will be run...
[ "python", "pylons" ]
11
1
1,507
2
0
2008-09-25T16:34:14.663000
2008-09-25T19:04:57.483000
134,388
134,396
Where do you do your validation? model, controller or view
Where do you put user input validation in a web form application? View: JavaScript client side Controller: Server side language (C#...) Model: Database (stored procedures or dependencies) I think there is validation required by each level: Did the user input a sane value are dates actual dates, are numbers actualy numb...
I check in all tiers, but I'd like to note a validation trick that I use. I validate in the database layer, proper constraints on your model will provide automatic data integrity validation. This is an art that seems to be lost on most web programmers.
Where do you do your validation? model, controller or view Where do you put user input validation in a web form application? View: JavaScript client side Controller: Server side language (C#...) Model: Database (stored procedures or dependencies) I think there is validation required by each level: Did the user input a ...
TITLE: Where do you do your validation? model, controller or view QUESTION: Where do you put user input validation in a web form application? View: JavaScript client side Controller: Server side language (C#...) Model: Database (stored procedures or dependencies) I think there is validation required by each level: Did...
[ "asp.net-mvc", "validation", "design-patterns" ]
13
8
9,289
10
0
2008-09-25T16:35:01.107000
2008-09-25T16:37:05.407000
134,392
134,467
How to add currency strings (non-standardized input) together in PHP?
I have a form in which people will be entering dollar values. Possible inputs: $999,999,999.99 999,999,999.99 999999999 99,999 $99,999 The user can enter a dollar value however they wish. I want to read the inputs as doubles so I can total them. I tried just typecasting the strings to doubles but that didn't work. Tota...
A regex won't convert your string into a number. I would suggest that you use a regex to validate the field (confirm that it fits one of your allowed formats), and then just loop over the string, discarding all non-digit and non-period characters. If you don't care about validation, you could skip the first step. The s...
How to add currency strings (non-standardized input) together in PHP? I have a form in which people will be entering dollar values. Possible inputs: $999,999,999.99 999,999,999.99 999999999 99,999 $99,999 The user can enter a dollar value however they wish. I want to read the inputs as doubles so I can total them. I tr...
TITLE: How to add currency strings (non-standardized input) together in PHP? QUESTION: I have a form in which people will be entering dollar values. Possible inputs: $999,999,999.99 999,999,999.99 999999999 99,999 $99,999 The user can enter a dollar value however they wish. I want to read the inputs as doubles so I ca...
[ "php" ]
2
2
2,983
7
0
2008-09-25T16:36:04.627000
2008-09-25T16:47:37.597000
134,408
147,338
Anyone ever tried to develop in C or C++ for Blackberry platforms?
Every indication I have, based on my experience in embedded computing is that doing something like this would require expensive equipment to get access to the platform (ICE debuggers, JTAG probes, I2C programmers, etc, etc), but I've always wondered if some ambitious hacker out there has found a way to load native code...
I've seen this question pop up in a number of different forums over time. The original Blackberries were programmable in C++ but I think that RIM ran up against the problems of trying to implement a secure platform in the C/C++ compile to native paradigm. The devices do have JTAG ports, but unless one could get hands o...
Anyone ever tried to develop in C or C++ for Blackberry platforms? Every indication I have, based on my experience in embedded computing is that doing something like this would require expensive equipment to get access to the platform (ICE debuggers, JTAG probes, I2C programmers, etc, etc), but I've always wondered if ...
TITLE: Anyone ever tried to develop in C or C++ for Blackberry platforms? QUESTION: Every indication I have, based on my experience in embedded computing is that doing something like this would require expensive equipment to get access to the platform (ICE debuggers, JTAG probes, I2C programmers, etc, etc), but I've a...
[ "blackberry", "native" ]
7
9
8,109
5
0
2008-09-25T16:38:24.280000
2008-09-29T02:37:51.213000
134,442
140,375
Mobile Capability for meta tags render en ASP.NET Mobile
Anybody knows what is mobile capability for render Meta Tags for each adapter? I am using Marg.Wurfl to detect mobile device, and it maps wurfl capabilities to mobile capabilities, but it does not render meta tags.I have found requiresXhtmlCssSuppression capability in ASP.NET Mobile Controls XHTML Adapter Source, but i...
After intensive using of Reflector, i have found than Wml, Chtml and Html (Mobile) control adaptares uses: RequiredMetaTagNameValue, RequiresContentTypeMetaTag and PreferredRenderingMime capabilities for rendering meta tags, you can see them in RenderExtraHeadElements function in *FormAdapter (not in *PageAdapter, WTF)...
Mobile Capability for meta tags render en ASP.NET Mobile Anybody knows what is mobile capability for render Meta Tags for each adapter? I am using Marg.Wurfl to detect mobile device, and it maps wurfl capabilities to mobile capabilities, but it does not render meta tags.I have found requiresXhtmlCssSuppression capabili...
TITLE: Mobile Capability for meta tags render en ASP.NET Mobile QUESTION: Anybody knows what is mobile capability for render Meta Tags for each adapter? I am using Marg.Wurfl to detect mobile device, and it maps wurfl capabilities to mobile capabilities, but it does not render meta tags.I have found requiresXhtmlCssSu...
[ "asp.net", "mobile", "mobile-website", "wurfl" ]
2
2
994
1
0
2008-09-25T16:44:37.137000
2008-09-26T15:52:09.723000
134,452
134,487
What's the best free IDE for learning smalltalk?
What do you think is a good IDE for learning SmallTalk? I'll only be using it as a hobby, so it has to be free.
I think Squeak is the way to go. It has an entire smalltalk environment and is constantly updated. Its what I used for learning and is actually even a cool app in itself.
What's the best free IDE for learning smalltalk? What do you think is a good IDE for learning SmallTalk? I'll only be using it as a hobby, so it has to be free.
TITLE: What's the best free IDE for learning smalltalk? QUESTION: What do you think is a good IDE for learning SmallTalk? I'll only be using it as a hobby, so it has to be free. ANSWER: I think Squeak is the way to go. It has an entire smalltalk environment and is constantly updated. Its what I used for learning and ...
[ "ide", "smalltalk" ]
26
22
19,152
10
0
2008-09-25T16:46:14.917000
2008-09-25T16:51:53.827000
134,456
134,553
Any performance impact in Oracle for using LIKE 'string' vs = 'string'?
This SELECT * FROM SOME_TABLE WHERE SOME_FIELD LIKE '%some_value%'; is slower than this SELECT * FROM SOME_TABLE WHERE SOME_FIELD = 'some_value'; but what about this? SELECT * FROM SOME_TABLE WHERE SOME_FIELD LIKE 'some_value'; My testing indicates the second and third examples are exactly the same. If that's true, my ...
There is a clear difference when you use bind variables, which you should be using in Oracle for anything other than data warehousing or other bulk data operations. Take the case of: SELECT * FROM SOME_TABLE WHERE SOME_FIELD LIKE:b1 Oracle cannot know that the value of:b1 is '%some_value%', or 'some_value' etc. until e...
Any performance impact in Oracle for using LIKE 'string' vs = 'string'? This SELECT * FROM SOME_TABLE WHERE SOME_FIELD LIKE '%some_value%'; is slower than this SELECT * FROM SOME_TABLE WHERE SOME_FIELD = 'some_value'; but what about this? SELECT * FROM SOME_TABLE WHERE SOME_FIELD LIKE 'some_value'; My testing indicates...
TITLE: Any performance impact in Oracle for using LIKE 'string' vs = 'string'? QUESTION: This SELECT * FROM SOME_TABLE WHERE SOME_FIELD LIKE '%some_value%'; is slower than this SELECT * FROM SOME_TABLE WHERE SOME_FIELD = 'some_value'; but what about this? SELECT * FROM SOME_TABLE WHERE SOME_FIELD LIKE 'some_value'; My...
[ "sql", "performance", "oracle" ]
17
21
25,789
7
0
2008-09-25T16:46:35.850000
2008-09-25T17:03:45.153000
134,463
134,583
Delphi Popup Menu Checks
I am using a popup menu in Delphi. I want to use it in a "radio group" fashion where if the user selects an item it is checked and the other items are not checked. I tried using the AutoCheck property, but this allows multiple items to be checked. Is there a way to set the popup menu so that only one item can be checke...
Zartog is right, but if you want to keep the checkbox, assign this event to every item in the popup menu. Note that this code is a little hairy looking because it does not depend on knowing the name of your popup menu (hence, looking it up with "GetParentComponent"). procedure TForm2.OnPopupItemClick(Sender: TObject); ...
Delphi Popup Menu Checks I am using a popup menu in Delphi. I want to use it in a "radio group" fashion where if the user selects an item it is checked and the other items are not checked. I tried using the AutoCheck property, but this allows multiple items to be checked. Is there a way to set the popup menu so that on...
TITLE: Delphi Popup Menu Checks QUESTION: I am using a popup menu in Delphi. I want to use it in a "radio group" fashion where if the user selects an item it is checked and the other items are not checked. I tried using the AutoCheck property, but this allows multiple items to be checked. Is there a way to set the pop...
[ "delphi" ]
6
5
12,144
3
0
2008-09-25T16:47:27.487000
2008-09-25T17:07:07.860000
134,470
134,504
Where to put controller parent class in CakePHP?
I have two controllers which share most of their code (but must be, nonetheless, different controllers). The obvious solution (to me, at least) is to create a class, and make the two controllers inherit from it. The thing is... where to put it? Now I have it in app_controller.php, but it's kind of messy there.
In cake, components are used to store logic that can be used by multiple controllers. The directory is /app/controllers/components. For instance, if you had some sharable utility logic, you would have an object called UtilComponent and a file in /app/controlers/components called UtilComponent.php. Then, in your control...
Where to put controller parent class in CakePHP? I have two controllers which share most of their code (but must be, nonetheless, different controllers). The obvious solution (to me, at least) is to create a class, and make the two controllers inherit from it. The thing is... where to put it? Now I have it in app_contr...
TITLE: Where to put controller parent class in CakePHP? QUESTION: I have two controllers which share most of their code (but must be, nonetheless, different controllers). The obvious solution (to me, at least) is to create a class, and make the two controllers inherit from it. The thing is... where to put it? Now I ha...
[ "cakephp" ]
4
9
1,053
2
0
2008-09-25T16:48:04.757000
2008-09-25T16:54:37.750000
134,481
134,768
How can I pass an argument to a C# plug-in being loaded through Assembly.CreateInstance?
What I have now (which successfully loads the plug-in) is this: Assembly myDLL = Assembly.LoadFrom("my.dll"); IMyClass myPluginObject = myDLL.CreateInstance("MyCorp.IMyClass") as IMyClass; This only works for a class that has a constructor with no arguments. How do I pass in an argument to a constructor?
You cannot. Instead use Activator.CreateInstance as shown in the example below (note that the Client namespace is in one DLL and the Host in another. Both must be found in the same directory for code to work.) However, if you want to create a truly pluggable interface, I suggest you use an Initialize method that take t...
How can I pass an argument to a C# plug-in being loaded through Assembly.CreateInstance? What I have now (which successfully loads the plug-in) is this: Assembly myDLL = Assembly.LoadFrom("my.dll"); IMyClass myPluginObject = myDLL.CreateInstance("MyCorp.IMyClass") as IMyClass; This only works for a class that has a con...
TITLE: How can I pass an argument to a C# plug-in being loaded through Assembly.CreateInstance? QUESTION: What I have now (which successfully loads the plug-in) is this: Assembly myDLL = Assembly.LoadFrom("my.dll"); IMyClass myPluginObject = myDLL.CreateInstance("MyCorp.IMyClass") as IMyClass; This only works for a cl...
[ "c#", "assemblies", "arguments", "createinstance" ]
5
12
11,485
5
0
2008-09-25T16:50:42.783000
2008-09-25T17:38:18.410000
134,490
134,873
Source Control for multiple projects/solutions with shared libraries
I am currently working on a project to convert a number of Excel VBA powered workbooks to VSTO solutions. All of the workbooks will share a number of class libraries and third party assemblies, in fact most of the work is done in the class libraries. I currently have my folder structure laid out like this. Base Librari...
You don't mention in your question what source control you are using. As it doesn't sound like you need to limit your outside developers access to the rest of the repository I would not bother with setting up multiple repositories. I would assume that unless your code runs into the millions of lines size that repositor...
Source Control for multiple projects/solutions with shared libraries I am currently working on a project to convert a number of Excel VBA powered workbooks to VSTO solutions. All of the workbooks will share a number of class libraries and third party assemblies, in fact most of the work is done in the class libraries. ...
TITLE: Source Control for multiple projects/solutions with shared libraries QUESTION: I am currently working on a project to convert a number of Excel VBA powered workbooks to VSTO solutions. All of the workbooks will share a number of class libraries and third party assemblies, in fact most of the work is done in the...
[ "version-control", "shared-libraries", "repository-design" ]
1
1
927
1
0
2008-09-25T16:52:48.380000
2008-09-25T17:58:03.823000
134,492
134,918
How to serialize an object into a string
I am able to serialize an object into a file and then restore it again as is shown in the next code snippet. I would like to serialize the object into a string and store into a database instead. Can anyone help me? LinkedList patches = // whatever... FileOutputStream fileStream = new FileOutputStream("foo.ser"); Object...
Sergio: You should use BLOB. It is pretty straighforward with JDBC. The problem with the second code you posted is the encoding. You should additionally encode the bytes to make sure none of them fails. If you still want to write it down into a String you can encode the bytes using java.util.Base64. Still you should us...
How to serialize an object into a string I am able to serialize an object into a file and then restore it again as is shown in the next code snippet. I would like to serialize the object into a string and store into a database instead. Can anyone help me? LinkedList patches = // whatever... FileOutputStream fileStream ...
TITLE: How to serialize an object into a string QUESTION: I am able to serialize an object into a file and then restore it again as is shown in the next code snippet. I would like to serialize the object into a string and store into a database instead. Can anyone help me? LinkedList patches = // whatever... FileOutput...
[ "java", "serialization" ]
162
290
271,374
13
0
2008-09-25T16:53:07.363000
2008-09-25T18:03:38.973000
134,494
134,498
Is there any difference between 'valid xml' and 'well formed xml'?
I wasn't aware of a difference, but a coworker says there is, although he can't back it up. What's the difference if any?
There is a difference, yes. XML that adheres to the XML standard is considered well formed, while xml that adheres to a DTD is considered valid.
Is there any difference between 'valid xml' and 'well formed xml'? I wasn't aware of a difference, but a coworker says there is, although he can't back it up. What's the difference if any?
TITLE: Is there any difference between 'valid xml' and 'well formed xml'? QUESTION: I wasn't aware of a difference, but a coworker says there is, although he can't back it up. What's the difference if any? ANSWER: There is a difference, yes. XML that adheres to the XML standard is considered well formed, while xml th...
[ "xml", "validation", "xsd", "dtd" ]
91
86
78,523
13
0
2008-09-25T16:53:08.847000
2008-09-25T16:53:29.923000
134,501
134,545
fork() as an argument
Usually when I need to fork in C, I do something like this: pid_t p = fork(); if(p == 0) { /* do child stuff */ } else { /* do parent stuff and pray there wasn't an error */ } It occured to me that I could ditch the extra variable and use: if(fork() == 0) { /* child */ } else { /* parent/pray */ } Improper error handli...
What you are suggesting will certainly work. However, error handling is not optional in any well-behaved application. The following implementation pattern is similarly succinct and also handles errors. Furthermore, it saves the fork() return value in the pid variable, in case you want to use it later in the parent to, ...
fork() as an argument Usually when I need to fork in C, I do something like this: pid_t p = fork(); if(p == 0) { /* do child stuff */ } else { /* do parent stuff and pray there wasn't an error */ } It occured to me that I could ditch the extra variable and use: if(fork() == 0) { /* child */ } else { /* parent/pray */ }...
TITLE: fork() as an argument QUESTION: Usually when I need to fork in C, I do something like this: pid_t p = fork(); if(p == 0) { /* do child stuff */ } else { /* do parent stuff and pray there wasn't an error */ } It occured to me that I could ditch the extra variable and use: if(fork() == 0) { /* child */ } else { /...
[ "c", "fork" ]
4
20
705
4
0
2008-09-25T16:54:06.723000
2008-09-25T17:02:46.110000
134,505
1,014,310
Microsoft.ApplicationBlocks.Data.ODBCHelper?
I've found mention of a data application block existing for ODBC, but can't seem to find it anywhere. If i didn't have a copy of the Access DB application block I wouldn't believe it ever existed either. Anyone know where to download either the DLL or the code-base from? --UPDATE: It is NOT included in either the v1, v...
Which version of.net are you interested in using the ODBC block on? The Enterprise library has a Data Access component. It is useful on SQL, Oracle, and ODBC. Just set a different provider name in the.config file EX: "System.Data.Odbc" /> At that point, the data access code is "standardized" and looks identical for SQL...
Microsoft.ApplicationBlocks.Data.ODBCHelper? I've found mention of a data application block existing for ODBC, but can't seem to find it anywhere. If i didn't have a copy of the Access DB application block I wouldn't believe it ever existed either. Anyone know where to download either the DLL or the code-base from? --U...
TITLE: Microsoft.ApplicationBlocks.Data.ODBCHelper? QUESTION: I've found mention of a data application block existing for ODBC, but can't seem to find it anywhere. If i didn't have a copy of the Access DB application block I wouldn't believe it ever existed either. Anyone know where to download either the DLL or the c...
[ ".net", "odbc", "application-blocks" ]
0
2
1,703
2
0
2008-09-25T16:54:49.777000
2009-06-18T18:14:32.863000
134,517
134,704
Getting software version numbers right. v1.0.0.1
I distribute software online, and always wonder if there is a proper way to better define version numbers. Let's assume A.B.C.D in the answers. When do you increase each of the components? Do you use any other version number tricks such as D mod 2 == 1 means it is an in house release only? Do you have beta releases wit...
I'm starting to like the Year.Release[.Build] convention that some apps (e.g. Perforce) use. Basically it just says the year in which you release, and the sequence within that year. So 2008.1 would be the first version, and if you released another a months or three later, it would go to 2008.2. The advantage of this sc...
Getting software version numbers right. v1.0.0.1 I distribute software online, and always wonder if there is a proper way to better define version numbers. Let's assume A.B.C.D in the answers. When do you increase each of the components? Do you use any other version number tricks such as D mod 2 == 1 means it is an in ...
TITLE: Getting software version numbers right. v1.0.0.1 QUESTION: I distribute software online, and always wonder if there is a proper way to better define version numbers. Let's assume A.B.C.D in the answers. When do you increase each of the components? Do you use any other version number tricks such as D mod 2 == 1 ...
[ "release", "release-management", "release-cycle" ]
20
29
13,490
15
0
2008-09-25T16:57:32.923000
2008-09-25T17:27:48.263000
134,520
134,935
Integrate Stack Overflow into IDEs?
Okay, this is just a crazy idea I have. Stack Overflow looks very structured and integrable into development applications. So would it be possible, even useful, to have a Stack Overflow plugin for, say, Eclipse? Which features of Stack Overflow would you like to have directly integrated into your IDE so you can use it ...
Following up on Josh's answer. This VS Macro will search StackOverflow for highlighted text in the Visual Studio IDE. Just highlight and press Alt+F1 Public Sub SearchStackOverflowForSelectedText() Dim s As String = ActiveWindowSelection().Trim() If s.Length > 0 Then DTE.ItemOperations.Navigate("http://www.stackoverflo...
Integrate Stack Overflow into IDEs? Okay, this is just a crazy idea I have. Stack Overflow looks very structured and integrable into development applications. So would it be possible, even useful, to have a Stack Overflow plugin for, say, Eclipse? Which features of Stack Overflow would you like to have directly integra...
TITLE: Integrate Stack Overflow into IDEs? QUESTION: Okay, this is just a crazy idea I have. Stack Overflow looks very structured and integrable into development applications. So would it be possible, even useful, to have a Stack Overflow plugin for, say, Eclipse? Which features of Stack Overflow would you like to hav...
[ "eclipse", "eclipse-plugin", "integration", "stackexchange-api" ]
20
21
1,182
7
0
2008-09-25T16:57:40.363000
2008-09-25T18:06:15.583000
134,526
134,606
How do I know I reached a file's maximum size when using ofstream?
While writing a file using ofstream, how do I know when the file's size has reached the OS' maximum file size - more specifically linux's maximum file size -??
First off, maximum file size is a filesystem limit, not an Operating System limit. It will even vary for a particular filesystem, based on how the filesystem was formatted. As for how you'd figure out that you'd reached the limit, your code will likely throw an exception when that happens, which you'll then be able to ...
How do I know I reached a file's maximum size when using ofstream? While writing a file using ofstream, how do I know when the file's size has reached the OS' maximum file size - more specifically linux's maximum file size -??
TITLE: How do I know I reached a file's maximum size when using ofstream? QUESTION: While writing a file using ofstream, how do I know when the file's size has reached the OS' maximum file size - more specifically linux's maximum file size -?? ANSWER: First off, maximum file size is a filesystem limit, not an Operati...
[ "c++", "linux" ]
4
5
4,005
4
0
2008-09-25T16:58:14.857000
2008-09-25T17:11:56.757000
134,543
134,652
Can you suggest the best screencast available to learn CSS?
It should be hands-on, complete, targeted to programmers and detailed on layout techniques!
Check out www.css-tricks.com. They have excellent screen casts. Another place to check out is the various web design podcasts. Go to iTunes and search the podcasts and you will probably find a few to check out.
Can you suggest the best screencast available to learn CSS? It should be hands-on, complete, targeted to programmers and detailed on layout techniques!
TITLE: Can you suggest the best screencast available to learn CSS? QUESTION: It should be hands-on, complete, targeted to programmers and detailed on layout techniques! ANSWER: Check out www.css-tricks.com. They have excellent screen casts. Another place to check out is the various web design podcasts. Go to iTunes a...
[ "css" ]
1
0
915
3
0
2008-09-25T17:02:27.140000
2008-09-25T17:18:20.347000
134,568
134,755
Is it frowned upon to release your software with > 1 first commercial version number?
Is it frowned upon to release your software with a version number high than 1? For example, some non tech-savy people might see a competitor's product with a higher version number as meaning my software is not as good.
I believe there are 3 major ways people market product versions: Product Name [Version #] (i.e. Wordperfect 5.0) Product Name [Release Year] (i.e. Gentoo 2008.0) Product Name [Code Name] (i.e. Windows Vista) I actuall prefer the release year as part of the versioning strategy, it lets your customers know what the lates...
Is it frowned upon to release your software with > 1 first commercial version number? Is it frowned upon to release your software with a version number high than 1? For example, some non tech-savy people might see a competitor's product with a higher version number as meaning my software is not as good.
TITLE: Is it frowned upon to release your software with > 1 first commercial version number? QUESTION: Is it frowned upon to release your software with a version number high than 1? For example, some non tech-savy people might see a competitor's product with a higher version number as meaning my software is not as goo...
[ "versioning", "release-cycle" ]
5
8
801
19
0
2008-09-25T17:05:32.623000
2008-09-25T17:36:16.200000
134,569
134,640
c++ exception : throwing std::string
I would like to throw an exception when my C++ methods encounter something weird and can't recover. Is it OK to throw a std::string pointer? Here's what I was looking forward to doing: void Foo::Bar() { if(!QueryPerformanceTimer(&m_baz)) { throw new std::string("it's the end of the world!"); } } void Foo::Caller() { t...
Yes. std::exception is the base exception class in the C++ standard library. You may want to avoid using strings as exception classes because they themselves can throw an exception during use. If that happens, then where will you be? boost has an excellent document on good style for exceptions and error handling. It's ...
c++ exception : throwing std::string I would like to throw an exception when my C++ methods encounter something weird and can't recover. Is it OK to throw a std::string pointer? Here's what I was looking forward to doing: void Foo::Bar() { if(!QueryPerformanceTimer(&m_baz)) { throw new std::string("it's the end of the ...
TITLE: c++ exception : throwing std::string QUESTION: I would like to throw an exception when my C++ methods encounter something weird and can't recover. Is it OK to throw a std::string pointer? Here's what I was looking forward to doing: void Foo::Bar() { if(!QueryPerformanceTimer(&m_baz)) { throw new std::string("it...
[ "c++", "exception", "stl" ]
84
104
184,210
7
0
2008-09-25T17:05:36.820000
2008-09-25T17:16:46.230000
134,575
134,667
Using Interface Builder for UITableViews
I'm very early in the iPhone development learning process. I'm trying to get my head around various pieces. Right now I've just taken the basic NavigationController template and I'm trying to create a simple grouped table view with a couple of text fields. What I can't seem to do is to get Interface Builder to allow me...
You can create the cell with Interface Builder, but you have to make it a top-level object, rather than a child of the table view. Then you can return this cell in your view controller's tableView:cellForRowAtIndexPath: function. Make sure to give the cell an identifier in Interface Builder and then use the same identi...
Using Interface Builder for UITableViews I'm very early in the iPhone development learning process. I'm trying to get my head around various pieces. Right now I've just taken the basic NavigationController template and I'm trying to create a simple grouped table view with a couple of text fields. What I can't seem to d...
TITLE: Using Interface Builder for UITableViews QUESTION: I'm very early in the iPhone development learning process. I'm trying to get my head around various pieces. Right now I've just taken the basic NavigationController template and I'm trying to create a simple grouped table view with a couple of text fields. What...
[ "iphone", "cocoa-touch", "uitableview", "interface-builder" ]
9
17
23,083
4
0
2008-09-25T17:06:02.653000
2008-09-25T17:20:03.820000
134,580
134,740
Applescriptable mySQL client - low cost or free?
Can anyone recommend a MySQL front end client or OS X that is AppleScriptable? Preferably low cost or free.
I would suggest just using the command-line mysql client and using the do shell script command in applescript to invoke it: do shell script "mysql -e 'select * from customer'"
Applescriptable mySQL client - low cost or free? Can anyone recommend a MySQL front end client or OS X that is AppleScriptable? Preferably low cost or free.
TITLE: Applescriptable mySQL client - low cost or free? QUESTION: Can anyone recommend a MySQL front end client or OS X that is AppleScriptable? Preferably low cost or free. ANSWER: I would suggest just using the command-line mysql client and using the do shell script command in applescript to invoke it: do shell scr...
[ "mysql", "macos", "applescript" ]
0
2
217
1
0
2008-09-25T17:06:32.607000
2008-09-25T17:33:55.910000
134,581
144,510
Gem update on Windows - is it broken?
This is a follow-up to this question. When I issue the gem update command on Windows, whenever it gets to a gem whose latest version DOESN'T have Windows binaries, it'll attempt to build the native extension which will, of course, fail. For example: Updating sqlite3-ruby Building native extensions. This could take a wh...
Gems, as of version 1.3.2, will now skip gems that fail to build, so update Rubygems to the latest version and the problem discussed here should be solved. gem update --system The following solution is now deprecated, but I leave it here for the record. I started a thread on this issue on the Ruby Forum (it's a front e...
Gem update on Windows - is it broken? This is a follow-up to this question. When I issue the gem update command on Windows, whenever it gets to a gem whose latest version DOESN'T have Windows binaries, it'll attempt to build the native extension which will, of course, fail. For example: Updating sqlite3-ruby Building n...
TITLE: Gem update on Windows - is it broken? QUESTION: This is a follow-up to this question. When I issue the gem update command on Windows, whenever it gets to a gem whose latest version DOESN'T have Windows binaries, it'll attempt to build the native extension which will, of course, fail. For example: Updating sqlit...
[ "windows", "ruby", "rubygems" ]
7
4
7,125
4
0
2008-09-25T17:06:36.583000
2008-09-27T21:22:09.843000
134,626
134,638
Which is more preferable to use: lambda functions or nested functions ('def')?
I mostly use lambda functions but sometimes use nested functions that seem to provide the same behavior. Here are some trivial examples where they functionally do the same thing if either were found within another function: Lambda function >>> a = lambda x: 1 + x >>> a(5) 6 Nested function >>> def b(x): return 1 + x >...
If you need to assign the lambda to a name, use a def instead. def s are just syntactic sugar for an assignment, so the result is the same, and they are a lot more flexible and readable. lambda s can be used for use once, throw away functions which won't have a name. However, this use case is very rare. You rarely need...
Which is more preferable to use: lambda functions or nested functions ('def')? I mostly use lambda functions but sometimes use nested functions that seem to provide the same behavior. Here are some trivial examples where they functionally do the same thing if either were found within another function: Lambda function >...
TITLE: Which is more preferable to use: lambda functions or nested functions ('def')? QUESTION: I mostly use lambda functions but sometimes use nested functions that seem to provide the same behavior. Here are some trivial examples where they functionally do the same thing if either were found within another function:...
[ "python", "syntax", "function", "lambda" ]
140
150
99,893
16
0
2008-09-25T17:15:03.240000
2008-09-25T17:16:31.257000
134,629
146,596
How do I use django.core.urlresolvers.reverse with a function reference instead of a named URL pattern?
In my urls.py file, I have: from myapp import views... (r'^categories/$', views.categories) Where categories is a view function inside myapp/views.py. No other URLconf lines reference views.categories. In a unit test file, I’m trying to grab this URL using django.core.urlresolvers.reverse(), instead of just copying '/c...
After futher investigation, turns out it was an issue with how I was importing the views module: How do I successfully pass a function reference to Django’s reverse() function? Thanks for the help though, guys: you inspired me to look at it properly.
How do I use django.core.urlresolvers.reverse with a function reference instead of a named URL pattern? In my urls.py file, I have: from myapp import views... (r'^categories/$', views.categories) Where categories is a view function inside myapp/views.py. No other URLconf lines reference views.categories. In a unit test...
TITLE: How do I use django.core.urlresolvers.reverse with a function reference instead of a named URL pattern? QUESTION: In my urls.py file, I have: from myapp import views... (r'^categories/$', views.categories) Where categories is a view function inside myapp/views.py. No other URLconf lines reference views.categori...
[ "python", "django" ]
10
2
16,482
4
0
2008-09-25T17:15:23.537000
2008-09-28T19:56:18.793000
134,633
134,779
Is it possible to implement a COM interface with a .NET generics class?
I have the following interface which I'm trying to make COM-visible. When I try to generate the type-library it doesn't like the fact that my implementation class derives from a generic-class. Is it possible to use a generic class as a COM implementation class? (I know I could write a non-generic wrapper and export tha...
Generic types and types that derive from a generic type cannot be exported. Set ComVisible(false) on your MyClass type. You'll need to either create a non-generic class implementation or use the interface only.
Is it possible to implement a COM interface with a .NET generics class? I have the following interface which I'm trying to make COM-visible. When I try to generate the type-library it doesn't like the fact that my implementation class derives from a generic-class. Is it possible to use a generic class as a COM implemen...
TITLE: Is it possible to implement a COM interface with a .NET generics class? QUESTION: I have the following interface which I'm trying to make COM-visible. When I try to generate the type-library it doesn't like the fact that my implementation class derives from a generic-class. Is it possible to use a generic class...
[ ".net", "generics", "com", "comvisible" ]
9
6
6,384
1
0
2008-09-25T17:15:43.863000
2008-09-25T17:41:52.957000
134,644
134,700
Checking for duplicates in a collection
Suppose you have a collection of Foo classes: class Foo { public string Bar; public string Baz; } List foolist; And you want to check this collection to see if another entry has a matching Bar. bool isDuplicate = false; foreach (Foo f in foolist) { if (f.Bar == SomeBar) { isDuplicate = true; break; } } Contains() does...
fooList.Exists(item => item.Bar == SomeBar) That's not LINQ, but a Lambda expression, but nevertheless, it uses a v3.5 feature. No problem: fooList.Exists(delegate(Foo Item) { return item.Bar == SomeBar}); That should work in 2.0.
Checking for duplicates in a collection Suppose you have a collection of Foo classes: class Foo { public string Bar; public string Baz; } List foolist; And you want to check this collection to see if another entry has a matching Bar. bool isDuplicate = false; foreach (Foo f in foolist) { if (f.Bar == SomeBar) { isDupl...
TITLE: Checking for duplicates in a collection QUESTION: Suppose you have a collection of Foo classes: class Foo { public string Bar; public string Baz; } List foolist; And you want to check this collection to see if another entry has a matching Bar. bool isDuplicate = false; foreach (Foo f in foolist) { if (f.Bar ==...
[ "c#", ".net", ".net-2.0" ]
4
10
1,385
9
0
2008-09-25T17:17:06.387000
2008-09-25T17:26:33.570000
134,650
134,660
How to search through archived files with Perl
What is your preferred method for reading through the contents of zipped directories with Perl?
There are several modules on CPAN for working with various archive formats (zip, tar, etc.), the one you're probably after is Archive::Zip.
How to search through archived files with Perl What is your preferred method for reading through the contents of zipped directories with Perl?
TITLE: How to search through archived files with Perl QUESTION: What is your preferred method for reading through the contents of zipped directories with Perl? ANSWER: There are several modules on CPAN for working with various archive formats (zip, tar, etc.), the one you're probably after is Archive::Zip.
[ "perl", "search", "file-io", "compression" ]
3
6
1,084
3
0
2008-09-25T17:17:59.083000
2008-09-25T17:19:06.913000
134,653
143,599
Finalizer launched while its object was still being used
Summary: C#/.NET is supposed to be garbage collected. C# has a destructor, used to clean resources. What happen when an object A is garbage collected the same line I try to clone one of its variable members? Apparently, on multiprocessors, sometimes, the garbage collector wins... The problem Today, on a training sessio...
It's simply a bug in your code: finalizers should not be accessing managed objects. The only reason to implement a finalizer is to release unmanaged resources. And in this case, you should carefully implement the standard IDisposable pattern. With this pattern, you implement a protected method "protected Dispose(bool d...
Finalizer launched while its object was still being used Summary: C#/.NET is supposed to be garbage collected. C# has a destructor, used to clean resources. What happen when an object A is garbage collected the same line I try to clone one of its variable members? Apparently, on multiprocessors, sometimes, the garbage ...
TITLE: Finalizer launched while its object was still being used QUESTION: Summary: C#/.NET is supposed to be garbage collected. C# has a destructor, used to clean resources. What happen when an object A is garbage collected the same line I try to clone one of its variable members? Apparently, on multiprocessors, somet...
[ "c#", ".net", "garbage-collection", "finalization" ]
5
9
1,872
8
0
2008-09-25T17:18:24.713000
2008-09-27T12:53:23.077000
134,658
134,733
Problem encrypting membership element in web.config
I am trying to encrypt the "system.web.membership" element within the Web.Config of our.Net application to secure username and password to Active Directory. I am using the aspnet_regiis command to encrypt, and have tried several different strings for the value of the "pe" option with no success. I have successfully enc...
The configuration section is identified by " system.web/membership ", not " membership " nor " system.web.membership ".
Problem encrypting membership element in web.config I am trying to encrypt the "system.web.membership" element within the Web.Config of our.Net application to secure username and password to Active Directory. I am using the aspnet_regiis command to encrypt, and have tried several different strings for the value of the ...
TITLE: Problem encrypting membership element in web.config QUESTION: I am trying to encrypt the "system.web.membership" element within the Web.Config of our.Net application to secure username and password to Active Directory. I am using the aspnet_regiis command to encrypt, and have tried several different strings for...
[ ".net", "configuration", "encryption", "web-config" ]
5
8
4,300
2
0
2008-09-25T17:19:02.357000
2008-09-25T17:33:18.250000
134,673
3,189,578
Project dependency missing in deployment project
I've got a VS2008 deployment project that builds an installer for a couple of Windows services. Each service references several different projects: CustomerName.MailSendingService -> CustomerName.Network -> CustomerName.Data -> CustomerName.Security CustomerName.ProductIntegrationService -> CustomerName.Core -> Custom...
I have a couple more things to add after reproducing the same suspected msi defect. 1) When I added the second project output sharing the same detected dependency to the installer it did not automatically add the dependency. I removed both project output's and added them back in reverse order. The second project output...
Project dependency missing in deployment project I've got a VS2008 deployment project that builds an installer for a couple of Windows services. Each service references several different projects: CustomerName.MailSendingService -> CustomerName.Network -> CustomerName.Data -> CustomerName.Security CustomerName.Product...
TITLE: Project dependency missing in deployment project QUESTION: I've got a VS2008 deployment project that builds an installer for a couple of Windows services. Each service references several different projects: CustomerName.MailSendingService -> CustomerName.Network -> CustomerName.Data -> CustomerName.Security Cu...
[ "visual-studio-2008", "deployment-project" ]
12
5
9,765
8
0
2008-09-25T17:20:31.183000
2010-07-06T19:35:22.580000
134,680
134,720
DataGrid Edit Problem
I have a DataGrid, with an ItemTemplate that has an image and label. In the EditItemTemplate the label is replaced by a textbox. My problem is that the edit template only shows when I click the Edit button the second time. What gives?
Make sure you're re-binding the DataGrid after setting the EditItemIndex property. Edit: Agreed with Massa. Best practice is to move your databinding into a separate method and call it first on the first page load, and again after setting EditItemIndex.
DataGrid Edit Problem I have a DataGrid, with an ItemTemplate that has an image and label. In the EditItemTemplate the label is replaced by a textbox. My problem is that the edit template only shows when I click the Edit button the second time. What gives?
TITLE: DataGrid Edit Problem QUESTION: I have a DataGrid, with an ItemTemplate that has an image and label. In the EditItemTemplate the label is replaced by a textbox. My problem is that the edit template only shows when I click the Edit button the second time. What gives? ANSWER: Make sure you're re-binding the Data...
[ "asp.net", "datagrid" ]
0
0
765
2
0
2008-09-25T17:21:23.863000
2008-09-25T17:31:11.437000
134,683
134,701
Why do small spaces keep showing up in my web pages?
This might be a stupid question but if there's a better or proper way to do this, I'd love to learn it. I have run across this a few times, including recently, where small spaces show up in the rendered version of my HTML page. Intuitively I think these should not be there because outside of text or entities the format...
The whitespace (carriage return included) is usually rendered as space in all browsers. You need to put the elements one after another, but you can use a trick: This also looks a little ugly, but it's still better than one single line. You might change the formatting, but the idea is to add carriage returns inside the ...
Why do small spaces keep showing up in my web pages? This might be a stupid question but if there's a better or proper way to do this, I'd love to learn it. I have run across this a few times, including recently, where small spaces show up in the rendered version of my HTML page. Intuitively I think these should not be...
TITLE: Why do small spaces keep showing up in my web pages? QUESTION: This might be a stupid question but if there's a better or proper way to do this, I'd love to learn it. I have run across this a few times, including recently, where small spaces show up in the rendered version of my HTML page. Intuitively I think t...
[ "html", "css", "layout" ]
6
14
919
7
0
2008-09-25T17:22:32.630000
2008-09-25T17:26:33.633000