question_id
int64
4
6.31M
answer_id
int64
7
6.31M
title
stringlengths
9
150
question_body
stringlengths
0
28.8k
answer_body
stringlengths
60
27.2k
question_text
stringlengths
40
28.9k
combined_text
stringlengths
124
39.6k
tags
listlengths
1
6
question_score
int64
0
26.3k
answer_score
int64
0
28.8k
view_count
int64
15
14M
answer_count
int64
0
182
favorite_count
int64
0
32
question_creation_date
stringdate
2008-07-31 21:42:52
2011-06-10 18:12:18
answer_creation_date
stringdate
2008-07-31 22:17:57
2011-06-10 18:14:17
183,567
183,639
Zero-to-many relationship with Linq to SQL
I have a User class which may or may not have an associated Department. This is referenced through the foreign key DepartmentId, and the relevant field in the User table is set to allow nulls. When I set up my "Create User" form and select no Department, I get a conflict error on SubmitChanges(): The INSERT statement c...
I have found a less-than-desirable solution by putting the following in my UsersController.Create method: // Snipped UpdateModel call if (form["User.DepartmentId"].Length == 0) { createdUser.DepartmentId = null; } Models.User.DataContext.SubmitChanges(); Of course, I would prefer something that is cleaner / automatic.
Zero-to-many relationship with Linq to SQL I have a User class which may or may not have an associated Department. This is referenced through the foreign key DepartmentId, and the relevant field in the User table is set to allow nulls. When I set up my "Create User" form and select no Department, I get a conflict error...
TITLE: Zero-to-many relationship with Linq to SQL QUESTION: I have a User class which may or may not have an associated Department. This is referenced through the foreign key DepartmentId, and the relevant field in the User table is set to allow nulls. When I set up my "Create User" form and select no Department, I ge...
[ "linq-to-sql" ]
1
1
1,555
2
0
2008-10-08T16:08:43.267000
2008-10-08T16:25:51.440000
183,578
183,875
Error installing newgem on linux
I am trying to install newgem on my linux box (sudo gem install newgem) and i am getting the following error: Building native extensions. This could take a while... ERROR: Error installing newgem: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb install newgem extconf.rb:1:in `require': no such...
mkmf is a Ruby module which generates Makefiles. It is supposed to be part of the standard Ruby install, but Debian (and derivatives) split it out into the ruby1.8-dev package. If you can't find mkmf.rb in any of the directories outputted by ruby -e'print $:.join("\n")', then you should figure out what you need to inst...
Error installing newgem on linux I am trying to install newgem on my linux box (sudo gem install newgem) and i am getting the following error: Building native extensions. This could take a while... ERROR: Error installing newgem: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb install newgem e...
TITLE: Error installing newgem on linux QUESTION: I am trying to install newgem on my linux box (sudo gem install newgem) and i am getting the following error: Building native extensions. This could take a while... ERROR: Error installing newgem: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.r...
[ "ruby", "linux" ]
5
6
462
2
0
2008-10-08T16:11:45.790000
2008-10-08T17:23:04.663000
183,585
184,032
SQL command to LINQ (pivoting)
I'm moving DB from MySQL (used ODBC) to MS SQL and I want to "translate" SQL queries to LINQ. Can someone help me with this (it should SUM Charge column for every location and group result by months): SELECT sum(case when Location="Location1" then Charge else 0 end) as Location1, sum(case when Location="Location2" then...
This might help. context.log_sales.GroupBy(s => new {Year = OrderTime.Year, Month = OrderTime.Month}).Select ( g => new { Date = new DateTime(g.Key.Year, g.Key.Month, 1), Location1 = g.Where(s => s.Location == "Location1").Sum(s => s.Charge), Location2 = g.Where(s => s.Location == "Location2").Sum(s => s.Charge), Locat...
SQL command to LINQ (pivoting) I'm moving DB from MySQL (used ODBC) to MS SQL and I want to "translate" SQL queries to LINQ. Can someone help me with this (it should SUM Charge column for every location and group result by months): SELECT sum(case when Location="Location1" then Charge else 0 end) as Location1, sum(case...
TITLE: SQL command to LINQ (pivoting) QUESTION: I'm moving DB from MySQL (used ODBC) to MS SQL and I want to "translate" SQL queries to LINQ. Can someone help me with this (it should SUM Charge column for every location and group result by months): SELECT sum(case when Location="Location1" then Charge else 0 end) as L...
[ "sql", "linq", "pivot" ]
3
6
1,996
2
0
2008-10-08T16:13:18.983000
2008-10-08T18:03:46.517000
183,586
192,996
Tool for generating C# classes from NHibernate mappings files?
What tool is there for generating C# classes from NHibernate mappings files?
On the NHibernate resources page under 'Helpful tools', there are a few code generators listed: http://nhibernate.info/doc/nh/en/index.html
Tool for generating C# classes from NHibernate mappings files? What tool is there for generating C# classes from NHibernate mappings files?
TITLE: Tool for generating C# classes from NHibernate mappings files? QUESTION: What tool is there for generating C# classes from NHibernate mappings files? ANSWER: On the NHibernate resources page under 'Helpful tools', there are a few code generators listed: http://nhibernate.info/doc/nh/en/index.html
[ "nhibernate" ]
2
1
3,133
3
0
2008-10-08T16:13:23.947000
2008-10-10T20:58:26.540000
183,602
183,964
Why does Visual Studio take so long to delete a file
Why does Visual studio take so long to delete a file from the solution tree? The app freezes and sits there for what feels like an eternity. If I delete the file from the file system first, then delete it in the solution it happens instantly. Is there an option I can set somewhere to avoid this?
I've found that when there is a lot in my Recycle Bin (1000s of files), it takes longer to delete a file in Windows Explorer as well as Visual Studio.
Why does Visual Studio take so long to delete a file Why does Visual studio take so long to delete a file from the solution tree? The app freezes and sits there for what feels like an eternity. If I delete the file from the file system first, then delete it in the solution it happens instantly. Is there an option I can...
TITLE: Why does Visual Studio take so long to delete a file QUESTION: Why does Visual studio take so long to delete a file from the solution tree? The app freezes and sits there for what feels like an eternity. If I delete the file from the file system first, then delete it in the solution it happens instantly. Is the...
[ "visual-studio" ]
15
20
6,495
6
0
2008-10-08T16:15:57.183000
2008-10-08T17:47:43.460000
183,604
1,183,481
How do I create an ActiveRecord relationship to an ActiveResource object?
Let's say I'm writing a Library application for a publishing company who already has a People application. So in my Library application I have class Person < ActiveResource::Base self.site = "http://api.people.mypublisher.com/" end and now I want to store Article s for each Person: class Article < ActiveRecord::Base be...
As you point out, you are giving up a lot because ActiveResource does not have associations in the sense that ActiveRecord does. You have already found the answer to question #1. As for question #2, your ActiveRecord model Article should behave just fine when configured with a "belongs_to" association to an ActiveResou...
How do I create an ActiveRecord relationship to an ActiveResource object? Let's say I'm writing a Library application for a publishing company who already has a People application. So in my Library application I have class Person < ActiveResource::Base self.site = "http://api.people.mypublisher.com/" end and now I want...
TITLE: How do I create an ActiveRecord relationship to an ActiveResource object? QUESTION: Let's say I'm writing a Library application for a publishing company who already has a People application. So in my Library application I have class Person < ActiveResource::Base self.site = "http://api.people.mypublisher.com/" ...
[ "ruby-on-rails", "activerecord", "activeresource" ]
5
2
4,286
3
0
2008-10-08T16:16:54.530000
2009-07-26T01:08:31.590000
183,606
183,678
Comparison Functor Types vs. operator<
In the Google C++ Style Guide, the section on Operator Overloading recommends against overloading any operators ("except in rare, special circumstances"). Specifically, it recommends: In particular, do not overload operator== or operator< just so that your class can be used as a key in an STL container; instead, you sh...
Except for the more fundamental types, the less-than operation isn't always trivial, and even equality may vary from situation to situation. Imagine the situation of an airline that wants to assign all passengers a boarding number. This number reflects the boarding order (of course). Now, what determines who comes befo...
Comparison Functor Types vs. operator< In the Google C++ Style Guide, the section on Operator Overloading recommends against overloading any operators ("except in rare, special circumstances"). Specifically, it recommends: In particular, do not overload operator== or operator< just so that your class can be used as a k...
TITLE: Comparison Functor Types vs. operator< QUESTION: In the Google C++ Style Guide, the section on Operator Overloading recommends against overloading any operators ("except in rare, special circumstances"). Specifically, it recommends: In particular, do not overload operator== or operator< just so that your class ...
[ "c++", "stl", "coding-style" ]
11
17
9,330
7
0
2008-10-08T16:17:28.070000
2008-10-08T16:32:55.590000
183,622
183,647
How do I compare strings in Bourne Shell?
I need to compare strings in shell: var1="mtu eth0" if [ "$var1" == "mtu *" ] then # do something fi But obviously the "*" doesn't work in Shell. Is there a way to do it?
bash Shortest fix: if [[ "$var1" = "mtu "* ]] Bash's [[ ]] doesn't get glob-expanded, unlike [ ] (which must, for historical reasons). bash --posix Oh, I posted too fast. Bourne shell, not Bash... if [ "${var1:0:4}" == "mtu " ] ${var1:0:4} means the first four characters of $var1. /bin/sh Ah, sorry. Bash's POSIX emulat...
How do I compare strings in Bourne Shell? I need to compare strings in shell: var1="mtu eth0" if [ "$var1" == "mtu *" ] then # do something fi But obviously the "*" doesn't work in Shell. Is there a way to do it?
TITLE: How do I compare strings in Bourne Shell? QUESTION: I need to compare strings in shell: var1="mtu eth0" if [ "$var1" == "mtu *" ] then # do something fi But obviously the "*" doesn't work in Shell. Is there a way to do it? ANSWER: bash Shortest fix: if [[ "$var1" = "mtu "* ]] Bash's [[ ]] doesn't get glob-exp...
[ "shell", "sh", "posix" ]
16
9
65,440
7
0
2008-10-08T16:21:47.907000
2008-10-08T16:27:34.527000
183,629
201,083
What is the best practice for JPA/Hibernate entity classes and synchronization?
It seems like most examples of JPA/Hibernate entity bean classes I've seen do no explicit synchronization. Yet, it is possible to call getters/setters on those objects in the context of building up a transaction. And it's possible for those methods to be called across multiple threads (although maybe that's unusual and...
The object probably is not the same for the 2 threads. Supposing your threads use a session factory to access the db, the objects you get from the session should be viewed as 'independent' (I believe hibernate creates 'fresh' objects for each get(), unless they are in the session). As for your stars question, it's the ...
What is the best practice for JPA/Hibernate entity classes and synchronization? It seems like most examples of JPA/Hibernate entity bean classes I've seen do no explicit synchronization. Yet, it is possible to call getters/setters on those objects in the context of building up a transaction. And it's possible for those...
TITLE: What is the best practice for JPA/Hibernate entity classes and synchronization? QUESTION: It seems like most examples of JPA/Hibernate entity bean classes I've seen do no explicit synchronization. Yet, it is possible to call getters/setters on those objects in the context of building up a transaction. And it's ...
[ "java", "multithreading", "hibernate", "jpa" ]
2
1
6,352
5
0
2008-10-08T16:23:38.917000
2008-10-14T13:08:35.940000
183,638
183,644
Making my ajax updated div fade in
I have this code that performs an ajax call and loads the results into two duplicate divs every time a dropdown is changed. I want the results to be faded into the div, to give a more obvious indication that something has changed, as its so seamless its sometimes hard to notice the change! print("$('.ajaxdropdown').cha...
You'll have to hide() it before you can use fadeIn(). UPDATE: Here's how you'd do this by chaining: $("#charges-gsm-faq").hide().html(html).fadeIn(); $("#charges-gsm-prices").hide().html(html).fadeIn();
Making my ajax updated div fade in I have this code that performs an ajax call and loads the results into two duplicate divs every time a dropdown is changed. I want the results to be faded into the div, to give a more obvious indication that something has changed, as its so seamless its sometimes hard to notice the ch...
TITLE: Making my ajax updated div fade in QUESTION: I have this code that performs an ajax call and loads the results into two duplicate divs every time a dropdown is changed. I want the results to be faded into the div, to give a more obvious indication that something has changed, as its so seamless its sometimes har...
[ "jquery", "ajax" ]
28
50
38,995
5
0
2008-10-08T16:25:42.437000
2008-10-08T16:27:10.283000
183,642
183,664
What do the letter codes in Oracle user_contraints table's constraint_type column stand for?
select distinct constraint_type from user_constraints; C - C P R U Seems P means primary key and R means foreign key, correct? What are U and C?
Code Description Acts On Level --------------------------------------------- C Check on a table Column O Read Only on a view Object P Primary Key Object R Referential (Foreign Key) Column U Unique Key Column V Check Option on a view Object
What do the letter codes in Oracle user_contraints table's constraint_type column stand for? select distinct constraint_type from user_constraints; C - C P R U Seems P means primary key and R means foreign key, correct? What are U and C?
TITLE: What do the letter codes in Oracle user_contraints table's constraint_type column stand for? QUESTION: select distinct constraint_type from user_constraints; C - C P R U Seems P means primary key and R means foreign key, correct? What are U and C? ANSWER: Code Description Acts On Level -----------------------...
[ "oracle", "constraints", "oracleinternals" ]
75
74
83,691
2
0
2008-10-08T16:26:35.103000
2008-10-08T16:31:28.120000
183,656
183,674
How to Digitally "Sign" a document
I don't like paper documents. I like everything stored on a server. I'd like to avoid printing, signing, and scanning, if possible. How do I get signatures from people to sign-off on forms and still keep it digital? The purpose of signing is to prove that certain departments have OK'd the document. Most of these people...
There are myriad approaches discussed in Schneier's Applied Cryptography. Much of what you're looking for comes down to a Digital Signature Algorithm (DSA) - of which NIST has one, asymetric encryption algorithms can provide, etc. The simple route would be to collect delivery and read receipts on email, but that's not ...
How to Digitally "Sign" a document I don't like paper documents. I like everything stored on a server. I'd like to avoid printing, signing, and scanning, if possible. How do I get signatures from people to sign-off on forms and still keep it digital? The purpose of signing is to prove that certain departments have OK'd...
TITLE: How to Digitally "Sign" a document QUESTION: I don't like paper documents. I like everything stored on a server. I'd like to avoid printing, signing, and scanning, if possible. How do I get signatures from people to sign-off on forms and still keep it digital? The purpose of signing is to prove that certain dep...
[ "security", "cryptography" ]
12
2
12,683
12
0
2008-10-08T16:30:12.227000
2008-10-08T16:32:46.403000
183,675
184,142
Firebird stored procedure for concatenating all field values from multiple rows
my goal is to write a stored proc that can collect all field values from multiple rows into one single output variable (maybe varchar(some_length)). It may seem strange solution but i've quite positive its the only one i can use at that situation im in. I have not used Firebird before and stored procs look way differen...
The following procedure does what you describe: SET TERM!!; CREATE PROCEDURE concat_names RETURNS (concat VARCHAR(2000)) AS DECLARE VARIABLE name VARCHAR(100); BEGIN concat = ''; FOR SELECT first_name || ' ' || last_name FROM employee INTO:name DO BEGIN concat = concat || name || ', '; END END!! SET TERM;!! EXECUTE PRO...
Firebird stored procedure for concatenating all field values from multiple rows my goal is to write a stored proc that can collect all field values from multiple rows into one single output variable (maybe varchar(some_length)). It may seem strange solution but i've quite positive its the only one i can use at that sit...
TITLE: Firebird stored procedure for concatenating all field values from multiple rows QUESTION: my goal is to write a stored proc that can collect all field values from multiple rows into one single output variable (maybe varchar(some_length)). It may seem strange solution but i've quite positive its the only one i c...
[ "database", "stored-procedures", "firebird" ]
5
5
7,970
3
0
2008-10-08T16:32:47.120000
2008-10-08T18:24:38.907000
183,685
183,691
C# Set collection?
Does anyone know if there is a good equivalent to Java's Set collection in C#? I know that you can somewhat mimic a set using a Dictionary or a HashTable by populating but ignoring the values, but that's not a very elegant way.
Try HashSet: The HashSet(Of T) class provides high-performance set operations. A set is a collection that contains no duplicate elements, and whose elements are in no particular order... The capacity of a HashSet(Of T) object is the number of elements that the object can hold. A HashSet(Of T) object's capacity automati...
C# Set collection? Does anyone know if there is a good equivalent to Java's Set collection in C#? I know that you can somewhat mimic a set using a Dictionary or a HashTable by populating but ignoring the values, but that's not a very elegant way.
TITLE: C# Set collection? QUESTION: Does anyone know if there is a good equivalent to Java's Set collection in C#? I know that you can somewhat mimic a set using a Dictionary or a HashTable by populating but ignoring the values, but that's not a very elegant way. ANSWER: Try HashSet: The HashSet(Of T) class provides ...
[ "c#", ".net", "collections", "set" ]
569
187
486,823
7
0
2008-10-08T16:33:59.270000
2008-10-08T16:35:05.400000
183,686
183,754
How to gain exclusive access to SQL Server 2005 database to restore?
Whenever I restore a backup of my database in SQL Server I am presented with the following error: Msg 3101, Level 16, State 1, Line 1 Exclusive access could not be obtained because the database is in use. Msg 3013, Level 16, State 1, Line 1 RESTORE DATABASE is terminating abnormally. Usually to get around this I just r...
You can force the database offline and drop connections with: EXEC sp_dboption N'yourDatabase', N'offline', N'true' Or you can ALTER DATABASE [yourDatabase] SET OFFLINE WITH ROLLBACK AFTER 60 SECONDS Rollback specifies if anything is executing. After that period they will be rolled back. So it provides some protection....
How to gain exclusive access to SQL Server 2005 database to restore? Whenever I restore a backup of my database in SQL Server I am presented with the following error: Msg 3101, Level 16, State 1, Line 1 Exclusive access could not be obtained because the database is in use. Msg 3013, Level 16, State 1, Line 1 RESTORE DA...
TITLE: How to gain exclusive access to SQL Server 2005 database to restore? QUESTION: Whenever I restore a backup of my database in SQL Server I am presented with the following error: Msg 3101, Level 16, State 1, Line 1 Exclusive access could not be obtained because the database is in use. Msg 3013, Level 16, State 1,...
[ "sql-server", "t-sql" ]
20
19
25,374
7
0
2008-10-08T16:34:02.140000
2008-10-08T16:49:50.830000
183,702
184,536
Access parent's parent from javascript object
Something like var life= { users: { guys: function(){ this.SOMETHING.mameAndDestroy(this.girls); }, girls: function(){ this.SOMETHING.kiss(this.boys); }, }, mameAndDestroy: function(group){ }, kiss: function(group){ } }; this.SOMETHING is what I imagine the format is, but it might not be. What will step back up to the ...
JavaScript does not offer this functionality natively. And I doubt you could even create this type of functionality. For example: var Bobby = {name: "Bobby"}; var Dad = {name: "Dad", children: [ Bobby ]}; var Mom = {name: "Mom", children: [ Bobby ]}; Who does Bobby belong to?
Access parent's parent from javascript object Something like var life= { users: { guys: function(){ this.SOMETHING.mameAndDestroy(this.girls); }, girls: function(){ this.SOMETHING.kiss(this.boys); }, }, mameAndDestroy: function(group){ }, kiss: function(group){ } }; this.SOMETHING is what I imagine the format is, but i...
TITLE: Access parent's parent from javascript object QUESTION: Something like var life= { users: { guys: function(){ this.SOMETHING.mameAndDestroy(this.girls); }, girls: function(){ this.SOMETHING.kiss(this.boys); }, }, mameAndDestroy: function(group){ }, kiss: function(group){ } }; this.SOMETHING is what I imagine th...
[ "javascript", "oop" ]
58
50
120,299
12
0
2008-10-08T16:36:52.087000
2008-10-08T19:47:52.390000
183,739
184,188
Resources for working with video feeds in C#
I'm starting to get into a side project that I hope to pull in frames from several small IP cameras, perhaps do a bit of motion detection and redisplay them in a form with alerts. Does anyone have some good resources or similar projects that I could use to get acquainted with the ins and outs? I'm using C# 3.5 with SP1...
Here you can find an article on how to do motion detection between images. It's based on the AForge.NET library, which, quoting their site: AForge.NET is a C# framework designed for developers and researchers in the fields of Computer Vision and Artificial Intelligence - image processing, neural networks, genetic algor...
Resources for working with video feeds in C# I'm starting to get into a side project that I hope to pull in frames from several small IP cameras, perhaps do a bit of motion detection and redisplay them in a form with alerts. Does anyone have some good resources or similar projects that I could use to get acquainted wit...
TITLE: Resources for working with video feeds in C# QUESTION: I'm starting to get into a side project that I hope to pull in frames from several small IP cameras, perhaps do a bit of motion detection and redisplay them in a form with alerts. Does anyone have some good resources or similar projects that I could use to ...
[ "c#", ".net-3.5", "video", "video-capture", "motion-detection" ]
4
2
1,460
1
0
2008-10-08T16:46:43.347000
2008-10-08T18:33:11.853000
183,742
183,746
How do you deal with m..n relationships in a relational database?
Let's look at an example - books. A book can have 1..n authors. An author can have 1..m books. What is a good way to represent all of the authors of a book? I came up with an idea to create a Books table and an Authors table. The Authors table has a primary AuthorID key the author's name. The Books table has a primary ...
Add another table called BookAuthors with columns for BookID, AuthorID, and NameUsed. A NULL value for NameUsed would mean to pull it from the Author's table instead. This is called an Intersection table.
How do you deal with m..n relationships in a relational database? Let's look at an example - books. A book can have 1..n authors. An author can have 1..m books. What is a good way to represent all of the authors of a book? I came up with an idea to create a Books table and an Authors table. The Authors table has a prim...
TITLE: How do you deal with m..n relationships in a relational database? QUESTION: Let's look at an example - books. A book can have 1..n authors. An author can have 1..m books. What is a good way to represent all of the authors of a book? I came up with an idea to create a Books table and an Authors table. The Author...
[ "sql", "database", "database-design" ]
18
31
22,775
10
0
2008-10-08T16:47:01.537000
2008-10-08T16:48:35.933000
183,745
183,785
Persistence: Data Trees stored as Directory Trees
I was wondering as to the practicalities of storing an in memory tree structure as directory tree for persistence purposes. In my case he target filesystem will be ZFS, and once the structure has been created it will be accessed by multiple processes infrequently. How performant is using a Directory Tree as a mechanism...
In order to read and write your tree, you will be calling the filesystem several times per node. This is much more expensive than any sane code you could devise to walk a memory image. Whether it is a sensible approach depends on what your usage pattern is expected to be. If in a typical invocation of your code you exp...
Persistence: Data Trees stored as Directory Trees I was wondering as to the practicalities of storing an in memory tree structure as directory tree for persistence purposes. In my case he target filesystem will be ZFS, and once the structure has been created it will be accessed by multiple processes infrequently. How p...
TITLE: Persistence: Data Trees stored as Directory Trees QUESTION: I was wondering as to the practicalities of storing an in memory tree structure as directory tree for persistence purposes. In my case he target filesystem will be ZFS, and once the structure has been created it will be accessed by multiple processes i...
[ "filesystems", "persistence", "tree-structure" ]
2
3
478
4
0
2008-10-08T16:47:49.103000
2008-10-08T17:00:09.263000
183,761
183,786
Flat File Repair Tool
Scenario: Attempting to import many (>100), large(>1M recs) flat-files (csv). Problem: Many records are missing field delimiters. Asking: Is there a parsing tool that will attempt to define and validate the file and allow you to make "in-line" corrections? ETA: I'm attempting to import this files to MS SQL Server using...
Been there, done that. Wrote my own tool. It's remarkable how many programs that allegedly output CSV don't actually do so correctly. A commercial tool would be nice, but given the variety of problems that I've encountered in CSV files (missing delimiters, bad separator values, embedded CR/LF in the middle of fields, e...
Flat File Repair Tool Scenario: Attempting to import many (>100), large(>1M recs) flat-files (csv). Problem: Many records are missing field delimiters. Asking: Is there a parsing tool that will attempt to define and validate the file and allow you to make "in-line" corrections? ETA: I'm attempting to import this files ...
TITLE: Flat File Repair Tool QUESTION: Scenario: Attempting to import many (>100), large(>1M recs) flat-files (csv). Problem: Many records are missing field delimiters. Asking: Is there a parsing tool that will attempt to define and validate the file and allow you to make "in-line" corrections? ETA: I'm attempting to ...
[ "file" ]
3
4
1,065
5
0
2008-10-08T16:51:35.583000
2008-10-08T17:00:53.037000
183,773
183,836
What are the differences between the Builder, Factory Method, and Abstract Factory patterns?
A program receives a list of Messages (base type). Each message in the list has to be processed according to it's type (descendant type). However, different messages need different inputs in order to be processed correctly. What is the following technique called? (I haven't checked this code in a compiler) abstract cla...
They are both examples of the factory method pattern. The only difference is that the second example has the method in its own static class. This would be an example of the abstract factory pattern: abstract class MessageProcessorFactory { public abstract MessageProcessor GetProcessor (Message message, DataDomain data)...
What are the differences between the Builder, Factory Method, and Abstract Factory patterns? A program receives a list of Messages (base type). Each message in the list has to be processed according to it's type (descendant type). However, different messages need different inputs in order to be processed correctly. Wha...
TITLE: What are the differences between the Builder, Factory Method, and Abstract Factory patterns? QUESTION: A program receives a list of Messages (base type). Each message in the list has to be processed according to it's type (descendant type). However, different messages need different inputs in order to be proces...
[ ".net", "design-patterns" ]
12
10
4,867
2
0
2008-10-08T16:54:08.497000
2008-10-08T17:11:54.903000
183,780
183,797
Organization of JUnit tests in projects
What would you consider best practice for organizing JUnit tests in a project, and why? For example, do you keep your tests next to the classes they test? Do you put them in a separate but parallel package structure? Do you use a different organization strategy entirely?
I use a separate but parallel package structure for several reasons. It keeps tests organized the same way as the application code. I can easily build just the application files for distribution. Test code still has access to my application code. It's not as cluttered as having test code mixed with application code.
Organization of JUnit tests in projects What would you consider best practice for organizing JUnit tests in a project, and why? For example, do you keep your tests next to the classes they test? Do you put them in a separate but parallel package structure? Do you use a different organization strategy entirely?
TITLE: Organization of JUnit tests in projects QUESTION: What would you consider best practice for organizing JUnit tests in a project, and why? For example, do you keep your tests next to the classes they test? Do you put them in a separate but parallel package structure? Do you use a different organization strategy ...
[ "java", "junit" ]
39
39
8,647
5
0
2008-10-08T16:56:53.763000
2008-10-08T17:03:41.067000
183,782
183,829
Loading content as the user scrolls down
I am building a blog type page, and I want to load items into the page as the user scrolls down, much like Google Reader, or Soup.io. How would you go about achieving this effect? I've seen some examples which read the height of the page, and have an onScroll even attached to the window so that as the user scrolls down...
Unspace had an article demonstrating this functionality: Endless Pageless: No More Next Page. Their demonstration page is here (dead, for reference). This particular example uses RoR and Prototype.
Loading content as the user scrolls down I am building a blog type page, and I want to load items into the page as the user scrolls down, much like Google Reader, or Soup.io. How would you go about achieving this effect? I've seen some examples which read the height of the page, and have an onScroll even attached to th...
TITLE: Loading content as the user scrolls down QUESTION: I am building a blog type page, and I want to load items into the page as the user scrolls down, much like Google Reader, or Soup.io. How would you go about achieving this effect? I've seen some examples which read the height of the page, and have an onScroll e...
[ "javascript", "html", "ajax", "scroll" ]
4
3
7,027
2
0
2008-10-08T16:59:24.540000
2008-10-08T17:10:15.080000
183,788
183,805
C / C++ compiler warnings: do you clean up all your code to remove them or leave them in?
I've worked on many projects where I've been given code by others to update. More often than not I compile it and get about 1,000+ compiler warnings. When I see compiler warnings they make me feel dirty, so my first task is to clean up the code and remove them all. Typically I find about a dozen problems like uninitial...
I would clean up any warning. Even the ones that you know are harmless (if such a thing exists) will give a bad impression of you to whoever will compile the code. It one of the "smelly" signs I would look for if I had to work on someone else code. If not real errors or potential future issues, it would be a sign of sl...
C / C++ compiler warnings: do you clean up all your code to remove them or leave them in? I've worked on many projects where I've been given code by others to update. More often than not I compile it and get about 1,000+ compiler warnings. When I see compiler warnings they make me feel dirty, so my first task is to cle...
TITLE: C / C++ compiler warnings: do you clean up all your code to remove them or leave them in? QUESTION: I've worked on many projects where I've been given code by others to update. More often than not I compile it and get about 1,000+ compiler warnings. When I see compiler warnings they make me feel dirty, so my fi...
[ "c++", "c", "compiler-construction", "warnings" ]
68
95
13,208
18
0
2008-10-08T17:01:18.390000
2008-10-08T17:05:04.263000
183,791
183,804
How would you do a "not in" query with LINQ?
I have two collections which have property Email in both collections. I need to get a list of the items in the first list where Email does not exist in the second list. With SQL I would just use "not in", but I do not know the equivalent in LINQ. How is that done? So far I have a join, like... var matches = from item1 ...
I don't know if this will help you but.. NorthwindDataContext dc = new NorthwindDataContext(); dc.Log = Console.Out; var query = from c in dc.Customers where!(from o in dc.Orders select o.CustomerID).Contains(c.CustomerID) select c; foreach (var c in query) Console.WriteLine( c ); from The NOT IN clause in LINQ to SQ...
How would you do a "not in" query with LINQ? I have two collections which have property Email in both collections. I need to get a list of the items in the first list where Email does not exist in the second list. With SQL I would just use "not in", but I do not know the equivalent in LINQ. How is that done? So far I h...
TITLE: How would you do a "not in" query with LINQ? QUESTION: I have two collections which have property Email in both collections. I need to get a list of the items in the first list where Email does not exist in the second list. With SQL I would just use "not in", but I do not know the equivalent in LINQ. How is tha...
[ "c#", "linq" ]
348
337
397,689
16
0
2008-10-08T17:01:40.930000
2008-10-08T17:05:00.690000
183,831
183,851
Which graphic file formats are supported by browsers?
JPEG, GIF and PNG can be displayed with the img tag and will work in all browsers, the object element can be use for displaying images specifying its MIME type, but what other graphic formats are supported by img or object tag in most browsers without installing plugins? (TIF, SVG, PCX, PICT, etc..)
There's an excellent chart on wikipedia that lists common image types and their support by browser. The file types you listed (jpg, gif and png) seem to be the main formats supported by nearly every browser, albeit with certain caveats: Internet Explorer supports PNG images but is unable to correctly display images wit...
Which graphic file formats are supported by browsers? JPEG, GIF and PNG can be displayed with the img tag and will work in all browsers, the object element can be use for displaying images specifying its MIME type, but what other graphic formats are supported by img or object tag in most browsers without installing plu...
TITLE: Which graphic file formats are supported by browsers? QUESTION: JPEG, GIF and PNG can be displayed with the img tag and will work in all browsers, the object element can be use for displaying images specifying its MIME type, but what other graphic formats are supported by img or object tag in most browsers with...
[ "cross-browser", "image-formats" ]
51
72
66,433
3
0
2008-10-08T17:10:23.020000
2008-10-08T17:15:40.667000
183,846
183,988
.NET Regex balancing groups expression - matching when not balanced
.NET balanced group regexes make my head explode. I've got this string i'm trying to match: other stuff blah blah.... { stuff stuff {key: stuff stuff } } more stuff..... Here's my regex: [^{}]* # anything that isn't { } \{ # starting with { (?> # atomic group: throw away backtracks on exit [^{}]+ | \{(?:\w+:)?(? ) # on...
Have you checked what it is matching in the second case? Since you don't have any anchors, I think the engine starts the match just after the first '{'. From there, until the end, the string matches. Try surrounding the pattern with \A and \z.
.NET Regex balancing groups expression - matching when not balanced .NET balanced group regexes make my head explode. I've got this string i'm trying to match: other stuff blah blah.... { stuff stuff {key: stuff stuff } } more stuff..... Here's my regex: [^{}]* # anything that isn't { } \{ # starting with { (?> # atomi...
TITLE: .NET Regex balancing groups expression - matching when not balanced QUESTION: .NET balanced group regexes make my head explode. I've got this string i'm trying to match: other stuff blah blah.... { stuff stuff {key: stuff stuff } } more stuff..... Here's my regex: [^{}]* # anything that isn't { } \{ # starting ...
[ ".net", "regex" ]
1
4
1,264
2
0
2008-10-08T17:14:45.990000
2008-10-08T17:55:17.203000
183,849
183,967
Can Database Mirroring Be Setup On MS SQLServer Between Two Clusters
Using Microsoft SQL Server's database mirroring capability, can the mirroring occur between two clusters? All of the examples in MSDN show a topology indicating single servers for both the principal and mirror server.
At least in 2005 and 2008, the answer is yes. I don't personally have experience with clustering, so I don't have tips on how to set it up or what to watch after you do.
Can Database Mirroring Be Setup On MS SQLServer Between Two Clusters Using Microsoft SQL Server's database mirroring capability, can the mirroring occur between two clusters? All of the examples in MSDN show a topology indicating single servers for both the principal and mirror server.
TITLE: Can Database Mirroring Be Setup On MS SQLServer Between Two Clusters QUESTION: Using Microsoft SQL Server's database mirroring capability, can the mirroring occur between two clusters? All of the examples in MSDN show a topology indicating single servers for both the principal and mirror server. ANSWER: At lea...
[ "sql-server", "database", "cluster-computing", "mirroring" ]
1
2
451
1
0
2008-10-08T17:15:10.170000
2008-10-08T17:48:30.697000
183,853
183,870
What is the difference between '/' and '//' when used for division?
Is there a benefit to using one over the other? In Python 2, they both seem to return the same results: >>> 6/3 2 >>> 6//3 2
In Python 3.x, 5 / 2 will return 2.5 and 5 // 2 will return 2. The former is floating point division, and the latter is floor division, sometimes also called integer division. In Python 2.2 or later in the 2.x line, there is no difference for integers unless you perform a from __future__ import division, which causes P...
What is the difference between '/' and '//' when used for division? Is there a benefit to using one over the other? In Python 2, they both seem to return the same results: >>> 6/3 2 >>> 6//3 2
TITLE: What is the difference between '/' and '//' when used for division? QUESTION: Is there a benefit to using one over the other? In Python 2, they both seem to return the same results: >>> 6/3 2 >>> 6//3 2 ANSWER: In Python 3.x, 5 / 2 will return 2.5 and 5 // 2 will return 2. The former is floating point division...
[ "python", "math", "syntax", "operators", "floor-division" ]
588
784
721,354
16
0
2008-10-08T17:16:35.830000
2008-10-08T17:21:37.910000
183,856
183,891
How do I LINQify this?
Is there any way to clean up this type of loop using LINQ? List result; List makes; List models; for (int i = 0; i < makes.Count() && i < models.Count(); i++) { result.Add(new Car() { Make = makes[i], Model = models[i] }); } Basically I'm looking for some way to collate multiple arrays of individual fields into a sing...
You could use Enumerable.Range, like so: List result = Enumerable.Range(0, Math.Min(makes.Count, models.Count)).Select(i => new Car { Make = makes[i], Model = models[i] }).ToList(); If makes and models always contain the same number of items, you can use more compact syntax: List result = makes.Select((make, i) => new ...
How do I LINQify this? Is there any way to clean up this type of loop using LINQ? List result; List makes; List models; for (int i = 0; i < makes.Count() && i < models.Count(); i++) { result.Add(new Car() { Make = makes[i], Model = models[i] }); } Basically I'm looking for some way to collate multiple arrays of indivi...
TITLE: How do I LINQify this? QUESTION: Is there any way to clean up this type of loop using LINQ? List result; List makes; List models; for (int i = 0; i < makes.Count() && i < models.Count(); i++) { result.Add(new Car() { Make = makes[i], Model = models[i] }); } Basically I'm looking for some way to collate multipl...
[ "c#", ".net", "linq" ]
3
7
423
4
0
2008-10-08T17:17:22.037000
2008-10-08T17:26:06.280000
183,881
185,102
Image Capture in C#
I'm working on a home project that involves comparing images to a database of images (using a quadrant - or so - histogram approach). I wanted to know what my options are in regards to web cams or other image capture devices that: Are easy to work with with the Windows SDK (particularly DirectShow, which I plan to use ...
If you only want images, many web cams support TWAIN -- you can use with.NET using this code http://www.codeproject.com/KB/dotnet/twaindotnet.aspx
Image Capture in C# I'm working on a home project that involves comparing images to a database of images (using a quadrant - or so - histogram approach). I wanted to know what my options are in regards to web cams or other image capture devices that: Are easy to work with with the Windows SDK (particularly DirectShow, ...
TITLE: Image Capture in C# QUESTION: I'm working on a home project that involves comparing images to a database of images (using a quadrant - or so - histogram approach). I wanted to know what my options are in regards to web cams or other image capture devices that: Are easy to work with with the Windows SDK (particu...
[ "c#", "image", "webcam", "image-capture" ]
5
3
7,140
2
0
2008-10-08T17:24:28.390000
2008-10-08T22:05:23.377000
183,882
183,997
Interesting compiler projects
I'm currently in the process of choosing a project for a grad-level compiler course to be done over the next 8 weeks. I'd like to do something related to optimization since I haven't worked much in that area before, but anything in the field is fair game. What was the most interesting compiler-related project you've do...
If you're interested in optimization, Vectorization of loops using SSE and MMX instruction sets could be interesting.
Interesting compiler projects I'm currently in the process of choosing a project for a grad-level compiler course to be done over the next 8 weeks. I'd like to do something related to optimization since I haven't worked much in that area before, but anything in the field is fair game. What was the most interesting comp...
TITLE: Interesting compiler projects QUESTION: I'm currently in the process of choosing a project for a grad-level compiler course to be done over the next 8 weeks. I'd like to do something related to optimization since I haven't worked much in that area before, but anything in the field is fair game. What was the mos...
[ "compiler-construction" ]
26
7
17,218
18
0
2008-10-08T17:24:44.473000
2008-10-08T17:56:47.030000
183,887
183,906
VS 2k8 Doesn't Release File Handle After Debugging Stops: Unable to copy file X to output directory because it is being used by another process
Every once in a while, typically when I stop debugging in our UI assembly, I get the following error which requires a restart of Visual Studio 2008 and it's killing my productivity: Error 13 Unable to copy file [UI assembly] to [output directory]. The process cannot access the file [output directory][UI assembly] becau...
I've had similar problems in VS2005 and VS2008 without any add-ins installed or any third-party controls in the project. The only solution I've found is to close Visual Studio and reopen it. It is a very intermittent problem and while annoying, one that it seems can't be resolved on your end.
VS 2k8 Doesn't Release File Handle After Debugging Stops: Unable to copy file X to output directory because it is being used by another process Every once in a while, typically when I stop debugging in our UI assembly, I get the following error which requires a restart of Visual Studio 2008 and it's killing my producti...
TITLE: VS 2k8 Doesn't Release File Handle After Debugging Stops: Unable to copy file X to output directory because it is being used by another process QUESTION: Every once in a while, typically when I stop debugging in our UI assembly, I get the following error which requires a restart of Visual Studio 2008 and it's k...
[ "visual-studio", "visual-studio-2008" ]
6
2
2,037
7
0
2008-10-08T17:25:39.167000
2008-10-08T17:31:49.607000
183,898
183,908
Forward Referencing or Declaration in C++
How do I do forward referencing / declaration in C++ to avoid circular header file references? I have the #ifndef guard in the header file, yet memory tells me I need this forward referencing thing - which i've used before >< but can't remember how.
You predeclare the class without including it. For example: //#include "Foo.h" // including Foo.h causes circular reference class Foo; class Bar {... };
Forward Referencing or Declaration in C++ How do I do forward referencing / declaration in C++ to avoid circular header file references? I have the #ifndef guard in the header file, yet memory tells me I need this forward referencing thing - which i've used before >< but can't remember how.
TITLE: Forward Referencing or Declaration in C++ QUESTION: How do I do forward referencing / declaration in C++ to avoid circular header file references? I have the #ifndef guard in the header file, yet memory tells me I need this forward referencing thing - which i've used before >< but can't remember how. ANSWER: Y...
[ "c++", "syntax", "forward-declaration" ]
4
15
1,054
3
0
2008-10-08T17:29:19.097000
2008-10-08T17:32:04.287000
183,907
183,909
How do I convert Unicode escape sequences to Unicode characters in a .NET string?
Say you've loaded a text file into a string, and you'd like to convert all Unicode escapes into actual Unicode characters inside of the string. Example: "The following is the top half of an integral character in Unicode '\u2320', and this is the lower half '\U2321'."
The answer is simple and works well with strings up to at least several thousand characters. Example 1: Regex rx = new Regex( @"\\[uU]([0-9A-F]{4})" ); result = rx.Replace( result, match => ((char) Int32.Parse(match.Value.Substring(2), NumberStyles.HexNumber)).ToString() ); Example 2: Regex rx = new Regex( @"\\[uU]([0-...
How do I convert Unicode escape sequences to Unicode characters in a .NET string? Say you've loaded a text file into a string, and you'd like to convert all Unicode escapes into actual Unicode characters inside of the string. Example: "The following is the top half of an integral character in Unicode '\u2320', and this...
TITLE: How do I convert Unicode escape sequences to Unicode characters in a .NET string? QUESTION: Say you've loaded a text file into a string, and you'd like to convert all Unicode escapes into actual Unicode characters inside of the string. Example: "The following is the top half of an integral character in Unicode ...
[ "c#", ".net", "unicode" ]
34
50
29,825
5
0
2008-10-08T17:32:01.290000
2008-10-08T17:32:18.420000
183,914
183,924
How do I get the key values from $_POST?
echo $_POST["name"]; //returns the value a user typed into the "name" field I would like to be able to also return the text of the key. In this example, I want to return the text "name". Can I do this?
Check out the array_keys() function assuming this is PHP. https://www.php.net/array_keys
How do I get the key values from $_POST? echo $_POST["name"]; //returns the value a user typed into the "name" field I would like to be able to also return the text of the key. In this example, I want to return the text "name". Can I do this?
TITLE: How do I get the key values from $_POST? QUESTION: echo $_POST["name"]; //returns the value a user typed into the "name" field I would like to be able to also return the text of the key. In this example, I want to return the text "name". Can I do this? ANSWER: Check out the array_keys() function assuming this ...
[ "php", "arrays" ]
24
17
84,483
6
0
2008-10-08T17:33:08.153000
2008-10-08T17:34:38.057000
183,921
383,672
Rewrite all queries to not need the .php extension using a mod_rewrite RewriteRule
I'd like all queries like http://mysite.com/something/otherthing?foo=bar&x=y to be rewritten as http://mysite.com/something/otherthing.php?foo=bar&x=y In other words, just make the.php extension optional, universally.
I would do it this way. Basically, if file doesn't exist, try adding.php to it. RewriteCond %{REQUEST_FILENAME}!-f RewriteCond %{REQUEST_FILENAME}!-d RewriteRule ^(.+)$ $1.php [QSA,L]
Rewrite all queries to not need the .php extension using a mod_rewrite RewriteRule I'd like all queries like http://mysite.com/something/otherthing?foo=bar&x=y to be rewritten as http://mysite.com/something/otherthing.php?foo=bar&x=y In other words, just make the.php extension optional, universally.
TITLE: Rewrite all queries to not need the .php extension using a mod_rewrite RewriteRule QUESTION: I'd like all queries like http://mysite.com/something/otherthing?foo=bar&x=y to be rewritten as http://mysite.com/something/otherthing.php?foo=bar&x=y In other words, just make the.php extension optional, universally. ...
[ "php", "url", "mod-rewrite", "friendly-url" ]
6
6
1,842
5
0
2008-10-08T17:34:08.900000
2008-12-20T19:57:26.847000
183,923
183,951
Compiler fails converting a constrained generic type
I have a class that has a Generic type "G" In my class model i have public class DetailElement: ElementDefinition Let's say i have a method like this public void DoSomething (G generic) where G: ElementDefinition { if (generic is DetailElement) { ((DetailElement)generic).DescEN = "Hello people"; //line 1 ////// Element...
If G was constrained to be a DetailElement ( where G: DetailElement ) then you can go ahead and cast G to ElementDefinition, i.e., " (ElementDefinition) generic ". But because G might be another subclass of ElementDefinition other than DetailElement at run-time it won't allow it at compile-time where the type is unknow...
Compiler fails converting a constrained generic type I have a class that has a Generic type "G" In my class model i have public class DetailElement: ElementDefinition Let's say i have a method like this public void DoSomething (G generic) where G: ElementDefinition { if (generic is DetailElement) { ((DetailElement)gene...
TITLE: Compiler fails converting a constrained generic type QUESTION: I have a class that has a Generic type "G" In my class model i have public class DetailElement: ElementDefinition Let's say i have a method like this public void DoSomething (G generic) where G: ElementDefinition { if (generic is DetailElement) { ((...
[ "c#", "generics", "casting", "constraints" ]
4
8
2,128
4
0
2008-10-08T17:34:28.417000
2008-10-08T17:43:16.527000
183,928
183,971
How to let PHP to create subdomain automatically for each user?
How do I create subdomain like http://user.mywebsite.example? Do I have to access.htaccess somehow? Is it actually simply possible to create it via pure PHP code or I need to use some external script-server side language? To those who answered: Well, then, should I ask my hosting if they provide some sort of DNS access...
You're looking to create a custom A record. I'm pretty sure that you can use wildcards when specifying A records which would let you do something like this: *.mywebsite.example IN A 127.0.0.1 127.0.0.1 would be the IP address of your webserver. The method of actually adding the record will depend on your host. Then you...
How to let PHP to create subdomain automatically for each user? How do I create subdomain like http://user.mywebsite.example? Do I have to access.htaccess somehow? Is it actually simply possible to create it via pure PHP code or I need to use some external script-server side language? To those who answered: Well, then,...
TITLE: How to let PHP to create subdomain automatically for each user? QUESTION: How do I create subdomain like http://user.mywebsite.example? Do I have to access.htaccess somehow? Is it actually simply possible to create it via pure PHP code or I need to use some external script-server side language? To those who ans...
[ "php", "subdomain" ]
176
147
151,245
12
0
2008-10-08T17:36:51.827000
2008-10-08T17:49:38.540000
183,932
184,429
Why are my PHP sessions dying? And why can't I restore them?
I have an app using PHP and the PayPal API. The basic way it works to get a payment is that you do a web service call to PayPal to get a token and then do a browser redirect to PayPal with that token for the user to pay. After the payment details have been confirmed, PayPal redirects back to the URL you originally set ...
Just an idea... Do you have session.referer_check set to your host perhaps? The default is the empty string, but it might have been changed... and when the page 'comes back' from PayPal, php will trash the session info. You can check the session.referer_check with phpinfo().
Why are my PHP sessions dying? And why can't I restore them? I have an app using PHP and the PayPal API. The basic way it works to get a payment is that you do a web service call to PayPal to get a token and then do a browser redirect to PayPal with that token for the user to pay. After the payment details have been co...
TITLE: Why are my PHP sessions dying? And why can't I restore them? QUESTION: I have an app using PHP and the PayPal API. The basic way it works to get a payment is that you do a web service call to PayPal to get a token and then do a browser redirect to PayPal with that token for the user to pay. After the payment de...
[ "php", "session", "paypal" ]
2
3
2,686
2
0
2008-10-08T17:37:52.370000
2008-10-08T19:21:54.627000
183,950
184,262
Add ScriptManager to Page Programmatically?
I am developing a WebPart (it will be used in a SharePoint environment, although it does not use the Object Model) that I want to expose AJAX functionality in. Because of the nature of the environment, Adding the Script Manager directly to the page is not an option, and so must be added programmatically. I have attempt...
I was able to get this to work by using the Page's Init event: protected override void OnInit(EventArgs e) { Page.Init += delegate(object sender, EventArgs e_Init) { if (ScriptManager.GetCurrent(Page) == null) { ScriptManager sMgr = new ScriptManager(); Page.Form.Controls.AddAt(0, sMgr); } }; base.OnInit(e); }
Add ScriptManager to Page Programmatically? I am developing a WebPart (it will be used in a SharePoint environment, although it does not use the Object Model) that I want to expose AJAX functionality in. Because of the nature of the environment, Adding the Script Manager directly to the page is not an option, and so mu...
TITLE: Add ScriptManager to Page Programmatically? QUESTION: I am developing a WebPart (it will be used in a SharePoint environment, although it does not use the Object Model) that I want to expose AJAX functionality in. Because of the nature of the environment, Adding the Script Manager directly to the page is not an...
[ "c#", "sharepoint-2007", "web-parts", "scriptmanager" ]
28
41
49,928
7
0
2008-10-08T17:42:59.880000
2008-10-08T18:48:59.140000
183,953
184,428
How to get Visual Studio 2008 to edit SSRS 2005 Report Projects w/o Installing SQL Business Intelligence Development Studio 2005?
I'm trying to determine how to open/edit existing SQL Server Reporting Services (SSRS) 2005 report projects (.rptproj) and reports (.rdl) with Visual Studio 2008, without having to install SQL Business Intelligence Development Studio (BIDS) 2005.
You cannot. Check this forum posting which has a reponse from Microsoft. Yes, it was an active decision that the 2008 design evironments would not support continuous backwards compatability but would rather be a one way upgrade. This was not a casual decision and it is understood how it can be an impact. You can read t...
How to get Visual Studio 2008 to edit SSRS 2005 Report Projects w/o Installing SQL Business Intelligence Development Studio 2005? I'm trying to determine how to open/edit existing SQL Server Reporting Services (SSRS) 2005 report projects (.rptproj) and reports (.rdl) with Visual Studio 2008, without having to install S...
TITLE: How to get Visual Studio 2008 to edit SSRS 2005 Report Projects w/o Installing SQL Business Intelligence Development Studio 2005? QUESTION: I'm trying to determine how to open/edit existing SQL Server Reporting Services (SSRS) 2005 report projects (.rptproj) and reports (.rdl) with Visual Studio 2008, without h...
[ "visual-studio-2008", "sql-server-2005", "reporting-services", "report" ]
12
11
19,431
6
0
2008-10-08T17:43:42.110000
2008-10-08T19:21:13.240000
183,963
555,289
What is the Oracle KGL SIMULATOR?
What is this thing called a KGL SIMULATOR and how can its memory utilisation be managed by application developers? The background to the question is that I'm occasionally getting errors like the following and would like to get a general understanding of what is using this heap-space? ORA-04031: unable to allocate 4032 ...
KGL=Kernel General Library cache manager, as the name says it deals with library objects such cursors, cached stored object definitions (PL/SQL stored procs, table definitions etc). KGL simulator is used for estimating the benefit of caching if the cache was larger than currently. The general idea is that when flushing...
What is the Oracle KGL SIMULATOR? What is this thing called a KGL SIMULATOR and how can its memory utilisation be managed by application developers? The background to the question is that I'm occasionally getting errors like the following and would like to get a general understanding of what is using this heap-space? O...
TITLE: What is the Oracle KGL SIMULATOR? QUESTION: What is this thing called a KGL SIMULATOR and how can its memory utilisation be managed by application developers? The background to the question is that I'm occasionally getting errors like the following and would like to get a general understanding of what is using ...
[ "oracle", "debugging", "oracleinternals" ]
0
3
4,069
2
0
2008-10-08T17:47:18.233000
2009-02-17T02:02:12.783000
183,991
184,607
Setting a data breakpoint in Visual Studio 2005 on the address of a dereferenced pointer
I wonder if there's a way to do the following: I have a structure containing a member which is a pointer to a block of memory allocated by the kernel when I pass the structure to an API function (the structure is a WAVEHDR, the member is the reserved field.) I can set a data breakpoint on the value of the reserved memb...
A macro can evaluate anything that you can in the watch window: Dim e As EnvDTE.Expression e = DTE.Debugger.GetExpression(" ", True) If e.IsValidValue Then... use e.Value to do something End If The value you get back in e.Value is exactly the string you would see in the watch window, so you may have to pull it apart....
Setting a data breakpoint in Visual Studio 2005 on the address of a dereferenced pointer I wonder if there's a way to do the following: I have a structure containing a member which is a pointer to a block of memory allocated by the kernel when I pass the structure to an API function (the structure is a WAVEHDR, the mem...
TITLE: Setting a data breakpoint in Visual Studio 2005 on the address of a dereferenced pointer QUESTION: I wonder if there's a way to do the following: I have a structure containing a member which is a pointer to a block of memory allocated by the kernel when I pass the structure to an API function (the structure is ...
[ "c++", "c", "visual-studio-2005", "debugging" ]
4
2
2,383
2
0
2008-10-08T17:55:41.680000
2008-10-08T20:04:44.837000
184,002
185,879
Groovy: what's the purpose of "def" in "def x = 0"?
In the following piece of code (taken from the Groovy Semantics Manual page ), why prefix the assignment with the keyword def? def x = 0 def y = 5 while ( y-- > 0 ) { println "" + x + " " + y x++ } assert x == 5 The def keyword can be removed, and this snippet would produce the same results. So what's the effect of t...
It's syntactic sugar for basic scripts. Omitting the "def" keyword puts the variable in the bindings for the current script and groovy treats it (mostly) like a globally scoped variable: x = 1 assert x == 1 assert this.binding.getVariable("x") == 1 Using the def keyword instead does not put the variable in the scripts ...
Groovy: what's the purpose of "def" in "def x = 0"? In the following piece of code (taken from the Groovy Semantics Manual page ), why prefix the assignment with the keyword def? def x = 0 def y = 5 while ( y-- > 0 ) { println "" + x + " " + y x++ } assert x == 5 The def keyword can be removed, and this snippet would...
TITLE: Groovy: what's the purpose of "def" in "def x = 0"? QUESTION: In the following piece of code (taken from the Groovy Semantics Manual page ), why prefix the assignment with the keyword def? def x = 0 def y = 5 while ( y-- > 0 ) { println "" + x + " " + y x++ } assert x == 5 The def keyword can be removed, and ...
[ "groovy", "keyword" ]
198
302
99,018
6
0
2008-10-08T17:59:14.870000
2008-10-09T03:51:30.493000
184,009
195,251
How can I do an indexOf() in Lotus Notes Formula language (@ commands)?
I can't find this anywhere in the Domino Designer help. It seems so straightforward! All I need to do is find the position of a character in a string.
(edited) Please see the answer from charles ross instead. https://stackoverflow.com/a/19437044/11293 My less efficient method is below. If you really need the character position though you could do this: REM { S Source string F Character to find R Location of character in string or 0 }; S:= "My string"; F:= "t"; LEN_S...
How can I do an indexOf() in Lotus Notes Formula language (@ commands)? I can't find this anywhere in the Domino Designer help. It seems so straightforward! All I need to do is find the position of a character in a string.
TITLE: How can I do an indexOf() in Lotus Notes Formula language (@ commands)? QUESTION: I can't find this anywhere in the Domino Designer help. It seems so straightforward! All I need to do is find the position of a character in a string. ANSWER: (edited) Please see the answer from charles ross instead. https://stac...
[ "string", "lotus-notes", "lotus-formula" ]
0
0
5,914
4
0
2008-10-08T18:00:35.977000
2008-10-12T08:59:15.227000
184,014
184,046
Can an XML attribute be the empty string?
Can an XML attribute be the empty string? In other words, is valid XML?
You can create an empty attribute via attname="" You can create an empty element via or
Can an XML attribute be the empty string? Can an XML attribute be the empty string? In other words, is valid XML?
TITLE: Can an XML attribute be the empty string? QUESTION: Can an XML attribute be the empty string? In other words, is valid XML? ANSWER: You can create an empty attribute via attname="" You can create an empty element via or
[ "xml" ]
13
8
24,689
6
0
2008-10-08T18:01:25.600000
2008-10-08T18:06:54.810000
184,025
185,749
Best concrete "How-To Manual" on *Managing* Test Driven and/or Agile development?
I am looking for an easily digestible book to present to my boss/team. Background info: More and more of our meetings at work involve my boss/team pondering how to implement more "best practices" around here. ("Here" = a very small application development shop. 4 developers) The following things are items that my whole...
To throw another Pragmatic Programmers title in the mix: Ship It! Great book - take a look, might suit your needs with management.
Best concrete "How-To Manual" on *Managing* Test Driven and/or Agile development? I am looking for an easily digestible book to present to my boss/team. Background info: More and more of our meetings at work involve my boss/team pondering how to implement more "best practices" around here. ("Here" = a very small applic...
TITLE: Best concrete "How-To Manual" on *Managing* Test Driven and/or Agile development? QUESTION: I am looking for an easily digestible book to present to my boss/team. Background info: More and more of our meetings at work involve my boss/team pondering how to implement more "best practices" around here. ("Here" = a...
[ "testing", "project-management", "agile" ]
5
3
510
9
0
2008-10-08T18:02:54.007000
2008-10-09T02:45:49.550000
184,028
184,189
What are the disadvantages to using a PHP proxy to bypass the same-origin policy for XMLHttpRequest?
http://developer.yahoo.com/javascript/howto-proxy.html Are there disadvantages to this technique? The advantage is obvious, that you can use a proxy to get XML or JavaScript on another domain with XMLHttpRequest without running into same-origin restrictions. However, I do not hear about disadvantages over other methods...
Overhead - things are going to be a bit slower because you're going through an intermediary. There are security issues if you allow access to any external site via the proxy - be sure to lock it down to the specific site (and probably specific URL) of the resource you're proxying.
What are the disadvantages to using a PHP proxy to bypass the same-origin policy for XMLHttpRequest? http://developer.yahoo.com/javascript/howto-proxy.html Are there disadvantages to this technique? The advantage is obvious, that you can use a proxy to get XML or JavaScript on another domain with XMLHttpRequest without...
TITLE: What are the disadvantages to using a PHP proxy to bypass the same-origin policy for XMLHttpRequest? QUESTION: http://developer.yahoo.com/javascript/howto-proxy.html Are there disadvantages to this technique? The advantage is obvious, that you can use a proxy to get XML or JavaScript on another domain with XMLH...
[ "javascript", "security", "xmlhttprequest" ]
3
4
1,010
3
0
2008-10-08T18:03:18.387000
2008-10-08T18:33:12.087000
184,049
184,376
Framework/Language for new web 2.0 sites (2008 and 2009)
I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to start writing an application for January 2009. I am willi...
it depends. php - symfony is a great framework. downsides: php, wordy and directory heavy. propel gets annoying to use. upsides: php is everywhere and labor is cheap. well done framework, and good support. lots of plugins to make your life easier python - django is also a great framework. downsides: python programmers ...
Framework/Language for new web 2.0 sites (2008 and 2009) I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now October 2008. I want to ...
TITLE: Framework/Language for new web 2.0 sites (2008 and 2009) QUESTION: I know I'll get a thousand "Depends on what you're trying to do" answers, but seriously, there really is no solid information about this online yet. Here are my assumptions - I think they're similar for alot of people right now: It is now Octobe...
[ "python", "ruby-on-rails", "django", "merb" ]
4
5
1,002
13
0
2008-10-08T18:07:42.950000
2008-10-08T19:08:42
184,050
184,279
Eclipse PDT and .yml file, cannot open?
I am using Symphony framework and I have the default sandbox inside the Eclipse IDE. When I double click schema.yml instead of open in Eclipse it requests Windows to select a program to choose. I am a Visual Studio guy and I do not understand why it doesn't open in Eclipse, what should I do?
Right click on the file, select OPEN WITH>Text Editor and it will open in the IDE
Eclipse PDT and .yml file, cannot open? I am using Symphony framework and I have the default sandbox inside the Eclipse IDE. When I double click schema.yml instead of open in Eclipse it requests Windows to select a program to choose. I am a Visual Studio guy and I do not understand why it doesn't open in Eclipse, what ...
TITLE: Eclipse PDT and .yml file, cannot open? QUESTION: I am using Symphony framework and I have the default sandbox inside the Eclipse IDE. When I double click schema.yml instead of open in Eclipse it requests Windows to select a program to choose. I am a Visual Studio guy and I do not understand why it doesn't open...
[ "php", "eclipse", "yaml" ]
3
11
4,156
1
0
2008-10-08T18:07:45.633000
2008-10-08T18:51:34.640000
184,060
184,758
Java Application Installers
I'm not looking for java-web-start, I'm looking for a thick-client application installation toolkit. I've got a stand-alone application that consists of several files (jar files, data files, etc) and would need to do some pretty standard installation tasks, like asking the user for target directories, have them locate ...
Not an MSI-Installer but crossplatform: izPack It's xml-file based with it's own GUI or ant task (whtaever you prefer)
Java Application Installers I'm not looking for java-web-start, I'm looking for a thick-client application installation toolkit. I've got a stand-alone application that consists of several files (jar files, data files, etc) and would need to do some pretty standard installation tasks, like asking the user for target di...
TITLE: Java Application Installers QUESTION: I'm not looking for java-web-start, I'm looking for a thick-client application installation toolkit. I've got a stand-alone application that consists of several files (jar files, data files, etc) and would need to do some pretty standard installation tasks, like asking the ...
[ "java", "installation", "toolkit" ]
33
14
45,727
7
0
2008-10-08T18:09:53.337000
2008-10-08T20:34:07.197000
184,066
184,139
How to run classic ASP scripts under IIS 5.1 (WinXP Pro) alongside .NET & CF?
I'm running into a problem setting up my development environment. I've been working on ColdFusion and.NET applications up until recently I haven't needed to touch IIS. Now, I have to set up a classic ASP application for some one-off work. I added a virtual directory in IIS and pointed it at the actual codebase on my lo...
Take a look at your URL scan settings and see if.asp is an allowed file extension On my XP machine the relevant file is located at C:\WINDOWS\system32\inetsrv\urlscan\urlscan.ini
How to run classic ASP scripts under IIS 5.1 (WinXP Pro) alongside .NET & CF? I'm running into a problem setting up my development environment. I've been working on ColdFusion and.NET applications up until recently I haven't needed to touch IIS. Now, I have to set up a classic ASP application for some one-off work. I a...
TITLE: How to run classic ASP scripts under IIS 5.1 (WinXP Pro) alongside .NET & CF? QUESTION: I'm running into a problem setting up my development environment. I've been working on ColdFusion and.NET applications up until recently I haven't needed to touch IIS. Now, I have to set up a classic ASP application for some...
[ "iis", "asp-classic", "isapi-extension" ]
2
1
5,154
2
0
2008-10-08T18:12:03.253000
2008-10-08T18:24:29.813000
184,096
184,200
Update multiple rows into SQL table
Suppose there is a fully populated array of data String[n][3] myData. I want to do this: for (String[] row: myData) { SQL = "update mytable set col3 = row[2] where col1 = row[0] and col2=row[1];" } Obviously I've left a lot out, but I want to express the idea as succinctly as possible. Is there a simple way of doing th...
If you are using Sql Server you can use SqlBulkCopy. You would first have to put your data in a DataTable, which would be pretty easy since you already have it in a string array. http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx
Update multiple rows into SQL table Suppose there is a fully populated array of data String[n][3] myData. I want to do this: for (String[] row: myData) { SQL = "update mytable set col3 = row[2] where col1 = row[0] and col2=row[1];" } Obviously I've left a lot out, but I want to express the idea as succinctly as possibl...
TITLE: Update multiple rows into SQL table QUESTION: Suppose there is a fully populated array of data String[n][3] myData. I want to do this: for (String[] row: myData) { SQL = "update mytable set col3 = row[2] where col1 = row[0] and col2=row[1];" } Obviously I've left a lot out, but I want to express the idea as suc...
[ "c#", "asp.net", "sql" ]
2
3
33,841
10
0
2008-10-08T18:17:36.550000
2008-10-08T18:36:00.833000
184,108
184,152
How can I capture single keystrokes in a unix console app without blocking?
I have a very simple TCP server written in C. It runs indefinitely, waiting for connections. On Windows, I use select to check for activity on the socket, and if there isn't any, I have the following code to allow me to quit by hitting 'q' on the keyboard: if( kbhit() ) { char c = getch(); if( c == 'q' ) break; } This ...
Add stdin to your list of select handles, and if it has data, call read to read one character from it.
How can I capture single keystrokes in a unix console app without blocking? I have a very simple TCP server written in C. It runs indefinitely, waiting for connections. On Windows, I use select to check for activity on the socket, and if there isn't any, I have the following code to allow me to quit by hitting 'q' on t...
TITLE: How can I capture single keystrokes in a unix console app without blocking? QUESTION: I have a very simple TCP server written in C. It runs indefinitely, waiting for connections. On Windows, I use select to check for activity on the socket, and if there isn't any, I have the following code to allow me to quit b...
[ "c", "unix", "input", "terminal" ]
4
5
1,683
3
0
2008-10-08T18:19:31.413000
2008-10-08T18:25:45.643000
184,125
184,184
How does Databind consume a DataReader
If I have a control on a page that has its Datasource set to a DataReader, does that control consume the reader at the time the Datasource is set, or does the datareader continue to exist until Databind has been executed? What actually happens under the covers when Databind is executed?
Depending on the Control, DataBind() will Bind the Data to the Control. It does this by Iterating through the DataSource and create the Html and other Controls that are needed. For a DropDownList, DataBind() will create the ListItem for each record in a DataSet or each Element in an ArrayList. Later the Render method i...
How does Databind consume a DataReader If I have a control on a page that has its Datasource set to a DataReader, does that control consume the reader at the time the Datasource is set, or does the datareader continue to exist until Databind has been executed? What actually happens under the covers when Databind is exe...
TITLE: How does Databind consume a DataReader QUESTION: If I have a control on a page that has its Datasource set to a DataReader, does that control consume the reader at the time the Datasource is set, or does the datareader continue to exist until Databind has been executed? What actually happens under the covers wh...
[ "asp.net", "data-binding" ]
1
1
784
3
0
2008-10-08T18:22:31.237000
2008-10-08T18:32:18.203000
184,132
184,273
"Unix shell"-alike script under Windows
I need some help from the shell-script gurus out there. I have a.txt file (log) that traces the IP addresses of clients on several lines, in a format similar to this one: Line1 - Client IP [192.168.0.1] Other data Line2 - Client IP [192.168.0.2] Other data Line3 - Client IP [192.168.0.3] Other data Line4 - Client IP [1...
In PowerShell: The Verbose Way - $regex = '(? \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' get-content log.txt | where-object {if ($_ -match $regex){$matches.ipaddress}} | group-object -noelement Shorter version gc log.txt | % {if ($_ -match $regex){$matches.ipaddress}} | group -n
"Unix shell"-alike script under Windows I need some help from the shell-script gurus out there. I have a.txt file (log) that traces the IP addresses of clients on several lines, in a format similar to this one: Line1 - Client IP [192.168.0.1] Other data Line2 - Client IP [192.168.0.2] Other data Line3 - Client IP [192....
TITLE: "Unix shell"-alike script under Windows QUESTION: I need some help from the shell-script gurus out there. I have a.txt file (log) that traces the IP addresses of clients on several lines, in a format similar to this one: Line1 - Client IP [192.168.0.1] Other data Line2 - Client IP [192.168.0.2] Other data Line3...
[ "windows", "unix", "shell", "scripting" ]
1
6
965
5
0
2008-10-08T18:23:26.600000
2008-10-08T18:49:52.477000
184,147
184,566
CountDownLatch vs. Semaphore
Is there any advantage of using java.util.concurrent.CountdownLatch instead of java.util.concurrent.Semaphore? As far as I can tell the following fragments are almost equivalent: 1. Semaphore final Semaphore sem = new Semaphore(0); for (int i = 0; i < num_threads; ++ i) { Thread t = new Thread() { public void run() { t...
CountDownLatch is frequently used for the exact opposite of your example. Generally, you would have many threads blocking on await() that would all start simultaneously when the countown reached zero. final CountDownLatch countdown = new CountDownLatch(1); for (int i = 0; i < 10; ++ i) { Thread racecar = new Thread() ...
CountDownLatch vs. Semaphore Is there any advantage of using java.util.concurrent.CountdownLatch instead of java.util.concurrent.Semaphore? As far as I can tell the following fragments are almost equivalent: 1. Semaphore final Semaphore sem = new Semaphore(0); for (int i = 0; i < num_threads; ++ i) { Thread t = new Thr...
TITLE: CountDownLatch vs. Semaphore QUESTION: Is there any advantage of using java.util.concurrent.CountdownLatch instead of java.util.concurrent.Semaphore? As far as I can tell the following fragments are almost equivalent: 1. Semaphore final Semaphore sem = new Semaphore(0); for (int i = 0; i < num_threads; ++ i) { ...
[ "java", "multithreading", "concurrency", "semaphore", "countdownlatch" ]
114
123
65,739
8
0
2008-10-08T18:25:21.167000
2008-10-08T19:53:50.693000
184,171
184,227
What "formula" do you use to evaluate open-source communities?
One problem I have with open-source is not often the product or documentation, but the level of community involvement and support. Response time for some questions on official forums can take more than a week, which can honestly make a big difference when choosing a platform for commercial services use. However, I find...
I've usually found that relying on community support for anything mission critical is asking for trouble. So I usually stay away from open source unless it's something that I'm confident we can support in-house or there is a commercial support service available for it.
What "formula" do you use to evaluate open-source communities? One problem I have with open-source is not often the product or documentation, but the level of community involvement and support. Response time for some questions on official forums can take more than a week, which can honestly make a big difference when c...
TITLE: What "formula" do you use to evaluate open-source communities? QUESTION: One problem I have with open-source is not often the product or documentation, but the level of community involvement and support. Response time for some questions on official forums can take more than a week, which can honestly make a big...
[ "open-source" ]
2
3
202
3
0
2008-10-08T18:29:53.357000
2008-10-08T18:41:31.447000
184,178
316,338
Ruby: How to post a file via HTTP as multipart/form-data?
I want to do an HTTP POST that looks like an HMTL form posted from a browser. Specifically, post some text fields and a file field. Posting text fields is straightforward, there's an example right there in the net/http rdocs, but I can't figure out how to post a file along with it. Net::HTTP doesn't look like the best ...
I like RestClient. It encapsulates net/http with cool features like multipart form data: require 'rest_client' RestClient.post('http://localhost:3000/foo',:name_of_file_param => File.new('/path/to/file')) It also supports streaming. gem install rest-client will get you started.
Ruby: How to post a file via HTTP as multipart/form-data? I want to do an HTTP POST that looks like an HMTL form posted from a browser. Specifically, post some text fields and a file field. Posting text fields is straightforward, there's an example right there in the net/http rdocs, but I can't figure out how to post a...
TITLE: Ruby: How to post a file via HTTP as multipart/form-data? QUESTION: I want to do an HTTP POST that looks like an HMTL form posted from a browser. Specifically, post some text fields and a file field. Posting text fields is straightforward, there's an example right there in the net/http rdocs, but I can't figure...
[ "ruby", "http", "post" ]
129
104
137,379
14
0
2008-10-08T18:31:41.263000
2008-11-25T04:03:44.023000
184,187
184,344
How do I check out a file from perforce in python?
I would like to write some scripts in python that do some automated changes to source code. If the script determines it needs to change the file I would like to first check it out of perforce. I don't care about checking in because I will always want to build and test first.
Perforce has Python wrappers around their C/C++ tools, available in binary form for Windows, and source for other platforms: http://www.perforce.com/perforce/loadsupp.html#api You will find their documentation of the scripting API to be helpful: http://www.perforce.com/perforce/doc.current/manuals/p4script/p4script.pdf...
How do I check out a file from perforce in python? I would like to write some scripts in python that do some automated changes to source code. If the script determines it needs to change the file I would like to first check it out of perforce. I don't care about checking in because I will always want to build and test ...
TITLE: How do I check out a file from perforce in python? QUESTION: I would like to write some scripts in python that do some automated changes to source code. If the script determines it needs to change the file I would like to first check it out of perforce. I don't care about checking in because I will always want ...
[ "python", "scripting", "perforce" ]
16
22
21,478
6
0
2008-10-08T18:33:08.250000
2008-10-08T19:02:38.783000
184,195
184,225
Seating plan software recommendations (does such a beast even exist?)
I'm getting married soon and am busy with the seating plan, and am running into the usual issues of who sits where: X and Y must sit together, but A and B cannot stand each other etc. The numbers I'm dealing with aren't huge (so the manual option will work just fine), but being of the geeky persuasion, I was wondering ...
http://www.perfecttableplan.com/ I believe this is from a guy that usually posts at Joel On Software. Never tried it though. Hope it helps.
Seating plan software recommendations (does such a beast even exist?) I'm getting married soon and am busy with the seating plan, and am running into the usual issues of who sits where: X and Y must sit together, but A and B cannot stand each other etc. The numbers I'm dealing with aren't huge (so the manual option wil...
TITLE: Seating plan software recommendations (does such a beast even exist?) QUESTION: I'm getting married soon and am busy with the seating plan, and am running into the usual issues of who sits where: X and Y must sit together, but A and B cannot stand each other etc. The numbers I'm dealing with aren't huge (so the...
[ "language-agnostic" ]
4
6
3,680
7
0
2008-10-08T18:34:18.980000
2008-10-08T18:41:15.143000
184,204
191,304
How to change SharePoint extended web application's web.config file
Using the SharePoint API, how can I modify an extended webapp web.config file? I have to do some changes in this file to specify the connection string, membershipprovider, etc... for using Forms Authentication. Currently, I can change the "master" webapplication web.config file, but not the extended one. Edited I'm usi...
I got an answer form a blog. In your case, you need to write a Web Application scoped feature which after you provision your site using your C# app, it is deployed to the newly-provisioned site and in the receiver of the feature you inject the required web.config settings because in that context configuration API is ob...
How to change SharePoint extended web application's web.config file Using the SharePoint API, how can I modify an extended webapp web.config file? I have to do some changes in this file to specify the connection string, membershipprovider, etc... for using Forms Authentication. Currently, I can change the "master" weba...
TITLE: How to change SharePoint extended web application's web.config file QUESTION: Using the SharePoint API, how can I modify an extended webapp web.config file? I have to do some changes in this file to specify the connection string, membershipprovider, etc... for using Forms Authentication. Currently, I can change...
[ "sharepoint", "web-config" ]
5
2
2,760
2
0
2008-10-08T18:37:11.970000
2008-10-10T13:35:56.870000
184,216
184,372
Switching on a string/implementing button actions
Full disclaimer: I'm a CS student, and this question is related to a recently assigned Java program for Object-Oriented Programming. Although we've done some console stuff, this is the first time we've worked with a GUI and Swing or Awt. We were given some code that created a window with some text and a button that rot...
Instead of writing this: resetButton.addActionListener(this); You could also write this: resetButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { resetButtonActionPerformed(evt); } }); And instead of writing one big actionPerformed() for all actions, you can (and then have to)...
Switching on a string/implementing button actions Full disclaimer: I'm a CS student, and this question is related to a recently assigned Java program for Object-Oriented Programming. Although we've done some console stuff, this is the first time we've worked with a GUI and Swing or Awt. We were given some code that cre...
TITLE: Switching on a string/implementing button actions QUESTION: Full disclaimer: I'm a CS student, and this question is related to a recently assigned Java program for Object-Oriented Programming. Although we've done some console stuff, this is the first time we've worked with a GUI and Swing or Awt. We were given ...
[ "java", "swing", "awt" ]
1
1
823
5
0
2008-10-08T18:38:52.373000
2008-10-08T19:08:01.580000
184,253
203,016
Converting registry access to db calls from MFC Feature Pack
We may start converting an old VS2003 MFC project to use the fancy new features provided by the MFC Feature Pack and VS2008. Several of the new UI controls would be very nice except for one thing - they automatically save their information to the registry. I don't have a problem with the registry, but for the multiple ...
It seems like it should be possible to do what you're suggesting, according to the information on this page in MSDN. I haven't tried this myself, so I don't know how difficult it will be in practice. According to the documentation, you should create a class that inherits CSettingsStore to read and write the settings, a...
Converting registry access to db calls from MFC Feature Pack We may start converting an old VS2003 MFC project to use the fancy new features provided by the MFC Feature Pack and VS2008. Several of the new UI controls would be very nice except for one thing - they automatically save their information to the registry. I ...
TITLE: Converting registry access to db calls from MFC Feature Pack QUESTION: We may start converting an old VS2003 MFC project to use the fancy new features provided by the MFC Feature Pack and VS2008. Several of the new UI controls would be very nice except for one thing - they automatically save their information t...
[ "c++", "database", "mfc", "registry", "mfc-feature-pack" ]
2
2
1,009
2
0
2008-10-08T18:47:51.683000
2008-10-14T22:02:46.393000
184,254
440,333
Type 'System.Web.UI.WebControls.SessionParameter' does not have a public property named 'DbType'
I am using a Session Parameter on an ObjectDataSource. It works fine on the local development machine but I get this error after copying the website to the production server: Type 'System.Web.UI.WebControls.SessionParameter' does not have a public property named 'DbType'.
Me again! First Answer I gave was WRONG! Correct answer is that.NET Framework v3.5 was installed, and it needs to be updated to.NET framework 3.5 SP1
Type 'System.Web.UI.WebControls.SessionParameter' does not have a public property named 'DbType' I am using a Session Parameter on an ObjectDataSource. It works fine on the local development machine but I get this error after copying the website to the production server: Type 'System.Web.UI.WebControls.SessionParameter...
TITLE: Type 'System.Web.UI.WebControls.SessionParameter' does not have a public property named 'DbType' QUESTION: I am using a Session Parameter on an ObjectDataSource. It works fine on the local development machine but I get this error after copying the website to the production server: Type 'System.Web.UI.WebControl...
[ "asp.net", "sql", "parameters", "objectdatasource" ]
0
0
4,546
8
0
2008-10-08T18:48:00.857000
2009-01-13T19:10:04.303000
184,257
185,493
Using separate TFS projects for source control and work item tracking, is this a good thing?
I have a client who is using one TFS project just for source control only and now wants to manage work items in a totally different TFS project, using a different process template, and intends to link changesets to work items across TFS projects. I know that this is possible in TFS, but don't know what the limitations ...
It'll work - I've occasionally had to associate checkins with work items from other projects. I haven't noticed any issues with reports or the like, that said this seems like an overly complex arrangement with little benefit.
Using separate TFS projects for source control and work item tracking, is this a good thing? I have a client who is using one TFS project just for source control only and now wants to manage work items in a totally different TFS project, using a different process template, and intends to link changesets to work items a...
TITLE: Using separate TFS projects for source control and work item tracking, is this a good thing? QUESTION: I have a client who is using one TFS project just for source control only and now wants to manage work items in a totally different TFS project, using a different process template, and intends to link changese...
[ "version-control", "tfs", "team-project" ]
1
1
1,432
3
0
2008-10-08T18:48:12.010000
2008-10-09T00:33:58.413000
184,265
184,426
What system do you use to encrypt files for a group of people (OS agnostic prefered)?
Say you have a bunch of files. Say you can store meta data to these files. Say, one of these meta attributes were called "encryption" Say everyone was allowed to look at these files, but since they are encrypted, only people who know how to decrypt them can actually read the contents. Say, for every given value of "enc...
The encryption isn't the hard part, here. Understanding the business needs, and especially, what threats you're trying to protect against, is the hard part. Key management isn't a trivial thing. I highly recommend the book " Applied Cryptography " to help you understand the protocol-level issues better.
What system do you use to encrypt files for a group of people (OS agnostic prefered)? Say you have a bunch of files. Say you can store meta data to these files. Say, one of these meta attributes were called "encryption" Say everyone was allowed to look at these files, but since they are encrypted, only people who know ...
TITLE: What system do you use to encrypt files for a group of people (OS agnostic prefered)? QUESTION: Say you have a bunch of files. Say you can store meta data to these files. Say, one of these meta attributes were called "encryption" Say everyone was allowed to look at these files, but since they are encrypted, onl...
[ "encryption", "pki" ]
2
2
1,735
7
0
2008-10-08T18:49:09.217000
2008-10-08T19:19:50.950000
184,272
184,277
What exactly does the word Patch mean when referring to 'submitting a patch'?
What exactly does the word patch mean when referring to 'submitting a patch'? I've seen this used a lot, especially in the open source world. What what does it mean and what exactly is involved in submitting a patch?
It's a file with a list of differences between the code files that have changed. It's usually in the format generated by doing a diff -u on the two files. Most version control systems allow the easy creation of patches but it's generally in that same format. This allows the code change to be easily applied to someone e...
What exactly does the word Patch mean when referring to 'submitting a patch'? What exactly does the word patch mean when referring to 'submitting a patch'? I've seen this used a lot, especially in the open source world. What what does it mean and what exactly is involved in submitting a patch?
TITLE: What exactly does the word Patch mean when referring to 'submitting a patch'? QUESTION: What exactly does the word patch mean when referring to 'submitting a patch'? I've seen this used a lot, especially in the open source world. What what does it mean and what exactly is involved in submitting a patch? ANSWER...
[ "language-agnostic", "open-source", "patch" ]
11
18
4,278
10
0
2008-10-08T18:49:52.053000
2008-10-08T18:51:19.820000
184,289
741,015
How can jsessionID be suppressed on OC4J?
I'm deploying a JSF (myfaces, restfaces, and richfaces) app to OC4J. I don't want the jsessionid to appear in the status bar or the URL address. I have managed to suppress it in almost all cases. The one case that I still have problems with is when the site is first visited with a "clean" browser (with no cache, histor...
The following code in a servlet filter has worked for us. The idea is override any URL-rewriting logic by employing a custom response wrapper. public void doFilter( ServletRequest req, ServletResponse resp, FilterChain filterChain ) throws IOException, ServletException { if ( req instanceof HttpServletRequest && resp i...
How can jsessionID be suppressed on OC4J? I'm deploying a JSF (myfaces, restfaces, and richfaces) app to OC4J. I don't want the jsessionid to appear in the status bar or the URL address. I have managed to suppress it in almost all cases. The one case that I still have problems with is when the site is first visited wit...
TITLE: How can jsessionID be suppressed on OC4J? QUESTION: I'm deploying a JSF (myfaces, restfaces, and richfaces) app to OC4J. I don't want the jsessionid to appear in the status bar or the URL address. I have managed to suppress it in almost all cases. The one case that I still have problems with is when the site is...
[ "session", "jsf", "oc4j" ]
1
2
2,022
1
0
2008-10-08T18:52:53.437000
2009-04-12T00:03:30.903000
184,309
184,355
How to use System.IO.Compression to read/write ZIP files?
I know there are libraries out there for working with ZIP files. And, you can alternatively use the functionality built into Windows for working ZIP files. But, I'm wondering if anyone has worked out how to use the tools built into the System.IO.Compression namespace within.NET for reading/writing ZIP files? Or, is it ...
MSDN has a complete example http://msdn.microsoft.com/en-us/library/system.io.packaging.zippackage.aspx using the ZipPackage class. Requires.NET 3.5.
How to use System.IO.Compression to read/write ZIP files? I know there are libraries out there for working with ZIP files. And, you can alternatively use the functionality built into Windows for working ZIP files. But, I'm wondering if anyone has worked out how to use the tools built into the System.IO.Compression name...
TITLE: How to use System.IO.Compression to read/write ZIP files? QUESTION: I know there are libraries out there for working with ZIP files. And, you can alternatively use the functionality built into Windows for working ZIP files. But, I'm wondering if anyone has worked out how to use the tools built into the System.I...
[ ".net", "compression", "zip" ]
20
17
93,602
9
0
2008-10-08T18:56:16.567000
2008-10-08T19:04:05.397000
184,312
185,675
How to make Jetty dynamically load "static" pages
I am building Java web applications, and I hate the traditional "code-compile-deploy-test" cycle. I want to type in one tiny change, then see the result INSTANTLY, without having to compile and deploy. Fortunately, Jetty is great for this. It is a pure-java web server. It comes with a really nice maven plugin which let...
Jetty uses memory-mapped files to buffer static content, which causes the file-locking in Windows. Try setting useFileMappedBuffer for DefaultServlet to false. Troubleshooting Locked files on Windows (from the Jetty wiki) has instructions.
How to make Jetty dynamically load "static" pages I am building Java web applications, and I hate the traditional "code-compile-deploy-test" cycle. I want to type in one tiny change, then see the result INSTANTLY, without having to compile and deploy. Fortunately, Jetty is great for this. It is a pure-java web server. ...
TITLE: How to make Jetty dynamically load "static" pages QUESTION: I am building Java web applications, and I hate the traditional "code-compile-deploy-test" cycle. I want to type in one tiny change, then see the result INSTANTLY, without having to compile and deploy. Fortunately, Jetty is great for this. It is a pure...
[ "java", "spring", "jetty" ]
28
18
23,263
10
0
2008-10-08T18:57:28.217000
2008-10-09T02:13:56.730000
184,313
184,451
Regex failing on right parens
I have this.NET regex: ^(? ("[^"]*"))\s(? (\([^\)]*\)))\s(? ("[^"]*"))$ It properly matches the following strings: "some prefix" ("attribute 1" "value 1") "some suffix" "some prefix" ("attribute 1" "value 1" "attribute 2" "value 2") "some suffix" It fails on... "some prefix" ("attribute 1" "value (fail) 1") "some suffi...
my, untested guess: ^(? ("[^"]*"))\s(? (\(("[^"]*")(\s("[^"]*")*)**\)))\s(? ("[^"]*"))$ hereby I've replaced [^\)]* with ("[^"]*")(\s("[^"]*")*)* I assumed everything within the parenthesis is either between double quotes, or is a whitespace. If you want to know how I came up with this, read Mastering Regular Expressio...
Regex failing on right parens I have this.NET regex: ^(? ("[^"]*"))\s(? (\([^\)]*\)))\s(? ("[^"]*"))$ It properly matches the following strings: "some prefix" ("attribute 1" "value 1") "some suffix" "some prefix" ("attribute 1" "value 1" "attribute 2" "value 2") "some suffix" It fails on... "some prefix" ("attribute 1"...
TITLE: Regex failing on right parens QUESTION: I have this.NET regex: ^(? ("[^"]*"))\s(? (\([^\)]*\)))\s(? ("[^"]*"))$ It properly matches the following strings: "some prefix" ("attribute 1" "value 1") "some suffix" "some prefix" ("attribute 1" "value 1" "attribute 2" "value 2") "some suffix" It fails on... "some pref...
[ ".net", "regex" ]
0
2
211
5
0
2008-10-08T18:57:48.107000
2008-10-08T19:26:57.207000
184,328
184,369
What is the difference between Obfuscation, Hashing, and Encryption?
What is the difference between Obfuscation, Hashing, and Encryption? Here is my understanding: Hashing is a one-way algorithm; cannot be reversed Obfuscation is similar to encryption but doesn't require any "secret" to understand (ROT13 is one example) Encryption is reversible but a "secret" is required to do so
Hashing is a technique of creating semi-unique keys based on larger pieces of data. In a given hash you will eventually have "collisions" (e.g. two different pieces of data calculating to the same hash value) and when you do, you typically create a larger hash key size. obfuscation generally involves trying to remove h...
What is the difference between Obfuscation, Hashing, and Encryption? What is the difference between Obfuscation, Hashing, and Encryption? Here is my understanding: Hashing is a one-way algorithm; cannot be reversed Obfuscation is similar to encryption but doesn't require any "secret" to understand (ROT13 is one example...
TITLE: What is the difference between Obfuscation, Hashing, and Encryption? QUESTION: What is the difference between Obfuscation, Hashing, and Encryption? Here is my understanding: Hashing is a one-way algorithm; cannot be reversed Obfuscation is similar to encryption but doesn't require any "secret" to understand (RO...
[ "encryption", "hash", "obfuscation" ]
38
34
29,409
11
0
2008-10-08T19:00:45.323000
2008-10-08T19:07:29.990000
184,359
184,410
What's the purpose of sequental uniqueidentifier in PK of MS SQL?
I know that primary keys based on Guids do not have the best performance (due to the fragmentation), but they are globally unique and allow replication scenarios. Integral identifiers, on the other side, have greater performance at the cost of scalability. But in what scenarios would someone want to use sequential uniq...
What is commonly known as a sequential guids in SQL Server 2005 (generated by NEWSEQUENTIALID()) are an attempt to overcome the issues with normal guids. They are still universally unique but also are always ascending. This means that they can be used for replication and have much better insert performance than traditi...
What's the purpose of sequental uniqueidentifier in PK of MS SQL? I know that primary keys based on Guids do not have the best performance (due to the fragmentation), but they are globally unique and allow replication scenarios. Integral identifiers, on the other side, have greater performance at the cost of scalabilit...
TITLE: What's the purpose of sequental uniqueidentifier in PK of MS SQL? QUESTION: I know that primary keys based on Guids do not have the best performance (due to the fragmentation), but they are globally unique and allow replication scenarios. Integral identifiers, on the other side, have greater performance at the ...
[ "sql", "database", "guid", "uniqueidentifier" ]
2
6
1,241
2
0
2008-10-08T19:04:47.327000
2008-10-08T19:16:30.050000
184,365
184,802
Multiple users XDebug and PHP Debugging
How do you setup a multi-developer XDebug PHP environment? I have the following setup: I have a linux machine with Apache and Xdebug loaded and a php.ini file that I think is correct. I found a python proxy script that I'm using to proxy the calls from the PDT Eclipse IDE's my developers are using to the Apache/Xdebug ...
You can use ssh to tunnel the debug-connection back to your client machine. Eg. from your client machine, connect to the server with something like: ssh -R 9000:localhost:9000 you@example.com Then fire up your (local) debugger, and start the remote script. Xdebug (at the server) will now establish a connection to its l...
Multiple users XDebug and PHP Debugging How do you setup a multi-developer XDebug PHP environment? I have the following setup: I have a linux machine with Apache and Xdebug loaded and a php.ini file that I think is correct. I found a python proxy script that I'm using to proxy the calls from the PDT Eclipse IDE's my de...
TITLE: Multiple users XDebug and PHP Debugging QUESTION: How do you setup a multi-developer XDebug PHP environment? I have the following setup: I have a linux machine with Apache and Xdebug loaded and a php.ini file that I think is correct. I found a python proxy script that I'm using to proxy the calls from the PDT E...
[ "php", "xdebug" ]
8
19
7,977
1
0
2008-10-08T19:06:21.117000
2008-10-08T20:43:04.900000
184,373
184,413
What is the best HTML Rendering Engine to embed in an application?
At the moment, our application uses the Trident Win32 component, but we want to move away from that for a few reasons, chief among them being our desire to go cross-platform. We're looking at WebKit and Gecko, but I'd love to get some feedback before I make a decision. Here are some of the most important requirements: ...
A little history might help in your decision. When Apple was considering which engine to use in making Safari they looked at Gecko, but decided to go with KHTML, fork it and called it WebKit. Their reasons for doing this was that Gecko had tons of legacy cruft still leftover from Netscape and was far more complicated. ...
What is the best HTML Rendering Engine to embed in an application? At the moment, our application uses the Trident Win32 component, but we want to move away from that for a few reasons, chief among them being our desire to go cross-platform. We're looking at WebKit and Gecko, but I'd love to get some feedback before I ...
TITLE: What is the best HTML Rendering Engine to embed in an application? QUESTION: At the moment, our application uses the Trident Win32 component, but we want to move away from that for a few reasons, chief among them being our desire to go cross-platform. We're looking at WebKit and Gecko, but I'd love to get some ...
[ "c++", "qt", "webkit", "gecko", "rendering-engine" ]
18
9
21,137
6
0
2008-10-08T19:08:01.923000
2008-10-08T19:16:34.823000
184,409
184,588
NSAutoreleasePool in NSOperation main?
The documentation for +[NSThread detachNewThreadSelector:toTarget:withObject:] says: For non garbage-collected applications, the method aSelector is responsible for setting up an autorelease pool for the newly detached thread and freeing that pool before it exits. My question is, do I need to create my own NSAutoreleas...
Yes, you do. You're defining a self-contained piece of work which the NSOperationQueue will execute on "some" thread, so you're responsible for managing memory in that work piece.
NSAutoreleasePool in NSOperation main? The documentation for +[NSThread detachNewThreadSelector:toTarget:withObject:] says: For non garbage-collected applications, the method aSelector is responsible for setting up an autorelease pool for the newly detached thread and freeing that pool before it exits. My question is, ...
TITLE: NSAutoreleasePool in NSOperation main? QUESTION: The documentation for +[NSThread detachNewThreadSelector:toTarget:withObject:] says: For non garbage-collected applications, the method aSelector is responsible for setting up an autorelease pool for the newly detached thread and freeing that pool before it exits...
[ "cocoa", "cocoa-touch", "multithreading" ]
25
12
6,249
5
0
2008-10-08T19:16:18.087000
2008-10-08T20:01:19.163000
184,427
188,419
Outlook PropertyFrom MAPI Schema Property ID
I am looking to get the actual property name from a MAPI schema property. I'm obtaining the MAPI Schema property " http://schemas.microsoft.com/mapi/proptag/0x67AA000B " but I would like to know what field this corresponds to (I.E. Anniversary, BusinessAddress, etc). Any insight would be appreciated.
This link to MSDN provides a table which shows the allocation of particular tag range values to an assigned purpose MAPI Property Tag Table. The table indicates that 0x67aa000b is in the following range: 0x6600 0x67FF Provider-defined internal non-transmittable property The value 0x000b indicates this is a Boolean type...
Outlook PropertyFrom MAPI Schema Property ID I am looking to get the actual property name from a MAPI schema property. I'm obtaining the MAPI Schema property " http://schemas.microsoft.com/mapi/proptag/0x67AA000B " but I would like to know what field this corresponds to (I.E. Anniversary, BusinessAddress, etc). Any ins...
TITLE: Outlook PropertyFrom MAPI Schema Property ID QUESTION: I am looking to get the actual property name from a MAPI schema property. I'm obtaining the MAPI Schema property " http://schemas.microsoft.com/mapi/proptag/0x67AA000B " but I would like to know what field this corresponds to (I.E. Anniversary, BusinessAddr...
[ "c#", "outlook", "exchange-server", "mapi" ]
0
3
2,394
1
0
2008-10-08T19:20:01.633000
2008-10-09T17:59:22.967000
184,431
185,048
Converting XML to plain text - how should I ignore/handle whitespace in the XSLT?
I'm trying to convert an XML file into the markup used by dokuwiki, using XSLT. This actually works to some degree, but the indentation in the XSL file is getting inserted into the results. At the moment, I have two choices: abandon this XSLT thing entirely, and find another way to convert from XML to dokuwiki markup, ...
There are three reasons for getting unwanted whitespace in the result of an XSLT transformation: whitespace that comes from between nodes in the source document whitespace that comes from within nodes in the source document whitespace that comes from the stylesheet I'm going to talk about all three because it can be ha...
Converting XML to plain text - how should I ignore/handle whitespace in the XSLT? I'm trying to convert an XML file into the markup used by dokuwiki, using XSLT. This actually works to some degree, but the indentation in the XSL file is getting inserted into the results. At the moment, I have two choices: abandon this ...
TITLE: Converting XML to plain text - how should I ignore/handle whitespace in the XSLT? QUESTION: I'm trying to convert an XML file into the markup used by dokuwiki, using XSLT. This actually works to some degree, but the indentation in the XSL file is getting inserted into the results. At the moment, I have two choi...
[ "xml", "xslt", "whitespace", "dokuwiki" ]
36
77
32,320
4
0
2008-10-08T19:22:47.463000
2008-10-08T21:46:07.470000
184,436
184,575
Access Alter Table "Allow Zero Length"
I'm working with an old Access database (yes, it's very ugly and I hate it). I need to modify some of the columns from a VB app that I'm creating. I have most the modifications setup correctly, but I'm fighting with the fact that modifying a column to text has it default to "Allow Zero Length" to false. SO ALTER TABLE ...
This option isn't available with Jet sql. You can do it in the Access gui or with vba code. Example: Public Function setAllowZeroLenStr() On Error GoTo Proc_Err Dim db As Database Dim tbl As TableDef Dim fld As DAO.Field Set db = CurrentDb Set tbl = db.TableDefs![Applicant Table] Set fld = tbl.Fields![Applicant ID] f...
Access Alter Table "Allow Zero Length" I'm working with an old Access database (yes, it's very ugly and I hate it). I need to modify some of the columns from a VB app that I'm creating. I have most the modifications setup correctly, but I'm fighting with the fact that modifying a column to text has it default to "Allow...
TITLE: Access Alter Table "Allow Zero Length" QUESTION: I'm working with an old Access database (yes, it's very ugly and I hate it). I need to modify some of the columns from a VB app that I'm creating. I have most the modifications setup correctly, but I'm fighting with the fact that modifying a column to text has it...
[ "ms-access" ]
4
4
10,771
5
0
2008-10-08T19:24:35.900000
2008-10-08T19:57:01.747000
184,443
186,051
Mate actionscript only version, does it exist?
Hey there, I'm looking into using Mate, but the projects I work on do not require the majority of the functionality of the Flex framework. My workmate said that he heard of an Actionscript version, but I can find no information on the main site about this, only that they have removed some dependencies on the Flex frame...
Mate uses tags heavily, therefore it has a dependency on Flex. There are some ways to use tags without the Flex framework, but there are places in Mate where we use framework classes. It would take some effort to try to remove those dependencies, and while it is something that we want to investigate, I don't think it w...
Mate actionscript only version, does it exist? Hey there, I'm looking into using Mate, but the projects I work on do not require the majority of the functionality of the Flex framework. My workmate said that he heard of an Actionscript version, but I can find no information on the main site about this, only that they h...
TITLE: Mate actionscript only version, does it exist? QUESTION: Hey there, I'm looking into using Mate, but the projects I work on do not require the majority of the functionality of the Flex framework. My workmate said that he heard of an Actionscript version, but I can find no information on the main site about this...
[ "apache-flex", "actionscript-3", "mate" ]
1
4
336
1
0
2008-10-08T19:25:43.980000
2008-10-09T05:53:26.490000
184,471
184,659
Multiple DB Updates:
Replaces Question: Update multiple rows into SQL table Here's a Code Snippet to update an exam results set. DB structure is as given, but I can submit Stored Procedures for inclusion (Which are a pain to modify, so I save that until the end.) The question: Is there a better way using SQL server v 2005.,net 2.0? string ...
A few things stand out: You don't show where the SqlConnection is instantiated, so it's not clear that you're disposing it properly. You shouldn't be swallowing exceptions in the loop - better to handle them in a top level exception handler. You're instantiating new parameters on each iteration through the loop - you c...
Multiple DB Updates: Replaces Question: Update multiple rows into SQL table Here's a Code Snippet to update an exam results set. DB structure is as given, but I can submit Stored Procedures for inclusion (Which are a pain to modify, so I save that until the end.) The question: Is there a better way using SQL server v 2...
TITLE: Multiple DB Updates: QUESTION: Replaces Question: Update multiple rows into SQL table Here's a Code Snippet to update an exam results set. DB structure is as given, but I can submit Stored Procedures for inclusion (Which are a pain to modify, so I save that until the end.) The question: Is there a better way us...
[ "c#", ".net", "sql-server" ]
2
4
2,914
5
0
2008-10-08T19:33:11.717000
2008-10-08T20:14:23.757000
184,476
185,885
PowerShell generic collections
I have been pushing into the.NET framework in PowerShell, and I have hit something that I don't understand. This works fine: $foo = New-Object "System.Collections.Generic.Dictionary``2[System.String,System.String]" $foo.Add("FOO", "BAR") $foo Key Value --- ----- FOO BAR This however does not: $bar = New-Object "System...
Dictionary is not defined in the same assembly as SortedDictionary. One is in mscorlib and the other in system.dll. Therein lies the problem. The current behavior in PowerShell is that when resolving the generic parameters specified, if the types are not fully qualified type names, it sort of assumes that they are in t...
PowerShell generic collections I have been pushing into the.NET framework in PowerShell, and I have hit something that I don't understand. This works fine: $foo = New-Object "System.Collections.Generic.Dictionary``2[System.String,System.String]" $foo.Add("FOO", "BAR") $foo Key Value --- ----- FOO BAR This however does...
TITLE: PowerShell generic collections QUESTION: I have been pushing into the.NET framework in PowerShell, and I have hit something that I don't understand. This works fine: $foo = New-Object "System.Collections.Generic.Dictionary``2[System.String,System.String]" $foo.Add("FOO", "BAR") $foo Key Value --- ----- FOO BAR...
[ ".net", "powershell", "powershell-1.0" ]
37
20
45,302
3
0
2008-10-08T19:34:15.303000
2008-10-09T03:54:42.190000
184,482
184,518
enter multiple variables into table, assigning to each appropriate record
I display data into an html table, w/ a drop down box with a list of venues. Each volunteer will be assigned a venue. I envision being able to go down thru the html table and assigning each volunteer a venue. The drop down box contains all the possible venues that they can be assigned to. Setup Check in etc... Then onc...
Change the name of each select, in a way it includes a volunteer id: Setup etc... Setup etc... Setup etc... After submit there will be a table in $_POST named venues and with indices: 1, 2, 3 (beeing volunteer id) and values beeing selected value for each volunteer. Now you can iterate on $_POST['venues'] array and sav...
enter multiple variables into table, assigning to each appropriate record I display data into an html table, w/ a drop down box with a list of venues. Each volunteer will be assigned a venue. I envision being able to go down thru the html table and assigning each volunteer a venue. The drop down box contains all the po...
TITLE: enter multiple variables into table, assigning to each appropriate record QUESTION: I display data into an html table, w/ a drop down box with a list of venues. Each volunteer will be assigned a venue. I envision being able to go down thru the html table and assigning each volunteer a venue. The drop down box c...
[ "php", "mysql" ]
3
3
557
4
0
2008-10-08T19:35:08.810000
2008-10-08T19:43:03.193000
184,486
184,524
What is an intuitive way to move an XmlNode from one XmlDocument to another?
I have two XmlDocuments and I would like to move an XmlNode selected from one of the documents and append it at a particular location in the other document. The naively intuitive approach of simply calling AppendNode(xmlNodeFromDocument1) at the appropriate place of document 2, of course doesn't work because the method...
You need to call ImportNode on the target document to get a node compatible with your target document. The following code illustrates how it is done in C#. public void CopyExample() { XmlNode nodeFromDifferentDocument = SelectNodeFromSourceDocument(); XmlDocument targetDocument = InitializeTargetDocument(); XmlNode ta...
What is an intuitive way to move an XmlNode from one XmlDocument to another? I have two XmlDocuments and I would like to move an XmlNode selected from one of the documents and append it at a particular location in the other document. The naively intuitive approach of simply calling AppendNode(xmlNodeFromDocument1) at t...
TITLE: What is an intuitive way to move an XmlNode from one XmlDocument to another? QUESTION: I have two XmlDocuments and I would like to move an XmlNode selected from one of the documents and append it at a particular location in the other document. The naively intuitive approach of simply calling AppendNode(xmlNodeF...
[ ".net", "xml", "system.xml" ]
3
7
1,092
1
0
2008-10-08T19:35:41.103000
2008-10-08T19:45:22.083000
184,489
1,443,596
How to get an image stored as an oracle blob into an Image object
I am trying to retrieve an image stored in an oracle blob and place it in a new System.Drawing.Image instance. I know I can write the stream to a temp.bmp file on the disk and read it from there but thats just not l33t enough for me. How do I convert the blob object directly to an image?
Assuming: you are using the Microsoft client ( System.Data.OracleClient ). you have a proper OracleConnection instance ( connection ). you have an OracleCommand ready ( command, based on SELECT my_blob FROM my_table WHERE id=xx ). This should go like this: using (OracleDataReader odr=command.ExecuteReader()) { reader.R...
How to get an image stored as an oracle blob into an Image object I am trying to retrieve an image stored in an oracle blob and place it in a new System.Drawing.Image instance. I know I can write the stream to a temp.bmp file on the disk and read it from there but thats just not l33t enough for me. How do I convert the...
TITLE: How to get an image stored as an oracle blob into an Image object QUESTION: I am trying to retrieve an image stored in an oracle blob and place it in a new System.Drawing.Image instance. I know I can write the stream to a temp.bmp file on the disk and read it from there but thats just not l33t enough for me. Ho...
[ ".net", "ado.net" ]
0
1
3,007
2
0
2008-10-08T19:36:49.293000
2009-09-18T10:04:20.727000
184,491
199,222
Java Applet, AWT Refresh, issue on Mac OS X 10.4
We have a Java Applet built using AWT. This applet lets you select pictures from your hard drive and upload them to a server. The applet includes a scrollable list of pictures, which works fine in Windows, Linux and Mac OS X 10.5. We launch this applet via Java Web Start or within a web page. Our applet does not behave...
It does look like mixing lightweight (usually Swing) and heavyweight (AWT) components together. Moving to Swing you need to replace every last AWT component Swing equivalents (hint: avoid import java.awt.*). Threading is often a potential problem for odd bugs. Swing components must always be used on the EDT (use java.a...
Java Applet, AWT Refresh, issue on Mac OS X 10.4 We have a Java Applet built using AWT. This applet lets you select pictures from your hard drive and upload them to a server. The applet includes a scrollable list of pictures, which works fine in Windows, Linux and Mac OS X 10.5. We launch this applet via Java Web Start...
TITLE: Java Applet, AWT Refresh, issue on Mac OS X 10.4 QUESTION: We have a Java Applet built using AWT. This applet lets you select pictures from your hard drive and upload them to a server. The applet includes a scrollable list of pictures, which works fine in Windows, Linux and Mac OS X 10.5. We launch this applet ...
[ "java", "macos", "applet", "awt", "osx-tiger" ]
0
1
3,679
2
0
2008-10-08T19:37:14.347000
2008-10-13T22:19:01.337000
184,502
184,519
On a unix/linux system how can I learn more about a mylib.a archive?
In this particular case I'm trying to discover if a mylib.a file is 32 or 64 bit compatible. I'm familiar with ldd for shared objects (mylib.so) but how do I inspect a regular.a archive?
"nm" and "ar" will give you some information about the library archive.
On a unix/linux system how can I learn more about a mylib.a archive? In this particular case I'm trying to discover if a mylib.a file is 32 or 64 bit compatible. I'm familiar with ldd for shared objects (mylib.so) but how do I inspect a regular.a archive?
TITLE: On a unix/linux system how can I learn more about a mylib.a archive? QUESTION: In this particular case I'm trying to discover if a mylib.a file is 32 or 64 bit compatible. I'm familiar with ldd for shared objects (mylib.so) but how do I inspect a regular.a archive? ANSWER: "nm" and "ar" will give you some info...
[ "linux", "unix", "archive" ]
6
13
5,571
4
0
2008-10-08T19:40:12.763000
2008-10-08T19:43:49.653000
184,522
184,554
ListBox keep selection after losing focus
I have a ListBox that when in focus, and when I have an item selected returns a valid SelectedIndex. If I have a valid SelectedIndex and I click on a TextBox on the same Forum, the SelectedIndex now becomes -1. However I want it to keep its SelectedIndex from changing. How would I go about doing this?
ListBox will keep it's SelectedIndex regardless of focus. I tested it on a blank project with one ListBox, one TextBox and one Label used to display the ListBox's SelectedIndex. Under both the ListBox's SelectedIndexChanged and the TextBox's TextChanged events I updated the Label with the ListBox's SelectedIndex There ...
ListBox keep selection after losing focus I have a ListBox that when in focus, and when I have an item selected returns a valid SelectedIndex. If I have a valid SelectedIndex and I click on a TextBox on the same Forum, the SelectedIndex now becomes -1. However I want it to keep its SelectedIndex from changing. How woul...
TITLE: ListBox keep selection after losing focus QUESTION: I have a ListBox that when in focus, and when I have an item selected returns a valid SelectedIndex. If I have a valid SelectedIndex and I click on a TextBox on the same Forum, the SelectedIndex now becomes -1. However I want it to keep its SelectedIndex from ...
[ "c#", ".net", "listbox" ]
1
3
13,007
6
0
2008-10-08T19:44:29.493000
2008-10-08T19:51:52.490000
184,538
184,596
Fuzzy .png in Flash CS3
PNG images appear "fuzzy" in flash CS3. They are very blocky and appear unanti-aliased (if that is a word) Does anyone have a fix for this? Is there some setting I'm missing?
Are you loading them into your SWF through a loader? Or are they imported into your library as bitmap symbols? If they are loaded in try calling Bitmap.smoothing = true; or if they are in your library go to the Bitmap's properties and click Allow smoothing. Other than that I would check to make sure you don't have some...
Fuzzy .png in Flash CS3 PNG images appear "fuzzy" in flash CS3. They are very blocky and appear unanti-aliased (if that is a word) Does anyone have a fix for this? Is there some setting I'm missing?
TITLE: Fuzzy .png in Flash CS3 QUESTION: PNG images appear "fuzzy" in flash CS3. They are very blocky and appear unanti-aliased (if that is a word) Does anyone have a fix for this? Is there some setting I'm missing? ANSWER: Are you loading them into your SWF through a loader? Or are they imported into your library as...
[ "flash", "image", "png" ]
4
4
8,039
8
0
2008-10-08T19:48:22.233000
2008-10-08T20:03:25.183000
184,550
194,892
What do I need to do to upgrade an application to the latest Rails version?
I am currently using Rails 2.1.0 and want to upgrade to Rails 2.1.1. After issuing the following command gem update rails I suppose that I need to change this line RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION in environment.rb What other actions should I take to ensure that my application is using the ...
You'll also need to go into your application directory and run the following command: rake rails:update Then run your tests and make sure everything works.
What do I need to do to upgrade an application to the latest Rails version? I am currently using Rails 2.1.0 and want to upgrade to Rails 2.1.1. After issuing the following command gem update rails I suppose that I need to change this line RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION in environment.rb ...
TITLE: What do I need to do to upgrade an application to the latest Rails version? QUESTION: I am currently using Rails 2.1.0 and want to upgrade to Rails 2.1.1. After issuing the following command gem update rails I suppose that I need to change this line RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION ...
[ "ruby-on-rails", "upgrade" ]
6
3
2,716
2
0
2008-10-08T19:51:24.053000
2008-10-12T00:21:59.327000
184,560
4,055,942
How to monitor MySQL space?
I downloaded a VM image of a web application that uses MySQL. How can I monitor its space consumption and know when additional space must be added?
I have some great big queries to share: Run this to get the Total MySQL Data and Index Usage By Storage Engine SELECT IFNULL(B.engine,'Total') "Storage Engine", CONCAT(LPAD(REPLACE(FORMAT(B.DSize/POWER(1024,pw),3),',',''),17,' '),' ', SUBSTR(' KMGTP',pw+1,1),'B') "Data Size", CONCAT(LPAD(REPLACE( FORMAT(B.ISize/POWER(1...
How to monitor MySQL space? I downloaded a VM image of a web application that uses MySQL. How can I monitor its space consumption and know when additional space must be added?
TITLE: How to monitor MySQL space? QUESTION: I downloaded a VM image of a web application that uses MySQL. How can I monitor its space consumption and know when additional space must be added? ANSWER: I have some great big queries to share: Run this to get the Total MySQL Data and Index Usage By Storage Engine SELECT...
[ "mysql", "database-administration" ]
15
30
15,368
6
0
2008-10-08T19:52:29.823000
2010-10-29T21:11:16.037000
184,563
184,595
Checkstyle vs. PMD
We are introducing static analysis tools into the build system for our Java product. We are using Maven2 so Checkstyle and PMD integration come for free. However it looks like there is a large overlap in functionality between these two tools, in terms of enforcing basic style rules. Is there a benefit from utilizing bo...
You should definitely use FindBugs. In my experience, the false-positive rate is very low, and even the least-critical warnings it reports are worth addressing to some extent. As for Checkstyle vs. PMD, I would not use Checkstyle since it is pretty much only concerned with style. In my experience, Checkstyle will repor...
Checkstyle vs. PMD We are introducing static analysis tools into the build system for our Java product. We are using Maven2 so Checkstyle and PMD integration come for free. However it looks like there is a large overlap in functionality between these two tools, in terms of enforcing basic style rules. Is there a benefi...
TITLE: Checkstyle vs. PMD QUESTION: We are introducing static analysis tools into the build system for our Java product. We are using Maven2 so Checkstyle and PMD integration come for free. However it looks like there is a large overlap in functionality between these two tools, in terms of enforcing basic style rules....
[ "java", "static-analysis", "findbugs", "checkstyle", "pmd" ]
95
79
73,815
17
0
2008-10-08T19:52:55.717000
2008-10-08T20:03:05.743000
184,570
184,581
ASP.NET: How to convert <A> or HtmlAnchor to static text?
i have a repeater that will output a series of items: <%# GetItemText %> But some items will not have an associated link, so i don't want them to be clickable. i tried making it a runat=server HtmlAnchor, and set the htmlAnchor.Disabled = true for the items are should not actually have a link - but they can still be cl...
Use an control, which displays the text normally if no link is supplied. Edited to include example: <%# GetItemText %> In the above example, the anchor tag will be rendered to html regardless, but if the NavigateUrl attribute is an empty string, there will be no href at all and every browser I've ever used renders the ...
ASP.NET: How to convert <A> or HtmlAnchor to static text? i have a repeater that will output a series of items: <%# GetItemText %> But some items will not have an associated link, so i don't want them to be clickable. i tried making it a runat=server HtmlAnchor, and set the htmlAnchor.Disabled = true for the items are ...
TITLE: ASP.NET: How to convert <A> or HtmlAnchor to static text? QUESTION: i have a repeater that will output a series of items: <%# GetItemText %> But some items will not have an associated link, so i don't want them to be clickable. i tried making it a runat=server HtmlAnchor, and set the htmlAnchor.Disabled = true ...
[ "asp.net", "html" ]
4
10
1,092
1
0
2008-10-08T19:54:57.727000
2008-10-08T19:57:56.083000
184,574
213,730
How to append binary values in VBScript
If I have two variables containing binary values, how do I append them together as one binary value? For example, if I used WMI to read the registry of two REG_BINARY value, I then want to be able to concatenate the values. VBScript complains of a type mismatch when you try to join with the '&' operator.
For the record, I wanted VBScript code for a large userbase as a logon script that has the least chance of failing. I like the ADO objects, but there are so many mysterious ways ADO can be broken, so I shy away from ADODB.Stream. Instead, I was able to write conversion code to convert binary to hex encoded strings. The...
How to append binary values in VBScript If I have two variables containing binary values, how do I append them together as one binary value? For example, if I used WMI to read the registry of two REG_BINARY value, I then want to be able to concatenate the values. VBScript complains of a type mismatch when you try to jo...
TITLE: How to append binary values in VBScript QUESTION: If I have two variables containing binary values, how do I append them together as one binary value? For example, if I used WMI to read the registry of two REG_BINARY value, I then want to be able to concatenate the values. VBScript complains of a type mismatch ...
[ "vbscript", "binary" ]
0
1
5,990
3
0
2008-10-08T19:56:44.900000
2008-10-17T20:28:46.363000
184,585
184,621
System.NotSupportedException error in compact framework pictureBox control. How do I make a picture button in Compact framework?
I'm trying to make a picture button in the compact framework. I made a usercontrol and added a picturebox. I saw you could over ride the text and font for normal windows forms. but don't seem able to do it for compact. It crashes VS2008. Has anyone done this?
Consider using the Smart Device Framework from OpenNETCF. Whenever I've tried to do custom UI and the compact framework has let me down, SDF has usually already "fixed" it.
System.NotSupportedException error in compact framework pictureBox control. How do I make a picture button in Compact framework? I'm trying to make a picture button in the compact framework. I made a usercontrol and added a picturebox. I saw you could over ride the text and font for normal windows forms. but don't seem...
TITLE: System.NotSupportedException error in compact framework pictureBox control. How do I make a picture button in Compact framework? QUESTION: I'm trying to make a picture button in the compact framework. I made a usercontrol and added a picturebox. I saw you could over ride the text and font for normal windows for...
[ "windows-mobile", "compact-framework" ]
3
2
1,079
2
0
2008-10-08T20:00:49.447000
2008-10-08T20:08:40.117000
184,592
185,514
MINUS in MySQL?
I have topics(id*) and tags(id*,name) and a linking table topic_tags(topicFk*,tagFk*). Now I want to select every single topic, that has all of the good tags (a,b,c) but none of the bad tags (d,e,f). How do I do that?
My own solution using Pauls and Bills ideas. The idea is to inner join topics with good tags (to throw out topics with no good tags) and then count the unique tags for each topic (to verify that all the good tags are present). At the same time an outer join with bad tags should have not a single match (all fields are N...
MINUS in MySQL? I have topics(id*) and tags(id*,name) and a linking table topic_tags(topicFk*,tagFk*). Now I want to select every single topic, that has all of the good tags (a,b,c) but none of the bad tags (d,e,f). How do I do that?
TITLE: MINUS in MySQL? QUESTION: I have topics(id*) and tags(id*,name) and a linking table topic_tags(topicFk*,tagFk*). Now I want to select every single topic, that has all of the good tags (a,b,c) but none of the bad tags (d,e,f). How do I do that? ANSWER: My own solution using Pauls and Bills ideas. The idea is to...
[ "sql", "mysql" ]
2
0
6,456
7
0
2008-10-08T20:02:41.190000
2008-10-09T00:46:14.533000
184,600
184,839
Has and belongs to many relationship with multiple databases
I have a situation where I have two models, companies and permissions, where companies is in a separate database from my permissions database. This is a has and belongs to many relationship because each company can have many permissions and each permission can belong to many companies. The reason the two databases are ...
Has and belongs to many is old, clunky, and problematic. I recommend using has_many instead. You can specify the relationship table with the ":through" option; just pick which database you want it to reside in and create a model to represent it. http://apidock.com/rails/ActiveRecord/Associations/ClassMethods/has_many
Has and belongs to many relationship with multiple databases I have a situation where I have two models, companies and permissions, where companies is in a separate database from my permissions database. This is a has and belongs to many relationship because each company can have many permissions and each permission ca...
TITLE: Has and belongs to many relationship with multiple databases QUESTION: I have a situation where I have two models, companies and permissions, where companies is in a separate database from my permissions database. This is a has and belongs to many relationship because each company can have many permissions and ...
[ "ruby-on-rails", "ruby", "database", "has-and-belongs-to-many" ]
7
6
5,768
3
0
2008-10-08T20:03:45.713000
2008-10-08T20:50:48.237000
184,609
184,762
Will reassigning a variable in every iteration of a loop affect performance?
Consider the following two ways of writing a loop in Java to see if a list contains a given value: Style 1 boolean found = false; for(int i = 0; i < list.length &&!found; i++) { if(list[i] == testVal) found = true; } Style 2 boolean found = false; for(int i = 0; i < list.length &&!found; i++) { found = (list[i] == test...
Well, just write a micro benchmark: import java.util.*; public class Test { private static int[] list = new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9}; private static int testVal = 6; public static boolean version1() { boolean found = false; for(int i = 0; i < list.length &&!found; i++) { if(list[i] == testVal) found = true; ...
Will reassigning a variable in every iteration of a loop affect performance? Consider the following two ways of writing a loop in Java to see if a list contains a given value: Style 1 boolean found = false; for(int i = 0; i < list.length &&!found; i++) { if(list[i] == testVal) found = true; } Style 2 boolean found = fa...
TITLE: Will reassigning a variable in every iteration of a loop affect performance? QUESTION: Consider the following two ways of writing a loop in Java to see if a list contains a given value: Style 1 boolean found = false; for(int i = 0; i < list.length &&!found; i++) { if(list[i] == testVal) found = true; } Style 2 ...
[ "java", "optimization" ]
3
8
607
13
0
2008-10-08T20:05:40.840000
2008-10-08T20:34:25.807000