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
43,591
43,633
Override WebClientProtocol.Timeout via web.config
Is it possible to override default value of WebClientProtocol.Timeout property via web.config?
I cant think of a way to have just the Timeout property changed automatically via the webconfig. Manually configure the value or use DI to read the value in for you. It maybe possible also to change the value globally on the machine config.
Override WebClientProtocol.Timeout via web.config Is it possible to override default value of WebClientProtocol.Timeout property via web.config?
TITLE: Override WebClientProtocol.Timeout via web.config QUESTION: Is it possible to override default value of WebClientProtocol.Timeout property via web.config? ANSWER: I cant think of a way to have just the Timeout property changed automatically via the webconfig. Manually configure the value or use DI to read the ...
[ ".net", "configuration" ]
6
2
2,330
1
0
2008-09-04T12:14:13.760000
2008-09-04T12:33:30.890000
43,596
44,218
How well does WPF blend with XNA in real life?
I understand that there are several ways to blend XNA and WPF within the same application. I find it enticing to use WPF for all GUI and HUD stuff in my XNA games. Does anyone have any practical experience on how well this approach works in real life using.NET 3.5 SP1? Any pitfalls (such as the "airspace problem" )? An...
There is an addition in 3.5 SP1 that allows better interaction between DirectX and WPF (D3DImage), and one way to get to that is through XNA. Here are some details: http://jmorrill.hjtcentral.com/Default.aspx?tabid=428&EntryID=259
How well does WPF blend with XNA in real life? I understand that there are several ways to blend XNA and WPF within the same application. I find it enticing to use WPF for all GUI and HUD stuff in my XNA games. Does anyone have any practical experience on how well this approach works in real life using.NET 3.5 SP1? Any...
TITLE: How well does WPF blend with XNA in real life? QUESTION: I understand that there are several ways to blend XNA and WPF within the same application. I find it enticing to use WPF for all GUI and HUD stuff in my XNA games. Does anyone have any practical experience on how well this approach works in real life usin...
[ "wpf", "interop", "xna", "direct3d" ]
15
6
13,281
6
0
2008-09-04T12:16:42.083000
2008-09-04T17:19:47.957000
43,632
43,636
Can you make just part of a regex case-insensitive?
I've seen lots of examples of making an entire regular expression case-insensitive. What I'm wondering about is having just part of the expression be case-insensitive. For example, let's say I have a string like this: fooFOOfOoFoOBARBARbarbarbAr What if I want to match all occurrences of "foo" regardless of case but I ...
Perl lets you make part of your regular expression case-insensitive by using the (?i:) pattern modifier. Modern regex flavors allow you to apply modifiers to only part of the regular expression. If you insert the modifier (?ism) in the middle of the regex, the modifier only applies to the part of the regex to the right...
Can you make just part of a regex case-insensitive? I've seen lots of examples of making an entire regular expression case-insensitive. What I'm wondering about is having just part of the expression be case-insensitive. For example, let's say I have a string like this: fooFOOfOoFoOBARBARbarbarbAr What if I want to matc...
TITLE: Can you make just part of a regex case-insensitive? QUESTION: I've seen lots of examples of making an entire regular expression case-insensitive. What I'm wondering about is having just part of the expression be case-insensitive. For example, let's say I have a string like this: fooFOOfOoFoOBARBARbarbarbAr What...
[ "regex" ]
121
98
97,244
5
0
2008-09-04T12:33:26.553000
2008-09-04T12:35:25.520000
43,643
44,043
How do I style (css) radio buttons and labels?
Given the code bellow, how do I style the radio buttons to be next to the labels and style the label of the selected radio button differently than the other labels? What color is the sky? A strange radient green. A dark gloomy orange A perfect glittering blue Also let me state that I use the yui css styles as base. If ...
The first part of your question can be solved with just HTML & CSS; you'll need to use Javascript for the second part. Getting the Label Near the Radio Button I'm not sure what you mean by "next to": on the same line and near, or on separate lines? If you want all of the radio buttons on the same line, just use margins...
How do I style (css) radio buttons and labels? Given the code bellow, how do I style the radio buttons to be next to the labels and style the label of the selected radio button differently than the other labels? What color is the sky? A strange radient green. A dark gloomy orange A perfect glittering blue Also let me s...
TITLE: How do I style (css) radio buttons and labels? QUESTION: Given the code bellow, how do I style the radio buttons to be next to the labels and style the label of the selected radio button differently than the other labels? What color is the sky? A strange radient green. A dark gloomy orange A perfect glittering ...
[ "html", "css", "radio-button", "styles" ]
31
33
184,568
3
0
2008-09-04T12:37:58.617000
2008-09-04T15:49:41.010000
43,644
43,664
Can I update/select from a table in one query?
I need to select data when a page is viewed and update the 'views' column is there a way to do this in one query, or do I have to use to distinct queries?
If you do not want/need to use a transaction, you could create a stored procedure that first updates the view count and then selects the values and return them to the user.
Can I update/select from a table in one query? I need to select data when a page is viewed and update the 'views' column is there a way to do this in one query, or do I have to use to distinct queries?
TITLE: Can I update/select from a table in one query? QUESTION: I need to select data when a page is viewed and update the 'views' column is there a way to do this in one query, or do I have to use to distinct queries? ANSWER: If you do not want/need to use a transaction, you could create a stored procedure that firs...
[ "mysql", "sql-update" ]
2
2
2,972
5
0
2008-09-04T12:38:30.690000
2008-09-04T12:45:18.943000
43,672
43,704
What types of executables can be decompiled?
I think that java executables (jar files) are trivial to decompile and get the source code. What about other languages?.net and all? Which all languages can compile only to a decompile-able code?
In general, languages like Java, C#, and VB.NET are relatively easy to decompile because they are compiled to an intermediary language, not pure machine language. In their IL form, they retain more metadata than C code does when compiled to machine language. Technically you aren't getting the original source code out, ...
What types of executables can be decompiled? I think that java executables (jar files) are trivial to decompile and get the source code. What about other languages?.net and all? Which all languages can compile only to a decompile-able code?
TITLE: What types of executables can be decompiled? QUESTION: I think that java executables (jar files) are trivial to decompile and get the source code. What about other languages?.net and all? Which all languages can compile only to a decompile-able code? ANSWER: In general, languages like Java, C#, and VB.NET are ...
[ "decompiling" ]
5
11
2,163
5
0
2008-09-04T12:47:39.343000
2008-09-04T12:57:54.980000
43,711
43,720
What's a good way to overwrite DateTime.Now during testing?
I've got some (C#) code that relies on today's date to correctly calculate things in the future. If I use today's date in the testing, I have to repeat the calculation in the test, which doesn't feel right. What's the best way to set the date to a known value within the test so that I can test that the result is a know...
My preference is to have classes that use time actually rely on an interface, such as interface IClock { DateTime Now { get; } } With a concrete implementation class SystemClock: IClock { DateTime Now { get { return DateTime.Now; } } } Then if you want, you can provide any other kind of clock you want for testing, such...
What's a good way to overwrite DateTime.Now during testing? I've got some (C#) code that relies on today's date to correctly calculate things in the future. If I use today's date in the testing, I have to repeat the calculation in the test, which doesn't feel right. What's the best way to set the date to a known value ...
TITLE: What's a good way to overwrite DateTime.Now during testing? QUESTION: I've got some (C#) code that relies on today's date to correctly calculate things in the future. If I use today's date in the testing, I have to repeat the calculation in the test, which doesn't feel right. What's the best way to set the date...
[ "c#", "unit-testing", "datetime", "testing" ]
129
167
51,571
13
0
2008-09-04T13:02:12.007000
2008-09-04T13:06:28.843000
43,742
43,760
SQL Profiler on SQL Server 2005 Professional Edition
I want to use SQL Profiler to trace the queries executed agains my database, track performance, etc. However it seems that the SQL Profiler is only available in the Enterprise edition of SQL Server 2005. Is this the case indeed, and can I do something about it?
You don't need any SQL license to run the client tools (Management Studio, Profiler, etc). If your organization has a copy of the installation media for Developer, Standard, or Enterprise, you can install the client tools on your local machine under the same license. If you're working solo, I would recommend purchasing...
SQL Profiler on SQL Server 2005 Professional Edition I want to use SQL Profiler to trace the queries executed agains my database, track performance, etc. However it seems that the SQL Profiler is only available in the Enterprise edition of SQL Server 2005. Is this the case indeed, and can I do something about it?
TITLE: SQL Profiler on SQL Server 2005 Professional Edition QUESTION: I want to use SQL Profiler to trace the queries executed agains my database, track performance, etc. However it seems that the SQL Profiler is only available in the Enterprise edition of SQL Server 2005. Is this the case indeed, and can I do somethi...
[ "sql", "sql-server", "sql-server-2005" ]
2
7
7,946
4
0
2008-09-04T13:19:58.937000
2008-09-04T13:29:17.573000
43,743
46,200
ASP.NET MVC Performance
I found some wild remarks that ASP.NET MVC is 30x faster than ASP.NET WebForms. What real performance difference is there, has this been measured and what are the performance benefits. This is to help me consider moving from ASP.NET WebForms to ASP.NET MVC.
We haven't performed the type of scalability and perf tests necessary to come up with any conclusions. I think ScottGu may have been discussing potential perf targets. As we move towards Beta and RTM, we will internally be doing more perf testing. However, I'm not sure what our policy is on publishing results of perf t...
ASP.NET MVC Performance I found some wild remarks that ASP.NET MVC is 30x faster than ASP.NET WebForms. What real performance difference is there, has this been measured and what are the performance benefits. This is to help me consider moving from ASP.NET WebForms to ASP.NET MVC.
TITLE: ASP.NET MVC Performance QUESTION: I found some wild remarks that ASP.NET MVC is 30x faster than ASP.NET WebForms. What real performance difference is there, has this been measured and what are the performance benefits. This is to help me consider moving from ASP.NET WebForms to ASP.NET MVC. ANSWER: We haven't ...
[ "asp.net", "asp.net-mvc", "performance", "webforms" ]
102
69
30,696
14
0
2008-09-04T13:20:03.057000
2008-09-05T16:19:02.927000
43,764
79,273
MS Access Reporting - can it be pretty?
I am working on a project converting a "spreadsheet application" to a database solution. A macro was written that takes screen shots of each page and pastes them into a PowerPoint presentation. Because of the nice formatting options in Excel, the presentation looks very pretty. The problem I'm having is that I haven't ...
Access has the capability to create downright beautiful reports. The problem is that it can't make a spreadsheet look better than Excel. You have to know when to use each tool. Use Excel when you have spreadsheet-like formatting, need a lot of boxes and lines, or want to draw charts. Use Access when you will output a r...
MS Access Reporting - can it be pretty? I am working on a project converting a "spreadsheet application" to a database solution. A macro was written that takes screen shots of each page and pastes them into a PowerPoint presentation. Because of the nice formatting options in Excel, the presentation looks very pretty. T...
TITLE: MS Access Reporting - can it be pretty? QUESTION: I am working on a project converting a "spreadsheet application" to a database solution. A macro was written that takes screen shots of each page and pastes them into a PowerPoint presentation. Because of the nice formatting options in Excel, the presentation lo...
[ "ms-access", "reporting", "powerpoint" ]
1
3
7,615
10
0
2008-09-04T13:31:53.590000
2008-09-17T02:27:02.267000
43,765
65,992
Pin Emacs buffers to windows (for cscope)
For my day job, I live in Emacs. Utterly. I also have become pretty dependent on CScope to help me find things in the code. Normally, I have 2 windows in a split (C-x 3): alt text http://bitthicket.com/files/emacs-2split.JPG And I use the right window for code buffers and the left window for the CScope search buffer. W...
Put this in your.emacs file:;; Toggle window dedication (defun toggle-window-dedicated () "Toggle whether the current active window is dedicated or not" (interactive) (message (if (let (window (get-buffer-window (current-buffer))) (set-window-dedicated-p window (not (window-dedicated-p window)))) "Window '%s' i...
Pin Emacs buffers to windows (for cscope) For my day job, I live in Emacs. Utterly. I also have become pretty dependent on CScope to help me find things in the code. Normally, I have 2 windows in a split (C-x 3): alt text http://bitthicket.com/files/emacs-2split.JPG And I use the right window for code buffers and the l...
TITLE: Pin Emacs buffers to windows (for cscope) QUESTION: For my day job, I live in Emacs. Utterly. I also have become pretty dependent on CScope to help me find things in the code. Normally, I have 2 windows in a split (C-x 3): alt text http://bitthicket.com/files/emacs-2split.JPG And I use the right window for code...
[ "emacs", "cscope" ]
24
35
5,969
2
0
2008-09-04T13:31:57.893000
2008-09-15T19:31:43.363000
43,768
43,771
WPF control performance
What is a good (and preferably simple) way to test the rendering performance of WPF custom controls? I have several complex controls in which rendering performance is highly crucial. I want to be able to make sure that I can have lots of them drawwing out in a designer with a minimal impact on performance.
Tool called Perforator will help you. See following article for details: Performance Profiling Tools for WPF
WPF control performance What is a good (and preferably simple) way to test the rendering performance of WPF custom controls? I have several complex controls in which rendering performance is highly crucial. I want to be able to make sure that I can have lots of them drawwing out in a designer with a minimal impact on p...
TITLE: WPF control performance QUESTION: What is a good (and preferably simple) way to test the rendering performance of WPF custom controls? I have several complex controls in which rendering performance is highly crucial. I want to be able to make sure that I can have lots of them drawwing out in a designer with a m...
[ ".net", "wpf", "performance" ]
10
2
576
1
0
2008-09-04T13:32:36.130000
2008-09-04T13:33:44.893000
43,775
43,794
Modulus operation with negatives values - weird thing?
Can you please tell me how much is (-2) % 5? According to my Python interpreter is 3, but do you have a wise explanation for this? I've read that in some languages the result can be machine-dependent, but I'm not sure though.
By the way: most programming languages would disagree with Python and give the result -2. Depending on the interpretation of modulus this is correct. However, the most agreed-upon mathematical definition states that the modulus of a and b is the (strictly positive) rest r of the division of a / b. More precisely, 0 <= ...
Modulus operation with negatives values - weird thing? Can you please tell me how much is (-2) % 5? According to my Python interpreter is 3, but do you have a wise explanation for this? I've read that in some languages the result can be machine-dependent, but I'm not sure though.
TITLE: Modulus operation with negatives values - weird thing? QUESTION: Can you please tell me how much is (-2) % 5? According to my Python interpreter is 3, but do you have a wise explanation for this? I've read that in some languages the result can be machine-dependent, but I'm not sure though. ANSWER: By the way: ...
[ "python", "math", "modulo" ]
18
16
12,545
12
0
2008-09-04T13:36:46.917000
2008-09-04T13:46:23.663000
43,777
43,792
'method' vs. 'message' vs. 'function' vs. '???'
I recently asked a question about what I called "method calls". The answer referred to "messages". As a self-taught hobby programmer trying to phrase questions that don't make me look like an idiot, I'm realizing that the terminology that I use reveals a lot about how I learned to program. Is there a distinction betwee...
I've found this to be a language and programming-paradigm thing. One paradigm — OOP — refers to objects with member methods, which conceptually are how you send messages to those objects (this view is reflected in UML, for example). Another paradigm — functional — may or may not involve classes of objects, but function...
'method' vs. 'message' vs. 'function' vs. '???' I recently asked a question about what I called "method calls". The answer referred to "messages". As a self-taught hobby programmer trying to phrase questions that don't make me look like an idiot, I'm realizing that the terminology that I use reveals a lot about how I l...
TITLE: 'method' vs. 'message' vs. 'function' vs. '???' QUESTION: I recently asked a question about what I called "method calls". The answer referred to "messages". As a self-taught hobby programmer trying to phrase questions that don't make me look like an idiot, I'm realizing that the terminology that I use reveals a...
[ "language-agnostic", "terminology" ]
34
18
11,059
11
0
2008-09-04T13:39:15.443000
2008-09-04T13:45:18.877000
43,778
43,840
sqlite3-ruby gem: Failed to build gem native extension
Update: Check out this follow-up question: Gem Update on Windows - is it broken? On Windows, when I do this: gem install sqlite3-ruby I get the following error: Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native extension. c:/ruby/bin/ruby.exe...
As Nathan suggests, this does appear to be related to the fact that the latest versions of the sqlite3-ruby and hpricot gems don't appear to have Windows versions. Here's what to do when faced with this situation (note, the name of the gem is automatically wildcarded, so you can type just sql and get a list of all gems...
sqlite3-ruby gem: Failed to build gem native extension Update: Check out this follow-up question: Gem Update on Windows - is it broken? On Windows, when I do this: gem install sqlite3-ruby I get the following error: Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: ERROR: Fail...
TITLE: sqlite3-ruby gem: Failed to build gem native extension QUESTION: Update: Check out this follow-up question: Gem Update on Windows - is it broken? On Windows, when I do this: gem install sqlite3-ruby I get the following error: Building native extensions. This could take a while... ERROR: Error installing sqlite3...
[ "windows", "ruby", "rubygems" ]
22
28
54,915
6
0
2008-09-04T13:40:19.670000
2008-09-04T14:13:02.227000
43,802
43,807
How to convert a date String to a Date or Calendar object?
I have a String representation of a date that I need to create a Date or Calendar object from. I've looked through Date and Calendar APIs but haven't found anything that can do this other than creating my own ugly parse method. I know there must be a way, does anyone know of a solution?
In brief: DateFormat formatter = new SimpleDateFormat("MM/dd/yy"); try { Date date = formatter.parse("01/29/02"); } catch (ParseException e) { e.printStackTrace(); } See SimpleDateFormat javadoc for more. And to turn it into a Calendar, do: Calendar calendar = Calendar.getInstance(); calendar.setTime(date);
How to convert a date String to a Date or Calendar object? I have a String representation of a date that I need to create a Date or Calendar object from. I've looked through Date and Calendar APIs but haven't found anything that can do this other than creating my own ugly parse method. I know there must be a way, does ...
TITLE: How to convert a date String to a Date or Calendar object? QUESTION: I have a String representation of a date that I need to create a Date or Calendar object from. I've looked through Date and Calendar APIs but haven't found anything that can do this other than creating my own ugly parse method. I know there mu...
[ "java", "date", "calendar" ]
63
126
134,330
5
0
2008-09-04T13:54:17.683000
2008-09-04T13:56:37.320000
43,803
43,894
How do I best populate an HTML table in ASP.NET?
This is what I've got. It works. But, is there a simpler or better way? ASPX Page… Published Title Author Price ASPX.VB Code Behind… Protected Sub Page_Load( ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim db As New BookstoreDataContext RepeaterBooks.DataSource = From b In db.Books _ Order By b...
@Geoff That sort of Eval statement was actually added in 2.0, but if performance is important Eval should be avoided since it uses Reflection. The repeater is a pretty good way of doing it, although it might be faster to generate the table in code: ASPX Page: Published Title Author Price Code Behind: Protected Sub Page...
How do I best populate an HTML table in ASP.NET? This is what I've got. It works. But, is there a simpler or better way? ASPX Page… Published Title Author Price ASPX.VB Code Behind… Protected Sub Page_Load( ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim db As New BookstoreDataContext RepeaterB...
TITLE: How do I best populate an HTML table in ASP.NET? QUESTION: This is what I've got. It works. But, is there a simpler or better way? ASPX Page… Published Title Author Price ASPX.VB Code Behind… Protected Sub Page_Load( ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim db As New BookstoreDat...
[ "asp.net", "html", "vb.net" ]
5
4
18,545
8
0
2008-09-04T13:54:43.177000
2008-09-04T14:36:54.977000
43,805
43,810
Example of c# based rule language?
Can you provide a good example of rule definition language written in C#. Java guys have JESS, is there anything good for C#?
This page shows some examples of open-source rules engines in C#: http://csharp-source.net/open-source/rule-engines
Example of c# based rule language? Can you provide a good example of rule definition language written in C#. Java guys have JESS, is there anything good for C#?
TITLE: Example of c# based rule language? QUESTION: Can you provide a good example of rule definition language written in C#. Java guys have JESS, is there anything good for C#? ANSWER: This page shows some examples of open-source rules engines in C#: http://csharp-source.net/open-source/rule-engines
[ "c#", "rule-engine" ]
16
9
22,079
8
0
2008-09-04T13:54:48.463000
2008-09-04T13:57:24.557000
43,808
43,830
How to prefetch Oracle sequence ID-s in a distributed environment
I have a distributed Java application running on 5 application servers. The servers all use the same Oracle 9i database running on a 6th machine. The application need to prefetch a batch of 100 IDs from a sequence. It's relatively easy to do in a single-threaded, non-distributed environment, you can just issue these qu...
Why not just have the sequence as increment by 100 all the time? each "nextval" gives you 100 sequence numbers to work with SQL> create sequence so_test start with 100 increment by 100 nocache; Sequence created. SQL> select so_test.nextval - 99 as first_seq, so_test.currval as last_seq from dual; FIRST_SEQ LAST_SEQ ...
How to prefetch Oracle sequence ID-s in a distributed environment I have a distributed Java application running on 5 application servers. The servers all use the same Oracle 9i database running on a 6th machine. The application need to prefetch a batch of 100 IDs from a sequence. It's relatively easy to do in a single-...
TITLE: How to prefetch Oracle sequence ID-s in a distributed environment QUESTION: I have a distributed Java application running on 5 application servers. The servers all use the same Oracle 9i database running on a 6th machine. The application need to prefetch a batch of 100 IDs from a sequence. It's relatively easy ...
[ "java", "oracle" ]
6
11
7,325
4
0
2008-09-04T13:56:45.057000
2008-09-04T14:10:39.940000
43,809
43,872
Which JSTL URL should I reference in my JSPs?
I'm getting the following error when trying to run a JSP. I'm using Tomcat 6.0.18, and I'd like to use the latest version of JSTL. What version of JSTL should I use, and which URL goes with which version of JSTL? I'm getting this error "According to TLD or attribute directive in tag file, attribute key does not accept ...
Go with <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> More on this topic here
Which JSTL URL should I reference in my JSPs? I'm getting the following error when trying to run a JSP. I'm using Tomcat 6.0.18, and I'd like to use the latest version of JSTL. What version of JSTL should I use, and which URL goes with which version of JSTL? I'm getting this error "According to TLD or attribute directi...
TITLE: Which JSTL URL should I reference in my JSPs? QUESTION: I'm getting the following error when trying to run a JSP. I'm using Tomcat 6.0.18, and I'd like to use the latest version of JSTL. What version of JSTL should I use, and which URL goes with which version of JSTL? I'm getting this error "According to TLD or...
[ "jsp", "jstl", "uri", "taglib" ]
7
5
1,254
1
0
2008-09-04T13:57:15.243000
2008-09-04T14:28:30.550000
43,811
43,824
jQuery slicing and click events
This is probably a really simple jQuery question, but I couldn't answer it after 10 minutes in the documentation so... I have a list of checkboxes, and I can get them with the selector 'input[type=checkbox]'. I want the user to be able to shift-click and select a range of checkboxes. To accomplish this, I need to get t...
The following selector should also work in jQuery: input:checkbox. You can then string the:gt(index) and:lt(index) filters together, so if you want the 5th to 7th checkboxes, you'd use input:checkbox:gt(4):lt(2). To get the index of the currently clicked checkbox, just use $("input:checkbox").index($(this)).
jQuery slicing and click events This is probably a really simple jQuery question, but I couldn't answer it after 10 minutes in the documentation so... I have a list of checkboxes, and I can get them with the selector 'input[type=checkbox]'. I want the user to be able to shift-click and select a range of checkboxes. To ...
TITLE: jQuery slicing and click events QUESTION: This is probably a really simple jQuery question, but I couldn't answer it after 10 minutes in the documentation so... I have a list of checkboxes, and I can get them with the selector 'input[type=checkbox]'. I want the user to be able to shift-click and select a range ...
[ "javascript", "jquery" ]
7
9
1,578
4
0
2008-09-04T13:57:25.697000
2008-09-04T14:07:16.437000
43,823
47,083
How well will WCF scale to a large number of client users?
Does anyone have any experience with how well web services build with Microsoft's WCF will scale to a large number of users? The level I'm thinking of is in the region of 1000+ client users connecting to a collection of WCF services providing the business logic for our application, and these talking to a database - sim...
To ensure your WCF application can scale to the desired level I think you might need to tweak your thinking about the stats your services have to meet. You mention servicing "1000+ client users" but to gauge if your services can perform at that level you'll also need to have some estimated usage figures, which will hel...
How well will WCF scale to a large number of client users? Does anyone have any experience with how well web services build with Microsoft's WCF will scale to a large number of users? The level I'm thinking of is in the region of 1000+ client users connecting to a collection of WCF services providing the business logic...
TITLE: How well will WCF scale to a large number of client users? QUESTION: Does anyone have any experience with how well web services build with Microsoft's WCF will scale to a large number of users? The level I'm thinking of is in the region of 1000+ client users connecting to a collection of WCF services providing ...
[ "wcf", "scalability", "soa" ]
19
15
9,382
3
0
2008-09-04T14:06:57.920000
2008-09-05T23:32:19.750000
43,842
43,852
How Would You Programmatically Create a Pattern from a Date that is Stored in a String?
I have a string that contains the representation of a date. It looks like: Thu Nov 30 19:00:00 EST 2006 I'm trying to create a Date object using SimpleDateFormat and have 2 problems. 1.) I can't figure out the pattern to hard-code the solution into the SimpleDateFormat constructor 2.) I can't find a way I could parse t...
The format to pass to SimpleDateFormat could be looked up at http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy") As for your second question, I don't know of any Java library to figure out a date format and parse it without knowing in advance what t...
How Would You Programmatically Create a Pattern from a Date that is Stored in a String? I have a string that contains the representation of a date. It looks like: Thu Nov 30 19:00:00 EST 2006 I'm trying to create a Date object using SimpleDateFormat and have 2 problems. 1.) I can't figure out the pattern to hard-code t...
TITLE: How Would You Programmatically Create a Pattern from a Date that is Stored in a String? QUESTION: I have a string that contains the representation of a date. It looks like: Thu Nov 30 19:00:00 EST 2006 I'm trying to create a Date object using SimpleDateFormat and have 2 problems. 1.) I can't figure out the patt...
[ "java", "date" ]
6
8
2,569
11
0
2008-09-04T14:15:26.340000
2008-09-04T14:21:12.283000
43,866
43,901
How SID is different from Service name in Oracle tnsnames.ora
Why do I need two of them? When I have to use one or another?
Quote by @DAC In short: SID = the unique name of your DB, ServiceName = the alias used when connecting Not strictly true. SID = unique name of the INSTANCE (eg the oracle process running on the machine). Oracle considers the "Database" to be the files. Service Name = alias to an INSTANCE (or many instances). The main p...
How SID is different from Service name in Oracle tnsnames.ora Why do I need two of them? When I have to use one or another?
TITLE: How SID is different from Service name in Oracle tnsnames.ora QUESTION: Why do I need two of them? When I have to use one or another? ANSWER: Quote by @DAC In short: SID = the unique name of your DB, ServiceName = the alias used when connecting Not strictly true. SID = unique name of the INSTANCE (eg the oracl...
[ "database", "oracle", "service", "administration", "sid" ]
201
169
617,225
5
0
2008-09-04T14:26:06.593000
2008-09-04T14:39:55.250000
43,870
43,944
How to concatenate strings of a string field in a PostgreSQL 'group by' query?
I am looking for a way to concatenate the strings of a field within a group by query. So for example, I have a table: ID COMPANY_ID EMPLOYEE 1 1 Anna 2 1 Bill 3 2 Carol 4 2 Dave and I wanted to group by company_id to get something like: COMPANY_ID EMPLOYEE 1 Anna, Bill 2 Carol, Dave There is a built-in function in mySQ...
PostgreSQL 9.0 or later: Modern Postgres (since 2010) has the string_agg(expression, delimiter) function which will do exactly what the asker was looking for: SELECT company_id, string_agg(employee, ', ') FROM mytable GROUP BY company_id; Postgres 9 also added the ability to specify an ORDER BY clause in any aggregate ...
How to concatenate strings of a string field in a PostgreSQL 'group by' query? I am looking for a way to concatenate the strings of a field within a group by query. So for example, I have a table: ID COMPANY_ID EMPLOYEE 1 1 Anna 2 1 Bill 3 2 Carol 4 2 Dave and I wanted to group by company_id to get something like: COMP...
TITLE: How to concatenate strings of a string field in a PostgreSQL 'group by' query? QUESTION: I am looking for a way to concatenate the strings of a field within a group by query. So for example, I have a table: ID COMPANY_ID EMPLOYEE 1 1 Anna 2 1 Bill 3 2 Carol 4 2 Dave and I wanted to group by company_id to get so...
[ "sql", "postgresql", "group-by", "string-aggregation" ]
481
714
428,998
14
0
2008-09-04T14:27:16.263000
2008-09-04T15:03:25.147000
43,874
43,931
Restrict selection of SELECT option without disabling the field
I have a multiple selection SELECT field which I don't want the end user to be able to change the value of. For UI reasons, I would like to be able to do this without using the disabled="true" attribute. I've tried using onmousedown, onfocus, onclick and setting each to blur or return false but with no success. Can thi...
I know you mentioned that you don't want to, but I actually think that using the disabled attribute is a better solution: Volvo Saab Opel Audi If necessary, you can always give the select a class and style it with CSS. This solution will work in all browsers regardless of scripting capabilities.
Restrict selection of SELECT option without disabling the field I have a multiple selection SELECT field which I don't want the end user to be able to change the value of. For UI reasons, I would like to be able to do this without using the disabled="true" attribute. I've tried using onmousedown, onfocus, onclick and s...
TITLE: Restrict selection of SELECT option without disabling the field QUESTION: I have a multiple selection SELECT field which I don't want the end user to be able to change the value of. For UI reasons, I would like to be able to do this without using the disabled="true" attribute. I've tried using onmousedown, onfo...
[ "html", "user-interface", "html-select" ]
7
9
10,102
6
0
2008-09-04T14:30:06.193000
2008-09-04T14:56:08.287000
43,877
47,768
Managing web services in FlexBuilder - How does the manager work?
In FlexBuilder 3, there are two items under the 'Data' menu to import and manage web services. After importing a webservice, I can update it with the manage option. However, the webservices seems to disappear after they are imported. The manager does however recognize that a certain WSDL URL was imported and refuses to...
In your src folder of the flexbuilder project you should see the generated classes. For instance, if you use the manager to generate the proxy classes for www.example.com you should see the folders /com/example with the generated proxy classes inside. To consume these webservices in ActionScript use the statement: "imp...
Managing web services in FlexBuilder - How does the manager work? In FlexBuilder 3, there are two items under the 'Data' menu to import and manage web services. After importing a webservice, I can update it with the manage option. However, the webservices seems to disappear after they are imported. The manager does how...
TITLE: Managing web services in FlexBuilder - How does the manager work? QUESTION: In FlexBuilder 3, there are two items under the 'Data' menu to import and manage web services. After importing a webservice, I can update it with the manage option. However, the webservices seems to disappear after they are imported. Th...
[ "apache-flex", "web-services", "flexbuilder" ]
0
1
976
1
0
2008-09-04T14:30:52.760000
2008-09-06T19:43:54.190000
43,890
44,032
Crop MP3 to first 30 seconds
Original Question I want to be able to generate a new (fully valid) MP3 file from an existing MP3 file to be used as a preview -- try-before-you-buy style. The new file should only contain the first n seconds of the track. Now, I know I could just "chop the stream" at n seconds (calculating from the bitrate and header ...
I also recommend ffmpeg, but the command line suggested by John Boker has an unintended side effect: it re-encodes the file to the default bitrate (which is 64 kb/s in the version I have here at least). This might give your customers a false impression of the quality of your sound files, and it also takes longer to do....
Crop MP3 to first 30 seconds Original Question I want to be able to generate a new (fully valid) MP3 file from an existing MP3 file to be used as a preview -- try-before-you-buy style. The new file should only contain the first n seconds of the track. Now, I know I could just "chop the stream" at n seconds (calculating...
TITLE: Crop MP3 to first 30 seconds QUESTION: Original Question I want to be able to generate a new (fully valid) MP3 file from an existing MP3 file to be used as a preview -- try-before-you-buy style. The new file should only contain the first n seconds of the track. Now, I know I could just "chop the stream" at n se...
[ "mp3", "ffmpeg" ]
118
166
83,704
8
0
2008-09-04T14:35:14.437000
2008-09-04T15:42:02.153000
43,903
43,925
SQL Server 2005 Temporary Tables
In a stored procedure, when is #Temptable created in SQL Server 2005? When creating the query execution plan or when executing the stored procedure? if (@x = 1) begin select 1 as Text into #Temptable end else begin select 2 as Text into #Temptable end
Interesting question. For the type of temporary table you're creating, I think it's when the stored procedure is executed. Tables created with the # prefix are accessible to the SQL Server session they're created in. Once the session ends, they're dropped. This url: http://www.sql-server-performance.com/tips/query_exec...
SQL Server 2005 Temporary Tables In a stored procedure, when is #Temptable created in SQL Server 2005? When creating the query execution plan or when executing the stored procedure? if (@x = 1) begin select 1 as Text into #Temptable end else begin select 2 as Text into #Temptable end
TITLE: SQL Server 2005 Temporary Tables QUESTION: In a stored procedure, when is #Temptable created in SQL Server 2005? When creating the query execution plan or when executing the stored procedure? if (@x = 1) begin select 1 as Text into #Temptable end else begin select 2 as Text into #Temptable end ANSWER: Interest...
[ "sql-server", "sql-server-2005", "temp-tables" ]
1
1
4,839
4
0
2008-09-04T14:41:09.680000
2008-09-04T14:51:41.557000
43,908
43,917
Resources for building a Visual Studio plug-in?
I'd like to build a pretty simple plug-in for Visual Studio, but I don't really know how this has to be done. Is this doable in (non-managed) C++? I'd like to know what resources you'd recommend me.
I've never tried, so I don't know about doing it in C++, but this website has loads of information: http://msdn.microsoft.com/en-us/vsx/default.aspx
Resources for building a Visual Studio plug-in? I'd like to build a pretty simple plug-in for Visual Studio, but I don't really know how this has to be done. Is this doable in (non-managed) C++? I'd like to know what resources you'd recommend me.
TITLE: Resources for building a Visual Studio plug-in? QUESTION: I'd like to build a pretty simple plug-in for Visual Studio, but I don't really know how this has to be done. Is this doable in (non-managed) C++? I'd like to know what resources you'd recommend me. ANSWER: I've never tried, so I don't know about doing ...
[ "visual-studio", "add-in" ]
7
1
2,738
6
0
2008-09-04T14:43:18.957000
2008-09-04T14:46:13.503000
43,926
43,937
Can jQuery select by CSS rule, not class?
A.container can contain many.components, and.components themselves can contain.containers (which in turn can contain.components etc. etc.) Given code like this: $(".container.component").each(function(){ $(".container", this).css('border', '1px solid #f00'); }); What do I need to add to the line within the braces to se...
$(".container.component").each(function() { $(".container", this).each(function() { if($(this).css('width') == 'auto') { $(this).css('border', '1px solid #f00'); } }); }); Similar to the other answer but since components can also have multiple containers, also needs the.each() check in here too for the width.
Can jQuery select by CSS rule, not class? A.container can contain many.components, and.components themselves can contain.containers (which in turn can contain.components etc. etc.) Given code like this: $(".container.component").each(function(){ $(".container", this).css('border', '1px solid #f00'); }); What do I need ...
TITLE: Can jQuery select by CSS rule, not class? QUESTION: A.container can contain many.components, and.components themselves can contain.containers (which in turn can contain.components etc. etc.) Given code like this: $(".container.component").each(function(){ $(".container", this).css('border', '1px solid #f00'); }...
[ "javascript", "jquery", "css-selectors" ]
24
19
24,621
3
0
2008-09-04T14:53:14.440000
2008-09-04T14:59:39.323000
43,939
43,946
Targeting multiple versions of .net framework
Suppose I have some code that would, in theory, compile against any version of the.net framework. Think "Hello World", if you like. If I actually compile the code, though, I'll get an executable that runs against one particular version. Is there any way to arrange things so that the compiled exe will just run against w...
Im not sure if this is correct, but i'd try to compile it for the lowest version, the higher versions should be able to run the lower versions exe's.
Targeting multiple versions of .net framework Suppose I have some code that would, in theory, compile against any version of the.net framework. Think "Hello World", if you like. If I actually compile the code, though, I'll get an executable that runs against one particular version. Is there any way to arrange things so...
TITLE: Targeting multiple versions of .net framework QUESTION: Suppose I have some code that would, in theory, compile against any version of the.net framework. Think "Hello World", if you like. If I actually compile the code, though, I'll get an executable that runs against one particular version. Is there any way to...
[ ".net", "compilation", "version" ]
4
6
3,619
7
0
2008-09-04T15:00:35.187000
2008-09-04T15:03:33.167000
43,947
43,968
What is the best way of adding in regularly used blocks of code when marking up in TextMate?
Caveat: I'm relatively new to coding as well as TextMate, so apologies if there is an obvious answer I'm missing here. I do a lot of HTML/CSS markup, there are certain patterns that I use a lot, for example, forms, navigation menus etc. What I would like is a way to store those patterns and insert them quickly when I n...
You can do this very easily in TextMate using Snippets. Just add a new snippet in the bundle editor, and set up how you want to trigger it. You can set a key shortcut, or have it pop up when you hit Tab after a certain word/pattern. There are many things you can do with them—in your case, it would probably be very usef...
What is the best way of adding in regularly used blocks of code when marking up in TextMate? Caveat: I'm relatively new to coding as well as TextMate, so apologies if there is an obvious answer I'm missing here. I do a lot of HTML/CSS markup, there are certain patterns that I use a lot, for example, forms, navigation m...
TITLE: What is the best way of adding in regularly used blocks of code when marking up in TextMate? QUESTION: Caveat: I'm relatively new to coding as well as TextMate, so apologies if there is an obvious answer I'm missing here. I do a lot of HTML/CSS markup, there are certain patterns that I use a lot, for example, f...
[ "html", "design-patterns", "textmate", "markup" ]
1
6
148
3
0
2008-09-04T15:03:33.667000
2008-09-04T15:09:35.053000
43,955
43,959
Changing the default title of confirm() in JavaScript?
Is it possible to modify the title of the message box the confirm() function opens in JavaScript? I could create a modal popup box, but I would like to do this as minimalistic as possible. I would like to do something like this: confirm("This is the content of the message box", "Modified title"); The default title in I...
This is not possible, as you say, from a security stand point. The only way you could simulate it, is by creating a modeless dialog window. There are many third-party javascript-plugins that you could use to fake this effect so you do not have to write all that code.
Changing the default title of confirm() in JavaScript? Is it possible to modify the title of the message box the confirm() function opens in JavaScript? I could create a modal popup box, but I would like to do this as minimalistic as possible. I would like to do something like this: confirm("This is the content of the ...
TITLE: Changing the default title of confirm() in JavaScript? QUESTION: Is it possible to modify the title of the message box the confirm() function opens in JavaScript? I could create a modal popup box, but I would like to do this as minimalistic as possible. I would like to do something like this: confirm("This is t...
[ "javascript" ]
87
92
181,806
8
0
2008-09-04T15:06:01.133000
2008-09-04T15:07:26.713000
43,970
107,795
Configuring sendmail behind a firewall
I'm setting up a server which is on a network behind a firewall and I want programs on this computer to be able to use sendmail to send emails to any email address. We have an SMTP server running on this network (let's call it mailrelay.example.com) which is how we're supposed to get outgoing emails through the firewal...
@eli: modifying sendmail.cf directly is not usually recommended, since it is generated by the macro compiler. Edit /etc/mail/sendmail.mc to include the line: define(`SMART_HOST',`mailrelay.example.com')dnl After changing the sendmail.mc macro configuration file, it must be recompiled to produce the sendmail configurati...
Configuring sendmail behind a firewall I'm setting up a server which is on a network behind a firewall and I want programs on this computer to be able to use sendmail to send emails to any email address. We have an SMTP server running on this network (let's call it mailrelay.example.com) which is how we're supposed to ...
TITLE: Configuring sendmail behind a firewall QUESTION: I'm setting up a server which is on a network behind a firewall and I want programs on this computer to be able to use sendmail to send emails to any email address. We have an SMTP server running on this network (let's call it mailrelay.example.com) which is how ...
[ "configuration", "firewall", "sendmail", "smarthost" ]
8
14
23,429
3
0
2008-09-04T15:10:13.960000
2008-09-20T10:05:40.757000
43,971
43,983
Dynamic robots.txt
Let's say I have a web site for hosting community generated content that targets a very specific set of users. Now, let's say in the interest of fostering a better community I have an off-topic area where community members can post or talk about anything they want, regardless of the site's main theme. Now, I want most ...
This will work for all well-behaving search engines, just add it to the:
Dynamic robots.txt Let's say I have a web site for hosting community generated content that targets a very specific set of users. Now, let's say in the interest of fostering a better community I have an off-topic area where community members can post or talk about anything they want, regardless of the site's main theme...
TITLE: Dynamic robots.txt QUESTION: Let's say I have a web site for hosting community generated content that targets a very specific set of users. Now, let's say in the interest of fostering a better community I have an off-topic area where community members can post or talk about anything they want, regardless of the...
[ "seo" ]
11
22
5,921
8
0
2008-09-04T15:10:22.137000
2008-09-04T15:13:30.537000
43,992
50,977
How to safely embed any flash file (swf)?
I want to allow my users to embed their own Flash animations in their posts. Usually the actual file is hosted on some free image hosting site. I wouldn't actually load the flash unless the user clicked a button to play (so that nothing auto-plays on page load). I know people can make some really annoying crap in flash...
Adobe says you can set allowScriptAccess =never and allowNetworking =none and the swf should have no access to anything outside of itself. Although allowNetworking is only in Flash Player 9, so users with earlier versions of Flash would still be susceptible to some exploits. Creating more secure SWF web applications: S...
How to safely embed any flash file (swf)? I want to allow my users to embed their own Flash animations in their posts. Usually the actual file is hosted on some free image hosting site. I wouldn't actually load the flash unless the user clicked a button to play (so that nothing auto-plays on page load). I know people c...
TITLE: How to safely embed any flash file (swf)? QUESTION: I want to allow my users to embed their own Flash animations in their posts. Usually the actual file is hosted on some free image hosting site. I wouldn't actually load the flash unless the user clicked a button to play (so that nothing auto-plays on page load...
[ "security", "flash", "embed" ]
5
1
6,704
6
0
2008-09-04T15:15:24.137000
2008-09-08T23:51:04.047000
43,995
44,708
Why is branching and merging easier in Mercurial than in Subversion?
Handling multiple merges onto branches in Subversion or CVS is just one of those things that has to be experienced. It is inordinately easier to keep track of branches and merges in Mercurial (and probably any other distributed system) but I don't know why. Does anyone else know? My question stems from the fact that wi...
In Subversion (and CVS), the repository is first and foremost. In git and mercurial there is not really the concept of a repository in the same way; here changes are the central theme. +1 The hassle in CVS/SVN comes from the fact that these systems do not remember the parenthood of changes. In Git and Mercurial, not on...
Why is branching and merging easier in Mercurial than in Subversion? Handling multiple merges onto branches in Subversion or CVS is just one of those things that has to be experienced. It is inordinately easier to keep track of branches and merges in Mercurial (and probably any other distributed system) but I don't kno...
TITLE: Why is branching and merging easier in Mercurial than in Subversion? QUESTION: Handling multiple merges onto branches in Subversion or CVS is just one of those things that has to be experienced. It is inordinately easier to keep track of branches and merges in Mercurial (and probably any other distributed syste...
[ "svn", "git", "version-control", "mercurial" ]
93
115
12,083
6
0
2008-09-04T15:16:36.723000
2008-09-04T20:32:43.123000
44,007
190,097
ncover with nunit2 task in NAnt
Is there any chance to get this work? I want my tests to be run by nunit2 task in NAnt. In addition I want to run NCover without running tests again.
I figured it out. You change the path of the NUnit launcher to that of TeamCity's own. Here is an example: As you can see, I have some of my own variables in there, but you should be able to figure out what is going on. The property you are concerned with is teamcity.dotnet.nunitlauncher. You can read more about it her...
ncover with nunit2 task in NAnt Is there any chance to get this work? I want my tests to be run by nunit2 task in NAnt. In addition I want to run NCover without running tests again.
TITLE: ncover with nunit2 task in NAnt QUESTION: Is there any chance to get this work? I want my tests to be run by nunit2 task in NAnt. In addition I want to run NCover without running tests again. ANSWER: I figured it out. You change the path of the NUnit launcher to that of TeamCity's own. Here is an example: As y...
[ "nunit", "nant", "task", "ncover" ]
3
3
1,796
3
0
2008-09-04T15:22:18.130000
2008-10-10T04:11:11.453000
44,019
44,033
An easy way to diff log files, ignoring the time stamps?
I need to diff two log files but ignore the time stamp part of each line (the first 12 characters to be exact). Is there a good tool, or a clever awk command, that could help me out?
Depending on the shell you are using, you can turn the approach @Blair suggested into a 1-liner diff <(cut -b13- file1) <(cut -b13- file2) (+1 to @Blair for the original suggestion:-)
An easy way to diff log files, ignoring the time stamps? I need to diff two log files but ignore the time stamp part of each line (the first 12 characters to be exact). Is there a good tool, or a clever awk command, that could help me out?
TITLE: An easy way to diff log files, ignoring the time stamps? QUESTION: I need to diff two log files but ignore the time stamp part of each line (the first 12 characters to be exact). Is there a good tool, or a clever awk command, that could help me out? ANSWER: Depending on the shell you are using, you can turn th...
[ "parsing", "shell", "diff", "compare", "logging" ]
56
56
27,477
6
0
2008-09-04T15:33:35.730000
2008-09-04T15:44:17.700000
44,034
44,045
How can I get the definition (body) of a trigger in SQL Server?
Unable to find a SQL diff tool that meets my needs, I am writing my own. Between the INFORMATION_SCHEMA and sys tables, I have a mostly-complete working version. But one thing I can't find in the metadata is the definition of a trigger, you know, the actual SQL code. Am I overlooking something? Thanks. Thanks, Pete, I ...
sp_helptext works to get the sql that makes up a trigger. The text column in the syscomments view also contains the sql used for object creation.
How can I get the definition (body) of a trigger in SQL Server? Unable to find a SQL diff tool that meets my needs, I am writing my own. Between the INFORMATION_SCHEMA and sys tables, I have a mostly-complete working version. But one thing I can't find in the metadata is the definition of a trigger, you know, the actua...
TITLE: How can I get the definition (body) of a trigger in SQL Server? QUESTION: Unable to find a SQL diff tool that meets my needs, I am writing my own. Between the INFORMATION_SCHEMA and sys tables, I have a mostly-complete working version. But one thing I can't find in the metadata is the definition of a trigger, y...
[ "sql-server", "triggers", "metadata" ]
31
28
57,270
6
0
2008-09-04T15:46:07.743000
2008-09-04T15:50:34.193000
44,046
44,052
Truncate (not round) decimal places in SQL Server
I'm trying to determine the best way to truncate or drop extra decimal places in SQL without rounding. For example: declare @value decimal(18,2) set @value = 123.456 This will automatically round @value to be 123.46, which is good in most cases. However, for this project, I don't need that. Is there a simple way to tr...
You will need to provide 3 numbers to the ROUND function. number Required. The number to be rounded decimals Required. The number of decimal places to round number to operation Optional. If 0, it rounds the result to the number of decimal. If another value than 0, it truncates the result to the number of decimals. Defa...
Truncate (not round) decimal places in SQL Server I'm trying to determine the best way to truncate or drop extra decimal places in SQL without rounding. For example: declare @value decimal(18,2) set @value = 123.456 This will automatically round @value to be 123.46, which is good in most cases. However, for this proje...
TITLE: Truncate (not round) decimal places in SQL Server QUESTION: I'm trying to determine the best way to truncate or drop extra decimal places in SQL without rounding. For example: declare @value decimal(18,2) set @value = 123.456 This will automatically round @value to be 123.46, which is good in most cases. Howev...
[ "sql", "sql-server", "t-sql", "rounding" ]
227
210
794,340
21
0
2008-09-04T15:50:41.837000
2008-09-04T15:54:24.090000
44,048
44,053
Best way to rotate Apache log files
I've got an Apache server that has one access log file that is topping 600MB. This makes it really hard to search the file or parse it. What software or modules for Apache are available that will make a daily copy of my access file to make it more manageable?
Have you looked at logrotate - this is probably the simplest, most widely available and well understood method of achieving this. It is highly configurable and will probably do 90% of what you need.
Best way to rotate Apache log files I've got an Apache server that has one access log file that is topping 600MB. This makes it really hard to search the file or parse it. What software or modules for Apache are available that will make a daily copy of my access file to make it more manageable?
TITLE: Best way to rotate Apache log files QUESTION: I've got an Apache server that has one access log file that is topping 600MB. This makes it really hard to search the file or parse it. What software or modules for Apache are available that will make a daily copy of my access file to make it more manageable? ANSWE...
[ "apache", "logging", "webserver", "apache2", "apache2.4" ]
70
50
112,859
7
0
2008-09-04T15:51:59.977000
2008-09-04T15:54:38.737000
44,066
44,079
Pass functions in F#
Is it possible to pass a reference to a function to another function in F#? Specifically, I'd like to pass lambda functions like foo(fun x -> x ** 3) More specifically, I need to know how I would refer to the passed function in a function that I wrote myself.
Yes, it is possible. The manual has this example: > List.map (fun x -> x % 2 = 0) [1.. 5];; val it: bool list = [false; true; false; true; false]
Pass functions in F# Is it possible to pass a reference to a function to another function in F#? Specifically, I'd like to pass lambda functions like foo(fun x -> x ** 3) More specifically, I need to know how I would refer to the passed function in a function that I wrote myself.
TITLE: Pass functions in F# QUESTION: Is it possible to pass a reference to a function to another function in F#? Specifically, I'd like to pass lambda functions like foo(fun x -> x ** 3) More specifically, I need to know how I would refer to the passed function in a function that I wrote myself. ANSWER: Yes, it is p...
[ "f#", "functional-programming", "lambda" ]
10
8
5,996
3
0
2008-09-04T15:59:36.463000
2008-09-04T16:05:28.273000
44,078
44,124
Strip all HTML tags except links
I am trying to write a regular expression to strip all HTML with the exception of links (the and tags respectively. It does not have to be 100% secure (I am not worried about injection attacks or anything as I am parsing content that has already been approved and published into a SWF movie). The original "strip tags" r...
<(?!\/?a(?=>|\s.*>))\/?.*?> Try this. Had something similar for p tags. Worked for them so don't see why not. Uses negative lookahead to check that it doesn't match a (prefixed with an optional / character) where (using positive lookahead) a (with optional / prefix) is followed by a > or a space, stuff and then >. This...
Strip all HTML tags except links I am trying to write a regular expression to strip all HTML with the exception of links (the and tags respectively. It does not have to be 100% secure (I am not worried about injection attacks or anything as I am parsing content that has already been approved and published into a SWF mo...
TITLE: Strip all HTML tags except links QUESTION: I am trying to write a regular expression to strip all HTML with the exception of links (the and tags respectively. It does not have to be 100% secure (I am not worried about injection attacks or anything as I am parsing content that has already been approved and publi...
[ "html", "regex", "actionscript-3", "string", "tags" ]
27
28
20,282
6
0
2008-09-04T16:04:57.870000
2008-09-04T16:29:23.193000
44,080
44,137
Does Microsoft ASP.NET Ajax Cause DOM Object Leaks?
We've been using "Drip" to try and identify why pages with UpdatePanels in them tend to use a lot of client-side memory. With a page with a regular postback, we are seeing 0 leaks detected by Drip. However, when we add an update panel to the mix, every single DOM object that is inside of the update panel appears to lea...
According to ASP.NET AJAX in Action, p. 257 Just before the old markup is replaced with the updated HTML, all the DOM elements in the panel are examined for Microsoft Ajax behaviours or controls attached to them. To avoid memory leaks, the components associated with DOM elements are disposed, and then destroyed when th...
Does Microsoft ASP.NET Ajax Cause DOM Object Leaks? We've been using "Drip" to try and identify why pages with UpdatePanels in them tend to use a lot of client-side memory. With a page with a regular postback, we are seeing 0 leaks detected by Drip. However, when we add an update panel to the mix, every single DOM obje...
TITLE: Does Microsoft ASP.NET Ajax Cause DOM Object Leaks? QUESTION: We've been using "Drip" to try and identify why pages with UpdatePanels in them tend to use a lot of client-side memory. With a page with a regular postback, we are seeing 0 leaks detected by Drip. However, when we add an update panel to the mix, eve...
[ "asp.net", "dom", "asp.net-ajax", "memory-leaks" ]
2
3
1,239
3
0
2008-09-04T16:05:57.930000
2008-09-04T16:36:57.450000
44,084
44,095
How do I document a module in Python?
That's it. If you want to document a function or a class, you put a string just after the definition. For instance: def foo(): """This function does nothing.""" pass But what about a module? How can I document what a file.py does?
For the packages, you can document it in __init__.py. For the modules, you can add a docstring simply in the module file. All the information is here: http://www.python.org/dev/peps/pep-0257/
How do I document a module in Python? That's it. If you want to document a function or a class, you put a string just after the definition. For instance: def foo(): """This function does nothing.""" pass But what about a module? How can I document what a file.py does?
TITLE: How do I document a module in Python? QUESTION: That's it. If you want to document a function or a class, you put a string just after the definition. For instance: def foo(): """This function does nothing.""" pass But what about a module? How can I document what a file.py does? ANSWER: For the packages, you ca...
[ "python", "documentation", "python-module" ]
89
55
77,096
6
0
2008-09-04T16:06:48.957000
2008-09-04T16:12:23.127000
44,089
44,676
How To Extract SFTP SSH Key From Key Cache in FileZilla FTP Client
I have connected to a server via SFTP using FileZilla and accepted adding the server's SSH key to the key cache in FileZilla. How can I extract this cached key to a keyfile so that may use it through other SFTP applications that require a keyfile be made available? I have not been able to find anything in the FileZilla...
If you use the standard openssh console client (cygwin or from linux), host keys are stored, one-per-line, in ~/.ssh/known_hosts. From there, it's a simple matter of figuring out which bit of that host key is needed for your library. Putty also stores host keys, but it appears to encode them in hex. Those can be found ...
How To Extract SFTP SSH Key From Key Cache in FileZilla FTP Client I have connected to a server via SFTP using FileZilla and accepted adding the server's SSH key to the key cache in FileZilla. How can I extract this cached key to a keyfile so that may use it through other SFTP applications that require a keyfile be mad...
TITLE: How To Extract SFTP SSH Key From Key Cache in FileZilla FTP Client QUESTION: I have connected to a server via SFTP using FileZilla and accepted adding the server's SSH key to the key cache in FileZilla. How can I extract this cached key to a keyfile so that may use it through other SFTP applications that requir...
[ "ftp", "sftp", "filezilla" ]
20
22
81,104
5
0
2008-09-04T16:09:20.777000
2008-09-04T20:12:16.263000
44,100
44,106
Best way to use a property to reference a Key-Value pair in a dictionary
This is a fairly trivial matter, but I'm curious to hear people's opinions on it. If I have a Dictionary which I'm access through properties, which of these formats would you prefer for the property? /// /// This class's FirstProperty property /// [DefaultValue("myValue")] public string FirstProperty { get { return Dic...
I like the second one purely because any avoidance of magic strings/numbers in code is a good thing. IMO if you need to reference a number or string literal in code more than once, it should be a constant. In most cases even if it's only used once it should be in a constant
Best way to use a property to reference a Key-Value pair in a dictionary This is a fairly trivial matter, but I'm curious to hear people's opinions on it. If I have a Dictionary which I'm access through properties, which of these formats would you prefer for the property? /// /// This class's FirstProperty property ///...
TITLE: Best way to use a property to reference a Key-Value pair in a dictionary QUESTION: This is a fairly trivial matter, but I'm curious to hear people's opinions on it. If I have a Dictionary which I'm access through properties, which of these formats would you prefer for the property? /// /// This class's FirstPro...
[ ".net", "dictionary", "properties", "constants" ]
3
4
2,081
7
0
2008-09-04T16:15:13.650000
2008-09-04T16:18:09.977000
44,102
44,825
NT authentication login
I am working on a site where users can login to get more private information. My client has another site else where that uses nt authentication for accessing it. What they want to do is have a button on the site I am working on under the private area that will send them to the nt authenticated site, but not require the...
Here's an (untested) theory, the details of which will greatly depend on what types of authentication the Sharepoint site will accept. I'll tackle Basic, since it's the easiest. You'll write out some JavaScript that uses XMLHttpRequest to submit a request to the Sharepoint site, and add their username and password to t...
NT authentication login I am working on a site where users can login to get more private information. My client has another site else where that uses nt authentication for accessing it. What they want to do is have a button on the site I am working on under the private area that will send them to the nt authenticated s...
TITLE: NT authentication login QUESTION: I am working on a site where users can login to get more private information. My client has another site else where that uses nt authentication for accessing it. What they want to do is have a button on the site I am working on under the private area that will send them to the ...
[ "authentication", "ntlm" ]
1
1
1,111
5
0
2008-09-04T16:15:48.563000
2008-09-04T21:22:09.607000
44,109
44,178
What's the best way to extend the User model in Django?
What's the best way to extend the User model (bundled with Django's authentication app) with custom fields? I would also possibly like to use the email as the username (for authentication purposes). I've already seen a few ways to do it, but can't decide on which one is the best.
The least painful and indeed Django-recommended way of doing this is through a OneToOneField(User) property. Extending the existing User model … If you wish to store information related to User, you can use a one-to-one relationship to a model containing the fields for additional information. This one-to-one model is o...
What's the best way to extend the User model in Django? What's the best way to extend the User model (bundled with Django's authentication app) with custom fields? I would also possibly like to use the email as the username (for authentication purposes). I've already seen a few ways to do it, but can't decide on which ...
TITLE: What's the best way to extend the User model in Django? QUESTION: What's the best way to extend the User model (bundled with Django's authentication app) with custom fields? I would also possibly like to use the email as the username (for authentication purposes). I've already seen a few ways to do it, but can'...
[ "python", "django", "django-models", "django-authentication", "django-users" ]
548
312
332,269
17
0
2008-09-04T16:19:49.083000
2008-09-04T17:02:18.403000
44,118
44,129
SQL Server Alter Computed Column
Does anyone know of a way to alter a computed column without dropping the column in SQL Server. I want to stop using the column as a computed column and start storing data directly in the column, but would like to retain the current values. Is this even possible?
Not that I know of but here is something you can do add another column to the table update that column with the values of the computed column then drop the computed column
SQL Server Alter Computed Column Does anyone know of a way to alter a computed column without dropping the column in SQL Server. I want to stop using the column as a computed column and start storing data directly in the column, but would like to retain the current values. Is this even possible?
TITLE: SQL Server Alter Computed Column QUESTION: Does anyone know of a way to alter a computed column without dropping the column in SQL Server. I want to stop using the column as a computed column and start storing data directly in the column, but would like to retain the current values. Is this even possible? ANSW...
[ "sql-server", "alter-table" ]
8
10
10,875
3
0
2008-09-04T16:25:17.400000
2008-09-04T16:30:52.973000
44,131
44,174
How do I hide the input caret in a System.Windows.Forms.TextBox?
I need to display a variable-length message and allow the text to be selectable. I have made the TextBox ReadOnly which does not allow the text to be edited, but the input caret is still shown. The blinking input caret is confusing. How do I hide it?
You can do through a win32 call [DllImport("user32.dll")] static extern bool HideCaret(IntPtr hWnd); public void HideCaret() { HideCaret(someTextBox.Handle); }
How do I hide the input caret in a System.Windows.Forms.TextBox? I need to display a variable-length message and allow the text to be selectable. I have made the TextBox ReadOnly which does not allow the text to be edited, but the input caret is still shown. The blinking input caret is confusing. How do I hide it?
TITLE: How do I hide the input caret in a System.Windows.Forms.TextBox? QUESTION: I need to display a variable-length message and allow the text to be selectable. I have made the TextBox ReadOnly which does not allow the text to be edited, but the input caret is still shown. The blinking input caret is confusing. How ...
[ "winforms", "textbox" ]
11
18
17,869
6
0
2008-09-04T16:32:37.710000
2008-09-04T16:58:24.247000
44,135
135,468
Project design / FS layout for large django projects
What is the best way to layout a large django project? The tutorials provide simple instructions for setting up apps, models, and views, but there is less information about how apps and projects should be broken down, how much sharing is allowable/necessary between apps in a typical project (obviously that is largely d...
The major guidelines are similar to any other large code project. Apps should address a single, clearly-defined responsibility. The name "application" is a misnomer; Django apps should be thought of more as reusable components which can be plugged together to create a real application. Tests for each app should be cont...
Project design / FS layout for large django projects What is the best way to layout a large django project? The tutorials provide simple instructions for setting up apps, models, and views, but there is less information about how apps and projects should be broken down, how much sharing is allowable/necessary between a...
TITLE: Project design / FS layout for large django projects QUESTION: What is the best way to layout a large django project? The tutorials provide simple instructions for setting up apps, models, and views, but there is less information about how apps and projects should be broken down, how much sharing is allowable/n...
[ "python", "django" ]
44
19
8,149
6
0
2008-09-04T16:36:12.180000
2008-09-25T19:30:33.117000
44,144
44,160
Hudson can't build my Maven 2 project because it says artifacts are missing from the repository? (they aren't)
I'm using Hudson and Maven 2 for my automated build/CI. I can build fine with maven from the command line, but when I run the same goal with Hudson, the build fails complaining of missing artifacts. I'm running Hudson as a windows XP service.
Obvious question, but have you got Hudson set up to point to the same Maven repository as your command line build? You can check this from the Hudson admin gui - look in the Maven section of the Manage Hudson page. This should have a MAVEN_HOME environment variable listed. Look in the settings.xml file under: MAVEN_HOM...
Hudson can't build my Maven 2 project because it says artifacts are missing from the repository? (they aren't) I'm using Hudson and Maven 2 for my automated build/CI. I can build fine with maven from the command line, but when I run the same goal with Hudson, the build fails complaining of missing artifacts. I'm runnin...
TITLE: Hudson can't build my Maven 2 project because it says artifacts are missing from the repository? (they aren't) QUESTION: I'm using Hudson and Maven 2 for my automated build/CI. I can build fine with maven from the command line, but when I run the same goal with Hudson, the build fails complaining of missing art...
[ "maven-2", "continuous-integration", "hudson" ]
4
3
10,265
2
0
2008-09-04T16:39:56.413000
2008-09-04T16:49:26.813000
44,145
48,261
Database sharding and Rails
What's the best way to deal with a sharded database in Rails? Should the sharding be handled at the application layer, the active record layer, the database driver layer, a proxy layer, or something else altogether? What are the pros and cons of each?
FiveRuns have a gem named DataFabric that does application-level sharding and master/slave replication. It might be worth checking out.
Database sharding and Rails What's the best way to deal with a sharded database in Rails? Should the sharding be handled at the application layer, the active record layer, the database driver layer, a proxy layer, or something else altogether? What are the pros and cons of each?
TITLE: Database sharding and Rails QUESTION: What's the best way to deal with a sharded database in Rails? Should the sharding be handled at the application layer, the active record layer, the database driver layer, a proxy layer, or something else altogether? What are the pros and cons of each? ANSWER: FiveRuns have...
[ "ruby-on-rails", "database", "activerecord", "sharding" ]
12
13
10,874
9
0
2008-09-04T16:40:10
2008-09-07T08:47:30.657000
44,177
44,203
Connecting private IPs
A friend of mine told me there was a way to connect two private IPs without using a proxy server. The idea was that both computers connected to a public server and some how the server joined the private connections and won't use any more bandwidth. Is this true? How's this technique named?
There is a technique called " Hole Punching " that works well with "Cone" NAT (Cone is a technical familly of router). That's not an 100% sure technique, today, it works well with UDP on about 80% of the router. There is some implementations of library to realize Hole Punching: STUN ( wikipedia )
Connecting private IPs A friend of mine told me there was a way to connect two private IPs without using a proxy server. The idea was that both computers connected to a public server and some how the server joined the private connections and won't use any more bandwidth. Is this true? How's this technique named?
TITLE: Connecting private IPs QUESTION: A friend of mine told me there was a way to connect two private IPs without using a proxy server. The idea was that both computers connected to a public server and some how the server joined the private connections and won't use any more bandwidth. Is this true? How's this techn...
[ "tcp", "ip-address" ]
3
2
352
5
0
2008-09-04T17:01:13.647000
2008-09-04T17:12:42.357000
44,181
44,183
SQL: Select like column from two tables
I have a database with two tables ( Table1 and Table2 ). They both have a common column [ColumnA] which is an nvarchar. How can I select this column from both tables and return it as a single column in my result set? So I'm looking for something like: ColumnA in Table1: a b c ColumnA in Table2: d e f Result set shoul...
SELECT ColumnA FROM Table1 UNION Select ColumnB FROM Table2 ORDER BY 1 Also, if you know the contents of Table1 and Table2 will NEVER overlap, you can use UNION ALL in place of UNION instead. Saves a little bit of resources that way. -- Kevin Fairchild
SQL: Select like column from two tables I have a database with two tables ( Table1 and Table2 ). They both have a common column [ColumnA] which is an nvarchar. How can I select this column from both tables and return it as a single column in my result set? So I'm looking for something like: ColumnA in Table1: a b c Co...
TITLE: SQL: Select like column from two tables QUESTION: I have a database with two tables ( Table1 and Table2 ). They both have a common column [ColumnA] which is an nvarchar. How can I select this column from both tables and return it as a single column in my result set? So I'm looking for something like: ColumnA in...
[ "sql" ]
10
16
11,502
8
0
2008-09-04T17:03:25.250000
2008-09-04T17:04:15.327000
44,190
44,216
Looking for a simple JavaScript example that updates DOM
I am looking for a simple JavaScript example that updates DOM. Any suggestions?
Here is a short pure-javascript example. Assume you have a div with the id "maincontent". var newnode = document.createTextNode('Here is some text.'); document.getElementById('maincontent').appendChild(newnode); Of course, things are a lot easier (especially when you want to do more complicated things) with jQuery.
Looking for a simple JavaScript example that updates DOM I am looking for a simple JavaScript example that updates DOM. Any suggestions?
TITLE: Looking for a simple JavaScript example that updates DOM QUESTION: I am looking for a simple JavaScript example that updates DOM. Any suggestions? ANSWER: Here is a short pure-javascript example. Assume you have a div with the id "maincontent". var newnode = document.createTextNode('Here is some text.'); docum...
[ "javascript", "dom" ]
5
5
2,365
5
0
2008-09-04T17:06:32.370000
2008-09-04T17:18:09.753000
44,194
44,219
How do I best generate a CSV (comma-delimited text file) for download with ASP.NET?
This is what I've got. It works. But, is there a simpler or better way? One an ASPX page, I've got the download link... Download as CSV file And then I've got the Download.aspx.vb Code Behind... Public Partial Class Download Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System....
CSV formatting has some gotchas. Have you asked yourself these questions: Does any of my data have embedded commas? Does any of my data have embedded double-quotes? Does any of my data have have newlines? Do I need to support Unicode strings? I see several problems in your code above. The comma thing first of all... yo...
How do I best generate a CSV (comma-delimited text file) for download with ASP.NET? This is what I've got. It works. But, is there a simpler or better way? One an ASPX page, I've got the download link... Download as CSV file And then I've got the Download.aspx.vb Code Behind... Public Partial Class Download Inherits Sy...
TITLE: How do I best generate a CSV (comma-delimited text file) for download with ASP.NET? QUESTION: This is what I've got. It works. But, is there a simpler or better way? One an ASPX page, I've got the download link... Download as CSV file And then I've got the Download.aspx.vb Code Behind... Public Partial Class Do...
[ "asp.net", "vb.net", "file-io", "csv" ]
18
23
61,067
8
0
2008-09-04T17:07:17.160000
2008-09-04T17:19:59.437000
44,205
44,236
Direct TCP/IP connections in P2P apps
From a Joel's post on Copilot: Direct Connect! We’ve always done everything we can to make sure that Fog Creek Copilot can connect in any networking situation, no matter what firewalls or NATs are in place. To make this happen, both parties make outbound connections to our server, which relays traffic on their behalf. ...
It's pretty tricky and interesting. I'm sure I have some details wrong, but the overview is this: The programs can already talk to each other through Joel's server, so they can exchange information with each other and Joel's server. Further, Joel has their external IP addresses, and they give joel information about the...
Direct TCP/IP connections in P2P apps From a Joel's post on Copilot: Direct Connect! We’ve always done everything we can to make sure that Fog Creek Copilot can connect in any networking situation, no matter what firewalls or NATs are in place. To make this happen, both parties make outbound connections to our server, ...
TITLE: Direct TCP/IP connections in P2P apps QUESTION: From a Joel's post on Copilot: Direct Connect! We’ve always done everything we can to make sure that Fog Creek Copilot can connect in any networking situation, no matter what firewalls or NATs are in place. To make this happen, both parties make outbound connectio...
[ "networking", "tcp", "p2p" ]
4
10
8,188
3
0
2008-09-04T17:13:59.843000
2008-09-04T17:26:12.340000
44,220
44,225
Difference between foreach and for loops over an IEnumerable class in C#
I have been told that there is a performance difference between the following code blocks. foreach (Entity e in entityList) {.... } and for (int i=0; i where List entityList; I am no CLR expect but from what I can tell they should boil down to basically the same code. Does anybody have concrete (heck, I'd take packed d...
foreach creates an instance of an enumerator (returned from GetEnumerator) and that enumerator also keeps state throughout the course of the foreach loop. It then repeatedly calls for the Next() object on the enumerator and runs your code for each object it returns. They don't boil down to the same code in any way, rea...
Difference between foreach and for loops over an IEnumerable class in C# I have been told that there is a performance difference between the following code blocks. foreach (Entity e in entityList) {.... } and for (int i=0; i where List entityList; I am no CLR expect but from what I can tell they should boil down to bas...
TITLE: Difference between foreach and for loops over an IEnumerable class in C# QUESTION: I have been told that there is a performance difference between the following code blocks. foreach (Entity e in entityList) {.... } and for (int i=0; i where List entityList; I am no CLR expect but from what I can tell they shoul...
[ "c#", "performance", "loops" ]
13
10
21,759
7
0
2008-09-04T17:20:16.677000
2008-09-04T17:22:27.043000
44,224
45,989
How to start learning JAVA for use with Oracle RDBMS?
I am looking for some advice on what should I concentrate my efforts to get the needed skills to become a Java developer for Oracle applications. I'm bit confused as there are lot of technologies in the Java world. Where should I start? What to avoid? Is JDeveloper a good IDE for a beginner?
To become an Oracle Developer there is a bit more to learn than jdbc. You should take a look at the Oracle web site. It is kind of slow and not very intuitive but has a lot of good information. There are OUGs that have good info as well. If you just want to access Oracle via JAVA then you should use a framework such as...
How to start learning JAVA for use with Oracle RDBMS? I am looking for some advice on what should I concentrate my efforts to get the needed skills to become a Java developer for Oracle applications. I'm bit confused as there are lot of technologies in the Java world. Where should I start? What to avoid? Is JDeveloper ...
TITLE: How to start learning JAVA for use with Oracle RDBMS? QUESTION: I am looking for some advice on what should I concentrate my efforts to get the needed skills to become a Java developer for Oracle applications. I'm bit confused as there are lot of technologies in the Java world. Where should I start? What to avo...
[ "java", "oracle" ]
5
3
1,825
7
0
2008-09-04T17:21:54.753000
2008-09-05T15:02:54.687000
44,247
44,265
What is the best practice for estimating required time for development of the SDLC phases?
As a project manager, you are required to organize time so that the project meets a deadline. Is there some sort of equations to use for estimating how long the development will take? let's say the database time = sql storedprocedures * tables manipulated or something similar Or are you just stuck having to get the exp...
There's no set formula out there that I've seen that would really work. Fogbugz has its monte carlo simulator which has somewhat of a concept for this, but really, experience is going to be your best point of reference. Every developer and every project will be different!
What is the best practice for estimating required time for development of the SDLC phases? As a project manager, you are required to organize time so that the project meets a deadline. Is there some sort of equations to use for estimating how long the development will take? let's say the database time = sql storedproce...
TITLE: What is the best practice for estimating required time for development of the SDLC phases? QUESTION: As a project manager, you are required to organize time so that the project meets a deadline. Is there some sort of equations to use for estimating how long the development will take? let's say the database time...
[ "project-management", "time-management" ]
1
0
569
3
0
2008-09-04T17:30:58.443000
2008-09-04T17:36:24.577000
44,260
44,310
Can .NET check other running programs command line parameters?
We've got an interesting case where we are trying to determine how different instances of our app were launched. Is there any way for.NET to be able to query another running instance and get the command line parameters passed to that instance? I've not been able to find any way to do it in.NET so far, so I thought I'd ...
You can retrieve this information through WMI. See the Win32_Process class, in particular its command line property. This Code Project article provides pointers on how to do this,
Can .NET check other running programs command line parameters? We've got an interesting case where we are trying to determine how different instances of our app were launched. Is there any way for.NET to be able to query another running instance and get the command line parameters passed to that instance? I've not been...
TITLE: Can .NET check other running programs command line parameters? QUESTION: We've got an interesting case where we are trying to determine how different instances of our app were launched. Is there any way for.NET to be able to query another running instance and get the command line parameters passed to that insta...
[ ".net", "command-line", "parameters" ]
2
4
455
3
0
2008-09-04T17:34:27.157000
2008-09-04T17:54:11.337000
44,261
44,268
cmd defaults to F: drive
When I open cmd on my laptop it is defaulting to the F: drive. This is troubling me does anyone know how it got that way or how to get it back to where it opens to the C: drive by default?
I believe it defaults to %HOMEDRIVE%\%HOMEPATH% so if you can muck about with those environment variables that might be an option. I can't edit these environment variables on my company's network, so I had to use the AutoRun to change it to something sane.
cmd defaults to F: drive When I open cmd on my laptop it is defaulting to the F: drive. This is troubling me does anyone know how it got that way or how to get it back to where it opens to the C: drive by default?
TITLE: cmd defaults to F: drive QUESTION: When I open cmd on my laptop it is defaulting to the F: drive. This is troubling me does anyone know how it got that way or how to get it back to where it opens to the C: drive by default? ANSWER: I believe it defaults to %HOMEDRIVE%\%HOMEPATH% so if you can muck about with t...
[ "windows", "cmd" ]
9
2
28,663
11
0
2008-09-04T17:34:28.093000
2008-09-04T17:36:52.690000
44,281
44,454
Database Patterns
Does anyone know of papers/books/etc. that document patterns for databases? For example, one common rule of thumb is that every table should have a primary key and that the key should be devoid of information content. So I was wondering if anyone had written a book or published papers regarding design patterns for desi...
Specifically, regarding keys: I strongly disagree with the strange idea that keys must be without meaning. In general, I consider a database a collection of facts; as soon as you start adding arbitrary numbers (like generated keys) and other irrelevant information into it, it should be a warning sign. I recommend this ...
Database Patterns Does anyone know of papers/books/etc. that document patterns for databases? For example, one common rule of thumb is that every table should have a primary key and that the key should be devoid of information content. So I was wondering if anyone had written a book or published papers regarding design...
TITLE: Database Patterns QUESTION: Does anyone know of papers/books/etc. that document patterns for databases? For example, one common rule of thumb is that every table should have a primary key and that the key should be devoid of information content. So I was wondering if anyone had written a book or published paper...
[ "design-patterns", "database-design" ]
24
10
6,141
6
0
2008-09-04T17:42:13.330000
2008-09-04T18:48:03.143000
44,286
45,018
Program for working with large CSV Files
Are there any good programs for dealing with reading large CSV files? Some of the datafiles I deal with are in the 1 GB range. They have too many lines for Excel to even deal with. Using Access can be a little slow, as you have to actually import them into a database to work with them directly. Is there a program that ...
MySQL can import CSV files very quickly onto tables using the LOAD DATA INFILE command. It can also read from CSV files directly, bypassing any import procedures, by using the CSV storage engine. Importing it onto native tables with LOAD DATA INFILE has a start up cost, but after that you can INSERT/UPDATE much faster,...
Program for working with large CSV Files Are there any good programs for dealing with reading large CSV files? Some of the datafiles I deal with are in the 1 GB range. They have too many lines for Excel to even deal with. Using Access can be a little slow, as you have to actually import them into a database to work wit...
TITLE: Program for working with large CSV Files QUESTION: Are there any good programs for dealing with reading large CSV files? Some of the datafiles I deal with are in the 1 GB range. They have too many lines for Excel to even deal with. Using Access can be a little slow, as you have to actually import them into a da...
[ "csv", "load-data-infile" ]
13
8
19,854
7
0
2008-09-04T17:42:59.727000
2008-09-05T00:13:28.103000
44,288
44,373
Differences in string compare methods in C#
Comparing string in C# is pretty simple. In fact there are several ways to do it. I have listed some in the block below. What I am curious about are the differences between them and when one should be used over the others? Should one be avoided at all costs? Are there more I haven't listed? string testString = "Test"; ...
Here are the rules for how these functions work: stringValue.CompareTo(otherStringValue) null comes before a string it uses CultureInfo.CurrentCulture.CompareInfo.Compare, which means it will use a culture-dependent comparison. This might mean that ß will compare equal to SS in Germany, or similar stringValue.Equals(ot...
Differences in string compare methods in C# Comparing string in C# is pretty simple. In fact there are several ways to do it. I have listed some in the block below. What I am curious about are the differences between them and when one should be used over the others? Should one be avoided at all costs? Are there more I ...
TITLE: Differences in string compare methods in C# QUESTION: Comparing string in C# is pretty simple. In fact there are several ways to do it. I have listed some in the block below. What I am curious about are the differences between them and when one should be used over the others? Should one be avoided at all costs?...
[ "c#", "string", "comparison" ]
286
244
210,026
11
0
2008-09-04T17:44:10.440000
2008-09-04T18:17:00.097000
44,294
46,226
Enabled Brigded Network in Vmware Server
I have the vmware server with this error, anyone knows how to fix it? VMware Server Error http://soporte.cardinalsystems.com.ar/errorvmwareserver.jpg
In the Network Connections on the host PC, you might try repairing the connections that are created by VMWare. Something like "VMWare Network Adapter VMnet1" I'm assuming that the network connections (to a LAN/Internet) are working on the host computer. If not, I'd start by fixing the host first.
Enabled Brigded Network in Vmware Server I have the vmware server with this error, anyone knows how to fix it? VMware Server Error http://soporte.cardinalsystems.com.ar/errorvmwareserver.jpg
TITLE: Enabled Brigded Network in Vmware Server QUESTION: I have the vmware server with this error, anyone knows how to fix it? VMware Server Error http://soporte.cardinalsystems.com.ar/errorvmwareserver.jpg ANSWER: In the Network Connections on the host PC, you might try repairing the connections that are created by...
[ "vmware", "virtualization", "vmware-server" ]
2
2
1,357
3
0
2008-09-04T17:45:59.577000
2008-09-05T16:25:24.457000
44,298
47,663
Strong Validation in WPF
I have a databound TextBox in my application like so: (The type of Height is decimal? ) public class NullableConverter: IValueConverter { public object Convert(object o, Type type, object parameter, CultureInfo culture) { return o; } public object ConvertBack(object o, Type type, object parameter, CultureInfo culture)...
You can force the keyboard focus to stay on the TextBox by handling the PreviewLostKeyBoardFocus event like this: private void TextBox_PreviewLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) { e.Handled = true; }
Strong Validation in WPF I have a databound TextBox in my application like so: (The type of Height is decimal? ) public class NullableConverter: IValueConverter { public object Convert(object o, Type type, object parameter, CultureInfo culture) { return o; } public object ConvertBack(object o, Type type, object parame...
TITLE: Strong Validation in WPF QUESTION: I have a databound TextBox in my application like so: (The type of Height is decimal? ) public class NullableConverter: IValueConverter { public object Convert(object o, Type type, object parameter, CultureInfo culture) { return o; } public object ConvertBack(object o, Type t...
[ "wpf", "validation", "data-binding" ]
1
2
2,734
2
0
2008-09-04T17:47:48.700000
2008-09-06T17:00:44.037000
44,337
44,579
preferred way to implement visitor pattern in dynamic languages?
As an exercise for myself, I was translating a sample program into various languages. Starting in C#, I had a visitor-pattern interface like so: interface Visitor { void Accept(Bedroom x); void Accept(Bathroom x); void Accept(Kitchen x); void Accept(LivingRoom x); } Moving to ruby (or python, or whatever), I no longer ...
My recommendation is to use the former approach. There are pluses and minuses for each approach. The former is harder to maintain as the number of Room types grows; the latter is harder as the number of Cleaner types grows. In Ruby, you could try def accept(x) send "accept#{x.class}".to_sym, x end PS: not all dynamical...
preferred way to implement visitor pattern in dynamic languages? As an exercise for myself, I was translating a sample program into various languages. Starting in C#, I had a visitor-pattern interface like so: interface Visitor { void Accept(Bedroom x); void Accept(Bathroom x); void Accept(Kitchen x); void Accept(Livin...
TITLE: preferred way to implement visitor pattern in dynamic languages? QUESTION: As an exercise for myself, I was translating a sample program into various languages. Starting in C#, I had a visitor-pattern interface like so: interface Visitor { void Accept(Bedroom x); void Accept(Bathroom x); void Accept(Kitchen x);...
[ "c#", "ruby", "design-patterns", "dynamic-languages" ]
3
3
908
2
0
2008-09-04T17:59:52.073000
2008-09-04T19:31:52.880000
44,338
44,525
Unit testing with network-reliant code
I'm trying to be better about unit testing my code, but right now I'm writing a lot of code that deals with remote systems. SNMP, WMI, that sort of thing. With most classes I can mock up objects to test them, but how do you deal with unit testing a real system? For example, if my class goes out and gets the Win32_Logic...
Assuming you meant "How do I test against things that are hard/impossible to mock": If you have a class that "goes out and gets the Win32_LogicalDisk object for a server" AND does something else (consumes the 'Win32_LogicalDisk' object in some way), assuming you want to test the pieces of the class that consume this ob...
Unit testing with network-reliant code I'm trying to be better about unit testing my code, but right now I'm writing a lot of code that deals with remote systems. SNMP, WMI, that sort of thing. With most classes I can mock up objects to test them, but how do you deal with unit testing a real system? For example, if my ...
TITLE: Unit testing with network-reliant code QUESTION: I'm trying to be better about unit testing my code, but right now I'm writing a lot of code that deals with remote systems. SNMP, WMI, that sort of thing. With most classes I can mock up objects to test them, but how do you deal with unit testing a real system? F...
[ "unit-testing", "testing", "wmi" ]
10
6
4,094
3
0
2008-09-04T18:00:02.040000
2008-09-04T19:12:21.837000
44,350
44,361
What are the best keyboard macros for programming in windows?
I like putting shortcuts of the form "g - google.lnk" in my start menu so google is two keystrokes away. Win, g. My eight or so most frequent applications go there. I also make links to my solution files I am always opening "x - Popular Project.lnk" Are there any better ways to automate opening frequently used applicat...
AutoHotkey is a reasonably good program for implementing windows key shortcuts. You might instead define WIN + G to be "open browser to google" which gives you a better response time (don't have to wait for start menu to popup, etc) There are macro programs that change the macros used based on the window that's in focu...
What are the best keyboard macros for programming in windows? I like putting shortcuts of the form "g - google.lnk" in my start menu so google is two keystrokes away. Win, g. My eight or so most frequent applications go there. I also make links to my solution files I am always opening "x - Popular Project.lnk" Are ther...
TITLE: What are the best keyboard macros for programming in windows? QUESTION: I like putting shortcuts of the form "g - google.lnk" in my start menu so google is two keystrokes away. Win, g. My eight or so most frequent applications go there. I also make links to my solution files I am always opening "x - Popular Pro...
[ "keyboard", "macros", "performance" ]
3
3
10,377
6
0
2008-09-04T18:04:01.017000
2008-09-04T18:09:30.863000
44,352
44,381
Iterate over subclasses of a given class in a given module
In Python, given a module X and a class Y, how can I iterate or generate a list of all subclasses of Y that exist in module X?
Here's one way to do it: import inspect def get_subclasses(mod, cls): """Yield the classes in module ``mod`` that inherit from ``cls``""" for name, obj in inspect.getmembers(mod): if hasattr(obj, "__bases__") and cls in obj.__bases__: yield obj
Iterate over subclasses of a given class in a given module In Python, given a module X and a class Y, how can I iterate or generate a list of all subclasses of Y that exist in module X?
TITLE: Iterate over subclasses of a given class in a given module QUESTION: In Python, given a module X and a class Y, how can I iterate or generate a list of all subclasses of Y that exist in module X? ANSWER: Here's one way to do it: import inspect def get_subclasses(mod, cls): """Yield the classes in module ``mod...
[ "python", "oop" ]
19
15
12,725
4
0
2008-09-04T18:05:23.337000
2008-09-04T18:20:21.087000
44,364
44,375
How can I avoid global state?
So, I was reading the Google testing blog, and it says that global state is bad and makes it hard to write tests. I believe it--my code is difficult to test right now. So how do I avoid global state? The biggest things I use global state (as I understand it) for is managing key pieces of information between our develop...
Dependency injection is what you're looking for. Rather than have those functions go out and look for their dependencies, inject the dependencies into the functions. That is, when you call the functions pass the data they want to them. That way it's easy to put a testing framework around a class because you can simply ...
How can I avoid global state? So, I was reading the Google testing blog, and it says that global state is bad and makes it hard to write tests. I believe it--my code is difficult to test right now. So how do I avoid global state? The biggest things I use global state (as I understand it) for is managing key pieces of i...
TITLE: How can I avoid global state? QUESTION: So, I was reading the Google testing blog, and it says that global state is bad and makes it hard to write tests. I believe it--my code is difficult to test right now. So how do I avoid global state? The biggest things I use global state (as I understand it) for is managi...
[ "testing", "state", "global", "global-state" ]
10
12
2,600
4
0
2008-09-04T18:11:29.250000
2008-09-04T18:18:03.150000
44,372
44,434
BLOB Storage - 100+ GB, MySQL, SQLite, or PostgreSQL + Python
I have an idea for a simple application which will monitor a group of folders, index any files it finds. A gui will allow me quickly tag new files and move them into a single database for storage and also provide an easy mechanism for querying the db by tag, name, file type and date. At the moment I have about 100+ GB ...
I'm still researching this option for one of my own projects, but CouchDB may be worth a look.
BLOB Storage - 100+ GB, MySQL, SQLite, or PostgreSQL + Python I have an idea for a simple application which will monitor a group of folders, index any files it finds. A gui will allow me quickly tag new files and move them into a single database for storage and also provide an easy mechanism for querying the db by tag,...
TITLE: BLOB Storage - 100+ GB, MySQL, SQLite, or PostgreSQL + Python QUESTION: I have an idea for a simple application which will monitor a group of folders, index any files it finds. A gui will allow me quickly tag new files and move them into a single database for storage and also provide an easy mechanism for query...
[ "database", "blob" ]
1
2
2,645
6
0
2008-09-04T18:14:43.503000
2008-09-04T18:38:41.107000
44,376
44,378
Add alternating row color to SQL Server Reporting services report
How do you shade alternating rows in a SQL Server Reporting Services report? Edit: There are a bunch of good answers listed below--from quick and simple to complex and comprehensive. Alas, I can choose only one...
Go to the table row's BackgroundColor property and choose "Expression..." Use this expression: = IIf(RowNumber(Nothing) Mod 2 = 0, "Silver", "Transparent") This trick can be applied to many areas of the report. And in.NET 3.5+ You could use: = If(RowNumber(Nothing) Mod 2 = 0, "Silver", "Transparent") Not looking for re...
Add alternating row color to SQL Server Reporting services report How do you shade alternating rows in a SQL Server Reporting Services report? Edit: There are a bunch of good answers listed below--from quick and simple to complex and comprehensive. Alas, I can choose only one...
TITLE: Add alternating row color to SQL Server Reporting services report QUESTION: How do you shade alternating rows in a SQL Server Reporting Services report? Edit: There are a bunch of good answers listed below--from quick and simple to complex and comprehensive. Alas, I can choose only one... ANSWER: Go to the tab...
[ "sql-server", "reporting-services", "formatting" ]
150
221
290,201
18
0
2008-09-04T18:18:32.947000
2008-09-04T18:19:32.850000
44,383
44,393
Reading Email using Pop3 in C#
I am looking for a method of reading emails using Pop3 in C# 2.0. Currently, I am using code found in CodeProject. However, this solution is less than ideal. The biggest problem is that it doesn't support emails written in unicode.
I've successfully used OpenPop.NET to access emails via POP3.
Reading Email using Pop3 in C# I am looking for a method of reading emails using Pop3 in C# 2.0. Currently, I am using code found in CodeProject. However, this solution is less than ideal. The biggest problem is that it doesn't support emails written in unicode.
TITLE: Reading Email using Pop3 in C# QUESTION: I am looking for a method of reading emails using Pop3 in C# 2.0. Currently, I am using code found in CodeProject. However, this solution is less than ideal. The biggest problem is that it doesn't support emails written in unicode. ANSWER: I've successfully used OpenPop...
[ "c#", "unicode", "pop3" ]
75
74
142,101
8
0
2008-09-04T18:21:06.653000
2008-09-04T18:24:34.477000
44,391
65,953
How do I prevent replay attacks?
This is related to another question I asked. In summary, I have a special case of a URL where, when a form is POSTed to it, I can't rely on cookies for authentication or to maintain the user's session, but I somehow need to know who they are, and I need to know they're logged in! I think I came up with a solution to my...
If you hash in a time-stamp along with the user name and password, you can close the window for replay attacks to within a couple of seconds. I don't know if this meets your needs, but it is at least a partial solution.
How do I prevent replay attacks? This is related to another question I asked. In summary, I have a special case of a URL where, when a form is POSTed to it, I can't rely on cookies for authentication or to maintain the user's session, but I somehow need to know who they are, and I need to know they're logged in! I thin...
TITLE: How do I prevent replay attacks? QUESTION: This is related to another question I asked. In summary, I have a special case of a URL where, when a form is POSTed to it, I can't rely on cookies for authentication or to maintain the user's session, but I somehow need to know who they are, and I need to know they're...
[ "asp.net", "security", "encryption" ]
18
15
39,002
12
0
2008-09-04T18:23:22.093000
2008-09-15T19:27:12.720000
44,396
142,968
How to reference javadocs to dependencies in Maven's eclipse plugin when javadoc not attached to dependency
I use Eclipse, Maven, and Java in my development. I use Maven to download dependencies (jar files and javadoc when available) and Maven's eclipse plug-in to generate the.project and.classpath files for Eclipse. When the dependency downloaded does not have attached javadoc I manually add a link for the javadoc in the.cl...
You might consider just avoiding this problem completely by installing the javadoc jar into your local repository manually using the install-file goal and passing in the -Dclassifier=javadoc option. Once you do that the.classpath that mvn generates should be correct. If you use a remote repo as a proxy to central you c...
How to reference javadocs to dependencies in Maven's eclipse plugin when javadoc not attached to dependency I use Eclipse, Maven, and Java in my development. I use Maven to download dependencies (jar files and javadoc when available) and Maven's eclipse plug-in to generate the.project and.classpath files for Eclipse. W...
TITLE: How to reference javadocs to dependencies in Maven's eclipse plugin when javadoc not attached to dependency QUESTION: I use Eclipse, Maven, and Java in my development. I use Maven to download dependencies (jar files and javadoc when available) and Maven's eclipse plug-in to generate the.project and.classpath fi...
[ "java", "eclipse", "maven-2" ]
54
17
48,934
6
0
2008-09-04T18:25:44.537000
2008-09-27T04:15:29.997000
44,401
44,468
catching button clicks in javascript without server interaction
I've got a sign up form that requires the user to enter their email and password, both are in two separate text boxes. I want to provide a button that the user can click so that the password (which is masked) will appear in a popup when the user clicks the button. Currently my JavaScript code for this is as follows: fu...
I did a quick example up of a working version: The key is that the input is of type button and not submit. I used the prototype library for retrieving the element by ID.
catching button clicks in javascript without server interaction I've got a sign up form that requires the user to enter their email and password, both are in two separate text boxes. I want to provide a button that the user can click so that the password (which is masked) will appear in a popup when the user clicks the...
TITLE: catching button clicks in javascript without server interaction QUESTION: I've got a sign up form that requires the user to enter their email and password, both are in two separate text boxes. I want to provide a button that the user can click so that the password (which is masked) will appear in a popup when t...
[ "javascript", "ajax" ]
1
1
753
8
0
2008-09-04T18:28:39.990000
2008-09-04T18:53:55.670000
44,408
44,461
How do you generate a random number in C#?
I would like to generate a random floating point number between 2 values. What is the best way to do this in C#?
The only thing I'd add to Eric 's response is an explanation; I feel that knowledge of why code works is better than knowing what code works. The explanation is this: let's say you want a number between 2.5 and 4.5. The range is 2.0 (4.5 - 2.5). NextDouble only returns a number between 0 and 1.0, but if you multiply th...
How do you generate a random number in C#? I would like to generate a random floating point number between 2 values. What is the best way to do this in C#?
TITLE: How do you generate a random number in C#? QUESTION: I would like to generate a random floating point number between 2 values. What is the best way to do this in C#? ANSWER: The only thing I'd add to Eric 's response is an explanation; I feel that knowledge of why code works is better than knowing what code wo...
[ "c#", "floating-point", "random" ]
33
60
42,215
6
0
2008-09-04T18:30:57.567000
2008-09-04T18:52:22.103000
44,421
44,433
Outlook Email via a Webpage
I have a web application developed with ASP.net and C# that is running on my companies' intranet. Because all the users for this application are all using Microsoft Outlook without exception, I would like for the the application to open up an Outlook message on the client-side. I understand that Office is designed to b...
You cannot open something on the client from server side code. You'd have to use script on the page to do what you're wanting (or something else client-side like ActiveX or embedded.NET or something) Here's a sample Javascript that invokes an Outlook MailItem from an webpage. This could easily be injected into the page...
Outlook Email via a Webpage I have a web application developed with ASP.net and C# that is running on my companies' intranet. Because all the users for this application are all using Microsoft Outlook without exception, I would like for the the application to open up an Outlook message on the client-side. I understand ...
TITLE: Outlook Email via a Webpage QUESTION: I have a web application developed with ASP.net and C# that is running on my companies' intranet. Because all the users for this application are all using Microsoft Outlook without exception, I would like for the the application to open up an Outlook message on the client-s...
[ "c#", "asp.net", "outlook", "ms-office" ]
3
6
5,697
5
0
2008-09-04T18:34:16.060000
2008-09-04T18:38:23.930000
44,467
44,968
What can cause .NET assembly registration to fail?
We've seen an issue where one of our installers (msi) returns the error code 2908, which is used to indicate that an assembly failed to register. Later in the installation, we get the following (sanitized) error: MyAssemblyName, version="1.0.1.1", culture="neutral", publicKeyToken="119EFC79848A50". Please refer to Help...
I found a pair of blog postings that appear to cover this topic.
What can cause .NET assembly registration to fail? We've seen an issue where one of our installers (msi) returns the error code 2908, which is used to indicate that an assembly failed to register. Later in the installation, we get the following (sanitized) error: MyAssemblyName, version="1.0.1.1", culture="neutral", pu...
TITLE: What can cause .NET assembly registration to fail? QUESTION: We've seen an issue where one of our installers (msi) returns the error code 2908, which is used to indicate that an assembly failed to register. Later in the installation, we get the following (sanitized) error: MyAssemblyName, version="1.0.1.1", cul...
[ ".net", "windows", "windows-installer" ]
0
1
1,031
1
0
2008-09-04T18:53:00.570000
2008-09-04T23:26:59.993000
44,469
44,482
What's the best way to insert/update/delete multiple records in a database from an application?
Given a small set of entities (say, 10 or fewer) to insert, delete, or update in an application, what is the best way to perform the necessary database operations? Should multiple queries be issued, one for each entity to be affected? Or should some sort of XML construct that can be parsed by the database engine be use...
It depends on how many you need to do, and how fast the operations need to run. If it's only a few, then doing them one at a time with whatever mechanism you have for doing single operations will work fine. If you need to do thousands or more, and it needs to run quickly, you should re-use the connection and command, c...
What's the best way to insert/update/delete multiple records in a database from an application? Given a small set of entities (say, 10 or fewer) to insert, delete, or update in an application, what is the best way to perform the necessary database operations? Should multiple queries be issued, one for each entity to be...
TITLE: What's the best way to insert/update/delete multiple records in a database from an application? QUESTION: Given a small set of entities (say, 10 or fewer) to insert, delete, or update in an application, what is the best way to perform the necessary database operations? Should multiple queries be issued, one for...
[ "sql", "database" ]
3
1
1,465
5
0
2008-09-04T18:53:56.450000
2008-09-04T18:58:36.160000
44,470
152,493
How do I get the ClickOnce Publish version to match the AssemblyInfo.cs File version?
Every time I publish the application in ClickOnce I get get it to update the revision number by one. Is there a way to get this change automatically to change the version number in AssemblyInfo.cs file (all our error reporting looks at the Assembly Version)?
We use Team Foundation Server Team Build and have added a block to the TFSBuild.proj's AfterCompile target to trigger the ClickOnce publish with our preferred version number: The PublishApplicationVersion variable is generated by a custom MSBuild task to use the TFS Changeset number, but you could use your own custom t...
How do I get the ClickOnce Publish version to match the AssemblyInfo.cs File version? Every time I publish the application in ClickOnce I get get it to update the revision number by one. Is there a way to get this change automatically to change the version number in AssemblyInfo.cs file (all our error reporting looks a...
TITLE: How do I get the ClickOnce Publish version to match the AssemblyInfo.cs File version? QUESTION: Every time I publish the application in ClickOnce I get get it to update the revision number by one. Is there a way to get this change automatically to change the version number in AssemblyInfo.cs file (all our error...
[ "visual-studio", "clickonce", "versioning" ]
31
33
21,016
4
0
2008-09-04T18:54:01.520000
2008-09-30T10:13:01.050000
44,476
45,131
Compressing a TIF file
I'm trying to convert a multipage color tiff file to a c# CompressionCCITT3 tiff in C#. I realize that I need to make sure that all pixels are 1 bit. I have not found a useful example of this online.
You need this conversion as CCITT3 and CCITT4 don't support color (if I remember right).
Compressing a TIF file I'm trying to convert a multipage color tiff file to a c# CompressionCCITT3 tiff in C#. I realize that I need to make sure that all pixels are 1 bit. I have not found a useful example of this online.
TITLE: Compressing a TIF file QUESTION: I'm trying to convert a multipage color tiff file to a c# CompressionCCITT3 tiff in C#. I realize that I need to make sure that all pixels are 1 bit. I have not found a useful example of this online. ANSWER: You need this conversion as CCITT3 and CCITT4 don't support color (if ...
[ "c#", "tiff" ]
0
1
6,637
4
0
2008-09-04T18:55:37.447000
2008-09-05T02:21:06.953000
44,481
44,651
Is it possible to craft a glob that matches files in the current directory and all subdirectories?
For this directory structure:. |-- README.txt |-- firstlevel.rb `-- lib |-- models | |-- foo | | `-- fourthlevel.rb | `-- thirdlevel.rb `-- secondlevel.rb 3 directories, 5 files The glob would match: firstlevel.rb lib/secondlevel.rb lib/models/thirdlevel.rb lib/models/foo/fourthlevel.rb
Apologies if I've missed the real point of the question but, if I was using sh/bash/etc., then I would probably use find to do the job: find. -name '*.rb' -type f Globs can get a bit nasty when used from within a script and find is much more flexible.
Is it possible to craft a glob that matches files in the current directory and all subdirectories? For this directory structure:. |-- README.txt |-- firstlevel.rb `-- lib |-- models | |-- foo | | `-- fourthlevel.rb | `-- thirdlevel.rb `-- secondlevel.rb 3 directories, 5 files The glob would match: firstlevel.rb lib/se...
TITLE: Is it possible to craft a glob that matches files in the current directory and all subdirectories? QUESTION: For this directory structure:. |-- README.txt |-- firstlevel.rb `-- lib |-- models | |-- foo | | `-- fourthlevel.rb | `-- thirdlevel.rb `-- secondlevel.rb 3 directories, 5 files The glob would match: fi...
[ "shell", "glob" ]
1
4
315
4
0
2008-09-04T18:58:16.707000
2008-09-04T20:01:53.510000
44,485
44,513
Arbitrary Naming Convention (Business Objects)
Ok, do you do Business.Name or Business.BusinessName SubCategory.ID or SubCategory.SubCategoryID What about in your database? Why? I'm torn with both. Would love there to be a "right answer"
The main drawback of using ID, Name etc is that you have to qualify them with the table name if you are writing an SQL join which overlaps two tables. Despite that, I find it far more concise and readable to just use ID and Name - your code and tables will 'flow' much more easily past the eyes. Easier to type and less ...
Arbitrary Naming Convention (Business Objects) Ok, do you do Business.Name or Business.BusinessName SubCategory.ID or SubCategory.SubCategoryID What about in your database? Why? I'm torn with both. Would love there to be a "right answer"
TITLE: Arbitrary Naming Convention (Business Objects) QUESTION: Ok, do you do Business.Name or Business.BusinessName SubCategory.ID or SubCategory.SubCategoryID What about in your database? Why? I'm torn with both. Would love there to be a "right answer" ANSWER: The main drawback of using ID, Name etc is that you hav...
[ "c#", "oop", "object", "naming" ]
0
2
946
5
0
2008-09-04T18:59:36.953000
2008-09-04T19:09:04.667000
44,516
44,739
JavaFX video encoding
On JavaFX's Wikipedia In May 2008 (...) Sun Also announced a multi-year agreement with On2 Technologies to bring comprehensive video capabilities to the JavaFX product family using the company's TrueMotion Video codec. Do you know if it will include encoding capabilities for Webcam Video like Flash or just playback/str...
The JavaFX API just supports media playback at the moment (see here: javafx.scene.media.MediaView ). There might very well be mere Java APIs for encoding, however.
JavaFX video encoding On JavaFX's Wikipedia In May 2008 (...) Sun Also announced a multi-year agreement with On2 Technologies to bring comprehensive video capabilities to the JavaFX product family using the company's TrueMotion Video codec. Do you know if it will include encoding capabilities for Webcam Video like Flas...
TITLE: JavaFX video encoding QUESTION: On JavaFX's Wikipedia In May 2008 (...) Sun Also announced a multi-year agreement with On2 Technologies to bring comprehensive video capabilities to the JavaFX product family using the company's TrueMotion Video codec. Do you know if it will include encoding capabilities for Webc...
[ "flash", "video", "javafx", "encoding" ]
1
1
1,395
1
0
2008-09-04T19:10:11.607000
2008-09-04T20:47:21.233000
44,517
44,559
Tools to convert asp.net dynamic site into static site
Are there any tools that will spider an asp.net website and create a static site?
http://www.httrack.com/ Have used for this purpose a few times, may need to do a little tidying up of urls, and some css linked images might not make it, depends on how good a job you want to do. If you have dreamweaver, you can use that to manage the links if you need to clean up the file names afterwards. Optionally ...
Tools to convert asp.net dynamic site into static site Are there any tools that will spider an asp.net website and create a static site?
TITLE: Tools to convert asp.net dynamic site into static site QUESTION: Are there any tools that will spider an asp.net website and create a static site? ANSWER: http://www.httrack.com/ Have used for this purpose a few times, may need to do a little tidying up of urls, and some css linked images might not make it, de...
[ "asp.net", "web-crawler" ]
0
2
1,697
4
0
2008-09-04T19:10:14.023000
2008-09-04T19:26:33.423000
44,542
44,844
Algorithm / pseudo-code to create paging links?
Can someome provide code or pseudo-code for how the paging links on StackOverflow are generated? I keep racking my brain but can't think of a decent way to build the dynamic links that always show the 2 pages around the current, plus the first and last. Example: 1... 5 6 7... 593
There are several other answers already, but I'd like to show you the approach I took to solve it: First, let's check out how Stack Overflow handles normal cases and edge cases. Each of my pages displays 10 results, so to find out what it does for 1 page, find a tag that has less than 11 entries: usability works today....
Algorithm / pseudo-code to create paging links? Can someome provide code or pseudo-code for how the paging links on StackOverflow are generated? I keep racking my brain but can't think of a decent way to build the dynamic links that always show the 2 pages around the current, plus the first and last. Example: 1... 5 6 ...
TITLE: Algorithm / pseudo-code to create paging links? QUESTION: Can someome provide code or pseudo-code for how the paging links on StackOverflow are generated? I keep racking my brain but can't think of a decent way to build the dynamic links that always show the 2 pages around the current, plus the first and last. ...
[ "algorithm", "paging" ]
18
46
12,803
6
0
2008-09-04T19:20:15.250000
2008-09-04T21:32:07.723000
44,554
44,570
What’s your logging philosophy?
As Jeff Atwood asked: "What’s your logging philosophy? Should all code be littered with.logthis() and.logthat() calls? Or do you inject logging after the fact somehow?"
My logging philosophy is pretty easily summarized in four parts: Auditing, or business logic logging Log those things that are required to be logged. This comes from the application requirements, and may include logging every change made to any database (as in many financial applications) or logging accesses to data (a...
What’s your logging philosophy? As Jeff Atwood asked: "What’s your logging philosophy? Should all code be littered with.logthis() and.logthat() calls? Or do you inject logging after the fact somehow?"
TITLE: What’s your logging philosophy? QUESTION: As Jeff Atwood asked: "What’s your logging philosophy? Should all code be littered with.logthis() and.logthat() calls? Or do you inject logging after the fact somehow?" ANSWER: My logging philosophy is pretty easily summarized in four parts: Auditing, or business logic...
[ "logging" ]
22
21
2,521
12
0
2008-09-04T19:24:54.880000
2008-09-04T19:29:37.147000
44,566
44,700
How do I simultaneously work on version 1.1 and version 2.0?
The situation: We're out of beta and version 1.0 has been released to several customer sites. Team A is already busy working on version 1.1 that will have incremental bugfixes and usability tweaks, while another team works on version 2.0 with large-scale changes, where the core of the product may have been completely r...
One good way is to fix each bug in the stable branch and merge the stable branch into the development branch. This is the Parallel Maintenance/Development Lines pattern, and the key is to merge early and often. Merging infrequently and late means that the development branch is unrecognisable compared to the stable one,...
How do I simultaneously work on version 1.1 and version 2.0? The situation: We're out of beta and version 1.0 has been released to several customer sites. Team A is already busy working on version 1.1 that will have incremental bugfixes and usability tweaks, while another team works on version 2.0 with large-scale chan...
TITLE: How do I simultaneously work on version 1.1 and version 2.0? QUESTION: The situation: We're out of beta and version 1.0 has been released to several customer sites. Team A is already busy working on version 1.1 that will have incremental bugfixes and usability tweaks, while another team works on version 2.0 wit...
[ "svn", "build-process", "release", "revision" ]
10
9
604
8
0
2008-09-04T19:28:52.793000
2008-09-04T20:27:06.477000
44,569
44,590
Octal number literals: When? Why? Ever?
I have never used octal numbers in my code nor come across any code that used it (hexadecimal and bit twiddling notwithstanding). I started programming in C/C++ about 1994 so maybe I'm too young for this? Does older code use octal? C includes support for these by prepending a 0, but where is the code that uses these ba...
I recently had to write network protocol code that accesses 3-bit fields. Octal comes in handy when you want to debug that. Just for effect, can you tell me what the 3-bit fields of this are? 0x492492 On the other hand, this same number in octal: 022222222 Now, finally, in binary (in groups of 3): 010 010 010 010 010 0...
Octal number literals: When? Why? Ever? I have never used octal numbers in my code nor come across any code that used it (hexadecimal and bit twiddling notwithstanding). I started programming in C/C++ about 1994 so maybe I'm too young for this? Does older code use octal? C includes support for these by prepending a 0, ...
TITLE: Octal number literals: When? Why? Ever? QUESTION: I have never used octal numbers in my code nor come across any code that used it (hexadecimal and bit twiddling notwithstanding). I started programming in C/C++ about 1994 so maybe I'm too young for this? Does older code use octal? C includes support for these b...
[ "c", "numbers" ]
51
55
40,187
13
0
2008-09-04T19:29:33.980000
2008-09-04T19:36:40.530000
44,588
44,595
How to convince a company to switch their Source Control
My current place of employment is currently in a transition, new ownership has taken over, things are finally getting standardized and proper guidelines are being enforced. But we are still using VSS, there really isn't any reason for using it other then that's what whats initially setup. We don't use Visual Studio, or...
VSS totally relies on the clients to manage the database. If a client drops connection in the middle of a write over the network at just the wrong time, your file is trashed on the server. Not just the tip, but all the history. Hope you have a good backup. I've been through it. It's bad news. VSS usage over VPN or othe...
How to convince a company to switch their Source Control My current place of employment is currently in a transition, new ownership has taken over, things are finally getting standardized and proper guidelines are being enforced. But we are still using VSS, there really isn't any reason for using it other then that's w...
TITLE: How to convince a company to switch their Source Control QUESTION: My current place of employment is currently in a transition, new ownership has taken over, things are finally getting standardized and proper guidelines are being enforced. But we are still using VSS, there really isn't any reason for using it o...
[ "svn", "version-control", "visual-sourcesafe" ]
12
16
1,417
14
0
2008-09-04T19:34:09.460000
2008-09-04T19:38:07.797000
44,601
44,750
.NET Development on a Mac Tips
I have just got a MacBook Pro and have been using it (+Fusion) to develop on for about a month now. The purpose of this question is similar to Hidden Features of C#; to become a how-to of tips and trick for windows development on a mac. I should clarify that I am aware of boot camp but do not use it (nor do I have any ...
@Andrew - I'm exactly in your situation. I use a MBP while my company work is purely Microsoft based: i.e.,.NET, COM etc. While nothing can beat running Vista natively in Boot Camp (I've never seen Vista run so fast), the niceties of having your Mac OS be the "main" OS, for internet, mail etc. has gotten me to the foll...
.NET Development on a Mac Tips I have just got a MacBook Pro and have been using it (+Fusion) to develop on for about a month now. The purpose of this question is similar to Hidden Features of C#; to become a how-to of tips and trick for windows development on a mac. I should clarify that I am aware of boot camp but do...
TITLE: .NET Development on a Mac Tips QUESTION: I have just got a MacBook Pro and have been using it (+Fusion) to develop on for about a month now. The purpose of this question is similar to Hidden Features of C#; to become a how-to of tips and trick for windows development on a mac. I should clarify that I am aware o...
[ ".net", "macos", "vmware", "virtualization" ]
28
15
21,771
10
0
2008-09-04T19:38:53.987000
2008-09-04T20:51:21.240000
44,617
44,653
Adding more information to TestResult.xml file from NUnit
I would like to be able to add a "message" to a unit test, such that it actually appears within the TestResult.xml file generated by NUnit. For example, this is currently generated: I would like to be able to have an additional attribute (or node as the case may be), such as: The idea is that "message" above would some...
This may be missing the point, but how about naming the tests so they indicate what they test - then you may not even need the message. If it proves to be absolutely necessary, I think you'll need to produce your own testrunner that would (off the top of my head) read an additional attribute off the TestCase and attach...
Adding more information to TestResult.xml file from NUnit I would like to be able to add a "message" to a unit test, such that it actually appears within the TestResult.xml file generated by NUnit. For example, this is currently generated: I would like to be able to have an additional attribute (or node as the case may...
TITLE: Adding more information to TestResult.xml file from NUnit QUESTION: I would like to be able to add a "message" to a unit test, such that it actually appears within the TestResult.xml file generated by NUnit. For example, this is currently generated: I would like to be able to have an additional attribute (or no...
[ "unit-testing", "nunit" ]
6
2
5,249
4
0
2008-09-04T19:45:06.390000
2008-09-04T20:03:00.997000
44,619
45,791
How Do I Test Rails Logging In from the Console?
I was having a heck of a time figuring out how to login and logout using response objects from Rails. The standard blogs were ok, but I finally diagnosed it, and I wanted to record it here. app.get '/' assert_response:success app.get '/auth_only_url' assert_response 302 user = User.find(:user_to_login) app.post '/signi...
'www.example.com' is the default host as set in ActionController::Integration::Session >> ActionController::Integration::Session.new.host => "www.example.com" It is set in actionpack/lib/action_controller/integration.rb#75 You should be able to change it in your integration test by doing the following: session = open_s...
How Do I Test Rails Logging In from the Console? I was having a heck of a time figuring out how to login and logout using response objects from Rails. The standard blogs were ok, but I finally diagnosed it, and I wanted to record it here. app.get '/' assert_response:success app.get '/auth_only_url' assert_response 302 ...
TITLE: How Do I Test Rails Logging In from the Console? QUESTION: I was having a heck of a time figuring out how to login and logout using response objects from Rails. The standard blogs were ok, but I finally diagnosed it, and I wanted to record it here. app.get '/' assert_response:success app.get '/auth_only_url' as...
[ "ruby-on-rails", "ruby" ]
7
3
1,535
1
0
2008-09-04T19:45:31.193000
2008-09-05T13:21:07.833000