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
176,998
177,059
What is the most important feature in Mono 2.0?
Mono 2.0 was just officially released. What single feature do you think is the most important?
Windows.Forms is definitely way up there... that might be the feature I'm most excited about. And LINQ-to-XML should be good. I'm looking forward to more LINQ providers now that the LINQ core is available!:)
What is the most important feature in Mono 2.0? Mono 2.0 was just officially released. What single feature do you think is the most important?
TITLE: What is the most important feature in Mono 2.0? QUESTION: Mono 2.0 was just officially released. What single feature do you think is the most important? ANSWER: Windows.Forms is definitely way up there... that might be the feature I'm most excited about. And LINQ-to-XML should be good. I'm looking forward to m...
[ "mono" ]
3
2
320
4
0
2008-10-07T02:19:45.593000
2008-10-07T02:46:43.170000
177,037
177,044
C++ Convert SQLVARCHAR to string
I need to convert from a SQLVARCHAR to a string data type Variable definitions as follows: string strFirstName; SQLVARCHAR rtnFirstName[50]; Want to be able to accomplish the following: if (strFirstName.empty()) strFirstName = rtnFirstName; Gives an error that the binary '=': no operator found which takes a right-hand...
What database API are you using? All the Google hits I can find for SQLVARCHAR say it's an unsigned char, so you can do something like this: strFirstName = reinterpret_cast (rtnFirstName);
C++ Convert SQLVARCHAR to string I need to convert from a SQLVARCHAR to a string data type Variable definitions as follows: string strFirstName; SQLVARCHAR rtnFirstName[50]; Want to be able to accomplish the following: if (strFirstName.empty()) strFirstName = rtnFirstName; Gives an error that the binary '=': no operat...
TITLE: C++ Convert SQLVARCHAR to string QUESTION: I need to convert from a SQLVARCHAR to a string data type Variable definitions as follows: string strFirstName; SQLVARCHAR rtnFirstName[50]; Want to be able to accomplish the following: if (strFirstName.empty()) strFirstName = rtnFirstName; Gives an error that the bin...
[ "c++", "string", "varchar" ]
1
2
1,366
1
0
2008-10-07T02:35:03.660000
2008-10-07T02:40:00.203000
177,039
177,101
C# boxing question
First, two examples: // This works int foo = 43; long lFoo = foo; // This doesn't object foo = (int)43; long? nullFoo = foo as long?; // returns null long lFoo = (long)foo; // throws InvalidCastException if (foo.GetType() == typeof(int)) Console.WriteLine("But foo is an int..."); // This gets written out Now, my guess...
object foo = (int) 43; long lFoo = ((IConvertible) foo).ToInt64(null);
C# boxing question First, two examples: // This works int foo = 43; long lFoo = foo; // This doesn't object foo = (int)43; long? nullFoo = foo as long?; // returns null long lFoo = (long)foo; // throws InvalidCastException if (foo.GetType() == typeof(int)) Console.WriteLine("But foo is an int..."); // This gets writte...
TITLE: C# boxing question QUESTION: First, two examples: // This works int foo = 43; long lFoo = foo; // This doesn't object foo = (int)43; long? nullFoo = foo as long?; // returns null long lFoo = (long)foo; // throws InvalidCastException if (foo.GetType() == typeof(int)) Console.WriteLine("But foo is an int..."); /...
[ "c#", "icomparable", "unboxing" ]
2
7
998
3
0
2008-10-07T02:36:39.320000
2008-10-07T03:08:19.553000
177,054
177,092
Is there a practical limit to the size of bit masks?
There's a common way to store multiple values in one variable, by using a bitmask. For example, if a user has read, write and execute privileges on an item, that can be converted to a single number by saying read = 4 (2^2), write = 2 (2^1), execute = 1 (2^0) and then add them together to get 7. I use this technique in ...
Off the top of my head, I'd write a set_bit and get_bit function that could take an array of bytes and a bit offset in the array, and use some bit-twiddling to set/get the appropriate bit in the array. Something like this (in C, but hopefully you get the idea): // sets the n-th bit in |bytes|. num_bytes is the number o...
Is there a practical limit to the size of bit masks? There's a common way to store multiple values in one variable, by using a bitmask. For example, if a user has read, write and execute privileges on an item, that can be converted to a single number by saying read = 4 (2^2), write = 2 (2^1), execute = 1 (2^0) and then...
TITLE: Is there a practical limit to the size of bit masks? QUESTION: There's a common way to store multiple values in one variable, by using a bitmask. For example, if a user has read, write and execute privileges on an item, that can be converted to a single number by saying read = 4 (2^2), write = 2 (2^1), execute ...
[ "sql", "bit-manipulation", "bitmask" ]
5
3
8,581
7
0
2008-10-07T02:44:48.430000
2008-10-07T03:03:48.797000
177,060
177,099
TCustomDataSet C++ Builder
I'm looking for an example of a TCustomDataSet implementation in C++ beyond the TTextDataset example that ships as an example project within C++ Builder. The TTextDataset is hard to learn from because the code is not documented very well and it only shows a single field example. I've created my own class that descends ...
I have a couple of examples. but unfortunately they are in Delphi, but you should get the idea: Example 1 Example 2 The second one goes into a bit more explanation and is one I used to base a custom dataset on that did binding to UI (In delphi).
TCustomDataSet C++ Builder I'm looking for an example of a TCustomDataSet implementation in C++ beyond the TTextDataset example that ships as an example project within C++ Builder. The TTextDataset is hard to learn from because the code is not documented very well and it only shows a single field example. I've created ...
TITLE: TCustomDataSet C++ Builder QUESTION: I'm looking for an example of a TCustomDataSet implementation in C++ beyond the TTextDataset example that ships as an example project within C++ Builder. The TTextDataset is hard to learn from because the code is not documented very well and it only shows a single field exam...
[ "c++builder", "vcl" ]
2
3
935
1
0
2008-10-07T02:48:07.487000
2008-10-07T03:06:26.827000
177,076
299,386
How to tie a dropdown list to a gridview in Sharepoint 2007?
This should be a really really simple thing, but for some reason it is just eluding me. I want a Sharepoint page which will have a drop down list that is tied to a database lookup table. When an item is selected and they click a GO button, I want it to update a gridview that is also on the page. I'm looking for a simpl...
I currently use a drop down tied to one sharepoint list to filter a dataview of another sharepoint List. The instructions are here: http://blogs.msdn.com/sharepointdesigner/archive/2007/03/05/asp-net-controls-filter-the-data-view.aspx
How to tie a dropdown list to a gridview in Sharepoint 2007? This should be a really really simple thing, but for some reason it is just eluding me. I want a Sharepoint page which will have a drop down list that is tied to a database lookup table. When an item is selected and they click a GO button, I want it to update...
TITLE: How to tie a dropdown list to a gridview in Sharepoint 2007? QUESTION: This should be a really really simple thing, but for some reason it is just eluding me. I want a Sharepoint page which will have a drop down list that is tied to a database lookup table. When an item is selected and they click a GO button, I...
[ "sharepoint", "sharepoint-designer" ]
1
2
8,172
2
0
2008-10-07T02:53:23.280000
2008-11-18T17:01:54.033000
177,094
177,137
Object database for Ruby on Rails
Is there drop-in replacement for ActiveRecord that uses some sort of Object Store? I am thinking something like Erlang's MNesia would be ideal. Update I've been investigating CouchDB and I think this is the option I am going to go with. It's a toss-up between using CouchRest and ActiveCouch. CouchRest is pretty mature,...
AciveCouch purports to be just such a library for CouchDB, which is, in fact, written in Erlang. I wouldn't say it's as mature as ActiveRecord though. That is the closest thing I know of to what you're asking for.
Object database for Ruby on Rails Is there drop-in replacement for ActiveRecord that uses some sort of Object Store? I am thinking something like Erlang's MNesia would be ideal. Update I've been investigating CouchDB and I think this is the option I am going to go with. It's a toss-up between using CouchRest and Active...
TITLE: Object database for Ruby on Rails QUESTION: Is there drop-in replacement for ActiveRecord that uses some sort of Object Store? I am thinking something like Erlang's MNesia would be ideal. Update I've been investigating CouchDB and I think this is the option I am going to go with. It's a toss-up between using Co...
[ "ruby-on-rails", "ruby", "database", "object-oriented-database" ]
14
2
4,022
5
0
2008-10-07T03:03:57.393000
2008-10-07T03:32:57.570000
177,121
177,183
Can someone give a good tutorial on WWF?
In particular, I am interested in: 1) Getting up a free environment setup to do workflows. 2) How to use existing workflow items/states and what is involved in that. Thanks!
Are you looking for a virtual lab like this one from MSDN? For some How Tos, try downloading Hands-on Labs for Windows Workflow Foundation
Can someone give a good tutorial on WWF? In particular, I am interested in: 1) Getting up a free environment setup to do workflows. 2) How to use existing workflow items/states and what is involved in that. Thanks!
TITLE: Can someone give a good tutorial on WWF? QUESTION: In particular, I am interested in: 1) Getting up a free environment setup to do workflows. 2) How to use existing workflow items/states and what is involved in that. Thanks! ANSWER: Are you looking for a virtual lab like this one from MSDN? For some How Tos, t...
[ ".net", "workflow-foundation" ]
2
3
2,537
2
0
2008-10-07T03:22:16.653000
2008-10-07T03:52:56.217000
177,133
180,467
Overriding DataGridViewTextBoxCell Paint Method
I am trying to override the DataGridViewTextBoxCell's paint method in a derived class so that I can indent the foreground text by some variable amount of pixels. I would like it if the width of the column adjusts so that its total width is the length of my cells text plus the "buffer" indent. Does anyone know of a way ...
If you are trying to auto-size the columns (depending on size of the cell contents) then you should look at Column.AutoSizeMode property and Column.DefaultCellStyle property. static const int INDENTCOEFF = 5; DataGridViewCellStyle cellStyle = new DataGridViewCellStyle(); cellStyle.Padding = new Padding(INDENTCOEFF, 5,...
Overriding DataGridViewTextBoxCell Paint Method I am trying to override the DataGridViewTextBoxCell's paint method in a derived class so that I can indent the foreground text by some variable amount of pixels. I would like it if the width of the column adjusts so that its total width is the length of my cells text plus...
TITLE: Overriding DataGridViewTextBoxCell Paint Method QUESTION: I am trying to override the DataGridViewTextBoxCell's paint method in a derived class so that I can indent the foreground text by some variable amount of pixels. I would like it if the width of the column adjusts so that its total width is the length of ...
[ "c#", "winforms" ]
3
1
4,565
3
0
2008-10-07T03:29:38.263000
2008-10-07T21:14:52.730000
177,135
284,384
Storing Crystal Reports in XML files?
I was talking to somebody a recently who mentioned it was possible to store reports created using Crystal Reports as XML files. Upon Googling this, I can't find anything suggesting that this is the case (using data stored in XML in a report, yes, but actually storing the report, the part stored by default as a.rpt file...
It is not possible to store the report template in XMLformat. XML is supported as export format of the "rendered" report only. For what purpose do you need the report template in XML format. There is a Java reporting solution called Crystal-Clear which can read the Crytsal Reports report template and save it as XML rep...
Storing Crystal Reports in XML files? I was talking to somebody a recently who mentioned it was possible to store reports created using Crystal Reports as XML files. Upon Googling this, I can't find anything suggesting that this is the case (using data stored in XML in a report, yes, but actually storing the report, th...
TITLE: Storing Crystal Reports in XML files? QUESTION: I was talking to somebody a recently who mentioned it was possible to store reports created using Crystal Reports as XML files. Upon Googling this, I can't find anything suggesting that this is the case (using data stored in XML in a report, yes, but actually stor...
[ "crystal-reports" ]
5
4
11,812
5
0
2008-10-07T03:32:09.240000
2008-11-12T15:56:12.927000
177,146
177,375
How do I get the list of open file handles by process in C#?
How do I get the list of open file handles by process id in C#? I'm interested in digging down and getting the file names as well. Looking for the programmatic equivalent of what process explorer does. Most likely this will require interop. Considering adding a bounty on this, the implementation is nasty complicated.
Ouch this is going to be hard to do from managed code. There is a sample on codeproject Most of the stuff can be done in interop, but you need a driver to get the filename cause it lives in the kernel's address space. Process Explorer embeds the driver in its resources. Getting this all hooked up from C# and supporting...
How do I get the list of open file handles by process in C#? How do I get the list of open file handles by process id in C#? I'm interested in digging down and getting the file names as well. Looking for the programmatic equivalent of what process explorer does. Most likely this will require interop. Considering adding...
TITLE: How do I get the list of open file handles by process in C#? QUESTION: How do I get the list of open file handles by process id in C#? I'm interested in digging down and getting the file names as well. Looking for the programmatic equivalent of what process explorer does. Most likely this will require interop. ...
[ "c#", ".net" ]
45
26
64,284
7
0
2008-10-07T03:37:24.127000
2008-10-07T06:23:16.290000
177,154
177,159
Creating an instance from a class name
I'm trying to create an instance of a class at run time. The classes I'm trying to create all inherit from a base class, ConfigMgrObj, and are named ConfigMgr_xxxxxx e.g. ConfigMgr_Collection. They all take a special object that I'm calling oController and a string as arguments. This is the line I'm using to do it, whe...
Are the types you're trying to instantiate actually declared within the same assembly? Passing null as the first parameter is telling Activator that the types live in the current assembly.
Creating an instance from a class name I'm trying to create an instance of a class at run time. The classes I'm trying to create all inherit from a base class, ConfigMgrObj, and are named ConfigMgr_xxxxxx e.g. ConfigMgr_Collection. They all take a special object that I'm calling oController and a string as arguments. T...
TITLE: Creating an instance from a class name QUESTION: I'm trying to create an instance of a class at run time. The classes I'm trying to create all inherit from a base class, ConfigMgrObj, and are named ConfigMgr_xxxxxx e.g. ConfigMgr_Collection. They all take a special object that I'm calling oController and a stri...
[ "c#", "reflection" ]
3
6
1,685
2
0
2008-10-07T03:40:55.680000
2008-10-07T03:44:00.057000
177,160
228,956
Skipping the 'CompressResources' build step for Xcode iPhone apps
Is it possible to set an iPhone Xcode project to skip the 'CompressResources' build step? Specifically, I want to skip the stage where it runs pngcrush on all of my.png files, many of which don't survive the experience in a form which my app can read. Edit: the version of pngcrush used creates png files which contain a...
You can add "IPHONE_OPTIMIZE_OPTIONS=-skip-PNGs" to your project settings to prevent the png mangling, but be careful with it, you might need to optimize the icon and Default.png separately then.
Skipping the 'CompressResources' build step for Xcode iPhone apps Is it possible to set an iPhone Xcode project to skip the 'CompressResources' build step? Specifically, I want to skip the stage where it runs pngcrush on all of my.png files, many of which don't survive the experience in a form which my app can read. Ed...
TITLE: Skipping the 'CompressResources' build step for Xcode iPhone apps QUESTION: Is it possible to set an iPhone Xcode project to skip the 'CompressResources' build step? Specifically, I want to skip the stage where it runs pngcrush on all of my.png files, many of which don't survive the experience in a form which m...
[ "iphone", "xcode", "image", "resources" ]
11
10
7,828
5
0
2008-10-07T03:45:37.137000
2008-10-23T08:31:20.223000
177,161
177,191
What is the most efficient way to get the first item from an associative array in JavaScript?
I need to get just the first item (actually, just the first key) off a rather large associative array in JavaScript. Here's how I'm doing it currently (using jQuery): getKey = function (data) { var firstKey; $.each(data, function (key, val) { firstKey = key; return false; }); return firstKey; }; Just guessing, but I'd ...
There isn't really a first or last element in associative arrays (i.e. objects). The only order you can hope to acquire is the order the elements were saved by the parser -- and no guarantees for consistency with that. But, if you want the first to come up, the classic manner might actually be a bit easier: function ge...
What is the most efficient way to get the first item from an associative array in JavaScript? I need to get just the first item (actually, just the first key) off a rather large associative array in JavaScript. Here's how I'm doing it currently (using jQuery): getKey = function (data) { var firstKey; $.each(data, funct...
TITLE: What is the most efficient way to get the first item from an associative array in JavaScript? QUESTION: I need to get just the first item (actually, just the first key) off a rather large associative array in JavaScript. Here's how I'm doing it currently (using jQuery): getKey = function (data) { var firstKey; ...
[ "javascript", "jquery", "arrays", "associative" ]
47
46
51,424
3
0
2008-10-07T03:45:44.313000
2008-10-07T03:55:51.627000
177,177
177,200
For what type of project is Entity Framework currently suited?
I was listening to a podcast recently that was discussing at length the short comings of Entity Framework (EF). But, their opinions may need to be taken with a grain of salt (by me), as from what I could gather: These were folks that were ORM experts. They either made their living off of ORM tools, or their hobby They ...
The Entity Framework is suitable for all applications which would benefit from having an ORM layer. Daniel Simmons post goes into detail on this. http://blogs.msdn.com/dsimmons/archive/2008/05/17/why-use-the-entity-framework.aspx Entity Framework is similar in many ways to Linq for SQL but is not tied to MS SQL Server ...
For what type of project is Entity Framework currently suited? I was listening to a podcast recently that was discussing at length the short comings of Entity Framework (EF). But, their opinions may need to be taken with a grain of salt (by me), as from what I could gather: These were folks that were ORM experts. They ...
TITLE: For what type of project is Entity Framework currently suited? QUESTION: I was listening to a podcast recently that was discussing at length the short comings of Entity Framework (EF). But, their opinions may need to be taken with a grain of salt (by me), as from what I could gather: These were folks that were ...
[ "entity-framework" ]
3
1
672
1
0
2008-10-07T03:49:22.950000
2008-10-07T04:00:50.897000
177,188
177,243
Is there a way to run an outside executable after a solution is built in Visual Studio 2008?
I'm not talking about a post build event for a project. Rather, I want to run an executable automatically after the entire solution is built. Is there a way to do a post build event for the solution?
Visual Studio 2010 and before You can do this in the Macro Editor by handling OnBuildDone. The event gives you a couple of handy properties you can check: scope (project/solution/batch) and action (build/rebuild/clean/deploy). To do what you want would be something like this (not tested, mind): Public Sub AfterBuild(sc...
Is there a way to run an outside executable after a solution is built in Visual Studio 2008? I'm not talking about a post build event for a project. Rather, I want to run an executable automatically after the entire solution is built. Is there a way to do a post build event for the solution?
TITLE: Is there a way to run an outside executable after a solution is built in Visual Studio 2008? QUESTION: I'm not talking about a post build event for a project. Rather, I want to run an executable automatically after the entire solution is built. Is there a way to do a post build event for the solution? ANSWER: ...
[ "visual-studio-2008", "build-process" ]
18
23
2,155
2
0
2008-10-07T03:54:48.553000
2008-10-07T04:35:46.787000
177,189
177,201
How to implement a single instance Java application?
Sometime I see many application such as msn, windows media player etc that are single instance applications (when user executes while application is running a new application instance will not created). In C#, I use Mutex class for this but I don't know how to do this in Java.
If I believe this article, by: having the first instance attempt to open a listening socket on the localhost interface. If it's able to open the socket, it is assumed that this is the first instance of the application to be launched. If not, the assumption is that an instance of this application is already running. The...
How to implement a single instance Java application? Sometime I see many application such as msn, windows media player etc that are single instance applications (when user executes while application is running a new application instance will not created). In C#, I use Mutex class for this but I don't know how to do thi...
TITLE: How to implement a single instance Java application? QUESTION: Sometime I see many application such as msn, windows media player etc that are single instance applications (when user executes while application is running a new application instance will not created). In C#, I use Mutex class for this but I don't ...
[ "java", "single-instance" ]
93
62
68,460
17
0
2008-10-07T03:54:57.133000
2008-10-07T04:01:38.400000
177,209
177,337
What's a good C memory allocator for embedded systems?
I have an single threaded, embedded application that allocates and deallocates lots and lots of small blocks (32-64b). The perfect scenario for a cache based allocator. And although I could TRY to write one it'll likely be a waste of time, and not as well tested and tuned as some solution that's already been on the fro...
I did some research on this very topic recently, as we had an issue with memory fragmentation. In the end we decided to stay with GNU libc's implementation, and add some application-level memory pools where necessary. There were other allocators which had better fragmentation behavior, but we weren't comfortable enough...
What's a good C memory allocator for embedded systems? I have an single threaded, embedded application that allocates and deallocates lots and lots of small blocks (32-64b). The perfect scenario for a cache based allocator. And although I could TRY to write one it'll likely be a waste of time, and not as well tested an...
TITLE: What's a good C memory allocator for embedded systems? QUESTION: I have an single threaded, embedded application that allocates and deallocates lots and lots of small blocks (32-64b). The perfect scenario for a cache based allocator. And although I could TRY to write one it'll likely be a waste of time, and not...
[ "c", "embedded", "lua", "malloc", "allocation" ]
21
8
8,356
8
0
2008-10-07T04:05:15.773000
2008-10-07T05:55:21.727000
177,228
1,627,285
What's the best way to find out the installed version of the iPhone SDK?
What is the easiest way of finding out what version of the iPhone SDK is installed on my OS X? When you log into the Apple's iPhone Developer Center, you can see the build number of the current available version of the SDK, but you have to remember if you have already downloaded that version or not. What is the easiest...
This is a cross post from this question. The best place to check which version of the iPhone SDK you have installed is to use System Profiler. Apple Menu > About this Mac > More Info... > Software > Developer Once there, you'll see version and build numbers for all of the major components of the Developer Tools. The to...
What's the best way to find out the installed version of the iPhone SDK? What is the easiest way of finding out what version of the iPhone SDK is installed on my OS X? When you log into the Apple's iPhone Developer Center, you can see the build number of the current available version of the SDK, but you have to remembe...
TITLE: What's the best way to find out the installed version of the iPhone SDK? QUESTION: What is the easiest way of finding out what version of the iPhone SDK is installed on my OS X? When you log into the Apple's iPhone Developer Center, you can see the build number of the current available version of the SDK, but y...
[ "ios", "macos" ]
3
5
5,818
4
0
2008-10-07T04:23:59.540000
2009-10-26T20:55:00.800000
177,240
177,765
How to use a function-based index on a column that contains NULLs in Oracle 10+?
Lets just say you have a table in Oracle: CREATE TABLE person ( id NUMBER PRIMARY KEY, given_names VARCHAR2(50), surname VARCHAR2(50) ); with these function-based indices: CREATE INDEX idx_person_upper_given_names ON person (UPPER(given_names)); CREATE INDEX idx_person_upper_last_name ON person (UPPER(last_name)); Now,...
The index can be used, though the optimiser may have chosen not to use it for your particular example: SQL> create table my_objects 2 as select object_id, object_name 3 from all_objects; Table created. SQL> select count(*) from my_objects; 2 / COUNT(*) ---------- 83783 SQL> alter table my_objects modify object_name...
How to use a function-based index on a column that contains NULLs in Oracle 10+? Lets just say you have a table in Oracle: CREATE TABLE person ( id NUMBER PRIMARY KEY, given_names VARCHAR2(50), surname VARCHAR2(50) ); with these function-based indices: CREATE INDEX idx_person_upper_given_names ON person (UPPER(given_na...
TITLE: How to use a function-based index on a column that contains NULLs in Oracle 10+? QUESTION: Lets just say you have a table in Oracle: CREATE TABLE person ( id NUMBER PRIMARY KEY, given_names VARCHAR2(50), surname VARCHAR2(50) ); with these function-based indices: CREATE INDEX idx_person_upper_given_names ON pers...
[ "sql", "oracle" ]
6
8
49,497
5
0
2008-10-07T04:33:41.953000
2008-10-07T09:36:25.323000
177,241
177,861
How do you store themes in the database?
I know how to load themes dynamically when they are stored locally. Is it possible to store theses themes in the database yet still apply them programmatically as described in referenced MSDN article? Also - If you do store them in the filesystem, is it possible to change the path of the App_Themes directory to a diffe...
Themes need to be in local files (App_Themes/ThemeName needs to exist). There's no concept like ThemeProvider (would be nice, but there's not). Your stylesheet(s) and skin files need to be there, images etc can be anywhere.
How do you store themes in the database? I know how to load themes dynamically when they are stored locally. Is it possible to store theses themes in the database yet still apply them programmatically as described in referenced MSDN article? Also - If you do store them in the filesystem, is it possible to change the pa...
TITLE: How do you store themes in the database? QUESTION: I know how to load themes dynamically when they are stored locally. Is it possible to store theses themes in the database yet still apply them programmatically as described in referenced MSDN article? Also - If you do store them in the filesystem, is it possibl...
[ "asp.net" ]
1
0
353
2
0
2008-10-07T04:34:06.650000
2008-10-07T10:20:16.467000
177,242
177,878
The encoding 'UTF-8' is not supported by the Java runtime
Whenever I start our Apache Felix (OSGi) based application under SUN Java ( build 1.6.0_10-rc2-b32 and other 1.6.x builds) I see the following message output on the console (usually under Ubuntu 8.4): Warning: The encoding 'UTF-8' is not supported by the Java runtime. I've seen this message display occasionally when ru...
According the documentation "Every implementation of the Java platform is required to support the following standard charsets... US-ASCII, ISO-8859-1, UTF-8, UTF-16BE, UTF-16LE, UTF-16." So I doubt that Sun have released a build without UTF-8 support. The actual error message appears to be from here, which is part of t...
The encoding 'UTF-8' is not supported by the Java runtime Whenever I start our Apache Felix (OSGi) based application under SUN Java ( build 1.6.0_10-rc2-b32 and other 1.6.x builds) I see the following message output on the console (usually under Ubuntu 8.4): Warning: The encoding 'UTF-8' is not supported by the Java ru...
TITLE: The encoding 'UTF-8' is not supported by the Java runtime QUESTION: Whenever I start our Apache Felix (OSGi) based application under SUN Java ( build 1.6.0_10-rc2-b32 and other 1.6.x builds) I see the following message output on the console (usually under Ubuntu 8.4): Warning: The encoding 'UTF-8' is not suppor...
[ "java", "linux", "unicode" ]
13
12
27,282
7
0
2008-10-07T04:34:15.870000
2008-10-07T10:29:58.460000
177,259
177,280
Why are Array.Sort() and Array.IndexOf() methods static?
Always was interested why are Array.Sort() and Array.IndexOf() methods made static and similar ArrayList.Sort() and ArrayList.IndexOf() are designed as member methods. Thank you for any ideas.
In my view Array class is basically a class representation of the fixed size arrays that we declare using [] in program (you can draw the analogy like int has it's class (structure) representation as System.Int32). Also Array class does not contain the actually array data in any instance variables but it provides just ...
Why are Array.Sort() and Array.IndexOf() methods static? Always was interested why are Array.Sort() and Array.IndexOf() methods made static and similar ArrayList.Sort() and ArrayList.IndexOf() are designed as member methods. Thank you for any ideas.
TITLE: Why are Array.Sort() and Array.IndexOf() methods static? QUESTION: Always was interested why are Array.Sort() and Array.IndexOf() methods made static and similar ArrayList.Sort() and ArrayList.IndexOf() are designed as member methods. Thank you for any ideas. ANSWER: In my view Array class is basically a class...
[ ".net", "collections", "framework-design" ]
6
5
1,840
2
0
2008-10-07T04:48:13.627000
2008-10-07T05:03:59.023000
177,271
177,278
Roulette Selection in Genetic Algorithms
Can anyone provide some pseudo code for a roulette selection function? How would I implement this: I don't really understand how to read this math notation. I never took any probability or statistics.
It's been a few years since i've done this myself, however the following pseudo code was found easily enough on google. for all members of population sum += fitness of this individual end for for all members of population probability = sum of probabilities + (fitness / sum) sum of probabilities += probability end for ...
Roulette Selection in Genetic Algorithms Can anyone provide some pseudo code for a roulette selection function? How would I implement this: I don't really understand how to read this math notation. I never took any probability or statistics.
TITLE: Roulette Selection in Genetic Algorithms QUESTION: Can anyone provide some pseudo code for a roulette selection function? How would I implement this: I don't really understand how to read this math notation. I never took any probability or statistics. ANSWER: It's been a few years since i've done this myself, ...
[ "genetic-algorithm", "evolutionary-algorithm", "roulette-wheel-selection" ]
39
40
59,738
14
0
2008-10-07T04:56:18.493000
2008-10-07T05:03:08.400000
177,275
194,038
grid controls for ASP.NET MVC?
If you are using ASP.NET MVC how are you doing grid display? Rolled your own? Got a library from somewhere? These are some of the known grid display solutions I have found for ASP.NET MVC ASP.NET MVC Flexgrid - Has nice column layout method Code based ASP.NET MVC GridView - simple, small, clean MVC Contrib - grid from ...
We have been using jqGrid on a project and have had some good luck with it. Lots of options for inline editing, etc. If that stuff isn't necessary, then we've just used a plain foreach loop like @Hrvoje.
grid controls for ASP.NET MVC? If you are using ASP.NET MVC how are you doing grid display? Rolled your own? Got a library from somewhere? These are some of the known grid display solutions I have found for ASP.NET MVC ASP.NET MVC Flexgrid - Has nice column layout method Code based ASP.NET MVC GridView - simple, small,...
TITLE: grid controls for ASP.NET MVC? QUESTION: If you are using ASP.NET MVC how are you doing grid display? Rolled your own? Got a library from somewhere? These are some of the known grid display solutions I have found for ASP.NET MVC ASP.NET MVC Flexgrid - Has nice column layout method Code based ASP.NET MVC GridVie...
[ "jquery", "asp.net-mvc", "grid" ]
280
40
156,750
12
0
2008-10-07T05:00:58.063000
2008-10-11T12:46:27.093000
177,277
177,289
How to get a list of all child nodes in a TreeView in .NET
I have a TreeView control in my WinForms.NET application that has multiple levels of childnodes that have childnodes with more childnodes, with no defined depth. When a user selects any parent node (not necessarily at the root level), how can I get a list of all the nodes beneith that parent node? For example, I starte...
Use recursion Function GetChildren(parentNode as TreeNode) as List(Of String) Dim nodes as List(Of String) = New List(Of String) GetAllChildren(parentNode, nodes) return nodes End Function Sub GetAllChildren(parentNode as TreeNode, nodes as List(Of String)) For Each childNode as TreeNode in parentNode.Nodes nodes.Add(...
How to get a list of all child nodes in a TreeView in .NET I have a TreeView control in my WinForms.NET application that has multiple levels of childnodes that have childnodes with more childnodes, with no defined depth. When a user selects any parent node (not necessarily at the root level), how can I get a list of al...
TITLE: How to get a list of all child nodes in a TreeView in .NET QUESTION: I have a TreeView control in my WinForms.NET application that has multiple levels of childnodes that have childnodes with more childnodes, with no defined depth. When a user selects any parent node (not necessarily at the root level), how can ...
[ ".net", "vb.net", "treeview", "tree-nodes" ]
16
20
85,518
10
0
2008-10-07T05:02:51.943000
2008-10-07T05:10:35.767000
177,284
177,311
SQL Absolute value across columns
I have a table that looks something like this: word big expensive smart fast dog 9 -10 -20 4 professor 2 4 40 -7 ferrari 7 50 0 48 alaska 10 0 1 0 gnat -3 0 0 0 The + and - values are associated with the word, so professor is smart and dog is not smart. Alaska is big, as a proportion of the total value associated with...
abs value fartherest from zero: select max(abs(mycol)) from mytbl will be zero if the value is negative: select n+abs(mycol) from zzz where abs(mycol)=(select max(abs(mycol)) from mytbl);
SQL Absolute value across columns I have a table that looks something like this: word big expensive smart fast dog 9 -10 -20 4 professor 2 4 40 -7 ferrari 7 50 0 48 alaska 10 0 1 0 gnat -3 0 0 0 The + and - values are associated with the word, so professor is smart and dog is not smart. Alaska is big, as a proportion ...
TITLE: SQL Absolute value across columns QUESTION: I have a table that looks something like this: word big expensive smart fast dog 9 -10 -20 4 professor 2 4 40 -7 ferrari 7 50 0 48 alaska 10 0 1 0 gnat -3 0 0 0 The + and - values are associated with the word, so professor is smart and dog is not smart. Alaska is big...
[ "python", "mysql", "sql", "oracle", "postgresql" ]
2
3
5,103
5
0
2008-10-07T05:06:31
2008-10-07T05:28:46.633000
177,287
177,312
Alert boxes in Python?
Is it possible to produce an alert similar to JavaScript's alert("message") in python, with an application running as a daemon. This will be run in Windows, Most likely XP but 2000 and Vista are also very real possibilities. Update: This is intended to run in the background and alert the user when certain conditions ar...
what about this: import win32api win32api.MessageBox(0, 'hello', 'title') Additionally: win32api.MessageBox(0, 'hello', 'title', 0x00001000) will make the box appear on top of other windows, for urgent messages. See MessageBox function for other options.
Alert boxes in Python? Is it possible to produce an alert similar to JavaScript's alert("message") in python, with an application running as a daemon. This will be run in Windows, Most likely XP but 2000 and Vista are also very real possibilities. Update: This is intended to run in the background and alert the user whe...
TITLE: Alert boxes in Python? QUESTION: Is it possible to produce an alert similar to JavaScript's alert("message") in python, with an application running as a daemon. This will be run in Windows, Most likely XP but 2000 and Vista are also very real possibilities. Update: This is intended to run in the background and ...
[ "python", "alerts" ]
41
73
133,070
6
0
2008-10-07T05:08:36.410000
2008-10-07T05:29:15.430000
177,323
177,328
How to read the last row with SQL Server
What is the most efficient way to read the last row with SQL Server? The table is indexed on a unique key -- the "bottom" key values represent the last row.
If you're using MS SQL, you can try: SELECT TOP 1 * FROM table_Name ORDER BY unique_column DESC
How to read the last row with SQL Server What is the most efficient way to read the last row with SQL Server? The table is indexed on a unique key -- the "bottom" key values represent the last row.
TITLE: How to read the last row with SQL Server QUESTION: What is the most efficient way to read the last row with SQL Server? The table is indexed on a unique key -- the "bottom" key values represent the last row. ANSWER: If you're using MS SQL, you can try: SELECT TOP 1 * FROM table_Name ORDER BY unique_column DESC
[ "sql", "sql-server" ]
111
206
447,091
18
0
2008-10-07T05:34:39.790000
2008-10-07T05:37:56.367000
177,324
177,342
What are some of the major shifts in thinking required to become a good Rich Internet Application (RIA) developer?
I've been experimenting with Adobe Flex recently. Being a long-time server-side web app developer, I'm faced with difficulties that I last experienced when I dabbled in Java Swing development a long time ago. It mainly revolves around the flow of control between my code and the framework's code. Most things are asynchr...
There's two models I'm seeing in the market right now: Blended UI. The server is still involved in the UI construction effort, but a lot of it is offloaded to javascript. This is how a lot of the javascript toolkits work (except dojo, extjs,...). Separated concerns. The server is treated as a data storage and synchroni...
What are some of the major shifts in thinking required to become a good Rich Internet Application (RIA) developer? I've been experimenting with Adobe Flex recently. Being a long-time server-side web app developer, I'm faced with difficulties that I last experienced when I dabbled in Java Swing development a long time a...
TITLE: What are some of the major shifts in thinking required to become a good Rich Internet Application (RIA) developer? QUESTION: I've been experimenting with Adobe Flex recently. Being a long-time server-side web app developer, I'm faced with difficulties that I last experienced when I dabbled in Java Swing develop...
[ "java", ".net", "desktop", "ria" ]
1
2
309
2
0
2008-10-07T05:35:51.877000
2008-10-07T05:57:28.870000
177,353
177,364
.NET - Find all references of property assignment
I am using VB.NET. In Visual Studio, if I right-click a property name and click "Find All References", it searches for all instances of the property being used. However, a property is always used either for assignment (Set method) or retrieval (Get method). Is there any way of searching for only one of these uses? e.g....
Use the compiler to turn what you want to find into errors. Remove the setter to find all the places were it was going to be used.
.NET - Find all references of property assignment I am using VB.NET. In Visual Studio, if I right-click a property name and click "Find All References", it searches for all instances of the property being used. However, a property is always used either for assignment (Set method) or retrieval (Get method). Is there any...
TITLE: .NET - Find all references of property assignment QUESTION: I am using VB.NET. In Visual Studio, if I right-click a property name and click "Find All References", it searches for all instances of the property being used. However, a property is always used either for assignment (Set method) or retrieval (Get met...
[ "vb.net", "search", "ide", "properties" ]
6
8
1,843
4
0
2008-10-07T06:06:16.603000
2008-10-07T06:14:28.023000
177,363
177,367
Hash of a string to be of specific length
Is there a way to generate a hash of a string so that the hash itself would be of specific length? I've got a function that generates 41-byte hashes (SHA-1), but I need it to be 33-bytes max (because of certain hardware limitations). If I truncate the 41-byte hash to 33, I'd probably (certainly!) lost the uniqueness. O...
The way hashes are calculated that's unfortunately not possible. To limit the hash length to 33 bytes, you will have to cut it. You could xor the first and last 33 bytes, as that might keep more of the information. But even with 33 bytes you don't have that big a chance of a collision. md5: http://www.md5hashing.com/c+...
Hash of a string to be of specific length Is there a way to generate a hash of a string so that the hash itself would be of specific length? I've got a function that generates 41-byte hashes (SHA-1), but I need it to be 33-bytes max (because of certain hardware limitations). If I truncate the 41-byte hash to 33, I'd pr...
TITLE: Hash of a string to be of specific length QUESTION: Is there a way to generate a hash of a string so that the hash itself would be of specific length? I've got a function that generates 41-byte hashes (SHA-1), but I need it to be 33-bytes max (because of certain hardware limitations). If I truncate the 41-byte ...
[ "c++", "algorithm", "hash" ]
6
5
12,571
9
0
2008-10-07T06:13:35.013000
2008-10-07T06:17:55.020000
177,373
177,390
How do I sort a generic list?
I have a generic list... public List ApprovalEvents The ApprovalEventDto has public class ApprovalEventDto { public string Event { get; set; } public DateTime EventDate { get; set; } } How do I sort the list by the event date?
You can use List.Sort() as follows: ApprovalEvents.Sort((lhs, rhs) => (lhs.EventDate.CompareTo(rhs.EventDate)));
How do I sort a generic list? I have a generic list... public List ApprovalEvents The ApprovalEventDto has public class ApprovalEventDto { public string Event { get; set; } public DateTime EventDate { get; set; } } How do I sort the list by the event date?
TITLE: How do I sort a generic list? QUESTION: I have a generic list... public List ApprovalEvents The ApprovalEventDto has public class ApprovalEventDto { public string Event { get; set; } public DateTime EventDate { get; set; } } How do I sort the list by the event date? ANSWER: You can use List.Sort() as follows: ...
[ "c#", "generics" ]
4
13
1,274
7
0
2008-10-07T06:22:42.267000
2008-10-07T06:31:06.320000
177,389
177,411
Testing socket connection in Python
This question will expand on: Best way to open a socket in Python When opening a socket how can I test to see if it has been established, and that it did not timeout, or generally fail. Edit: I tried this: try: s.connect((address, '80')) except: alert('failed' + address, 'down') but the alert function is called even wh...
It seems that you catch not the exception you wanna catch out there:) if the s is a socket.socket() object, then the right way to call.connect would be: import socket s = socket.socket() address = '127.0.0.1' port = 80 # port number is a number, not string try: s.connect((address, port)) # originally, it was # except E...
Testing socket connection in Python This question will expand on: Best way to open a socket in Python When opening a socket how can I test to see if it has been established, and that it did not timeout, or generally fail. Edit: I tried this: try: s.connect((address, '80')) except: alert('failed' + address, 'down') but ...
TITLE: Testing socket connection in Python QUESTION: This question will expand on: Best way to open a socket in Python When opening a socket how can I test to see if it has been established, and that it did not timeout, or generally fail. Edit: I tried this: try: s.connect((address, '80')) except: alert('failed' + add...
[ "python", "sockets" ]
36
47
132,066
4
0
2008-10-07T06:30:19.863000
2008-10-07T06:46:53.403000
177,393
177,402
What is the correct way to initialize a very large struct?
In our code we used to have something like this: *(controller->bigstruct) = ( struct bigstruct ){ 0 }; This used to work great, and then we upgraded versions of GCC and suddenly started seeing stack overflows. Looking at the assembly, the old GCC code (2.x) was basically doing this: memset(controller->bigstruct, 0, siz...
memset is the way to go. You do not have many alternatives. Do something like: #define InitStruct(var, type) type var; memset(&var, 0, sizeof(type)) So that you only have to: InitStruct(st, BigStruct); And then use st as usual... I do not get how "0" is not a valid "0" type for a struct. The only way to "mass initializ...
What is the correct way to initialize a very large struct? In our code we used to have something like this: *(controller->bigstruct) = ( struct bigstruct ){ 0 }; This used to work great, and then we upgraded versions of GCC and suddenly started seeing stack overflows. Looking at the assembly, the old GCC code (2.x) was...
TITLE: What is the correct way to initialize a very large struct? QUESTION: In our code we used to have something like this: *(controller->bigstruct) = ( struct bigstruct ){ 0 }; This used to work great, and then we upgraded versions of GCC and suddenly started seeing stack overflows. Looking at the assembly, the old ...
[ "c", "struct" ]
22
21
20,710
6
0
2008-10-07T06:32:01.140000
2008-10-07T06:38:52.607000
177,422
177,568
NHibernate mapping to another object NOT on the ID
Ok, NHibernate question here. I have two objects that I would like to map to each other. I have the "Vendor" and the "Township"... now the two should be linked by zip code, NOT ID. I have done this many times btw objects using id's but never something like this. The issue I am having it that the ZipCodes while stored a...
This has been fixed! I needed the property-ref property in the Vendor.xml file for the many to one relationship. Thanks!
NHibernate mapping to another object NOT on the ID Ok, NHibernate question here. I have two objects that I would like to map to each other. I have the "Vendor" and the "Township"... now the two should be linked by zip code, NOT ID. I have done this many times btw objects using id's but never something like this. The is...
TITLE: NHibernate mapping to another object NOT on the ID QUESTION: Ok, NHibernate question here. I have two objects that I would like to map to each other. I have the "Vendor" and the "Township"... now the two should be linked by zip code, NOT ID. I have done this many times btw objects using id's but never something...
[ "c#", ".net", "xml", "nhibernate" ]
2
2
1,112
1
0
2008-10-07T06:54:20.547000
2008-10-07T08:18:13.843000
177,437
177,451
What does 'const static' mean in C and C++?
const static int foo = 42; I saw this in some code here on StackOverflow and I couldn't figure out what it does. Then I saw some confused answers on other forums. My best guess is that it's used in C to hide the constant foo from other modules. Is this correct? If so, why would anyone use it in a C++ context where you ...
It has uses in both C and C++. As you guessed, the static part limits its scope to that compilation unit. It also provides for static initialization. const just tells the compiler to not let anybody modify it. This variable is either put in the data or bss segment depending on the architecture, and might be in memory m...
What does 'const static' mean in C and C++? const static int foo = 42; I saw this in some code here on StackOverflow and I couldn't figure out what it does. Then I saw some confused answers on other forums. My best guess is that it's used in C to hide the constant foo from other modules. Is this correct? If so, why wou...
TITLE: What does 'const static' mean in C and C++? QUESTION: const static int foo = 42; I saw this in some code here on StackOverflow and I couldn't figure out what it does. Then I saw some confused answers on other forums. My best guess is that it's used in C to hide the constant foo from other modules. Is this corre...
[ "c++", "c" ]
153
134
263,216
12
0
2008-10-07T06:59:39.837000
2008-10-07T07:05:40.870000
177,442
177,473
Remove manifest permissions in Vista
I have been developing a C# windows form application in XP. It all works just fine. But in Vista it was not able to write the log or scoreboard file to the hard drive. I found out that I needed a manifest file to allow the popup to ask it to be run as admin. This all worked well and I am very pleased. My problem is I d...
The manifest doesn't give any specific permission to the module. The manifest is inserted as a resource in the module and is then. If you need to repeat the test - just open the file with a resource editor and delete and MANIFEST resources you can see.
Remove manifest permissions in Vista I have been developing a C# windows form application in XP. It all works just fine. But in Vista it was not able to write the log or scoreboard file to the hard drive. I found out that I needed a manifest file to allow the popup to ask it to be run as admin. This all worked well and...
TITLE: Remove manifest permissions in Vista QUESTION: I have been developing a C# windows form application in XP. It all works just fine. But in Vista it was not able to write the log or scoreboard file to the hard drive. I found out that I needed a manifest file to allow the popup to ask it to be run as admin. This a...
[ "windows-vista", "manifest", "permissions", "administrator" ]
0
1
1,974
1
0
2008-10-07T07:01:14.857000
2008-10-07T07:20:15.067000
177,446
177,472
Physical path of usercontrol (asp.net)
I have a problem regarding getting the path of a user control. The scenario is as follows: In a aspx i have multiple user controls. In one of those user conrtols i need to loop through the other user controls and get the physical path of them. Is there any easy way to do this?
List GetUserControlPathsForPage { var list = new List (); return getUserControlPathsRecursive(Page.Controls, list); } void getPathsRecursive(ControlCollection controls, List list) { foreach (var c in controls) { var uc = c as UserControl; if (uc!= null) { list.Add(Server.MapPath(uc.AppRelativeVirtualPath)); } getPaths...
Physical path of usercontrol (asp.net) I have a problem regarding getting the path of a user control. The scenario is as follows: In a aspx i have multiple user controls. In one of those user conrtols i need to loop through the other user controls and get the physical path of them. Is there any easy way to do this?
TITLE: Physical path of usercontrol (asp.net) QUESTION: I have a problem regarding getting the path of a user control. The scenario is as follows: In a aspx i have multiple user controls. In one of those user conrtols i need to loop through the other user controls and get the physical path of them. Is there any easy w...
[ ".net", "asp.net", "path" ]
0
3
3,560
1
0
2008-10-07T07:03:44.460000
2008-10-07T07:18:52.153000
177,459
177,493
Design pattern for converting one type of tree structure to another?
I have a sort of tree structure that represent a hierarchy of layers in a map, divided by types of layers and categories. Each node can be a different class for different types of layers (but all nodes implement a common interface). I need to convert that class to an ASP.NET TreeView control. Each node in the input tre...
A Visitor perhaps, to walk input tree and build corresponding UI tree?
Design pattern for converting one type of tree structure to another? I have a sort of tree structure that represent a hierarchy of layers in a map, divided by types of layers and categories. Each node can be a different class for different types of layers (but all nodes implement a common interface). I need to convert ...
TITLE: Design pattern for converting one type of tree structure to another? QUESTION: I have a sort of tree structure that represent a hierarchy of layers in a map, divided by types of layers and categories. Each node can be a different class for different types of layers (but all nodes implement a common interface). ...
[ "design-patterns", "treeview", "tree" ]
0
2
3,575
5
0
2008-10-07T07:08:39.757000
2008-10-07T07:34:58.797000
177,464
177,487
How to apply the MVC pattern to GUI development
I am primary a web developer but I do have a very good understanding of C++ and C#. However, recently I have writing a GUI application and I have started to get lost in how to handle the relationship between my controller and view logic. In PHP it was very easy - and I could write my own MVC pattern with my eyes closed...
If I was you I would expose events from an interface of your view. This would allow you to make the controller central to the entire interaction. The controller would load first and instantiate the view, I would use dependency injection so that you don't create a dependency on the view itself but only on the interface....
How to apply the MVC pattern to GUI development I am primary a web developer but I do have a very good understanding of C++ and C#. However, recently I have writing a GUI application and I have started to get lost in how to handle the relationship between my controller and view logic. In PHP it was very easy - and I co...
TITLE: How to apply the MVC pattern to GUI development QUESTION: I am primary a web developer but I do have a very good understanding of C++ and C#. However, recently I have writing a GUI application and I have started to get lost in how to handle the relationship between my controller and view logic. In PHP it was ve...
[ "c#", "c++", "model-view-controller", "user-interface", "design-patterns" ]
8
6
6,717
5
0
2008-10-07T07:11:43.413000
2008-10-07T07:31:05.047000
177,468
177,557
Qt and no moc_*.cpp file
I'm developing a simple Qt 4 app and making my own dialog. I subclassed QDialog, inserted the Q_OBJECT macro in the class declaration block, and... I get [Linker error] undefined reference to `vtable for MyDialog' and there is no moc_MyDialog.cpp generated by the moc compiler. I am using Qt 4.1.3 on Windows XP and ming...
The undefined reference to "vtable for MyDialog" is caused because there is no moc file. Most c++ compilers create the vtable definition in the object file containing the first virtual function. When subclassing a qt object and using the Q_OBJECT macro, this will be in the moc*.cpp file. Therefore, this error means tha...
Qt and no moc_*.cpp file I'm developing a simple Qt 4 app and making my own dialog. I subclassed QDialog, inserted the Q_OBJECT macro in the class declaration block, and... I get [Linker error] undefined reference to `vtable for MyDialog' and there is no moc_MyDialog.cpp generated by the moc compiler. I am using Qt 4.1...
TITLE: Qt and no moc_*.cpp file QUESTION: I'm developing a simple Qt 4 app and making my own dialog. I subclassed QDialog, inserted the Q_OBJECT macro in the class declaration block, and... I get [Linker error] undefined reference to `vtable for MyDialog' and there is no moc_MyDialog.cpp generated by the moc compiler....
[ "c++", "qt", "qt4" ]
17
36
29,659
6
0
2008-10-07T07:16:10.833000
2008-10-07T08:13:15.287000
177,479
177,481
Prevent site data from being crawled and ripped
I'm looking into building a content site with possibly thousands of different entries, accessible by index and by search. What are the measures I can take to prevent malicious crawlers from ripping off all the data from my site? I'm less worried about SEO, although I wouldn't want to block legitimate crawlers all toget...
Any site that it visible by human eyes is, in theory, potentially rippable. If you're going to even try to be accessible then this, by definition, must be the case (how else will speaking browsers be able to deliver your content if it isn't machine readable). Your best bet is to look into watermarking your content, so ...
Prevent site data from being crawled and ripped I'm looking into building a content site with possibly thousands of different entries, accessible by index and by search. What are the measures I can take to prevent malicious crawlers from ripping off all the data from my site? I'm less worried about SEO, although I woul...
TITLE: Prevent site data from being crawled and ripped QUESTION: I'm looking into building a content site with possibly thousands of different entries, accessible by index and by search. What are the measures I can take to prevent malicious crawlers from ripping off all the data from my site? I'm less worried about SE...
[ "web-crawler", "spam-prevention" ]
20
20
21,231
12
0
2008-10-07T07:23:10.147000
2008-10-07T07:25:49.457000
177,492
180,855
Keeping filters in Django Admin
What I would like to achive is: I go to admin site, apply some filters to the list of objects I click and object edit, edit, edit, hit 'Save' Site takes me to the list of objects... unfiltered. I'd like to have the filter from step 1 remembered and applied. Is there an easy way to do it?
Unfortunately there's no easy way to do this. The filtering does not seem to be saved in any session variable. Clicking back twice is the normal method, but it can be unweildy and annoying if you've just changed an object so that it should no longer be shown using your filter. If it's just a one-off, click back twice o...
Keeping filters in Django Admin What I would like to achive is: I go to admin site, apply some filters to the list of objects I click and object edit, edit, edit, hit 'Save' Site takes me to the list of objects... unfiltered. I'd like to have the filter from step 1 remembered and applied. Is there an easy way to do it?
TITLE: Keeping filters in Django Admin QUESTION: What I would like to achive is: I go to admin site, apply some filters to the list of objects I click and object edit, edit, edit, hit 'Save' Site takes me to the list of objects... unfiltered. I'd like to have the filter from step 1 remembered and applied. Is there an ...
[ "python", "django", "django-admin" ]
6
4
4,555
7
0
2008-10-07T07:33:58.813000
2008-10-07T23:41:28.567000
177,496
177,518
Refer to a Javascript File in Jquery
I have a simple HTML. I am using the JQuery for AJAX purpose. Now, I want to put my javascript function in a separate javascript file. What is the syntax for this? For example, currently my script section in the HTML is something like this: But I want to put the function function() { $("#SubmitForm").click(Submit()); }...
Move the scripts.js script tag down beneath the jQuery script tag and then just move the whole of that inline script block into scripts.js. As jQuery will already have been instantiated by the time scripts.js loads, the Javascript will just execute inline in the same way that it does at the moment. Also on a separate n...
Refer to a Javascript File in Jquery I have a simple HTML. I am using the JQuery for AJAX purpose. Now, I want to put my javascript function in a separate javascript file. What is the syntax for this? For example, currently my script section in the HTML is something like this: But I want to put the function function() ...
TITLE: Refer to a Javascript File in Jquery QUESTION: I have a simple HTML. I am using the JQuery for AJAX purpose. Now, I want to put my javascript function in a separate javascript file. What is the syntax for this? For example, currently my script section in the HTML is something like this: But I want to put the fu...
[ "jquery" ]
3
5
4,953
4
0
2008-10-07T07:35:59.543000
2008-10-07T07:45:05.720000
177,506
177,512
Why do I see a double variable initialized to some value like 21.4 as 21.399999618530273?
double r = 11.631; double theta = 21.4; In the debugger, these are shown as 11.631000000000000 and 21.399999618530273. How can I avoid this?
These accuracy problems are due to the internal representation of floating point numbers and there's not much you can do to avoid it. By the way, printing these values at run-time often still leads to the correct results, at least using modern C++ compilers. For most operations, this isn't much of an issue.
Why do I see a double variable initialized to some value like 21.4 as 21.399999618530273? double r = 11.631; double theta = 21.4; In the debugger, these are shown as 11.631000000000000 and 21.399999618530273. How can I avoid this?
TITLE: Why do I see a double variable initialized to some value like 21.4 as 21.399999618530273? QUESTION: double r = 11.631; double theta = 21.4; In the debugger, these are shown as 11.631000000000000 and 21.399999618530273. How can I avoid this? ANSWER: These accuracy problems are due to the internal representation...
[ "floating-point", "precision" ]
49
57
20,140
14
0
2008-10-07T07:40:17.490000
2008-10-07T07:42:32.183000
177,513
179,440
RMI or Web Services sample application
Does anyone know of a sample distributed application (.NET or J2EE) using RMI or Web Services?
Here's a simple solution: BEA Weblogic has a sample web application called MedRec that I've been using for a while. This sample comes with a.NET client built in called CSharpClient that connects to MedRec via Web Services. I was thrilled that I didn't need to install anything else. In Weblogic 10 the client can be foun...
RMI or Web Services sample application Does anyone know of a sample distributed application (.NET or J2EE) using RMI or Web Services?
TITLE: RMI or Web Services sample application QUESTION: Does anyone know of a sample distributed application (.NET or J2EE) using RMI or Web Services? ANSWER: Here's a simple solution: BEA Weblogic has a sample web application called MedRec that I've been using for a while. This sample comes with a.NET client built i...
[ "java", ".net", "web-services" ]
0
0
2,493
4
0
2008-10-07T07:43:00.467000
2008-10-07T17:03:35.937000
177,514
177,581
Good XMPP Java Libraries for server side?
I was hoping to implement a simple XMPP server in Java. What I need is a library which can parse and understand xmpp requests from a client. I have looked at Smack (mentioned below) and JSO. Smack appears to be client only so while it might help parsing packets it doesn't know how to respond to clients. Is JSO maintain...
http://xmpp.org/xmpp-software/libraries/ has a list of software libraries for XMPP. Here is an outdated snapshot of it: ActionScript as3xmpp C iksemel libstrophe Loudmouth C++ gloox Iris oajabber C# /.NET / Mono agsXMPP SDK jabber-net Erlang Jabberlang Flash XIFF Haskell hsxmpp Java Echomine Feridian Jabber Stream Obje...
Good XMPP Java Libraries for server side? I was hoping to implement a simple XMPP server in Java. What I need is a library which can parse and understand xmpp requests from a client. I have looked at Smack (mentioned below) and JSO. Smack appears to be client only so while it might help parsing packets it doesn't know ...
TITLE: Good XMPP Java Libraries for server side? QUESTION: I was hoping to implement a simple XMPP server in Java. What I need is a library which can parse and understand xmpp requests from a client. I have looked at Smack (mentioned below) and JSO. Smack appears to be client only so while it might help parsing packet...
[ "java", "xmpp" ]
63
51
50,319
10
0
2008-10-07T07:43:22.010000
2008-10-07T08:23:40.900000
177,520
190,016
What are the alternatives to using Expand in a LINQ to ADO.net Data Service Query?
I am wondering if there are any alternatives to using the Expand key word when performing an LINQ to ADO.net Data Services query. The expand method does get me the data I am interested in, but it requires me to know all of the sub-objects that I am going to be working with in advance. My absolute preference would be th...
Loading sub-objects via ADO.net Data Services seem to have two choices: Eager Loading Accomplished by.Expand("[MemberVariableName]") on the LINQ to Data Services example var me = (from m in ctx.Member.Expand("MailingAddress") where m.MemberID == 10000 select m).First(); MessageBox.Show(me.MailingAddress.Street); Lazy L...
What are the alternatives to using Expand in a LINQ to ADO.net Data Service Query? I am wondering if there are any alternatives to using the Expand key word when performing an LINQ to ADO.net Data Services query. The expand method does get me the data I am interested in, but it requires me to know all of the sub-object...
TITLE: What are the alternatives to using Expand in a LINQ to ADO.net Data Service Query? QUESTION: I am wondering if there are any alternatives to using the Expand key word when performing an LINQ to ADO.net Data Services query. The expand method does get me the data I am interested in, but it requires me to know all...
[ "linq", "entity-framework", "lazy-loading", "wcf-data-services" ]
5
9
8,692
2
0
2008-10-07T07:45:28.713000
2008-10-10T03:27:33.630000
177,532
177,565
Where should I begin with HDLs?
I am a self-taught embedded developer. I mostly use AVRs programmed in C and ASM, but I have dabbled with other systems. I am looking to move onto more complex devices like CPLDs and FPGAs, but I have no idea where to start. So my one and a half questions are: Do you prefer VHDL or Verilog and why? What is a good way f...
Buy a cheap starter kit from Xilinx or Altera (the two big FPGA players). A Xilinx Spartan3 starter kit is $200. I personally prefer VHDL. It is strongly typed and has more advanced features than Verilog. VHDL is more popular in Europe and Verilog is dominating in the US. Buy a book (e.g. Peter Ashendens The Designers ...
Where should I begin with HDLs? I am a self-taught embedded developer. I mostly use AVRs programmed in C and ASM, but I have dabbled with other systems. I am looking to move onto more complex devices like CPLDs and FPGAs, but I have no idea where to start. So my one and a half questions are: Do you prefer VHDL or Veril...
TITLE: Where should I begin with HDLs? QUESTION: I am a self-taught embedded developer. I mostly use AVRs programmed in C and ASM, but I have dabbled with other systems. I am looking to move onto more complex devices like CPLDs and FPGAs, but I have no idea where to start. So my one and a half questions are: Do you pr...
[ "embedded", "verilog", "vhdl", "hdl" ]
4
7
1,084
10
0
2008-10-07T07:57:46.987000
2008-10-07T08:16:41.257000
177,536
178,182
A way to prevent a mobile browser from downloading and displaying images
Is there a simple way to prevent browser from downloading and displaying images, best would be via some magic style tag or javasctipe. The thing is, I'd like to tweak the company's website a bit to be more usable via mobile devices. The company is a gaming one, there's like 5MBs of images on it's main page (and those c...
You can use htaccess to redirect image requests made from mobile browser users. I haven't tested this but it should work: RewriteCond %{HTTP_USER_AGENT} (nokia¦symbian¦iphone¦blackberry) [NC] RewriteCond %{REQUEST_URI}!^/images/$ RewriteRule (.*) /blank.jpg [L] This code redirects all requests made to files in image fo...
A way to prevent a mobile browser from downloading and displaying images Is there a simple way to prevent browser from downloading and displaying images, best would be via some magic style tag or javasctipe. The thing is, I'd like to tweak the company's website a bit to be more usable via mobile devices. The company is...
TITLE: A way to prevent a mobile browser from downloading and displaying images QUESTION: Is there a simple way to prevent browser from downloading and displaying images, best would be via some magic style tag or javasctipe. The thing is, I'd like to tweak the company's website a bit to be more usable via mobile devic...
[ "javascript", "http-headers", "mobile-website" ]
0
4
3,925
4
0
2008-10-07T07:59:46.657000
2008-10-07T12:17:32.410000
177,538
177,561
Any chances to imitate times() Ruby method in C#?
Every time I need to do something N times inside an algorithm using C# I write this code for (int i = 0; i < N; i++) {... } Studying Ruby I have learned about method times() which can be used with the same semantics like this N.times do... end Code fragment in C# looks more complex and we should declare useless variabl...
A slightly briefer version of cvk's answer: public static class Extensions { public static void Times(this int count, Action action) { for (int i=0; i < count; i++) { action(); } } public static void Times(this int count, Action action) { for (int i=0; i < count; i++) { action(i); } } } Use: 5.Times(() => Console.Writ...
Any chances to imitate times() Ruby method in C#? Every time I need to do something N times inside an algorithm using C# I write this code for (int i = 0; i < N; i++) {... } Studying Ruby I have learned about method times() which can be used with the same semantics like this N.times do... end Code fragment in C# looks ...
TITLE: Any chances to imitate times() Ruby method in C#? QUESTION: Every time I need to do something N times inside an algorithm using C# I write this code for (int i = 0; i < N; i++) {... } Studying Ruby I have learned about method times() which can be used with the same semantics like this N.times do... end Code fra...
[ "c#", "ruby", "language-features", "cycle" ]
29
51
3,453
4
0
2008-10-07T08:01:17.997000
2008-10-07T08:15:04.240000
177,550
177,585
How do I estimate SQL Server index sizes
While estimating straight row and table sizes are fairly simple math, we find it challenging to guess just how much space each index will occupy (for a given table size). What areas can we learn to calculate a better estimate and growth rate for indexes?
An index leaf has a preamble identifying the data page (7 bytes plus some directory information for variable length columns, if any) plus a copy of the key value (s) which will be the same size as the table data for those columns. There's one for each row in the table. The higher up levels of the index are much smaller...
How do I estimate SQL Server index sizes While estimating straight row and table sizes are fairly simple math, we find it challenging to guess just how much space each index will occupy (for a given table size). What areas can we learn to calculate a better estimate and growth rate for indexes?
TITLE: How do I estimate SQL Server index sizes QUESTION: While estimating straight row and table sizes are fairly simple math, we find it challenging to guess just how much space each index will occupy (for a given table size). What areas can we learn to calculate a better estimate and growth rate for indexes? ANSWE...
[ "sql-server", "indexing", "capacity-planning" ]
4
6
7,562
2
0
2008-10-07T08:09:41.613000
2008-10-07T08:24:59.460000
177,559
180,715
Getting rid of the evil delay caused by ShellExecute
This is something that's been bothering me a while and there just has to be a solution to this. Every time I call ShellExecute to open an external file (be it a document, executable or a URL) this causes a very long lockup in my program before ShellExecute spawns the new process and returns. Does anyone know how to sol...
Are you multithreaded? I've seen issues with opening files with ShellExecute. Not executables, but files associated an application - usually MS Office. Applications that used DDE to open their files did some of broadcast of a message to all threads in all (well, I don't know if it was all...) programs. Since I wasn't p...
Getting rid of the evil delay caused by ShellExecute This is something that's been bothering me a while and there just has to be a solution to this. Every time I call ShellExecute to open an external file (be it a document, executable or a URL) this causes a very long lockup in my program before ShellExecute spawns the...
TITLE: Getting rid of the evil delay caused by ShellExecute QUESTION: This is something that's been bothering me a while and there just has to be a solution to this. Every time I call ShellExecute to open an external file (be it a document, executable or a URL) this causes a very long lockup in my program before Shell...
[ "c++", "winapi", "shellexecute" ]
5
3
2,956
3
0
2008-10-07T08:13:55.007000
2008-10-07T22:39:29.597000
177,560
177,580
SecurityException thrown when app starts from remote folder
I have an app written in C# that lies on a network share. When I run it from a local drive, everything works fine. When I start it from the remote share, calls like try { System.Reflection.Assembly.GetExecutingAssembly(); System.IO.Directory.GetCurrentDirectory(); } throw a SecurityException 'Request failed'. What caus...
This is due to CAS; code started from the local machine has much more trust than code in the intranet, which in turn has more trust that code from the internet. IIRC, with the latest SP (3.5SP1?) if you have mapped the share (i.e. as F:) it is trusted; otherwise you will need to either: a: apply a caspol change to all ...
SecurityException thrown when app starts from remote folder I have an app written in C# that lies on a network share. When I run it from a local drive, everything works fine. When I start it from the remote share, calls like try { System.Reflection.Assembly.GetExecutingAssembly(); System.IO.Directory.GetCurrentDirector...
TITLE: SecurityException thrown when app starts from remote folder QUESTION: I have an app written in C# that lies on a network share. When I run it from a local drive, everything works fine. When I start it from the remote share, calls like try { System.Reflection.Assembly.GetExecutingAssembly(); System.IO.Directory....
[ ".net", "security" ]
3
5
1,193
3
0
2008-10-07T08:15:03.473000
2008-10-07T08:22:39.043000
177,569
177,601
Why does Eclipse code completion not work on some projects?
I have Eclipse 3.3.2 with PDT doing PHP development. All projects that I create, even SVN projects have code completion. Now I just opened another SVN project and it has no code completion or PHP templates (CTRL-space does nothing in that project). However, I can open the other projects and code completion all work in ...
Maybe Eclipse doesn't understand the project has a "PHP nature". Try comparing the.project file on both projects to look for differences. It should contain something like: org.eclipse.php.core.PHPNature The.project file will be in your workspace under the project directories.
Why does Eclipse code completion not work on some projects? I have Eclipse 3.3.2 with PDT doing PHP development. All projects that I create, even SVN projects have code completion. Now I just opened another SVN project and it has no code completion or PHP templates (CTRL-space does nothing in that project). However, I ...
TITLE: Why does Eclipse code completion not work on some projects? QUESTION: I have Eclipse 3.3.2 with PDT doing PHP development. All projects that I create, even SVN projects have code completion. Now I just opened another SVN project and it has no code completion or PHP templates (CTRL-space does nothing in that pro...
[ "php", "eclipse", "eclipse-pdt", "eclipse-3.3" ]
24
43
40,506
17
0
2008-10-07T08:18:52.360000
2008-10-07T08:29:17.033000
177,588
177,718
Running an exe from windows service that interacts the the user's desktop
I've created a windows service in C# and Windows Server 2003. I would like my service to be able to run an exe file that is Windows forms application. When I start the service - it runs the other application but I cannot see it. When I open Task Manager - i can see that the application is running but I just cannot see ...
Showing UI from a Windows service is very problematic because the service may be running on a different desktop from the user (and on Vista/Server 2008 will in fact always run on a different desktop). The easiest solution is to run the UI not directly from the service but from an application running on the user's deskt...
Running an exe from windows service that interacts the the user's desktop I've created a windows service in C# and Windows Server 2003. I would like my service to be able to run an exe file that is Windows forms application. When I start the service - it runs the other application but I cannot see it. When I open Task ...
TITLE: Running an exe from windows service that interacts the the user's desktop QUESTION: I've created a windows service in C# and Windows Server 2003. I would like my service to be able to run an exe file that is Windows forms application. When I start the service - it runs the other application but I cannot see it....
[ "windows-services" ]
0
5
5,072
1
0
2008-10-07T08:25:35.623000
2008-10-07T09:14:06.337000
177,611
178,237
Is it possible to automate the creation of a inno setup package with ant?
I am creating an Eclipse RCP application. I am following Joel's advice in the following article "Daily Builds are your friend": http://www.joelonsoftware.com/articles/fog0000000023.html So, I've written a nice build script that creates an Eclipse RCP product and that runs unit tests on the code. All results are then di...
sure its easy, Inno project is a plain text file so you can even edit setupper script easily by ant, however I would recommend creating a separate small include file by your script. You can have store there "variables" such as version+build number that you show in begin of setup. put this line to your setupper: #includ...
Is it possible to automate the creation of a inno setup package with ant? I am creating an Eclipse RCP application. I am following Joel's advice in the following article "Daily Builds are your friend": http://www.joelonsoftware.com/articles/fog0000000023.html So, I've written a nice build script that creates an Eclipse...
TITLE: Is it possible to automate the creation of a inno setup package with ant? QUESTION: I am creating an Eclipse RCP application. I am following Joel's advice in the following article "Daily Builds are your friend": http://www.joelonsoftware.com/articles/fog0000000023.html So, I've written a nice build script that ...
[ "java", "eclipse", "inno-setup", "rcp" ]
4
7
6,753
2
0
2008-10-07T08:30:48.467000
2008-10-07T12:36:38.190000
177,613
177,794
ActiveRecord Association caching Date value in conditions clause
My Account model has the following two associations: has_many:expenses,:order => 'expenses.dated_on DESC',:dependent =>:destroy has_many:recent_expenses,:class_name => 'Expense',:conditions => "expenses.dated_on <= '#{Date.today}'",:order => 'dated_on DESC',:limit => 5 In one of my views I'm rendering recent expenses ...
Rails is building the query when loaded and then will re-use that query every time you call @account.recent_expenses which is exactly what you're experiencing. If you're using Rails 2.1 you can use named_scope to achieve what you're looking for. in your Expense model, put the following: named_scope:recent, lambda { {:c...
ActiveRecord Association caching Date value in conditions clause My Account model has the following two associations: has_many:expenses,:order => 'expenses.dated_on DESC',:dependent =>:destroy has_many:recent_expenses,:class_name => 'Expense',:conditions => "expenses.dated_on <= '#{Date.today}'",:order => 'dated_on DE...
TITLE: ActiveRecord Association caching Date value in conditions clause QUESTION: My Account model has the following two associations: has_many:expenses,:order => 'expenses.dated_on DESC',:dependent =>:destroy has_many:recent_expenses,:class_name => 'Expense',:conditions => "expenses.dated_on <= '#{Date.today}'",:ord...
[ "ruby-on-rails" ]
2
6
934
3
0
2008-10-07T08:30:58.653000
2008-10-07T09:48:46.187000
177,628
177,661
Domain Specific Languages (DSL) and Domain Driven Design (DDD)
What is the differences and similarities between Domain Specific Languages (DSL) and Domain Driven Design (DDD)?
Domain Driven Design (DDD) is a way of thinking and communicating about the problems and its solutions. Domain Specific Language (DSL) is a way of writing code. They're similar because they both start with the word "domain". That's it, I guess.:-)
Domain Specific Languages (DSL) and Domain Driven Design (DDD) What is the differences and similarities between Domain Specific Languages (DSL) and Domain Driven Design (DDD)?
TITLE: Domain Specific Languages (DSL) and Domain Driven Design (DDD) QUESTION: What is the differences and similarities between Domain Specific Languages (DSL) and Domain Driven Design (DDD)? ANSWER: Domain Driven Design (DDD) is a way of thinking and communicating about the problems and its solutions. Domain Specif...
[ "c#", ".net", "domain-driven-design", "dsl" ]
12
12
4,840
10
0
2008-10-07T08:37:33.383000
2008-10-07T08:50:54.977000
177,638
177,647
What are the code convention for parameters/return values (collections)
I had a little discussion with a friend about the usage of collections in return/input values of a method. He told me that we have to use - the most derived type for return values. - the least derived type for input parameters. So, it means that, for example, a method has to get a ReadOnlyCollection as parameter, and a...
Regarding input parameters, it's generally more flexible to use the least specific type. For example, if all your method is going to do is enumerate the items in a collection passed as an argument, it's more flexible to accept IEnumerable. For example, consider a method "ProcessCustomers" that accepts a parameter that ...
What are the code convention for parameters/return values (collections) I had a little discussion with a friend about the usage of collections in return/input values of a method. He told me that we have to use - the most derived type for return values. - the least derived type for input parameters. So, it means that, f...
TITLE: What are the code convention for parameters/return values (collections) QUESTION: I had a little discussion with a friend about the usage of collections in return/input values of a method. He told me that we have to use - the most derived type for return values. - the least derived type for input parameters. So...
[ "c#" ]
1
8
521
3
0
2008-10-07T08:41:18.163000
2008-10-07T08:46:43.380000
177,640
177,646
Lock / Prevent edit of source files on Linux using C++
How can I programmatically lock/unlock, or otherwise prevent/enable editing, a source file on Linux using C++. I want to be able to lock source file so that if I open it in an editor it will not allow me to save back to the same source file. I am thinking of maybe changing the permissions to read-only (and change it ba...
Try man fchmod: NAME chmod, fchmod - change permissions of a file SYNOPSIS #include #include int chmod(const char *path, mode_t mode); int fchmod(int fildes, mode_t mode);
Lock / Prevent edit of source files on Linux using C++ How can I programmatically lock/unlock, or otherwise prevent/enable editing, a source file on Linux using C++. I want to be able to lock source file so that if I open it in an editor it will not allow me to save back to the same source file. I am thinking of maybe ...
TITLE: Lock / Prevent edit of source files on Linux using C++ QUESTION: How can I programmatically lock/unlock, or otherwise prevent/enable editing, a source file on Linux using C++. I want to be able to lock source file so that if I open it in an editor it will not allow me to save back to the same source file. I am ...
[ "c++", "linux", "file-locking" ]
1
5
1,874
3
0
2008-10-07T08:43:14.057000
2008-10-07T08:45:50.870000
177,644
177,665
Swapping the hand holding the mouse : do you have a better idea?
Spending thousand of hours in front of my computer, ergonomics became quickly a main issue. For the monitor or the keyboard, technical solutions exist. But for the mouse, I never get used to the trackball and putting a little pillow under my wrist made me feel uncomfortable. So I started to swap the hand that holds the...
Yeah I had that problem too for a while. The first thing I did was modify my chair so I had a flat area where I could put a mouse and rest my arm on the padded arm wrest. Now I have an L shaped desk, and can rest my whole arm on the desk ( from elbow to hand anyway ). I found that it makes a big difference over just wr...
Swapping the hand holding the mouse : do you have a better idea? Spending thousand of hours in front of my computer, ergonomics became quickly a main issue. For the monitor or the keyboard, technical solutions exist. But for the mouse, I never get used to the trackball and putting a little pillow under my wrist made me...
TITLE: Swapping the hand holding the mouse : do you have a better idea? QUESTION: Spending thousand of hours in front of my computer, ergonomics became quickly a main issue. For the monitor or the keyboard, technical solutions exist. But for the mouse, I never get used to the trackball and putting a little pillow unde...
[ "mouse", "ergonomics" ]
1
2
1,041
6
0
2008-10-07T08:44:50.950000
2008-10-07T08:52:21.933000
177,673
178,024
Html.TextBox conditional attribute with ASP.NET MVC Preview 5
I have a strongly-typed MVC View Control which is responsible for the UI where users can create and edit Client items. I'd like them to be able to define the ClientId on creation, but not edit, and this to be reflected in the UI. To this end, I have the following line: <%= Html.TextBox("Client.ClientId", ViewData.Model...
Tough problem... However, if you want to define only the readonly attribute, you can do it like this: <%= Html.TextBox("Client.ClientId", ViewData.Model.ClientId, ViewData.Model.ClientId!= null && ViewData.Model.ClientId.Length > 0? new { @readonly = "readonly" }: null) %> If you want to define more attributes then you...
Html.TextBox conditional attribute with ASP.NET MVC Preview 5 I have a strongly-typed MVC View Control which is responsible for the UI where users can create and edit Client items. I'd like them to be able to define the ClientId on creation, but not edit, and this to be reflected in the UI. To this end, I have the foll...
TITLE: Html.TextBox conditional attribute with ASP.NET MVC Preview 5 QUESTION: I have a strongly-typed MVC View Control which is responsible for the UI where users can create and edit Client items. I'd like them to be able to define the ClientId on creation, but not edit, and this to be reflected in the UI. To this en...
[ "asp.net-mvc", "attributes", "html-helper", "readonly" ]
30
38
52,668
8
0
2008-10-07T08:54:24.800000
2008-10-07T11:29:53.753000
177,675
177,692
Could you recommend an unstructured data indexing software?
I am collecting logs from several custom made applications. Each application has it's own log format. What I'm looking for is a central tool which would allow me to search through all of my logs. This means the tool would have to be able to define a different regex (or alike) for each log file (marking where a record b...
You can try Lucene. It is free. It is written in Java, and it allows full-text search over large amount of data. It is not a complete application, but rather a library, so you have to write code that uses it to index and to search your logs. You may have to define different document types or at least different indexing...
Could you recommend an unstructured data indexing software? I am collecting logs from several custom made applications. Each application has it's own log format. What I'm looking for is a central tool which would allow me to search through all of my logs. This means the tool would have to be able to define a different ...
TITLE: Could you recommend an unstructured data indexing software? QUESTION: I am collecting logs from several custom made applications. Each application has it's own log format. What I'm looking for is a central tool which would allow me to search through all of my logs. This means the tool would have to be able to d...
[ "search", "indexing" ]
3
3
1,597
3
0
2008-10-07T08:54:31.570000
2008-10-07T09:00:50.823000
177,677
177,793
How to convert a number to a bytearray in bit endian order
I am trying to uncompress some data created in VB6 using the zlib API. I have read this is possible with the qUncompress function: http://doc.trolltech.com/4.4/qbytearray.html#qUncompress I have read the data in from QDataStream via readRawBytes into a char array, which I then converted to a QByteArray for decompressio...
I haven't used VB6 in ages, so I hope this is approximately correct. I think that vb6 used () for array indexing. If I got anything wrong, please let me know. Looking at the qUncompress docs, you should have put your data in your QByteArray starting at byte 5 (I'm going to assume that you left the array index base set ...
How to convert a number to a bytearray in bit endian order I am trying to uncompress some data created in VB6 using the zlib API. I have read this is possible with the qUncompress function: http://doc.trolltech.com/4.4/qbytearray.html#qUncompress I have read the data in from QDataStream via readRawBytes into a char arr...
TITLE: How to convert a number to a bytearray in bit endian order QUESTION: I am trying to uncompress some data created in VB6 using the zlib API. I have read this is possible with the qUncompress function: http://doc.trolltech.com/4.4/qbytearray.html#qUncompress I have read the data in from QDataStream via readRawByt...
[ "c++", "qt", "vb6", "compression", "endianness" ]
5
2
5,052
6
0
2008-10-07T08:55:02.940000
2008-10-07T09:48:37.700000
177,678
1,874,562
SQL server 2005 Connection Error: Cannot generate SSPI context
Provide Used: Microsoft OLE DB Provider for SQL Server. Can anyone help me with this.. I was trying to connect with LLBLgen
This MSDN blog page has some useful on this... http://blogs.msdn.com/sql_protocols/archive/2006/12/02/understanding-kerberos-and-ntlm-authentication-in-sql-server-connections.aspx
SQL server 2005 Connection Error: Cannot generate SSPI context Provide Used: Microsoft OLE DB Provider for SQL Server. Can anyone help me with this.. I was trying to connect with LLBLgen
TITLE: SQL server 2005 Connection Error: Cannot generate SSPI context QUESTION: Provide Used: Microsoft OLE DB Provider for SQL Server. Can anyone help me with this.. I was trying to connect with LLBLgen ANSWER: This MSDN blog page has some useful on this... http://blogs.msdn.com/sql_protocols/archive/2006/12/02/unde...
[ "sql-server" ]
4
2
22,765
10
0
2008-10-07T08:55:04.643000
2009-12-09T15:17:08.783000
177,719
177,724
Case-insensitive search
I'm trying to get a case-insensitive search with two strings in JavaScript working. Normally it would be like this: var string="Stackoverflow is the BEST"; var result= string.search(/best/i); alert(result); The /i flag would be for case-insensitive. But I need to search for a second string; without the flag it works pe...
Yeah, use.match, rather than.search. The result from the.match call will return the actual string that was matched itself, but it can still be used as a boolean value. var string = "Stackoverflow is the BEST"; var result = string.match(/best/i); // result == 'BEST'; if (result){ alert('Matched'); } Using a regular exp...
Case-insensitive search I'm trying to get a case-insensitive search with two strings in JavaScript working. Normally it would be like this: var string="Stackoverflow is the BEST"; var result= string.search(/best/i); alert(result); The /i flag would be for case-insensitive. But I need to search for a second string; with...
TITLE: Case-insensitive search QUESTION: I'm trying to get a case-insensitive search with two strings in JavaScript working. Normally it would be like this: var string="Stackoverflow is the BEST"; var result= string.search(/best/i); alert(result); The /i flag would be for case-insensitive. But I need to search for a s...
[ "javascript", "search", "string-comparison", "case-insensitive" ]
293
397
336,308
12
0
2008-10-07T09:14:07.787000
2008-10-07T09:16:21.230000
177,725
178,099
Reading the dynamically changed value of an HtmlInputHidden in ASP.NET
I got a simple page with a HtmlInputHidden field. I use a javascript to update that value and when posting back the page i want to read the value of that HtmlInputHidden field. The Value property of that HtmlInputHidden field is on postback the default value (the value it had when the page got created, not the value re...
The input field needs to be within a form. Also make sure ViewState is enabled.
Reading the dynamically changed value of an HtmlInputHidden in ASP.NET I got a simple page with a HtmlInputHidden field. I use a javascript to update that value and when posting back the page i want to read the value of that HtmlInputHidden field. The Value property of that HtmlInputHidden field is on postback the defa...
TITLE: Reading the dynamically changed value of an HtmlInputHidden in ASP.NET QUESTION: I got a simple page with a HtmlInputHidden field. I use a javascript to update that value and when posting back the page i want to read the value of that HtmlInputHidden field. The Value property of that HtmlInputHidden field is on...
[ "asp.net", "javascript", "controls" ]
0
3
2,176
2
0
2008-10-07T09:16:31.510000
2008-10-07T11:50:47.003000
177,727
177,846
Don't display HTML code and entities in dropdownlists
When I add or é to a text value of a listitem, it display the code of the HTML entity instead of the result (a space or é). I can add "physical" non-breaking spaces or special chars, but I would like to avoid that if possible. Sometimes the data stored in database is encoded, and I don't want to always process data bef...
ListItems are automatically HtmlEncoded. You can HtmlDecode the list items before hand, so when they are HtmlEncoded you get the proper characters: DropDownList1.DataSource = new List { Server.HtmlDecode("A…"), Server.HtmlDecode("B C") }; DropDownList1.DataBind();
Don't display HTML code and entities in dropdownlists When I add or é to a text value of a listitem, it display the code of the HTML entity instead of the result (a space or é). I can add "physical" non-breaking spaces or special chars, but I would like to avoid that if possible. Sometimes the data stored in database i...
TITLE: Don't display HTML code and entities in dropdownlists QUESTION: When I add or é to a text value of a listitem, it display the code of the HTML entity instead of the result (a space or é). I can add "physical" non-breaking spaces or special chars, but I would like to avoid that if possible. Sometimes the data st...
[ "asp.net" ]
1
6
2,133
5
0
2008-10-07T09:17:03.927000
2008-10-07T10:12:01.273000
177,750
177,754
LINQ to XML gets no data with schema set
I am trying to get some XML data with LINQ, but running into a problem. I am using a schema, which is set in the attribute xmlns... There are many CarForSale elements. When the schema is set and I do this... XElement doc = XElement.Load(HttpContext.Current.Server.MapPath("App_Data/XML/CarsForSale.xml")); var cars2 = f...
You need to prepend the namespace: var ns = "http://schemas.sharplogic.net/CarSales.xsd"; var cars2 = from d in doc.Descendants(ns + "CarForSale") select d; otherwise search by local name: var cars2 = from d in doc.Descendants() where d.Name.LocalName == "CarForSale" select d;
LINQ to XML gets no data with schema set I am trying to get some XML data with LINQ, but running into a problem. I am using a schema, which is set in the attribute xmlns... There are many CarForSale elements. When the schema is set and I do this... XElement doc = XElement.Load(HttpContext.Current.Server.MapPath("App_Da...
TITLE: LINQ to XML gets no data with schema set QUESTION: I am trying to get some XML data with LINQ, but running into a problem. I am using a schema, which is set in the attribute xmlns... There are many CarForSale elements. When the schema is set and I do this... XElement doc = XElement.Load(HttpContext.Current.Serv...
[ "xml", "linq", "linq-to-xml" ]
4
7
2,763
2
0
2008-10-07T09:28:00.427000
2008-10-07T09:30:07.380000
177,752
177,785
'CONTINUE' keyword in Oracle 10g PL/SQL
I'm migrating a TSQL stored procedure to PL/SQL and have encountered a problem - the lack of a CONTINUE keyword in Oracle 10g. I've read that Oracle 11g has this as a new feature, but upgrading is not an option unfortunately. Is there any alternative to CONTINUE in 10g? I don't believe it's practical to restructure the...
You can simulate a continue using goto and labels. DECLARE done BOOLEAN; BEGIN FOR i IN 1..50 LOOP IF done THEN GOTO end_loop; END IF; < > -- not allowed unless an executable statement follows NULL; -- add NULL statement to avoid error END LOOP; -- raises an error without the previous NULL END;
'CONTINUE' keyword in Oracle 10g PL/SQL I'm migrating a TSQL stored procedure to PL/SQL and have encountered a problem - the lack of a CONTINUE keyword in Oracle 10g. I've read that Oracle 11g has this as a new feature, but upgrading is not an option unfortunately. Is there any alternative to CONTINUE in 10g? I don't b...
TITLE: 'CONTINUE' keyword in Oracle 10g PL/SQL QUESTION: I'm migrating a TSQL stored procedure to PL/SQL and have encountered a problem - the lack of a CONTINUE keyword in Oracle 10g. I've read that Oracle 11g has this as a new feature, but upgrading is not an option unfortunately. Is there any alternative to CONTINUE...
[ "oracle", "continue" ]
42
60
99,565
9
0
2008-10-07T09:28:43.047000
2008-10-07T09:44:26.477000
177,761
177,789
A guide to moving from Visual Studio to Eclipse
Is there guide out there that will help me, A.Net developer whose been using Visual studio for some time, get to grips with Eclipse? Even just a quick guide to eclipse. Has anyone else made the transition, and if so how did you cope. Any Tips?
Not sure if it will help you, but Eric Sink ran a nice four part series some time ago on his move from VS to Eclipse: From C# to Java - Part 1 From C# to Java - Part 2 From C# to Java - Part 3 From C# to Java - Part 4
A guide to moving from Visual Studio to Eclipse Is there guide out there that will help me, A.Net developer whose been using Visual studio for some time, get to grips with Eclipse? Even just a quick guide to eclipse. Has anyone else made the transition, and if so how did you cope. Any Tips?
TITLE: A guide to moving from Visual Studio to Eclipse QUESTION: Is there guide out there that will help me, A.Net developer whose been using Visual studio for some time, get to grips with Eclipse? Even just a quick guide to eclipse. Has anyone else made the transition, and if so how did you cope. Any Tips? ANSWER: N...
[ "visual-studio", "eclipse" ]
4
7
1,202
3
0
2008-10-07T09:35:19.537000
2008-10-07T09:45:55.303000
177,762
177,893
Boolean 'NOT' in T-SQL not working on 'bit' datatype?
Trying to perform a single boolean NOT operation, it appears that under MS SQL Server 2005, the following block does not work DECLARE @MyBoolean bit; SET @MyBoolean = 0; SET @MyBoolean = NOT @MyBoolean; SELECT @MyBoolean; Instead, I am getting more successful with DECLARE @MyBoolean bit; SET @MyBoolean = 0; SET @MyBool...
Use the ~ operator: DECLARE @MyBoolean bit SET @MyBoolean = 0 SET @MyBoolean = ~@MyBoolean SELECT @MyBoolean
Boolean 'NOT' in T-SQL not working on 'bit' datatype? Trying to perform a single boolean NOT operation, it appears that under MS SQL Server 2005, the following block does not work DECLARE @MyBoolean bit; SET @MyBoolean = 0; SET @MyBoolean = NOT @MyBoolean; SELECT @MyBoolean; Instead, I am getting more successful with D...
TITLE: Boolean 'NOT' in T-SQL not working on 'bit' datatype? QUESTION: Trying to perform a single boolean NOT operation, it appears that under MS SQL Server 2005, the following block does not work DECLARE @MyBoolean bit; SET @MyBoolean = 0; SET @MyBoolean = NOT @MyBoolean; SELECT @MyBoolean; Instead, I am getting more...
[ "sql", "sql-server", "t-sql", "boolean-operations" ]
87
165
92,430
7
0
2008-10-07T09:35:24.827000
2008-10-07T10:37:58.663000
177,764
177,805
Does a software architect have a role in agile, esp. Scrum?
I'm reading the book "The Software Architect's Profession" by Marc and Laura Sewell ( Amazon link ) and it got me wondering whether a software architect is a part of the old non-agile BDUF approach. Is there a place for software architects in an agile approach? I'm especially interested in Scrum. BTW I currently am the...
Sure. Remember - agile isn't a 'bring me a rock' approach. There are still requirements, still a design and still a need for a solid architecture. When you are building a product or product line and employing Scrum or some other agile approach to managing your project, one of the key ideas is developing a short iterati...
Does a software architect have a role in agile, esp. Scrum? I'm reading the book "The Software Architect's Profession" by Marc and Laura Sewell ( Amazon link ) and it got me wondering whether a software architect is a part of the old non-agile BDUF approach. Is there a place for software architects in an agile approach...
TITLE: Does a software architect have a role in agile, esp. Scrum? QUESTION: I'm reading the book "The Software Architect's Profession" by Marc and Laura Sewell ( Amazon link ) and it got me wondering whether a software architect is a part of the old non-agile BDUF approach. Is there a place for software architects in...
[ "architecture", "agile", "scrum" ]
23
11
13,409
15
0
2008-10-07T09:36:10.020000
2008-10-07T09:52:03.623000
177,778
178,178
How do I set the background color of a widget like combobox or double spin box?
I am trying to set the background color for a double spin box, and I am not sure what function I should use. I saw some function called SetBackgroundRole which accepts a Qt::ColorRole, but I am not sure how to use this one as well. Kindly let me know, what's the simple way to change the background color of a QComboBox ...
Using a QPalette isn't guaranteed to work for all styles, because style authors are restricted by the different platforms' guidelines and by the native theme engine. To make sure your background color will be correct, I would suggest to use the Qt Style Sheet. Here is what I did to change the background color of a QCom...
How do I set the background color of a widget like combobox or double spin box? I am trying to set the background color for a double spin box, and I am not sure what function I should use. I saw some function called SetBackgroundRole which accepts a Qt::ColorRole, but I am not sure how to use this one as well. Kindly l...
TITLE: How do I set the background color of a widget like combobox or double spin box? QUESTION: I am trying to set the background color for a double spin box, and I am not sure what function I should use. I saw some function called SetBackgroundRole which accepts a Qt::ColorRole, but I am not sure how to use this one...
[ "qt", "qcombobox", "qspinbox" ]
39
42
95,460
9
0
2008-10-07T09:41:28.293000
2008-10-07T12:16:46.577000
177,814
177,823
Does .Net do clever connection management like PHP?
During an ASP.NET page load I'm opening and closing multiple System.Data.SqlClient.SqlConnections inside multiple controls contained in the page. I thought it would be a good idea instead to create a "pool" of connections and when opening a connection check to see if the connection string matches that of an open connec...
Connection pooling is an essential feature of ADO.NET. Read this MSDN article or some of the other resources available on the net, like this blog post
Does .Net do clever connection management like PHP? During an ASP.NET page load I'm opening and closing multiple System.Data.SqlClient.SqlConnections inside multiple controls contained in the page. I thought it would be a good idea instead to create a "pool" of connections and when opening a connection check to see if ...
TITLE: Does .Net do clever connection management like PHP? QUESTION: During an ASP.NET page load I'm opening and closing multiple System.Data.SqlClient.SqlConnections inside multiple controls contained in the page. I thought it would be a good idea instead to create a "pool" of connections and when opening a connectio...
[ "php", "asp.net", "sqlconnection" ]
0
3
348
2
0
2008-10-07T09:57:21.833000
2008-10-07T10:01:05.897000
177,815
178,271
POST multiple parameters
I am changing a GET to a POST. Currently I have.jsp?id=a,b,c,d. When changing this to a post I am still sitting the id parameter a,b,c,d. This is not working for me. Can I submit a comma separated list to a post parameter?
Am I wrong or most of the answers are beside the point? To answer precisely your question, yes, you can submit a comma separated list to a POST parameter. To be honest, I just did a quick try with a PHP script, but I don't see why Java would behave differently. One point with POST requests is precisely that you have mu...
POST multiple parameters I am changing a GET to a POST. Currently I have.jsp?id=a,b,c,d. When changing this to a post I am still sitting the id parameter a,b,c,d. This is not working for me. Can I submit a comma separated list to a post parameter?
TITLE: POST multiple parameters QUESTION: I am changing a GET to a POST. Currently I have.jsp?id=a,b,c,d. When changing this to a post I am still sitting the id parameter a,b,c,d. This is not working for me. Can I submit a comma separated list to a post parameter? ANSWER: Am I wrong or most of the answers are beside ...
[ "html", "http", "jsp", "post" ]
13
15
108,212
7
0
2008-10-07T09:57:42.130000
2008-10-07T12:46:55.407000
177,826
177,834
When developing a website with visual studio, how do I improve the build time?
I have a lot of classes in the App_Code directory could this be a problem? Would it build faster if it was in a separate library? Any other tips?
There's a decent article here. Items listed there are: Do not disable batch compilation Leverage Server-side Compilation Move App_Code files into a separate class library project Check for conflicting dependencies Turn off AutoToolboxPopulate in the Windows Forms Designer options. Disable validation for HTML editing
When developing a website with visual studio, how do I improve the build time? I have a lot of classes in the App_Code directory could this be a problem? Would it build faster if it was in a separate library? Any other tips?
TITLE: When developing a website with visual studio, how do I improve the build time? QUESTION: I have a lot of classes in the App_Code directory could this be a problem? Would it build faster if it was in a separate library? Any other tips? ANSWER: There's a decent article here. Items listed there are: Do not disabl...
[ "asp.net", "visual-studio", "build" ]
2
3
217
2
0
2008-10-07T10:02:09.670000
2008-10-07T10:05:50.757000
177,835
177,851
Get random data using Generics
One of our unit tests is to populate properties within our business objects with random data. These properties are of different intrinsic types and therefore we would like to use the power of generics to return data of the type you pass in. Something along the lines of: public static T GetData () How would you go about...
It depends on what data you want to randomize, because the way or the algorithm you want to use is totally different depending on the type. For example: // Random int Random r = new Random(); return r.Next(); // Random Guid return Guid.NewGuid();... So this obviously makes the use of generics a nice semplification on ...
Get random data using Generics One of our unit tests is to populate properties within our business objects with random data. These properties are of different intrinsic types and therefore we would like to use the power of generics to return data of the type you pass in. Something along the lines of: public static T Ge...
TITLE: Get random data using Generics QUESTION: One of our unit tests is to populate properties within our business objects with random data. These properties are of different intrinsic types and therefore we would like to use the power of generics to return data of the type you pass in. Something along the lines of: ...
[ "c#", "unit-testing", "generics" ]
2
1
4,115
4
0
2008-10-07T10:06:54.187000
2008-10-07T10:18:10.607000
177,836
177,840
A doubt with the ICloneable interface in petshop 4.0?
In the 'DBUtility' project of Petshop 4.0,the abstract class SqlHelper has a method 'GetCachedParameters': public static SqlParameter[] GetCachedParameters(string cacheKey) { SqlParameter[] cachedParms = (SqlParameter[])parmCache[cacheKey]; if (cachedParms == null) return null; SqlParameter[] clonedParms = new SqlPar...
If cachedParms were returned directly, the caller could then change the elements of the array. The contents of the cache would then be effectively corrupted - the next caller to fetch the parameters from the cache with the same cache key would get unexpected results. EDIT: Cloning the array itself prevents the elements...
A doubt with the ICloneable interface in petshop 4.0? In the 'DBUtility' project of Petshop 4.0,the abstract class SqlHelper has a method 'GetCachedParameters': public static SqlParameter[] GetCachedParameters(string cacheKey) { SqlParameter[] cachedParms = (SqlParameter[])parmCache[cacheKey]; if (cachedParms == null)...
TITLE: A doubt with the ICloneable interface in petshop 4.0? QUESTION: In the 'DBUtility' project of Petshop 4.0,the abstract class SqlHelper has a method 'GetCachedParameters': public static SqlParameter[] GetCachedParameters(string cacheKey) { SqlParameter[] cachedParms = (SqlParameter[])parmCache[cacheKey]; if (ca...
[ "c#", "icloneable" ]
1
5
388
2
0
2008-10-07T10:07:00.817000
2008-10-07T10:08:18.643000
177,856
177,870
How do I trap Ctrl+C (SIGINT) in a C# console app?
I would like to be able to trap Ctrl + C in a C# console application so that I can carry out some cleanups before exiting. What is the best way of doing this?
See MSDN: Console.CancelKeyPress Event Article with code samples: Ctrl-C and the.NET console application
How do I trap Ctrl+C (SIGINT) in a C# console app? I would like to be able to trap Ctrl + C in a C# console application so that I can carry out some cleanups before exiting. What is the best way of doing this?
TITLE: How do I trap Ctrl+C (SIGINT) in a C# console app? QUESTION: I would like to be able to trap Ctrl + C in a C# console application so that I can carry out some cleanups before exiting. What is the best way of doing this? ANSWER: See MSDN: Console.CancelKeyPress Event Article with code samples: Ctrl-C and the.NE...
[ "c#", ".net", "console" ]
285
141
168,452
9
0
2008-10-07T10:19:37.327000
2008-10-07T10:24:16.460000
177,863
177,880
Firefox cuts files, whose name contains spaces, in a Struts application
I am using the next class (simplified for the sake of understandability) to download images in a struts web application. It is working fine in every browser but firefox, which cuts names containing spaces. That it is to say: file with spaces.pdf gets downloaded in firefox as: file while in chrome, IE7 IE6 is downloaded...
The filename should be a quoted string. (According to Section 19.5.1 of RFC 2616 ) response.setHeader("Content-Disposition","attachment; filename=\"" + filename + "\"");
Firefox cuts files, whose name contains spaces, in a Struts application I am using the next class (simplified for the sake of understandability) to download images in a struts web application. It is working fine in every browser but firefox, which cuts names containing spaces. That it is to say: file with spaces.pdf ge...
TITLE: Firefox cuts files, whose name contains spaces, in a Struts application QUESTION: I am using the next class (simplified for the sake of understandability) to download images in a struts web application. It is working fine in every browser but firefox, which cuts names containing spaces. That it is to say: file ...
[ "java", "firefox", "struts" ]
17
36
6,172
3
0
2008-10-07T10:21:26.073000
2008-10-07T10:32:29.093000
177,883
177,891
How can I include a servlet in a jsp page?
is it possible to include a servlet in a jsp page? if so how?
You can't include it (via one of the JSP directives), but you can chain to it. There's a great example over at JGuru. See this article.
How can I include a servlet in a jsp page? is it possible to include a servlet in a jsp page? if so how?
TITLE: How can I include a servlet in a jsp page? QUESTION: is it possible to include a servlet in a jsp page? if so how? ANSWER: You can't include it (via one of the JSP directives), but you can chain to it. There's a great example over at JGuru. See this article.
[ "jsp", "servlets", "include" ]
2
0
7,390
2
0
2008-10-07T10:33:52.697000
2008-10-07T10:37:22.330000
177,901
177,922
What does WISC (stack) mean?
LAMP is a well-known acronym for the software/technology bundle/stack representing Linux, Apache, MySQL, PHP. There are a few passing references on the Web that use the acronym WISC to speak of the other (supposedly Microsoft-centric) software/technology bundle/stack in contrast to LAMP. There is, however, no Wikipedia...
Or WISA: Windows, IIS, SQL Server, ASP.net I don't know why anyone would want to call it WISC, as these people are essentially saying "We will never ever use VB.NET, IronPython, IronRuby, F# or any other.NET Language". Also calling it.NET (WISN) sounds a bit weird as well, since ASP.NET is the Web-Technology of.NET. Bu...
What does WISC (stack) mean? LAMP is a well-known acronym for the software/technology bundle/stack representing Linux, Apache, MySQL, PHP. There are a few passing references on the Web that use the acronym WISC to speak of the other (supposedly Microsoft-centric) software/technology bundle/stack in contrast to LAMP. Th...
TITLE: What does WISC (stack) mean? QUESTION: LAMP is a well-known acronym for the software/technology bundle/stack representing Linux, Apache, MySQL, PHP. There are a few passing references on the Web that use the acronym WISC to speak of the other (supposedly Microsoft-centric) software/technology bundle/stack in co...
[ "terminology" ]
114
78
29,792
3
0
2008-10-07T10:40:27.003000
2008-10-07T10:48:07.550000
177,910
177,939
Accessing python egg's own metadata
I've produced a python egg using setuptools and would like to access it's metadata at runtime. I currently got working this: import pkg_resources dist = pkg_resources.get_distribution("my_project") print(dist.version) but this would probably work incorrectly if I had multiple versions of the same egg installed. And if ...
I am somewhat new to Python as well, but from what I understand: Although you can install multiple versions of the "same" egg (having the same name), only one of them will be available to any particular piece of code at runtime (based on your discovery method). So if your egg is the one calling this code, it must have ...
Accessing python egg's own metadata I've produced a python egg using setuptools and would like to access it's metadata at runtime. I currently got working this: import pkg_resources dist = pkg_resources.get_distribution("my_project") print(dist.version) but this would probably work incorrectly if I had multiple version...
TITLE: Accessing python egg's own metadata QUESTION: I've produced a python egg using setuptools and would like to access it's metadata at runtime. I currently got working this: import pkg_resources dist = pkg_resources.get_distribution("my_project") print(dist.version) but this would probably work incorrectly if I ha...
[ "python", "setuptools", "pkg-resources" ]
6
4
1,356
2
0
2008-10-07T10:43:22.847000
2008-10-07T10:56:40.420000
177,911
221,884
How to set focus in WPF page reload?
I've got a WPF browser-like application with a few pages. When I switch between pages, I'd like to set the keyboard focus. When a page is loaded the first time, this works by calling Control.Focus() in the constructor. But when I switch between pages this does not work anymore - the focus is just on the first field, an...
Since I found no solution to this problem, I used a simple workaround: I fire up a secondary thread, which changes the focus after the page has loaded. Luckily this is done very easily using BeginInvoke: myControl.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, (System.Threading.SendOrPos...
How to set focus in WPF page reload? I've got a WPF browser-like application with a few pages. When I switch between pages, I'd like to set the keyboard focus. When a page is loaded the first time, this works by calling Control.Focus() in the constructor. But when I switch between pages this does not work anymore - the...
TITLE: How to set focus in WPF page reload? QUESTION: I've got a WPF browser-like application with a few pages. When I switch between pages, I'd like to set the keyboard focus. When a page is loaded the first time, this works by calling Control.Focus() in the constructor. But when I switch between pages this does not ...
[ "wpf", "focus" ]
0
0
4,982
4
0
2008-10-07T10:44:06.030000
2008-10-21T13:28:56.817000
177,927
177,932
What is a good design for a query "layer" for Java JPA
In JPA the Entities are nice annotated Plain Old Java Objects. But I have not found a good way to interact with them and the database. In my current app, my basic design is always to have a sequence based id as primary key so I usually have to look up entities by other properties than PK. And for each Entity I have a s...
Try Seam. The Query Objects do most of the work for you, and they're easily extendable. Or, you could always implement a similar pattern. In general, Seam does a lot of useful stuff to bridge the gap between JPA and you view and business layers. You don't have to use JSF for Seam to be useful.
What is a good design for a query "layer" for Java JPA In JPA the Entities are nice annotated Plain Old Java Objects. But I have not found a good way to interact with them and the database. In my current app, my basic design is always to have a sequence based id as primary key so I usually have to look up entities by o...
TITLE: What is a good design for a query "layer" for Java JPA QUESTION: In JPA the Entities are nice annotated Plain Old Java Objects. But I have not found a good way to interact with them and the database. In my current app, my basic design is always to have a sequence based id as primary key so I usually have to loo...
[ "java", "hibernate", "jpa", "ejb" ]
2
4
1,603
6
0
2008-10-07T10:52:24.420000
2008-10-07T10:55:07.770000
177,935
177,985
How to Implement Ocean Surface Effect Using OpenGL ES 1.1?
I'm working on an iPhone game that takes place on the ocean surface. Can someone recommend some sample code or tutorials for implementing waves or ripples in OpenGL? As I write this, iPhone only supports OpenGL ES 1.1, so there is no support for shaders or other fancy effects. I don't need anything too fancy. I don't n...
iPhone is pretty much like a GPU from 1999 in capabilities (e.g. NVIDIA Riva TNT 2). So your most realistic options are just blending several scrolling textures. E.g. have one texture with some "wave pattern". Set it up into two texture stages, and scroll both in different directions/speeds (via a texture matrix). The ...
How to Implement Ocean Surface Effect Using OpenGL ES 1.1? I'm working on an iPhone game that takes place on the ocean surface. Can someone recommend some sample code or tutorials for implementing waves or ripples in OpenGL? As I write this, iPhone only supports OpenGL ES 1.1, so there is no support for shaders or othe...
TITLE: How to Implement Ocean Surface Effect Using OpenGL ES 1.1? QUESTION: I'm working on an iPhone game that takes place on the ocean surface. Can someone recommend some sample code or tutorials for implementing waves or ripples in OpenGL? As I write this, iPhone only supports OpenGL ES 1.1, so there is no support f...
[ "iphone", "opengl-es" ]
3
3
3,274
2
0
2008-10-07T10:55:58.703000
2008-10-07T11:11:29.577000
177,953
181,607
Webdav windows server 2008 not allowing doc files to save
I have setup web dav on windows server 2008. It seems to work fine but will not allow me to save a word document to the dir but it will allow a text file to be saved. Any ideas? Thanks, Alex
Found answer at: http://learn.iis.net/page.aspx/350/installing-and-configuring-webdav-on-iis-70/ Cd c:\ cd "%WinDir%\System32\InetSrv"\ AppCmd set config "Default Web Site/documents"" /section:system.webServer/security/requestFiltering /+fileExtensions.[fileExtension='.doc',allowed='true'] /commit:apphost
Webdav windows server 2008 not allowing doc files to save I have setup web dav on windows server 2008. It seems to work fine but will not allow me to save a word document to the dir but it will allow a text file to be saved. Any ideas? Thanks, Alex
TITLE: Webdav windows server 2008 not allowing doc files to save QUESTION: I have setup web dav on windows server 2008. It seems to work fine but will not allow me to save a word document to the dir but it will allow a text file to be saved. Any ideas? Thanks, Alex ANSWER: Found answer at: http://learn.iis.net/page.a...
[ "windows-server-2008", "webdav" ]
0
0
706
1
0
2008-10-07T11:01:40.160000
2008-10-08T07:01:39.283000
177,956
177,987
What is the best way to convert an int or null to boolean value in an SQL query?
What is the best way to convert an int or null to boolean value in an SQL query, such that: Any non-null value is TRUE in the results Any null value is FALSE in the results
To my knowledge (correct me if I'm wrong), there is no concept of literal boolean values in SQL. You can have expressions evaluating to boolean values, but you cannot output them. This said, you can use CASE WHEN to produce a value you can use in a comparison: SELECT CASE WHEN ValueColumn IS NULL THEN 'FALSE' ELSE 'TRU...
What is the best way to convert an int or null to boolean value in an SQL query? What is the best way to convert an int or null to boolean value in an SQL query, such that: Any non-null value is TRUE in the results Any null value is FALSE in the results
TITLE: What is the best way to convert an int or null to boolean value in an SQL query? QUESTION: What is the best way to convert an int or null to boolean value in an SQL query, such that: Any non-null value is TRUE in the results Any null value is FALSE in the results ANSWER: To my knowledge (correct me if I'm wron...
[ "sql", "null", "boolean", "type-conversion" ]
59
80
137,209
11
0
2008-10-07T11:02:21.843000
2008-10-07T11:11:52.103000
177,965
180,047
Displaying path/version information for a loaded COM object?
I've got some code that uses the Component Categories manager to load all of the classes that implement a particular category. Is there an easy way to get a description, path and version information from the loaded DLL or EXE?
When the object is loaded in-proc (i.e. from a DLL) in the same apartment, there are potentially some tricks you could do to find the DLL in memory. For instance, if you look in the virtual method table (vtable) for code pointers into the live object, they would usually point into the DLL. You could then use some syste...
Displaying path/version information for a loaded COM object? I've got some code that uses the Component Categories manager to load all of the classes that implement a particular category. Is there an easy way to get a description, path and version information from the loaded DLL or EXE?
TITLE: Displaying path/version information for a loaded COM object? QUESTION: I've got some code that uses the Component Categories manager to load all of the classes that implement a particular category. Is there an easy way to get a description, path and version information from the loaded DLL or EXE? ANSWER: When ...
[ "com" ]
0
1
252
2
0
2008-10-07T11:06:03.347000
2008-10-07T19:46:40.067000
177,968
178,017
Multidimensional Repeating Data Control
Excuse my title if it's confusing, but I don't know how else to describe this, except in the long explanation below: I would like to create a multidimensional, templated, data bound, repeating ASP.NET control, with paging and sorting. I.e. You specify how many columns and rows per page, so items are displayed across an...
There is a new ListView control in 3.5 that can be displayed the way you describe. If you tweak the 'tiled' or 'single row' views you can probably do what you like and it supports paging out of the box.
Multidimensional Repeating Data Control Excuse my title if it's confusing, but I don't know how else to describe this, except in the long explanation below: I would like to create a multidimensional, templated, data bound, repeating ASP.NET control, with paging and sorting. I.e. You specify how many columns and rows pe...
TITLE: Multidimensional Repeating Data Control QUESTION: Excuse my title if it's confusing, but I don't know how else to describe this, except in the long explanation below: I would like to create a multidimensional, templated, data bound, repeating ASP.NET control, with paging and sorting. I.e. You specify how many c...
[ "asp.net" ]
0
1
153
1
0
2008-10-07T11:06:36.483000
2008-10-07T11:24:37.367000
177,970
178,063
Is there a way to get DateTime value from timestamp type column?
I need a select from table which does not have column that tells when row was inserted, only timestamp column (values like: 0x0000000000530278). Some data was imported to the table yesterday and now I need to find out what exactly was imported:( Is there a way to do it using only timestamp info? Here I found that: Time...
The Transact-SQL timestamp data type is a binary data type with no time-related values. So to answer your question: Is there a way to get DateTime value from timestamp type column? The answer is: No
Is there a way to get DateTime value from timestamp type column? I need a select from table which does not have column that tells when row was inserted, only timestamp column (values like: 0x0000000000530278). Some data was imported to the table yesterday and now I need to find out what exactly was imported:( Is there ...
TITLE: Is there a way to get DateTime value from timestamp type column? QUESTION: I need a select from table which does not have column that tells when row was inserted, only timestamp column (values like: 0x0000000000530278). Some data was imported to the table yesterday and now I need to find out what exactly was im...
[ "sql", "sql-server", "t-sql" ]
12
23
55,425
8
0
2008-10-07T11:06:44.593000
2008-10-07T11:39:25.713000
177,974
178,072
How can I make email go to a local folder during testing?
How can I test sending email from my application without flooding my inbox? Is there a way to tell IIS/ASP.NET how to deliver email to a local folder for inspection?
Yes there is a way. You can alter web.config like this so that when you send email it will instead be created as an.EML file in c:\LocalDir. You can also create an instance of the SmtpClient class with these same settings, if you don't want to/can't change the web.config. In C# that looks something like this: var smtpC...
How can I make email go to a local folder during testing? How can I test sending email from my application without flooding my inbox? Is there a way to tell IIS/ASP.NET how to deliver email to a local folder for inspection?
TITLE: How can I make email go to a local folder during testing? QUESTION: How can I test sending email from my application without flooding my inbox? Is there a way to tell IIS/ASP.NET how to deliver email to a local folder for inspection? ANSWER: Yes there is a way. You can alter web.config like this so that when y...
[ "asp.net", "testing", "smtp" ]
22
44
11,729
2
0
2008-10-07T11:08:19.473000
2008-10-07T11:41:58.923000
177,989
178,006
Downloading document from internal server externally
This a bit of strange one.... We have an internal web app that runs on server (A) and a document repository that runs on server (B). I have simple link on a page and I want to enable the user to download a document(From IIS Server (A)). However this document does not exist on Server (A) until the user clicks the button...
If the world can see server A and server A can see server B. I would recommend setting up a reverse proxy. http://www.codeplex.com/urlrewriter Basically what this does is allows the world to download from server B but only through the reverse proxy. You can create a reverse proxy interface with this library above with ...
Downloading document from internal server externally This a bit of strange one.... We have an internal web app that runs on server (A) and a document repository that runs on server (B). I have simple link on a page and I want to enable the user to download a document(From IIS Server (A)). However this document does not...
TITLE: Downloading document from internal server externally QUESTION: This a bit of strange one.... We have an internal web app that runs on server (A) and a document repository that runs on server (B). I have simple link on a page and I want to enable the user to download a document(From IIS Server (A)). However this...
[ "c#", "asp.net", "iis", "reverse-proxy" ]
1
5
251
2
0
2008-10-07T11:12:30.137000
2008-10-07T11:19:39.890000
178,001
181,077
WSGI Middleware recommendations
I have heard that there is lots of interesting and useful WSGI middleware around. However, I am not sure which ones (apart from the ones that are part of pylons) are useful and stable. What is your favourite WSGI middleware?
WSGI.org has a fairly comprehensive list of WSGI Middleware & Utilities.
WSGI Middleware recommendations I have heard that there is lots of interesting and useful WSGI middleware around. However, I am not sure which ones (apart from the ones that are part of pylons) are useful and stable. What is your favourite WSGI middleware?
TITLE: WSGI Middleware recommendations QUESTION: I have heard that there is lots of interesting and useful WSGI middleware around. However, I am not sure which ones (apart from the ones that are part of pylons) are useful and stable. What is your favourite WSGI middleware? ANSWER: WSGI.org has a fairly comprehensive ...
[ "python", "pylons", "wsgi" ]
3
2
682
1
0
2008-10-07T11:18:18.503000
2008-10-08T01:31:37.953000
178,020
178,087
How do I embed a Google map into a Flash website?
I would like to include a Google map in a Flash site I am building. I would like to retain as much of the zoom, print, copy/send url, direction functionality as is practically possible. Please could somebody advise the best way to do this? Thanks.
See Google Maps API for Flash This API lets Flex developers embed Google Maps in Flash applications. Similar to the JavaScript version, this ActionScript API provides a number of utilities for manipulating and adding content to maps through a variety of services, enabling you to embed robust, interactive maps applicati...
How do I embed a Google map into a Flash website? I would like to include a Google map in a Flash site I am building. I would like to retain as much of the zoom, print, copy/send url, direction functionality as is practically possible. Please could somebody advise the best way to do this? Thanks.
TITLE: How do I embed a Google map into a Flash website? QUESTION: I would like to include a Google map in a Flash site I am building. I would like to retain as much of the zoom, print, copy/send url, direction functionality as is practically possible. Please could somebody advise the best way to do this? Thanks. ANS...
[ "flash", "actionscript", "google-maps" ]
5
5
7,625
3
0
2008-10-07T11:25:30.673000
2008-10-07T11:45:56.543000
178,026
178,090
Why is "null" present in C# and Java?
We noticed that lots of bugs in our software developed in C# (or Java) cause a NullReferenceException. Is there a reason why "null" has even been included in the language? After all, if there were no "null", I would have no bug, right? In other words, what feature in the language couldn't work without null?
Anders Hejlsberg, "C# father", just spoke about that point in his Computerworld interview: For example, in the type system we do not have separation between value and reference types and nullability of types. This may sound a little wonky or a little technical, but in C# reference types can be null, such as strings, bu...
Why is "null" present in C# and Java? We noticed that lots of bugs in our software developed in C# (or Java) cause a NullReferenceException. Is there a reason why "null" has even been included in the language? After all, if there were no "null", I would have no bug, right? In other words, what feature in the language c...
TITLE: Why is "null" present in C# and Java? QUESTION: We noticed that lots of bugs in our software developed in C# (or Java) cause a NullReferenceException. Is there a reason why "null" has even been included in the language? After all, if there were no "null", I would have no bug, right? In other words, what feature...
[ "c#", "java", "null" ]
76
93
7,422
25
0
2008-10-07T11:30:36.560000
2008-10-07T11:47:23.157000
178,068
271,483
How do you disable the CPU window in Delphi 7
When stepping a program in Delphi 7, the CPU window sometimes pops up and then steps through that instructions. I find this an annoyance as I wish to only step Pascal Code. Does anyone know how to disable this CPU pop-up? I would not be sorry if this window never ever shows. It did not happen on Delphi 5 which was my p...
Delphi does not, by default, step into the CPU window. So the answer to your question is not that it can not be done. Maybe the question should be: What did I do that causes this. EDIT: From the comments I understand that it happens when you press pause to break in the debugger. It is not strange that it stops on the e...
How do you disable the CPU window in Delphi 7 When stepping a program in Delphi 7, the CPU window sometimes pops up and then steps through that instructions. I find this an annoyance as I wish to only step Pascal Code. Does anyone know how to disable this CPU pop-up? I would not be sorry if this window never ever shows...
TITLE: How do you disable the CPU window in Delphi 7 QUESTION: When stepping a program in Delphi 7, the CPU window sometimes pops up and then steps through that instructions. I find this an annoyance as I wish to only step Pascal Code. Does anyone know how to disable this CPU pop-up? I would not be sorry if this windo...
[ "delphi", "debugging", "ide", "window", "cpu" ]
15
7
12,603
5
0
2008-10-07T11:40:42.530000
2008-11-07T08:02:44.723000