PostId
int64 4
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 1
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -55
461k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
21.5k
| Title
stringlengths 3
250
| BodyMarkdown
stringlengths 5
30k
⌀ | Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 32
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
52,821 | 09/09/2008 20:25:10 | 5,236 | 09/08/2008 16:36:03 | 6 | 1 | In LINQ to SQL how can I make it so I can add items to a collection of an entity without saving the entity first? | var e1 = new E1();
e1.e2s.Add(new e2()); //e2s is null until e1 is saved, i want to save them all at the same time
context.e1s.imsertonsubmit(e1);
context.submitchanges(); | linq-to-sql | null | null | null | null | null | open | In LINQ to SQL how can I make it so I can add items to a collection of an entity without saving the entity first?
===
var e1 = new E1();
e1.e2s.Add(new e2()); //e2s is null until e1 is saved, i want to save them all at the same time
context.e1s.imsertonsubmit(e1);
context.submitchanges(); | 0 |
52,822 | 09/09/2008 20:26:12 | 4,685 | 09/05/2008 07:49:27 | 43 | 4 | How to import a DBF file in SQL Server | How can you import a foxpro DBF file in SQL Server?
| sql-server | foxpro | dbf | null | null | null | open | How to import a DBF file in SQL Server
===
How can you import a foxpro DBF file in SQL Server?
| 0 |
52,824 | 09/09/2008 20:26:47 | 5,416 | 09/09/2008 13:41:43 | 11 | 3 | Cross-Branch merging in TFS? | Is it possible to merge to a branch that is not a direct parent or child in TFS? I suspect that the answer is no as this is what I've experienced while using it. However, it seems that at certain times it would be really useful when there are different features being worked on that may have different approval cycles (ie. feature one **might** be approved before feature two). This becomes exceedingly difficult when we have production branches where we have to merge some feature into a previous branch so we can release before the next full version.
What techniques can be used otherwise to mitigate a scenario such as the one(s) described above? | version-control | tfs | branch | null | null | null | open | Cross-Branch merging in TFS?
===
Is it possible to merge to a branch that is not a direct parent or child in TFS? I suspect that the answer is no as this is what I've experienced while using it. However, it seems that at certain times it would be really useful when there are different features being worked on that may have different approval cycles (ie. feature one **might** be approved before feature two). This becomes exceedingly difficult when we have production branches where we have to merge some feature into a previous branch so we can release before the next full version.
What techniques can be used otherwise to mitigate a scenario such as the one(s) described above? | 0 |
52,830 | 09/09/2008 20:29:15 | 4,903 | 09/06/2008 14:16:54 | 199 | 12 | Inform potential clients about security vulnerabilities? | We have a lot of open discussions with potential clients, and they ask frequently about our level of technical expertise, including the scope of work for our current projects. The first thing I do in order to gauge the level of expertise on staff they have now or have previously used is to check for security vulnerabilities like XSS and SQL injection. I have yet to find a potential client who is vulnerable, but I started to wonder, would they actually think this investigation was helpful, or would they think, "um, these guys will trash our site if we don't do business with them." Non-technical folks get scared pretty easily by this stuff, so I'm wondering is this a show of good faith, or a poor business practice? | sql | xss | injection | null | null | null | open | Inform potential clients about security vulnerabilities?
===
We have a lot of open discussions with potential clients, and they ask frequently about our level of technical expertise, including the scope of work for our current projects. The first thing I do in order to gauge the level of expertise on staff they have now or have previously used is to check for security vulnerabilities like XSS and SQL injection. I have yet to find a potential client who is vulnerable, but I started to wonder, would they actually think this investigation was helpful, or would they think, "um, these guys will trash our site if we don't do business with them." Non-technical folks get scared pretty easily by this stuff, so I'm wondering is this a show of good faith, or a poor business practice? | 0 |
52,831 | 09/09/2008 20:29:43 | 5,252 | 09/08/2008 17:54:32 | 76 | 1 | What are the best RSS feeds for software project/program managers? | ENG or RUS Language only. | language-agnostic | project-management | null | null | null | null | open | What are the best RSS feeds for software project/program managers?
===
ENG or RUS Language only. | 0 |
52,842 | 09/09/2008 20:33:41 | 3,043 | 08/26/2008 13:24:14 | 1,561 | 158 | Sorting Directory.GetFiles() | System.IO.Directory.GetFiles() returns a string[]. What is the default sort order for the returned values? I'm assuming by name, but if so how much does the current culture effect it? Can you change it to something like creation date?
**Update:** while MSDN points out that the sort order is not guaranteed for .Net 3.5, but 2.0 version of the page doesn't say anything at all, and neither page will help you sort by thing like creation or modification time. | .net | .net-2.0 | null | null | null | null | open | Sorting Directory.GetFiles()
===
System.IO.Directory.GetFiles() returns a string[]. What is the default sort order for the returned values? I'm assuming by name, but if so how much does the current culture effect it? Can you change it to something like creation date?
**Update:** while MSDN points out that the sort order is not guaranteed for .Net 3.5, but 2.0 version of the page doesn't say anything at all, and neither page will help you sort by thing like creation or modification time. | 0 |
52,844 | 09/09/2008 20:34:02 | 3,051 | 08/26/2008 13:43:22 | 180 | 7 | Hide directories in wxGenericDirCtrl | I am using a wxGenericDirCtrl, and I would like to know if there is a way to hide directories, I'd especially like to hide siblings of parent nodes.
For example if my directory structure looks like this:
+-a
|
+-b
| |
| +-whatever
|
+-c
| |
| +-d
| |
| +-e
| |
| +-f
|
+-g
|
+-whatever
If my currently selected directory is /a/c/d is there any way to hide b and g, so that the tree looks like this in my ctrl:
+-a
|
+-c
|
+-[d]
|
+-e
|
+-f
I'm currently working with a directory structure that has lots and lots directories that are irrelevant to most users, so it would be nice to be able to clean it up.
| wxwidgets | wxpython | null | null | null | null | open | Hide directories in wxGenericDirCtrl
===
I am using a wxGenericDirCtrl, and I would like to know if there is a way to hide directories, I'd especially like to hide siblings of parent nodes.
For example if my directory structure looks like this:
+-a
|
+-b
| |
| +-whatever
|
+-c
| |
| +-d
| |
| +-e
| |
| +-f
|
+-g
|
+-whatever
If my currently selected directory is /a/c/d is there any way to hide b and g, so that the tree looks like this in my ctrl:
+-a
|
+-c
|
+-[d]
|
+-e
|
+-f
I'm currently working with a directory structure that has lots and lots directories that are irrelevant to most users, so it would be nice to be able to clean it up.
| 0 |
52,873 | 09/09/2008 20:50:03 | 2,536 | 08/22/2008 17:37:07 | 756 | 32 | CSS overflow table row positioning | I have table inside a div tab. The table has 40 rows in it and the div's height is set to show 10 rows of that table. CSS's overflow:auto lets me scroll through the 40 rows. All is well there.
How can I, with JavaScript cause the table to programatically position to a given row (ie, programmatically scroll the table up or down by row)?
Thank you
rp | javascript | html | css | table | null | null | open | CSS overflow table row positioning
===
I have table inside a div tab. The table has 40 rows in it and the div's height is set to show 10 rows of that table. CSS's overflow:auto lets me scroll through the 40 rows. All is well there.
How can I, with JavaScript cause the table to programatically position to a given row (ie, programmatically scroll the table up or down by row)?
Thank you
rp | 0 |
52,874 | 09/09/2008 20:50:12 | 338 | 08/04/2008 18:34:44 | 1,160 | 64 | How do you keep the machine awake? | I have a piece of server-ish software written in Java to run on Windows and OS X. I would like the software to signal to the OS to keep the machine awake (prevent it from going into sleep mode) while it is active.
Of course I don't expect there to be a cross platform solution, but I would love to have some very minimal C programs/scripts that my app can spawn to inform the OS to stay awake.
Any ideas? | osx | windows | operating-system | java | crossplatform | null | open | How do you keep the machine awake?
===
I have a piece of server-ish software written in Java to run on Windows and OS X. I would like the software to signal to the OS to keep the machine awake (prevent it from going into sleep mode) while it is active.
Of course I don't expect there to be a cross platform solution, but I would love to have some very minimal C programs/scripts that my app can spawn to inform the OS to stay awake.
Any ideas? | 0 |
52,880 | 09/09/2008 20:53:57 | 383 | 08/05/2008 10:46:37 | 2,657 | 248 | Google Reader API Unread Count | Does Google Reader have an API and if so, how can I get the count of the number of unread posts for a specific user knowing their username and password? | api | google-reader | null | null | null | null | open | Google Reader API Unread Count
===
Does Google Reader have an API and if so, how can I get the count of the number of unread posts for a specific user knowing their username and password? | 0 |
52,883 | 09/09/2008 20:54:55 | 3,146 | 08/27/2008 00:25:15 | 825 | 38 | Graph searching algorithm | I'm looking for a graph algorithm with some unusual properties.
Each edge in the graph is either an "up" edge or a "down" edge.
A valid path can go an indefinite number of "up"'s followed by an indefinite number of "down"'s, or vice versa. However it cannot change direction more than once.
E.g., a valid path might be A "up" B "up" C "down" E "down" F
an invalid path might be A "up" B "down" C "up" D
What is a good algorithm for finding the shortest valid path between two nodes? What about finding all of the equal length shortest paths?
| graph | algorithm | null | null | null | null | open | Graph searching algorithm
===
I'm looking for a graph algorithm with some unusual properties.
Each edge in the graph is either an "up" edge or a "down" edge.
A valid path can go an indefinite number of "up"'s followed by an indefinite number of "down"'s, or vice versa. However it cannot change direction more than once.
E.g., a valid path might be A "up" B "up" C "down" E "down" F
an invalid path might be A "up" B "down" C "up" D
What is a good algorithm for finding the shortest valid path between two nodes? What about finding all of the equal length shortest paths?
| 0 |
52,898 | 09/09/2008 21:02:24 | 5,433 | 09/09/2008 15:02:32 | 13 | 2 | SQL syntax curiousity | I've noticed that Visual Studio 2008 is placing square brackets around column names in sql. Do the brackets offer any advantage? When I hand code T-SQL I've never bothered with them.
Example:
Visual Studio:
SELECT [column1], [column2] etc...
My own way:
SELECT column1, column2 etc...
| sql2005 | syntax | brackets | null | null | null | open | SQL syntax curiousity
===
I've noticed that Visual Studio 2008 is placing square brackets around column names in sql. Do the brackets offer any advantage? When I hand code T-SQL I've never bothered with them.
Example:
Visual Studio:
SELECT [column1], [column2] etc...
My own way:
SELECT column1, column2 etc...
| 0 |
52,917 | 09/09/2008 21:12:45 | 4,615 | 09/04/2008 20:36:16 | 28 | 8 | How do you delete wild card cookies in Rails? | How do you delete a cookie in rails that was set with a wild card domain:
cookies[:foo] = {:value => 'bar', :domain => '.acme.com'}
When, following the docs, you do:
cookies.delete :foo
the logs say
Cookie set: foo=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT
Notice that the domain is missing (it seems to use the default
params for everything). Respecting the RFC, of course the cookie's
still there, Browser -> ctrl/cmd-L ->
javascript:alert(document.cookie);
Voilà!
Q: What's the "correct" way to delete such a cookie?
| ruby-on-rails | null | null | null | null | null | open | How do you delete wild card cookies in Rails?
===
How do you delete a cookie in rails that was set with a wild card domain:
cookies[:foo] = {:value => 'bar', :domain => '.acme.com'}
When, following the docs, you do:
cookies.delete :foo
the logs say
Cookie set: foo=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT
Notice that the domain is missing (it seems to use the default
params for everything). Respecting the RFC, of course the cookie's
still there, Browser -> ctrl/cmd-L ->
javascript:alert(document.cookie);
Voilà!
Q: What's the "correct" way to delete such a cookie?
| 0 |
52,924 | 09/09/2008 21:17:55 | 4,636 | 09/04/2008 22:44:17 | 66 | 5 | Separating CSS deployment from rest of site | Where I work, the design and development departments are totally separated, however we (the design department) are responsible for managing the CSS for our sites. Typically, new CSS needs to be released to the production server far more often than new website code. Because of this, we are deploying the CSS separately, and it lives outside source control.
However, lately, we've run into a few problems with new CSS not being synched for up site releases, and in general the process is a huge headache. I've been pushing to get the CSS under some kind of source control, but having trouble finding a good deployment method that makes everyone happy. Our biggest problem is managing changes that affect current portions of the site, where the CSS changes need to go live before the site changes, but not break anything on the exisiting site.
I won't go into the finer details of the weird culture between designers and devs here, but I was wondering what experience others have had in managing large amounts of CSS (50+ files, thousands and thousands of lines) that needs to be constantly updated and released independent of site releases. | css | design | version-control | project-management | deployment | null | open | Separating CSS deployment from rest of site
===
Where I work, the design and development departments are totally separated, however we (the design department) are responsible for managing the CSS for our sites. Typically, new CSS needs to be released to the production server far more often than new website code. Because of this, we are deploying the CSS separately, and it lives outside source control.
However, lately, we've run into a few problems with new CSS not being synched for up site releases, and in general the process is a huge headache. I've been pushing to get the CSS under some kind of source control, but having trouble finding a good deployment method that makes everyone happy. Our biggest problem is managing changes that affect current portions of the site, where the CSS changes need to go live before the site changes, but not break anything on the exisiting site.
I won't go into the finer details of the weird culture between designers and devs here, but I was wondering what experience others have had in managing large amounts of CSS (50+ files, thousands and thousands of lines) that needs to be constantly updated and released independent of site releases. | 0 |
52,926 | 09/09/2008 21:19:41 | 2,025 | 08/19/2008 20:59:50 | 1,572 | 136 | Beginning C# | On recommendation I've decided to learn C# as my first desktop language. I've a good experience with PHP and MySQL under my belt but I'm completely new to desktop programming.
What I'm looking for is a good introductory tutorial into C# from the perspective of a new programmer. For example I've never done any memory management in PHP and I assume I'll need to in C#. If you could recommend any websites (I assume I'll be using MSDN a lot). I learn well from books if there are any specially good ones too.
Thanks | c# | null | null | null | null | null | open | Beginning C#
===
On recommendation I've decided to learn C# as my first desktop language. I've a good experience with PHP and MySQL under my belt but I'm completely new to desktop programming.
What I'm looking for is a good introductory tutorial into C# from the perspective of a new programmer. For example I've never done any memory management in PHP and I assume I'll need to in C#. If you could recommend any websites (I assume I'll be using MSDN a lot). I learn well from books if there are any specially good ones too.
Thanks | 0 |
52,927 | 09/09/2008 21:19:44 | 4,593 | 09/04/2008 19:05:18 | 21 | 4 | Console.WriteLine and generic List | I frequently find myself writing code like this:
List<int> list = new List<int> { 1, 3, 5 };
foreach (int i in list) {
Console.Write("{0}\t", i.ToString()); }
Console.WriteLine();
Better would be something like this:
List<int> list = new List<int> { 1, 3, 5 };
Console.WriteLine("{0}\t", list);
I suspect there's some clever way of doing this, but I don't see it. Does anybody have a better solution than the first block? | c# | list | generics | console | null | null | open | Console.WriteLine and generic List
===
I frequently find myself writing code like this:
List<int> list = new List<int> { 1, 3, 5 };
foreach (int i in list) {
Console.Write("{0}\t", i.ToString()); }
Console.WriteLine();
Better would be something like this:
List<int> list = new List<int> { 1, 3, 5 };
Console.WriteLine("{0}\t", list);
I suspect there's some clever way of doing this, but I don't see it. Does anybody have a better solution than the first block? | 0 |
52,931 | 09/09/2008 21:19:53 | 4,933 | 09/06/2008 18:57:56 | 11 | 4 | Open Source Actionscript 3 or Javascript date utility classes? | I was wondering if anyone could point to an Open Source date utility class that is fairly robust. I find myself rolling my own when I want to do a lot of things I take for granted in C# and Java. For instance I did find a decent example of a DateDiff() function that I tore apart and another DatePart() function. Another examples would be parsing different date/time formats. I'm trying to avoid reinventing something if it's already built.
Another possibility may be a nice set of Javascript files that I can convert to ActionScript 3. So far I've found [DateJS][1] but I want to get a good idea of what is out there.
[1]: http://www.datejs.com | javascript | flex | actionscript-3 | null | null | null | open | Open Source Actionscript 3 or Javascript date utility classes?
===
I was wondering if anyone could point to an Open Source date utility class that is fairly robust. I find myself rolling my own when I want to do a lot of things I take for granted in C# and Java. For instance I did find a decent example of a DateDiff() function that I tore apart and another DatePart() function. Another examples would be parsing different date/time formats. I'm trying to avoid reinventing something if it's already built.
Another possibility may be a nice set of Javascript files that I can convert to ActionScript 3. So far I've found [DateJS][1] but I want to get a good idea of what is out there.
[1]: http://www.datejs.com | 0 |
52,933 | 09/09/2008 21:20:38 | 1,228 | 08/13/2008 13:58:55 | 1,388 | 106 | How can I modify a Work Item type to include additional information in TFS? | TFS2008. I'd like to track task points on a Task work item, but there isn't anywhere (other than the description) to record this. I'd like to add a dropdown with 0, 1, 2, 3, 5, 8, etc, so these task points can be exported in reports. | teamfoundationserver | workitem | null | null | null | null | open | How can I modify a Work Item type to include additional information in TFS?
===
TFS2008. I'd like to track task points on a Task work item, but there isn't anywhere (other than the description) to record this. I'd like to add a dropdown with 0, 1, 2, 3, 5, 8, etc, so these task points can be exported in reports. | 0 |
52,945 | 09/09/2008 21:23:46 | 1,228 | 08/13/2008 13:58:55 | 1,388 | 106 | Best way to search data stored as XML in Sql Server? | Say I have data structures stored as XML (XML data type) within Sql Server. A user wishes to pull out a record if, within the data, a certain string is found.
What are my options for implementing this, and which is the best way to do it?
Note that each record can have different XML data structures | sql-server | xml | search | null | null | null | open | Best way to search data stored as XML in Sql Server?
===
Say I have data structures stored as XML (XML data type) within Sql Server. A user wishes to pull out a record if, within the data, a certain string is found.
What are my options for implementing this, and which is the best way to do it?
Note that each record can have different XML data structures | 0 |
52,950 | 09/09/2008 21:24:53 | 3,146 | 08/27/2008 00:25:15 | 830 | 39 | How to make git ignore changes in case? | I'm not too sure what is going on here, but sometimes a particular file in my repository will change the case of it's name. e.g.,:
before:
File.h
after:
file.h
I don't really care why this is happening, but this causes git to think it is a new file, and then I have to go and change the file name back. Can you just make git ignore case changes? | git | windows | null | null | null | null | open | How to make git ignore changes in case?
===
I'm not too sure what is going on here, but sometimes a particular file in my repository will change the case of it's name. e.g.,:
before:
File.h
after:
file.h
I don't really care why this is happening, but this causes git to think it is a new file, and then I have to go and change the file name back. Can you just make git ignore case changes? | 0 |
52,952 | 09/09/2008 21:25:43 | 4,541 | 09/04/2008 17:37:04 | 159 | 3 | Detecting if an IDataReader contains a certain field before iteration. | So I'm using an IDataReader to hydrate some business objects, but I don't know at runtime exactly what fields will be in the reader. Any fields that aren't in the reader would be left null on the resulting object. How do you test if a reader contains a specific field without just wrapping it in a try/catch? | c# | null | null | null | null | null | open | Detecting if an IDataReader contains a certain field before iteration.
===
So I'm using an IDataReader to hydrate some business objects, but I don't know at runtime exactly what fields will be in the reader. Any fields that aren't in the reader would be left null on the resulting object. How do you test if a reader contains a specific field without just wrapping it in a try/catch? | 0 |
52,954 | 09/09/2008 21:26:33 | 5,118 | 09/08/2008 00:23:26 | 4 | 1 | How do I get javadoc to link to the Java API using an Ant task? | Right now my ant task looks like.
<javadoc sourcepath="${source}" destdir="${doc}">
<link href="http://java.sun.com/j2se/1.5.0/docs/api/" />
</javadoc>
And I'm getting this warning:
javadoc: warning - Error fetching URL: http://java.sun.com/j2se/1.5.0/docs/api/package-list
How do I get the javadoc to properly link to the API? I am behind a proxy. | ant | javadoc | null | null | null | null | open | How do I get javadoc to link to the Java API using an Ant task?
===
Right now my ant task looks like.
<javadoc sourcepath="${source}" destdir="${doc}">
<link href="http://java.sun.com/j2se/1.5.0/docs/api/" />
</javadoc>
And I'm getting this warning:
javadoc: warning - Error fetching URL: http://java.sun.com/j2se/1.5.0/docs/api/package-list
How do I get the javadoc to properly link to the API? I am behind a proxy. | 0 |
52,964 | 09/09/2008 21:31:07 | 5,466 | 09/09/2008 20:38:17 | 11 | 1 | SQL Server Random Sort | What is the best way to sort the results of a sql query into a random order within a stored procedure? | sql-server | null | null | null | null | null | open | SQL Server Random Sort
===
What is the best way to sort the results of a sql query into a random order within a stored procedure? | 0 |
52,965 | 09/09/2008 21:31:12 | 2,701 | 08/24/2008 15:51:24 | 286 | 21 | Is business logic subjective? | I have a team lead who seems to think that business logic is very subjective, to the point that if my stored procedure has a "WHERE ID = @ID" -- he would call this *business logic*
What approach should I take to define *business logic* in a very objective way without offending my team lead? | business-logic | null | null | null | null | null | open | Is business logic subjective?
===
I have a team lead who seems to think that business logic is very subjective, to the point that if my stored procedure has a "WHERE ID = @ID" -- he would call this *business logic*
What approach should I take to define *business logic* in a very objective way without offending my team lead? | 0 |
52,981 | 09/09/2008 21:36:35 | 122 | 08/02/2008 07:56:07 | 4,144 | 191 | Cannot delete from the database...? | So, I have 2 database instances, one is for development in general, another was copied from development for unit tests.
Something changed in the development database that I can't figure out, and I don't know how to see what is different.
When I try to delete from a particular table, with for example:
delete from myschema.mytable where id = 555
I get the following normal response from the unit test DB indicating no row was deleted:
> SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result of a query is an empty table. SQLSTATE=02000
However, the development database fails to delete at all with the following error:
> DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0440N No authorized routine named "=" of type "FUNCTION" having compatible arguments was found. SQLSTATE=42884
My best guess is there is some trigger or view that was added or changed that is causing the problem, but I have no idea how to go about finding the problem... has anyone had this problem or know how to figure out what the root of the problem is?
(note that this is a DB2 database) | database | db2 | null | null | null | null | open | Cannot delete from the database...?
===
So, I have 2 database instances, one is for development in general, another was copied from development for unit tests.
Something changed in the development database that I can't figure out, and I don't know how to see what is different.
When I try to delete from a particular table, with for example:
delete from myschema.mytable where id = 555
I get the following normal response from the unit test DB indicating no row was deleted:
> SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result of a query is an empty table. SQLSTATE=02000
However, the development database fails to delete at all with the following error:
> DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0440N No authorized routine named "=" of type "FUNCTION" having compatible arguments was found. SQLSTATE=42884
My best guess is there is some trigger or view that was added or changed that is causing the problem, but I have no idea how to go about finding the problem... has anyone had this problem or know how to figure out what the root of the problem is?
(note that this is a DB2 database) | 0 |
52,984 | 09/09/2008 21:37:43 | 5,118 | 09/08/2008 00:23:26 | 4 | 1 | How do I generate Emma code coverage reports using Ant? | How do I setup an Ant task to generate [Emma](http://emma.sourceforge.net) code coverage reports? | ant | code-analysis | emma | null | null | null | open | How do I generate Emma code coverage reports using Ant?
===
How do I setup an Ant task to generate [Emma](http://emma.sourceforge.net) code coverage reports? | 0 |
52,989 | 09/09/2008 21:43:55 | 4,160 | 09/02/2008 07:15:12 | 123 | 2 | Using generic classes with ObjectDataSource | I have a generic Repository<T> class I want to use with an ObjectDataSource. Repository<T> lives in a separate project called DataAccess. According to <a href="http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/767f1a821d9b23da/b1e045958ae427a5?lnk=st#b1e045958ae427a5">this post from the MS newsgroups</a> (relevant part copied below):
>Internally, the ObjectDataSource is calling Type.GetType(string) to get the
type, so we need to follow the guideline documented in Type.GetType on how
to get type using generics. You can refer to MSDN Library on Type.GetType:
><http://msdn2.microsoft.com/en-us/library/w3f99sx1.aspx>
>From the document, you will learn that you need to use backtick (`) to
denotes the type name which is using generics.
>Also, here we must specify the assembly name in the type name string.
>So, for your question, the answer is to use type name like follows:
>TypeName="TestObjectDataSourceAssembly.MyDataHandler`1[System.String],TestObjectDataSourceAssembly"
Okay, makes sense. When I try it, however, the page throws an exception:
<asp:ObjectDataSource ID="MyDataSource" TypeName="MyProject.Repository`1[MyProject.MessageCategory],DataAccess" />
>[InvalidOperationException: The type specified in the TypeName property of ObjectDataSource 'MyDataSource' could not be found.]
The curious thing is that this only happens when I'm viewing the page. When I open the "Configure Data Source" dialog from the VS2008 designer, it properly show me the methods on my generic Repository class. Passing the TypeName string to Type.GetType() while debugging also returns a valid type. So what gives? | asp.net | generics | objectdatasource | null | null | null | open | Using generic classes with ObjectDataSource
===
I have a generic Repository<T> class I want to use with an ObjectDataSource. Repository<T> lives in a separate project called DataAccess. According to <a href="http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/767f1a821d9b23da/b1e045958ae427a5?lnk=st#b1e045958ae427a5">this post from the MS newsgroups</a> (relevant part copied below):
>Internally, the ObjectDataSource is calling Type.GetType(string) to get the
type, so we need to follow the guideline documented in Type.GetType on how
to get type using generics. You can refer to MSDN Library on Type.GetType:
><http://msdn2.microsoft.com/en-us/library/w3f99sx1.aspx>
>From the document, you will learn that you need to use backtick (`) to
denotes the type name which is using generics.
>Also, here we must specify the assembly name in the type name string.
>So, for your question, the answer is to use type name like follows:
>TypeName="TestObjectDataSourceAssembly.MyDataHandler`1[System.String],TestObjectDataSourceAssembly"
Okay, makes sense. When I try it, however, the page throws an exception:
<asp:ObjectDataSource ID="MyDataSource" TypeName="MyProject.Repository`1[MyProject.MessageCategory],DataAccess" />
>[InvalidOperationException: The type specified in the TypeName property of ObjectDataSource 'MyDataSource' could not be found.]
The curious thing is that this only happens when I'm viewing the page. When I open the "Configure Data Source" dialog from the VS2008 designer, it properly show me the methods on my generic Repository class. Passing the TypeName string to Type.GetType() while debugging also returns a valid type. So what gives? | 0 |
53,002 | 09/09/2008 21:56:27 | 5,473 | 09/09/2008 21:20:03 | 1 | 0 | How do I create tri-state checkboxes with a TreeView control in .NET? | I have a treeview control with checkboxes turned on. Because the treeview control has nested nodes, I need the checkboxes to be able to have some sort of tri-mode selection. I can't find a way to do this (I can only have the checkboxes fully checked or unchecked). | vb.net | null | null | null | null | null | open | How do I create tri-state checkboxes with a TreeView control in .NET?
===
I have a treeview control with checkboxes turned on. Because the treeview control has nested nodes, I need the checkboxes to be able to have some sort of tri-mode selection. I can't find a way to do this (I can only have the checkboxes fully checked or unchecked). | 0 |
53,012 | 09/09/2008 22:04:02 | 4,308 | 09/02/2008 19:27:46 | 43 | 3 | Algorithm to decide if digital audio data is clipping? | Is there an algorithm or some heuristic to decide whether digital audio data is [clipping][1]?
[1]: http://en.wikipedia.org/wiki/Clipping_(audio)#Digital_clipping | algorithm | audio | heuristics | null | null | null | open | Algorithm to decide if digital audio data is clipping?
===
Is there an algorithm or some heuristic to decide whether digital audio data is [clipping][1]?
[1]: http://en.wikipedia.org/wiki/Clipping_(audio)#Digital_clipping | 0 |
53,019 | 09/09/2008 22:10:43 | 4,298 | 09/02/2008 18:17:28 | 12 | 0 | What kind of technologies are available for sending text messages? | I'm looking into sending regular automated text-messages to a list of subscribed users. Having played with Windows Mobile devices, I could easily implement this using the compact .Net framework + a device hooked up to usb and send the messages through this. I would like to explore other solutions like having a server or something similar to do this. I just have no idea what is involved in such a system. | c# | mobile | messaging | null | null | null | open | What kind of technologies are available for sending text messages?
===
I'm looking into sending regular automated text-messages to a list of subscribed users. Having played with Windows Mobile devices, I could easily implement this using the compact .Net framework + a device hooked up to usb and send the messages through this. I would like to explore other solutions like having a server or something similar to do this. I just have no idea what is involved in such a system. | 0 |
53,025 | 09/09/2008 22:13:54 | 4,111 | 09/01/2008 20:34:03 | 98 | 12 | Best way to implement 1:1 asynchronous callbacks/events in ActionScript 3 / Flex? | I've been utilizing the [command pattern][1] in my Flex projects, with asynchronous callback routes required between:
- whoever instantiated a given command object and the command object,
- the command object and the "data access" object (i.e. someone who handles the remote procedure calls over the network to the servers) that the command object calls.
Each of these two callback routes has to be able to be a one-to-one relationship. This is due to the fact that I might have several instances of a given command class running the exact same job at the same time but with slightly different parameters, and I don't want their callbacks getting mixed up. Using events, the default way of handling asynchronicity in AS3, is thus pretty much out since they're inherently based on one-to-many relationships.
Currently I have done this using **callback function references** with specific kinds of signatures, but I was wondering *if someone knew of a better (or an alternative) way?*
Here's an example to illustrate my current method:
- I might have a view object that spawns a `DeleteObjectCommand` instance due to some user action, passing references to two of its own private member functions (one for success, one for failure: let's say `"deleteObjectSuccessHandler()"` and `"deleteObjectFailureHandler()"` in this example) as callback function references to the command class's constructor.
- Then the command object would repeat this pattern with its connection to the "data access" object.
- When the RPC over the network has successfully been completed (or has failed), the appropriate callback functions are called, first by the "data access" object and then the command object, so that finally the view object that instantiated the operation in the first place gets notified by having its `deleteObjectSuccessHandler()` or `deleteObjectFailureHandler()` called.
[1]: http://en.wikipedia.org/wiki/Command_pattern | actionscript-3 | flex | asynchronous | null | null | null | open | Best way to implement 1:1 asynchronous callbacks/events in ActionScript 3 / Flex?
===
I've been utilizing the [command pattern][1] in my Flex projects, with asynchronous callback routes required between:
- whoever instantiated a given command object and the command object,
- the command object and the "data access" object (i.e. someone who handles the remote procedure calls over the network to the servers) that the command object calls.
Each of these two callback routes has to be able to be a one-to-one relationship. This is due to the fact that I might have several instances of a given command class running the exact same job at the same time but with slightly different parameters, and I don't want their callbacks getting mixed up. Using events, the default way of handling asynchronicity in AS3, is thus pretty much out since they're inherently based on one-to-many relationships.
Currently I have done this using **callback function references** with specific kinds of signatures, but I was wondering *if someone knew of a better (or an alternative) way?*
Here's an example to illustrate my current method:
- I might have a view object that spawns a `DeleteObjectCommand` instance due to some user action, passing references to two of its own private member functions (one for success, one for failure: let's say `"deleteObjectSuccessHandler()"` and `"deleteObjectFailureHandler()"` in this example) as callback function references to the command class's constructor.
- Then the command object would repeat this pattern with its connection to the "data access" object.
- When the RPC over the network has successfully been completed (or has failed), the appropriate callback functions are called, first by the "data access" object and then the command object, so that finally the view object that instantiated the operation in the first place gets notified by having its `deleteObjectSuccessHandler()` or `deleteObjectFailureHandler()` called.
[1]: http://en.wikipedia.org/wiki/Command_pattern | 0 |
53,026 | 09/09/2008 22:14:25 | 1,363 | 08/14/2008 18:24:19 | 136 | 4 | How to easily edit SQL XML column in SQL Management Studio | I have a table with an XML column. This column is storing some values I keep for configuring my application. I created it to have a more flexible schema.
I can't find a way to update this column directly from the table view in SQL Management Studio. Other (INT or Varchar for example) columns are editable. I know I can write an UPDATE statement or create some code to update it. But I'm looking for something more flexible that will let power users edit the XML directly.
Any ideas? | sql | xml | null | null | null | null | open | How to easily edit SQL XML column in SQL Management Studio
===
I have a table with an XML column. This column is storing some values I keep for configuring my application. I created it to have a more flexible schema.
I can't find a way to update this column directly from the table view in SQL Management Studio. Other (INT or Varchar for example) columns are editable. I know I can write an UPDATE statement or create some code to update it. But I'm looking for something more flexible that will let power users edit the XML directly.
Any ideas? | 0 |
53,027 | 09/09/2008 22:15:09 | 1,384,652 | 08/01/2008 12:01:23 | 1,914 | 83 | Large Python Includes | I have a file that I want to include in Python but the included file is fairly long and it'd be much neater to be able to split them into several files but then I have to use several include statements.
Is there some way to group together several files and include all at once? | python | null | null | null | null | null | open | Large Python Includes
===
I have a file that I want to include in Python but the included file is fairly long and it'd be much neater to be able to split them into several files but then I have to use several include statements.
Is there some way to group together several files and include all at once? | 0 |
53,041 | 09/09/2008 22:23:36 | 1,965 | 08/19/2008 15:51:08 | 3,738 | 220 | GUID's in a SLN file | Visual Studio Solution files contain two GUID's per project entry. I figure one of them is from the AssemblyInfo.cs
Does anyone know for sure where these come from, and what they are used for? | .net | visual-studio | sln | null | null | null | open | GUID's in a SLN file
===
Visual Studio Solution files contain two GUID's per project entry. I figure one of them is from the AssemblyInfo.cs
Does anyone know for sure where these come from, and what they are used for? | 0 |
53,045 | 09/09/2008 22:26:28 | 5,236 | 09/08/2008 16:36:03 | 11 | 2 | linq to sql stack overflow with self-referencing entity | I have an entity that contains many of itself, how do I map this in LINQ to SQl such that it does not do an infinite loop of getting e1 then all its children then their parents (e1) then its children and repeat? Now I know I can do this if I set the child property to false, however that is the most important property (don't really care about the parent). Is there a way to have it do lazy loading? Would that even fix it? | linq-to-sql | lazy-loading | null | null | null | null | open | linq to sql stack overflow with self-referencing entity
===
I have an entity that contains many of itself, how do I map this in LINQ to SQl such that it does not do an infinite loop of getting e1 then all its children then their parents (e1) then its children and repeat? Now I know I can do this if I set the child property to false, however that is the most important property (don't really care about the parent). Is there a way to have it do lazy loading? Would that even fix it? | 0 |
53,046 | 09/09/2008 22:27:11 | 4,883 | 09/06/2008 10:24:59 | 452 | 5 | How do you get double-underscores to display in markdown? | In python, there are some special variables and filenames that are surrounded by double-underscores. For example, there is the
__file__
variable. I am only able to get them to show up correctly inside of a code block. What do I need to enter to get double underscores in regular text without having them interpreted as an emphasis? | markdown | null | null | null | null | null | open | How do you get double-underscores to display in markdown?
===
In python, there are some special variables and filenames that are surrounded by double-underscores. For example, there is the
__file__
variable. I am only able to get them to show up correctly inside of a code block. What do I need to enter to get double underscores in regular text without having them interpreted as an emphasis? | 0 |
53,057 | 09/09/2008 22:36:35 | 31,505 | 2008-09-01 | 1,416 | 40 | How to add a dll to gac in vista | When I drag & drop a dll to the assembly folder on vista, I get the error "Access is denied: mydll.dll". How can I bypass the error message and add my dll to gac? | windows-vista | gac | null | null | null | null | open | How to add a dll to gac in vista
===
When I drag & drop a dll to the assembly folder on vista, I get the error "Access is denied: mydll.dll". How can I bypass the error message and add my dll to gac? | 0 |
53,064 | 09/09/2008 22:39:58 | 5,234 | 09/08/2008 16:25:48 | 1 | 0 | Embed asp page without iframe | I want to embed an .asp page on an html page. I cannot use an iframe. I tried:
<object width="100%" height="1500" type="text/html" data="url.asp">
alt : <a href="url.asp">url</a>
</object>"
works great in ff but not ie7. Any ideas? | asp.net | iframe | null | null | null | null | open | Embed asp page without iframe
===
I want to embed an .asp page on an html page. I cannot use an iframe. I tried:
<object width="100%" height="1500" type="text/html" data="url.asp">
alt : <a href="url.asp">url</a>
</object>"
works great in ff but not ie7. Any ideas? | 0 |
53,065 | 09/09/2008 22:40:00 | 2,701 | 08/24/2008 15:51:24 | 291 | 22 | Enterprise Library Application Blocks OR Home Grown Framework? | We are currently looking to adopt some type of "standard" developer framework and have looked into using the Enterprise Library. Would you recommend using these blocks as the foundation for software development, or should we do something *home grown*? | framework | enterprise-library | null | null | null | null | open | Enterprise Library Application Blocks OR Home Grown Framework?
===
We are currently looking to adopt some type of "standard" developer framework and have looked into using the Enterprise Library. Would you recommend using these blocks as the foundation for software development, or should we do something *home grown*? | 0 |
53,069 | 09/09/2008 22:43:57 | 4,872 | 09/06/2008 09:14:55 | 68 | 2 | In SQL Server, how do I identify *all* dependencies for a specific table using system tables/views? | I am writing a DDL script to drop a number of tables but need to identify all dependencies for those tables first. Those dependencies include foreign key constraints, stored procedures, views, etc. Preferably, I want to programmatically script out dropping those dependencies using the system tables/views before dropping the dependent table. | sql-server | database | mssql | scripting | null | null | open | In SQL Server, how do I identify *all* dependencies for a specific table using system tables/views?
===
I am writing a DDL script to drop a number of tables but need to identify all dependencies for those tables first. Those dependencies include foreign key constraints, stored procedures, views, etc. Preferably, I want to programmatically script out dropping those dependencies using the system tables/views before dropping the dependent table. | 0 |
53,070 | 09/09/2008 22:44:05 | 2,701 | 08/24/2008 15:51:24 | 291 | 22 | Examples for coding against the PayPal API in .NET 2.0+? | Can anyone point me to a good introduction to coding against the paypal API? | .net | asp.net | paypal | null | null | null | open | Examples for coding against the PayPal API in .NET 2.0+?
===
Can anyone point me to a good introduction to coding against the paypal API? | 0 |
53,081 | 09/09/2008 22:51:25 | 1,897 | 08/19/2008 07:54:49 | 223 | 31 | HTML meta keyword/description element, useful or not? | Does filling out HTML meta description/keyword tags matter for SEO? | html | seo | null | null | null | null | open | HTML meta keyword/description element, useful or not?
===
Does filling out HTML meta description/keyword tags matter for SEO? | 0 |
53,086 | 09/09/2008 22:52:32 | 1,368 | 08/14/2008 18:57:47 | 153 | 10 | Can I depend on the values of GetHashCode() to be consistant? | Is the return value of GetHashCode() guaranteed to be consistent assuming the same string value is being used? (C#/ASP.NET)
I uploaded my code to a server today and to my surprise I had to reindex some data because my server (win2008 64-bit) was returning different values compared to my desktop computer. | hash | c# | null | null | null | null | open | Can I depend on the values of GetHashCode() to be consistant?
===
Is the return value of GetHashCode() guaranteed to be consistent assuming the same string value is being used? (C#/ASP.NET)
I uploaded my code to a server today and to my surprise I had to reindex some data because my server (win2008 64-bit) was returning different values compared to my desktop computer. | 0 |
53,102 | 09/09/2008 23:05:06 | 3,798 | 08/30/2008 22:09:59 | 207 | 15 | Why Does Path.Combine not properly concatenate filenames that start with Path.DirectorySeparatorChar | In the Immediate Window
? System.IO.Path.Combine(@"C:\test",@"test")
"C:\\test\\test"
? System.IO.Path.Combine(@"C:\test",@"\test")
"\\test"
It seems that they should both be the same.
The old FileSystemObject.BuildPath() didn't work this way...
| c# | .net | null | null | null | null | open | Why Does Path.Combine not properly concatenate filenames that start with Path.DirectorySeparatorChar
===
In the Immediate Window
? System.IO.Path.Combine(@"C:\test",@"test")
"C:\\test\\test"
? System.IO.Path.Combine(@"C:\test",@"\test")
"\\test"
It seems that they should both be the same.
The old FileSystemObject.BuildPath() didn't work this way...
| 0 |
53,108 | 09/09/2008 23:08:24 | 5,324 | 09/09/2008 06:49:51 | 11 | 1 | Is it possible to make a recursive SQL query ? | I have a table similar to this:
CREATE TABLE example (
id integer primary key,
name char(200),
parentid integer,
value integer);
I can use the parentid field to arrange data into a tree structure.
Now here's the bit I can't work out. Given a parentid, is it possible to write an SQL statement to add up all the value fields under that parentid and recurse down the branch of the tree ?
| sql | null | null | null | null | null | open | Is it possible to make a recursive SQL query ?
===
I have a table similar to this:
CREATE TABLE example (
id integer primary key,
name char(200),
parentid integer,
value integer);
I can use the parentid field to arrange data into a tree structure.
Now here's the bit I can't work out. Given a parentid, is it possible to write an SQL statement to add up all the value fields under that parentid and recurse down the branch of the tree ?
| 0 |
53,112 | 09/09/2008 23:09:10 | 277 | 08/04/2008 10:55:22 | 513 | 18 | Good Ways to Use Source Control and an IDE for Plugin Code? | What are good ways of dealing with the issues surrounding plugin code that interacts with outside system?
To give a concrete and representative example, suppose I would like to use Subversion and Eclipse to develop plugins for WordPress. The main code body of WordPress is installed on the webserver, and the plugin code needs to be available in a subdirectory of that server.
I could see how you could simply checkout a copy of your code directly under the web directory on a development machine, but how would you also then integrate this with the IDE?
I am making the assumption here that all the code for the plugin is located under a single directory.
Do most people just add the plugin as a project in an IDE and then place the working folder for the project wherever the 'main' software system wants it to be? Or do people use some kind of symlinks to their home directory? | ide | plugin-development | null | null | null | null | open | Good Ways to Use Source Control and an IDE for Plugin Code?
===
What are good ways of dealing with the issues surrounding plugin code that interacts with outside system?
To give a concrete and representative example, suppose I would like to use Subversion and Eclipse to develop plugins for WordPress. The main code body of WordPress is installed on the webserver, and the plugin code needs to be available in a subdirectory of that server.
I could see how you could simply checkout a copy of your code directly under the web directory on a development machine, but how would you also then integrate this with the IDE?
I am making the assumption here that all the code for the plugin is located under a single directory.
Do most people just add the plugin as a project in an IDE and then place the working folder for the project wherever the 'main' software system wants it to be? Or do people use some kind of symlinks to their home directory? | 0 |
53,128 | 09/09/2008 23:22:23 | 3,147 | 08/27/2008 01:00:22 | 80 | 12 | Java ConnectionPool connection not closing, stuck in 'sleep' | I have a webapp that uses JNDI lookups to get a connection to the database.
The connection works fine and returns the query no problems. The issue us that the connection does not close properly and is stuck in the 'sleep' mode (according to mysql administrator). This means that they become unusable nad then I run out of connections.
Can someone give me a few pointers as to what I can do to make the connection return to the pool successfully.
public class DatabaseBean {
private static final Logger logger = Logger.getLogger(DatabaseBean.class);
private Connection conn;
private PreparedStatement prepStmt;
/**
* Zero argument constructor
* Setup generic databse connection in here to avoid redundancy
* The connection details are in /META-INF/context.xml
*/
public DatabaseBean() {
try {
InitialContext initContext = new InitialContext();
DataSource ds = (DataSource) initContext.lookup("java:/comp/env/jdbc/mysite");
conn = ds.getConnection();
}
catch (SQLException SQLEx) {
logger.fatal("There was a problem with the database connection.");
logger.fatal(SQLEx);
logger.fatal(SQLEx.getCause());
}
catch (NamingException nameEx) {
logger.fatal("There was a naming exception");
logger.fatal(nameEx);
logger.fatal(nameEx.getCause());
}
}
/**
* Execute a query. Do not use for statements (update delete insert etc).
*
* @return A ResultSet of the execute query. A set of size zero if no results were returned. It is never null.
* @see #executeUpdate() for running update, insert delete etc.
*/
public ResultSet executeQuery() {
ResultSet result = null;
try {
result = prepStmt.executeQuery();
logger.debug(prepStmt.toString());
}
catch (SQLException SQLEx) {
logger.fatal("There was an error running a query");
logger.fatal(SQLEx);
}
return result;
}
*SNIP*
public void close() {
try {
prepStmt.close();
prepStmt = null;
conn.close();
conn = null;
} catch (SQLException SQLEx) {
logger.warn("There was an error closing the database connection.");
}
}
}
This is inside a javabean that uses the database connection.
public LinkedList<ImportantNoticeBean> getImportantNotices() {
DatabaseBean noticesDBBean = new DatabaseBean();
LinkedList<ImportantNoticeBean> listOfNotices = new LinkedList<ImportantNoticeBean>();
try {
PreparedStatement preStmt = noticesDBBean.getConn().prepareStatement("SELECT pseudonym, message, date_to, date_from " +
"FROM importantnotices, users " +
"WHERE importantnotices.username = users.username " +
"AND NOW() >= date_from AND NOW() <= date_to;");
noticesDBBean.setPrepStmt(preStmt);
ResultSet result = noticesDBBean.executeQuery();
while (result.next()) {
ImportantNoticeBean noticeBean = new ImportantNoticeBean();
noticeBean.setAuthor(result.getString("pseudonym"));
noticeBean.setMessage(result.getString("message"));
noticeBean.setDateTo(result.getDate("date_to"));
noticeBean.setDateFrom(result.getDate("date_from"));
listOfNotices.add(noticeBean);
}
result.close();
} catch (SQLException SQLEx) {
logger.error("There was an error in ImportantNoticesBean.getImportantNotices()");
logger.error(SQLEx);
} finally {
noticesDBBean.close();
}
return listOfNotices;
}
<Context reloadable="true">
<Resource name="jdbc/mysite"
auth="Container"
type="javax.sql.DataSource"
username="user"
password="password"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/mysite"
maxActive="10"
maxIdle="5"
maxWait="6000"
removeAbandoned="true"
logAbandoned="false"
removeAbandonedTimeout="20"
/>
</Context> | java | database | tomcat | null | null | null | open | Java ConnectionPool connection not closing, stuck in 'sleep'
===
I have a webapp that uses JNDI lookups to get a connection to the database.
The connection works fine and returns the query no problems. The issue us that the connection does not close properly and is stuck in the 'sleep' mode (according to mysql administrator). This means that they become unusable nad then I run out of connections.
Can someone give me a few pointers as to what I can do to make the connection return to the pool successfully.
public class DatabaseBean {
private static final Logger logger = Logger.getLogger(DatabaseBean.class);
private Connection conn;
private PreparedStatement prepStmt;
/**
* Zero argument constructor
* Setup generic databse connection in here to avoid redundancy
* The connection details are in /META-INF/context.xml
*/
public DatabaseBean() {
try {
InitialContext initContext = new InitialContext();
DataSource ds = (DataSource) initContext.lookup("java:/comp/env/jdbc/mysite");
conn = ds.getConnection();
}
catch (SQLException SQLEx) {
logger.fatal("There was a problem with the database connection.");
logger.fatal(SQLEx);
logger.fatal(SQLEx.getCause());
}
catch (NamingException nameEx) {
logger.fatal("There was a naming exception");
logger.fatal(nameEx);
logger.fatal(nameEx.getCause());
}
}
/**
* Execute a query. Do not use for statements (update delete insert etc).
*
* @return A ResultSet of the execute query. A set of size zero if no results were returned. It is never null.
* @see #executeUpdate() for running update, insert delete etc.
*/
public ResultSet executeQuery() {
ResultSet result = null;
try {
result = prepStmt.executeQuery();
logger.debug(prepStmt.toString());
}
catch (SQLException SQLEx) {
logger.fatal("There was an error running a query");
logger.fatal(SQLEx);
}
return result;
}
*SNIP*
public void close() {
try {
prepStmt.close();
prepStmt = null;
conn.close();
conn = null;
} catch (SQLException SQLEx) {
logger.warn("There was an error closing the database connection.");
}
}
}
This is inside a javabean that uses the database connection.
public LinkedList<ImportantNoticeBean> getImportantNotices() {
DatabaseBean noticesDBBean = new DatabaseBean();
LinkedList<ImportantNoticeBean> listOfNotices = new LinkedList<ImportantNoticeBean>();
try {
PreparedStatement preStmt = noticesDBBean.getConn().prepareStatement("SELECT pseudonym, message, date_to, date_from " +
"FROM importantnotices, users " +
"WHERE importantnotices.username = users.username " +
"AND NOW() >= date_from AND NOW() <= date_to;");
noticesDBBean.setPrepStmt(preStmt);
ResultSet result = noticesDBBean.executeQuery();
while (result.next()) {
ImportantNoticeBean noticeBean = new ImportantNoticeBean();
noticeBean.setAuthor(result.getString("pseudonym"));
noticeBean.setMessage(result.getString("message"));
noticeBean.setDateTo(result.getDate("date_to"));
noticeBean.setDateFrom(result.getDate("date_from"));
listOfNotices.add(noticeBean);
}
result.close();
} catch (SQLException SQLEx) {
logger.error("There was an error in ImportantNoticesBean.getImportantNotices()");
logger.error(SQLEx);
} finally {
noticesDBBean.close();
}
return listOfNotices;
}
<Context reloadable="true">
<Resource name="jdbc/mysite"
auth="Container"
type="javax.sql.DataSource"
username="user"
password="password"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/mysite"
maxActive="10"
maxIdle="5"
maxWait="6000"
removeAbandoned="true"
logAbandoned="false"
removeAbandonedTimeout="20"
/>
</Context> | 0 |
53,132 | 09/09/2008 23:26:19 | 1,196 | 08/13/2008 12:33:04 | 2,897 | 207 | Mouse for programmer | We have [discussed][1] keyboards. But take a look at the small piece of plastic to the right (or left :) ) of your beloved keyboard! This humble creature helps use to draw nice forms, and click all around the web. Real programmer mouse must be precise and comfortable, so which mouse would you make a companion to your keyboard?
Currently I'm in love with this fat member of mice family:
**Natural wireless laser mouse 6000**
![Mouse][2]
[1]: http://stackoverflow.com/questions/687/keyboard-for-programmers
[2]: http://www.microsoft.com/hardware/mouseandkeyboard/images/products/nwlm6k/mk_productfeatures_nwlm6k.jpg | peripherals | hardware | productivity | ergonomics | health | 09/28/2011 11:16:25 | not constructive | Mouse for programmer
===
We have [discussed][1] keyboards. But take a look at the small piece of plastic to the right (or left :) ) of your beloved keyboard! This humble creature helps use to draw nice forms, and click all around the web. Real programmer mouse must be precise and comfortable, so which mouse would you make a companion to your keyboard?
Currently I'm in love with this fat member of mice family:
**Natural wireless laser mouse 6000**
![Mouse][2]
[1]: http://stackoverflow.com/questions/687/keyboard-for-programmers
[2]: http://www.microsoft.com/hardware/mouseandkeyboard/images/products/nwlm6k/mk_productfeatures_nwlm6k.jpg | 4 |
53,135 | 09/09/2008 23:29:25 | 3,798 | 08/30/2008 22:09:59 | 212 | 15 | What registry access can you get without Administrator privleges? | I know that we shouldn't being using the registry to store Application Data anymore, but in updating a Legacy application (and wanting to do the fewest changes), what Registry Hives are non-administrators allowed to use? Can I access all of HKEY_LOCAL_USER (the application currently access HKEY_LOCAL_MACHINE) without Administrator privileges? | registry | null | null | null | null | null | open | What registry access can you get without Administrator privleges?
===
I know that we shouldn't being using the registry to store Application Data anymore, but in updating a Legacy application (and wanting to do the fewest changes), what Registry Hives are non-administrators allowed to use? Can I access all of HKEY_LOCAL_USER (the application currently access HKEY_LOCAL_MACHINE) without Administrator privileges? | 0 |
53,136 | 09/09/2008 23:30:09 | 122 | 08/02/2008 07:56:07 | 4,144 | 192 | How to find all database references | In trying to figure out [this problem][1] (which is still unsolved and I still have no clue what is going on), I am wondering if maybe an external reference to the table in question is causing the problem. For example, a trigger or view or some other such thing.
Is there an easy way to find all references to a given database table? Including all views, triggers, constraints, or anything at all, preferably from the command line, and also preferably without a 3rd party tool (we are using db2).
[1]: http://stackoverflow.com/questions/52981/cannot-delete-from-the-database | database | db2 | null | null | null | null | open | How to find all database references
===
In trying to figure out [this problem][1] (which is still unsolved and I still have no clue what is going on), I am wondering if maybe an external reference to the table in question is causing the problem. For example, a trigger or view or some other such thing.
Is there an easy way to find all references to a given database table? Including all views, triggers, constraints, or anything at all, preferably from the command line, and also preferably without a 3rd party tool (we are using db2).
[1]: http://stackoverflow.com/questions/52981/cannot-delete-from-the-database | 0 |
53,139 | 09/09/2008 23:30:52 | 4,786 | 09/05/2008 15:29:10 | 92 | 6 | What do you use to capture webpages, diagram/pictures and code snippets for later reference? | What do you use to capture webpages, diagram/pictures and code snippets for later reference? | productivity | null | null | null | null | null | open | What do you use to capture webpages, diagram/pictures and code snippets for later reference?
===
What do you use to capture webpages, diagram/pictures and code snippets for later reference? | 0 |
53,161 | 09/09/2008 23:44:33 | 1,057 | 08/11/2008 22:41:35 | 73 | 9 | Find the highest order bit in C | what I'm after is something I can feed a number into and it will return the highest order bit. I'm sure there's a simple way. Below is an example output (left is the input)
<pre>1 -> 1
2 -> 2
3 -> 2
4 -> 4
5 -> 4
6 -> 4
7 -> 4
8 -> 8
9 -> 8
...
63 -> 32</pre> | c | null | null | null | null | null | open | Find the highest order bit in C
===
what I'm after is something I can feed a number into and it will return the highest order bit. I'm sure there's a simple way. Below is an example output (left is the input)
<pre>1 -> 1
2 -> 2
3 -> 2
4 -> 4
5 -> 4
6 -> 4
7 -> 4
8 -> 8
9 -> 8
...
63 -> 32</pre> | 0 |
53,162 | 09/09/2008 23:45:30 | 4,872 | 09/06/2008 09:14:55 | 68 | 2 | How can I do a line continuation of code in Python? | I have a long line of code that I want to break up among multiple lines. What do I use and what is the syntax? | python | syntax | null | null | null | null | open | How can I do a line continuation of code in Python?
===
I have a long line of code that I want to break up among multiple lines. What do I use and what is the syntax? | 0 |
53,164 | 09/09/2008 23:45:56 | 5,488 | 09/09/2008 23:24:32 | 11 | 3 | Fixed vs. variable frame rates in games: what is best, and when? | After working for a while developing games, I've been exposed to both variable frame rates (where you work out how much time has passed since the last tick and update actor movement accordingly) and fixed frame rates (where you work out how much time has passed and choose either to tick a fixed amount of time or sleep until the next window comes).
Which method works best for specific situations? Please consider:
- Catering to different system specifications;
- Ease of development/maintenance;
- Ease of porting;
- Final performance.
| frame-rate | null | null | null | null | null | open | Fixed vs. variable frame rates in games: what is best, and when?
===
After working for a while developing games, I've been exposed to both variable frame rates (where you work out how much time has passed since the last tick and update actor movement accordingly) and fixed frame rates (where you work out how much time has passed and choose either to tick a fixed amount of time or sleep until the next window comes).
Which method works best for specific situations? Please consider:
- Catering to different system specifications;
- Ease of development/maintenance;
- Ease of porting;
- Final performance.
| 0 |
53,167 | 09/09/2008 23:47:20 | 5,056 | 09/07/2008 15:43:17 | 352 | 38 | Looking for experiences working with Qt | I had an idea for a plug-in for my favorite program runner [Launchy][1], however after downloading the source code I found that it makes heavy use of the Qt library. The bulk of my experience is in C# and PHP and until that moment I had never really even heard of this library.
Which leads me to ask, does anyone have any impressions of it that they can share with me? Do you find working with it to be hard or easy? What professional/hobbyist prospects would experience with Qt make available for me? Is it fun? Do you think its worth my time overall? Are there any common gotchas that should I decide to learn it I should keep an eye out for? Just trying to solicit some opinions.
[1]: http://www.launchy.net | .net | qt | vc++ | null | null | null | open | Looking for experiences working with Qt
===
I had an idea for a plug-in for my favorite program runner [Launchy][1], however after downloading the source code I found that it makes heavy use of the Qt library. The bulk of my experience is in C# and PHP and until that moment I had never really even heard of this library.
Which leads me to ask, does anyone have any impressions of it that they can share with me? Do you find working with it to be hard or easy? What professional/hobbyist prospects would experience with Qt make available for me? Is it fun? Do you think its worth my time overall? Are there any common gotchas that should I decide to learn it I should keep an eye out for? Just trying to solicit some opinions.
[1]: http://www.launchy.net | 0 |
53,172 | 09/09/2008 23:48:26 | 3,900 | 08/31/2008 19:21:25 | 1 | 0 | On Disk Substring index | I have a file (fasta file to be specific) that I would like to index, so that I can quickly locate any substring within the file and then find the location within the original fasta file.
This would be easy to do in many cases, using a Trie or substring array, unfortunately the strings I need to index are 800+ MBs which means that doing them in memory in unacceptable, so I'm looking for a reasonable way to create this index on disk, with minimal memory usage. | indexing | on-disk | substring | null | null | null | open | On Disk Substring index
===
I have a file (fasta file to be specific) that I would like to index, so that I can quickly locate any substring within the file and then find the location within the original fasta file.
This would be easy to do in many cases, using a Trie or substring array, unfortunately the strings I need to index are 800+ MBs which means that doing them in memory in unacceptable, so I'm looking for a reasonable way to create this index on disk, with minimal memory usage. | 0 |
53,178 | 09/09/2008 23:51:03 | 320 | 08/04/2008 16:17:25 | 1 | 0 | Prompt for Database Connection String | I would like to offer a database connection prompt to the user. I can build my own, but it would be nice if I can use something that somebody else has already built (maybe something built into Windows or a free library available on the Internet). Anybody know how to do this in .Net? | .net | database | connection-string | null | null | null | open | Prompt for Database Connection String
===
I would like to offer a database connection prompt to the user. I can build my own, but it would be nice if I can use something that somebody else has already built (maybe something built into Windows or a free library available on the Internet). Anybody know how to do this in .Net? | 0 |
53,198 | 09/10/2008 00:04:15 | 1,389 | 08/15/2008 01:29:00 | 31 | 5 | HelpInsight documentation in Delphi 2007 | I am using D2007 and am trying to document my source code, using the HelpInsight feature (provided since D2005). I am mainly interested in getting the HelpInsight tool-tips working. From various Web-surfing and experimentation I have found the following:
1. Using the triple slash (///) comment style works more often than the other documented comment styles. i.e.: <code>{*! comment *}</code> and <code>{! comment }</code>
2. The comments must be in the interface section of the code.
3. The first comment cannot be for a function. (i.e. it must be for a type - or at least it appears the parser must have seen the "type" keyword before the HelpInsight feature works)
Despite following these "rules", sometimes the Help-insight just doesn't find the comments I've written. One file does not produce the correct HelpInsight tool-tips, but if I include this file in a different dummy project, it works properly.
Does anyone have any other pointers / tricks for getting HelpInsight to work?
| documentation | delphi | ndoc | null | null | null | open | HelpInsight documentation in Delphi 2007
===
I am using D2007 and am trying to document my source code, using the HelpInsight feature (provided since D2005). I am mainly interested in getting the HelpInsight tool-tips working. From various Web-surfing and experimentation I have found the following:
1. Using the triple slash (///) comment style works more often than the other documented comment styles. i.e.: <code>{*! comment *}</code> and <code>{! comment }</code>
2. The comments must be in the interface section of the code.
3. The first comment cannot be for a function. (i.e. it must be for a type - or at least it appears the parser must have seen the "type" keyword before the HelpInsight feature works)
Despite following these "rules", sometimes the Help-insight just doesn't find the comments I've written. One file does not produce the correct HelpInsight tool-tips, but if I include this file in a different dummy project, it works properly.
Does anyone have any other pointers / tricks for getting HelpInsight to work?
| 0 |
53,208 | 09/10/2008 00:13:35 | 814 | 08/09/2008 04:07:15 | 184 | 13 | How do I automatically destroy child processes in Windows? | In C++ Windows app, I launch several long running child processes (currently I use CreateProcess(...) to do this.
I want the child processes to be automatically closed if my main processes crashes or is closed.
How do I do this? | windows | processes | null | null | null | null | open | How do I automatically destroy child processes in Windows?
===
In C++ Windows app, I launch several long running child processes (currently I use CreateProcess(...) to do this.
I want the child processes to be automatically closed if my main processes crashes or is closed.
How do I do this? | 0 |
53,220 | 09/10/2008 00:29:07 | 2,975 | 08/26/2008 09:40:04 | 1,240 | 52 | Is there an ASP.NET pagination control (Not MVC)? | I've got a search results page that basically consists of a repeater with content in it. What I need is a way to paginate the results. Getting paginated results isn't the problem, what I'm after is a web control that will display a list of the available paged data, preferably by providing the number of results and a page size | asp.net | pagination | null | null | null | null | open | Is there an ASP.NET pagination control (Not MVC)?
===
I've got a search results page that basically consists of a repeater with content in it. What I need is a way to paginate the results. Getting paginated results isn't the problem, what I'm after is a web control that will display a list of the available paged data, preferably by providing the number of results and a page size | 0 |
53,224 | 09/10/2008 00:30:42 | 5,346 | 09/09/2008 10:01:45 | 109 | 9 | Getting international characters from a web page? | I want to scrape some information off a football (soccer) web page using simple python regexp's. The problem is that players such as the first chap, ÄÄRITALO, comes out as &#196;&#196;RITALO!
That is, html uses escaped markup for the special characters, such as &#196;
Is there a simple way of reading the html into the correct python string? If it was XML/XHTML it would be easy, the parser would do it. | python | html | unicode | parse | null | null | open | Getting international characters from a web page?
===
I want to scrape some information off a football (soccer) web page using simple python regexp's. The problem is that players such as the first chap, ÄÄRITALO, comes out as &#196;&#196;RITALO!
That is, html uses escaped markup for the special characters, such as &#196;
Is there a simple way of reading the html into the correct python string? If it was XML/XHTML it would be easy, the parser would do it. | 0 |
53,225 | 09/10/2008 00:31:11 | 4,883 | 09/06/2008 10:24:59 | 461 | 5 | How do you check whether a python method is bound or not? | Given a reference to a method, is there a way to check whether the method is bound to an object or not? Can you also access the instance that it's bound to? | python | null | null | null | null | null | open | How do you check whether a python method is bound or not?
===
Given a reference to a method, is there a way to check whether the method is bound to an object or not? Can you also access the instance that it's bound to? | 0 |
53,232 | 09/10/2008 00:37:52 | 445,087 | 09/02/2008 17:25:48 | 318 | 7 | How can I run a Windows GUI application on as a service? | I have an existing GUI application that should have been implemented as a service. Basically, I need to be able to remotely log onto and off of the Windows 2003 server and still keep this program running.
Is this even possible? | windows | gui | legacy | windows-services | null | null | open | How can I run a Windows GUI application on as a service?
===
I have an existing GUI application that should have been implemented as a service. Basically, I need to be able to remotely log onto and off of the Windows 2003 server and still keep this program running.
Is this even possible? | 0 |
53,249 | 09/10/2008 00:51:13 | 1,811 | 08/18/2008 17:11:10 | 160 | 14 | Are there any good Javascript code coverage tools? | Looking for a Javascript code coverage tool.
Ideally, I'd be able to easily integrate with continuous builds. Looking for something that I can run cross-platform, but Windows only tools may be able to work.
Does anybody have any good recommendations of tools to use or what tools to avoid?
**Note**: I've already read through this question: [http://stackoverflow.com/questions/39329/what-is-your-favourite-code-coverage-tools-free-and-non-free][1]. I'm looking at specifically analyzing Javascript code coverage.
[1]: http://stackoverflow.com/questions/39329/what-is-your-favourite-code-coverage-tools-free-and-non-free | javascript | qa | code-coverage | software-quality | coverage | 06/29/2012 01:54:35 | not constructive | Are there any good Javascript code coverage tools?
===
Looking for a Javascript code coverage tool.
Ideally, I'd be able to easily integrate with continuous builds. Looking for something that I can run cross-platform, but Windows only tools may be able to work.
Does anybody have any good recommendations of tools to use or what tools to avoid?
**Note**: I've already read through this question: [http://stackoverflow.com/questions/39329/what-is-your-favourite-code-coverage-tools-free-and-non-free][1]. I'm looking at specifically analyzing Javascript code coverage.
[1]: http://stackoverflow.com/questions/39329/what-is-your-favourite-code-coverage-tools-free-and-non-free | 4 |
53,253 | 09/10/2008 00:56:49 | 3,915 | 08/31/2008 21:34:28 | 18 | 0 | Should we stop using Zend WinEnabler? | Our system uses Zend WinEnabler. Do you use it? Is it obsolete? Should we stop using it? Is it known to cause handle/memory leaks?
Here is an (old) introduction to it: "PHP Creators Unveil New Product that Makes PHP Truly Viable for Windows Environments"
<http://personalweb.about.com/b/2004/03/29/zend-announces-winenabler-enabling-php-for-windows-environments.htm>
Thanks in advance to all respondents. | php | zend | null | null | null | null | open | Should we stop using Zend WinEnabler?
===
Our system uses Zend WinEnabler. Do you use it? Is it obsolete? Should we stop using it? Is it known to cause handle/memory leaks?
Here is an (old) introduction to it: "PHP Creators Unveil New Product that Makes PHP Truly Viable for Windows Environments"
<http://personalweb.about.com/b/2004/03/29/zend-announces-winenabler-enabling-php-for-windows-environments.htm>
Thanks in advance to all respondents. | 0 |
53,256 | 09/10/2008 00:59:46 | 429 | 08/05/2008 16:44:40 | 1,424 | 48 | Getting closest element by id | I have two elements:
<input a>
<input b onclick="...">
When b is clicked, I want to access a and manipulate some of its data. A does not have a globally unique name, so document.getElementsByName is out. Looking into the event object, I thought event.target.parentNode would have some function like getElementsByName, but this does not seem to be the case with <td>s. Is there any simple way to do this? | javascript | html | dom | null | null | null | open | Getting closest element by id
===
I have two elements:
<input a>
<input b onclick="...">
When b is clicked, I want to access a and manipulate some of its data. A does not have a globally unique name, so document.getElementsByName is out. Looking into the event object, I thought event.target.parentNode would have some function like getElementsByName, but this does not seem to be the case with <td>s. Is there any simple way to do this? | 0 |
53,257 | 09/10/2008 01:02:42 | 5,479 | 09/09/2008 22:28:56 | 11 | 3 | Case Tools | Anyone here using a case tool for programming in a corporate environment? I am using AllFusion Gen aka IEF\Composer\Cool:Gen from Computer Associates. | casetools | null | null | null | null | null | open | Case Tools
===
Anyone here using a case tool for programming in a corporate environment? I am using AllFusion Gen aka IEF\Composer\Cool:Gen from Computer Associates. | 0 |
53,260 | 09/10/2008 01:08:20 | 797 | 08/09/2008 02:14:04 | 2,102 | 85 | Retaining HTTP POST data when a request is interrupted by a login page | Say a user is browsing a website, and then performs some action which changes the database (let's say they add a comment). When the request to actually add the comment comes in, however, we find we need to force them to login before they can continue.
Assume the login page asks for a username and password, and redirects the user back to the URL they were going to when the login was required. That redirect works find for a URL with only GET parameters, but if the request originally contained some HTTP POST data, that is now lost.
Can anyone recommend a way to handle this scenario when HTTP POST data is involved?
Obviously, if necessary, the login page could dynamically generate a form with all the POST parameters to pass them along (though that seems messy), but even then, I don't know of any way for the login page to redirect the user on to their intended page while keeping the POST data in the request. | language-agnostic | null | null | null | null | null | open | Retaining HTTP POST data when a request is interrupted by a login page
===
Say a user is browsing a website, and then performs some action which changes the database (let's say they add a comment). When the request to actually add the comment comes in, however, we find we need to force them to login before they can continue.
Assume the login page asks for a username and password, and redirects the user back to the URL they were going to when the login was required. That redirect works find for a URL with only GET parameters, but if the request originally contained some HTTP POST data, that is now lost.
Can anyone recommend a way to handle this scenario when HTTP POST data is involved?
Obviously, if necessary, the login page could dynamically generate a form with all the POST parameters to pass them along (though that seems messy), but even then, I don't know of any way for the login page to redirect the user on to their intended page while keeping the POST data in the request. | 0 |
53,290 | 09/10/2008 01:36:21 | 117 | 08/02/2008 05:54:20 | 686 | 24 | How could I get my SVN-only host to pull from a git repository? | I'd really like to get our host to pull from our Git repository instead of uploading files manually, but it doesn't have Git installed.
So is there a way to trick Subversion (which they do have) into checking out a Git repository?
I think I already know the answer, namely bug my host to add Git and live with it until they do, but I thought I would ask anyway.
| svn | git | build-automation | capistrano | null | null | open | How could I get my SVN-only host to pull from a git repository?
===
I'd really like to get our host to pull from our Git repository instead of uploading files manually, but it doesn't have Git installed.
So is there a way to trick Subversion (which they do have) into checking out a Git repository?
I think I already know the answer, namely bug my host to add Git and live with it until they do, but I thought I would ask anyway.
| 0 |
53,292 | 09/10/2008 01:36:47 | 422 | 08/05/2008 15:11:55 | 1,097 | 52 | Ruby Package Include Problems | I'm trying to use the [Optiflag][1] package in my Ruby code and whenever I try to do the necessary `require optiflag.rb`, my program fails with the standard `no such file to load -- optiflag` message. I added the directory with that library to my $PATH variable, but it's still not working. Any ideas?
[1]: http://optiflag.rubyforge.org/discussion.html | ruby | null | null | null | null | null | open | Ruby Package Include Problems
===
I'm trying to use the [Optiflag][1] package in my Ruby code and whenever I try to do the necessary `require optiflag.rb`, my program fails with the standard `no such file to load -- optiflag` message. I added the directory with that library to my $PATH variable, but it's still not working. Any ideas?
[1]: http://optiflag.rubyforge.org/discussion.html | 0 |
53,295 | 09/10/2008 01:39:55 | 5,054 | 09/07/2008 15:33:08 | 1 | 0 | Java Web Services API, however I can't run Tomcat on my server | I'm trying to use some data from a PlanPlusOnline account. They only provide a java web services API. The server for the site where the data will be used does not allow me to install Tomcat. I'm not going to lie, I am a Java software engineer, and I do some web work on the side. I'm not familiar with web services or servlets, but I was willing to give it a shot. I'd much rather they have JSON access to the data, but as far as I know they don't. Any ideas? | web-services | json | null | null | null | null | open | Java Web Services API, however I can't run Tomcat on my server
===
I'm trying to use some data from a PlanPlusOnline account. They only provide a java web services API. The server for the site where the data will be used does not allow me to install Tomcat. I'm not going to lie, I am a Java software engineer, and I do some web work on the side. I'm not familiar with web services or servlets, but I was willing to give it a shot. I'd much rather they have JSON access to the data, but as far as I know they don't. Any ideas? | 0 |
53,301 | 09/10/2008 01:47:08 | 708 | 08/08/2008 06:10:02 | 557 | 18 | Can you bind a DataTrigger to an Attached Property? | In WPF, is it possible for a DataTrigger to bind to an attached property?
I essentially want to use a converter on an attached property to provide a style when a particular validation rule has been broken. I am using markup like the following:
<DataTrigger Binding="{Binding Path=Validation.Errors,
RelativeSource={RelativeSource Self},
Converter={StaticResource RequiredToBoolConverter}}"
Value="True">
<Setter Property="Background" Value="LightGreen" />
</DataTrigger>
However, when this runs, I get the following:
> System.Windows.Data Error: 39 :
> BindingExpression path error:
> 'Validation' property not found on
> 'object' ''TextBox' (Name='')'.
> BindingExpression:Path=Validation.Errors;
> DataItem='TextBox' (Name=''); target
> element is 'TextBox' (Name=''); target
> property is 'NoTarget' (type 'Object')
If I change my DataTrigger binding path to "Text", I do not get the databinding error (but of course it does not provide the behaviour I am seeking). | wpf | null | null | null | null | null | open | Can you bind a DataTrigger to an Attached Property?
===
In WPF, is it possible for a DataTrigger to bind to an attached property?
I essentially want to use a converter on an attached property to provide a style when a particular validation rule has been broken. I am using markup like the following:
<DataTrigger Binding="{Binding Path=Validation.Errors,
RelativeSource={RelativeSource Self},
Converter={StaticResource RequiredToBoolConverter}}"
Value="True">
<Setter Property="Background" Value="LightGreen" />
</DataTrigger>
However, when this runs, I get the following:
> System.Windows.Data Error: 39 :
> BindingExpression path error:
> 'Validation' property not found on
> 'object' ''TextBox' (Name='')'.
> BindingExpression:Path=Validation.Errors;
> DataItem='TextBox' (Name=''); target
> element is 'TextBox' (Name=''); target
> property is 'NoTarget' (type 'Object')
If I change my DataTrigger binding path to "Text", I do not get the databinding error (but of course it does not provide the behaviour I am seeking). | 0 |
53,309 | 09/10/2008 01:52:52 | 1,891 | 08/19/2008 05:37:52 | 258 | 7 | Best way to draw text with OpenGL and Cocoa? | Does anyone know an easy way to draw arbitrary text in a Cocoa NSOpenGLView? I have a couple of constraints.
- The text on screen may change from frame to frame (for example, a framerate display in the corner)
- I would like to be able to select any font installed on the system at any size
| cocoa | opengl | null | null | null | null | open | Best way to draw text with OpenGL and Cocoa?
===
Does anyone know an easy way to draw arbitrary text in a Cocoa NSOpenGLView? I have a couple of constraints.
- The text on screen may change from frame to frame (for example, a framerate display in the corner)
- I would like to be able to select any font installed on the system at any size
| 0 |
53,316 | 09/10/2008 02:09:02 | 1,666 | 08/17/2008 21:07:18 | 958 | 58 | Hibernate crops clob values oddly | I have a one to many relationship between two tables. The many table contains a clob column. The clob column looks like this in hibernate:
@CollectionOfElements(fetch = EAGER)
@JoinTable(name = NOTE_JOIN_TABLE, joinColumns = @JoinColumn(name = "note"))
@Column(name = "substitution")
@IndexColumn(name = "listIndex", base = 0)
@Lob
private List<String> substitutions;
So basically I may have a Note with some subsitutions, say `"foo"` and `"fizzbuzz"`. So in my main table I could have a Note with id 4 and in my `NOTE_JOIN_TABLE` I would have two rows, `"foo"` and `"fizzbuzz"` that both have a relationship to the Note.
However, when one of these is inserted into the DB **the larger substitution values are cropped to be as long as the shortest.** So in this case I would have `"foo"` and `"fiz"` in the DB instead of `"foo"` and `"fizzbuzz"`.
Do you have any idea why this is happening? I have checked and confirmed they aren't being cropped anywhere in our code, it's defintely hibernate. | java | oracle | hibernate | null | null | null | open | Hibernate crops clob values oddly
===
I have a one to many relationship between two tables. The many table contains a clob column. The clob column looks like this in hibernate:
@CollectionOfElements(fetch = EAGER)
@JoinTable(name = NOTE_JOIN_TABLE, joinColumns = @JoinColumn(name = "note"))
@Column(name = "substitution")
@IndexColumn(name = "listIndex", base = 0)
@Lob
private List<String> substitutions;
So basically I may have a Note with some subsitutions, say `"foo"` and `"fizzbuzz"`. So in my main table I could have a Note with id 4 and in my `NOTE_JOIN_TABLE` I would have two rows, `"foo"` and `"fizzbuzz"` that both have a relationship to the Note.
However, when one of these is inserted into the DB **the larger substitution values are cropped to be as long as the shortest.** So in this case I would have `"foo"` and `"fiz"` in the DB instead of `"foo"` and `"fizzbuzz"`.
Do you have any idea why this is happening? I have checked and confirmed they aren't being cropped anywhere in our code, it's defintely hibernate. | 0 |
53,338 | 09/10/2008 02:41:32 | 5,408 | 09/09/2008 13:23:01 | 11 | 1 | What are the disadvantages of Typed DataSets | I come from a world that favors building your own rather than rely on libraries and frameworks built by others. After escaping this world I have found the joy, and ease, of using such tools as Typed DataSets within Visual Studio. So besides the loss of flexibility what else do you lose? Are there performance factors (disregarding the procs vs dynamic sql debate)? Limitations? | .net | dataset | dal | null | null | null | open | What are the disadvantages of Typed DataSets
===
I come from a world that favors building your own rather than rely on libraries and frameworks built by others. After escaping this world I have found the joy, and ease, of using such tools as Typed DataSets within Visual Studio. So besides the loss of flexibility what else do you lose? Are there performance factors (disregarding the procs vs dynamic sql debate)? Limitations? | 0 |
53,347 | 09/10/2008 02:55:05 | 242 | 08/03/2008 22:55:19 | 480 | 29 | Crystal Report icons/toolbar not working when deployed on web server | I have built a web page which contains a Crystal Report built using the Crystal libraries included in Visual Studio 2008.
It 'works on my machine' but when deployed to the web server the icons (Export, Print etc) on the Crystal Report toolbar do not display or work. Just seeing the 'red X' where the button image should be and clicking does nothing.
I have checked that the toolbar images are actually in the location being looked at on the web server:
(C:/Inetpub/wwwroot/aspnet_client/system_web/2_0_50727/CrystalReportWebFormViewer4/images/toolbar/)
They are all there.
I have checked the permissions on the above mentioned folder on the web server.
Gave 'full control' to every user just to test it.
I have also intalled/run the 'CRRedist2008_x86.msi' on the web server.
Some people have mentioned ensuring that 'crystalreportviewers115' folder is added to my '\wwwroot\aspnet_client\system_web\2_0_50727' folder on the web server but I have been unable to find the 'crystalreportviewers115' to copy it.
Appreciate any help or ideas you may be able to offer. | deployment | crystal-reports | null | null | null | null | open | Crystal Report icons/toolbar not working when deployed on web server
===
I have built a web page which contains a Crystal Report built using the Crystal libraries included in Visual Studio 2008.
It 'works on my machine' but when deployed to the web server the icons (Export, Print etc) on the Crystal Report toolbar do not display or work. Just seeing the 'red X' where the button image should be and clicking does nothing.
I have checked that the toolbar images are actually in the location being looked at on the web server:
(C:/Inetpub/wwwroot/aspnet_client/system_web/2_0_50727/CrystalReportWebFormViewer4/images/toolbar/)
They are all there.
I have checked the permissions on the above mentioned folder on the web server.
Gave 'full control' to every user just to test it.
I have also intalled/run the 'CRRedist2008_x86.msi' on the web server.
Some people have mentioned ensuring that 'crystalreportviewers115' folder is added to my '\wwwroot\aspnet_client\system_web\2_0_50727' folder on the web server but I have been unable to find the 'crystalreportviewers115' to copy it.
Appreciate any help or ideas you may be able to offer. | 0 |
53,355 | 09/10/2008 03:07:41 | 1,965 | 08/19/2008 15:51:08 | 3,804 | 223 | How do you create a shortcut to a directory so that it opens in explorer | Better yet, how can I make My Computer always open in Explorer as well?
I usually make a shortcut to my programming directories on my quick launch bar, but I'd love for them to open in Explorer. | windows | explorer | generic | null | null | null | open | How do you create a shortcut to a directory so that it opens in explorer
===
Better yet, how can I make My Computer always open in Explorer as well?
I usually make a shortcut to my programming directories on my quick launch bar, but I'd love for them to open in Explorer. | 0 |
53,364 | 09/10/2008 03:18:13 | 4,959 | 09/07/2008 02:03:07 | 1 | 1 | Printing in Adobe AIR - Standalone PDF Generation | <p>Is it possible to generate PDF Documents in an Adobe AIR application without resorting to a round trip web service for generating the PDF? I've looked at the initial Flex Reports on GoogleCode but it requires a round trip for generating the actual PDF.</p>
<p>Given that AIR is supposed to be the Desktop end for RIAs is there a way to accomplish this? I suspect I am overlooking something but my searches through the documentation don't reveal too much and given the target for AIR I can't believe that it's just something they didn't include.</p> | flex | air | printing | ria | null | null | open | Printing in Adobe AIR - Standalone PDF Generation
===
<p>Is it possible to generate PDF Documents in an Adobe AIR application without resorting to a round trip web service for generating the PDF? I've looked at the initial Flex Reports on GoogleCode but it requires a round trip for generating the actual PDF.</p>
<p>Given that AIR is supposed to be the Desktop end for RIAs is there a way to accomplish this? I suspect I am overlooking something but my searches through the documentation don't reveal too much and given the target for AIR I can't believe that it's just something they didn't include.</p> | 0 |
53,365 | 09/10/2008 03:19:38 | 1,666 | 08/17/2008 21:07:18 | 958 | 58 | Getting hibernate to log clob parameters | *(see [here][1] for the problem I'm trying to solve)*
How do you get hibernate to log clob values it's going to insert. It is logging other value types, such as Integer etc.
I have the following in my log4j config:
log4j.logger.net.sf.hibernate.SQL=DEBUG
log4j.logger.org.hibernate.SQL=DEBUG
log4j.logger.net.sf.hibernate.type=DEBUG
log4j.logger.org.hibernate.type=DEBUG
Which produces output such as:
(org.hibernate.SQL) insert into NoteSubstitutions (note, listIndex, substitution) values (?, ?, ?)
(org.hibernate.type.LongType) binding '170650' to parameter: 1
(org.hibernate.type.IntegerType) binding '0' to parameter: 2
(org.hibernate.SQL) insert into NoteSubstitutions (note, listIndex, substitution) values (?, ?, ?)
(org.hibernate.type.LongType) binding '170650' to parameter: 1
(org.hibernate.type.IntegerType) binding '1' to parameter: 2
However you'll note that it never displays `parameter: 3` which is our clob.
How do I get it to show this in the log?
[1]: http://beta.stackoverflow.com/questions/53316/hibernate-crops-clob-values-oddly | hibernate | oracle | java | null | null | null | open | Getting hibernate to log clob parameters
===
*(see [here][1] for the problem I'm trying to solve)*
How do you get hibernate to log clob values it's going to insert. It is logging other value types, such as Integer etc.
I have the following in my log4j config:
log4j.logger.net.sf.hibernate.SQL=DEBUG
log4j.logger.org.hibernate.SQL=DEBUG
log4j.logger.net.sf.hibernate.type=DEBUG
log4j.logger.org.hibernate.type=DEBUG
Which produces output such as:
(org.hibernate.SQL) insert into NoteSubstitutions (note, listIndex, substitution) values (?, ?, ?)
(org.hibernate.type.LongType) binding '170650' to parameter: 1
(org.hibernate.type.IntegerType) binding '0' to parameter: 2
(org.hibernate.SQL) insert into NoteSubstitutions (note, listIndex, substitution) values (?, ?, ?)
(org.hibernate.type.LongType) binding '170650' to parameter: 1
(org.hibernate.type.IntegerType) binding '1' to parameter: 2
However you'll note that it never displays `parameter: 3` which is our clob.
How do I get it to show this in the log?
[1]: http://beta.stackoverflow.com/questions/53316/hibernate-crops-clob-values-oddly | 0 |
53,370 | 09/10/2008 03:28:04 | 361 | 08/05/2008 04:20:27 | 549 | 23 | Where are people getting that rotaty loading image? | I keep running across this loading image
<http://georgia.ubuntuforums.com/images/misc/lightbox_progress.gif>
which seems to have entered into existence in the last 18 months. All of a sudden it is in every application and is on every web site. Not wanting to be left out is there somewhere I can get this logo, perhaps with a transparent background? Also where did it come from? | image | animation | null | null | null | null | open | Where are people getting that rotaty loading image?
===
I keep running across this loading image
<http://georgia.ubuntuforums.com/images/misc/lightbox_progress.gif>
which seems to have entered into existence in the last 18 months. All of a sudden it is in every application and is on every web site. Not wanting to be left out is there somewhere I can get this logo, perhaps with a transparent background? Also where did it come from? | 0 |
53,379 | 09/10/2008 03:37:33 | 3,839 | 08/31/2008 10:11:12 | 563 | 35 | using DBMS_APPLICATION_INFO with Jboss | Does anyone have examples of how to use [DBMS_APPLICATION_INFO][1] package with JBOSS?
We have a various applications which run within JBOSS and share db pools. I would like, at the start of each session these applications to identify themselves to the database using DBMS_APPLICATION_INFO so I can more easily track which sections of the application is causing database issues.
I'm not too familiar with session life cycles in JBOSS, but at the end of the day, what needs to happen is at the start and end of a transaction, this package needs to be called.
Has anyone done this before?
[1]: http://www.oracle-base.com/articles/8i/DBMS_APPLICATION_INFO.php | java | oracle | jboss | null | null | null | open | using DBMS_APPLICATION_INFO with Jboss
===
Does anyone have examples of how to use [DBMS_APPLICATION_INFO][1] package with JBOSS?
We have a various applications which run within JBOSS and share db pools. I would like, at the start of each session these applications to identify themselves to the database using DBMS_APPLICATION_INFO so I can more easily track which sections of the application is causing database issues.
I'm not too familiar with session life cycles in JBOSS, but at the end of the day, what needs to happen is at the start and end of a transaction, this package needs to be called.
Has anyone done this before?
[1]: http://www.oracle-base.com/articles/8i/DBMS_APPLICATION_INFO.php | 0 |
53,391 | 09/10/2008 03:54:15 | 5,496 | 09/10/2008 02:49:33 | 1 | 0 | Centralizing/controlling arbitrary builds of .NET projects and solutions. | Over the years I have created and tweaked a set of NAnt scripts to perform complete project builds. The main script takes a single application end point (a web application project for example) and does a complete, from source control, build of it. The scripts are preconfigured with the necessary information regarding build output locations, source control addresses, etc. The main point is that you can feed it very little information and build a given project from the ground up. This satisfies the "arbitrary" part of my question.
In the past I have worked for companies that produce a few software products (mostly web applications). This environment lends itself very well to a typical continuous integration setup where there is an integrator for each product. I have set up integrators to serve as both CI builds as well as integrators to handle a complete release candidate build and QA deployment. These integrators use the master build scripts, so the integrators themselves are very little more than source control monitoring and a call to the master NAnt script.
I now work for a development group that creates many applications. Often, developers are called on to support applications originally built by others. When I started there was no build management in place. I am in a particularly unique position within the group as the lead developer of a 4 person team for one business unit's product suite (around a half dozen complete systems). I have implemented CruiseControl.Net with the master build scripts for doing both CI builds as well as RC builds. This works find for the fixed set of projects within the business' product suite.
I have been using CCNet for many years now so I'm fully aware of what it can do. I have great respect for its contribution to the continuous integration arena as I use it for all the projects in my suite of products. I have stressed to my team the use of the official RC build integrator as the master builder for anything destined for any location other than development. This provides great control over the fixed set of projects that are under CCNet's control.
However, there are other developers building other applications. Some of these are 1 developer projects that are often not even in source control until well into the project life cycle (something else I'm trying to change). Many of these projects are one-offs that won't have much of a life in development after they have been deployed. Despite that, they'll still need to be supported. Integral to supporting those is the fact that without centralized build management of these projects the release candidate builds that go to QA and eventually production are left to be done on individual developer machines. This, of course, provides zero guarantee that everything is in source control among the other factors of a developer machine build.
The issue I've been trying to solve is: what kind of system can I use to provide centralized control over these sort of arbitrary builds? This is definitely not a unique problem. However, in much of the reading I have done about centralized builds, build automation and continuous integration the focus is on fixed projects/products and the task of supporting continued development on them. What types of process are used by business that are doing development on new projects constantly? Are they not using these types of processes?
While the master build scripts do live on the build server, they are clumsy to use. Also I'd prefer to limit the console access to the build server. So some management system is required to provider easier access to firing off arbitrary builds on a central system.
I realize that what I'm looking for may lay under the covers of MS Team Build. Unfortunately, whenever I start reading about it, I get that quicksand feeling when I start getting into the MS marketing material and quickly loose my way, never really finding out if what I want to do can be done with it. Plus, the licensing costs have been addressed as a likely show stopper in some past general discussions on the topic of Team Foundation Server and Team System.
I'm a eager to hear from anyone who has solved this problem who might offer suggestions. I have done some work on a centralized build system based around my master "build-any-project" build scripts. However, what I have is in its infancy and has been constructed to support mainly just the types of projects that I work on. There lacks the kind of support required at this point to handle many application types or the plethora of project/solution configurations that are possible with Visual Studio. | .net | visual-studio | build-automation | null | null | null | open | Centralizing/controlling arbitrary builds of .NET projects and solutions.
===
Over the years I have created and tweaked a set of NAnt scripts to perform complete project builds. The main script takes a single application end point (a web application project for example) and does a complete, from source control, build of it. The scripts are preconfigured with the necessary information regarding build output locations, source control addresses, etc. The main point is that you can feed it very little information and build a given project from the ground up. This satisfies the "arbitrary" part of my question.
In the past I have worked for companies that produce a few software products (mostly web applications). This environment lends itself very well to a typical continuous integration setup where there is an integrator for each product. I have set up integrators to serve as both CI builds as well as integrators to handle a complete release candidate build and QA deployment. These integrators use the master build scripts, so the integrators themselves are very little more than source control monitoring and a call to the master NAnt script.
I now work for a development group that creates many applications. Often, developers are called on to support applications originally built by others. When I started there was no build management in place. I am in a particularly unique position within the group as the lead developer of a 4 person team for one business unit's product suite (around a half dozen complete systems). I have implemented CruiseControl.Net with the master build scripts for doing both CI builds as well as RC builds. This works find for the fixed set of projects within the business' product suite.
I have been using CCNet for many years now so I'm fully aware of what it can do. I have great respect for its contribution to the continuous integration arena as I use it for all the projects in my suite of products. I have stressed to my team the use of the official RC build integrator as the master builder for anything destined for any location other than development. This provides great control over the fixed set of projects that are under CCNet's control.
However, there are other developers building other applications. Some of these are 1 developer projects that are often not even in source control until well into the project life cycle (something else I'm trying to change). Many of these projects are one-offs that won't have much of a life in development after they have been deployed. Despite that, they'll still need to be supported. Integral to supporting those is the fact that without centralized build management of these projects the release candidate builds that go to QA and eventually production are left to be done on individual developer machines. This, of course, provides zero guarantee that everything is in source control among the other factors of a developer machine build.
The issue I've been trying to solve is: what kind of system can I use to provide centralized control over these sort of arbitrary builds? This is definitely not a unique problem. However, in much of the reading I have done about centralized builds, build automation and continuous integration the focus is on fixed projects/products and the task of supporting continued development on them. What types of process are used by business that are doing development on new projects constantly? Are they not using these types of processes?
While the master build scripts do live on the build server, they are clumsy to use. Also I'd prefer to limit the console access to the build server. So some management system is required to provider easier access to firing off arbitrary builds on a central system.
I realize that what I'm looking for may lay under the covers of MS Team Build. Unfortunately, whenever I start reading about it, I get that quicksand feeling when I start getting into the MS marketing material and quickly loose my way, never really finding out if what I want to do can be done with it. Plus, the licensing costs have been addressed as a likely show stopper in some past general discussions on the topic of Team Foundation Server and Team System.
I'm a eager to hear from anyone who has solved this problem who might offer suggestions. I have done some work on a centralized build system based around my master "build-any-project" build scripts. However, what I have is in its infancy and has been constructed to support mainly just the types of projects that I work on. There lacks the kind of support required at this point to handle many application types or the plethora of project/solution configurations that are possible with Visual Studio. | 0 |
53,395 | 09/10/2008 04:03:08 | 5,302 | 09/08/2008 22:49:47 | 16 | 4 | Suggestions wanted with Lists or Enumerators of T when inheriting from generic classes | I know the answer is not going to be simple, and I already use a couple of (I think ugly) cludges. I am simply looking for some elegant answers.
Abstract class:
public interface IOtherObjects;
public abstract class MyObjects<T> where T : IOtherObjects
{
...
public List<T> ToList()
{
...
}
}
Children:
public class MyObjectsA : MyObjects<OtherObjectA> //(where OtherObjectA implements IOtherObjects)
{
}
public class MyObjectsB : MyObjects<OtherObjectB> //(where OtherObjectB implements IOtherObjects)
{
}
Is it possible, looping through a collection of MyObjects (or other similar grouping, generic or otherwise) to then utilise to *ToList* method of the *MyObjects* base class, as we do not specifically know the type of T at this point.
| c# | generics | suggestions | null | null | null | open | Suggestions wanted with Lists or Enumerators of T when inheriting from generic classes
===
I know the answer is not going to be simple, and I already use a couple of (I think ugly) cludges. I am simply looking for some elegant answers.
Abstract class:
public interface IOtherObjects;
public abstract class MyObjects<T> where T : IOtherObjects
{
...
public List<T> ToList()
{
...
}
}
Children:
public class MyObjectsA : MyObjects<OtherObjectA> //(where OtherObjectA implements IOtherObjects)
{
}
public class MyObjectsB : MyObjects<OtherObjectB> //(where OtherObjectB implements IOtherObjects)
{
}
Is it possible, looping through a collection of MyObjects (or other similar grouping, generic or otherwise) to then utilise to *ToList* method of the *MyObjects* base class, as we do not specifically know the type of T at this point.
| 0 |
53,404 | 09/10/2008 04:13:38 | 223 | 08/03/2008 16:58:07 | 11 | 4 | Managed OleDB provider written in C# | An OleDB provider is a binary implementing COM interfaces provided by Microsoft. From that it seems to be possible to create a provider using C#. Is that correct? Is there a sample demonstrating that? If not, would you discourage me from doing that? I see that there are multiple unmanaged samples but I can't find any managed. | c# | com | oledb | null | null | null | open | Managed OleDB provider written in C#
===
An OleDB provider is a binary implementing COM interfaces provided by Microsoft. From that it seems to be possible to create a provider using C#. Is that correct? Is there a sample demonstrating that? If not, would you discourage me from doing that? I see that there are multiple unmanaged samples but I can't find any managed. | 0 |
53,411 | 09/10/2008 04:21:42 | 5,503 | 09/10/2008 04:13:18 | 1 | 0 | wav <> mp3 for flash(as3) | I'm wondering about MP3 decoding/encoding, and I was hoping to pull this off in Flash using AS3
I'm sure it'll be a right pain...
I have no idea where to start, can anyone offer any pointers? reference material? | mp3 | as3 | decode | wav | null | null | open | wav <> mp3 for flash(as3)
===
I'm wondering about MP3 decoding/encoding, and I was hoping to pull this off in Flash using AS3
I'm sure it'll be a right pain...
I have no idea where to start, can anyone offer any pointers? reference material? | 0 |
53,417 | 09/10/2008 04:38:19 | 2,847 | 08/25/2008 14:12:52 | 595 | 45 | NHibernate or LINQ to SQL | If starting a new project what would you use for your ORM NHibernate or LINQ and why. What are the pros and cons of each.
edit: LINQ to SQL not just LINQ (thanks @Jon Limjap) | nhibernate | linq | c# | .net | null | 07/22/2012 02:42:19 | not constructive | NHibernate or LINQ to SQL
===
If starting a new project what would you use for your ORM NHibernate or LINQ and why. What are the pros and cons of each.
edit: LINQ to SQL not just LINQ (thanks @Jon Limjap) | 4 |
53,426 | 09/10/2008 04:47:57 | 2,064 | 08/20/2008 03:39:44 | 155 | 2 | Memory leak detectors for C? | What memory leak detectors have people had a good experience with? | c | memory-leaks | null | null | null | null | open | Memory leak detectors for C?
===
What memory leak detectors have people had a good experience with? | 0 |
53,428 | 09/10/2008 04:49:32 | 5,499 | 09/10/2008 03:15:54 | 1 | 1 | What are some good Python ORM solutions? | I'm evaluating and looking at using CherryPy for a project that's basically a javascript front-end from the client-side (browser) that talks to a Python web service on the back-end. So, I really need something fast and lightweight on the back-end that I can implement using Python that then speaks to the PostgreSQL db via an ORM (JSON to the browser).
I'm also looking at Django, which I like, since its ORM is built-in. However, I think Django might be a little more than I really need (i.e. more features than I really need == slower?).
Anyone have any experience with different Python ORM solutions that can compare and contrast their features and functionality, speed, efficiency, etc.? | python | orm | null | null | null | 07/14/2012 14:12:05 | not constructive | What are some good Python ORM solutions?
===
I'm evaluating and looking at using CherryPy for a project that's basically a javascript front-end from the client-side (browser) that talks to a Python web service on the back-end. So, I really need something fast and lightweight on the back-end that I can implement using Python that then speaks to the PostgreSQL db via an ORM (JSON to the browser).
I'm also looking at Django, which I like, since its ORM is built-in. However, I think Django might be a little more than I really need (i.e. more features than I really need == slower?).
Anyone have any experience with different Python ORM solutions that can compare and contrast their features and functionality, speed, efficiency, etc.? | 4 |
53,435 | 09/10/2008 04:52:58 | 209 | 08/03/2008 13:54:19 | 70 | 6 | Getting IIS Worker Process Crash dumps | I'm doing something bad in my ASP.NET app. It could be the any number of CTP libraries I'm using or I'm just not disposing something properly. But when I redeploy my ASP.NET to my Vista IIS7 install or my server's IIS6 install I crash an IIS worker process.
I've narrowed the problem down to my HTTP crawler, which is a multithreaded beast that crawls sites for useful information when asked to. After I start a crawler and redeploy the app over the top, rather than gracefully unloading the appDomain and reloading, an IIS worker process will crash (popping up a crash message) and continue reloading the app domain.
When this crash happens, where can I find the crash dump for analysis?
| c# | asp.net | debugging | multithreading | null | null | open | Getting IIS Worker Process Crash dumps
===
I'm doing something bad in my ASP.NET app. It could be the any number of CTP libraries I'm using or I'm just not disposing something properly. But when I redeploy my ASP.NET to my Vista IIS7 install or my server's IIS6 install I crash an IIS worker process.
I've narrowed the problem down to my HTTP crawler, which is a multithreaded beast that crawls sites for useful information when asked to. After I start a crawler and redeploy the app over the top, rather than gracefully unloading the appDomain and reloading, an IIS worker process will crash (popping up a crash message) and continue reloading the app domain.
When this crash happens, where can I find the crash dump for analysis?
| 0 |
53,439 | 09/10/2008 04:55:21 | 266 | 08/04/2008 10:02:44 | 1,146 | 30 | Is it possible to unit test p/invoke calls? | I want to wrap a piece of code that uses the Windows Impersonation API into a neat little helper class, and as usual, I'm looking for a way to go test-first. However, while WindowsIdentity is a managed class, the LogonUser call that is required to actually perform the logging in as another user is an unmanaged function in advapi32.dll.
I think I can work around this by introducing an interface for my helper class to use and hiding the P/Invoke calls in an implementation, but testing that implementation will still be a problem. And you can imagine actually performing the impersonation in the test can be a bit problematic, given that the user would actually need to exist on the system. | c# | unit-testing | impersonation | unmanaged | null | null | open | Is it possible to unit test p/invoke calls?
===
I want to wrap a piece of code that uses the Windows Impersonation API into a neat little helper class, and as usual, I'm looking for a way to go test-first. However, while WindowsIdentity is a managed class, the LogonUser call that is required to actually perform the logging in as another user is an unmanaged function in advapi32.dll.
I think I can work around this by introducing an interface for my helper class to use and hiding the P/Invoke calls in an implementation, but testing that implementation will still be a problem. And you can imagine actually performing the impersonation in the test can be a bit problematic, given that the user would actually need to exist on the system. | 0 |
53,444 | 09/10/2008 04:59:45 | 157 | 08/02/2008 17:42:25 | 773 | 45 | donation services | A friend came to me about a donation service on his website. We want to go as cheap as possible, and when I suggested paypal he said he wants to go an "independent" route --I think this means he doesn't want a gateway service, but I don't think that is possible without collecting the data and going old school with paper (please correct me!). There is another post that mentions [ecommerce][1] that I looked at. And from his list, pretty much all I need to take care of is the:
> [*Justin Standard:*][3]
>> - Secure session for users
>> - Payment processing
>> - what external systems do you interface with
>> - what kinds of payments do you accept
>> - what currencies do you accept
The first might be done for us with the third party service, but if there is a way to go "independent", then I will deal with that when it comes up.
It's a donation, so we are obviously going to want to maximize what we can accept. I saw a list of [services online][2], but it looks god old. Some of the sites seem reputable, and I've been looking at them. But I'd really like to ask the community what services they've possibly used and been happy with or ones they've heard good things about.
[1]: http://stackoverflow.com/questions/12010/shopping-cart
[2]: http://www.affinityresources.com/pgs/awz55Online2.shtml
[3]: http://stackoverflow.com/questions/12010/shopping-cart#12012 | e-commerce | payment | donation | null | null | null | open | donation services
===
A friend came to me about a donation service on his website. We want to go as cheap as possible, and when I suggested paypal he said he wants to go an "independent" route --I think this means he doesn't want a gateway service, but I don't think that is possible without collecting the data and going old school with paper (please correct me!). There is another post that mentions [ecommerce][1] that I looked at. And from his list, pretty much all I need to take care of is the:
> [*Justin Standard:*][3]
>> - Secure session for users
>> - Payment processing
>> - what external systems do you interface with
>> - what kinds of payments do you accept
>> - what currencies do you accept
The first might be done for us with the third party service, but if there is a way to go "independent", then I will deal with that when it comes up.
It's a donation, so we are obviously going to want to maximize what we can accept. I saw a list of [services online][2], but it looks god old. Some of the sites seem reputable, and I've been looking at them. But I'd really like to ask the community what services they've possibly used and been happy with or ones they've heard good things about.
[1]: http://stackoverflow.com/questions/12010/shopping-cart
[2]: http://www.affinityresources.com/pgs/awz55Online2.shtml
[3]: http://stackoverflow.com/questions/12010/shopping-cart#12012 | 0 |
53,450 | 09/10/2008 05:07:25 | 4,239 | 09/02/2008 13:46:59 | 53 | 6 | When building a Handler, should it be .ashx or .axd? | Say I'm building an ASP.Net class that inherits from IHttpHandler, should I wire this up to a URL ending in .ashx, or should I use the .axd extension?
Does it matter as long as there's no naming conflict? | asp.net | null | null | null | null | null | open | When building a Handler, should it be .ashx or .axd?
===
Say I'm building an ASP.Net class that inherits from IHttpHandler, should I wire this up to a URL ending in .ashx, or should I use the .axd extension?
Does it matter as long as there's no naming conflict? | 0 |
53,464 | 09/10/2008 05:20:54 | 959 | 08/11/2008 05:23:02 | 143 | 13 | How to stop IIS asking authentication for default website on localhost | I have IIS 5.1 installed on Windows XP Pro SP2. Besides I have installed VS 2008 Express with .NET 3.5. So obviously IIS is configured for ASP.NET automatically for .NET 3.5
The problem is whenever I access http://localhost IE & Firefox both presents authentication box. Even if I enter Administrator user and its password, the authentication fails. I have already checked the anonymous user access (with IUSR_ user and password is controlled by IIS) in Directory Security options of default website.
However other deployed web apps work fine (does not ask for any authentication).
In IE this authentication process stops if I add http://localhost in Intranet sites option.
Please note that the file system is FAT32 when IIS is installed.
Regards,
Jatan | iis | null | null | null | null | null | open | How to stop IIS asking authentication for default website on localhost
===
I have IIS 5.1 installed on Windows XP Pro SP2. Besides I have installed VS 2008 Express with .NET 3.5. So obviously IIS is configured for ASP.NET automatically for .NET 3.5
The problem is whenever I access http://localhost IE & Firefox both presents authentication box. Even if I enter Administrator user and its password, the authentication fails. I have already checked the anonymous user access (with IUSR_ user and password is controlled by IIS) in Directory Security options of default website.
However other deployed web apps work fine (does not ask for any authentication).
In IE this authentication process stops if I add http://localhost in Intranet sites option.
Please note that the file system is FAT32 when IIS is installed.
Regards,
Jatan | 0 |
53,472 | 09/10/2008 05:28:46 | 4,121 | 09/01/2008 21:29:49 | 20 | 1 | Best way to convert a Ruby string range to a Range object | I have some Ruby code which takes dates on the command line in the format:
-d 20080101,20080201..20080229,20080301
Which means I want to run for all dates between 20080201 and 20080229 (inclusive) and the other dates present in the list.
Given I can get the string 20080201..20080229 what is the best way to convert this to an instance of Range. Currently I am using eval, but it feels like there should be a better way. | ruby | null | null | null | null | null | open | Best way to convert a Ruby string range to a Range object
===
I have some Ruby code which takes dates on the command line in the format:
-d 20080101,20080201..20080229,20080301
Which means I want to run for all dates between 20080201 and 20080229 (inclusive) and the other dates present in the list.
Given I can get the string 20080201..20080229 what is the best way to convert this to an instance of Range. Currently I am using eval, but it feels like there should be a better way. | 0 |
53,473 | 09/10/2008 05:29:40 | 5,512 | 09/10/2008 05:29:40 | 1 | 0 | Javascript - Applying class to an HTML tag given an attribute/value | I am trying to apply styles to HTML tags dynamically by reading in the value of certain HTML attributes and applying a class name based on their values. For instance, if I have:
`<p height="30">`
I want to apply a `class="h30"` to that paragraph so that I can style it in my style sheet. I can't find any information on getting the value of an attribute that is not an `id` or `class`. Help? | javascript | html | attributes | null | null | null | open | Javascript - Applying class to an HTML tag given an attribute/value
===
I am trying to apply styles to HTML tags dynamically by reading in the value of certain HTML attributes and applying a class name based on their values. For instance, if I have:
`<p height="30">`
I want to apply a `class="h30"` to that paragraph so that I can style it in my style sheet. I can't find any information on getting the value of an attribute that is not an `id` or `class`. Help? | 0 |
53,479 | 09/10/2008 05:37:26 | 5,110 | 09/07/2008 22:57:07 | 8 | 5 | ASP.NET MVC vs. Web client software factory (WCSF) | I have recently been doing a bit of investigation into the different types of Model View architectures, and need to decide which one to pursue for future in-house development. As I'm currently working in a Microsoft shop that has ASP.NET skills, it seems my options are between ASP.NET MVC and WCSF (Monorail is probably out of the as it wouldn't be supported by Microsoft).
After reading [the ASP.NET MVC framework, using the WCSF as a yardstick][1], I picked up the following points:
- ASP.NET MVC cannot use web controls that rely on postbacks, whereas WCSF can.
- You have more control over the urls in an ASP.NET MVC site as opposed to a WCSF site.
- An ASP.NET MVC site will probably be easier to test than an equivalent WCSF version.
- It seems that the WCSF still uses the code behind to control UI events under some circumstances, but ASP.NET doesn't allow this.
What are some of the other considerations?<br/>
What have I misunderstood?<br/>
Is there anybody out there who has used both frameworks and has advice either way?
[1]: http://blogs.msdn.com/simonince/archive/2007/11/22/the-asp-net-mvc-framework-using-the-wcsf-as-a-yardstick.aspx | asp.net | asp.net-mvc | wcsf | null | null | null | open | ASP.NET MVC vs. Web client software factory (WCSF)
===
I have recently been doing a bit of investigation into the different types of Model View architectures, and need to decide which one to pursue for future in-house development. As I'm currently working in a Microsoft shop that has ASP.NET skills, it seems my options are between ASP.NET MVC and WCSF (Monorail is probably out of the as it wouldn't be supported by Microsoft).
After reading [the ASP.NET MVC framework, using the WCSF as a yardstick][1], I picked up the following points:
- ASP.NET MVC cannot use web controls that rely on postbacks, whereas WCSF can.
- You have more control over the urls in an ASP.NET MVC site as opposed to a WCSF site.
- An ASP.NET MVC site will probably be easier to test than an equivalent WCSF version.
- It seems that the WCSF still uses the code behind to control UI events under some circumstances, but ASP.NET doesn't allow this.
What are some of the other considerations?<br/>
What have I misunderstood?<br/>
Is there anybody out there who has used both frameworks and has advice either way?
[1]: http://blogs.msdn.com/simonince/archive/2007/11/22/the-asp-net-mvc-framework-using-the-wcsf-as-a-yardstick.aspx | 0 |
53,480 | 09/10/2008 05:37:30 | 5,369 | 09/09/2008 11:14:39 | 46 | 9 | Fuzzy text (sentences/titles) matching in C# | Hey, I'm using [Levenshteins][1] algorithm to get distance between source and target string.
also I have method which returns value from 0 to 1:
/// <summary>
/// Gets the similarity between two strings.
/// All relation scores are in the [0, 1] range,
/// which means that if the score gets a maximum value (equal to 1)
/// then the two string are absolutely similar
/// </summary>
/// <param name="string1">The string1.</param>
/// <param name="string2">The string2.</param>
/// <returns></returns>
public static float CalculateSimilarity(String s1, String s2)
{
if ((s1 == null) || (s2 == null)) return 0.0f;
float dis = LevenshteinDistance.Compute(s1, s2);
float maxLen = s1.Length;
if (maxLen < s2.Length)
maxLen = s2.Length;
if (maxLen == 0.0F)
return 1.0F;
else return 1.0F - dis / maxLen;
}
but this for me is not enough. Because I need more complex way to match two sentences.
For example I want automatically tag some music, I have original song names, and i have songs with trash, like *super, quality,* years like *2007, 2008,* etc..etc.. also some files have just http://trash..thash..song_name_mp3.mp3, other are normal. I want to create an algorithm which will work just more perfect than mine now.. Maybe anyone can help me?
here is my current algo:
/// <summary>
/// if we need to ignore this target.
/// </summary>
/// <param name="targetString">The target string.</param>
/// <returns></returns>
private bool doIgnore(String targetString)
{
if ((targetString != null) && (targetString != String.Empty))
{
for (int i = 0; i < ignoreWordsList.Length; ++i)
{
//* if we found ignore word or target string matching some some special cases like years (Regex).
if (targetString == ignoreWordsList[i] || (isMatchInSpecialCases(targetString))) return true;
}
}
return false;
}
/// <summary>
/// Removes the duplicates.
/// </summary>
/// <param name="list">The list.</param>
private void removeDuplicates(List<String> list)
{
if ((list != null) && (list.Count > 0))
{
for (int i = 0; i < list.Count - 1; ++i)
{
if (list[i] == list[i + 1])
{
list.RemoveAt(i);
--i;
}
}
}
}
/// <summary>
/// Does the fuzzy match.
/// </summary>
/// <param name="targetTitle">The target title.</param>
/// <returns></returns>
private TitleMatchResult doFuzzyMatch(String targetTitle)
{
TitleMatchResult matchResult = null;
if (targetTitle != null && targetTitle != String.Empty)
{
try
{
//* change target title (string) to lower case.
targetTitle = targetTitle.ToLower();
//* scores, we will select higher score at the end.
Dictionary<Title, float> scores = new Dictionary<Title, float>();
//* do split special chars: '-', ' ', '.', ',', '?', '/', ':', ';', '%', '(', ')', '#', '\"', '\'', '!', '|', '^', '*', '[', ']', '{', '}', '=', '!', '+', '_'
List<String> targetKeywords = new List<string>(targetTitle.Split(ignoreCharsList, StringSplitOptions.RemoveEmptyEntries));
//* remove all trash from keywords, like super, quality, etc..
targetKeywords.RemoveAll(delegate(String x) { return doIgnore(x); });
//* sort keywords.
targetKeywords.Sort();
//* remove some duplicates.
removeDuplicates(targetKeywords);
//* go through all original titles.
foreach (Title sourceTitle in titles)
{
float tempScore = 0f;
//* split orig. title to keywords list.
List<String> sourceKeywords = new List<string>(sourceTitle.Name.Split(ignoreCharsList, StringSplitOptions.RemoveEmptyEntries));
sourceKeywords.Sort();
removeDuplicates(sourceKeywords);
//* go through all source ttl keywords.
foreach (String keyw1 in sourceKeywords)
{
float max = float.MinValue;
foreach (String keyw2 in targetKeywords)
{
float currentScore = StringMatching.StringMatching.CalculateSimilarity(keyw1.ToLower(), keyw2);
if (currentScore > max)
{
max = currentScore;
}
}
tempScore += max;
}
//* calculate average score.
float averageScore = (tempScore / Math.Max(targetKeywords.Count, sourceKeywords.Count));
//* if average score is bigger than minimal score and target title is not in this source title ignore list.
if (averageScore >= minimalScore && !sourceTitle.doIgnore(targetTitle))
{
//* add score.
scores.Add(sourceTitle, averageScore);
}
}
//* choose biggest score.
float maxi = float.MinValue;
foreach (KeyValuePair<Title, float> kvp in scores)
{
if (kvp.Value > maxi)
{
maxi = kvp.Value;
matchResult = new TitleMatchResult(maxi, kvp.Key, MatchTechnique.FuzzyLogic);
}
}
}
catch { }
}
//* return result.
return matchResult;
}
This works normally but just in some cases, a lot of titles which should match, does not match... I think I need some kind of formula to play with weights and etc, but i can't think of one..
Ideas? Suggestions? Algos?
by the way I already know this topic (My colleague already posted it but we cannot come with a proper solution for this problem.):
[http://stackoverflow.com/questions/49263/approximate-string-matching-algorithms][2]
[1]: http://en.wikipedia.org/wiki/Levenshtein_distance
[2]: http://stackoverflow.com/questions/49263/approximate-string-matching-algorithms | c# | algorithm | string | fuzzy-search | null | null | open | Fuzzy text (sentences/titles) matching in C#
===
Hey, I'm using [Levenshteins][1] algorithm to get distance between source and target string.
also I have method which returns value from 0 to 1:
/// <summary>
/// Gets the similarity between two strings.
/// All relation scores are in the [0, 1] range,
/// which means that if the score gets a maximum value (equal to 1)
/// then the two string are absolutely similar
/// </summary>
/// <param name="string1">The string1.</param>
/// <param name="string2">The string2.</param>
/// <returns></returns>
public static float CalculateSimilarity(String s1, String s2)
{
if ((s1 == null) || (s2 == null)) return 0.0f;
float dis = LevenshteinDistance.Compute(s1, s2);
float maxLen = s1.Length;
if (maxLen < s2.Length)
maxLen = s2.Length;
if (maxLen == 0.0F)
return 1.0F;
else return 1.0F - dis / maxLen;
}
but this for me is not enough. Because I need more complex way to match two sentences.
For example I want automatically tag some music, I have original song names, and i have songs with trash, like *super, quality,* years like *2007, 2008,* etc..etc.. also some files have just http://trash..thash..song_name_mp3.mp3, other are normal. I want to create an algorithm which will work just more perfect than mine now.. Maybe anyone can help me?
here is my current algo:
/// <summary>
/// if we need to ignore this target.
/// </summary>
/// <param name="targetString">The target string.</param>
/// <returns></returns>
private bool doIgnore(String targetString)
{
if ((targetString != null) && (targetString != String.Empty))
{
for (int i = 0; i < ignoreWordsList.Length; ++i)
{
//* if we found ignore word or target string matching some some special cases like years (Regex).
if (targetString == ignoreWordsList[i] || (isMatchInSpecialCases(targetString))) return true;
}
}
return false;
}
/// <summary>
/// Removes the duplicates.
/// </summary>
/// <param name="list">The list.</param>
private void removeDuplicates(List<String> list)
{
if ((list != null) && (list.Count > 0))
{
for (int i = 0; i < list.Count - 1; ++i)
{
if (list[i] == list[i + 1])
{
list.RemoveAt(i);
--i;
}
}
}
}
/// <summary>
/// Does the fuzzy match.
/// </summary>
/// <param name="targetTitle">The target title.</param>
/// <returns></returns>
private TitleMatchResult doFuzzyMatch(String targetTitle)
{
TitleMatchResult matchResult = null;
if (targetTitle != null && targetTitle != String.Empty)
{
try
{
//* change target title (string) to lower case.
targetTitle = targetTitle.ToLower();
//* scores, we will select higher score at the end.
Dictionary<Title, float> scores = new Dictionary<Title, float>();
//* do split special chars: '-', ' ', '.', ',', '?', '/', ':', ';', '%', '(', ')', '#', '\"', '\'', '!', '|', '^', '*', '[', ']', '{', '}', '=', '!', '+', '_'
List<String> targetKeywords = new List<string>(targetTitle.Split(ignoreCharsList, StringSplitOptions.RemoveEmptyEntries));
//* remove all trash from keywords, like super, quality, etc..
targetKeywords.RemoveAll(delegate(String x) { return doIgnore(x); });
//* sort keywords.
targetKeywords.Sort();
//* remove some duplicates.
removeDuplicates(targetKeywords);
//* go through all original titles.
foreach (Title sourceTitle in titles)
{
float tempScore = 0f;
//* split orig. title to keywords list.
List<String> sourceKeywords = new List<string>(sourceTitle.Name.Split(ignoreCharsList, StringSplitOptions.RemoveEmptyEntries));
sourceKeywords.Sort();
removeDuplicates(sourceKeywords);
//* go through all source ttl keywords.
foreach (String keyw1 in sourceKeywords)
{
float max = float.MinValue;
foreach (String keyw2 in targetKeywords)
{
float currentScore = StringMatching.StringMatching.CalculateSimilarity(keyw1.ToLower(), keyw2);
if (currentScore > max)
{
max = currentScore;
}
}
tempScore += max;
}
//* calculate average score.
float averageScore = (tempScore / Math.Max(targetKeywords.Count, sourceKeywords.Count));
//* if average score is bigger than minimal score and target title is not in this source title ignore list.
if (averageScore >= minimalScore && !sourceTitle.doIgnore(targetTitle))
{
//* add score.
scores.Add(sourceTitle, averageScore);
}
}
//* choose biggest score.
float maxi = float.MinValue;
foreach (KeyValuePair<Title, float> kvp in scores)
{
if (kvp.Value > maxi)
{
maxi = kvp.Value;
matchResult = new TitleMatchResult(maxi, kvp.Key, MatchTechnique.FuzzyLogic);
}
}
}
catch { }
}
//* return result.
return matchResult;
}
This works normally but just in some cases, a lot of titles which should match, does not match... I think I need some kind of formula to play with weights and etc, but i can't think of one..
Ideas? Suggestions? Algos?
by the way I already know this topic (My colleague already posted it but we cannot come with a proper solution for this problem.):
[http://stackoverflow.com/questions/49263/approximate-string-matching-algorithms][2]
[1]: http://en.wikipedia.org/wiki/Levenshtein_distance
[2]: http://stackoverflow.com/questions/49263/approximate-string-matching-algorithms | 0 |
53,482 | 09/10/2008 05:41:34 | 4,960 | 09/07/2008 02:07:20 | 286 | 14 | How do I change the password of the root user in MySQL? | I have long since forgotten the password for the root user on one of my boxes. Is there a way I can change it without having to log in to the instance, or will I have to reinstall?
| mysql | null | null | null | null | null | open | How do I change the password of the root user in MySQL?
===
I have long since forgotten the password for the root user on one of my boxes. Is there a way I can change it without having to log in to the instance, or will I have to reinstall?
| 0 |
53,489 | 09/10/2008 05:50:39 | 4,883 | 09/06/2008 10:24:59 | 504 | 5 | How do you list all processes on the command line in Windows? | Is there a command equivalent to 'ps' on Unix that can list all processes on a Windows machine? | windows | command-line | null | null | null | null | open | How do you list all processes on the command line in Windows?
===
Is there a command equivalent to 'ps' on Unix that can list all processes on a Windows machine? | 0 |
53,491 | 09/10/2008 05:52:21 | 4,960 | 09/07/2008 02:07:20 | 291 | 15 | How do I enable external access to MySQL Server? | How do I enable external access to MySQL Server? I can connect locally but I cannot connect from another box on the network.
I just tried
grant all privileges on *.* to root@'%' identified by '*****' with grant option;
And restarted MySQL Server with no success.
| mysql | null | null | null | null | null | open | How do I enable external access to MySQL Server?
===
How do I enable external access to MySQL Server? I can connect locally but I cannot connect from another box on the network.
I just tried
grant all privileges on *.* to root@'%' identified by '*****' with grant option;
And restarted MySQL Server with no success.
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.