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
167,415
174,318
Using .Net Framework Source debugging
I'm getting a null-object exception deep within XsltCompiledTransform, and I'd like to use the.Net Framework Source debugging feature to see what isn't being initialized, but even after following the directions for enabling it, I can't figure out how to step into the.Transform() method and start spelunking. The tutoria...
If you have trouble fetching the sources on the fly, you might want to try out.NET Mass Downloader As it looks, the sources for XsltCompiledTransform are included.
Using .Net Framework Source debugging I'm getting a null-object exception deep within XsltCompiledTransform, and I'd like to use the.Net Framework Source debugging feature to see what isn't being initialized, but even after following the directions for enabling it, I can't figure out how to step into the.Transform() me...
TITLE: Using .Net Framework Source debugging QUESTION: I'm getting a null-object exception deep within XsltCompiledTransform, and I'd like to use the.Net Framework Source debugging feature to see what isn't being initialized, but even after following the directions for enabling it, I can't figure out how to step into ...
[ "debugging", ".net-3.5" ]
0
0
207
1
0
2008-10-03T15:25:31.393000
2008-10-06T13:38:30.483000
167,416
167,521
Share auto-incremented primary key between two tables
Hi I want to have two tables each have an INT "id" column which will auto-increment but I don't want either "id" columns to ever share the same number. What is this called and what's the best way to do it? Sequence? Iterator? Index? Incrementor? Motivation: we're migrating from one schema to a another and have a web-pa...
Just configure the identity increment to be >1 e.g. table one uses IDENTITY (1, 10) [1,11,21...] and table two uses IDENTITY (2, 10) [2,12,22...]. This will also give you some room for expansion if needed later.
Share auto-incremented primary key between two tables Hi I want to have two tables each have an INT "id" column which will auto-increment but I don't want either "id" columns to ever share the same number. What is this called and what's the best way to do it? Sequence? Iterator? Index? Incrementor? Motivation: we're mi...
TITLE: Share auto-incremented primary key between two tables QUESTION: Hi I want to have two tables each have an INT "id" column which will auto-increment but I don't want either "id" columns to ever share the same number. What is this called and what's the best way to do it? Sequence? Iterator? Index? Incrementor? Mo...
[ "sql", "sql-server" ]
10
14
7,225
9
0
2008-10-03T15:25:48.380000
2008-10-03T15:48:36.323000
167,427
167,730
Creating a ruler bar in MFC
What's the best way to go about creating a vertical and horizontal ruler bars in an SDI app? Would you make it part of the frame or the view? Derive it from CControlBar, or is there a better method? The vertical ruler must also be docked to a pane and not the frame. To make it a little clearer as to what I'm after, ima...
I would not use control bars. I have no good reason other then (IMOHO) are difficult to get to do what you want - if what you want if something other than a docking toolbar. I would just draw them directly on the View window using GDI calls. I guess I might think about making each ruler its own window, and draw the rul...
Creating a ruler bar in MFC What's the best way to go about creating a vertical and horizontal ruler bars in an SDI app? Would you make it part of the frame or the view? Derive it from CControlBar, or is there a better method? The vertical ruler must also be docked to a pane and not the frame. To make it a little clear...
TITLE: Creating a ruler bar in MFC QUESTION: What's the best way to go about creating a vertical and horizontal ruler bars in an SDI app? Would you make it part of the frame or the view? Derive it from CControlBar, or is there a better method? The vertical ruler must also be docked to a pane and not the frame. To make...
[ "c++", "winapi", "visual-c++", "mfc" ]
1
1
2,312
2
0
2008-10-03T15:28:37.407000
2008-10-03T16:24:09.450000
167,439
167,472
How do I enter a pound sterling character (£) into the Python interactive shell on Mac OS X?
Update: Thanks for the suggestions guys. After further research, I’ve reformulated the question here: Python/editline on OS X: £ sign seems to be bound to ed-prev-word On Mac OS X I can’t enter a pound sterling sign (£) into the Python interactive shell. Mac OS X 10.5.5 Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17) ...
I'd imagine that the terminal emulator is eating the keystroke as a control code. Maybe see if it has a config file you can mess around with?
How do I enter a pound sterling character (£) into the Python interactive shell on Mac OS X? Update: Thanks for the suggestions guys. After further research, I’ve reformulated the question here: Python/editline on OS X: £ sign seems to be bound to ed-prev-word On Mac OS X I can’t enter a pound sterling sign (£) into th...
TITLE: How do I enter a pound sterling character (£) into the Python interactive shell on Mac OS X? QUESTION: Update: Thanks for the suggestions guys. After further research, I’ve reformulated the question here: Python/editline on OS X: £ sign seems to be bound to ed-prev-word On Mac OS X I can’t enter a pound sterlin...
[ "python", "bash", "macos", "shell", "terminal" ]
4
1
5,836
5
0
2008-10-03T15:30:59.667000
2008-10-03T15:39:05.687000
167,440
168,436
Does anyone know some cool PL/SQL plugin for IntelliJ Idea?
I've evaluated some plugins from official IntelliJ repository, but none of them seems to provide more then basic syntax highlighting. Even highlighting is limited. For example, Database Navigator doesn't highlight IF. It would be great to have proper highlighting. And if it would have auto-complete feature and provide ...
Have you tried SQL Query Plugin? It comes with a great host of features, including multiple query windows, direct editing of tables, and of course, proper highlighting for PL/SQL syntax and a browser of the internal database structure. It also integrates well with the main editor: you can right-click on any selected Ja...
Does anyone know some cool PL/SQL plugin for IntelliJ Idea? I've evaluated some plugins from official IntelliJ repository, but none of them seems to provide more then basic syntax highlighting. Even highlighting is limited. For example, Database Navigator doesn't highlight IF. It would be great to have proper highlight...
TITLE: Does anyone know some cool PL/SQL plugin for IntelliJ Idea? QUESTION: I've evaluated some plugins from official IntelliJ repository, but none of them seems to provide more then basic syntax highlighting. Even highlighting is limited. For example, Database Navigator doesn't highlight IF. It would be great to hav...
[ "plugins", "plsql", "intellij-idea" ]
14
4
10,205
2
0
2008-10-03T15:31:08.120000
2008-10-03T19:15:50.477000
167,449
167,450
trace.axd returns a 404 error
On a.Net production server, I am unable to look at the Application trace. The web server returns a 404 error. When copying the files on my local computer, the trace works, making further testing impractical. The trace seems to be correctly set: edit: crap, I was trying to reply to it directly since I lost 2 hours on th...
First of all, check whether the trace works whith a minimal trace directive: should work in any case. Then check the IIS configuration: an URL rewriting rule might be interfering with the trace.axd url. If this is not the case, check whether the server accepts the.axd extension (Manage IIS>Properties>Home Directory>Con...
trace.axd returns a 404 error On a.Net production server, I am unable to look at the Application trace. The web server returns a 404 error. When copying the files on my local computer, the trace works, making further testing impractical. The trace seems to be correctly set: edit: crap, I was trying to reply to it direc...
TITLE: trace.axd returns a 404 error QUESTION: On a.Net production server, I am unable to look at the Application trace. The web server returns a 404 error. When copying the files on my local computer, the trace works, making further testing impractical. The trace seems to be correctly set: edit: crap, I was trying to...
[ "asp.net", "iis" ]
0
1
1,993
1
0
2008-10-03T15:34:15.227000
2008-10-03T15:34:22.233000
167,453
167,545
XSLT Abstractions
I'm exploring the XML -> XSLT -> HTML meme for producing web content. I have very little XSLT experience. I'm curious what mechanisms are available in XSLT to handle abstractions or "refactoring". For example, with generic HTML and a service side include, many pages can be templated and decomposed to where there are, s...
For my own project, this is how I divided up my pages. There was a template.xsl file which was imported by each of my XSLs. Most pages just had template.xsl, but some pages such as cart, etc. needed their own because of the different kind of data they were parsing. This is a snippet from my template.xsl. I threw in all...
XSLT Abstractions I'm exploring the XML -> XSLT -> HTML meme for producing web content. I have very little XSLT experience. I'm curious what mechanisms are available in XSLT to handle abstractions or "refactoring". For example, with generic HTML and a service side include, many pages can be templated and decomposed to ...
TITLE: XSLT Abstractions QUESTION: I'm exploring the XML -> XSLT -> HTML meme for producing web content. I have very little XSLT experience. I'm curious what mechanisms are available in XSLT to handle abstractions or "refactoring". For example, with generic HTML and a service side include, many pages can be templated ...
[ "html", "xml", "xslt" ]
10
14
5,718
6
0
2008-10-03T15:34:50.360000
2008-10-03T15:53:06.437000
167,464
356,456
Can I connect to SQL Server using Windows Authentication from Java EE webapp?
I am currently investigating how to make a connection to a SQL Server database from my Java EE web application using Windows Authentication instead of SQL Server authentication. I am running this app off of Tomcat 6.0, and am utilizing the Microsoft JDBC driver. My connection properties file looks as follows: dbDriver ...
I do not think one can push the user credentials from the browser to the database (and does it makes sense? I think not) But if you want to use the credentials of the user running Tomcat to connect to SQL Server then you can use Microsoft's JDBC Driver. Just build your JDBC URL like this: jdbc:sqlserver://localhost;int...
Can I connect to SQL Server using Windows Authentication from Java EE webapp? I am currently investigating how to make a connection to a SQL Server database from my Java EE web application using Windows Authentication instead of SQL Server authentication. I am running this app off of Tomcat 6.0, and am utilizing the Mi...
TITLE: Can I connect to SQL Server using Windows Authentication from Java EE webapp? QUESTION: I am currently investigating how to make a connection to a SQL Server database from my Java EE web application using Windows Authentication instead of SQL Server authentication. I am running this app off of Tomcat 6.0, and a...
[ "java", "sql-server", "tomcat", "jdbc", "jakarta-ee" ]
56
77
207,469
5
0
2008-10-03T15:36:21.650000
2008-12-10T15:23:02.570000
167,471
167,754
Oracle merge constants into single table
In Oracle, given a simple data table: create table data ( id VARCHAR2(255), key VARCHAR2(255), value VARCHAR2(511)); suppose I want to "insert or update" a value. I have something like: merge into data using dual on (id='someid' and key='testKey') when matched then update set value = 'someValue' when not matched then i...
I don't consider using dual to be a hack. To get rid of binding/typing twice, I would do something like: merge into data using ( select 'someid' id, 'testKey' key, 'someValue' value from dual ) val on ( data.id=val.id and data.key=val.key ) when matched then update set data.value = val.value when not matched then inser...
Oracle merge constants into single table In Oracle, given a simple data table: create table data ( id VARCHAR2(255), key VARCHAR2(255), value VARCHAR2(511)); suppose I want to "insert or update" a value. I have something like: merge into data using dual on (id='someid' and key='testKey') when matched then update set va...
TITLE: Oracle merge constants into single table QUESTION: In Oracle, given a simple data table: create table data ( id VARCHAR2(255), key VARCHAR2(255), value VARCHAR2(511)); suppose I want to "insert or update" a value. I have something like: merge into data using dual on (id='someid' and key='testKey') when matched ...
[ "oracle", "jdbc", "merge" ]
20
24
34,758
3
0
2008-10-03T15:38:33.427000
2008-10-03T16:29:38.143000
167,485
176,807
Is it possible to have a List<string> as a property on an active record class
Is it possible to have a HasMany relationship of a basic type such as String, on an ActiveRecord class, without the need for creating another entity such as (TodoListItem) to hold the value. [ActiveRecord] public class TodoList { [PrimaryKey] public int Id { get { return _id; } set { _id = value; } } [HasMany(typeof(...
Yes, you can do this. You can map a one-to-many relation to a built-in or simple type (value type or string) rather than a persisted type. You'll need to specify the ColumnKey, Table and Element params in the HasMany attribute declaration to get it to wire up properly. You have to have a surrogate key column so the AR ...
Is it possible to have a List<string> as a property on an active record class Is it possible to have a HasMany relationship of a basic type such as String, on an ActiveRecord class, without the need for creating another entity such as (TodoListItem) to hold the value. [ActiveRecord] public class TodoList { [PrimaryKey...
TITLE: Is it possible to have a List<string> as a property on an active record class QUESTION: Is it possible to have a HasMany relationship of a basic type such as String, on an ActiveRecord class, without the need for creating another entity such as (TodoListItem) to hold the value. [ActiveRecord] public class TodoL...
[ "c#", "collections", "castle-activerecord" ]
1
8
874
2
0
2008-10-03T15:41:25.290000
2008-10-07T00:29:28.577000
167,487
274,098
NSThread and UIViewController interaction
If I spawn a new thread, and then within it I push a new controller onto my UINavigationController, using code like this... (a) not working -(void)myCallbackInThread { // move on... UIApplication* app = [UIApplication sharedApplication]; [app changeView]; } then I find that the view appears, but does not respond to use...
In your case, it really depends on what's happening in [app changeView], but the reason it stops responding is most likely that you have no run loop dispatching events on your new, secondary thread (more on this below). In general, however, it is a very bad idea to update the GUI from a secondary thread. As you've alre...
NSThread and UIViewController interaction If I spawn a new thread, and then within it I push a new controller onto my UINavigationController, using code like this... (a) not working -(void)myCallbackInThread { // move on... UIApplication* app = [UIApplication sharedApplication]; [app changeView]; } then I find that the...
TITLE: NSThread and UIViewController interaction QUESTION: If I spawn a new thread, and then within it I push a new controller onto my UINavigationController, using code like this... (a) not working -(void)myCallbackInThread { // move on... UIApplication* app = [UIApplication sharedApplication]; [app changeView]; } th...
[ "iphone", "cocoa", "multithreading" ]
5
2
4,273
4
0
2008-10-03T15:42:07.630000
2008-11-08T00:35:34.020000
167,502
1,278,072
UpdatePanelAnimationExtender - Resize not working
This is the page that I'm having. But the resize part in the section does not seem to be working. I copied most of the code from the Ajax site. I placed a alert() in the tag (line 108) to find the value of 'b._originalHeight' and it shows up as '44'. I have also tried the code in the above-said tutorial (line 132) and ...
After watching Joe Stagner's video, I too tried to implement the ASP.NET AJAX UpdatePanelAnimation Extender, and I too had difficulty implementing the resize animation. My problem was the following: I didn't add a System.Threading.Thread.Sleep(1000) statement to the server-side event handler. Your code example doesn't ...
UpdatePanelAnimationExtender - Resize not working This is the page that I'm having. But the resize part in the section does not seem to be working. I copied most of the code from the Ajax site. I placed a alert() in the tag (line 108) to find the value of 'b._originalHeight' and it shows up as '44'. I have also tried t...
TITLE: UpdatePanelAnimationExtender - Resize not working QUESTION: This is the page that I'm having. But the resize part in the section does not seem to be working. I copied most of the code from the Ajax site. I placed a alert() in the tag (line 108) to find the value of 'b._originalHeight' and it shows up as '44'. I...
[ "asp.net", "updatepanelanimationexte" ]
1
1
2,962
2
0
2008-10-03T15:44:46.300000
2009-08-14T14:09:19.500000
167,509
167,519
How to sort gridview by column containing nullable integer?
I have a GridView where one column is bound to an object property containing a nullable integer. I set SortExpression to the name of the property, and sorting works perfectly as long as all rows contain a value. If any rows contain null, however, I get an exception: System.InvalidOperationException: Failed to compare t...
The Nullable type exposes a comparison method for comparing nullable types, so the solution is to override the gridview sorting logic and manually specify a comparison: gridview.Sorting += new GridViewSortEventHandler(gridView_Sorting); protected void gridView_Sorting(object sender, GridViewSortEventArgs e) { // Only ...
How to sort gridview by column containing nullable integer? I have a GridView where one column is bound to an object property containing a nullable integer. I set SortExpression to the name of the property, and sorting works perfectly as long as all rows contain a value. If any rows contain null, however, I get an exce...
TITLE: How to sort gridview by column containing nullable integer? QUESTION: I have a GridView where one column is bound to an object property containing a nullable integer. I set SortExpression to the name of the property, and sorting works perfectly as long as all rows contain a value. If any rows contain null, howe...
[ "asp.net", "gridview" ]
1
3
2,382
2
0
2008-10-03T15:46:20.070000
2008-10-03T15:48:13.577000
167,517
251,509
Naked Objects. Good or Bad
I have recently been exposed to naked objects. It looks like a pretty decent framework. However I do not see it in widespread use like say, Spring. So why is this framework not getting any mainstream application credit. What are its shortcomings as you see?
From my experience using NOF 3.0.3... The good: Automagically generates an DnD UI for your domain objects, like what db4o does for persistence. This is what MVC was always meant to be, according to the MVC pattern creator. The framework only asks your domain objects (POJOs) to be subclassed from AbstractDomainObject th...
Naked Objects. Good or Bad I have recently been exposed to naked objects. It looks like a pretty decent framework. However I do not see it in widespread use like say, Spring. So why is this framework not getting any mainstream application credit. What are its shortcomings as you see?
TITLE: Naked Objects. Good or Bad QUESTION: I have recently been exposed to naked objects. It looks like a pretty decent framework. However I do not see it in widespread use like say, Spring. So why is this framework not getting any mainstream application credit. What are its shortcomings as you see? ANSWER: From my ...
[ "java", "frameworks", "naked-objects" ]
16
10
9,012
10
0
2008-10-03T15:47:55.420000
2008-10-30T19:50:10.560000
167,533
167,607
Best Voice Compression Algorithms/Formats
We have some raw voice audio that we need to distribute over the internet. We need decent quality, but it doesn't need to be of musical quality. Our main concern is usability by the consumer (i.e. what and where they can play it) and size of the download. My experience has shown that mp3s do not produce the best compre...
Start here. As you rightly point out, voice compression is different from general audio compression. You'll find many codecs dedicated to telephony applications, ranging from PCM and ADPCM through later packet based encodings such as CELP used on GSM cellular networks. Still, VOIP voice encoding is slightly different f...
Best Voice Compression Algorithms/Formats We have some raw voice audio that we need to distribute over the internet. We need decent quality, but it doesn't need to be of musical quality. Our main concern is usability by the consumer (i.e. what and where they can play it) and size of the download. My experience has show...
TITLE: Best Voice Compression Algorithms/Formats QUESTION: We have some raw voice audio that we need to distribute over the internet. We need decent quality, but it doesn't need to be of musical quality. Our main concern is usability by the consumer (i.e. what and where they can play it) and size of the download. My e...
[ "audio", "compression" ]
9
5
10,365
6
0
2008-10-03T15:50:53.870000
2008-10-03T16:04:44.060000
167,542
167,561
How do I declare a multi-column PK in MySQL
I'm trying to create a table with two columns comprising the primary key in MySQL, but I can't figure out the syntax. I understand single-column PKs, but the syntax isn't the same to create a primary key with two columns.
CREATE TABLE table_name ( c1 INT NOT NULL, c2 INT NOT NULL, PRIMARY KEY (c1, c2) )
How do I declare a multi-column PK in MySQL I'm trying to create a table with two columns comprising the primary key in MySQL, but I can't figure out the syntax. I understand single-column PKs, but the syntax isn't the same to create a primary key with two columns.
TITLE: How do I declare a multi-column PK in MySQL QUESTION: I'm trying to create a table with two columns comprising the primary key in MySQL, but I can't figure out the syntax. I understand single-column PKs, but the syntax isn't the same to create a primary key with two columns. ANSWER: CREATE TABLE table_name ( c...
[ "mysql", "sql", "database", "ddl" ]
1
7
932
4
0
2008-10-03T15:52:44.083000
2008-10-03T15:56:14.530000
167,567
167,713
NUnit: Running multiple assertions in a single test
I have been asked to write a testing application that needs to test a new stored procedure on multiple rows in a database, in essence I want to do something like this: [Test] public void TestSelect() { foreach(id in ids) { DataTable old = Database.call("old_stored_proc",id); DataTable new_ = Database.call("new_stored_p...
1) If the id's are constant and not looked up at test run time, create a separate unit test fixture for each id. That way you will know which id's are actually failing. See here for a write up on the problems with data driven tests: http://googletesting.blogspot.com/2008/09/tott-data-driven-traps.html 2) If you need to...
NUnit: Running multiple assertions in a single test I have been asked to write a testing application that needs to test a new stored procedure on multiple rows in a database, in essence I want to do something like this: [Test] public void TestSelect() { foreach(id in ids) { DataTable old = Database.call("old_stored_pro...
TITLE: NUnit: Running multiple assertions in a single test QUESTION: I have been asked to write a testing application that needs to test a new stored procedure on multiple rows in a database, in essence I want to do something like this: [Test] public void TestSelect() { foreach(id in ids) { DataTable old = Database.ca...
[ "c#", "unit-testing", "nunit" ]
7
5
6,767
8
0
2008-10-03T15:57:13.280000
2008-10-03T16:21:56.130000
167,576
167,680
Check if table exists in SQL Server
I would like this to be the ultimate discussion on how to check if a table exists in SQL Server 2000/2005 using SQL Statements. Here are two possible ways of doing it. Which one is the standard/best way of doing it? First way: IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' AND TABLE_NA...
For queries like this it is always best to use an INFORMATION_SCHEMA view. These views are (mostly) standard across many different databases and rarely change from version to version. To check if a table exists use: IF (EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'TheSchema' AND TABLE_NAME = 'T...
Check if table exists in SQL Server I would like this to be the ultimate discussion on how to check if a table exists in SQL Server 2000/2005 using SQL Statements. Here are two possible ways of doing it. Which one is the standard/best way of doing it? First way: IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE ...
TITLE: Check if table exists in SQL Server QUESTION: I would like this to be the ultimate discussion on how to check if a table exists in SQL Server 2000/2005 using SQL Statements. Here are two possible ways of doing it. Which one is the standard/best way of doing it? First way: IF EXISTS (SELECT 1 FROM INFORMATION_SC...
[ "sql-server", "t-sql", "sql-server-2005", "sql-server-2000" ]
1,432
1,618
1,862,739
30
0
2008-10-03T16:00:33.803000
2008-10-03T16:17:35.343000
167,577
5,830,110
Access to old, no longer available, feed entries
I am working on a project that requires reliable access to historic feed entries which are not necessarily available in the current feed of the website. I have found several ways to access such data, but none of them give me all the characteristics I need. Look at this as a brainstorm. I will tell you how much I have f...
The best answer I've found so far, is this: Google reader's unofficial API turns out to have a public access point for their feeds, which means there is no authentication needed. Use is as follows: http://www.google.com/reader/public/atom/feed/ {your feed uri here}?n=1000 replace the text in the squigglies (including t...
Access to old, no longer available, feed entries I am working on a project that requires reliable access to historic feed entries which are not necessarily available in the current feed of the website. I have found several ways to access such data, but none of them give me all the characteristics I need. Look at this a...
TITLE: Access to old, no longer available, feed entries QUESTION: I am working on a project that requires reliable access to historic feed entries which are not necessarily available in the current feed of the website. I have found several ways to access such data, but none of them give me all the characteristics I ne...
[ "rss", "feed", "atom-feed" ]
6
1
1,608
2
0
2008-10-03T16:00:42.570000
2011-04-29T09:02:49.947000
167,580
169,716
Is there a way to prevent the VB6 compiler from shuffling the contents of files?
For reasons unknown, the VB6 compiler often likes to reorder the contents of.vbp files and the control descriptor block at the top of.frm files (The code that describes the properties of controls on the form. Code that you don't see in the IDE but you do see in a text editor and when doing diffs against the previous re...
I don't think there's much you can do about this. I've noticed the same problem: the IDE likes to rearrange things for seemingly no apparent reason. Some things I've noticed: When you use the SSTab control, VB likes to rearrange properties for tabs, especially the TabEnabled property. For project files, it randomly rea...
Is there a way to prevent the VB6 compiler from shuffling the contents of files? For reasons unknown, the VB6 compiler often likes to reorder the contents of.vbp files and the control descriptor block at the top of.frm files (The code that describes the properties of controls on the form. Code that you don't see in the...
TITLE: Is there a way to prevent the VB6 compiler from shuffling the contents of files? QUESTION: For reasons unknown, the VB6 compiler often likes to reorder the contents of.vbp files and the control descriptor block at the top of.frm files (The code that describes the properties of controls on the form. Code that yo...
[ "vb6" ]
4
6
930
3
0
2008-10-03T16:01:16.140000
2008-10-04T04:08:47.717000
167,602
167,642
How do I add Dispose functionality to a C# UserControl?
I have a class which implements UserControl. In.NET 2005, a Dispose method is automatically created in the MyClass.Designer.cs partial class file that looks like this: protected override void Dispose(bool disposing) { if (disposing && (components!= null)) { components.Dispose(); } base.Dispose(disposing); } If I want t...
In such a case I move the generated Dispose method to the main file and extend it. Visual Studio respects this. An other approach would be using a partial method (C# 3.0).
How do I add Dispose functionality to a C# UserControl? I have a class which implements UserControl. In.NET 2005, a Dispose method is automatically created in the MyClass.Designer.cs partial class file that looks like this: protected override void Dispose(bool disposing) { if (disposing && (components!= null)) { compon...
TITLE: How do I add Dispose functionality to a C# UserControl? QUESTION: I have a class which implements UserControl. In.NET 2005, a Dispose method is automatically created in the MyClass.Designer.cs partial class file that looks like this: protected override void Dispose(bool disposing) { if (disposing && (components...
[ "c#", "user-controls", "dispose" ]
68
61
60,245
8
0
2008-10-03T16:04:17.680000
2008-10-03T16:12:16.960000
167,605
168,044
Should the Network Service Account receive temp file permissions by default?
Recently I was working with generating a PDF from Crystal Reports through a webform. It was failing, which I determined to be caused by the permissions settings on the c:\windows\temp dir. I gave the Network Service account full access to this folder, which promptly fixed the issue. But is there a reason the Network Se...
These days, the default option will tend to be the more secure one. I don't think there's any other reason. I've had the same issue as you, and in my environment just gave the permission and moved on. This post suggests it is the fault of Crystal Reports, which is explicitly referencing %WINDIR%\Temp instead of using a...
Should the Network Service Account receive temp file permissions by default? Recently I was working with generating a PDF from Crystal Reports through a webform. It was failing, which I determined to be caused by the permissions settings on the c:\windows\temp dir. I gave the Network Service account full access to this...
TITLE: Should the Network Service Account receive temp file permissions by default? QUESTION: Recently I was working with generating a PDF from Crystal Reports through a webform. It was failing, which I determined to be caused by the permissions settings on the c:\windows\temp dir. I gave the Network Service account f...
[ "asp.net", "crystal-reports", "administration" ]
3
1
4,722
3
0
2008-10-03T16:04:28.333000
2008-10-03T17:42:05.330000
167,609
168,501
How best to modify my model in Spring MVC if I care about IOC
I am building an application using Spring MVC. I want to make certain changes to my Model for every Controller in the application. In particular, I want to insert certain extra data into the model which will be present for all pages of the application. I could do this several ways: just add the data at the end of every...
Aspects are a good approach, but Spring MVC makes it even easier -- you can define a HandlerInterceptor that will be called before or after every time a request is handled. In the HandlerInterceptor postHandle method (in your class that implements the HandlerInterceptor interface) you can add your data to the ModelAndV...
How best to modify my model in Spring MVC if I care about IOC I am building an application using Spring MVC. I want to make certain changes to my Model for every Controller in the application. In particular, I want to insert certain extra data into the model which will be present for all pages of the application. I cou...
TITLE: How best to modify my model in Spring MVC if I care about IOC QUESTION: I am building an application using Spring MVC. I want to make certain changes to my Model for every Controller in the application. In particular, I want to insert certain extra data into the model which will be present for all pages of the ...
[ "spring", "spring-mvc", "inversion-of-control" ]
3
4
1,522
3
0
2008-10-03T16:05:01.500000
2008-10-03T19:30:45.640000
167,622
174,924
Bindable LINQ vs. continuous LINQ
What are the major difference between bindable LINQ and continuous LINQ? •Bindable LINQ: www.codeplex.com/bindablelinq •Continuous LINQ: www.codeplex.com/clinq One more project was added basing on the provided feedback: •Obtics: obtics.codeplex.com
Their are 2 problems both these packages try to solve: Lack of a CollectionChanged event and Dynamic result sets. There is one additional problem bindable solves, additional automatic event triggers. The First Problem both packages aim to solve is this: Objects returned by a LINQ query do not provide CollectionChanged ...
Bindable LINQ vs. continuous LINQ What are the major difference between bindable LINQ and continuous LINQ? •Bindable LINQ: www.codeplex.com/bindablelinq •Continuous LINQ: www.codeplex.com/clinq One more project was added basing on the provided feedback: •Obtics: obtics.codeplex.com
TITLE: Bindable LINQ vs. continuous LINQ QUESTION: What are the major difference between bindable LINQ and continuous LINQ? •Bindable LINQ: www.codeplex.com/bindablelinq •Continuous LINQ: www.codeplex.com/clinq One more project was added basing on the provided feedback: •Obtics: obtics.codeplex.com ANSWER: Their are ...
[ "bindable-linq" ]
23
26
4,700
6
0
2008-10-03T16:08:00.120000
2008-10-06T16:05:26.427000
167,635
167,734
Using ldconfig on Linux
Let's say I 've added a library foo.so.1.1.1 to a path that is included in /etc/ld.so.conf When I run ldconfig on the system I get the links foo.so.1.1 and foo.so.1 to foo.so.1.1.1 How can I change the behavior to also get the foo.so link to foo.so.1.1.1?
ldconfig looks inside all shared objects that it finds, to look for the soname. It then creates a link using that soname as the name of the link. It's conventional (but far from universally done) for the soname to be the name and major version of the library, so your library foo.so.1.1 will have a soname of foo.so.1 an...
Using ldconfig on Linux Let's say I 've added a library foo.so.1.1.1 to a path that is included in /etc/ld.so.conf When I run ldconfig on the system I get the links foo.so.1.1 and foo.so.1 to foo.so.1.1.1 How can I change the behavior to also get the foo.so link to foo.so.1.1.1?
TITLE: Using ldconfig on Linux QUESTION: Let's say I 've added a library foo.so.1.1.1 to a path that is included in /etc/ld.so.conf When I run ldconfig on the system I get the links foo.so.1.1 and foo.so.1 to foo.so.1.1.1 How can I change the behavior to also get the foo.so link to foo.so.1.1.1? ANSWER: ldconfig look...
[ "linux" ]
20
31
38,781
2
0
2008-10-03T16:10:35.030000
2008-10-03T16:25:30.537000
167,643
167,668
How to INSERT an array of values in SQL Server 2005?
How do I write the SQL code to INSERT (or UPDATE) an array of values (with probably an attendant array of fieldnames, or with a matrix with them both) without simple iteration?
I construct the list as an xml string and pass it to the stored procs. In SQL 2005, it has enhanced xml functionalities to parse the xml and do a bulk insert. check this post: Passing lists to SQL Server 2005 with XML Parameters
How to INSERT an array of values in SQL Server 2005? How do I write the SQL code to INSERT (or UPDATE) an array of values (with probably an attendant array of fieldnames, or with a matrix with them both) without simple iteration?
TITLE: How to INSERT an array of values in SQL Server 2005? QUESTION: How do I write the SQL code to INSERT (or UPDATE) an array of values (with probably an attendant array of fieldnames, or with a matrix with them both) without simple iteration? ANSWER: I construct the list as an xml string and pass it to the stored...
[ "sql", "sql-server", "sql-server-2005", "bulkinsert" ]
2
12
18,710
4
0
2008-10-03T16:12:30.003000
2008-10-03T16:16:21.197000
167,657
167,691
Will targeting IE8 with conditional comments work?
When IE8 is released, will the following code work to add a conditional stylesheet? I've read conflicting reports as to whether this works with the beta. I'm hoping someone can share their experience. Thanks.
It worked for me – both in quirks mode and in standards compliance mode. However, it does not work when switching to IE8 compatibility mode.
Will targeting IE8 with conditional comments work? When IE8 is released, will the following code work to add a conditional stylesheet? I've read conflicting reports as to whether this works with the beta. I'm hoping someone can share their experience. Thanks.
TITLE: Will targeting IE8 with conditional comments work? QUESTION: When IE8 is released, will the following code work to add a conditional stylesheet? I've read conflicting reports as to whether this works with the beta. I'm hoping someone can share their experience. Thanks. ANSWER: It worked for me – both in quirks...
[ "html", "css", "internet-explorer", "internet-explorer-8", "stylesheet" ]
18
14
26,056
7
0
2008-10-03T16:13:26.820000
2008-10-03T16:18:24.703000
167,670
167,722
Any problems with SVN merge on a multi column ( tab delimited ) text file?
I have a multi-column text file ( tab delimited ) that I use for localized text in my project. I picked this format since it can easily be edited by anyone in most text editors (and excel too). My makefile processes it into a bunch of defines and binary data for including directly into my app. Do you know if SVN merge ...
It is line by line. The person who tries to commit later will get 'out of date' error, and when they try to update it, they will get a conflict in changed lines. Same with the merge. The one who merges later will have to sort out conflicts manually.
Any problems with SVN merge on a multi column ( tab delimited ) text file? I have a multi-column text file ( tab delimited ) that I use for localized text in my project. I picked this format since it can easily be edited by anyone in most text editors (and excel too). My makefile processes it into a bunch of defines an...
TITLE: Any problems with SVN merge on a multi column ( tab delimited ) text file? QUESTION: I have a multi-column text file ( tab delimited ) that I use for localized text in my project. I picked this format since it can easily be edited by anyone in most text editors (and excel too). My makefile processes it into a b...
[ "svn", "merge", "line", "tabs", "delimited" ]
2
3
286
2
0
2008-10-03T16:16:41.163000
2008-10-03T16:23:08.983000
167,671
167,693
How can I set up a configuration file for .NET console applications?
Is it possible to use a ".net configuration" file for a.NET console application? I'm looking for an equivalent to web.config, but specifically for console applications... I can certainly roll my own, but If I can use.NET's built in configuration reader then I would like to do that...I really just need to store a connec...
Yes - use app.config. Exactly the same syntax, options, etc. as web.config, but for console and WinForms applications. To add one to your project, right-click the project in Solution Explorer, Add..., New Item... and pick "Application Configuration File" from the Templates box.
How can I set up a configuration file for .NET console applications? Is it possible to use a ".net configuration" file for a.NET console application? I'm looking for an equivalent to web.config, but specifically for console applications... I can certainly roll my own, but If I can use.NET's built in configuration reade...
TITLE: How can I set up a configuration file for .NET console applications? QUESTION: Is it possible to use a ".net configuration" file for a.NET console application? I'm looking for an equivalent to web.config, but specifically for console applications... I can certainly roll my own, but If I can use.NET's built in c...
[ ".net", "configuration", "web-config", "app-config", "console-application" ]
18
33
28,006
7
0
2008-10-03T16:16:41.570000
2008-10-03T16:18:37.103000
167,697
169,777
Can I map local branches to remote branches with different prefixes in git?
We're working with a semi-centralized git repository here where I work. Each developer has their own subtree in the central git repository, so it looks something like this: master alice/branch1 alice/branch2 bob/branch1 michael/feature release/1.0 release/1.1 Working locally in my tree I have topic/feature, which corre...
If you can, I suggest you use the same branch names locally & remotely. Then git push will push all of your local branches to corresponding branches in the central repository. To use different prefixes in local and remote repos, you need to add a mapping to your config file each time you create a new feature branch. Th...
Can I map local branches to remote branches with different prefixes in git? We're working with a semi-centralized git repository here where I work. Each developer has their own subtree in the central git repository, so it looks something like this: master alice/branch1 alice/branch2 bob/branch1 michael/feature release/...
TITLE: Can I map local branches to remote branches with different prefixes in git? QUESTION: We're working with a semi-centralized git repository here where I work. Each developer has their own subtree in the central git repository, so it looks something like this: master alice/branch1 alice/branch2 bob/branch1 michae...
[ "git", "heroku", "phpfog", "nodester" ]
15
3
5,268
4
0
2008-10-03T16:19:22.937000
2008-10-04T05:09:17.050000
167,716
308,512
What is the difference between CouchDB and Lotus Notes?
I was looking into the possibility of using CouchDB. I heard that it was similar to Lotus Notes which everyone loves to hate. Is this true?
Development of Lotus Notes began over 20 years ago, with version 1 released in 1989. It was developed by Ray Ozzie, currently Chief Software Architect for Microsoft. Lotus Notes (the client) and Domino (the server) have been around for a long time and are mature well featured products. It has: A full client server stac...
What is the difference between CouchDB and Lotus Notes? I was looking into the possibility of using CouchDB. I heard that it was similar to Lotus Notes which everyone loves to hate. Is this true?
TITLE: What is the difference between CouchDB and Lotus Notes? QUESTION: I was looking into the possibility of using CouchDB. I heard that it was similar to Lotus Notes which everyone loves to hate. Is this true? ANSWER: Development of Lotus Notes began over 20 years ago, with version 1 released in 1989. It was devel...
[ "database", "couchdb", "lotus-notes" ]
22
48
5,757
8
0
2008-10-03T16:22:24.087000
2008-11-21T11:39:16.023000
167,735
167,764
Fast pseudo random number generator for procedural content
I am looking for a pseudo random number generator which would be specialized to work fast when it is given a seed before generating each number. Most generators I have seen so far assume you set seed once and then generate a long sequence of numbers. The only thing which looks somewhat similar to I have seen so far is ...
Seems like you're asking for a hash-function rather than a PRNG. Googling 'fast hash function' yields several promising-looking results. For example: uint32_t hash( uint32_t a) a = (a ^ 61) ^ (a >> 16); a = a + (a << 3); a = a ^ (a >> 4); a = a * 0x27d4eb2d; a = a ^ (a >> 15); return a; } Edit: Yep, some hash functions...
Fast pseudo random number generator for procedural content I am looking for a pseudo random number generator which would be specialized to work fast when it is given a seed before generating each number. Most generators I have seen so far assume you set seed once and then generate a long sequence of numbers. The only t...
TITLE: Fast pseudo random number generator for procedural content QUESTION: I am looking for a pseudo random number generator which would be specialized to work fast when it is given a seed before generating each number. Most generators I have seen so far assume you set seed once and then generate a long sequence of n...
[ "c++", "x86", "random" ]
14
21
17,097
6
0
2008-10-03T16:25:35.157000
2008-10-03T16:30:53.197000
167,740
167,971
Possible Memory leak in Number of Loaded classes in Java Application
I recently began profiling an osgi java application that I am writing using VisualVM. One thing I have noticed is that when the application starts sending data to a client (over JMS), the number of loaded classes starts increasing at a steady rate. The Heap size and the PermGen size remains constant, however. The numbe...
Are you dynamically creating new classes on the fly somehow? Thanks for your help. I figured out what the problem is. In one of my classes, I was using Jaxb to create an XML string. In doing this, JAXB ueses reflection to create a new class. JAXBContext context = JAXBContext.newInstance(this.getClass()); So although th...
Possible Memory leak in Number of Loaded classes in Java Application I recently began profiling an osgi java application that I am writing using VisualVM. One thing I have noticed is that when the application starts sending data to a client (over JMS), the number of loaded classes starts increasing at a steady rate. Th...
TITLE: Possible Memory leak in Number of Loaded classes in Java Application QUESTION: I recently began profiling an osgi java application that I am writing using VisualVM. One thing I have noticed is that when the application starts sending data to a client (over JMS), the number of loaded classes starts increasing at...
[ "java", "profiling" ]
10
5
14,793
6
0
2008-10-03T16:26:49.803000
2008-10-03T17:25:00.590000
167,743
170,908
Quickest way to implement a C++ Win32 Splash Screen
What's a simple way to implement a c++ Win32 program to... - display an 800x600x24 uncompressed bitmap image - in a window without borders (the only thing visible is the image) - that closes after ten seconds - and doesn't use MFC
You can: Create a dialog in your resource file Have it contain a Picture control Set the picture control type to Bitmap Create/import your bitmap in the resource file and set that bitmap ID to the picture control in your dialog Create the window by using CreateDialogParam Handle the WM_INITDIALOG in order to set a time...
Quickest way to implement a C++ Win32 Splash Screen What's a simple way to implement a c++ Win32 program to... - display an 800x600x24 uncompressed bitmap image - in a window without borders (the only thing visible is the image) - that closes after ten seconds - and doesn't use MFC
TITLE: Quickest way to implement a C++ Win32 Splash Screen QUESTION: What's a simple way to implement a c++ Win32 program to... - display an 800x600x24 uncompressed bitmap image - in a window without borders (the only thing visible is the image) - that closes after ten seconds - and doesn't use MFC ANSWER: You can: C...
[ "c++", "winapi" ]
10
1
16,275
6
0
2008-10-03T16:27:13.343000
2008-10-04T19:42:47.923000
167,745
170,277
Spring: Obtaining ResourceBundle based on MessageSource
I'm using hibernate validator framework with Spring. A class implementing the Spring Validator validates objects with Hibernate's ClassValidator. To localize ClassValidator's error messages I need to pass a ResourceBundle into the class' constructor. My ApplicationCountext has a MessageSource bean (ReloadableResourceBu...
MessageSourceResourceBundle sounds like what you are looking for. (Haven't tried it myself.)
Spring: Obtaining ResourceBundle based on MessageSource I'm using hibernate validator framework with Spring. A class implementing the Spring Validator validates objects with Hibernate's ClassValidator. To localize ClassValidator's error messages I need to pass a ResourceBundle into the class' constructor. My Applicatio...
TITLE: Spring: Obtaining ResourceBundle based on MessageSource QUESTION: I'm using hibernate validator framework with Spring. A class implementing the Spring Validator validates objects with Hibernate's ClassValidator. To localize ClassValidator's error messages I need to pass a ResourceBundle into the class' construc...
[ "java", "hibernate", "validation", "spring" ]
1
2
4,615
1
0
2008-10-03T16:27:41.330000
2008-10-04T12:44:04.790000
167,746
167,781
Where can I find an open source C# project that uses ADO.NET?
I am trying to write a Windows Form and ASP.NET C# front-end and MSAccess backend for a pretty small database concept I have. I have written this application once before in just MSAccess but I now need the app and database to be in different places. I have now figured out (thanks to a StackOverflow user) that ADO will ...
I haven't used this but it looks like it might be a good fit: http://www.codeproject.com/KB/database/DBaseFactGenerics.aspx
Where can I find an open source C# project that uses ADO.NET? I am trying to write a Windows Form and ASP.NET C# front-end and MSAccess backend for a pretty small database concept I have. I have written this application once before in just MSAccess but I now need the app and database to be in different places. I have n...
TITLE: Where can I find an open source C# project that uses ADO.NET? QUESTION: I am trying to write a Windows Form and ASP.NET C# front-end and MSAccess backend for a pretty small database concept I have. I have written this application once before in just MSAccess but I now need the app and database to be in differen...
[ "c#", "database", "open-source", "ado.net" ]
1
0
1,918
4
0
2008-10-03T16:27:44.857000
2008-10-03T16:36:39.690000
167,752
167,902
How can you display Typing Speed using Javascript or the jQuery library?
I would like to add a typing speed indicator just below the textarea we use on our contact form. It is just for fun and to give the user some interactivity with the page while they are completing the form. It should display the average speed while typing and keep the last average when the keystrokes are idle. When they...
Here's a tested implementation,which seems ok, but I don't guarantee the math. A Demo: http://jsfiddle.net/iaezzy/pLpx5oLf/ And the code: Type Speed CPM 0 WPM 0
How can you display Typing Speed using Javascript or the jQuery library? I would like to add a typing speed indicator just below the textarea we use on our contact form. It is just for fun and to give the user some interactivity with the page while they are completing the form. It should display the average speed while...
TITLE: How can you display Typing Speed using Javascript or the jQuery library? QUESTION: I would like to add a typing speed indicator just below the textarea we use on our contact form. It is just for fun and to give the user some interactivity with the page while they are completing the form. It should display the a...
[ "javascript" ]
7
11
11,625
4
0
2008-10-03T16:29:03.200000
2008-10-03T17:09:37.097000
167,760
168,097
Hiding a function
I have a class holding complex scientific computations. It is set up to only allow a user to create a properly instantiated case. To properly test the code, however, requires setting internal state variables directly, since the reference documents supply this data in their test cases. Done improperly, however, it can i...
Suppose you want to test this object by manipulating its fields. public class ComplexCalculation { protected int favoriteNumber; public int FavoriteNumber { get { return favoriteNumber; } } } Place this object in your test assembly/namespace: public class ComplexCalculationTest: ComplexCalculation { public void SetFavo...
Hiding a function I have a class holding complex scientific computations. It is set up to only allow a user to create a properly instantiated case. To properly test the code, however, requires setting internal state variables directly, since the reference documents supply this data in their test cases. Done improperly,...
TITLE: Hiding a function QUESTION: I have a class holding complex scientific computations. It is set up to only allow a user to create a properly instantiated case. To properly test the code, however, requires setting internal state variables directly, since the reference documents supply this data in their test cases...
[ "c#", "visual-studio", "intellisense" ]
2
4
454
7
0
2008-10-03T16:30:27.283000
2008-10-03T17:54:05.523000
167,761
167,789
How to achieve a photo "stack" border effect with CSS?
I'd like to be able to add a class to images that adds a border that makes them look like a stack of photos. Anyone know how to do this? Clarifications: Ideally something like the stack shown here but it doesn't need to be interactive and only needs to work for a single photo. I also don't mind using javascript if need...
The "depth" affect is probably going to be some type of drop shadow. Do you need to rotate the photos as well for the "messy photo pile" effect or are you looking for a "neatly stacked" look? The "messy photo pile" effect seems to me to break down into three components: Put a background behind the image for the "polaro...
How to achieve a photo "stack" border effect with CSS? I'd like to be able to add a class to images that adds a border that makes them look like a stack of photos. Anyone know how to do this? Clarifications: Ideally something like the stack shown here but it doesn't need to be interactive and only needs to work for a s...
TITLE: How to achieve a photo "stack" border effect with CSS? QUESTION: I'd like to be able to add a class to images that adds a border that makes them look like a stack of photos. Anyone know how to do this? Clarifications: Ideally something like the stack shown here but it doesn't need to be interactive and only nee...
[ "css" ]
3
1
3,908
5
0
2008-10-03T16:30:40.560000
2008-10-03T16:38:36.487000
167,791
167,793
Control multiple PCs with single Mouse and Keyboard
As a programmer I found it very hard to use my laptop and workstation with two different input devices, Can anyone suggest a good solution to use single mouse and keyboard to control my two machines I am not looking for a Virtual Machine or RDP solution to see my machines in a single monitor,
Synergy. Synergy lets you easily share a single mouse and keyboard between multiple computers with different operating systems, each with its own display, without special hardware. It's intended for users with multiple computers on their desk since each system uses its own monitor(s). Redirecting the mouse and keyboard...
Control multiple PCs with single Mouse and Keyboard As a programmer I found it very hard to use my laptop and workstation with two different input devices, Can anyone suggest a good solution to use single mouse and keyboard to control my two machines I am not looking for a Virtual Machine or RDP solution to see my mach...
TITLE: Control multiple PCs with single Mouse and Keyboard QUESTION: As a programmer I found it very hard to use my laptop and workstation with two different input devices, Can anyone suggest a good solution to use single mouse and keyboard to control my two machines I am not looking for a Virtual Machine or RDP solut...
[ "windows", "keyboard", "mouse", "desktop" ]
16
41
6,907
14
0
2008-10-03T16:38:51.977000
2008-10-03T16:39:48.513000
167,808
167,841
AJAX, postbacks and browser refreshes
I have created a user control to handle adding comments to certain business entities, like contacts and customers. Works great... except for one issue. I am using a ListView control to edit and delete comments, and a separate area, on the same user control to add a new comment. All of this is wrapped in an UpdatePanel....
You could try using the Post/Redirect/Get pattern. Basically instead of letting the postback send the data, redirect to the page. That way, if a user refreshes, s/he is refreshing the GET command rather than the POST. Sorry.. missed the UpdatePanel piece. Make sure that your submit button is also within that UpdatePane...
AJAX, postbacks and browser refreshes I have created a user control to handle adding comments to certain business entities, like contacts and customers. Works great... except for one issue. I am using a ListView control to edit and delete comments, and a separate area, on the same user control to add a new comment. All...
TITLE: AJAX, postbacks and browser refreshes QUESTION: I have created a user control to handle adding comments to certain business entities, like contacts and customers. Works great... except for one issue. I am using a ListView control to edit and delete comments, and a separate area, on the same user control to add ...
[ "asp.net", "ajax" ]
3
4
1,411
2
0
2008-10-03T16:43:20.300000
2008-10-03T16:52:43.353000
167,812
167,914
Java Development on a Mac - Xcode, Eclipse, or Netbeans
I've been using Xcode for the usual C/C++/ObjC development. I'm wondering what are practical considerations, opinions of Xcode, Eclipse or NetBeans usage on a Mac for Java development? Please don't include my current usage of Xcode in your analysis.
I like NetBeans on OS X for Java. It seems like I spend more time configuring eclipse to get a decent java programming environment. With NetBeans the setup time is less and I can get down to programming quicker...
Java Development on a Mac - Xcode, Eclipse, or Netbeans I've been using Xcode for the usual C/C++/ObjC development. I'm wondering what are practical considerations, opinions of Xcode, Eclipse or NetBeans usage on a Mac for Java development? Please don't include my current usage of Xcode in your analysis.
TITLE: Java Development on a Mac - Xcode, Eclipse, or Netbeans QUESTION: I've been using Xcode for the usual C/C++/ObjC development. I'm wondering what are practical considerations, opinions of Xcode, Eclipse or NetBeans usage on a Mac for Java development? Please don't include my current usage of Xcode in your analys...
[ "java", "eclipse", "xcode", "macos", "netbeans" ]
23
33
74,130
19
0
2008-10-03T16:43:54.307000
2008-10-03T17:11:50.337000
167,816
167,939
PHP Script Compression/"Compilation" Tools
Are there any more generic tools that can "compile" or basically merge multiple PHP files into a single file based on includes and autoloading classes? I'm thinking of something similar to Doctrine's compiling functionality or the compiling that many of the major JS frameworks do for "production" sites to lighten the f...
Out of curiosity, why do you want to do this? If it's for performance, don't bother. Just use regular includes instead of auto-loading, and it will have much of the same effect. For performance you're better off looking at one of the run-time caching solutions.
PHP Script Compression/"Compilation" Tools Are there any more generic tools that can "compile" or basically merge multiple PHP files into a single file based on includes and autoloading classes? I'm thinking of something similar to Doctrine's compiling functionality or the compiling that many of the major JS frameworks...
TITLE: PHP Script Compression/"Compilation" Tools QUESTION: Are there any more generic tools that can "compile" or basically merge multiple PHP files into a single file based on includes and autoloading classes? I'm thinking of something similar to Doctrine's compiling functionality or the compiling that many of the m...
[ "php", "optimization", "compilation", "merge" ]
3
1
1,959
4
0
2008-10-03T16:45:16.880000
2008-10-03T17:18:30.243000
167,827
167,992
I work in SCM/build. How do I tell non-programmers what I do?
Friends/family/etc ask me what I do and it always causes me pause while I think of how to explain it. They know what a software developer is but how can I explain what SCM is in 10 words?
Surprising they know what a software developer does! Anwyay, this sounds like a challenge for Haiku enthusiasts: in 5-7-5 (I'm lazy when doing english haiku and my seasonal reference is flakey - try a 3-5-3 if you like) from many good parts: one programme on your PC; lose track, get winter (hmm, 13 words)
I work in SCM/build. How do I tell non-programmers what I do? Friends/family/etc ask me what I do and it always causes me pause while I think of how to explain it. They know what a software developer is but how can I explain what SCM is in 10 words?
TITLE: I work in SCM/build. How do I tell non-programmers what I do? QUESTION: Friends/family/etc ask me what I do and it always causes me pause while I think of how to explain it. They know what a software developer is but how can I explain what SCM is in 10 words? ANSWER: Surprising they know what a software develo...
[ "version-control", "build" ]
2
1
429
3
0
2008-10-03T16:47:54.347000
2008-10-03T17:30:28.410000
167,852
167,968
WSDL URL for a WCF Service (basicHttpBinding) hosted inside a Windows Service
I am hosting a WCF service in a Windows Service on one of our servers. After making it work in basicHttpBinding and building a test client in.NET (which finally worked) I went along and try to access it from PHP using the SoapClient class. The final consumer will be a PHP site so I need to make it consumable in PHP. I ...
This might help: http://msdn.microsoft.com/en-us/library/ms734765.aspx In a nutshell you need to configure your service endpoints and behaviour. Here is a minimal example: name="WcfService1.Service1" behaviorConfiguration="SimpleServiceBehaviour"> contract="WcfService1.IService1"/> httpGetEnabled="true" policyVersion="...
WSDL URL for a WCF Service (basicHttpBinding) hosted inside a Windows Service I am hosting a WCF service in a Windows Service on one of our servers. After making it work in basicHttpBinding and building a test client in.NET (which finally worked) I went along and try to access it from PHP using the SoapClient class. Th...
TITLE: WSDL URL for a WCF Service (basicHttpBinding) hosted inside a Windows Service QUESTION: I am hosting a WCF service in a Windows Service on one of our servers. After making it work in basicHttpBinding and building a test client in.NET (which finally worked) I went along and try to access it from PHP using the So...
[ "php", "wcf", "url", "wsdl", "basichttpbinding" ]
12
9
30,403
2
0
2008-10-03T16:56:21.507000
2008-10-03T17:24:40.527000
167,858
168,132
Need assistance with serial port communications in Ruby
I need to do some communications over a serial port in Ruby. From my research, it appears that there aren't many modern libraries for serial communications and the newest material I can find is from 2006. Are there any gems that I'm not aware of? I ultimately need to maintain communications with a serial device attache...
The serial port specification has not changed in forever, I wouldn't worry about how old the libraries are. I'm assuming you saw this article from 2006 about ruby and serial ports Here's someone who got the Ruby-SerialPort library mentioned there to work on macs this year. There's also this old post from ruby talk, abo...
Need assistance with serial port communications in Ruby I need to do some communications over a serial port in Ruby. From my research, it appears that there aren't many modern libraries for serial communications and the newest material I can find is from 2006. Are there any gems that I'm not aware of? I ultimately need...
TITLE: Need assistance with serial port communications in Ruby QUESTION: I need to do some communications over a serial port in Ruby. From my research, it appears that there aren't many modern libraries for serial communications and the newest material I can find is from 2006. Are there any gems that I'm not aware of?...
[ "ruby", "serial-port", "communication" ]
4
2
5,840
3
0
2008-10-03T16:58:24.963000
2008-10-03T18:05:22.460000
167,862
168,033
How can I "unuse" a namespace?
One of the vagaries of my development system (Codegear C++Builder) is that some of the auto-generated headers insist on having... using namespace xyzzy...statements in them, which impact on my code when I least want or expect it. Is there a way I can somehow cancel/override a previous "using" statement to avoid this. M...
Nope. But there's a potential solution: if you enclose your include directive in a namespace of its own, like this... namespace codegear { #include "codegear_header.h" } // namespace codegear...then the effects of any using directives within that header are neutralized. That might be problematic in some cases. That's w...
How can I "unuse" a namespace? One of the vagaries of my development system (Codegear C++Builder) is that some of the auto-generated headers insist on having... using namespace xyzzy...statements in them, which impact on my code when I least want or expect it. Is there a way I can somehow cancel/override a previous "us...
TITLE: How can I "unuse" a namespace? QUESTION: One of the vagaries of my development system (Codegear C++Builder) is that some of the auto-generated headers insist on having... using namespace xyzzy...statements in them, which impact on my code when I least want or expect it. Is there a way I can somehow cancel/overr...
[ "c++", "namespaces", "c++builder" ]
96
66
55,155
7
0
2008-10-03T16:59:58.720000
2008-10-03T17:39:08.487000
167,873
168,050
Repeated cookie query or Storing in viewstate? Which is the better practice?
I have a internal website that users log into. This data is saved as a cookie. From there the users go on their merry way. Every so often the application(s) will query the authentication record to determine what permissions the user has. My question is this: Is it more efficent to just query the cookie for the user dat...
Viewstate is specific to the page they are viewing, so its gone once they go along thier merry way. Not a good way to persist data. Your best bet is to use Forms Authentication, its built in to ASP.NET and you can also shove any user-specific information into the Forms Authentication Ticket's Value. You can get 4000 by...
Repeated cookie query or Storing in viewstate? Which is the better practice? I have a internal website that users log into. This data is saved as a cookie. From there the users go on their merry way. Every so often the application(s) will query the authentication record to determine what permissions the user has. My qu...
TITLE: Repeated cookie query or Storing in viewstate? Which is the better practice? QUESTION: I have a internal website that users log into. This data is saved as a cookie. From there the users go on their merry way. Every so often the application(s) will query the authentication record to determine what permissions t...
[ "cookies", "asp.net-2.0", "viewstate" ]
1
1
5,016
4
0
2008-10-03T17:01:49.810000
2008-10-03T17:43:30.990000
167,888
168,539
How can I GZip compress a file from Excel VBA using code in an .xla file only?
I need to be able to GZip compress a file in an Excel VBA function. Specifically I need to be able to use the 'deflate' algorithm. Is there a way to do this without having to exec a command line application? With no dependency on external tools the code will be more robust. Ideally the code would make use of pre-instal...
VBA (which is really a dialect of VB6) is slow for these kind of applications. I remember I once implemented Shannon-Fano algorithm on VB6 and on C, the C version was about 10 times faster, even after being turned into a DLLMain and called from there rather than on a command-line executable. There are lots of COM DLLs ...
How can I GZip compress a file from Excel VBA using code in an .xla file only? I need to be able to GZip compress a file in an Excel VBA function. Specifically I need to be able to use the 'deflate' algorithm. Is there a way to do this without having to exec a command line application? With no dependency on external to...
TITLE: How can I GZip compress a file from Excel VBA using code in an .xla file only? QUESTION: I need to be able to GZip compress a file in an Excel VBA function. Specifically I need to be able to use the 'deflate' algorithm. Is there a way to do this without having to exec a command line application? With no depende...
[ "excel", "gzip", "add-in", "vba" ]
4
4
9,950
5
0
2008-10-03T17:04:02.317000
2008-10-03T19:35:48.250000
167,909
168,110
Is F# suitable for Physics applications?
I hate Physics, but I love software development. When I go back to school after Thanksgiving, I'll be taking two more quarters of Physics before I'm done with the horrid thing. I am currently reading postings on the F# units of measurement feature, but I've never used a language like F#. Would it be suitable to write a...
In my biased opinion, F# is ideal for physics. It has a feature called Units of Measure which does dimensional analysis for you, providing errors if you get it wrong. For example if you write: let distance: float = gravity * 3.0 That would yield a compile-error, since gravity is < meters/seconds^2 > and not < meters >....
Is F# suitable for Physics applications? I hate Physics, but I love software development. When I go back to school after Thanksgiving, I'll be taking two more quarters of Physics before I'm done with the horrid thing. I am currently reading postings on the F# units of measurement feature, but I've never used a language...
TITLE: Is F# suitable for Physics applications? QUESTION: I hate Physics, but I love software development. When I go back to school after Thanksgiving, I'll be taking two more quarters of Physics before I'm done with the horrid thing. I am currently reading postings on the F# units of measurement feature, but I've nev...
[ ".net", "f#", "physics" ]
4
11
1,526
7
0
2008-10-03T17:10:38.950000
2008-10-03T17:56:48.980000
167,916
169,346
Table load via Partition Exchange (Oracle 10g)
I have a few questions about optimizing this type of load. One builds a new table of data to be loaded into a partitioned table and then builds the indexes on this new table. Should you build the index with the COMPUTE STATISTICS option or use the Cascade option of the DBMS_Stats? Should you gather stats on the table b...
Should you build the index with the COMPUTE STATISTICS option or use the Cascade option of the DBMS_Stats? If this is a data warehouse then first consider not gathering statistics at all, and using dynamic sampling. Second, if you do gather statistics then by all means use compute statistics on the index. Should you ga...
Table load via Partition Exchange (Oracle 10g) I have a few questions about optimizing this type of load. One builds a new table of data to be loaded into a partitioned table and then builds the indexes on this new table. Should you build the index with the COMPUTE STATISTICS option or use the Cascade option of the DBM...
TITLE: Table load via Partition Exchange (Oracle 10g) QUESTION: I have a few questions about optimizing this type of load. One builds a new table of data to be loaded into a partitioned table and then builds the indexes on this new table. Should you build the index with the COMPUTE STATISTICS option or use the Cascade...
[ "oracle", "statistics", "oracle10g", "partitioning" ]
2
1
3,590
2
0
2008-10-03T17:12:11.210000
2008-10-03T23:45:58.120000
167,917
167,944
How do you enforce strong passwords?
There are many techniques to enforce strong passwords on website: Requesting that passwords pass a regex of varying complexity Setting the password autonomously, so that casual users have a strong password Letting passwords expire etc. On the other hands there are drawbacks, because all of them make life less easy for ...
I don't think it's possible to enforce strong passwords, but there are lots of things you can do to encourage them as much as possible. Rate each password and give the user feedback in the form of a score or a graphical bar, etc. Set a minimum password score to weed out the awful ones Have a list of common words that a...
How do you enforce strong passwords? There are many techniques to enforce strong passwords on website: Requesting that passwords pass a regex of varying complexity Setting the password autonomously, so that casual users have a strong password Letting passwords expire etc. On the other hands there are drawbacks, because...
TITLE: How do you enforce strong passwords? QUESTION: There are many techniques to enforce strong passwords on website: Requesting that passwords pass a regex of varying complexity Setting the password autonomously, so that casual users have a strong password Letting passwords expire etc. On the other hands there are ...
[ "security", "passwords" ]
9
24
2,108
8
0
2008-10-03T17:12:14.017000
2008-10-03T17:19:16.203000
167,923
168,009
What is best way to remove duplicate lines matching regex from string using Python?
This is a pretty straight forward attempt. I haven't been using python for too long. Seems to work but I am sure I have much to learn. Someone let me know if I am way off here. Needs to find patterns, write the first line which matches, and then add a summary message for remaining consecutive lines which match pattern ...
The rematcher function seems to do what you want: def rematcher(re_str, iterable): matcher= re.compile(re_str) in_match= 0 for item in iterable: if matcher.match(item): if in_match == 0: yield item in_match+= 1 else: if in_match > 1: yield "%s repeats %d more times\n" % (re_str, in_match-1) in_match= 0 yield item if i...
What is best way to remove duplicate lines matching regex from string using Python? This is a pretty straight forward attempt. I haven't been using python for too long. Seems to work but I am sure I have much to learn. Someone let me know if I am way off here. Needs to find patterns, write the first line which matches,...
TITLE: What is best way to remove duplicate lines matching regex from string using Python? QUESTION: This is a pretty straight forward attempt. I haven't been using python for too long. Seems to work but I am sure I have much to learn. Someone let me know if I am way off here. Needs to find patterns, write the first l...
[ "python", "regex" ]
2
1
3,155
3
0
2008-10-03T17:13:37.167000
2008-10-03T17:34:20.337000
167,946
167,958
How would you compare two XML Documents?
As part of the base class for some extensive unit testing, I am writing a helper function which recursively compares the nodes of one XmlDocument object to another in C# (.NET). Some requirements of this: The first document is the source, e.g. what I want the XML document to look like. Thus the second is the one I want...
Microsoft has an XML diff API that you can use. Unofficial NuGet: https://www.nuget.org/packages/XMLDiffPatch.
How would you compare two XML Documents? As part of the base class for some extensive unit testing, I am writing a helper function which recursively compares the nodes of one XmlDocument object to another in C# (.NET). Some requirements of this: The first document is the source, e.g. what I want the XML document to loo...
TITLE: How would you compare two XML Documents? QUESTION: As part of the base class for some extensive unit testing, I am writing a helper function which recursively compares the nodes of one XmlDocument object to another in C# (.NET). Some requirements of this: The first document is the source, e.g. what I want the X...
[ "c#", ".net", "xml", "compare", "xmldocument" ]
71
64
112,158
13
0
2008-10-03T17:19:34.890000
2008-10-03T17:22:46.397000
167,952
265,931
Should I use NULL or an empty string to represent no data in table column?
Null or empty string -- is one better than the other to represent no data in a table column? (I specifically use MySQL, but I'm thinking this is system-independent.) Are there major advantages/disadvantages to using one over the other, or is it simply programmer preference?
I strongly disagree with everyone who says to unconditionally use NULL. Allowing a column to be NULL introduces an additional state that you wouldn't have if you set the column up as NOT NULL. Do not do this if you don't need the additional state. That is, if you can't come up with a difference between the meaning of e...
Should I use NULL or an empty string to represent no data in table column? Null or empty string -- is one better than the other to represent no data in a table column? (I specifically use MySQL, but I'm thinking this is system-independent.) Are there major advantages/disadvantages to using one over the other, or is it ...
TITLE: Should I use NULL or an empty string to represent no data in table column? QUESTION: Null or empty string -- is one better than the other to represent no data in a table column? (I specifically use MySQL, but I'm thinking this is system-independent.) Are there major advantages/disadvantages to using one over th...
[ "mysql", "database", "null" ]
29
33
15,114
16
0
2008-10-03T17:21:13.047000
2008-11-05T17:22:29.620000
167,954
168,079
Order dates by upcoming
So I build an array of various dates. Birthdays, anniversaries, and holidays. I'd like to order the array by which one is happening next, essentially sort October to September (wrapping to next year) so if my array is $a = ([0]=>"1980-04-14", [1]=>"2007-06-08", [2]=>"2008-12-25", [3]=>"1978-11-03") I'd like to sort it ...
function relative_year_day($date) { $value = date('z', strtotime($date)) - date('z'); if ($value < 0) $value += 365; return $value; } function cmp($a, $b) { $aValue = relative_year_day($a); $bValue = relative_year_day($b); if ($aValue == $bValue) return 0; return ($aValue < $bValue)? -1: 1; } $a = array("1980-04-...
Order dates by upcoming So I build an array of various dates. Birthdays, anniversaries, and holidays. I'd like to order the array by which one is happening next, essentially sort October to September (wrapping to next year) so if my array is $a = ([0]=>"1980-04-14", [1]=>"2007-06-08", [2]=>"2008-12-25", [3]=>"1978-11-0...
TITLE: Order dates by upcoming QUESTION: So I build an array of various dates. Birthdays, anniversaries, and holidays. I'd like to order the array by which one is happening next, essentially sort October to September (wrapping to next year) so if my array is $a = ([0]=>"1980-04-14", [1]=>"2007-06-08", [2]=>"2008-12-25...
[ "php", "arrays", "sorting" ]
3
3
608
6
0
2008-10-03T17:21:52.843000
2008-10-03T17:49:00.683000
167,990
175,269
How can I embed one file into another with Ant?
I am developing a small web app project (ColdFusion) and I am trying to keep my project split into multiple files during development, but deploy just one file on completion. I have references to external files, for instance: And when I build my project, I want to have the files included and embedded within the single f...
Answering my own question after a few hours of hacking... and this groovy script replaces any referenced javascript or css file with the file contents itself. f = new File("${targetDir}/index.cfm") fContent = f.text fContent = jsReplace(fContent) fContent = cssReplace(fContent) f.write(fContent) // JS Replacement def ...
How can I embed one file into another with Ant? I am developing a small web app project (ColdFusion) and I am trying to keep my project split into multiple files during development, but deploy just one file on completion. I have references to external files, for instance: And when I build my project, I want to have the...
TITLE: How can I embed one file into another with Ant? QUESTION: I am developing a small web app project (ColdFusion) and I am trying to keep my project split into multiple files during development, but deploy just one file on completion. I have references to external files, for instance: And when I build my project, ...
[ "ant", "groovy", "build" ]
3
1
2,827
3
0
2008-10-03T17:30:02.593000
2008-10-06T17:21:14.433000
168,014
173,848
How do you defend your application against corporate politics?
I can't tell you how many times I've run into situations where a higher-up says 'Look, just do it'. This is obviously at the expense of rigidity in the planning process, and will (probably) affect product quality. By now, I have more experience with this, and with that, I have the confidence to stand up for the quality...
The most likely cause of being told "look just do it" by a superior is information asymmetry: either of you or both of you know something that other party doesn't. The manager might not be telling you that in the grand scheme of issues this specific problem is fairly unimportant or they just looking for a quick fix, si...
How do you defend your application against corporate politics? I can't tell you how many times I've run into situations where a higher-up says 'Look, just do it'. This is obviously at the expense of rigidity in the planning process, and will (probably) affect product quality. By now, I have more experience with this, a...
TITLE: How do you defend your application against corporate politics? QUESTION: I can't tell you how many times I've run into situations where a higher-up says 'Look, just do it'. This is obviously at the expense of rigidity in the planning process, and will (probably) affect product quality. By now, I have more exper...
[ "project-management" ]
3
8
477
7
0
2008-10-03T17:35:14.283000
2008-10-06T10:49:24.223000
168,017
168,034
Convert BSTR to int
Does any one know how can I convert a BSTR to an int in VC++ 2008 Thanks in advance.
You can pass a BSTR safely to any function expecting a wchar_t *. So you can use _wtoi ().
Convert BSTR to int Does any one know how can I convert a BSTR to an int in VC++ 2008 Thanks in advance.
TITLE: Convert BSTR to int QUESTION: Does any one know how can I convert a BSTR to an int in VC++ 2008 Thanks in advance. ANSWER: You can pass a BSTR safely to any function expecting a wchar_t *. So you can use _wtoi ().
[ "c++", "winapi" ]
4
12
13,963
8
0
2008-10-03T17:36:37.167000
2008-10-03T17:39:58.190000
168,037
168,088
Creating a random ordered list from an ordered list
I have an application that takes the quality results for a manufacturing process and creates graphs both to show Pareto charts of the bad, and also to show production throughput. To automate the task of testing these statistical procedures I would like to deterministically be able to add records into the database and h...
You'll want to use a shuffle algorithm. Make sure to use a proper shuffle algorithm and not a home-baked one, because it may introduce some form of subtle pattern to the data. See this post by Jeff Atwood about the problem with using "random enough" shuffles.
Creating a random ordered list from an ordered list I have an application that takes the quality results for a manufacturing process and creates graphs both to show Pareto charts of the bad, and also to show production throughput. To automate the task of testing these statistical procedures I would like to deterministi...
TITLE: Creating a random ordered list from an ordered list QUESTION: I have an application that takes the quality results for a manufacturing process and creates graphs both to show Pareto charts of the bad, and also to show production throughput. To automate the task of testing these statistical procedures I would li...
[ "algorithm" ]
6
12
6,279
6
0
2008-10-03T17:40:47.610000
2008-10-03T17:51:44.093000
168,062
168,093
My SQL Server 2000 Transaction Log Size Seems Small
I'm wondering why my transaction log would only be 2 MB on my 40 GB database when I have recovery mode set to full and unlimited file growth set on the transaction log. Any ideas? Edit: I'd say there is probably a few hundred MB inserted every day and a lot of updates going on. It's a database that drives a fairly acti...
Because you back up the log, and that's what it's supposed to do? Sidenote (given that I can't comment): A full backup does not truncate the log. Only log backups, or TRUNCATE_ONLY commands, truncate the log.
My SQL Server 2000 Transaction Log Size Seems Small I'm wondering why my transaction log would only be 2 MB on my 40 GB database when I have recovery mode set to full and unlimited file growth set on the transaction log. Any ideas? Edit: I'd say there is probably a few hundred MB inserted every day and a lot of updates...
TITLE: My SQL Server 2000 Transaction Log Size Seems Small QUESTION: I'm wondering why my transaction log would only be 2 MB on my 40 GB database when I have recovery mode set to full and unlimited file growth set on the transaction log. Any ideas? Edit: I'd say there is probably a few hundred MB inserted every day an...
[ "sql-server-2000" ]
1
3
376
3
0
2008-10-03T17:46:19.017000
2008-10-03T17:53:27.473000
168,073
171,574
How do I redirect a file download using Grails?
I'm currently writing a website that allows people to download Excel and text files. Is there a way to redirect to a different page when they click, so that we run javascript and do analytics (i.e. keep download count)? Currently, nothing prevents the user from simply right-clicking and saving. Edit: To be more specifi...
I started describing how you might do this in Grails but then remembered most analytics services (Google, Omniture, etc.) will let you track downloaded files by using the onclick event. If you have some custom javascript based tracking you're doing, you can do the same thing. The onclick will get called before the docu...
How do I redirect a file download using Grails? I'm currently writing a website that allows people to download Excel and text files. Is there a way to redirect to a different page when they click, so that we run javascript and do analytics (i.e. keep download count)? Currently, nothing prevents the user from simply rig...
TITLE: How do I redirect a file download using Grails? QUESTION: I'm currently writing a website that allows people to download Excel and text files. Is there a way to redirect to a different page when they click, so that we run javascript and do analytics (i.e. keep download count)? Currently, nothing prevents the us...
[ "grails", "download" ]
2
2
2,584
2
0
2008-10-03T17:48:09.747000
2008-10-05T06:24:30.343000
168,080
168,444
JPA and inheritance
I have a some JPA entities that inherit from one another and uses discriminator to determine what class to be created (untested as of yet). @Entity(name="switches") @DiscriminatorColumn(name="type") @DiscriminatorValue(value="500") public class DmsSwitch extends Switch implements Serializable {} @MappedSuperclass publ...
As your switch class is not an entity, it cannot be used in an entity relationship... Unfortunately, you'll have to transform your mappedsuperclass as an entity to involve it in a relationship.
JPA and inheritance I have a some JPA entities that inherit from one another and uses discriminator to determine what class to be created (untested as of yet). @Entity(name="switches") @DiscriminatorColumn(name="type") @DiscriminatorValue(value="500") public class DmsSwitch extends Switch implements Serializable {} @M...
TITLE: JPA and inheritance QUESTION: I have a some JPA entities that inherit from one another and uses discriminator to determine what class to be created (untested as of yet). @Entity(name="switches") @DiscriminatorColumn(name="type") @DiscriminatorValue(value="500") public class DmsSwitch extends Switch implements S...
[ "java", "jpa" ]
1
1
1,492
3
0
2008-10-03T17:49:21.710000
2008-10-03T19:17:29.990000
168,113
168,328
Django: How do I create a generic url routing to views?
I have a pretty standard django app, and am wondering how to set the url routing so that I don't have to explicitly map each url to a view. For example, let's say that I have the following views: Project, Links, Profile, Contact. I'd rather not have my urlpatterns look like this: (r'^Project/$', 'mysite.app.views.proje...
mods = ('Project','Links','Profile','Contact') urlpatterns = patterns('', *(('^%s/$'%n, 'mysite.app.views.%s'%n.lower()) for n in mods) )
Django: How do I create a generic url routing to views? I have a pretty standard django app, and am wondering how to set the url routing so that I don't have to explicitly map each url to a view. For example, let's say that I have the following views: Project, Links, Profile, Contact. I'd rather not have my urlpatterns...
TITLE: Django: How do I create a generic url routing to views? QUESTION: I have a pretty standard django app, and am wondering how to set the url routing so that I don't have to explicitly map each url to a view. For example, let's say that I have the following views: Project, Links, Profile, Contact. I'd rather not h...
[ "python", "django", "pylons" ]
8
5
3,434
3
0
2008-10-03T17:58:05.470000
2008-10-03T18:49:41.760000
168,114
175,757
Best Flash Audio/Video + Interactivity server?
I'm looking for suggestions on Flash realtime servers. Currently, we use a combination of Moock's Unity and Red5, but there are a couple problems. First, we are moving to AS3, and Unity only supports AS2. Secondly, Red5 is pretty flaky for us, we'd prefer something more stable. We can't use the official Flash Media Ser...
Give Wowza a try! I've only used it for webcam recording, but the experience was very seamless, a far cry from Red5. Plus as a developer you can use the full Wowza for free AFAIK, so you don't have to take my word for it. It's easy to install, they have good code samples, it really gave me a good impression. Another in...
Best Flash Audio/Video + Interactivity server? I'm looking for suggestions on Flash realtime servers. Currently, we use a combination of Moock's Unity and Red5, but there are a couple problems. First, we are moving to AS3, and Unity only supports AS2. Secondly, Red5 is pretty flaky for us, we'd prefer something more st...
TITLE: Best Flash Audio/Video + Interactivity server? QUESTION: I'm looking for suggestions on Flash realtime servers. Currently, we use a combination of Moock's Unity and Red5, but there are a couple problems. First, we are moving to AS3, and Unity only supports AS2. Secondly, Red5 is pretty flaky for us, we'd prefer...
[ "flash", "actionscript-3", "sockets", "rtmp" ]
13
6
1,367
4
0
2008-10-03T17:58:15.517000
2008-10-06T19:16:43.763000
168,116
170,842
What would be Linux equivalent of GetProcessIoCounters?
Here's a link to Windows documentation. Basically I would like to get similar data, but on Linux. If not all is possible, then at least some parts.
If you enable CONFIG\_TASK\_IO\_ACCOUNTING, you will have the information available in /proc/ /io. This is available since kernel 2.6.20, but not normally enabled by default (However, in Ubuntu 8.04 it seems like it is enabled). You can read about the various data items in Documentation/filesystems/proc.txt in the kern...
What would be Linux equivalent of GetProcessIoCounters? Here's a link to Windows documentation. Basically I would like to get similar data, but on Linux. If not all is possible, then at least some parts.
TITLE: What would be Linux equivalent of GetProcessIoCounters? QUESTION: Here's a link to Windows documentation. Basically I would like to get similar data, but on Linux. If not all is possible, then at least some parts. ANSWER: If you enable CONFIG\_TASK\_IO\_ACCOUNTING, you will have the information available in /p...
[ "linux", "statistics", "operating-system" ]
2
2
464
4
0
2008-10-03T17:58:22.537000
2008-10-04T18:57:02.027000
168,119
172,472
Time math in Delphi
I have a pretty unusual problem (for me). I am writing an application that will allow a user to change their system time forward or back either by explicit date (change my date to 6/3/1955) or by increment using buttons (go forward 1 month). I'm writing this to help some of my users test some software that requires jum...
As mentioned by gabr and mliesen, have a look at the DateUtils and SysUtils units, useful functions include. IncDay - Add a or subtract a number of days. IncMonth - Add a or subtract a number of months. IncWeek - Add a or subtract a number of weeks. IncYear - Add a or subtract a number of years. EncodeDate - Returns a ...
Time math in Delphi I have a pretty unusual problem (for me). I am writing an application that will allow a user to change their system time forward or back either by explicit date (change my date to 6/3/1955) or by increment using buttons (go forward 1 month). I'm writing this to help some of my users test some softwa...
TITLE: Time math in Delphi QUESTION: I have a pretty unusual problem (for me). I am writing an application that will allow a user to change their system time forward or back either by explicit date (change my date to 6/3/1955) or by increment using buttons (go forward 1 month). I'm writing this to help some of my user...
[ "delphi", "date", "time" ]
7
15
9,652
5
0
2008-10-03T18:00:15.107000
2008-10-05T19:02:24.980000
168,120
168,133
How can I do bi-directional communication with a custom USB device?
I'm planning to build a USB device that has buttons that some software needs to respond to, and indicators that the software needs to control. I'm new to USB, so I'm looking for any pointers that will get me started.
When I did some USB development a while ago, I found the information at USB Central extremely valuable. For low bandwidth requirements, you can use something like the FT232R which is a single-chip USB serial implementation. The FTDI drivers are readily available and make the device appear as a regular serial port to th...
How can I do bi-directional communication with a custom USB device? I'm planning to build a USB device that has buttons that some software needs to respond to, and indicators that the software needs to control. I'm new to USB, so I'm looking for any pointers that will get me started.
TITLE: How can I do bi-directional communication with a custom USB device? QUESTION: I'm planning to build a USB device that has buttons that some software needs to respond to, and indicators that the software needs to control. I'm new to USB, so I'm looking for any pointers that will get me started. ANSWER: When I d...
[ "hardware", "usb" ]
2
2
2,675
4
0
2008-10-03T18:01:13.917000
2008-10-03T18:05:22.897000
168,136
178,254
How to set up your own PEAR Channel?
I am looking for instructions on how to setup a PEAR channel for our project so that we can deploy it with the pear installer. I have searched the web for a while and cannot find any straightforward information. I followed this tutorial for a while, but I am having a hell of a time getting this to work. Does anyone kno...
It looks like you are one of the few people who want to do this. That tutorial you linked to appears to be the latest (!) but the package is still somewhat in development. The documentation in that package is also non-existent. It looks like it's up to you to write the docs. Or maybe contact Greg Beaver; the author of ...
How to set up your own PEAR Channel? I am looking for instructions on how to setup a PEAR channel for our project so that we can deploy it with the pear installer. I have searched the web for a while and cannot find any straightforward information. I followed this tutorial for a while, but I am having a hell of a time ...
TITLE: How to set up your own PEAR Channel? QUESTION: I am looking for instructions on how to setup a PEAR channel for our project so that we can deploy it with the pear installer. I have searched the web for a while and cannot find any straightforward information. I followed this tutorial for a while, but I am having...
[ "php", "deployment", "pear" ]
13
3
585
3
0
2008-10-03T18:06:19.400000
2008-10-07T12:42:11.343000
168,150
172,629
Other than for LINQ queries, how do you use anonymous types in C#?
I've been trying to get up to speed on some of the newer features in C# and one of them that I haven't had occasion to use is anonymous types. I understand the usage as it pertains to LINQ queries and I looked at this SO post which asked a similar question. Most of the examples I've seen on the net are related to LINQ ...
With a bit of reflection, you can turn an anonymous type into a Dictionary; Roy Osherove blogs his technique for this here: http://weblogs.asp.net/rosherove/archive/2008/03/11/turn-anonymous-types-into-idictionary-of-values.aspx Jacob Carpenter uses anonymous types as a way to initialize immutable objects with syntax s...
Other than for LINQ queries, how do you use anonymous types in C#? I've been trying to get up to speed on some of the newer features in C# and one of them that I haven't had occasion to use is anonymous types. I understand the usage as it pertains to LINQ queries and I looked at this SO post which asked a similar quest...
TITLE: Other than for LINQ queries, how do you use anonymous types in C#? QUESTION: I've been trying to get up to speed on some of the newer features in C# and one of them that I haven't had occasion to use is anonymous types. I understand the usage as it pertains to LINQ queries and I looked at this SO post which ask...
[ "c#", "anonymous-types" ]
5
6
1,455
6
0
2008-10-03T18:10:40.247000
2008-10-05T20:46:17.360000
168,167
169,779
Initializing cherrypy.session early
I love CherryPy's API for sessions, except for one detail. Instead of saying cherrypy.session["spam"] I'd like to be able to just say session["spam"]. Unfortunately, I can't simply have a global from cherrypy import session in one of my modules, because the cherrypy.session object isn't created until the first time a p...
For CherryPy 3.1, you would need to find the right subclass of Session, run its 'setup' classmethod, and then set cherrypy.session to a ThreadLocalProxy. That all happens in cherrypy.lib.sessions.init, in the following chunks: # Find the storage class and call setup (first time only). storage_class = storage_type.title...
Initializing cherrypy.session early I love CherryPy's API for sessions, except for one detail. Instead of saying cherrypy.session["spam"] I'd like to be able to just say session["spam"]. Unfortunately, I can't simply have a global from cherrypy import session in one of my modules, because the cherrypy.session object is...
TITLE: Initializing cherrypy.session early QUESTION: I love CherryPy's API for sessions, except for one detail. Instead of saying cherrypy.session["spam"] I'd like to be able to just say session["spam"]. Unfortunately, I can't simply have a global from cherrypy import session in one of my modules, because the cherrypy...
[ "python", "cherrypy" ]
3
5
2,478
1
0
2008-10-03T18:16:08.803000
2008-10-04T05:12:53.407000
168,169
168,221
public variables vs private variables with accessors
Has anyone else seen people do this: private string _name; public string Name{ get{ return _name; } set{ _name = value;}} I understand using accessors if you are going to exercise some sort of control over how it gets set or perform some sort of function on it when there is a get. But if you are just going to do this, ...
If you make the member a public field, then you can't later refactor it into a property without changing the interface to your class. If you expose it as a property from the very beginning, you can make whatever changes to the property accessor functions that you need and the class's interface remains unchanged. Note t...
public variables vs private variables with accessors Has anyone else seen people do this: private string _name; public string Name{ get{ return _name; } set{ _name = value;}} I understand using accessors if you are going to exercise some sort of control over how it gets set or perform some sort of function on it when t...
TITLE: public variables vs private variables with accessors QUESTION: Has anyone else seen people do this: private string _name; public string Name{ get{ return _name; } set{ _name = value;}} I understand using accessors if you are going to exercise some sort of control over how it gets set or perform some sort of fun...
[ "c#", "oop", "accessor" ]
24
36
8,029
10
0
2008-10-03T18:16:26.477000
2008-10-03T18:27:47.313000
168,170
168,176
Do .net applications run on Linux?
Do.net applications run on linux? Are there any free/paid interop libraries available?
Mono is a.NET-compatible platform, including compiler and runtime. The Mono Migration Analyzer helps figure out compatibility issues.
Do .net applications run on Linux? Do.net applications run on linux? Are there any free/paid interop libraries available?
TITLE: Do .net applications run on Linux? QUESTION: Do.net applications run on linux? Are there any free/paid interop libraries available? ANSWER: Mono is a.NET-compatible platform, including compiler and runtime. The Mono Migration Analyzer helps figure out compatibility issues.
[ ".net", "linux" ]
8
26
2,682
5
0
2008-10-03T18:17:01.437000
2008-10-03T18:18:09.967000
168,171
168,196
Regular expression for parsing name value pairs
Can someone provide a regular expression for parsing name/value pairs from a string? The pairs are separated by commas, and the value can optionally be enclosed in quotes. For example: AssemblyName=foo.dll,ClassName="SomeClass",Parameters="Some,Parameters"
No escape: /([^=,]*)=("[^"]*"|[^,"]*)/ Double quote escape for both key and value: /((?:"[^"]*"|[^=,])*)=((?:"[^"]*"|[^=,])*)/ key=value,"key with "" in it"="value with "" in it",key=value" "with" "spaces Backslash string escape: /([^=,]*)=("(?:\\.|[^"\\]+)*"|[^,"]*)/ key=value,key="value",key="val\"ue" Full backslas...
Regular expression for parsing name value pairs Can someone provide a regular expression for parsing name/value pairs from a string? The pairs are separated by commas, and the value can optionally be enclosed in quotes. For example: AssemblyName=foo.dll,ClassName="SomeClass",Parameters="Some,Parameters"
TITLE: Regular expression for parsing name value pairs QUESTION: Can someone provide a regular expression for parsing name/value pairs from a string? The pairs are separated by commas, and the value can optionally be enclosed in quotes. For example: AssemblyName=foo.dll,ClassName="SomeClass",Parameters="Some,Parameter...
[ "regex" ]
19
34
33,921
3
0
2008-10-03T18:17:11.093000
2008-10-03T18:22:50.660000
168,173
168,182
Change name of file sent to client?
I have a webpage that pulls information from a database, converts it to.csv format, and writes the file to the HTTPResponse. string csv = GetCSV(); Response.Clear(); Response.ContentType = "text/csv"; Response.Write(csv); This works fine, and the file is sent to the client with no problems. However, when the file is se...
I believe this will work for you. Response.AddHeader("content-disposition", "attachment; filename=NewFileName.csv");
Change name of file sent to client? I have a webpage that pulls information from a database, converts it to.csv format, and writes the file to the HTTPResponse. string csv = GetCSV(); Response.Clear(); Response.ContentType = "text/csv"; Response.Write(csv); This works fine, and the file is sent to the client with no pr...
TITLE: Change name of file sent to client? QUESTION: I have a webpage that pulls information from a database, converts it to.csv format, and writes the file to the HTTPResponse. string csv = GetCSV(); Response.Clear(); Response.ContentType = "text/csv"; Response.Write(csv); This works fine, and the file is sent to the...
[ "c#", "asp.net", "http" ]
8
12
4,363
4
0
2008-10-03T18:17:32.777000
2008-10-03T18:20:01.320000
168,181
301,496
Double-click double-insert resolutions?
A team member has run into an issue with an old in-house system where a user double-clicking on a link on a web page can cause two requests to be sent from the browser resulting in two database inserts of the same record in a race condition; the last one to run fails with a primary key violation. Several solutions and ...
You need to implement the Synchronizer Token pattern. How it works is: a value (the token) is generated on the server for each request. This same token must then be included in your form submission. On receipt of the request the server token and client token are compared and if they are the same you may continue to add...
Double-click double-insert resolutions? A team member has run into an issue with an old in-house system where a user double-clicking on a link on a web page can cause two requests to be sent from the browser resulting in two database inserts of the same record in a race condition; the last one to run fails with a prima...
TITLE: Double-click double-insert resolutions? QUESTION: A team member has run into an issue with an old in-house system where a user double-clicking on a link on a web page can cause two requests to be sent from the browser resulting in two database inserts of the same record in a race condition; the last one to run ...
[ "insert", "primary-key", "double-click" ]
1
1
796
5
0
2008-10-03T18:19:27.767000
2008-11-19T10:37:17.600000
168,214
169,035
Pass a PHP variable to a JavaScript variable
What is the easiest way to encode a PHP string for output to a JavaScript variable? I have a PHP string which includes quotes and newlines. I need the contents of this string to be put into a JavaScript variable. Normally, I would just construct my JavaScript in a PHP file, à la: However, this doesn't work when $myVarV...
Expanding on someone else's answer: Using json_encode() requires: PHP 5.2.0 or greater $myVarValue encoded as UTF-8 (or US-ASCII, of course) Since UTF-8 supports full Unicode, it should be safe to convert on the fly. Please note that if you use this in html attributes like onclick, you need to pass the result of json_e...
Pass a PHP variable to a JavaScript variable What is the easiest way to encode a PHP string for output to a JavaScript variable? I have a PHP string which includes quotes and newlines. I need the contents of this string to be put into a JavaScript variable. Normally, I would just construct my JavaScript in a PHP file, ...
TITLE: Pass a PHP variable to a JavaScript variable QUESTION: What is the easiest way to encode a PHP string for output to a JavaScript variable? I have a PHP string which includes quotes and newlines. I need the contents of this string to be put into a JavaScript variable. Normally, I would just construct my JavaScri...
[ "php", "javascript", "escaping", "newline" ]
403
560
345,095
14
0
2008-10-03T18:27:03.507000
2008-10-03T21:49:08.637000
168,218
3,300,950
Is it possible to have separate SQLite databases within the same Django project?
I was considering creating a separate SQLite database for certain apps on a Django project. However, I did not want to use direct SQLite access if possible. Django-style ORM access to these database would be ideal. Is this possible? Thank you.
Already supported http://docs.djangoproject.com/en/dev/topics/db/multi-db/
Is it possible to have separate SQLite databases within the same Django project? I was considering creating a separate SQLite database for certain apps on a Django project. However, I did not want to use direct SQLite access if possible. Django-style ORM access to these database would be ideal. Is this possible? Thank ...
TITLE: Is it possible to have separate SQLite databases within the same Django project? QUESTION: I was considering creating a separate SQLite database for certain apps on a Django project. However, I did not want to use direct SQLite access if possible. Django-style ORM access to these database would be ideal. Is thi...
[ "database", "django", "sqlite", "orm" ]
5
4
1,373
4
0
2008-10-03T18:27:33.070000
2010-07-21T15:25:03.353000
168,232
168,331
Unresolved External Symbol Errors switching from build library to exe or dll
I am building an application as a library, but to make sure I can get the output that I'd like, I switched it over to produce an exe. As soon as I did, I got several errors about unresolved external symbols. At first I thought that I didn't have a path set to the 3rd party library that I was referencing, so I added the...
Building a library, the linker doesn't need to resolve imported symbols. That happens only when it starts linking object files and libraries together. That's why you only started seeing the error when building an executable. Indeed, in VC2008 (and 2005, if I remember well), use the project properties -> Linker -> Input...
Unresolved External Symbol Errors switching from build library to exe or dll I am building an application as a library, but to make sure I can get the output that I'd like, I switched it over to produce an exe. As soon as I did, I got several errors about unresolved external symbols. At first I thought that I didn't ha...
TITLE: Unresolved External Symbol Errors switching from build library to exe or dll QUESTION: I am building an application as a library, but to make sure I can get the output that I'd like, I switched it over to produce an exe. As soon as I did, I got several errors about unresolved external symbols. At first I though...
[ "c++", "visual-studio-2005", "linker" ]
1
2
6,291
3
0
2008-10-03T18:30:44.997000
2008-10-03T18:50:03.943000
168,236
168,321
How can I access an IFRAME from the codebehind file in ASP.NET?
I am trying to set attributes for an IFRAME html control from the code-behind aspx.cs file. I came across a post that says you can use FindControl to find the non-asp controls using: The aspx file contains: and then the code-behind file contains: protected void Page_Load(object sender, EventArgs e) { HtmlControl conten...
If the iframe is directly on the page where the code is running, you should be able to reference it directly: contentPanel1.Attribute = value; If not (it's in a child control, or the MasterPage), you'll need a good idea of the hierarchy of the page... Or use the brute-force method of writing a recursive version of Find...
How can I access an IFRAME from the codebehind file in ASP.NET? I am trying to set attributes for an IFRAME html control from the code-behind aspx.cs file. I came across a post that says you can use FindControl to find the non-asp controls using: The aspx file contains: and then the code-behind file contains: protected...
TITLE: How can I access an IFRAME from the codebehind file in ASP.NET? QUESTION: I am trying to set attributes for an IFRAME html control from the code-behind aspx.cs file. I came across a post that says you can use FindControl to find the non-asp controls using: The aspx file contains: and then the code-behind file c...
[ "asp.net", "iframe" ]
30
12
105,614
10
0
2008-10-03T18:31:53.560000
2008-10-03T18:48:16.193000
168,240
169,495
Is it possible to connect PHP to SQL Server Compact Edition?
Is it possible to connect PHP to a SQL Server Compact Edition database? What would be the best driver? I need it for a desktop application where SQL Server Express is too heavy.
Short Answer: No. Long Answer: To my knowledge, unlike PostgreSQL / MySQL / MS-SQL, there is no native driver to connect PHP to SQL Server Compact Edition. If you want to connect to it, your best bet is to use PHP ODBC connections to talk to a ODBC Driver connected to the SQL Compact server. But its pretty much a hack,...
Is it possible to connect PHP to SQL Server Compact Edition? Is it possible to connect PHP to a SQL Server Compact Edition database? What would be the best driver? I need it for a desktop application where SQL Server Express is too heavy.
TITLE: Is it possible to connect PHP to SQL Server Compact Edition? QUESTION: Is it possible to connect PHP to a SQL Server Compact Edition database? What would be the best driver? I need it for a desktop application where SQL Server Express is too heavy. ANSWER: Short Answer: No. Long Answer: To my knowledge, unlike...
[ "php", "sql-server", "sql-server-ce" ]
5
4
6,713
5
0
2008-10-03T18:32:09.503000
2008-10-04T01:28:39.287000
168,249
168,271
How do I use an arbitrary string as a lock in C++?
Let's say I have a multithreaded C++ program that handles requests in the form of a function call to handleRequest(string key). Each call to handleRequest occurs in a separate thread, and there are an arbitrarily large number of possible values for key. I want the following behavior: Simultaneous calls to handleRequest...
You could do something similar to what you have in your question, but instead of a single global_key_map have several (probably in an array or vector) - which one is used is determined by some simple hash function on the string. That way instead of a single global lock, you spread that out over several independent ones...
How do I use an arbitrary string as a lock in C++? Let's say I have a multithreaded C++ program that handles requests in the form of a function call to handleRequest(string key). Each call to handleRequest occurs in a separate thread, and there are an arbitrarily large number of possible values for key. I want the foll...
TITLE: How do I use an arbitrary string as a lock in C++? QUESTION: Let's say I have a multithreaded C++ program that handles requests in the form of a function call to handleRequest(string key). Each call to handleRequest occurs in a separate thread, and there are an arbitrarily large number of possible values for ke...
[ "c++", "multithreading", "concurrency", "locking" ]
10
12
2,319
6
0
2008-10-03T18:34:25.363000
2008-10-03T18:38:17.573000
168,273
478,587
How do I build and install P4Python for Mac OS X?
I've been unable to build P4Python for an Intel Mac OS X 10.5.5. These are my steps: I downloaded p4python.tgz (from http://filehost.perforce.com/perforce/r07.3/tools/ ) and expanded it into "P4Python-2007.3". I downloaded p4api.tar (from http://filehost.perforce.com/perforce/r07.3/bin.macosx104x86/ ) and expanded it i...
The newer version 2008.1 will build with Python 2.4. I had posted the minor changes required to do that on my P4Python page, but they were rolled in to the official version. Robert
How do I build and install P4Python for Mac OS X? I've been unable to build P4Python for an Intel Mac OS X 10.5.5. These are my steps: I downloaded p4python.tgz (from http://filehost.perforce.com/perforce/r07.3/tools/ ) and expanded it into "P4Python-2007.3". I downloaded p4api.tar (from http://filehost.perforce.com/pe...
TITLE: How do I build and install P4Python for Mac OS X? QUESTION: I've been unable to build P4Python for an Intel Mac OS X 10.5.5. These are my steps: I downloaded p4python.tgz (from http://filehost.perforce.com/perforce/r07.3/tools/ ) and expanded it into "P4Python-2007.3". I downloaded p4api.tar (from http://fileho...
[ "python", "macos", "perforce", "p4python" ]
2
1
2,078
3
0
2008-10-03T18:38:40.083000
2009-01-26T00:18:32.783000
168,280
168,638
How do I show an embedded excel file in a WebPage?
I want to allow an Excel report to be viewed embedded in a WebPage... is there a way? I don't want to use an ActiveX, or OWC (Office Web Components), I just want to open an existing file from the internet explorer application. I don't want users to download and then open it. Using an iframe wouldn't be a problem, but m...
This has to do with the local person's browser set up and not really anything you can do on your end. If they click a link with the.xls(x) extension, the browser determines if it wants to open it itself or in a new window. Here 2 microsoft pages on how to change these settings: http://support.microsoft.com/.../how-to-c...
How do I show an embedded excel file in a WebPage? I want to allow an Excel report to be viewed embedded in a WebPage... is there a way? I don't want to use an ActiveX, or OWC (Office Web Components), I just want to open an existing file from the internet explorer application. I don't want users to download and then op...
TITLE: How do I show an embedded excel file in a WebPage? QUESTION: I want to allow an Excel report to be viewed embedded in a WebPage... is there a way? I don't want to use an ActiveX, or OWC (Office Web Components), I just want to open an existing file from the internet explorer application. I don't want users to do...
[ "asp.net", "html", "excel", "embed" ]
7
7
67,692
9
0
2008-10-03T18:39:22.063000
2008-10-03T19:59:11.933000
168,298
168,355
Will Learning C++ Help for Building Fast/No-Additional-Requirements Desktop Applications?
Will learning C++ help me build native applications with good speed? Will it help me as a programmer, and what are the other benefits? The reason why I want to learn C++ is because I'm disappointed with the UI performances of applications built on top of JVM and.NET. They feel slow, and start slow too. Of course, a rea...
If you want to build Windows applications that will run without frameworks such as.NET or virtual machines/interpreters, then your only really viable choices are going to be Visual Basic or C/C++ I've written some small Windows apps before in C++ code, and there is definitely a benefit in terms of speed and ease of dep...
Will Learning C++ Help for Building Fast/No-Additional-Requirements Desktop Applications? Will learning C++ help me build native applications with good speed? Will it help me as a programmer, and what are the other benefits? The reason why I want to learn C++ is because I'm disappointed with the UI performances of appl...
TITLE: Will Learning C++ Help for Building Fast/No-Additional-Requirements Desktop Applications? QUESTION: Will learning C++ help me build native applications with good speed? Will it help me as a programmer, and what are the other benefits? The reason why I want to learn C++ is because I'm disappointed with the UI pe...
[ "c++", "user-interface", "native" ]
6
5
1,014
9
0
2008-10-03T18:44:43.503000
2008-10-03T18:57:12.277000
168,303
168,341
How to enforce locking workstation when leaving? Is this important?
Within your organization, is every developer required to lock his workstation when leaving it? What do you see a risks when workstations are left unlocked, and how do you think such risks are important compared to "over-wire" (network hacking) security risks? What policies do you think are most efficient to enforce loc...
For me, this has become habit. On a Windows machine, pressing Windows-L is a quick way of locking the machine. The solution might be social rather than technical. Convince people that they don't want anyone else reading their email or spoofing their accounts when they step away.
How to enforce locking workstation when leaving? Is this important? Within your organization, is every developer required to lock his workstation when leaving it? What do you see a risks when workstations are left unlocked, and how do you think such risks are important compared to "over-wire" (network hacking) security...
TITLE: How to enforce locking workstation when leaving? Is this important? QUESTION: Within your organization, is every developer required to lock his workstation when leaving it? What do you see a risks when workstations are left unlocked, and how do you think such risks are important compared to "over-wire" (network...
[ "security", "corporate-policy" ]
5
5
4,693
21
0
2008-10-03T18:45:29.930000
2008-10-03T18:53:28.493000
168,317
168,365
C# .Net exe doesn't close when PC is restarted, keeping the machine from restarting
We have a SmartClient built in C# that stubornly remains open when the PC its running on is being restarted. This halts the restart process unless the user first closes the SmartClient or there is some other manual intervention. This is causing problems when the infrastructure team remotely installs new software that r...
OK, if you have access to the app, you can handle the SessionEnded event.... Microsoft.Win32.SystemEvents.SessionEnded +=new Microsoft.Win32.SessionEndedEventHandler(shutdownHandler);... private void shutdownHandler(object sender, Microsoft.Win32.SessionEndedEventArgs e) { // Do stuff }
C# .Net exe doesn't close when PC is restarted, keeping the machine from restarting We have a SmartClient built in C# that stubornly remains open when the PC its running on is being restarted. This halts the restart process unless the user first closes the SmartClient or there is some other manual intervention. This is...
TITLE: C# .Net exe doesn't close when PC is restarted, keeping the machine from restarting QUESTION: We have a SmartClient built in C# that stubornly remains open when the PC its running on is being restarted. This halts the restart process unless the user first closes the SmartClient or there is some other manual int...
[ "c#", "multithreading", "events", "smartclient", "restart" ]
5
5
1,099
6
0
2008-10-03T18:47:28.957000
2008-10-03T18:58:27.873000
168,349
188,272
how to identify the minimal set of parameters describing a data set
I have a bunch of regression test data. Each test is just a list of messages (associative arrays), mapping message field names to values. There's a lot of repetition within this data. For example test1 = [ { sender => 'client', msg => '123', arg => '900', foo => 'bar',... }, { sender => 'server', msg => '456', arg => '...
The following papers describe algortithms for discovering functional dependencies: Y. Huhtala, J. Kärkkäinen, P. Porkka, and H. Toivonen. TANE: An efficient algorithm for discovering functional and approximate dependencies. The Computer Journal, 42(2):100–111, 1999, doi:10.1093/comjnl/42.2.100. I. Savnik and P. A. Flac...
how to identify the minimal set of parameters describing a data set I have a bunch of regression test data. Each test is just a list of messages (associative arrays), mapping message field names to values. There's a lot of repetition within this data. For example test1 = [ { sender => 'client', msg => '123', arg => '90...
TITLE: how to identify the minimal set of parameters describing a data set QUESTION: I have a bunch of regression test data. Each test is just a list of messages (associative arrays), mapping message field names to values. There's a lot of repetition within this data. For example test1 = [ { sender => 'client', msg =>...
[ "algorithm" ]
6
3
430
3
0
2008-10-03T18:56:05.883000
2008-10-09T17:18:48.650000
168,374
168,506
What is the best way to partition large tables in SQL Server?
In a recent project the "lead" developer designed a database schema where "larger" tables would be split across two separate databases with a view on the main database which would union the two separate database-tables together. The main database is what the application was driven off of so these tables looked and felt...
I don't think that you are really going to gain anything by partitioning the table across multiple databases in a single server. All you have essentially done there is increased the overhead in working with the "table" in the first place by having several instances (i.e. open in two different DBs) of it under a single ...
What is the best way to partition large tables in SQL Server? In a recent project the "lead" developer designed a database schema where "larger" tables would be split across two separate databases with a view on the main database which would union the two separate database-tables together. The main database is what the...
TITLE: What is the best way to partition large tables in SQL Server? QUESTION: In a recent project the "lead" developer designed a database schema where "larger" tables would be split across two separate databases with a view on the main database which would union the two separate database-tables together. The main da...
[ "sql", "sql-server", "partitioning" ]
13
6
15,692
6
0
2008-10-03T19:00:41.083000
2008-10-03T19:30:58.603000
168,375
168,394
Visual Studio 2005 Memory Usage
I find that quite often Visual Studio memory usage will average ~150-300 MB of RAM. As a developer who very often needs to run with multiple instances of Visual Studio open, are there any performance tricks to optimize the amount of memory that VS uses? I am running VS 2005 with one add-in (TFS)
From this blog post: [...] These changes are all available from the Options dialog (Tools –> Options): Environment General: Disable “Animate environment tools” Documents: Disable “Detect when file is changed outside the environment” Keyboard: Remove the F1 key from the Help.F1Help command Help\Online: Set “When loading...
Visual Studio 2005 Memory Usage I find that quite often Visual Studio memory usage will average ~150-300 MB of RAM. As a developer who very often needs to run with multiple instances of Visual Studio open, are there any performance tricks to optimize the amount of memory that VS uses? I am running VS 2005 with one add-...
TITLE: Visual Studio 2005 Memory Usage QUESTION: I find that quite often Visual Studio memory usage will average ~150-300 MB of RAM. As a developer who very often needs to run with multiple instances of Visual Studio open, are there any performance tricks to optimize the amount of memory that VS uses? I am running VS ...
[ "visual-studio", "memory", "visual-studio-2005", "memory-management" ]
24
14
16,828
5
0
2008-10-03T19:00:51.880000
2008-10-03T19:04:08.487000
168,384
168,406
Templated delegates
I have the following piece of code pattern: void M1(string s, string v) { try { // Do some work } catch(Exception ex) { // Encapsulate and rethrow exception } } The only difference is that the return type and the number and types of parameters to the methods can vary. I want to create a generic / templated method that ...
I like the Action public static void Method(Action func) { try { func(); } catch (Exception ex) { // Encapsulate and rethrow exception throw; } } public static void testCall() { string hello = "Hello World"; // Or any delgate Method(() => Console.WriteLine(hello)); // Or Method(() => AnotherTestMethod("Hello", "Worl...
Templated delegates I have the following piece of code pattern: void M1(string s, string v) { try { // Do some work } catch(Exception ex) { // Encapsulate and rethrow exception } } The only difference is that the return type and the number and types of parameters to the methods can vary. I want to create a generic / te...
TITLE: Templated delegates QUESTION: I have the following piece of code pattern: void M1(string s, string v) { try { // Do some work } catch(Exception ex) { // Encapsulate and rethrow exception } } The only difference is that the return type and the number and types of parameters to the methods can vary. I want to cre...
[ ".net", "generics", "delegates", "template-method-pattern" ]
1
1
196
1
0
2008-10-03T19:02:10.783000
2008-10-03T19:09:38.070000
168,393
168,414
Does typeof(myType).TypeHandle use reflection?
If I wrote this code: typeof(myType).TypeHandle Would it use reflection? How much different from: Type.GetType(string).TypeHandle is it?
Well, it really depends on what you mean by "reflection" - which isn't exactly strictly defined. There are two parts to using typeof in the compiled code. The first is the use of the ldtoken which is an IL instruction described like this in the CIL spec: The ldtoken instruction pushes a RuntimeHandle for the specified ...
Does typeof(myType).TypeHandle use reflection? If I wrote this code: typeof(myType).TypeHandle Would it use reflection? How much different from: Type.GetType(string).TypeHandle is it?
TITLE: Does typeof(myType).TypeHandle use reflection? QUESTION: If I wrote this code: typeof(myType).TypeHandle Would it use reflection? How much different from: Type.GetType(string).TypeHandle is it? ANSWER: Well, it really depends on what you mean by "reflection" - which isn't exactly strictly defined. There are tw...
[ "c#" ]
5
7
1,361
1
0
2008-10-03T19:03:50.093000
2008-10-03T19:11:14.057000
168,396
168,421
Capturing method state using Reflection
Is there a way to use.NET reflection to capture the values of all parameters/local variables?
You could get at this information using the CLR debugging API though it won't be a simple couple of lines to extract it.
Capturing method state using Reflection Is there a way to use.NET reflection to capture the values of all parameters/local variables?
TITLE: Capturing method state using Reflection QUESTION: Is there a way to use.NET reflection to capture the values of all parameters/local variables? ANSWER: You could get at this information using the CLR debugging API though it won't be a simple couple of lines to extract it.
[ "c#", ".net", "reflection" ]
5
3
3,624
6
0
2008-10-03T19:04:46.397000
2008-10-03T19:12:18.643000
168,402
168,466
XML Schema XSD TotalDigits vs. MaxInclusive
I have run across an XML Schema with the following definition: However, it seems to me that totalDigits is redundant. I am somewhat new to XML Schema, and want to make sure I'm not missing something. What is the actual behavior of totalDigits vs. maxInclusive? Can totalDigits always be represented with a combination of...
can totalDigits always be represented with a combination of minInclusive and MaxInclusive? In this case, yes. As you're dealing with an integer, the value must be a whole number, so you have a finite set of values between minInclusive and maxInclusive. If you had decimal values, totalDigits would tell you how many numb...
XML Schema XSD TotalDigits vs. MaxInclusive I have run across an XML Schema with the following definition: However, it seems to me that totalDigits is redundant. I am somewhat new to XML Schema, and want to make sure I'm not missing something. What is the actual behavior of totalDigits vs. maxInclusive? Can totalDigits...
TITLE: XML Schema XSD TotalDigits vs. MaxInclusive QUESTION: I have run across an XML Schema with the following definition: However, it seems to me that totalDigits is redundant. I am somewhat new to XML Schema, and want to make sure I'm not missing something. What is the actual behavior of totalDigits vs. maxInclusiv...
[ "xml", "xsd" ]
8
8
34,200
2
0
2008-10-03T19:06:44.817000
2008-10-03T19:22:20.057000
168,408
168,509
C++ alternatives to void* pointers (that isn't templates)
It looks like I had a fundamental misunderstanding about C++:< I like the polymorphic container solution. Thank you SO, for bringing that to my attention:) So, we have a need to create a relatively generic container type object. It also happens to encapsulate some business related logic. However, we need to store essen...
Can you not have a root Container class that contains elements: template class Container { public: // You'll likely want to use shared_ptr instead. virtual void push(T *element) = 0; virtual T *pop() = 0; virtual void InvokeSomeMethodOnAllItems() = 0; }; template class List: public Container { iterator begin(); itera...
C++ alternatives to void* pointers (that isn't templates) It looks like I had a fundamental misunderstanding about C++:< I like the polymorphic container solution. Thank you SO, for bringing that to my attention:) So, we have a need to create a relatively generic container type object. It also happens to encapsulate so...
TITLE: C++ alternatives to void* pointers (that isn't templates) QUESTION: It looks like I had a fundamental misunderstanding about C++:< I like the polymorphic container solution. Thank you SO, for bringing that to my attention:) So, we have a need to create a relatively generic container type object. It also happens...
[ "c++", "templates", "pointers", "polymorphism" ]
9
4
13,004
8
0
2008-10-03T19:10:07.820000
2008-10-03T19:31:25.093000
168,409
539,024
How do you get a directory listing sorted by creation date in python?
What is the best way to get a list of all files in a directory, sorted by date [created | modified], using python, on a windows machine?
Update: to sort dirpath 's entries by modification date in Python 3: import os from pathlib import Path paths = sorted(Path(dirpath).iterdir(), key=os.path.getmtime) (put @Pygirl's answer here for greater visibility) If you already have a list of filenames files, then to sort it inplace by creation time on Windows (ma...
How do you get a directory listing sorted by creation date in python? What is the best way to get a list of all files in a directory, sorted by date [created | modified], using python, on a windows machine?
TITLE: How do you get a directory listing sorted by creation date in python? QUESTION: What is the best way to get a list of all files in a directory, sorted by date [created | modified], using python, on a windows machine? ANSWER: Update: to sort dirpath 's entries by modification date in Python 3: import os from pa...
[ "python", "windows", "directory" ]
220
189
325,619
19
0
2008-10-03T19:10:08.130000
2009-02-11T21:58:21.737000
168,415
168,418
Tcp/Ip Socket connections in .NET
For my current project, I need to request XML data over a tcp/ip socket connection. For this, I am using the TcpClient class: Dim client As New TcpClient() client.Connect(server, port) Dim stream As NetworkStream = client.GetStream() stream.Write(request) stream.Read(buffer, 0, buffer.length) // Output buffer and ret...
You create a loop for reading. Stream.Read returns int for the bytes it read so far, or 0 if the end of stream is reached. So, its like: int bytes_read = 0; while (bytes_read < buffer.Length) bytes_read += stream.Read(buffer, bytes_read, buffer.length - bytes_read); EDIT: now, the question is how you determine the size...
Tcp/Ip Socket connections in .NET For my current project, I need to request XML data over a tcp/ip socket connection. For this, I am using the TcpClient class: Dim client As New TcpClient() client.Connect(server, port) Dim stream As NetworkStream = client.GetStream() stream.Write(request) stream.Read(buffer, 0, buffer...
TITLE: Tcp/Ip Socket connections in .NET QUESTION: For my current project, I need to request XML data over a tcp/ip socket connection. For this, I am using the TcpClient class: Dim client As New TcpClient() client.Connect(server, port) Dim stream As NetworkStream = client.GetStream() stream.Write(request) stream.Read...
[ "asp.net", "sockets", "tcp" ]
4
3
5,461
4
0
2008-10-03T19:11:18.660000
2008-10-03T19:12:00.077000
168,423
178,496
Why does subversion chown/recreate files on checkin?
I have a personal wiki that I take notes on. The wiki's pages are in a subversion working copy directory, "pages", and I set their permissions to 664, owned by www-data:www-data. My username is in the "www-data" group, so I can checkin and mess with the pages manually. For a while, I had an issue because every time I r...
Set the "sticky" permissions bit. find -type d -exec chgrp www-data {} + find -type d -exec chmod g+s {} + this will encourage checkout's file creation phase to inherit the directories permissions instead of switching to the person whom last edited it. Edit: dow +s == setgid. Information left here for posterity and oth...
Why does subversion chown/recreate files on checkin? I have a personal wiki that I take notes on. The wiki's pages are in a subversion working copy directory, "pages", and I set their permissions to 664, owned by www-data:www-data. My username is in the "www-data" group, so I can checkin and mess with the pages manuall...
TITLE: Why does subversion chown/recreate files on checkin? QUESTION: I have a personal wiki that I take notes on. The wiki's pages are in a subversion working copy directory, "pages", and I set their permissions to 664, owned by www-data:www-data. My username is in the "www-data" group, so I can checkin and mess with...
[ "svn", "permissions" ]
2
3
1,420
2
0
2008-10-03T19:12:45.740000
2008-10-07T13:45:00.047000
168,426
168,545
How do I add a shortcut key to Eclipse 3.2 Java plug-in to build the current project?
One of the few annoying things about the Eclipse Java plug-in is the absence of a keyboard shortcut to build the project associated with the current resource. Anyone know how to go about it?
In the Preferences dialog box, under the General section is a dialog box called "Keys". This lets you attach key bindings to many events, including Build Project.
How do I add a shortcut key to Eclipse 3.2 Java plug-in to build the current project? One of the few annoying things about the Eclipse Java plug-in is the absence of a keyboard shortcut to build the project associated with the current resource. Anyone know how to go about it?
TITLE: How do I add a shortcut key to Eclipse 3.2 Java plug-in to build the current project? QUESTION: One of the few annoying things about the Eclipse Java plug-in is the absence of a keyboard shortcut to build the project associated with the current resource. Anyone know how to go about it? ANSWER: In the Preferenc...
[ "java", "eclipse", "eclipse-3.2" ]
19
27
14,872
3
0
2008-10-03T19:13:23.197000
2008-10-03T19:37:34.130000
168,438
168,476
RTTI on objects in Delphi
I'm trying to parse objects to XML in Delphi, so I read about calling the object's ClassInfo method to get its RTTI info. The thing is, this apparently only works for TPersistent objects. Otherwise, I have to specifically add a compiler directive {$M+} to the source code for the compiler to generate RTTI info. So I hap...
Did you put those properties and methods into the published section? Besides that, 'classical' RTTI ($TYPEINFO ON) will only get you information on properties, not on methods. You need 'extended' RTTI ($METHODINFO ON) for those. Good starting point for extended RTTI: David Glassborow on extended RTTI (who would believe...
RTTI on objects in Delphi I'm trying to parse objects to XML in Delphi, so I read about calling the object's ClassInfo method to get its RTTI info. The thing is, this apparently only works for TPersistent objects. Otherwise, I have to specifically add a compiler directive {$M+} to the source code for the compiler to ge...
TITLE: RTTI on objects in Delphi QUESTION: I'm trying to parse objects to XML in Delphi, so I read about calling the object's ClassInfo method to get its RTTI info. The thing is, this apparently only works for TPersistent objects. Otherwise, I have to specifically add a compiler directive {$M+} to the source code for ...
[ "delphi", "rtti" ]
2
7
3,197
4
0
2008-10-03T19:16:07.900000
2008-10-03T19:25:03.453000