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
169,596
219,839
What is an efficient method of paging through very large result sets in SQL Server 2005?
EDIT: I'm still waiting for more answers. Thanks! In SQL 2000 days, I used to use temp table method where you create a temp table with new identity column and primary key then select where identity column between A and B. When SQL 2005 came along I found out about Row_Number() and I've been using it ever since... But n...
Well, for your sample query ROW_COUNT should be pretty fast with thousands of rows, provided you have an index on your PostDate field. If you don't, the server needs to perform a complete clustered index scan on your PK, practically load every page, fetch your PostDate field, sort by it, determine the rows to extract f...
What is an efficient method of paging through very large result sets in SQL Server 2005? EDIT: I'm still waiting for more answers. Thanks! In SQL 2000 days, I used to use temp table method where you create a temp table with new identity column and primary key then select where identity column between A and B. When SQL ...
TITLE: What is an efficient method of paging through very large result sets in SQL Server 2005? QUESTION: EDIT: I'm still waiting for more answers. Thanks! In SQL 2000 days, I used to use temp table method where you create a temp table with new identity column and primary key then select where identity column between ...
[ "sql-server-2005", "performance", "pagination" ]
7
1
2,638
2
0
2008-10-04T02:33:46.800000
2008-10-20T20:42:56.177000
169,620
169,687
Java EE -- is it just fluff or the real stuff?
I'm familiar with the LAMP stack and over the years have successfully deployed a handful of web sties based on it. I've used everything from Apache + modPerl, to PHP, to Ruby and Rails. With good use of caching my Rails site can sustain a pretty good load, but I'm not talking massive. I never really liked Java as a lan...
The key differentiator that Java EE offers over the LAMP stack can be boiled down to a single word. Transactions. Most smaller systems simply rely on the transaction system supplied by the database, and for many applications that is (obviously) quite satisfactory. But each Java EE server includes a distributed transact...
Java EE -- is it just fluff or the real stuff? I'm familiar with the LAMP stack and over the years have successfully deployed a handful of web sties based on it. I've used everything from Apache + modPerl, to PHP, to Ruby and Rails. With good use of caching my Rails site can sustain a pretty good load, but I'm not talk...
TITLE: Java EE -- is it just fluff or the real stuff? QUESTION: I'm familiar with the LAMP stack and over the years have successfully deployed a handful of web sties based on it. I've used everything from Apache + modPerl, to PHP, to Ruby and Rails. With good use of caching my Rails site can sustain a pretty good load...
[ "jakarta-ee", "frameworks", "lamp", "java-ee-5" ]
12
18
1,527
9
0
2008-10-04T02:50:34.833000
2008-10-04T03:35:37.270000
169,624
169,636
Is it possible to order by any column given a stored procedure parameter in SQL Server?
I was looking into sorting tables by a column designated given some input, and from what I've found, there is no easy way to do this. The best I've found is a switch statement: SELECT Column1, Column2, Column3, Column4 FROM Table ORDER BY CASE WHEN @OrderBY = 'Column1' THEN Column1 WHEN @OrderBY = 'Column2' THEN Column...
You have two choices: As you have implemented above Or generate dynamic sql and execute using sp_executesql
Is it possible to order by any column given a stored procedure parameter in SQL Server? I was looking into sorting tables by a column designated given some input, and from what I've found, there is no easy way to do this. The best I've found is a switch statement: SELECT Column1, Column2, Column3, Column4 FROM Table OR...
TITLE: Is it possible to order by any column given a stored procedure parameter in SQL Server? QUESTION: I was looking into sorting tables by a column designated given some input, and from what I've found, there is no easy way to do this. The best I've found is a switch statement: SELECT Column1, Column2, Column3, Col...
[ "sql-server", "database", "sql-server-2005" ]
4
4
1,127
5
0
2008-10-04T02:52:55.157000
2008-10-04T02:57:34.507000
169,637
169,651
DateTime, DateTime? and LINQ
When I retrieve a record using LINQ that has a DateTime field only the ToString() is available. Where are all the other DateTime methods? I have to Convert.ToDateTime the DateTime? that the Field returns? What is the difference between (DateTime) and (DateTime?)
If by DateTime? you mean a Nullable, then you can get the DateTime value via the DateTime?. Value property.
DateTime, DateTime? and LINQ When I retrieve a record using LINQ that has a DateTime field only the ToString() is available. Where are all the other DateTime methods? I have to Convert.ToDateTime the DateTime? that the Field returns? What is the difference between (DateTime) and (DateTime?)
TITLE: DateTime, DateTime? and LINQ QUESTION: When I retrieve a record using LINQ that has a DateTime field only the ToString() is available. Where are all the other DateTime methods? I have to Convert.ToDateTime the DateTime? that the Field returns? What is the difference between (DateTime) and (DateTime?) ANSWER: I...
[ ".net", "linq", "datetime" ]
11
16
14,223
4
0
2008-10-04T02:58:23.257000
2008-10-04T03:08:20.350000
169,695
544,781
Persisting Printer Settings
What is the best way to persist/save printer settings in.Net? There used to be a bug in.Net 1.1 in the serialization of the PrinterSetting object and there were some workarounds but I'm wondering if there isn't a better or easier way of doing this in the more recent versions of the framework. The main use case is to al...
I did a pretty ghetto method of dumping the current DEVMODE and overwriting it back when they want to use it again to send some proprietary printer settings to a copier machine at work. I couldn't find a better way to get to some of the properties that simply weren't exposed via the printing API (such as proprietary st...
Persisting Printer Settings What is the best way to persist/save printer settings in.Net? There used to be a bug in.Net 1.1 in the serialization of the PrinterSetting object and there were some workarounds but I'm wondering if there isn't a better or easier way of doing this in the more recent versions of the framework...
TITLE: Persisting Printer Settings QUESTION: What is the best way to persist/save printer settings in.Net? There used to be a bug in.Net 1.1 in the serialization of the PrinterSetting object and there were some workarounds but I'm wondering if there isn't a better or easier way of doing this in the more recent version...
[ ".net", "serialization", "printing", "settings" ]
4
3
1,686
4
0
2008-10-04T03:44:21.777000
2009-02-13T04:57:25.557000
169,697
169,714
What are your required software development operation manuals?
After reading E-myth Revisited, I realize that I can do a better job at making my company less reliant upon me... I spend a tremendous amount of time answering silly questions (silly to me, but necessary for my developers to get the job done). I need to write a set of operating manuals for what to do in certain situati...
What about a wiki - at least then other people can start to contribute. Otherwise they are just going to rely on you for the manuals
What are your required software development operation manuals? After reading E-myth Revisited, I realize that I can do a better job at making my company less reliant upon me... I spend a tremendous amount of time answering silly questions (silly to me, but necessary for my developers to get the job done). I need to wri...
TITLE: What are your required software development operation manuals? QUESTION: After reading E-myth Revisited, I realize that I can do a better job at making my company less reliant upon me... I spend a tremendous amount of time answering silly questions (silly to me, but necessary for my developers to get the job do...
[ "manual" ]
1
2
345
2
0
2008-10-04T03:48:48.490000
2008-10-04T04:08:02.913000
169,721
172,131
Where can I find the Flex source code?
I keep hearing that Flex is open source and I figured that a great way to learn about the inner workings would be to look at it. I can easily find the Flex SDK ( http://opensource.adobe.com/wiki/display/flexsdk/Get+Source+Code ), but I'm wanting to look at the class definitions for the MXML core library (like NumericSt...
If you have installed the sdk or Flex builder all of the source files are installed locally on your computer, I believe. I have flex builder 3 installed source is located here(depending on where you installed): Source for flex 3 sdk C:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\frameworks\projects\framework\src\mx S...
Where can I find the Flex source code? I keep hearing that Flex is open source and I figured that a great way to learn about the inner workings would be to look at it. I can easily find the Flex SDK ( http://opensource.adobe.com/wiki/display/flexsdk/Get+Source+Code ), but I'm wanting to look at the class definitions fo...
TITLE: Where can I find the Flex source code? QUESTION: I keep hearing that Flex is open source and I figured that a great way to learn about the inner workings would be to look at it. I can easily find the Flex SDK ( http://opensource.adobe.com/wiki/display/flexsdk/Get+Source+Code ), but I'm wanting to look at the cl...
[ "apache-flex", "open-source" ]
11
11
8,766
4
0
2008-10-04T04:15:03.930000
2008-10-05T15:19:07.300000
169,731
169,740
How do I reference an object dynamically?
In Javascript, I have an object: obj = { one: "foo", two: "bar" }; Now, I want do do this var a = 'two'; if(confirm('Do you want One')) { a = 'one'; } alert(obj.a); But of course it doesn't work. What would be the correct way of referencing this object dynamically?
short answer: obj[a] long answer: obj.field is just a shorthand for obj["field"], for the special case where the key is a constant string without spaces, dots, or other nasty things. in your question, the key wasn't a constant, so simply use the full syntax.
How do I reference an object dynamically? In Javascript, I have an object: obj = { one: "foo", two: "bar" }; Now, I want do do this var a = 'two'; if(confirm('Do you want One')) { a = 'one'; } alert(obj.a); But of course it doesn't work. What would be the correct way of referencing this object dynamically?
TITLE: How do I reference an object dynamically? QUESTION: In Javascript, I have an object: obj = { one: "foo", two: "bar" }; Now, I want do do this var a = 'two'; if(confirm('Do you want One')) { a = 'one'; } alert(obj.a); But of course it doesn't work. What would be the correct way of referencing this object dynami...
[ "javascript", "json" ]
8
20
7,039
3
0
2008-10-04T04:23:55.457000
2008-10-04T04:31:26.627000
169,765
169,906
How do you get non-technical folks to appreciate a non-UI problem?
Suppose you're working on an enterprise project in which you have to get management signoff in order for you to develop a new feature set. Usually your management has no problem signing off on some bright shiny new UI feature. Unfortunately they have a hard time appreciating some behind-the-scenes issues that are cruci...
Every craft has its unsexy sides. Things that HAVE to be done, but nobody notices them directly. In a grocery store somebody has to organize how and when to fill the grocery shelves so they always look fresh. In a laundry you need somebody who thinks about how the processes should be optimized so that the customer gets...
How do you get non-technical folks to appreciate a non-UI problem? Suppose you're working on an enterprise project in which you have to get management signoff in order for you to develop a new feature set. Usually your management has no problem signing off on some bright shiny new UI feature. Unfortunately they have a ...
TITLE: How do you get non-technical folks to appreciate a non-UI problem? QUESTION: Suppose you're working on an enterprise project in which you have to get management signoff in order for you to develop a new feature set. Usually your management has no problem signing off on some bright shiny new UI feature. Unfortun...
[ "language-agnostic", "communication", "requirements" ]
17
18
631
11
0
2008-10-04T04:55:39.900000
2008-10-04T07:18:31.517000
169,784
169,786
Not getting the correct count in SQL
I am totally new to SQL. I have a simple select query similar to this: SELECT COUNT(col1) FROM table1 There are some 120 records in the table and shown on the GUI. For some reason, this query always returns a number which is less than the actual count. Can somebody please help me?
You might have some null values in col1 column. Aggregate functions ignore nulls. try this SELECT COUNT(ISNULL(col1,0)) FROM table1
Not getting the correct count in SQL I am totally new to SQL. I have a simple select query similar to this: SELECT COUNT(col1) FROM table1 There are some 120 records in the table and shown on the GUI. For some reason, this query always returns a number which is less than the actual count. Can somebody please help me?
TITLE: Not getting the correct count in SQL QUESTION: I am totally new to SQL. I have a simple select query similar to this: SELECT COUNT(col1) FROM table1 There are some 120 records in the table and shown on the GUI. For some reason, this query always returns a number which is less than the actual count. Can somebody...
[ "sql", "sql-server-2005", "t-sql" ]
4
13
868
4
0
2008-10-04T05:17:36.907000
2008-10-04T05:18:44.753000
169,799
169,857
How do I dynamically add Panels to other panels at runtime in Java?
I'm trying to get into java again (it's been a few years). I never really did any GUI coding in java. I've been using Netbeans to get started with this. When using winforms in C# at work I use a usercontrols to build parts of my UI and add them to forms dynamically. I've been trying to use JPanels like usercontrols in ...
I figured it out. The comments under the accepted answer here explain it: Dynamically added JTable not displaying Basically I just added the following before the mainPanel.add() mainPanel.setLayout(new java.awt.BorderLayout());
How do I dynamically add Panels to other panels at runtime in Java? I'm trying to get into java again (it's been a few years). I never really did any GUI coding in java. I've been using Netbeans to get started with this. When using winforms in C# at work I use a usercontrols to build parts of my UI and add them to form...
TITLE: How do I dynamically add Panels to other panels at runtime in Java? QUESTION: I'm trying to get into java again (it's been a few years). I never really did any GUI coding in java. I've been using Netbeans to get started with this. When using winforms in C# at work I use a usercontrols to build parts of my UI an...
[ "java", "swing" ]
11
17
33,434
6
0
2008-10-04T05:32:05.927000
2008-10-04T06:13:53.517000
169,810
169,825
2D animation in Python
I'm writing a simulator in Python, and am curious about options and opinions regarding basic 2D animations. By animation, I'm referring to rendering on the fly, not displaying prerendered images. I'm currently using matplotlib (Wxagg backend), and it's possible that I'll be able to continue using it, but I suspect it w...
I am a fan of pyglet which is a completely self contained library for doing graphical work under win32, linux, and OS X. It has very low overhead, and you can see this for yourself from the tutorial on the website. It should play well with wxpython, or at least I seem to recall posts to the mailing list about wxpython ...
2D animation in Python I'm writing a simulator in Python, and am curious about options and opinions regarding basic 2D animations. By animation, I'm referring to rendering on the fly, not displaying prerendered images. I'm currently using matplotlib (Wxagg backend), and it's possible that I'll be able to continue using...
TITLE: 2D animation in Python QUESTION: I'm writing a simulator in Python, and am curious about options and opinions regarding basic 2D animations. By animation, I'm referring to rendering on the fly, not displaying prerendered images. I'm currently using matplotlib (Wxagg backend), and it's possible that I'll be able...
[ "python", "animation", "2d" ]
12
14
33,515
3
0
2008-10-04T05:36:23.267000
2008-10-04T05:50:03.410000
169,812
171,386
Will there be a functional language which does for the Java community what F# does for the .NET community?
Will there be a functional language which does for the Java community what F# does for the.NET community? What functional programming languages are available, or in development, for the JVM?
Perhaps Clojure. It's not statically typed, but it has more of an emphasis on immutability and concurrency than F#. However, like F# (and unlike Common Lisp), it is intended to be a primarily functional language that is good at consuming OO libraries from the underlying platform.
Will there be a functional language which does for the Java community what F# does for the .NET community? Will there be a functional language which does for the Java community what F# does for the.NET community? What functional programming languages are available, or in development, for the JVM?
TITLE: Will there be a functional language which does for the Java community what F# does for the .NET community? QUESTION: Will there be a functional language which does for the Java community what F# does for the.NET community? What functional programming languages are available, or in development, for the JVM? ANS...
[ "functional-programming", "jvm" ]
22
17
5,353
10
0
2008-10-04T05:39:20.263000
2008-10-05T02:42:08.047000
169,814
169,848
How to find the distance between the two most widely separated nodes
I'm working through previous years ACM Programming Competition problems trying to get better at solving Graph problems. The one I'm working on now is I'm given an arbitrary number of undirected graph nodes, their neighbors and the distances for the edges connecting the nodes. What I NEED is the distance between the two...
It looks like you can use either of: Floyd Warshall algorithm Johnson's algorithm. I can't give you much guidance about them though - I'm no expert.
How to find the distance between the two most widely separated nodes I'm working through previous years ACM Programming Competition problems trying to get better at solving Graph problems. The one I'm working on now is I'm given an arbitrary number of undirected graph nodes, their neighbors and the distances for the ed...
TITLE: How to find the distance between the two most widely separated nodes QUESTION: I'm working through previous years ACM Programming Competition problems trying to get better at solving Graph problems. The one I'm working on now is I'm given an arbitrary number of undirected graph nodes, their neighbors and the di...
[ "java", "algorithm", "graph-theory" ]
3
3
6,814
6
0
2008-10-04T05:40:33.537000
2008-10-04T06:05:53.813000
169,818
169,923
Object-relational mapping: What's the best way to implement getters?
What should happen when I call $user->get_email_address()? Option 1: Pull the email address from the database on demand public function get_email_address() { if (!$this->email_address) { $this->read_from_database('email_address'); } return $this->email_address; } Option 2: Pull the email address (and the other User att...
There really isn't a correct answer for this. Depends on how many users you're loading at once, how many text/blob fields are in your User table, whether your user table loads any associated child objects. As aaronjensen says, this pattern is called lazy loading - and the opposite behaviour (loading everything up front...
Object-relational mapping: What's the best way to implement getters? What should happen when I call $user->get_email_address()? Option 1: Pull the email address from the database on demand public function get_email_address() { if (!$this->email_address) { $this->read_from_database('email_address'); } return $this->emai...
TITLE: Object-relational mapping: What's the best way to implement getters? QUESTION: What should happen when I call $user->get_email_address()? Option 1: Pull the email address from the database on demand public function get_email_address() { if (!$this->email_address) { $this->read_from_database('email_address'); } ...
[ "php", "orm", "oop", "mapping" ]
4
9
850
3
0
2008-10-04T05:42:14.067000
2008-10-04T07:33:28.223000
169,828
170,072
What are the real benefits of Visual Studio Team System Database Edition (GDR)?
Interested if anyone has used VSTS Database Edition extensively and, if so, which features did you find the most useful over the standard Visual Studio database projects? What are the most compelling features as opposed to alternative schema management options or tools like RedGate's SqlCompare etc? Edit: Microsoft jus...
We use the database edition functionality of Team Suite on Stack Overflow. As Vaibhav said, mostly it is useful because it gives you a one-click way to reverse engineer a database into source control, and keep it up to date. Note that it also has decent Data and Schema compare tools as well. You can compare projects to...
What are the real benefits of Visual Studio Team System Database Edition (GDR)? Interested if anyone has used VSTS Database Edition extensively and, if so, which features did you find the most useful over the standard Visual Studio database projects? What are the most compelling features as opposed to alternative schem...
TITLE: What are the real benefits of Visual Studio Team System Database Edition (GDR)? QUESTION: Interested if anyone has used VSTS Database Edition extensively and, if so, which features did you find the most useful over the standard Visual Studio database projects? What are the most compelling features as opposed to...
[ "sql-server", "database-tools" ]
19
7
4,123
7
0
2008-10-04T05:53:28.053000
2008-10-04T10:06:37.823000
169,829
169,849
INotifyPropertyChanging and validations: when do I raise PropertyChanging?
INotifyPropertyChanged is fairly self explanatory and I think I'm clear on when to raise that one (i.e. when I've finished updating the values). If I implement INotifyPropertyChanging I'm tending to raise the event as soon as I enter the setter or other method that changes the objects state and then continue with any g...
If your object is given a value that is invalid for the property and you throw an exception then you shouldn't raise the PropertyChanging event. You should only raise the event when you've decided that the value will change. The typical usage scenario is for changing a simple field: public T Foo { get { return m_Foo; }...
INotifyPropertyChanging and validations: when do I raise PropertyChanging? INotifyPropertyChanged is fairly self explanatory and I think I'm clear on when to raise that one (i.e. when I've finished updating the values). If I implement INotifyPropertyChanging I'm tending to raise the event as soon as I enter the setter ...
TITLE: INotifyPropertyChanging and validations: when do I raise PropertyChanging? QUESTION: INotifyPropertyChanged is fairly self explanatory and I think I'm clear on when to raise that one (i.e. when I've finished updating the values). If I implement INotifyPropertyChanging I'm tending to raise the event as soon as I...
[ ".net", "data-binding", "events", "change-tracking" ]
11
13
2,457
3
0
2008-10-04T05:53:57.537000
2008-10-04T06:07:37.570000
169,833
169,846
How do I write content to another browser window using Javascript?
I've opened a new window with window.open() and I want to use the reference from the window.open() call to then write content to the new window. I've tried copying HTML from the old window to the new window by using myWindow.document.body.innerHTML = oldWindowDiv.innerHTML; but that's doesn't work. Any ideas?
The reference returned by window.open() is to the child window's window object. So you can do anything you would normally do, here's an example: var myWindow = window.open('...') myWindow.document.getElementById('foo').style.backgroundColor = 'red' Bear in mind that this will only work if the parent and child windows h...
How do I write content to another browser window using Javascript? I've opened a new window with window.open() and I want to use the reference from the window.open() call to then write content to the new window. I've tried copying HTML from the old window to the new window by using myWindow.document.body.innerHTML = ol...
TITLE: How do I write content to another browser window using Javascript? QUESTION: I've opened a new window with window.open() and I want to use the reference from the window.open() call to then write content to the new window. I've tried copying HTML from the old window to the new window by using myWindow.document.b...
[ "javascript", "dom" ]
12
14
30,443
4
0
2008-10-04T05:54:36.147000
2008-10-04T06:04:29.637000
169,862
169,919
How can I implement the pop out functionality of chat windows in GMail?
I'm not looking for a full implementation, I'm more interested in how they do it. I know they use GWT, but I'd like a more low level answer. Naively, I would start by thinking when you click the popout link they simply open a new window and copy content into it. There are lots of reasons why that won't work out well, s...
I recently needed to solve exactly this problem in an app. I ended up using this great little jQuery plugin to do the trick: WindowMsg (see link at bottom) While I'm sure there are other ways to accomplish the same task, that plugin does works thusly: first you create a new child window from your original window using ...
How can I implement the pop out functionality of chat windows in GMail? I'm not looking for a full implementation, I'm more interested in how they do it. I know they use GWT, but I'd like a more low level answer. Naively, I would start by thinking when you click the popout link they simply open a new window and copy co...
TITLE: How can I implement the pop out functionality of chat windows in GMail? QUESTION: I'm not looking for a full implementation, I'm more interested in how they do it. I know they use GWT, but I'd like a more low level answer. Naively, I would start by thinking when you click the popout link they simply open a new ...
[ "javascript" ]
8
12
2,626
2
0
2008-10-04T06:21:20.133000
2008-10-04T07:27:09.470000
169,866
169,893
Export pictures in Microsoft Word to TIFF
How to export pictures in Microsoft Word to TIFF file using Visual Studio Tools for Office? I can obtain a reference to the pictures as InlineShape object collection, the hard part now is how to save them as TIFF images.
OK guys, I got the problem solved. Here's the code snippet: private void SaveToImage(Word.InlineShape picShape, string filePath) { picShape.Select(); theApp.Selection.CopyAsPicture(); IDataObject data = Clipboard.GetDataObject(); if (data.GetDataPresent(typeof(Bitmap))) { Bitmap image = (Bitmap)data.GetData(typeof(Bitm...
Export pictures in Microsoft Word to TIFF How to export pictures in Microsoft Word to TIFF file using Visual Studio Tools for Office? I can obtain a reference to the pictures as InlineShape object collection, the hard part now is how to save them as TIFF images.
TITLE: Export pictures in Microsoft Word to TIFF QUESTION: How to export pictures in Microsoft Word to TIFF file using Visual Studio Tools for Office? I can obtain a reference to the pictures as InlineShape object collection, the hard part now is how to save them as TIFF images. ANSWER: OK guys, I got the problem sol...
[ "c#", "vsto" ]
1
2
3,467
2
0
2008-10-04T06:30:21.770000
2008-10-04T07:04:36.380000
169,877
169,927
Test cases, "when", "what", and "why"?
Being new to test based development, this question has been bugging me. How much is too much? What should be tested, how should it be tested, and why should it be tested? The examples given are in C# with NUnit, but I assume the question itself is language agnostic. Here are two current examples of my own, tests on a g...
I would say that what you're actually testing are equivalence classes. In my view, there is no difference between a adding to a list that has 3 items or 7 items. However, there is a difference between 0 items, 1 item and >1 items. I would probably have 3 tests each for Add/Remove methods for these cases initially. Once...
Test cases, "when", "what", and "why"? Being new to test based development, this question has been bugging me. How much is too much? What should be tested, how should it be tested, and why should it be tested? The examples given are in C# with NUnit, but I assume the question itself is language agnostic. Here are two c...
TITLE: Test cases, "when", "what", and "why"? QUESTION: Being new to test based development, this question has been bugging me. How much is too much? What should be tested, how should it be tested, and why should it be tested? The examples given are in C# with NUnit, but I assume the question itself is language agnost...
[ "language-agnostic", "tdd" ]
6
7
241
4
0
2008-10-04T06:49:09.640000
2008-10-04T07:37:29.840000
169,888
170,122
Rspec - problems with switching from plugins to gems
When dropping the use of rspec and rspec-rails plugins and switching to the gem versions instead, is there anything extra I have to change in spec_helper.rb or something to make the specs in my app see the change? I can no longer get my specs to run successfully anymore after deleting the plugins and installing the gem...
From your error message it looks like you do not have a recent version of the hoe gem installed. Try doing a gem install hoe --version '> 1.7.0 and see if it helps. It may be that when you installed the rspec and rspec-rails gems you did not get the dependencies as well and there may be other dependent gems missing.
Rspec - problems with switching from plugins to gems When dropping the use of rspec and rspec-rails plugins and switching to the gem versions instead, is there anything extra I have to change in spec_helper.rb or something to make the specs in my app see the change? I can no longer get my specs to run successfully anym...
TITLE: Rspec - problems with switching from plugins to gems QUESTION: When dropping the use of rspec and rspec-rails plugins and switching to the gem versions instead, is there anything extra I have to change in spec_helper.rb or something to make the specs in my app see the change? I can no longer get my specs to run...
[ "ruby-on-rails", "ruby", "rspec", "rubygems" ]
2
3
1,190
1
0
2008-10-04T06:58:40.557000
2008-10-04T10:58:19.293000
169,889
169,935
What's the best process / app for automated deployment of PHP apps?
There's another post on SO relating to.NET -- not us. Pure PHP. Trying to find the best way/process to deploy stable version of our PHP app. I've seen an article on Capistrano, but am curious what else is out there. Aside from the obvious reasons, I'm also looking to add some scripting so that the SVN rev number gets a...
I've used a home-grown script for quite some time. It will (based on an application configuration file): Run svn export on the repository based on a tag. Package the export into a tar or zip file, which includes the tag in the name. Use scp to copy the package to the appropriate server (QA or release). Connect to the s...
What's the best process / app for automated deployment of PHP apps? There's another post on SO relating to.NET -- not us. Pure PHP. Trying to find the best way/process to deploy stable version of our PHP app. I've seen an article on Capistrano, but am curious what else is out there. Aside from the obvious reasons, I'm ...
TITLE: What's the best process / app for automated deployment of PHP apps? QUESTION: There's another post on SO relating to.NET -- not us. Pure PHP. Trying to find the best way/process to deploy stable version of our PHP app. I've seen an article on Capistrano, but am curious what else is out there. Aside from the obv...
[ "php", "deployment" ]
5
2
4,007
5
0
2008-10-04T07:00:38.620000
2008-10-04T07:48:10.583000
169,894
4,695,438
In Flot, is it possible to eliminate or hide grid ticks without eliminating the corresponding label?
The Flot API documentation describes the library's extensive hooks for customizing the axes of a graph. You can set the number of ticks, their color, etc. separately for each axis. However, I can not figure out how to prevent Flot from drawing the vertical grid lines without also removing the x-axis labels. I've tried ...
As Laurimann noted, Flot continues to evolve. The ability to control this has been added to the API (as noted in the flot issue Nelson linked to). If you download the latest version (which is still labeled 0.6), you can disable lines on an axis with "tickLength", like so: xaxis: { tickLength: 0 } Rather annoyingly, thi...
In Flot, is it possible to eliminate or hide grid ticks without eliminating the corresponding label? The Flot API documentation describes the library's extensive hooks for customizing the axes of a graph. You can set the number of ticks, their color, etc. separately for each axis. However, I can not figure out how to p...
TITLE: In Flot, is it possible to eliminate or hide grid ticks without eliminating the corresponding label? QUESTION: The Flot API documentation describes the library's extensive hooks for customizing the axes of a graph. You can set the number of ticks, their color, etc. separately for each axis. However, I can not f...
[ "javascript", "jquery", "graph", "flot" ]
17
58
15,126
5
0
2008-10-04T07:05:12.167000
2011-01-14T20:11:10.370000
169,897
169,913
How to package Twisted program with py2exe?
I tried to package a Twisted program with py2exe, but once I run the exe file I built, I got a "No module named resource" error. And I found the py2exe said: The following modules appear to be missing ['FCNTL', 'OpenSSL', 'email.Generator', 'email.Iterators', 'email.Utils', 'pkg_resources', 'pywintypes', 'resource', 'w...
I've seen this before... py2exe, for some reason, is not detecting that these modules are needed inside the ZIP archive and is leaving them out. You can explicitly specify modules to include on the py2exe command line: python setup.py py2exe -p win32com -i twisted.web.resource Something like that. Read up on the option...
How to package Twisted program with py2exe? I tried to package a Twisted program with py2exe, but once I run the exe file I built, I got a "No module named resource" error. And I found the py2exe said: The following modules appear to be missing ['FCNTL', 'OpenSSL', 'email.Generator', 'email.Iterators', 'email.Utils', '...
TITLE: How to package Twisted program with py2exe? QUESTION: I tried to package a Twisted program with py2exe, but once I run the exe file I built, I got a "No module named resource" error. And I found the py2exe said: The following modules appear to be missing ['FCNTL', 'OpenSSL', 'email.Generator', 'email.Iterators'...
[ "python", "twisted", "py2exe" ]
11
11
8,867
2
0
2008-10-04T07:08:05.390000
2008-10-04T07:21:29.810000
169,904
169,950
Can I listen on a port (using HttpListener or other .NET code) on Vista without requiring administrator priveleges?
I'm using HttpListener to allow a user to set up a proxy on a user-defined port. When I start the HttpListener, I get an exception if the application isn't running under administrator privileges in Vista. From what I've read, this is expected behavior - administrator privileges are required to start listening on a port...
I've never used an HttpListener, but from your description it sounds more like you want to listen on a regular TCP port, instead of embedding your application into a server URL namespace (which is what HttpListener appears to do). You should be able to use regular socket functions (System.Net.Sockets.TcpListener) to op...
Can I listen on a port (using HttpListener or other .NET code) on Vista without requiring administrator priveleges? I'm using HttpListener to allow a user to set up a proxy on a user-defined port. When I start the HttpListener, I get an exception if the application isn't running under administrator privileges in Vista....
TITLE: Can I listen on a port (using HttpListener or other .NET code) on Vista without requiring administrator priveleges? QUESTION: I'm using HttpListener to allow a user to set up a proxy on a user-defined port. When I start the HttpListener, I get an exception if the application isn't running under administrator pr...
[ ".net", "windows-vista", "permissions" ]
43
9
39,119
5
0
2008-10-04T07:14:50.773000
2008-10-04T07:58:52.120000
169,905
169,912
Where is the history of the 'run' dialogue saved on Windows XP?
I want to write a script which cleans the 'run' dialogue automatically every log off. Where is the history stored?
From: How to Remove Individual Entries from Run Command History Where is the Run MRU (Most Recently Used) List? The RUNMRU list is stored in the Windows Registry in the following location: HKEY_CURRENT_USER\ Software\ Microsoft\ Windows\ CurrentVersion\ Explorer\ RunMRU\ Is There a Program to Delete Individual Entries ...
Where is the history of the 'run' dialogue saved on Windows XP? I want to write a script which cleans the 'run' dialogue automatically every log off. Where is the history stored?
TITLE: Where is the history of the 'run' dialogue saved on Windows XP? QUESTION: I want to write a script which cleans the 'run' dialogue automatically every log off. Where is the history stored? ANSWER: From: How to Remove Individual Entries from Run Command History Where is the Run MRU (Most Recently Used) List? Th...
[ "windows", "windows-xp" ]
1
6
8,307
3
0
2008-10-04T07:17:00.473000
2008-10-04T07:20:45.177000
169,907
169,945
How do I base64 encode a string efficiently using Excel VBA?
I need to encode a 100KB+ string as base64 in VBA. Are there any built-in functions or COM objects available which will do this as a pure VBA approach is either complex or doesn't scale well at these volumes (see links from dbb and marxidad )?
You can use the MSXML Base64 encoding functionality as described at www.nonhostile.com/howto-encode-decode-base64-vb6.asp: Function EncodeBase64(text As String) As String Dim arrData() As Byte arrData = StrConv(text, vbFromUnicode) Dim objXML As MSXML2.DOMDocument Dim objNode As MSXML2.IXMLDOMElement Set objXML = New...
How do I base64 encode a string efficiently using Excel VBA? I need to encode a 100KB+ string as base64 in VBA. Are there any built-in functions or COM objects available which will do this as a pure VBA approach is either complex or doesn't scale well at these volumes (see links from dbb and marxidad )?
TITLE: How do I base64 encode a string efficiently using Excel VBA? QUESTION: I need to encode a 100KB+ string as base64 in VBA. Are there any built-in functions or COM objects available which will do this as a pure VBA approach is either complex or doesn't scale well at these volumes (see links from dbb and marxidad ...
[ "vba", "excel", "encoding", "base64" ]
35
58
152,417
3
0
2008-10-04T07:19:42.667000
2008-10-04T07:55:23.127000
169,908
169,957
View MS Access Report in .net ReportViewer control
Is it possible to view an MS Access report in the.Net ReportViewer control?
I dont think so...you first need to migrate the reports to SSRS. http://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/migratereports.mspx
View MS Access Report in .net ReportViewer control Is it possible to view an MS Access report in the.Net ReportViewer control?
TITLE: View MS Access Report in .net ReportViewer control QUESTION: Is it possible to view an MS Access report in the.Net ReportViewer control? ANSWER: I dont think so...you first need to migrate the reports to SSRS. http://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/migratereports.mspx
[ "c#", ".net", "vb.net", "ms-access", "reportviewer" ]
2
1
2,876
1
0
2008-10-04T07:19:45.180000
2008-10-04T08:10:16.280000
169,925
169,932
How to convert a string into double and vice versa?
I want to convert a string into a double and after doing some math on it, convert it back to a string. How do I do this in Objective-C? Is there a way to round a double to the nearest integer too?
You can convert an NSString into a double with double myDouble = [myString doubleValue]; Rounding to the nearest int can then be done as int myInt = (int)(myDouble + (myDouble>0? 0.5: -0.5)) I'm honestly not sure if there's a more streamlined way to convert back into a string than NSString* myNewString = [NSString stri...
How to convert a string into double and vice versa? I want to convert a string into a double and after doing some math on it, convert it back to a string. How do I do this in Objective-C? Is there a way to round a double to the nearest integer too?
TITLE: How to convert a string into double and vice versa? QUESTION: I want to convert a string into a double and after doing some math on it, convert it back to a string. How do I do this in Objective-C? Is there a way to round a double to the nearest integer too? ANSWER: You can convert an NSString into a double wi...
[ "objective-c" ]
147
235
278,771
12
0
2008-10-04T07:36:01.107000
2008-10-04T07:45:08.980000
169,928
169,931
Where can I find some good information about how the new canvas HTML element works?
I keep reading about how great this new Canvas element for HTML5 is and I see amazing demos done with just javascript and no flash. Where can I find some good information on how to some of these things myself?
The specification defines the API and behaviour. This tutorial should help you get started.
Where can I find some good information about how the new canvas HTML element works? I keep reading about how great this new Canvas element for HTML5 is and I see amazing demos done with just javascript and no flash. Where can I find some good information on how to some of these things myself?
TITLE: Where can I find some good information about how the new canvas HTML element works? QUESTION: I keep reading about how great this new Canvas element for HTML5 is and I see amazing demos done with just javascript and no flash. Where can I find some good information on how to some of these things myself? ANSWER:...
[ "javascript", "html", "canvas" ]
3
7
670
6
0
2008-10-04T07:39:10.570000
2008-10-04T07:44:40.743000
169,929
169,937
JUnit Eclipse plugin source-code?
I'm looking into writing an Eclipse plugin for FlexUnit and was wondering where I could get the sources for the JUnit Eclipse plugin. I checked the JUnit sources at sourceforge but couldn't spot any code that looked like the plugin code. Any idea where this code is available?
You can find it on Eclipse's repository: http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.pde.junit/
JUnit Eclipse plugin source-code? I'm looking into writing an Eclipse plugin for FlexUnit and was wondering where I could get the sources for the JUnit Eclipse plugin. I checked the JUnit sources at sourceforge but couldn't spot any code that looked like the plugin code. Any idea where this code is available?
TITLE: JUnit Eclipse plugin source-code? QUESTION: I'm looking into writing an Eclipse plugin for FlexUnit and was wondering where I could get the sources for the JUnit Eclipse plugin. I checked the JUnit sources at sourceforge but couldn't spot any code that looked like the plugin code. Any idea where this code is av...
[ "eclipse", "open-source", "junit", "eclipse-plugin", "flexunit" ]
8
12
6,051
3
0
2008-10-04T07:39:37.340000
2008-10-04T07:50:25.867000
169,936
170,944
What is a reasonable size for an iPhone App?
I'm wondering what's a reasonable size for iPhone Apps. Right now I'm working on an iPhone game, and of course it loads fast into my device since I'm connected directly to it through a USB cable, but I've no idea how long it would actually take to download from the App Store. In my case it's about 2mb in size, which is...
Looking through some of the games i have on my phone they weigh in around 7 or 8 mb a pop. I think your 2mb will be fine. One thing i can tell you for sure is that if you want to be distributable over the cell network your application has to be under 50 mb. If you exceed this it will have to be downloaded using wifi or...
What is a reasonable size for an iPhone App? I'm wondering what's a reasonable size for iPhone Apps. Right now I'm working on an iPhone game, and of course it loads fast into my device since I'm connected directly to it through a USB cable, but I've no idea how long it would actually take to download from the App Store...
TITLE: What is a reasonable size for an iPhone App? QUESTION: I'm wondering what's a reasonable size for iPhone Apps. Right now I'm working on an iPhone game, and of course it loads fast into my device since I'm connected directly to it through a USB cable, but I've no idea how long it would actually take to download ...
[ "iphone" ]
9
13
16,895
4
0
2008-10-04T07:49:20.453000
2008-10-04T20:26:00.223000
169,981
189,937
Mock testing and PHP's magic __get method
I'm having problems when trying to mock objects with __get and __set methods (using simpletest ). Writing mock responses for __get doesn't smell right - the tests seem too tightly tied to implementation. Any recommendations for testing, or should I just avoid the magic methods completely?
I had the same problem and found the solution in the SimpleTest test cases: From mock_objects_test.php: class ClassWithSpecialMethods { function __get($name) { } function __set($name, $value) { } function __isset($name) { } function __unset($name) { } function __call($method, $arguments) { } function __toString() { } }...
Mock testing and PHP's magic __get method I'm having problems when trying to mock objects with __get and __set methods (using simpletest ). Writing mock responses for __get doesn't smell right - the tests seem too tightly tied to implementation. Any recommendations for testing, or should I just avoid the magic methods ...
TITLE: Mock testing and PHP's magic __get method QUESTION: I'm having problems when trying to mock objects with __get and __set methods (using simpletest ). Writing mock responses for __get doesn't smell right - the tests seem too tightly tied to implementation. Any recommendations for testing, or should I just avoid ...
[ "php", "testing" ]
4
3
3,610
1
0
2008-10-04T08:28:23.043000
2008-10-10T02:37:30.393000
169,989
170,022
What is your experience with auditing features (Oracle)?
Did you ever use Oracle auditing features on a production db? How did that impact on performances, and are there differences you noticed between different versions of Oracle?
Perfomance-wise, you'd need to auditing a hell of a lot of information for Oracle 10.2 FGA to be a significant problem. I haven't used earlier versions or 11g. Even simply for manageability reasons, you need to look at auditing only pertinent information... From the top of my head, I don't see why CPU/IO utilization wo...
What is your experience with auditing features (Oracle)? Did you ever use Oracle auditing features on a production db? How did that impact on performances, and are there differences you noticed between different versions of Oracle?
TITLE: What is your experience with auditing features (Oracle)? QUESTION: Did you ever use Oracle auditing features on a production db? How did that impact on performances, and are there differences you noticed between different versions of Oracle? ANSWER: Perfomance-wise, you'd need to auditing a hell of a lot of in...
[ "database", "oracle" ]
3
1
206
1
0
2008-10-04T08:32:26.873000
2008-10-04T09:11:17.917000
170,001
175,968
FCKeditor vs TinyMCE and XHTML Compliance
I'm after (short) opinions on FCKeditor vs TinyMCE and whether either or both are XHTML compliant. In the interest of keeping with the spirit of stackoverflow, if someone has already made your point, just upvote them.
From my experience FCKEditor does indeed produce XHTML compliant code, but that code is slightly different depending on what browser you're in. Mostly, this was related to the enter key producing either a break or a paragraph, and I think it may have been configurable.
FCKeditor vs TinyMCE and XHTML Compliance I'm after (short) opinions on FCKeditor vs TinyMCE and whether either or both are XHTML compliant. In the interest of keeping with the spirit of stackoverflow, if someone has already made your point, just upvote them.
TITLE: FCKeditor vs TinyMCE and XHTML Compliance QUESTION: I'm after (short) opinions on FCKeditor vs TinyMCE and whether either or both are XHTML compliant. In the interest of keeping with the spirit of stackoverflow, if someone has already made your point, just upvote them. ANSWER: From my experience FCKEditor does...
[ "html", "tinymce", "fckeditor", "richtextediting" ]
5
1
3,587
3
0
2008-10-04T08:40:37.607000
2008-10-06T20:06:54.630000
170,004
170,056
How to remove only the parent element and not its child elements in JavaScript?
Let's say: pre text child foo child bar nested text post text to this: pre text child foo child bar nested text post text I've been figuring out using Mootools, jQuery and even (raw) JavaScript, but couldn't get the idea how to do this.
Using jQuery you can do this: var cnt = $(".remove-just-this").contents(); $(".remove-just-this").replaceWith(cnt); Quick links to the documentation: contents ( ): jQuery replaceWith ( content: [ String | Element | jQuery ] ): jQuery
How to remove only the parent element and not its child elements in JavaScript? Let's say: pre text child foo child bar nested text post text to this: pre text child foo child bar nested text post text I've been figuring out using Mootools, jQuery and even (raw) JavaScript, but couldn't get the idea how to do this.
TITLE: How to remove only the parent element and not its child elements in JavaScript? QUESTION: Let's say: pre text child foo child bar nested text post text to this: pre text child foo child bar nested text post text I've been figuring out using Mootools, jQuery and even (raw) JavaScript, but couldn't get the idea h...
[ "javascript", "dom" ]
102
143
76,369
13
0
2008-10-04T08:46:37.577000
2008-10-04T09:37:35.073000
170,006
170,024
Please comment on this simple software protection schema
I was asked implement a licensing schema for our product. They are very expensive products with few customers sparsely distributed around the world and basically every one of them has a design environment (a windows application installed on single windows machines, from 1 to 150 client machines per customer) and a web ...
I have yet to see a licensing scheme that wasn't broken in a few weeks provided there was sufficient interest. Your scheme looks very good (though be certain that if someone really wants to, they'll break it). Whatever you do, you should follow Eric Sink's advice: The goal should simply be to "keep honest people honest...
Please comment on this simple software protection schema I was asked implement a licensing schema for our product. They are very expensive products with few customers sparsely distributed around the world and basically every one of them has a design environment (a windows application installed on single windows machine...
TITLE: Please comment on this simple software protection schema QUESTION: I was asked implement a licensing schema for our product. They are very expensive products with few customers sparsely distributed around the world and basically every one of them has a design environment (a windows application installed on sing...
[ "drm" ]
2
10
803
4
0
2008-10-04T08:48:17.450000
2008-10-04T09:12:42.097000
170,009
170,181
Your Scrum definition of Done
While Scrum is easy in theory and hard in practice, I wanted to hear your definition of Done; i.e. what are the gates (unit test, code coverage > 80%, code reviews, load tests, perf.test, functional tests, etc.) your product has to go through before you can label the product "Done"
I'd say it is up to your team to decide. Talk with the product owner. Ideally done would be when a story is in Production and being used. However, there is a time gap between when a story is development complete and in Live. Makes it hard to track how long a story took to develop. In my team, our definition of done is,...
Your Scrum definition of Done While Scrum is easy in theory and hard in practice, I wanted to hear your definition of Done; i.e. what are the gates (unit test, code coverage > 80%, code reviews, load tests, perf.test, functional tests, etc.) your product has to go through before you can label the product "Done"
TITLE: Your Scrum definition of Done QUESTION: While Scrum is easy in theory and hard in practice, I wanted to hear your definition of Done; i.e. what are the gates (unit test, code coverage > 80%, code reviews, load tests, perf.test, functional tests, etc.) your product has to go through before you can label the prod...
[ "agile", "scrum" ]
24
8
10,067
5
0
2008-10-04T08:52:42.683000
2008-10-04T11:39:33.797000
170,019
170,031
In PHP will a session be created if a browser is not used
I have an API that is dependent on certain state information between requests. As an easy first version of the code, I am simply using PHP session's to store the state information instead of something more advanced (APC, memcache, DB). Throughout my initial testing in a web browser, everything worked perfectly. However...
Session Cookies Remember that HTTP is stateless, so sessions are tracked on your server, but the client has to identify itself with each request. When you declare session_start(), your browser is usually setting a cookie (the "PHP Session Id"), and then identifying itself by sending the cookie value with each request. ...
In PHP will a session be created if a browser is not used I have an API that is dependent on certain state information between requests. As an easy first version of the code, I am simply using PHP session's to store the state information instead of something more advanced (APC, memcache, DB). Throughout my initial test...
TITLE: In PHP will a session be created if a browser is not used QUESTION: I have an API that is dependent on certain state information between requests. As an easy first version of the code, I am simply using PHP session's to store the state information instead of something more advanced (APC, memcache, DB). Througho...
[ "php", "session", "browser" ]
7
21
3,831
3
0
2008-10-04T09:09:28.407000
2008-10-04T09:17:55.970000
170,021
170,037
What factors that degrade the performance of a SQL Server 2000 Job?
We are currently running a SQL Job that archives data daily at every 10PM. However, the end users complains that from 10PM to 12, the page shows a time out error. Here's the pseudocode of the job while @jobArchive = 1 and @countProcecessedItem < @maxItem exec ArchiveItems @countProcecessedItem out if error occured set ...
Only thing not clear is it the ArchiveItems also delete or not data from database. Deleting rows in SQL Server is a very expensive operation that causes a lot of Locking condition on the database, with possibility to have table and database locks and this typically causes timeout. If you're deleting data what you can d...
What factors that degrade the performance of a SQL Server 2000 Job? We are currently running a SQL Job that archives data daily at every 10PM. However, the end users complains that from 10PM to 12, the page shows a time out error. Here's the pseudocode of the job while @jobArchive = 1 and @countProcecessedItem < @maxIt...
TITLE: What factors that degrade the performance of a SQL Server 2000 Job? QUESTION: We are currently running a SQL Job that archives data daily at every 10PM. However, the end users complains that from 10PM to 12, the page shows a time out error. Here's the pseudocode of the job while @jobArchive = 1 and @countProcec...
[ "sql-server", "performance" ]
1
1
248
3
0
2008-10-04T09:10:19.543000
2008-10-04T09:20:21.567000
170,028
170,040
How would you simplify Entering and Exiting a ReaderWriterLock?
This seems very noisy to me. Five lines of overhead is just too much. m_Lock.EnterReadLock() Try Return m_List.Count Finally m_Lock.ExitReadLock() End Try So how would you simply this?
I was thinking the same, but in C#;-p using System; using System.Threading; class Program { static void Main() { ReaderWriterLockSlim sync = new ReaderWriterLockSlim(); using (sync.Read()) { // etc } } } public static class ReaderWriterExt { sealed class ReadLockToken: IDisposable { private ReaderWriterLockSlim sync...
How would you simplify Entering and Exiting a ReaderWriterLock? This seems very noisy to me. Five lines of overhead is just too much. m_Lock.EnterReadLock() Try Return m_List.Count Finally m_Lock.ExitReadLock() End Try So how would you simply this?
TITLE: How would you simplify Entering and Exiting a ReaderWriterLock? QUESTION: This seems very noisy to me. Five lines of overhead is just too much. m_Lock.EnterReadLock() Try Return m_List.Count Finally m_Lock.ExitReadLock() End Try So how would you simply this? ANSWER: I was thinking the same, but in C#;-p using ...
[ "c#", ".net", "vb.net", "parallel-processing", "readerwriterlock" ]
11
23
6,325
5
0
2008-10-04T09:16:16.427000
2008-10-04T09:24:22.527000
170,036
170,057
Decent profiler for Windows?
Does windows have any decent sampling (eg. non-instrumenting) profilers available? Preferably something akin to Shark on MacOS, although i am willing to accept that i am going to have to pay for such a profiler on windows. I've tried the profiler in VS Team Suite and was not overly impressed, and was wondering if there...
Intel VTune is good and is non-instrumenting. We evaluated a whole bunch of profilers for Windows, and this was the best for working with driver code (though it does unmanaged user level code as well). A particular strength is that it reads all the Intel processor performance counters, so you can get a good understandi...
Decent profiler for Windows? Does windows have any decent sampling (eg. non-instrumenting) profilers available? Preferably something akin to Shark on MacOS, although i am willing to accept that i am going to have to pay for such a profiler on windows. I've tried the profiler in VS Team Suite and was not overly impresse...
TITLE: Decent profiler for Windows? QUESTION: Does windows have any decent sampling (eg. non-instrumenting) profilers available? Preferably something akin to Shark on MacOS, although i am willing to accept that i am going to have to pay for such a profiler on windows. I've tried the profiler in VS Team Suite and was n...
[ "c++", "windows", "performance", "profiling" ]
24
11
14,871
9
0
2008-10-04T09:20:16.667000
2008-10-04T09:38:43.900000
170,051
170,094
How would you simply Monitor.TryEnter
I'm trying to make things simpler. Here is my code: If Threading.Monitor.TryEnter(syncRoot) Then Try 'do something Finally Threading.Monitor.Exit(syncRoot) End Try Else 'do something else End If This is even worse than the ReaderWriterLock in terms of noise. I can use C# or VB, so answers applying to either will be wel...
Use a delegate? E.g. public bool TryEnter(object lockObject, Action work) { if (Monitor.TryEnter(lockObject)) { try { work(); } finally { Monitor.Exit(lockObject); } return true; } return false; }
How would you simply Monitor.TryEnter I'm trying to make things simpler. Here is my code: If Threading.Monitor.TryEnter(syncRoot) Then Try 'do something Finally Threading.Monitor.Exit(syncRoot) End Try Else 'do something else End If This is even worse than the ReaderWriterLock in terms of noise. I can use C# or VB, so ...
TITLE: How would you simply Monitor.TryEnter QUESTION: I'm trying to make things simpler. Here is my code: If Threading.Monitor.TryEnter(syncRoot) Then Try 'do something Finally Threading.Monitor.Exit(syncRoot) End Try Else 'do something else End If This is even worse than the ReaderWriterLock in terms of noise. I can...
[ "c#", ".net", "vb.net", "parallel-processing" ]
2
6
4,445
2
0
2008-10-04T09:34:18.450000
2008-10-04T10:31:55.510000
170,061
624,295
Is there a way to group RadioButtons generated from the ItemTemplate of an ItemsControl
The problem is that the RadioButton.GroupName behavior depends on the logical tree to find a common ancestor and effectively scope it's use to that part of the tree, but silverlight's ItemsControl doesn't maintain the logical tree. This means, in your example, the RadioButton's Parent property is always null I built a ...
Is there a way to group RadioButtons generated from the ItemTemplate of an ItemsControl
TITLE: Is there a way to group RadioButtons generated from the ItemTemplate of an ItemsControl ANSWER: The problem is that the RadioButton.GroupName behavior depends on the logical tree to find a common ancestor and effectively scope it's use to that part of the tree, but silverlight's ItemsControl doesn't maintain th...
[ "silverlight", "xaml" ]
4
4
3,556
2
0
2008-10-04T09:43:35.607000
2009-03-08T21:10:54.377000
170,064
170,385
What utilities can provide database hits/duration per page?
SQL Server profiler is great for profiling SQL Server performance for web apps. However, when I'm testing my webapp I'd like a summary of database hits/duration per page. Does anybody know of any utilities for giving you this kind of information?
If you want duration per page, I'd recommand Google Analytics. If you want a summary of database hits (ie, you run three procedures during one page load so you want to show a count of three) then I would recommend adding auditing code to your sprocs. Alternately (though more expensively in terms of processing) you coul...
What utilities can provide database hits/duration per page? SQL Server profiler is great for profiling SQL Server performance for web apps. However, when I'm testing my webapp I'd like a summary of database hits/duration per page. Does anybody know of any utilities for giving you this kind of information?
TITLE: What utilities can provide database hits/duration per page? QUESTION: SQL Server profiler is great for profiling SQL Server performance for web apps. However, when I'm testing my webapp I'd like a summary of database hits/duration per page. Does anybody know of any utilities for giving you this kind of informat...
[ "asp.net", "sql-server", "profiler" ]
0
1
269
2
0
2008-10-04T09:47:25.350000
2008-10-04T14:10:00.560000
170,070
170,084
What are the differences between using the New keyword and calling CreateObject in Excel VBA?
What criteria should I use to decide whether I write VBA code like this: Set xmlDocument = New MSXML2.DOMDocument or like this: Set xmlDocument = CreateObject("MSXML2.DOMDocument")?
As long as the variable is not typed as object Dim xmlDocument as MSXML2.DOMDocument Set xmlDocument = CreateObject("MSXML2.DOMDocument") is the same as Dim xmlDocument as MSXML2.DOMDocument Set xmlDocument = New MSXML2.DOMDocument both use early binding. Whereas Dim xmlDocument as Object Set xmlDocument = CreateObject...
What are the differences between using the New keyword and calling CreateObject in Excel VBA? What criteria should I use to decide whether I write VBA code like this: Set xmlDocument = New MSXML2.DOMDocument or like this: Set xmlDocument = CreateObject("MSXML2.DOMDocument")?
TITLE: What are the differences between using the New keyword and calling CreateObject in Excel VBA? QUESTION: What criteria should I use to decide whether I write VBA code like this: Set xmlDocument = New MSXML2.DOMDocument or like this: Set xmlDocument = CreateObject("MSXML2.DOMDocument")? ANSWER: As long as the va...
[ "vba", "excel", "binding", "com" ]
11
12
11,391
3
0
2008-10-04T09:59:56.620000
2008-10-04T10:22:50.880000
170,088
171,413
How to create an X++ batch job in Axapta 3.0?
I'd like to create a batch job in X++ for Microsoft Axapta 3.0 (Dynamics AX). How can I create a job which executes an X++ function like this one? static void ExternalDataRead(Args _args) {... }
Here's the bare minimum needed to create a batch job in AX: Create a batch job by creating a new class that extends the RunBaseBatch class: class MyBatchJob extends RunBaseBatch { } Implement the abstract method pack(): public container pack() { return connull(); } Implement the abstract method unpack(): public boolean...
How to create an X++ batch job in Axapta 3.0? I'd like to create a batch job in X++ for Microsoft Axapta 3.0 (Dynamics AX). How can I create a job which executes an X++ function like this one? static void ExternalDataRead(Args _args) {... }
TITLE: How to create an X++ batch job in Axapta 3.0? QUESTION: I'd like to create a batch job in X++ for Microsoft Axapta 3.0 (Dynamics AX). How can I create a job which executes an X++ function like this one? static void ExternalDataRead(Args _args) {... } ANSWER: Here's the bare minimum needed to create a batch job...
[ "axapta", "x++" ]
4
8
5,251
1
0
2008-10-04T10:25:12.277000
2008-10-05T03:10:36.007000
170,097
170,162
Adding gdb to MinGW
I've gone to http://sourceforge.net/project/showfiles.php?group_id=2435, downloaded the Automated MinGW Installer for MinGW 5.1.4 and at the same time the GNU Source-Level Debugger Release Candidate: GDB 6.8-3. I've then installed MinGW base tools into C:\MinGW. No problem so far. However when I come to install the gdb...
The Current Release (5.2.1) version of gdb at the project files page has always worked for me. The download is a stand-alone.exe, you don't need anything else. But I'll bet the.exe in the 6.8 package will work, too. I'd try using just the.exe, and then if there are problems, try extracting the other files from the 6.8 ...
Adding gdb to MinGW I've gone to http://sourceforge.net/project/showfiles.php?group_id=2435, downloaded the Automated MinGW Installer for MinGW 5.1.4 and at the same time the GNU Source-Level Debugger Release Candidate: GDB 6.8-3. I've then installed MinGW base tools into C:\MinGW. No problem so far. However when I com...
TITLE: Adding gdb to MinGW QUESTION: I've gone to http://sourceforge.net/project/showfiles.php?group_id=2435, downloaded the Automated MinGW Installer for MinGW 5.1.4 and at the same time the GNU Source-Level Debugger Release Candidate: GDB 6.8-3. I've then installed MinGW base tools into C:\MinGW. No problem so far. ...
[ "gdb", "mingw" ]
31
16
69,666
6
0
2008-10-04T10:35:46.593000
2008-10-04T11:20:33.883000
170,140
170,759
How do I add the interactive user to a directory in a localized Windows using WiX?
How do I add the Swedish interactive user, NT INSTANS\INTERAKTIV or the English interactive user, NT AUTHORITY\INTERACTIVE or any other localised user group with write permissions to a program folder's ACL? Is this question actually "How do I use secureObject "? I cannot use the LockPermissions Table because I undestan...
With recent releases of Wix, you can retrieve the localized names of often-used built-in user and group names via a property. For example, WIX_ACCOUNT_NETWORKSERVICE contains the localized name of the Network Service account. Unfortunately, as of 3.0.4513 NT AUTHORITY\INTERACTIVE is not among them. There exists a sampl...
How do I add the interactive user to a directory in a localized Windows using WiX? How do I add the Swedish interactive user, NT INSTANS\INTERAKTIV or the English interactive user, NT AUTHORITY\INTERACTIVE or any other localised user group with write permissions to a program folder's ACL? Is this question actually "How...
TITLE: How do I add the interactive user to a directory in a localized Windows using WiX? QUESTION: How do I add the Swedish interactive user, NT INSTANS\INTERAKTIV or the English interactive user, NT AUTHORITY\INTERACTIVE or any other localised user group with write permissions to a program folder's ACL? Is this ques...
[ "wix", "windows-installer" ]
4
6
2,180
2
0
2008-10-04T11:05:33.600000
2008-10-04T17:57:24.283000
170,152
170,209
Prevent users from starting multiple accounts?
I know that in the end it, can't be done. But, what are the options to: a) limit the options for persons to create multiple accounts, b) increase the chance of detecting multiple accounts / person for a blog-like web service? (people can sign up for their own blog) Update: I think the 'limit the options' has been answe...
I'm assuming you're talking about a free service? I can't think of any ways that don't either have serious drawbacks or would be trivial to defeat. Things like setting a cookie, requiring a unique e-mail address are easy to defeat. Requiring a unique IP address is not foolproof but might work to some degree, up to the ...
Prevent users from starting multiple accounts? I know that in the end it, can't be done. But, what are the options to: a) limit the options for persons to create multiple accounts, b) increase the chance of detecting multiple accounts / person for a blog-like web service? (people can sign up for their own blog) Update:...
TITLE: Prevent users from starting multiple accounts? QUESTION: I know that in the end it, can't be done. But, what are the options to: a) limit the options for persons to create multiple accounts, b) increase the chance of detecting multiple accounts / person for a blog-like web service? (people can sign up for their...
[ "registration", "accounts", "user-identification" ]
36
40
21,819
10
0
2008-10-04T11:12:10.170000
2008-10-04T12:03:04.297000
170,164
170,170
How to debug JavaScript in IE?
Is there a better way to debug JavaScript than MS Script Editor? I am searching for something like Firebug. Firebug Lite doesn't offer this functionality, though. ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
Use Visual Studio 2008. The Web Development Helper from Nikhilk is useful as is the Internet Explorer Developer Toolbar ( http://www.microsoft.com/en-us/download/details.aspx?id=18359 ). They are not as good as FireBug though:-(
How to debug JavaScript in IE? Is there a better way to debug JavaScript than MS Script Editor? I am searching for something like Firebug. Firebug Lite doesn't offer this functionality, though. ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
TITLE: How to debug JavaScript in IE? QUESTION: Is there a better way to debug JavaScript than MS Script Editor? I am searching for something like Firebug. Firebug Lite doesn't offer this functionality, though. ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ ANSWER: Use Visual Studio 2008. The Web Development Helpe...
[ "javascript", "internet-explorer" ]
10
7
3,482
9
0
2008-10-04T11:22:47.170000
2008-10-04T11:26:10.610000
170,168
203,582
jQuery templating engines
I am looking for a template engine to use client side. I have been trying a few like jsRepeater and jQuery Templates. While they seem to work OK in FireFox they all seem to break down in IE7 when it comes down to rendering HTML tables. I also took a look at MicrosoftAjaxTemplates.js (from http://www.codeplex.com/aspnet...
Check out Rick Strahl's post Client Templating with jQuery. He explores jTemplates, but then makes a better case for John Resig's micro-templating solution, even improving it some. Good comparisons, lots of samples.
jQuery templating engines I am looking for a template engine to use client side. I have been trying a few like jsRepeater and jQuery Templates. While they seem to work OK in FireFox they all seem to break down in IE7 when it comes down to rendering HTML tables. I also took a look at MicrosoftAjaxTemplates.js (from http...
TITLE: jQuery templating engines QUESTION: I am looking for a template engine to use client side. I have been trying a few like jsRepeater and jQuery Templates. While they seem to work OK in FireFox they all seem to break down in IE7 when it comes down to rendering HTML tables. I also took a look at MicrosoftAjaxTempl...
[ "jquery", "templates", "jsrender" ]
204
109
93,182
18
0
2008-10-04T11:25:10.223000
2008-10-15T03:01:45.010000
170,180
170,257
Looping over elements in jQuery
I want to loop over the elements of an HTML form, and store the values of the fields in an object. The following code doesn't work, though: function config() { $("#frmMain").children().map(function() { var child = $("this"); if (child.is(":checkbox")) this[child.attr("name")] = child.attr("checked"); if (child.is(":rad...
don't think you need quotations on this: var child = $("this"); try: var child = $(this);
Looping over elements in jQuery I want to loop over the elements of an HTML form, and store the values of the fields in an object. The following code doesn't work, though: function config() { $("#frmMain").children().map(function() { var child = $("this"); if (child.is(":checkbox")) this[child.attr("name")] = child.att...
TITLE: Looping over elements in jQuery QUESTION: I want to loop over the elements of an HTML form, and store the values of the fields in an object. The following code doesn't work, though: function config() { $("#frmMain").children().map(function() { var child = $("this"); if (child.is(":checkbox")) this[child.attr("n...
[ "javascript", "jquery" ]
27
40
107,457
7
0
2008-10-04T11:39:25.497000
2008-10-04T12:26:30.443000
170,186
170,205
Set a database value to null with a SqlCommand + parameters
I was previously taught today how to set parameters in a SQL query in.NET in this answer ( click ). Using parameters with values are fine, but when I try to set a field in the database to null I'm unsuccessful. Either the method thinks I am not setting a valid parameter or not specifying a parameter. e.g. Dim dc As New...
you want DBNull.Value. In my shared DAL code, I use a helper method that just does: foreach (IDataParameter param in cmd.Parameters) { if (param.Value == null) param.Value = DBNull.Value; }
Set a database value to null with a SqlCommand + parameters I was previously taught today how to set parameters in a SQL query in.NET in this answer ( click ). Using parameters with values are fine, but when I try to set a field in the database to null I'm unsuccessful. Either the method thinks I am not setting a valid...
TITLE: Set a database value to null with a SqlCommand + parameters QUESTION: I was previously taught today how to set parameters in a SQL query in.NET in this answer ( click ). Using parameters with values are fine, but when I try to set a field in the database to null I'm unsuccessful. Either the method thinks I am n...
[ ".net", "sql" ]
34
90
36,391
3
0
2008-10-04T11:44:39.467000
2008-10-04T11:58:18.563000
170,203
170,250
How do you make Flash not render an object on the Stage?
This discussion started over here but I thought it would be nice to have a definitive answer... So let's say you have MovieClip on the Stage (or a UIComponent for the Flex audience) - what do you have to do to not make it so that the user can't see the object but also so that the AVM2 doesn't even factor it in when ren...
The hack is for Flash 8 (Actionscript 2) or below. With the upgrades to Actionscript 3 and Flex 2/3 setting the visible property is enough.
How do you make Flash not render an object on the Stage? This discussion started over here but I thought it would be nice to have a definitive answer... So let's say you have MovieClip on the Stage (or a UIComponent for the Flex audience) - what do you have to do to not make it so that the user can't see the object but...
TITLE: How do you make Flash not render an object on the Stage? QUESTION: This discussion started over here but I thought it would be nice to have a definitive answer... So let's say you have MovieClip on the Stage (or a UIComponent for the Flex audience) - what do you have to do to not make it so that the user can't ...
[ "apache-flex", "flash", "actionscript-3", "optimization" ]
0
2
1,528
5
0
2008-10-04T11:58:10.437000
2008-10-04T12:19:07.993000
170,207
176,372
How to improve garbage collection performance?
What kind of optimization patterns can be used to improve the performance of the garbage collector? My reason for asking is that I do a lot of embedded software using the Compact Framework. On slow devices the garbage collection can become a problem, and I would like to reduce the times the garbage collector kicks in, ...
The key is to understand how the CF GC works for allocations. It's a simple mark-and-sweep, non-generational GC with specific algorithms for what will trigger a GC, and what will cause compaction and/or pitching after collection. There is almost nothing you can do at an app level to control the GC (the only method avai...
How to improve garbage collection performance? What kind of optimization patterns can be used to improve the performance of the garbage collector? My reason for asking is that I do a lot of embedded software using the Compact Framework. On slow devices the garbage collection can become a problem, and I would like to re...
TITLE: How to improve garbage collection performance? QUESTION: What kind of optimization patterns can be used to improve the performance of the garbage collector? My reason for asking is that I do a lot of embedded software using the Compact Framework. On slow devices the garbage collection can become a problem, and ...
[ ".net", "optimization", "compact-framework", "embedded", "garbage-collection" ]
9
12
3,148
6
0
2008-10-04T12:00:22.367000
2008-10-06T21:58:57.540000
170,223
170,240
Hashes of Hashes Idiom in Ruby?
Creating hashes of hashes in Ruby allows for convenient two (or more) dimensional lookups. However, when inserting one must always check if the first index already exists in the hash. For example: h = Hash.new h['x'] = Hash.new if not h.key?('x') h['x']['y'] = value_to_insert It would be preferable to do the following ...
You can pass the Hash.new function a block that is executed to yield a default value in case the queried value doesn't exist yet: h = Hash.new { |h, k| h[k] = Hash.new } Of course, this can be done recursively. There's an article explaining the details. For the sake of completeness, here's the solution from the article...
Hashes of Hashes Idiom in Ruby? Creating hashes of hashes in Ruby allows for convenient two (or more) dimensional lookups. However, when inserting one must always check if the first index already exists in the hash. For example: h = Hash.new h['x'] = Hash.new if not h.key?('x') h['x']['y'] = value_to_insert It would be...
TITLE: Hashes of Hashes Idiom in Ruby? QUESTION: Creating hashes of hashes in Ruby allows for convenient two (or more) dimensional lookups. However, when inserting one must always check if the first index already exists in the hash. For example: h = Hash.new h['x'] = Hash.new if not h.key?('x') h['x']['y'] = value_to_...
[ "ruby", "idioms", "hash-of-hashes" ]
34
54
5,345
2
0
2008-10-04T12:10:07.510000
2008-10-04T12:16:03.567000
170,272
170,279
C# Generic Class with "specialized" constructor
I have a class like the following: public class DropDownControl: BaseControl where Key: IComparable { private IEnumerable mEnumerator; private Func mGetKey; private Func mGetValue; private Func mIsKeyInCollection; public DropDownControl(string name, IEnumerable enumerator, Func getKey, Func getValue, Func isKeyInColle...
No, basically. The static method in a non-generic class (such as DropDownControl [no <>]) is the best approach, as you should be able to use type-inference when you call Create() - i.e. var control = DropDownControl.Create(name, dictionary); C# 3.0 helps here both via "var" (very welcome here) and by the much-improved ...
C# Generic Class with "specialized" constructor I have a class like the following: public class DropDownControl: BaseControl where Key: IComparable { private IEnumerable mEnumerator; private Func mGetKey; private Func mGetValue; private Func mIsKeyInCollection; public DropDownControl(string name, IEnumerable enumerato...
TITLE: C# Generic Class with "specialized" constructor QUESTION: I have a class like the following: public class DropDownControl: BaseControl where Key: IComparable { private IEnumerable mEnumerator; private Func mGetKey; private Func mGetValue; private Func mIsKeyInCollection; public DropDownControl(string name, IEn...
[ "c#", "generics" ]
4
13
20,421
2
0
2008-10-04T12:40:03.020000
2008-10-04T12:47:17.547000
170,282
170,808
Delphi 2009 Ribbon Controls - Glass Frame
I've been starting to use the new inbuilt Ribbon controls in Delphi 2009 and use the custom frame so the Application button and Mini-toolbar slide up onto the Window Frame, but I'm wondering if on Vista it should use the glass effect like Office 2007 does, and if so how I would enable this setting. Thanks for any help.
Unfortunately it doesn't appear that that CodeGear implementation of the Ribbon control is compatible with the glass frame. Something about the way it draws disables it.
Delphi 2009 Ribbon Controls - Glass Frame I've been starting to use the new inbuilt Ribbon controls in Delphi 2009 and use the custom frame so the Application button and Mini-toolbar slide up onto the Window Frame, but I'm wondering if on Vista it should use the glass effect like Office 2007 does, and if so how I would...
TITLE: Delphi 2009 Ribbon Controls - Glass Frame QUESTION: I've been starting to use the new inbuilt Ribbon controls in Delphi 2009 and use the custom frame so the Application button and Mini-toolbar slide up onto the Window Frame, but I'm wondering if on Vista it should use the glass effect like Office 2007 does, and...
[ "delphi", "delphi-2009", "vcl", "ribbon", "aero-glass" ]
4
7
4,981
2
0
2008-10-04T12:48:47.760000
2008-10-04T18:30:39.223000
170,294
170,886
Change Sound (or other) System Preferences in Mac OS X
I'd like to be able to switch the sound output source in Mac OS X without any GUI interaction. There are tools to do control the sound output, such as SoundSource and an applescript to open the preferences dialog. What I am looking for is something that switches the preference instantly, like SoundSource but it has to ...
Don’t think of it in terms of preferences; there’s no centralized system preference framework for this sort of thing. I believe what you need to do is use Core Audio to set the kAudioHardwarePropertyDefaultOutputDevice and kAudioHardwarePropertyDefaultSystemOutputDevice properties of the AudioSystemObject (using AudioH...
Change Sound (or other) System Preferences in Mac OS X I'd like to be able to switch the sound output source in Mac OS X without any GUI interaction. There are tools to do control the sound output, such as SoundSource and an applescript to open the preferences dialog. What I am looking for is something that switches th...
TITLE: Change Sound (or other) System Preferences in Mac OS X QUESTION: I'd like to be able to switch the sound output source in Mac OS X without any GUI interaction. There are tools to do control the sound output, such as SoundSource and an applescript to open the preferences dialog. What I am looking for is somethin...
[ "cocoa", "macos", "scripting", "applescript" ]
5
8
8,053
2
0
2008-10-04T12:58:09.363000
2008-10-04T19:20:54.380000
170,297
170,315
"Code covered" vs. "Code tested"?
Converting my current code project to TDD, I've noticed something. class Foo { public event EventHandler Test; public void SomeFunction() { //snip... Test(this, new EventArgs()); } } There are two dangers I can see when testing this code and relying on a code coverage tool to determine if you have enough tests. You sh...
I wouldn't say "take it with a grain of salt" (there is a lot of utility to code coverage), but to quote myself TDD and code coverage are not a panacea: · Even with 100% block coverage, there still will be errors in the conditions that choose which blocks to execute. · Even with 100% block coverage + 100% arc coverage,...
"Code covered" vs. "Code tested"? Converting my current code project to TDD, I've noticed something. class Foo { public event EventHandler Test; public void SomeFunction() { //snip... Test(this, new EventArgs()); } } There are two dangers I can see when testing this code and relying on a code coverage tool to determin...
TITLE: "Code covered" vs. "Code tested"? QUESTION: Converting my current code project to TDD, I've noticed something. class Foo { public event EventHandler Test; public void SomeFunction() { //snip... Test(this, new EventArgs()); } } There are two dangers I can see when testing this code and relying on a code coverag...
[ "tdd", "code-coverage" ]
2
4
746
7
0
2008-10-04T13:00:43.743000
2008-10-04T13:15:10.797000
170,337
171,703
Django signals vs. overriding save method
I'm having trouble wrapping my head around this. Right now I have some models that looks kind of like this: def Review(models.Model)...fields... overall_score = models.FloatField(blank=True) def Score(models.Model) review = models.ForeignKey(Review) question = models.TextField() grade = models.IntegerField() A Review ...
Save/delete signals are generally favourable in situations where you need to make changes which aren't completely specific to the model in question, or could be applied to models which have something in common, or could be configured for use across models. One common task in overridden save methods is automated generat...
Django signals vs. overriding save method I'm having trouble wrapping my head around this. Right now I have some models that looks kind of like this: def Review(models.Model)...fields... overall_score = models.FloatField(blank=True) def Score(models.Model) review = models.ForeignKey(Review) question = models.TextField...
TITLE: Django signals vs. overriding save method QUESTION: I'm having trouble wrapping my head around this. Right now I have some models that looks kind of like this: def Review(models.Model)...fields... overall_score = models.FloatField(blank=True) def Score(models.Model) review = models.ForeignKey(Review) question ...
[ "python", "django", "django-models", "django-signals" ]
117
98
28,760
5
0
2008-10-04T13:37:12
2008-10-05T08:38:39.653000
170,346
170,363
What are the performance improvement of Sequential Guid over standard Guid?
Has someone ever measured performance of Sequential Guid vs. Standard Guid when used as Primary Keys inside a database? I do not see the need for unique keys to be guessable or not, passing them from a web UI or in some other part seems a bad practice by itself and I do not see, if you have security concerns, how using...
GUID vs.Sequential GUID A typical pattern it's to use Guid as PK for tables, but, as referred in other discussions (see Advantages and disadvantages of GUID / UUID database keys ) there are some performance issues. This is a typical Guid sequence f3818d69-2552-40b7-a403-01a6db4552f7 7ce31615-fafb-42c4-b317-40d21a6a3c60...
What are the performance improvement of Sequential Guid over standard Guid? Has someone ever measured performance of Sequential Guid vs. Standard Guid when used as Primary Keys inside a database? I do not see the need for unique keys to be guessable or not, passing them from a web UI or in some other part seems a bad p...
TITLE: What are the performance improvement of Sequential Guid over standard Guid? QUESTION: Has someone ever measured performance of Sequential Guid vs. Standard Guid when used as Primary Keys inside a database? I do not see the need for unique keys to be guessable or not, passing them from a web UI or in some other ...
[ "database", "primary-key", "guid" ]
72
118
37,974
8
0
2008-10-04T13:43:39.507000
2008-10-04T13:52:51.390000
170,353
170,792
How do I write to a log from mod_python under apache?
I seem to only be able to write to the Apache error log via stderr. Anyone know of a more structured logging architecture that I could use from my python web project, like commons?
There isn't any built in support for mod_python logging to Apache currently. If you really want to work within the Apache logs you can check out this thread (make sure you get the second version of the posted code, rather than the first): http://www.dojoforum.com/node/13239 http://www.modpython.org/pipermail/mod_python...
How do I write to a log from mod_python under apache? I seem to only be able to write to the Apache error log via stderr. Anyone know of a more structured logging architecture that I could use from my python web project, like commons?
TITLE: How do I write to a log from mod_python under apache? QUESTION: I seem to only be able to write to the Apache error log via stderr. Anyone know of a more structured logging architecture that I could use from my python web project, like commons? ANSWER: There isn't any built in support for mod_python logging to...
[ "python", "apache", "logging" ]
2
3
5,351
4
0
2008-10-04T13:46:06.913000
2008-10-04T18:16:55.633000
170,355
1,327,611
How to detect user inactivity in an Excel workbook
I want to take an action in an Excel workbook macro after a period of inactivity (hide/protect some worksheets). What is the best/simplest way to achieve this? Í'm assuming I'll use Application.OnTime to periodically check if the user has been active. But what events should I handle to see if the user was "active" (i.e...
I have implemented this by handling Workbook_SheetActivate, Workbook_SheetSelectionChange and Workbook_WindowActivate. Realistically this is probably enough.
How to detect user inactivity in an Excel workbook I want to take an action in an Excel workbook macro after a period of inactivity (hide/protect some worksheets). What is the best/simplest way to achieve this? Í'm assuming I'll use Application.OnTime to periodically check if the user has been active. But what events s...
TITLE: How to detect user inactivity in an Excel workbook QUESTION: I want to take an action in an Excel workbook macro after a period of inactivity (hide/protect some worksheets). What is the best/simplest way to achieve this? Í'm assuming I'll use Application.OnTime to periodically check if the user has been active....
[ "vba", "excel", "timer", "user-inactivity" ]
2
2
3,100
3
0
2008-10-04T13:46:27.583000
2009-08-25T11:17:01.033000
170,377
176,853
Does tomcat 5.5 treat .jsp and .jspx files in the same way?
I'm working on a java web-application, trying to be xml-friendly and writing my jsp files using the jspx/xml syntax. It took me hours of dissecting examples and configuration files to find out that with tomcat 5.5 files using the new syntax should end in.jspx, or tomcat won't translate tag libraries and stuff. Both fil...
There are additional configurations for servlets that can affect behavior. I haven't tried it, but would assume that you could just override some of the default configurations for *.jsp to use that of *.jspx. Try adding a jsp-property-group definition for *.jsp with is-xml set to true: *.jsp true Some information on co...
Does tomcat 5.5 treat .jsp and .jspx files in the same way? I'm working on a java web-application, trying to be xml-friendly and writing my jsp files using the jspx/xml syntax. It took me hours of dissecting examples and configuration files to find out that with tomcat 5.5 files using the new syntax should end in.jspx,...
TITLE: Does tomcat 5.5 treat .jsp and .jspx files in the same way? QUESTION: I'm working on a java web-application, trying to be xml-friendly and writing my jsp files using the jspx/xml syntax. It took me hours of dissecting examples and configuration files to find out that with tomcat 5.5 files using the new syntax s...
[ "xml", "tomcat", "jspx" ]
2
4
1,754
2
0
2008-10-04T14:02:17.190000
2008-10-07T00:59:39.267000
170,380
170,391
Why do thread functions need to be declared as '__cdecl'?
Sample code that shows how to create threads using MFC declares the thread function as both static and __cdecl. Why is the latter required? Boost threads don't bother with this convention, so is it just an anachronism? For example (MFC): static __cdecl UINT MyFunc(LPVOID pParam) {... } CWinThread* pThread = AfxBeginTh...
__cdecl tells the compiler to use the C calling convention (as opposed to the stdcall, fastcall or whatever other calling convention your compiler supports). I believe, VC++ uses stdcall by default. The calling convention affects things such as how arguments are pushed onto the stack (or registers, in the case of fastc...
Why do thread functions need to be declared as '__cdecl'? Sample code that shows how to create threads using MFC declares the thread function as both static and __cdecl. Why is the latter required? Boost threads don't bother with this convention, so is it just an anachronism? For example (MFC): static __cdecl UINT MyFu...
TITLE: Why do thread functions need to be declared as '__cdecl'? QUESTION: Sample code that shows how to create threads using MFC declares the thread function as both static and __cdecl. Why is the latter required? Boost threads don't bother with this convention, so is it just an anachronism? For example (MFC): static...
[ "c++", "multithreading", "mfc", "boost" ]
6
4
3,776
5
0
2008-10-04T14:05:20.087000
2008-10-04T14:11:59.527000
170,394
170,413
An implementation of the fast Fourier transform (FFT) in C#
Where can I find a free, very quick, and reliable implementation of FFT in C#? That can be used in a product? Or are there any restrictions?
AForge.net is a free (open-source) library with Fast Fourier Transform support. (See Sources/Imaging/ ComplexImage.cs for usage, Sources/Math/ FourierTransform.cs for implemenation)
An implementation of the fast Fourier transform (FFT) in C# Where can I find a free, very quick, and reliable implementation of FFT in C#? That can be used in a product? Or are there any restrictions?
TITLE: An implementation of the fast Fourier transform (FFT) in C# QUESTION: Where can I find a free, very quick, and reliable implementation of FFT in C#? That can be used in a product? Or are there any restrictions? ANSWER: AForge.net is a free (open-source) library with Fast Fourier Transform support. (See Sources...
[ "c#", "signal-processing", "fft" ]
79
39
144,526
9
0
2008-10-04T14:12:19.573000
2008-10-04T14:23:09.193000
170,405
1,572,228
Scrubyt gives 404 Error when clicking link using _details method
This might be a similar problem to my earlier two questions - see here and here but I'm trying to use the _detail command to automatically click the link so I can scrape the details page for each individual event. The code I'm using is: require 'rubygems' require 'scrubyt' nuffield_data = Scrubyt::Extractor.define do ...
I had the same issue with relative links and fixed it like this... you have to set the:resolve param to the correct base url event do title 'The Coast of Mayo' link_url event_detail:resolve => 'http://www.nuffieldtheatre.co.uk/cn/events' do dates "1-4 October" times "7:30pm" end end
Scrubyt gives 404 Error when clicking link using _details method This might be a similar problem to my earlier two questions - see here and here but I'm trying to use the _detail command to automatically click the link so I can scrape the details page for each individual event. The code I'm using is: require 'rubygems'...
TITLE: Scrubyt gives 404 Error when clicking link using _details method QUESTION: This might be a similar problem to my earlier two questions - see here and here but I'm trying to use the _detail command to automatically click the link so I can scrape the details page for each individual event. The code I'm using is: ...
[ "ruby", "scrubyt" ]
1
1
378
4
0
2008-10-04T14:17:43.073000
2009-10-15T13:02:06.897000
170,415
170,444
Do you know what may cause memory leaks in JavaScript?
Do you know what may cause memory leaks in JavaScript? I am interested in browsers: IE 7, FireFox 3, Safari 3
There is a nice article about JavaScript and memory leaks. It does not specific about on browser, it rather describes the whole problematic of memory leaks and JavaScript. JavaScript and memory leaks Introducing the closure More leakage patterns Conclusion I think it is a better approach to be as browser unspecific as ...
Do you know what may cause memory leaks in JavaScript? Do you know what may cause memory leaks in JavaScript? I am interested in browsers: IE 7, FireFox 3, Safari 3
TITLE: Do you know what may cause memory leaks in JavaScript? QUESTION: Do you know what may cause memory leaks in JavaScript? I am interested in browsers: IE 7, FireFox 3, Safari 3 ANSWER: There is a nice article about JavaScript and memory leaks. It does not specific about on browser, it rather describes the whole ...
[ "javascript", "memory-leaks" ]
23
35
8,768
5
0
2008-10-04T14:23:37.727000
2008-10-04T14:41:15.787000
170,420
170,494
HowTo: Parse the UninstallString reg entry
In HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ is the list of installed programs in my machine (at least most of them). There, there's a String Value called UninstallString which has what you need to run in order to uninstall the program. The thing is not every installer writes the same kind...
Have a look at this link from MSDN explaining install/unistall procedures, specifically item #6 "Support Add/Remove Programs Properly". As an excerpt from the table there: Key Name | Key Type | Description UninstallPath | REG_EXPAND_SZ | Full path to the application's uninstall program Despite the fact it says 'full pa...
HowTo: Parse the UninstallString reg entry In HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ is the list of installed programs in my machine (at least most of them). There, there's a String Value called UninstallString which has what you need to run in order to uninstall the program. The thing ...
TITLE: HowTo: Parse the UninstallString reg entry QUESTION: In HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ is the list of installed programs in my machine (at least most of them). There, there's a String Value called UninstallString which has what you need to run in order to uninstall the p...
[ "registry", "uninstallstring" ]
5
2
3,987
1
0
2008-10-04T14:25:39.547000
2008-10-04T15:15:13.253000
170,426
170,610
Performance: Python 3.x vs Python 2.x
On a question of just performance, how does Python 3 compare to Python 2.x?
3.0 is slower than 2.5 on official benchmarks. From "What’s New in Python 3.0": The net result of the 3.0 generalizations is that Python 3.0 runs the pystone benchmark around 10% slower than Python 2.5. Most likely the biggest cause is the removal of special-casing for small integers. There’s room for improvement, but ...
Performance: Python 3.x vs Python 2.x On a question of just performance, how does Python 3 compare to Python 2.x?
TITLE: Performance: Python 3.x vs Python 2.x QUESTION: On a question of just performance, how does Python 3 compare to Python 2.x? ANSWER: 3.0 is slower than 2.5 on official benchmarks. From "What’s New in Python 3.0": The net result of the 3.0 generalizations is that Python 3.0 runs the pystone benchmark around 10% ...
[ "python", "performance", "python-3.x", "python-2.x" ]
24
29
10,604
6
0
2008-10-04T14:28:20.947000
2008-10-04T16:29:03.977000
170,442
315,207
Anyone implemented Endeca with .NET? Would you recommend Endeca or FAST?
Which search engine would you recommend for a Commerce website? We have millions of products in a catalog and we want it to be as quick as possible. We would also want to make sure that the marketing driven through the search engine will be fast and effective. What are your opinions?
This is only half the answer to your question. I've used it with Java and not.NET. Fast is said to be the better search engine. I don't know. However for Commerce Endeca is considered to be the best. I've used it with a catalog of 5Mil. products and queries are very very fast. If you use.NET or Java does not matter in ...
Anyone implemented Endeca with .NET? Would you recommend Endeca or FAST? Which search engine would you recommend for a Commerce website? We have millions of products in a catalog and we want it to be as quick as possible. We would also want to make sure that the marketing driven through the search engine will be fast a...
TITLE: Anyone implemented Endeca with .NET? Would you recommend Endeca or FAST? QUESTION: Which search engine would you recommend for a Commerce website? We have millions of products in a catalog and we want it to be as quick as possible. We would also want to make sure that the marketing driven through the search eng...
[ "search-engine", "performance", "endeca" ]
1
3
2,286
5
0
2008-10-04T14:39:10.830000
2008-11-24T19:44:45.950000
170,452
173,946
Theory: "Lexical Encoding"
I am using the term "Lexical Encoding" for my lack of a better one. A Word is arguably the fundamental unit of communication as opposed to a Letter. Unicode tries to assign a numeric value to each Letter of all known Alphabets. What is a Letter to one language, is a Glyph to another. Unicode 5.1 assigns more than 100,0...
Their are several major problems with this idea. In most languages, the meaning of a word, and the word associated with a meaning change very swiftly. No sooner would you have a number assigned to a word, before the meaning of the word would change. For instance, the word "gay" used to only mean "happy" or "merry", but...
Theory: "Lexical Encoding" I am using the term "Lexical Encoding" for my lack of a better one. A Word is arguably the fundamental unit of communication as opposed to a Letter. Unicode tries to assign a numeric value to each Letter of all known Alphabets. What is a Letter to one language, is a Glyph to another. Unicode ...
TITLE: Theory: "Lexical Encoding" QUESTION: I am using the term "Lexical Encoding" for my lack of a better one. A Word is arguably the fundamental unit of communication as opposed to a Letter. Unicode tries to assign a numeric value to each Letter of all known Alphabets. What is a Letter to one language, is a Glyph to...
[ "encoding", "theory", "nlp", "linguistics" ]
4
3
2,408
8
0
2008-10-04T14:48:06.927000
2008-10-06T11:30:39.307000
170,455
170,463
How can I read multiple tables into a dataset?
I have a stored procedure that returns multiple tables. How can I execute and read both tables? I have something like this: SqlConnection conn = new SqlConnection(CONNECTION_STRING); SqlCommand cmd = new SqlCommand("sp_mult_tables",conn); cmd.CommandType = CommandType.StoredProcedure); IDataReader rdr = cmd.ExecuteRea...
Adapted from MSDN: using (SqlConnection conn = new SqlConnection(connection)) { SqlDataAdapter adapter = new SqlDataAdapter(); adapter.SelectCommand = new SqlCommand(query, conn); adapter.Fill(dataset); return dataset; }
How can I read multiple tables into a dataset? I have a stored procedure that returns multiple tables. How can I execute and read both tables? I have something like this: SqlConnection conn = new SqlConnection(CONNECTION_STRING); SqlCommand cmd = new SqlCommand("sp_mult_tables",conn); cmd.CommandType = CommandType.Stor...
TITLE: How can I read multiple tables into a dataset? QUESTION: I have a stored procedure that returns multiple tables. How can I execute and read both tables? I have something like this: SqlConnection conn = new SqlConnection(CONNECTION_STRING); SqlCommand cmd = new SqlCommand("sp_mult_tables",conn); cmd.CommandType ...
[ "c#", "ado.net", "dataset" ]
4
5
13,153
4
0
2008-10-04T14:49:24.023000
2008-10-04T14:53:46.870000
170,458
170,626
Application Object and Concurrency Concerns
In some asp tutorials, like this, i observe the following pattern: Application.Lock 'do some things with the application object Application.Unlock However, since web pages can have multiple instances, there is an obvious concurrency problem. So my questions are the following: What if one page tries to lock while the ob...
From the MSDN documentation: The Lock method blocks other clients from modifying the variables stored in the Application object, ensuring that only one client at a time can alter or access the Application variables. If you do not call the Application.Unlock method explicitly, the server unlocks the locked Application o...
Application Object and Concurrency Concerns In some asp tutorials, like this, i observe the following pattern: Application.Lock 'do some things with the application object Application.Unlock However, since web pages can have multiple instances, there is an obvious concurrency problem. So my questions are the following:...
TITLE: Application Object and Concurrency Concerns QUESTION: In some asp tutorials, like this, i observe the following pattern: Application.Lock 'do some things with the application object Application.Unlock However, since web pages can have multiple instances, there is an obvious concurrency problem. So my questions ...
[ "concurrency", "asp-classic", "locking" ]
3
4
749
3
0
2008-10-04T14:51:40.227000
2008-10-04T16:39:58.277000
170,465
170,509
Is there a caching script for classic asp?
PHP has a number of opcode caches, which as i understand it are scripts that handle the caching aspects of an application. Is there something similar for classic asp, especially something that does not require component installation? Regarding the IIS caching behaviour, it seems from reading here that the behaviour is ...
Looking at your comments to the answers here so far and at your edit of your question you seem a little confused over caching. There are two types of caching we could be be talking about. Opcode or Template caching Output caching Opcode or Template caching is the caching that takes place when a raw script file which is...
Is there a caching script for classic asp? PHP has a number of opcode caches, which as i understand it are scripts that handle the caching aspects of an application. Is there something similar for classic asp, especially something that does not require component installation? Regarding the IIS caching behaviour, it see...
TITLE: Is there a caching script for classic asp? QUESTION: PHP has a number of opcode caches, which as i understand it are scripts that handle the caching aspects of an application. Is there something similar for classic asp, especially something that does not require component installation? Regarding the IIS caching...
[ "performance", "caching", "asp-classic" ]
4
3
4,695
3
0
2008-10-04T14:54:13.717000
2008-10-04T15:24:27.963000
170,466
170,495
What is the simplest, most maintainable way to create a SQL Server ODBC Data Source?
I need a programmatic way of creating a SQL Server ODBC Data Source. I can do this by directly accessing the Registry. It would be better if this could be done via an available (SQL Server/Windows) API to protect against changes in the registry keys or values with updated SQL Server drivers. Accepted Answer Note: Using...
SQLConfigDataSource() does the job. MSDN article Just in case here is a VB6 example: Const ODBC_ADD_DSN = 1 'user data source Const ODBC_ADD_SYS_DSN = 4 'system data source Private Declare Function SQLConfigDataSource Lib "ODBCCP32.DLL" (ByVal hwndParent As Long, ByVal fRequest As Long, ByVal lpszDriver As String, ByV...
What is the simplest, most maintainable way to create a SQL Server ODBC Data Source? I need a programmatic way of creating a SQL Server ODBC Data Source. I can do this by directly accessing the Registry. It would be better if this could be done via an available (SQL Server/Windows) API to protect against changes in the...
TITLE: What is the simplest, most maintainable way to create a SQL Server ODBC Data Source? QUESTION: I need a programmatic way of creating a SQL Server ODBC Data Source. I can do this by directly accessing the Registry. It would be better if this could be done via an available (SQL Server/Windows) API to protect agai...
[ "sql-server", "odbc", "datasource", "dsn" ]
3
8
7,120
5
0
2008-10-04T14:54:13.950000
2008-10-04T15:15:21.117000
170,467
170,472
makefiles - compile all c files at once
I want to experiment with GCC whole program optimizations. To do so I have to pass all C-files at once to the compiler frontend. However, I use makefiles to automate my build process, and I'm not an expert when it comes to makefile magic. How should I modify the makefile if I want to compile (maybe even link) using jus...
LIBS = -lkernel32 -luser32 -lgdi32 -lopengl32 CFLAGS = -Wall # Should be equivalent to your list of C files, if you don't build selectively SRC=$(wildcard *.c) test: $(SRC) gcc -o $@ $^ $(CFLAGS) $(LIBS)
makefiles - compile all c files at once I want to experiment with GCC whole program optimizations. To do so I have to pass all C-files at once to the compiler frontend. However, I use makefiles to automate my build process, and I'm not an expert when it comes to makefile magic. How should I modify the makefile if I wan...
TITLE: makefiles - compile all c files at once QUESTION: I want to experiment with GCC whole program optimizations. To do so I have to pass all C-files at once to the compiler frontend. However, I use makefiles to automate my build process, and I'm not an expert when it comes to makefile magic. How should I modify the...
[ "c", "makefile" ]
68
71
133,605
3
0
2008-10-04T14:56:26.363000
2008-10-04T15:00:58.617000
170,479
170,549
HTML Data exceeds field length after being hex-sanitized
The problem is you can't tell the user how many characters are allowed in the field because the escaped value has more characters than the unescaped one. I see a few solutions, but none looks very good: One whitelist for each field (too much work and doesn't quite solve the problem) One blacklist for each field (same a...
Don't build your application around the database - build the database for the application! Design how you want the interface to work for the user first, work out the longest acceptable field length, and use that. In general, don't escape before storing in the database - store raw data in the database and format it for ...
HTML Data exceeds field length after being hex-sanitized The problem is you can't tell the user how many characters are allowed in the field because the escaped value has more characters than the unescaped one. I see a few solutions, but none looks very good: One whitelist for each field (too much work and doesn't quit...
TITLE: HTML Data exceeds field length after being hex-sanitized QUESTION: The problem is you can't tell the user how many characters are allowed in the field because the escaped value has more characters than the unescaped one. I see a few solutions, but none looks very good: One whitelist for each field (too much wor...
[ "php", "html", "validation" ]
1
8
545
4
0
2008-10-04T15:07:19.493000
2008-10-04T15:50:51.450000
170,554
170,667
Java: Save objects in a textfile? Are there readymade solutions?
I want to save the objects I generated in a program. After restart the App should load automaticly all Objects in an Array. I want to write them in a file and parse them after restart. Are the other smarter possibilities than do it by hand? Thank you
You can use the Berkeley DB PersistentMap class to save your ( Serializable ) objects in a Map implementation (a cache) which persists them to a file. It's pretty simple to use and means you don't have to worry about what to save where. Three things to note about serialization: How are you going to cope with schema cha...
Java: Save objects in a textfile? Are there readymade solutions? I want to save the objects I generated in a program. After restart the App should load automaticly all Objects in an Array. I want to write them in a file and parse them after restart. Are the other smarter possibilities than do it by hand? Thank you
TITLE: Java: Save objects in a textfile? Are there readymade solutions? QUESTION: I want to save the objects I generated in a program. After restart the App should load automaticly all Objects in an Array. I want to write them in a file and parse them after restart. Are the other smarter possibilities than do it by ha...
[ "java", "object", "store", "flat-file" ]
7
4
9,490
8
0
2008-10-04T15:56:09.257000
2008-10-04T17:13:34.980000
170,556
170,588
Maintaining consistency when using temp backup tables
This is related to the accepted answer for What’s your #1 way to be careful with a live database? Suppose you create a temp table for backup purpose and make your changes in the original. The changes break the system and you want to restore the backup. In the meantime some other records have also changed in the origina...
I don't think that's desirable, I'd test harder before putting the table in production, but supposing it happened anyway, you'd have two options: 1.- Create an ON INSERT trigger which updates the temporary backup table with the rows inserted into the new table, massaging the data to fit into the old table or 2.- Find t...
Maintaining consistency when using temp backup tables This is related to the accepted answer for What’s your #1 way to be careful with a live database? Suppose you create a temp table for backup purpose and make your changes in the original. The changes break the system and you want to restore the backup. In the meanti...
TITLE: Maintaining consistency when using temp backup tables QUESTION: This is related to the accepted answer for What’s your #1 way to be careful with a live database? Suppose you create a temp table for backup purpose and make your changes in the original. The changes break the system and you want to restore the bac...
[ "database" ]
1
1
150
3
0
2008-10-04T15:57:00.440000
2008-10-04T16:12:49.190000
170,578
171,008
Operation must use an updatable query. (Error 3073) Microsoft Access
On some Microsoft Access queries, I get the following message: Operation must use an updatable query. (Error 3073). I work around it by using temporary tables, but I'm wondering if there's a better way. All the tables involved have a primary key. Here's the code: UPDATE CLOG SET CLOG.NEXTDUE = ( SELECT H1.paidthru FROM...
Since Jet 4, all queries that have a join to a SQL statement that summarizes data will be non-updatable. You aren't using a JOIN, but the WHERE clause is exactly equivalent to a join, and thus, the Jet query optimizer treats it the same way it treats a join. I'm afraid you're out of luck without a temp table, though ma...
Operation must use an updatable query. (Error 3073) Microsoft Access On some Microsoft Access queries, I get the following message: Operation must use an updatable query. (Error 3073). I work around it by using temporary tables, but I'm wondering if there's a better way. All the tables involved have a primary key. Here...
TITLE: Operation must use an updatable query. (Error 3073) Microsoft Access QUESTION: On some Microsoft Access queries, I get the following message: Operation must use an updatable query. (Error 3073). I work around it by using temporary tables, but I'm wondering if there's a better way. All the tables involved have a...
[ "ms-access" ]
23
25
158,613
23
0
2008-10-04T16:08:05.440000
2008-10-04T21:12:12.813000
170,584
170,591
Is the C# 2.0 to C# 3.0 transition worth it for this project?
I have read on Stack Overflow some people that have converting to C#2.0 to C#3, but is it really worth it? I have a project that is done at 75% before going in maintenance phase. I am asking to myself if it is worth it to switch to C#3.0? Update: The project will have a web interface now so before entering the maintena...
No, I would advise not. I would advise starting 3.5 on new projects only, unless there is a specific reason otherwise. You will not have any benefit from 3.5 by just recompiling, since your code is already written (or at least 75% of it). If you need to migrate to 3.5 in the future, you can easily do it. Of course, you...
Is the C# 2.0 to C# 3.0 transition worth it for this project? I have read on Stack Overflow some people that have converting to C#2.0 to C#3, but is it really worth it? I have a project that is done at 75% before going in maintenance phase. I am asking to myself if it is worth it to switch to C#3.0? Update: The project...
TITLE: Is the C# 2.0 to C# 3.0 transition worth it for this project? QUESTION: I have read on Stack Overflow some people that have converting to C#2.0 to C#3, but is it really worth it? I have a project that is done at 75% before going in maintenance phase. I am asking to myself if it is worth it to switch to C#3.0? U...
[ "c#", ".net", "project-management", "code-migration" ]
17
23
2,434
16
0
2008-10-04T16:10:34.110000
2008-10-04T16:14:00.623000
170,600
170,633
UNIX socket implementation for Java?
I realize that since UNIX sockets are platform-specific, there has to be some non-Java code involved. Specifically, we're interested in using JDBC to connect to a MySQL instance which only has UNIX domain sockets enabled. It doesn't look like this is supported, but from what I've read it should be at least possible to ...
Checkout the JUDS library. It is a Java Unix Domain Socket library... https://github.com/mcfunley/juds
UNIX socket implementation for Java? I realize that since UNIX sockets are platform-specific, there has to be some non-Java code involved. Specifically, we're interested in using JDBC to connect to a MySQL instance which only has UNIX domain sockets enabled. It doesn't look like this is supported, but from what I've re...
TITLE: UNIX socket implementation for Java? QUESTION: I realize that since UNIX sockets are platform-specific, there has to be some non-Java code involved. Specifically, we're interested in using JDBC to connect to a MySQL instance which only has UNIX domain sockets enabled. It doesn't look like this is supported, but...
[ "java", "unix", "jdbc", "unix-socket" ]
51
31
47,748
8
0
2008-10-04T16:18:37.430000
2008-10-04T16:46:07.860000
170,601
170,631
Objective-C Tidy
I have a somewhat messily-formatted Objective-C code base. Is there a way to have Xcode reformat an entire project to conform to a coding standard (i.e., properly indent, spaces v. tabs, etc.)? Are there other tools that might accomplish this?
Uncrustify: http://uncrustify.sourceforge.net/ Source Code Beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA If you want something simpler, you could probably get some way by simply stripping out all the white-space/line-breaks, and adding a new line-break on; { }, and manually re-indenting the code. It won...
Objective-C Tidy I have a somewhat messily-formatted Objective-C code base. Is there a way to have Xcode reformat an entire project to conform to a coding standard (i.e., properly indent, spaces v. tabs, etc.)? Are there other tools that might accomplish this?
TITLE: Objective-C Tidy QUESTION: I have a somewhat messily-formatted Objective-C code base. Is there a way to have Xcode reformat an entire project to conform to a coding standard (i.e., properly indent, spaces v. tabs, etc.)? Are there other tools that might accomplish this? ANSWER: Uncrustify: http://uncrustify.so...
[ "objective-c", "cocoa", "xcode" ]
16
23
8,122
8
0
2008-10-04T16:20:00.360000
2008-10-04T16:44:02.060000
170,617
170,630
How do I find the install time and date of Windows?
This might sound like a little bit of a crazy question, but how can I find out (hopefully via an API/registry key) the install time and date of Windows? The best I can come up with so far is to look at various files in C:\Windows and try to guess... but that's not exactly a nice solution.
In regedit.exe go to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\InstallDate It's given as the number of seconds since January 1, 1970. (Note: for Windows 10, this date will be when the last feature update was installed, not the original install date.) To convert that number into a readable date/ti...
How do I find the install time and date of Windows? This might sound like a little bit of a crazy question, but how can I find out (hopefully via an API/registry key) the install time and date of Windows? The best I can come up with so far is to look at various files in C:\Windows and try to guess... but that's not exa...
TITLE: How do I find the install time and date of Windows? QUESTION: This might sound like a little bit of a crazy question, but how can I find out (hopefully via an API/registry key) the install time and date of Windows? The best I can come up with so far is to look at various files in C:\Windows and try to guess... ...
[ "windows", "installation" ]
150
94
333,566
20
0
2008-10-04T16:36:15.850000
2008-10-04T16:43:16.897000
170,624
170,636
Javascript Image Resize
Does anyone know how to resize images proportionally using JavaScript? I have tried to modify the DOM by adding attributes height and width on the fly, but seems did not work on IE6.
To modify an image proportionally, simply only alter one of the width/height css properties, leave the other set to auto. image.style.width = '50%' image.style.height = 'auto' This will ensure that its aspect ratio remains the same. Bear in mind that browsers tend to suck at resizing images nicely - you'll probably fin...
Javascript Image Resize Does anyone know how to resize images proportionally using JavaScript? I have tried to modify the DOM by adding attributes height and width on the fly, but seems did not work on IE6.
TITLE: Javascript Image Resize QUESTION: Does anyone know how to resize images proportionally using JavaScript? I have tried to modify the DOM by adding attributes height and width on the fly, but seems did not work on IE6. ANSWER: To modify an image proportionally, simply only alter one of the width/height css prope...
[ "javascript", "internet-explorer-6", "image-manipulation" ]
50
71
228,446
13
0
2008-10-04T16:39:31.553000
2008-10-04T16:47:26.577000
170,649
170,682
Why have object oriented databases not been successful (yet)?
That's the question. Give only one reason you think why have OODB failed or why many systems nowadays still use relational databases.
Can we answer more than once? Another reason is that relational DB's have a strong foundation in mathematics: from the definition of a relation, right through to the normal forms, the theory is rock solid. It is true that the relational model does not map well to OO, but IMHO the benefits and stability of that model ou...
Why have object oriented databases not been successful (yet)? That's the question. Give only one reason you think why have OODB failed or why many systems nowadays still use relational databases.
TITLE: Why have object oriented databases not been successful (yet)? QUESTION: That's the question. Give only one reason you think why have OODB failed or why many systems nowadays still use relational databases. ANSWER: Can we answer more than once? Another reason is that relational DB's have a strong foundation in ...
[ "database", "orm", "rdbms", "object-oriented-database" ]
21
23
3,806
14
0
2008-10-04T17:06:03.373000
2008-10-04T17:21:10.067000
170,650
170,710
Rich Text in Windows Forms application
I would like to update a Windows Forms application to provide the following features: spell checking limited formatting of text: bold, italics, bulleted lists Ideally the formatted text could be accessed in a plain text way for reporting through tools that don't support the formatting, but could also be rendered as HTM...
You can add / create a drop-in spell checker for the Window Forms RichTextBox. A ready to go richtextbox custom control with spell checking. An app for checking spelling that could be easily integrated Also here is a article on adding a WPF RichTextBox to your application, as well as getting spell checking working. (Re...
Rich Text in Windows Forms application I would like to update a Windows Forms application to provide the following features: spell checking limited formatting of text: bold, italics, bulleted lists Ideally the formatted text could be accessed in a plain text way for reporting through tools that don't support the format...
TITLE: Rich Text in Windows Forms application QUESTION: I would like to update a Windows Forms application to provide the following features: spell checking limited formatting of text: bold, italics, bulleted lists Ideally the formatted text could be accessed in a plain text way for reporting through tools that don't ...
[ ".net", "wpf", "winforms" ]
4
3
1,801
3
0
2008-10-04T17:06:30.423000
2008-10-04T17:31:02.277000
170,653
170,654
Library Error for Ruby/QT
Trying to create a QtRuby application, I get the following error: /usr/lib64/ruby/site_ruby/1.8/Qt/qtruby4.rb:2144: [BUG] Segmentation fault ruby 1.8.6 (2008-03-03) [x86_64-linux] I am running a 64-bit version of Novell OpenSUSE 11 with DKE4 and Qt
The issue is with: require 'Qt' Because of the 64bit libraries, instead you need to use: require 'korundum4' Reference: http://www.sheepguardingllama.com/?p=2661
Library Error for Ruby/QT Trying to create a QtRuby application, I get the following error: /usr/lib64/ruby/site_ruby/1.8/Qt/qtruby4.rb:2144: [BUG] Segmentation fault ruby 1.8.6 (2008-03-03) [x86_64-linux] I am running a 64-bit version of Novell OpenSUSE 11 with DKE4 and Qt
TITLE: Library Error for Ruby/QT QUESTION: Trying to create a QtRuby application, I get the following error: /usr/lib64/ruby/site_ruby/1.8/Qt/qtruby4.rb:2144: [BUG] Segmentation fault ruby 1.8.6 (2008-03-03) [x86_64-linux] I am running a 64-bit version of Novell OpenSUSE 11 with DKE4 and Qt ANSWER: The issue is with:...
[ "ruby", "qt", "qt4", "kde4" ]
3
2
379
1
0
2008-10-04T17:07:31.203000
2008-10-04T17:08:26.223000
170,660
170,893
Can I put a caching server in front of my web site?
I have a web site using apache httpd as the server and mysql as the backend. It publishes a "thought for the day" that has gotten so popular that the server is crashing due to the number of requests. Since the same page is been requested (the thought only changes once a day), is it possible to put a caching server in f...
For slow changing pages, a cache will definitely reduce CPU usage; but in your extreme case, where the page changes once a day, and it's perfectly predictable, it would be far easier to use a simple and fast static file server ( lighthttp, nginx, etc) and a cron job to change your "thought of the day" every night. In f...
Can I put a caching server in front of my web site? I have a web site using apache httpd as the server and mysql as the backend. It publishes a "thought for the day" that has gotten so popular that the server is crashing due to the number of requests. Since the same page is been requested (the thought only changes once...
TITLE: Can I put a caching server in front of my web site? QUESTION: I have a web site using apache httpd as the server and mysql as the backend. It publishes a "thought for the day" that has gotten so popular that the server is crashing due to the number of requests. Since the same page is been requested (the thought...
[ "mysql", "database", "apache", "caching" ]
4
12
776
8
0
2008-10-04T17:10:42.240000
2008-10-04T19:28:40.713000
170,663
170,804
How do you design a good permgen space string in Java?
I'm wondering how you would go about designing a good permgen space string in Java. Based on my research and understanding I've come up with the following: example: JAVA_OPTS='-Xmx512m -XX:MaxPermSize=256m -server -Djava.awt.headless=true' Sorry the example didn't paste when I first posted the question......
I am also a bit unclear on the question, but if you mean what is a good number to use for max permgen size, it will depend on your app and the number of classes/methods loaded. To help determine them, you could run your application with its typical and most intense use cases and use JConsole and see what your app actua...
How do you design a good permgen space string in Java? I'm wondering how you would go about designing a good permgen space string in Java. Based on my research and understanding I've come up with the following: example: JAVA_OPTS='-Xmx512m -XX:MaxPermSize=256m -server -Djava.awt.headless=true' Sorry the example didn't ...
TITLE: How do you design a good permgen space string in Java? QUESTION: I'm wondering how you would go about designing a good permgen space string in Java. Based on my research and understanding I've come up with the following: example: JAVA_OPTS='-Xmx512m -XX:MaxPermSize=256m -server -Djava.awt.headless=true' Sorry t...
[ "java", "jvm", "permgen" ]
1
5
1,498
1
0
2008-10-04T17:12:24.123000
2008-10-04T18:28:43.300000
170,665
170,731
Helper functions for safe conversion from strings
Back in VB6, I wrote a few functions that would let me code without having to care about the difference between null and '' for strings, null and 0 for numbers, etc. Nothing kills my productivity more when coding than having to add special case code for dealing with data that might cause some irrelevant error; 9999/100...
There are scads of conversion functions built-in. But... i'm not sure any of them do exactly what you want. Generally,.NET methods err on the side of caution when passed invalid input, and throw an exception. Fortunately, you can easily write a utility method to convert a string representation of a numeric value, an em...
Helper functions for safe conversion from strings Back in VB6, I wrote a few functions that would let me code without having to care about the difference between null and '' for strings, null and 0 for numbers, etc. Nothing kills my productivity more when coding than having to add special case code for dealing with dat...
TITLE: Helper functions for safe conversion from strings QUESTION: Back in VB6, I wrote a few functions that would let me code without having to care about the difference between null and '' for strings, null and 0 for numbers, etc. Nothing kills my productivity more when coding than having to add special case code fo...
[ "c#", "vb6", "type-conversion" ]
10
36
10,132
4
0
2008-10-04T17:13:21.253000
2008-10-04T17:41:41.883000
170,689
182,722
Row Level Security with Entity Framework
I've been trying to consider how Row Level Security could be implemented with the Entity Framework. The idea is to have a database agnostic means that would offer methods to restrict the rows coming from the ObjectContext. Some of my inital ideas have involved modifying the partial classes created by the EDMGEN tool an...
Sure you can do it. The important thing to do is to block direct access to the object context (preventing users from building their own ObjectQuery), and instead give the client a narrower gateway within which to access and mutate entities. We do it with the Entity Repository pattern. You can find an example implementa...
Row Level Security with Entity Framework I've been trying to consider how Row Level Security could be implemented with the Entity Framework. The idea is to have a database agnostic means that would offer methods to restrict the rows coming from the ObjectContext. Some of my inital ideas have involved modifying the part...
TITLE: Row Level Security with Entity Framework QUESTION: I've been trying to consider how Row Level Security could be implemented with the Entity Framework. The idea is to have a database agnostic means that would offer methods to restrict the rows coming from the ObjectContext. Some of my inital ideas have involved ...
[ "c#", "database", "security", "entity-framework", "row-level-security" ]
11
11
8,467
4
0
2008-10-04T17:22:53.650000
2008-10-08T13:24:21.790000
170,726
170,747
To host or not to host?
What are the pros and cons of using a hosting provider for a Subversion repository versus maintaining it in-house? I'm sure there are benefits in terms of ease of set up and use. And it would be nice to have somebody else make sure that our code is backed up properly. However, Visual SVN Server is dirt simple to set up...
If you already have the infrastructure in place and are confident in your ability to host, backup and provide accessibility to your repositories then I would say that hosting SVN yourself is the way to go. This allows you relatively unlimited growth and total control over your source. If you have a primarily mobile dev...
To host or not to host? What are the pros and cons of using a hosting provider for a Subversion repository versus maintaining it in-house? I'm sure there are benefits in terms of ease of set up and use. And it would be nice to have somebody else make sure that our code is backed up properly. However, Visual SVN Server ...
TITLE: To host or not to host? QUESTION: What are the pros and cons of using a hosting provider for a Subversion repository versus maintaining it in-house? I'm sure there are benefits in terms of ease of set up and use. And it would be nice to have somebody else make sure that our code is backed up properly. However, ...
[ "svn", "hosting" ]
7
4
896
4
0
2008-10-04T17:39:03.963000
2008-10-04T17:50:20.303000
170,730
170,846
Best way to use sessions with MVC and OO PHP
I've been working with sessions, MVC design and object oriented PHP. Where should I save or retrieve data from a session? I would like to retrieve it from within methods so I don't have to pass the data to the methods. Whats the best practice?
I typically put this inside the controller. It just makes sense.. The controller decides what happens and why not let it decide if people are allowed to do the requested actions. Typically you have multiple controllers in a MVC system. Eg. BaseController (abstract - common), NonSessionController extends BaseController ...
Best way to use sessions with MVC and OO PHP I've been working with sessions, MVC design and object oriented PHP. Where should I save or retrieve data from a session? I would like to retrieve it from within methods so I don't have to pass the data to the methods. Whats the best practice?
TITLE: Best way to use sessions with MVC and OO PHP QUESTION: I've been working with sessions, MVC design and object oriented PHP. Where should I save or retrieve data from a session? I would like to retrieve it from within methods so I don't have to pass the data to the methods. Whats the best practice? ANSWER: I ty...
[ "php", "oop", "session" ]
2
3
6,533
5
0
2008-10-04T17:40:37.470000
2008-10-04T18:59:45.187000
170,734
171,958
is it time to try merb?
With Merb 1.0 rapidly approaching, I would like to know what Merb/Rails users recommend? Is it time to try Merb? What was downside for you when you switched to Merb from Rails?
Yes. Downsides: Lack of documentation, although this is getting better (not really a problem for some, as the code is very well documented). Rails plugins, Merb uses Gems, and not all have been ported (the most used ones have) Doing a straight port of a Rails app, will not utilize some of the cool features in Merb (plu...
is it time to try merb? With Merb 1.0 rapidly approaching, I would like to know what Merb/Rails users recommend? Is it time to try Merb? What was downside for you when you switched to Merb from Rails?
TITLE: is it time to try merb? QUESTION: With Merb 1.0 rapidly approaching, I would like to know what Merb/Rails users recommend? Is it time to try Merb? What was downside for you when you switched to Merb from Rails? ANSWER: Yes. Downsides: Lack of documentation, although this is getting better (not really a problem...
[ "ruby-on-rails", "ruby", "merb" ]
4
7
761
7
0
2008-10-04T17:43:59.083000
2008-10-05T13:18:25
170,751
170,756
What techniques have you actually used successfully to improve code coverage?
I regularly achieve 100% coverage of libraries using TDD, but not always, and there always seem to be parts of applications left over that are untested and uncovered. Then there are the cases when you start with legacy code that has very few tests and very little coverage. Please say what your situation is and what has...
Delete code. This isn't snarky, but actually serious. Any time I would see the smallest amount of code duplication or even code that I couldn't get to execute, I deleted it. This increased coverage and increased maintainability. I should note that this is more applicable to increasing the coverage of old code bases vs....
What techniques have you actually used successfully to improve code coverage? I regularly achieve 100% coverage of libraries using TDD, but not always, and there always seem to be parts of applications left over that are untested and uncovered. Then there are the cases when you start with legacy code that has very few ...
TITLE: What techniques have you actually used successfully to improve code coverage? QUESTION: I regularly achieve 100% coverage of libraries using TDD, but not always, and there always seem to be parts of applications left over that are untested and uncovered. Then there are the cases when you start with legacy code ...
[ "language-agnostic", "code-coverage" ]
5
6
849
5
0
2008-10-04T17:51:24.140000
2008-10-04T17:54:44.883000