Id
int64
4
8.51M
PostTypeId
int64
1
7
AcceptedAnswerId
int64
7
75.5M
ParentId
int64
4
41.8M
Score
int64
-208
27.7k
ViewCount
int64
11
12.4M
Body
stringlengths
0
45k
Title
stringlengths
2
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
225
CreationDate
stringdate
2008-07-31 21:42:52
2011-12-14 18:48:47
LastActivityDate
stringdate
2008-08-01 12:19:17
2023-03-05 04:40:26
LastEditDate
stringdate
2008-08-01 13:54:25
2023-03-05 03:12:45
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
-1
21.1M
Tags
listlengths
1
6
10,054
2
null
10,038
4
null
Avoid flash, its a horrible requirement, uncrawlable by Google, unsopported by a bunch of browsers and systems (eg iPhone) and most importantly: it forces you to reinvent web standards (e.g. scroll bars and whatnot), Javascript on the other hand is easier to maintain and code for in the noscript case. try [scriptaculo...
null
CC BY-SA 2.5
null
2008-08-13T16:36:44.780
2008-08-13T16:36:44.780
null
null
547
null
10,077
2
null
10,072
8
null
You are looking for a [Favicon](https://stackoverflow.com/questions/6642/preferred-way-to-use-favicons#6645).
null
CC BY-SA 2.5
null
2008-08-13T16:58:10.353
2008-10-17T21:00:01.277
2017-05-23T12:08:36.867
-1
91
null
10,076
2
null
10,072
0
null
load a file on the webserver called [favicon.ico](https://stackoverflow.com/favicon.ico)
null
CC BY-SA 2.5
null
2008-08-13T16:58:00.960
2008-10-17T21:00:01.277
2017-05-23T12:01:23.407
-1
30
null
10,072
1
10,077
null
8
3,891
How do I write code where a company icon appears on the left side next to the URL address in the browser's address bar?
Personalized icon next to the URL address in the browser's address bar?
CC BY-SA 4.0
0
2008-08-13T16:55:58.000
2019-10-16T07:31:13.963
2019-10-16T07:31:13.963
6,556,397
null
[ "html" ]
10,070
2
null
10,061
1
null
I presume that by GPS you mean Satellite Navigation? Most GPS units don't offer the turn-by-turn capability required to navigate effectively on roads, or the underlying road map data for that matter. OK, since Garmin are by far the biggest dog in the yard, I'd recommend taking a look at Garmin's [Location Based Servi...
null
CC BY-SA 2.5
null
2008-08-13T16:54:36.210
2008-08-20T18:39:16.343
2008-08-20T18:39:16.343
1,030
1,030
null
10,075
2
null
10,072
4
null
it loads www.whateveryouron.com/favicon.ico if your domain is robermyers.com, just put a favicon.ico 16px icon thats accessible, and you're in like flint. just try this [googles](http://www.google.com/favicon.ico) or [stackoverflows](https://stackoverflow.com/favicon.ico)
null
CC BY-SA 2.5
null
2008-08-13T16:57:59.887
2008-10-17T21:00:01.277
2017-05-23T11:48:44.687
-1
1,220
null
10,083
1
10,107
null
13
6,488
While I grew up using MSWindows, I transitioned to my much-loved Mac years ago. I don't want to start a flame war here on operating systems. I do, however, want a terminal a litle closer to what I'm used to. I'm not asking for full POSIX support - I don't have the patience to install Cygwin - but I miss tabbed termi...
better command for Windows?
CC BY-SA 3.0
0
2008-08-13T17:06:04.127
2014-03-06T18:18:18.460
2011-04-13T08:26:53.897
149,841
1,190
[ "windows", "macos", "command-line", "terminal" ]
10,085
2
null
10,083
7
null
I'm using [powershell](http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx), its awesome to keep you from going crazy, and it has rm and mkdir and ls. Tabbed terminals is still not in powershell, and copy paste is similar to cmd, but its way better than cmd.exe.
null
CC BY-SA 2.5
null
2008-08-13T17:07:20.957
2008-08-13T17:11:34.663
2008-08-13T17:11:34.663
1,220
1,220
null
10,089
2
null
10,083
1
null
I know you said you don't want to install anything, but I strongly suggest you give Services For Unix a shot: [http://technet.microsoft.com/en-us/interopmigration/bb380242.aspx](http://technet.microsoft.com/en-us/interopmigration/bb380242.aspx)
null
CC BY-SA 2.5
null
2008-08-13T17:09:42.780
2008-08-13T17:09:42.780
null
null
414
null
10,092
2
null
10,059
0
null
what about getting rid of the system menu and then putting it back in another place yourseld (say next to the close button etc.)?
null
CC BY-SA 2.5
null
2008-08-13T17:12:52.490
2008-08-13T17:12:52.490
null
null
730
null
10,088
1
10,180
null
3
579
I'm creating some custom work items in TFS and the helptext field seems handy but I don't see where it is being displayed in Team Explorer or Team System Web Access.
Where is TFS work item help text displayed?
CC BY-SA 3.0
null
2008-08-13T17:09:26.210
2012-06-08T18:40:00.300
2012-06-08T18:40:00.300
151,249
327
[ "visual-studio", "tfs" ]
10,097
2
null
10,083
0
null
[PowerShell](http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx) is worth looking into.
null
CC BY-SA 2.5
null
2008-08-13T17:15:33.127
2008-08-13T17:15:33.127
null
null
106
null
10,098
1
10,192
null
2
3,542
I'm getting into more of a TDD workflow, and have a mix of MVC and asp.net Web Forms apps. MOQ is recommended for MVC. I've used Rhino for Web Forms. Does anyone have a best practice for having 1 framework mock for both?
Best mock framework that can do both WebForms and MVC?
CC BY-SA 2.5
0
2008-08-13T17:16:33.857
2012-08-15T16:33:13.547
null
null
1,220
[ "c#", "asp.net", "asp.net-mvc", "testing" ]
10,059
1
10,555
null
7
3,856
I'm developing an MFC application and I've recently been searching for a good method to remove the icon from a Windows title bar, but retain the close button. The two obvious candidate solutions are turning off the system menu style or using the tool window style, but I would prefer not to disable the system menu or us...
Removing icon from Windows title bars without ditching close button or system menu?
CC BY-SA 3.0
null
2008-08-13T16:42:40.570
2017-04-11T17:22:24.877
2016-12-20T08:45:23.103
2,912,665
null
[ "c++", "windows", "user-interface", "mfc" ]
10,094
2
null
10,083
4
null
[PowerCmd](http://www.powercmd.com/) is great, with a ton of features including tabs, cut/copy/past, etc. [Console](http://sourceforge.net/projects/console/) is also a great replacement and is a bit more stripped down than PowerCmd (which can sometimes be a little feature rich. Also, with both of these, if you have ...
null
CC BY-SA 2.5
null
2008-08-13T17:13:47.420
2008-08-13T17:13:47.420
null
null
194
null
10,071
1
10,157
null
4
4,546
I'm working on an app that grabs and installs a bunch of updates off an an external server, and need some help with threading. The user follows this process: - - - - - The progress bar updates are fine, but the MessageBox is not fully cleared from the screen because the update loop starts right after the user clicks...
Compact Framework/Threading - MessageBox displays over other controls after option is chosen
CC BY-SA 3.0
null
2008-08-13T16:55:51.387
2016-05-20T14:17:40.253
2017-02-08T14:07:38.030
-1
636
[ "c#", "winforms", "multithreading", "compact-framework" ]
10,099
2
null
5,428
1
null
What's wrong is mixing standards. What's right is making sure that everyone does the same thing. ``` int Box = iBottom * nVerticleSide ```
null
CC BY-SA 2.5
null
2008-08-13T17:17:25.617
2008-08-13T17:17:25.617
null
null
1,223
null
10,105
2
null
3,180
6
null
I think it's great that Joel et al. let people use FogBugs hosted for free on their own. It's a great business strategy, because the users become fans (it is great software after all), and then they recommend it to their businesses or customers.
null
CC BY-SA 2.5
null
2008-08-13T17:25:21.250
2008-08-13T17:25:21.250
null
null
1,190
null
10,101
2
null
7,622
18
null
In terms of the type of shift you get, the important thing is the type of the value that you're shifting. A classic source of bugs is when you shift a literal to, say, mask off bits. For example, if you wanted to drop the left-most bit of an unsigned integer, then you might try this as your mask: ``` ~0 >> 1 ``` Unf...
null
CC BY-SA 2.5
null
2008-08-13T17:20:06.173
2008-08-13T17:20:06.173
null
null
1,236
null
10,110
2
null
10,083
1
null
PowerShell is amazing, however for anything other than the most basic commands there is a learning curve when switching from bash etc. I went back to using cygwin.
null
CC BY-SA 2.5
null
2008-08-13T17:28:19.933
2008-08-13T17:28:19.933
null
null
1,122
null
10,104
2
null
8,472
12
null
Although this [similar discussion](https://stackoverflow.com/questions/3027/is-there-an-unobtrusive-captcha-for-web-forms) was started: We are trying this solution on one of our frequently data mined applications: [A Better CAPTCHA Control (Look Ma - NO IMAGE!)](http://www.eggheadcafe.com/tutorials/aspnet/79e023b6-12...
null
CC BY-SA 2.5
null
2008-08-13T17:25:04.213
2008-08-13T17:25:04.213
2017-05-23T12:03:02.517
-1
439
null
10,106
2
null
10,083
1
null
I use [Console](http://sourceforge.net/projects/console/) with [unxutils](http://unxutils.sourceforge.net/) Console for the tabs and easier to manage select/copy/paste unxutils for ls, rm, grep, uniq, sort ... and other goodness.
null
CC BY-SA 2.5
null
2008-08-13T17:26:26.427
2008-08-13T17:26:26.427
null
null
238
null
10,112
2
null
10,083
2
null
I've never found anything I like more than Cygwin. I also went ahead and installed Cygwin/X w/ Openbox so I can get something like this: ![alt text](https://i.stack.imgur.com/ZM0MI.jpg) It's got multiple workspaces inside the main Openbox window so I can easily have up to 20 non-overlapping xterms that I can easily ...
null
CC BY-SA 3.0
null
2008-08-13T17:32:52.590
2012-03-28T21:52:44.697
2012-03-28T21:52:44.697
1,219,121
305
null
10,115
2
null
6,847
0
null
In my experience, positively employing defensive programming does not necessarily mean that you end up improving the quality of your code. Don't get me wrong, you need to defensively program to catch the kinds of problems that users will come across - users don't like it when your program crashes on them - but this is ...
null
CC BY-SA 2.5
null
2008-08-13T17:36:12.633
2008-08-13T17:36:12.633
null
null
1,236
null
10,107
2
null
10,083
6
null
Some more options: [MSYS](http://www.mingw.org): a Minimal SYStem providing a POSIX compatible Bourne shell environment, with a small collection of UNIX command line tools. Primarily developed as a means to execute the configure scripts and Makefiles used to build Open Source software, but also useful as a general pur...
null
CC BY-SA 2.5
null
2008-08-13T17:27:16.440
2008-08-13T17:27:16.440
null
null
304
null
10,130
2
null
9,750
1
null
I'm probably misremembering, but I thought that Joel's question was about the "on" bits rather than reversing them.
null
CC BY-SA 2.5
null
2008-08-13T17:57:13.243
2008-08-13T17:57:13.243
null
null
1,236
null
10,103
2
null
9,666
7
null
The correct answer seems to be, "Yes, mostly." 1. John's answer referencing the CLI spec indicates that accesses to variables not larger than 32 bits on a 32-bit processor are atomic. 2. Further confirmation from the C# spec, section 5.5, Atomicity of variable references: > Reads and writes of the following data typ...
null
CC BY-SA 4.0
null
2008-08-13T17:22:04.330
2021-01-27T03:15:46.800
2021-01-27T03:15:46.800
5,407,188
1,016
null
10,116
2
null
10,071
1
null
Have you tried putting a ``` Application.DoEvents() ``` in here ``` if (dlgRes == DialogResult.Yes) { Application.DoEvents(); ProcessAllUpdates(um2); } ```
null
CC BY-SA 2.5
null
2008-08-13T17:37:08.167
2008-08-13T17:37:08.167
null
null
1,075
null
10,129
2
null
10,123
14
null
This will do what you want: ``` signum = status & 0xff exitstatus = (status & 0xff00) >> 8 ```
null
CC BY-SA 2.5
null
2008-08-13T17:56:34.167
2008-08-13T17:56:34.167
null
null
116
null
10,138
2
null
9,570
1
null
As a bare minimum: mscoree.lib MSVCRT.lib mfc90.lib (adjust version appropriately) And iterate from there.
null
CC BY-SA 2.5
null
2008-08-13T18:07:03.413
2008-08-13T18:07:03.413
null
null
414
null
10,123
1
10,129
null
15
4,785
I'm trying to decode the result of the Python os.wait() function. This returns, according to the Python docs: > a tuple containing its pid and exit status indication: a 16-bit number, whose low byte is the signal number that killed the process, and whose high byte is the exit status (if the signal number is zero); the...
How do I treat an integer as an array of bytes in Python?
CC BY-SA 2.5
0
2008-08-13T17:46:41.940
2020-06-26T18:17:28.803
null
null
742
[ "python" ]
10,140
2
null
8,894
6
null
This is just a standard location to store frequently used SQL scripts. The reports-pgsql.sql script creates a table for storing these queries, the database they are intended to be run on, a title and some descriptive text about what they do. PhpPgAdmin has functionality to browse and execute these reports. It's a pr...
null
CC BY-SA 2.5
null
2008-08-13T18:08:47.947
2008-08-13T18:08:47.947
null
null
72
null
10,132
2
null
10,123
1
null
You can unpack the status using [bit-shifting](https://docs.python.org/3/reference/expressions.html#shifting-operations) and [masking](https://docs.python.org/3/reference/expressions.html#binary-bitwise-operations) operators. ``` low = status & 0x00FF high = (status & 0xFF00) >> 8 ``` I'm not a Python programmer, so I...
null
CC BY-SA 4.0
null
2008-08-13T17:58:27.563
2020-06-26T18:17:28.803
2020-06-26T18:17:28.803
901,641
872
null
10,148
2
null
10,123
0
null
The folks before me've nailed it, but if you really want it on one line, you can do this: ``` (signum, exitstatus) = (status & 0xFF, (status >> 8) & 0xFF) ``` EDIT: Had it backwards.
null
CC BY-SA 2.5
null
2008-08-13T18:14:10.947
2008-08-13T18:26:37.490
2008-08-13T18:26:37.490
429
429
null
10,139
2
null
601
7
null
Watch out for the Gnu Scientific Library. It's licensed under the GPL rather than LGPL. As other folks mentioned, the Boost random classes are a good start. Their implementation conforms to the PRNG code slated for TR1: [http://www.boost.org/doc/libs/1_35_0/libs/random/index.html](http://www.boost.org/doc/libs/1_35...
null
CC BY-SA 3.0
null
2008-08-13T18:08:03.457
2014-08-20T22:19:23.343
2014-08-20T22:19:23.343
1,248,536
1,244
null
10,141
2
null
3,230
18
null
1. Choose Project -> Properties 2. Select Configuration -> General 3. In the box for how you should link MFC, choose to statically link it. 4. Choose Linker -> Input. Under Additional Dependencies, add any libraries you need your app to statically link in.
null
CC BY-SA 3.0
null
2008-08-13T18:10:34.870
2017-02-27T16:41:15.867
2017-02-27T16:41:15.867
204,665
245
null
10,144
2
null
10,072
4
null
You need to create a favicon. The favicon uses a standard (in Windows, at least) .ico file. If you have a logo, you can convert it at sites like [http://www.favicongenerator.com/](http://www.favicongenerator.com/) In the `<head>` of your html page, use the `<link>` tag to define the location of the favicon like this: ...
null
CC BY-SA 4.0
null
2008-08-13T18:11:24.963
2019-05-01T16:25:59.107
2019-05-01T16:25:59.107
2,459,714
417
null
10,155
2
null
10,098
0
null
I would just go ahead and use my favourite framework for both. I don't think there's any reason that I would choose one framework for web forms and another for MVC. A far bigger problem is how I would unit test my web forms pages at all, since it's notoriously hard to seperate the page from the rest of the HttpRequest ...
null
CC BY-SA 2.5
null
2008-08-13T18:17:00.973
2008-08-13T18:17:00.973
null
null
1,016
null
10,150
2
null
6,847
1
null
I recommend people write code that is fascist in the development environment and benevolent in production. During development you want to catch bad data/logic/code as early as possible to prevent problems either going unnoticed or resulting in later problems where the root cause is hard to track. In production handl...
null
CC BY-SA 2.5
null
2008-08-13T18:15:11.803
2008-08-13T18:15:11.803
null
null
1,043
null
10,160
2
null
2,630
2
null
While it is not as fun as Out-Twitter, my favorite cmdlet is Get-Member, since it allows me to examine any of the objects I'm working with and find out new properties and methods, as well as the underlying type of the object. If I did not choose Get-Member, I would have to go with Out-Clipboard from the PowerShell Com...
null
CC BY-SA 2.5
null
2008-08-13T18:19:07.350
2008-08-13T18:19:07.350
null
null
1,233
null
10,163
2
null
9,974
2
null
Have you turned on ASP.NET tracing yet? I've had an instance where it wasn't the SQL stored procedure itself that was the problem, it was the fact that the procedure returned 5000 rows and the app was attempting to create databound ListItems with those 5000 items that was causing the problem. You might look into the ...
null
CC BY-SA 2.5
null
2008-08-13T18:22:10.027
2008-08-13T18:22:10.027
null
null
71
null
10,157
2
null
10,071
6
null
Your UI isn't updating because all the work is happening in the user interface thread. Your call to: ``` this.BeginInvoke((MethodInvoker)delegate() {update.Action.Run(); }) ``` is saying invoke update.Action.Run() on the thread that created "this" (your form), which is the user interface thread. ``` Application.Do...
null
CC BY-SA 2.5
null
2008-08-13T18:17:23.483
2008-08-13T18:17:23.483
null
null
1,078
null
10,162
2
null
10,006
10
null
If you are using IIS7, take a look at the [Compression Module](http://blogs.iis.net/ksingla/archive/2006/06/13/changes-to-compression-in-iis7.aspx). This allows you to configure compression for HTTP requests to your server.
null
CC BY-SA 2.5
null
2008-08-13T18:22:03.273
2008-08-13T18:22:03.273
null
null
571
null
10,168
2
null
10,158
0
null
I dont know regex syntax very well but could you not do: `[any alpha numeric]\*:[any alphanumeric]\*` I think something like that should work no?
null
CC BY-SA 3.0
null
2008-08-13T18:26:34.167
2016-02-07T18:31:43.777
2016-02-07T18:31:43.777
2,921,691
673
null
10,158
1
null
null
3
444
What's the easiest way to do an "instring" type function with a regex? For example, how could I reject a whole string because of the presence of a single character such as `:`? For example: - `this`- `there:is``:` More practically, how can I match the following string: ``` //foo/bar/baz[1]/ns:foo2/@attr/text() ```...
Regex Rejecting matches because of Instr
CC BY-SA 3.0
null
2008-08-13T18:18:30.643
2016-02-07T18:31:53.023
2011-12-20T18:56:46.163
592,746
64
[ "regex", "xpath" ]
10,180
2
null
10,088
2
null
When you hover over the type of the field. For instance create a new bug and hover over the "rank" and you should see "Stack rank used to prioritize work"
null
CC BY-SA 2.5
null
2008-08-13T18:30:52.723
2008-08-13T18:30:52.723
null
null
17
null
10,178
2
null
9,836
1
null
I've done a bit of integration between ASP.NET and Dynamics AX4 - it has a .NET API called Business Connector that gives you access to AX's full internal object model - if AX does it, your web app can do it too. My app had to execute arbitrary AX business logic functions and, apart from the crummy API documentation (I'...
null
CC BY-SA 2.5
null
2008-08-13T18:29:49.607
2008-08-13T18:29:49.607
null
null
1,016
null
10,186
2
null
10,158
1
null
Match on :? I think the question isn't clear enough, because the answer is so obvious: ``` if(Regex.Match(":", input)) // reject ```
null
CC BY-SA 2.5
null
2008-08-13T18:34:59.067
2008-08-13T18:34:59.067
null
null
null
null
10,187
2
null
10,158
0
null
You might want \w which is a "word" character. From [javadocs](http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html), it is defined as [a-zA-Z_0-9], so if you don't want underscores either, that may not work....
null
CC BY-SA 2.5
null
2008-08-13T18:36:02.823
2008-08-13T18:36:02.823
null
null
122
null
10,192
2
null
10,098
1
null
Rhino's latest release includes much of the sweet sweet 3.5 love that MoQ has. I'm a fan of MoQ, so that's what I'm using. But I also have Rhino, in case it does something that MoQ doesn't do. TL;DR: MoQ it baby.
null
CC BY-SA 2.5
null
2008-08-13T18:38:46.733
2008-08-13T18:38:46.733
null
null
null
null
10,190
1
10,194
null
11
19,560
Many applications have grids that display data from a database table one page at a time. Many of them also let the user pick the number of records per page, sort by any column, and navigate back and forth through the results. What's a good algorithm to implement this pattern without bringing the entire table to the cl...
How to return a page of results from SQL?
CC BY-SA 2.5
0
2008-08-13T18:38:02.740
2020-06-25T07:33:01.190
null
null
373
[ ".net", "sql", "linq", "pagination" ]
10,197
2
null
10,190
1
null
Actually, LINQ has Skip and Take methods which can be combined to choose which records are fetched. Check those out. For DB: [Pagination In SQL Server 2005](http://web.archive.org/web/20170901080057/http://www.singingeels.com:80/Articles/Pagination_In_SQL_Server_2005.aspx)
null
CC BY-SA 4.0
null
2008-08-13T18:43:17.893
2020-06-25T07:33:01.190
2020-06-25T07:33:01.190
6,262,124
380
null
10,149
1
10,161
null
6
1,829
For context, I am something of an emacs newbie. I haven't used it for very long, but have been using it more and more (I like it a lot). Also I'm comfortable with lisp, but not super familiar with elisp. What I need to do is bind a regular expression to a keyboard combination because I use this particular regex so o...
How do I bind a regular expression to a key combination in emacs?
CC BY-SA 3.0
0
2008-08-13T18:15:09.340
2013-01-23T22:12:10.863
2013-01-23T22:07:12.033
6,148
92
[ "regex", "emacs", "lisp" ]
10,194
2
null
10,190
11
null
On MS SQL Server 2005 and above, [ROW_NUMBER()](http://msdn.microsoft.com/en-us/library/ms186734.aspx) seems to work: [T-SQL: Paging with ROW_NUMBER()](http://blogs.x2line.com/al/archive/2005/11/18/1323.aspx) ``` DECLARE @PageNum AS INT; DECLARE @PageSize AS INT; SET @PageNum = 2; SET @PageSize = 10; WITH OrdersRN A...
null
CC BY-SA 3.0
null
2008-08-13T18:40:32.220
2013-01-27T14:09:44.917
2013-01-27T14:09:44.917
null
91
null
10,210
2
null
10,205
0
null
I am thinking that a generic framework would need to specify between two things: 1. What are the delimiting characters. 2. Under what condition do those characters not count (such as when they are between quotes). I think it may just be better off writing custom logic for every time you need to do something like this....
null
CC BY-SA 2.5
null
2008-08-13T18:49:40.020
2008-08-13T18:49:40.020
null
null
380
null
10,212
2
null
10,072
0
null
In modern browsers other fileformats than .ico works aswell. You can even put animated gif's in there!
null
CC BY-SA 2.5
null
2008-08-13T18:52:27.453
2008-10-17T21:00:01.277
null
null
914
null
10,202
2
null
10,149
1
null
@Justin: When executing a macro, it's a little different... incremental searches will just happen once, and you will have to execute the macro again if you want to search again. You can do more powerful and complex things though, such as search for a keyword, jump to the beginning of the line, mark, go to end of the ...
null
CC BY-SA 2.5
null
2008-08-13T18:44:39.997
2008-08-13T19:09:31.693
2008-08-13T19:09:31.693
122
122
null
10,161
2
null
10,149
6
null
You can use macros, just do then do everything for the macro, then to end the macro, then will execute the last defined macro. Then, you can name it using which lets you assign a name to it, which you can then invoke with , then store the definition using which will put the macro into your current buffer, and the...
null
CC BY-SA 3.0
null
2008-08-13T18:21:06.830
2013-01-23T22:12:10.863
2013-01-23T22:12:10.863
6,148
122
null
10,207
2
null
9,033
13
null
``` Func<int, int, int> add = (a, b) => (a + b); ``` ``` Console.WriteLine("{0:D10}", 2); // 0000000002 Dictionary<string, string> dict = new Dictionary<string, string> { {"David", "C#"}, {"Johann", "Perl"}, {"Morgan", "Python"} }; Console.WriteLine( "{0,10} {1, 10}", "Programmer", "Language" ); ...
null
CC BY-SA 2.5
null
2008-08-13T18:47:41.473
2008-09-08T17:30:22.623
2008-09-08T17:30:22.623
905
64
null
10,205
1
10,262
null
2
4,330
I'm looking at parsing a delimited string, something on the order of a,b,c But this is a very simple example, and parsing delimited data can get complex; for instance 1,"Your simple algorithm, it fails",True would blow your naiive string.Split implementation to bits. Is there anything I can freely use/steal/copy a...
Delimited string parsing?
CC BY-SA 3.0
0
2008-08-13T18:46:44.517
2016-02-07T18:31:10.713
2013-02-13T19:15:34.547
null
null
[ "c#", "text-parsing", "csv" ]
10,222
2
null
10,205
1
null
There are some good answers here: [Split a string ignoring quoted sections](https://stackoverflow.com/questions/6209/split-a-string-ignoring-quoted-sections) You might want to rephrase your question to something more precise (e.g. ?).
null
CC BY-SA 2.5
null
2008-08-13T18:55:40.427
2008-08-13T18:55:40.427
2017-05-23T12:08:38.563
-1
437
null
10,224
2
null
10,205
0
null
Simplest way is just to split the string into a char array and look for your string determiners and split char. It should be relatively easy to unit test. You can wrap it in an extension method similar to the basic .Spilt method.
null
CC BY-SA 2.5
null
2008-08-13T18:57:16.790
2008-08-13T18:57:16.790
null
null
905
null
10,226
2
null
9,734
0
null
I use String and not string, Int32 instead of int, so that my syntax highlighting picks up on a string as a Type and not a keyword. I want keywords to jump out at me.
null
CC BY-SA 2.5
null
2008-08-13T18:59:36.410
2008-08-13T18:59:36.410
null
null
580
null
10,223
2
null
10,205
2
null
Such as ``` var elements = new List<string>(); var current = new StringBuilder(); var p = 0; while (p < internalLine.Length) { if (internalLine[p] == '"') { p++; while (internalLine[p] != '"') { current.Append(internalLine[p]); p++; } // Skip past last ', ...
null
CC BY-SA 3.0
null
2008-08-13T18:57:15.463
2014-01-10T16:35:52.477
2014-01-10T16:35:52.477
2,824,961
414
null
10,227
2
null
10,190
1
null
Oracle Solution: ``` select * from ( select a.*, rownum rnum from ( YOUR_QUERY_GOES_HERE -- including the order by ) a where rownum <= MAX_ROW ) where rnum >= MIN_ROW ```
null
CC BY-SA 2.5
null
2008-08-13T19:00:32.320
2008-08-13T19:00:32.320
null
null
116
null
10,213
2
null
10,123
13
null
To answer your general question, you can use [bit manipulation](https://en.wikipedia.org/wiki/Bit_manipulation) ``` pid, status = os.wait() exitstatus, signum = status & 0xFF, (status & 0xFF00) >> 8 ``` However, there are also [built-in functions](https://docs.python.org/3/library/functions.html) for interpreting exit...
null
CC BY-SA 4.0
null
2008-08-13T18:52:36.270
2020-06-24T21:33:17.310
2020-06-24T21:33:17.310
10,794,031
99
null
10,217
2
null
10,205
2
null
I am not aware of any framework, but a simple state machine works: - - - - - - - - -
null
CC BY-SA 2.5
null
2008-08-13T18:53:44.660
2009-02-26T15:40:14.443
2009-02-26T15:40:14.443
91
91
null
10,228
1
10,321
null
79
40,838
Is there a way to get the tests inside of a `TestCase` to run in a certain order? For example, I want to separate the life cycle of an object from creation to use to destruction but I need to make sure that the object is set up first before I run the other tests.
Run PHPUnit Tests in Certain Order
CC BY-SA 3.0
0
2008-08-13T19:02:23.660
2017-07-26T10:09:27.937
2017-01-28T06:18:03.823
1,454,671
204
[ "php", "unit-testing", "phpunit" ]
10,229
1
10,484
null
3
714
Consider this problem: I have a program which should fetch (let's say) 100 records from a database, and then for each one it should get updated information from a web service. There are two ways to introduce parallelism in this scenario: 1. I start each request to the web service on a new Thread. The number of simult...
Multithreading Design Best Practice
CC BY-SA 3.0
0
2008-08-13T19:03:21.427
2014-01-10T16:30:51.670
2012-02-08T20:23:49.543
590,783
380
[ ".net", "multithreading" ]
10,234
2
null
10,230
2
null
In .Net: ``` string.IsNullOrEmpty( nystr ); ``` strings can be null, so .Length sometimes throws a NullReferenceException
null
CC BY-SA 2.5
null
2008-08-13T19:05:54.197
2008-08-13T19:05:54.197
null
null
905
null
10,230
1
10,233
null
19
19,660
Which is more efficient for the compiler and the best practice for checking whether a string is blank? 1. Checking whether the length of the string == 0 2. Checking whether the string is empty (strVar == "") Also, does the answer depend on language?
Checking for string contents? string Length Vs Empty String
CC BY-SA 3.0
0
2008-08-13T19:03:27.683
2023-01-05T16:47:52.487
2012-10-22T00:33:48.543
1,037,210
288
[ "string", "optimization", "language-agnostic", "compiler-construction" ]
10,235
2
null
10,230
0
null
Actually, IMO the best way to determine is the IsNullOrEmpty() method of the string class. [http://msdn.microsoft.com/en-us/library/system.string.isnullorempty.](http://msdn.microsoft.com/en-us/library/system.string.isnullorempty.) Update: I assumed .Net, in other languages, this might be different.
null
CC BY-SA 2.5
null
2008-08-13T19:06:38.877
2008-08-13T19:06:38.877
null
null
380
null
10,251
2
null
10,243
-1
null
I might be mistaken, but I'm pretty sure IE6 and less just don't do transparency with PNG files. I have two "solutions" that I use. Either create GIF files with transparency and use those everywhere, or just use them for IE 6 and older with conditional style sheets. The second really only works if you are using them...
null
CC BY-SA 2.5
null
2008-08-13T19:12:49.910
2008-08-13T19:12:49.910
null
null
655
null
10,232
2
null
2,222
3
null
On my project we're using Maven to build both our Flex RIA and the Java-based back end. In order to build and test the Flex app we use the [flex-mojos](http://code.google.com/p/flex-mojos/) maven plugins. They do a great job for us and I would highly recommend using Maven over Ant. That being said, if you're already...
null
CC BY-SA 3.0
null
2008-08-13T19:04:42.797
2013-01-28T04:57:03.400
2013-01-28T04:57:03.400
null
1,247
null
10,233
2
null
10,230
19
null
Yes, it depends on language, since string storage differs between languages. - `Length = 0`- `[0] == 0`- `.IsNullOrEmpty` Etc.
null
CC BY-SA 3.0
null
2008-08-13T19:05:42.357
2016-02-07T18:30:08.447
2016-02-07T18:30:08.447
2,921,691
414
null
10,250
2
null
10,230
18
null
In languages that use C-style (null-terminated) strings, comparing to `""` will be faster. That's an O(1) operation, while taking the length of a C-style string is O(n). In languages that store length as part of the string object (C#, Java, ...) checking the length is also O(1). In this case, directly checking the l...
null
CC BY-SA 2.5
null
2008-08-13T19:12:19.177
2008-08-13T19:12:19.177
null
null
872
null
10,260
1
10,811
null
7
609
I've kept up to date with new features in the C# language as it's moved from version 1 through version 3. I haven't done such a good job keeping up to date with ASP.NET. I feel like some of the post version 1 features are not so good (e.g. the AJAX framework) or are just not that useful to me (e.g. the membership fra...
What are the useful new ASP.NET features in the .NET Framework 3.5?
CC BY-SA 2.5
null
2008-08-13T19:18:07.667
2008-10-07T15:38:42.673
null
null
203
[ "asp.net" ]
10,252
2
null
10,243
2
null
[IE7.js](http://code.google.com/p/ie7-js/) will provide support for PNGs (including transparency) in IE6.
null
CC BY-SA 2.5
null
2008-08-13T19:12:56.477
2008-08-13T19:12:56.477
null
null
722
null
10,261
2
null
9,877
0
null
I have come to see that the best way to advertise yourself is to put quality content out there. If you write about the technology that you have experience in, maybe create a few tutorials, and if you do all that often enough, that shows some authority in your chosen field of work. This alone is one of the best adverti...
null
CC BY-SA 2.5
null
2008-08-13T19:18:08.307
2008-08-13T19:18:08.307
null
null
380
null
10,243
1
null
null
12
4,197
Our (beloved) designer keeps creating PNG files with transparent backgrounds for use in our applications. I'd like to make sure that this feature of the PNG works in "older" browsers as well. What's the best solution? @mabwi & @syd - Whether or not I agree about the use of a PNG is not the point. This is a problem t...
How to get PNG transparency working in browsers that don't natively support it?
CC BY-SA 2.5
0
2008-08-13T19:09:24.113
2020-06-26T12:54:01.853
2008-08-23T16:21:25.120
1,190
326
[ "browser", "png", "transparency" ]
10,254
2
null
9,846
1
null
> And again, let me emphasize, the C++ stuff is veerrrryyyy expensive. Would it make sense to do what I mentioned above? (.NET forms hiding heavy lifting C++) As noted before, I personally haven't noticed any system wide slow downs due to WinForms in applications written in both VB.NET and C#. However, if the applicat...
null
CC BY-SA 2.5
null
2008-08-13T19:13:50.580
2008-08-13T19:13:50.580
null
null
1,185
null
10,262
2
null
10,205
4
null
I use this to read from a file ``` string filename = @textBox1.Text; string[] fields; string[] delimiter = new string[] {"|"}; using (Microsoft.VisualBasic.FileIO.TextFieldParser parser = new Microsoft.VisualBasic.FileIO.TextFieldParser(filename)) { parser.Delimiters = delimiter; parser.HasFieldsEnclose...
null
CC BY-SA 3.0
null
2008-08-13T19:18:26.730
2016-02-07T18:31:10.713
2016-02-07T18:31:10.713
2,921,691
1,154
null
10,271
2
null
10,260
3
null
I'm still learning ASP.net so I can't tell you exactly, but if you look through [http://www.asp.net/learn/](http://www.asp.net/learn/) you'll probably find a few new gems, there's even a 3.5 section.
null
CC BY-SA 2.5
null
2008-08-13T19:23:07.783
2008-08-13T19:23:07.783
null
null
398
null
10,280
2
null
10,274
1
null
When you're going to perform an operation that is going to take a long time, or perhaps a continuous background thread. I guess you could always push the amount of threads available in the pool up but there would be little point in incurring the management costs of a thread that is never going to be given back to the p...
null
CC BY-SA 2.5
null
2008-08-13T19:27:42.673
2008-08-13T19:27:42.673
null
null
1,143
null
10,281
2
null
10,260
1
null
Its the [MVC framework](http://www.asp.net/mvc/). Without 3.5, there is no MVC. Without MVC, ASP.NET is a PITA.
null
CC BY-SA 2.5
null
2008-08-13T19:28:09.787
2008-08-13T19:28:09.787
null
null
null
null
10,277
2
null
10,260
5
null
Check out the [MVC framework](http://weblogs.asp.net/scottgu/archive/2007/10/14/asp-net-mvc-framework.aspx) which is built ontop of 3.5. Big improvement over the traditional webforms model.
null
CC BY-SA 2.5
null
2008-08-13T19:26:42.237
2008-08-13T19:26:42.237
null
null
1,208
null
10,265
2
null
7,252
2
null
It's his Mentor's responsibility to Teach him/her. How well are you teaching him/her HOW to test. Are you pair programming with him? The Junior more than likely doesn't know HOW to set up a good test for xyz. As a Junior freshout of school he knows many Concepts. Some technique. Some experience. But in the end, ...
null
CC BY-SA 2.5
null
2008-08-13T19:20:30.470
2008-08-13T19:20:30.470
null
null
580
null
10,274
1
10,287
null
40
17,362
When should I use the ThreadPool in .Net? It looks like the best option is to use a ThreadPool, in which case, why is it not the only option? What are your experiences around this?
When should I not use the ThreadPool in .Net?
CC BY-SA 3.0
0
2008-08-13T19:24:22.337
2018-07-12T14:55:27.010
2013-04-15T12:56:31.767
200,449
380
[ "c#", ".net", "multithreading", "design-decisions" ]
10,264
2
null
10,229
2
null
Two things to consider. ### 1. How long will it take to process a record? If record processing is very quick, the overhead of handing off records to threads can become a bottleneck. In this case, you would want to bundle records so that you don't have to hand them off so often. If record processing is reasonably lo...
null
CC BY-SA 2.5
null
2008-08-13T19:19:32.017
2008-08-13T19:19:32.017
2020-06-20T09:12:55.060
-1
872
null
10,283
2
null
10,230
1
null
In Java 1.6, the String class has a new method [isEmpty] [1](http://java.sun.com/javase/6/docs/api/java/lang/String.html#isEmpty()) There is also the Jakarta commons library, which has the [isBlank] [2](http://web.archive.org/web/20100802010006/http://commons.apache.org:80/lang/api/org/apache/commons/lang/StringUtils.h...
null
CC BY-SA 4.0
null
2008-08-13T19:30:28.063
2020-06-25T18:21:28.200
2020-06-25T18:21:28.200
6,262,124
543
null
10,289
2
null
10,243
0
null
I believe all browsers support PNG-8. Its not alpha blended, but it does have transparent backgrounds.
null
CC BY-SA 2.5
null
2008-08-13T19:34:04.093
2008-08-13T19:34:04.093
null
null
null
null
10,285
2
null
9,846
0
null
, but if it is a network monitoring system, why isn't it written as a "dedicated" Windows service? VB.NET shouldn't be much slower than C#. I'm not 100% certain if there is any big differences in the generated IL-code, but the only advantage (and justifiable reason to rewrite it in C#) I could think of (except that C...
null
CC BY-SA 2.5
null
2008-08-13T19:32:12.570
2008-08-13T19:32:12.570
null
null
936
null
10,291
2
null
10,229
0
null
The computer running the program is probably not the bottleneck, so: Remember that the HTTP protocol has a keep-alive header, that lets you send several GET requests on the same sockets, which saves you from the TCP/IP hand shake. Unfortunately I don't know how to use that in the .net libraries. (Should be possible.) ...
null
CC BY-SA 2.5
null
2008-08-13T19:34:24.593
2008-08-13T19:34:24.593
null
null
972
null
10,286
2
null
10,274
9
null
Thread pools make sense whenever you have the concept of worker threads. Any time you can easily partition processing into smaller jobs, each of which can be processed independently, worker threads (and therefore a thread pool) make sense. Thread pools do not make sense when you need thread which perform entirely dis...
null
CC BY-SA 2.5
null
2008-08-13T19:32:16.267
2008-08-13T19:32:16.267
null
null
872
null
10,282
2
null
10,190
7
null
I'd recommend either using LINQ, or try to copy what it does. I've got an app where I use the LINQ Take and Skip methods to retrieve paged data. The code looks something like this: ``` MyDataContext db = new MyDataContext(); var results = db.Products .Skip((pageNumber - 1) * pageSize) .Take(pageSize); ``` Ru...
null
CC BY-SA 2.5
null
2008-08-13T19:29:28.380
2008-08-13T19:29:28.380
null
null
1,016
null
10,290
2
null
7,252
1
null
@ jsmorris I once had the senior developer and "architect" berate me and a tester(it was my first job out of college) in email for not staying late and finishing such an "easy" task the night before. We had been at it all day and called it quits at 7pm, I had been thrashing since 11am before lunch that day and had pe...
null
CC BY-SA 2.5
null
2008-08-13T19:34:12.707
2008-08-13T19:34:12.707
null
null
580
null
10,293
1
9,320,380
null
9
729
Has anyone used [Jaxer](http://web.archive.org/web/20090803092709/http://www.aptana.com:80/Jaxer) in a production environment, I am curious as to how it holds up compared to something like php, ruby, etc. and if anyone knows of any pitfalls to using it that are well known.
Has anyone used Jaxer in production?
CC BY-SA 4.0
null
2008-08-13T19:35:31.643
2020-06-25T17:35:41.803
2020-06-25T17:35:41.803
6,262,124
567
[ "performance", "aptana", "jaxer" ]
10,300
1
45,655
null
10
6,100
I've been playing around with the ASP.NET MVC Framework and the one thing that's really confusing me is how I'm meant to do server side validation of posted form data. I presume I don't post back to the same URL, but if I don't, how do I redisplay the form with the entered data and error messages? Also, where should ...
Validating posted form data in the ASP.NET MVC framework
CC BY-SA 2.5
0
2008-08-13T19:45:33.917
2013-03-15T05:10:08.027
2013-03-15T05:10:08.027
727,208
203
[ "asp.net-mvc", "validation" ]
10,294
2
null
10,230
0
null
> In this case, directly checking the length is faster, because it avoids the overhead of constructing the new empty string. @DerekPark: That's not always true. "" is a string literal so, in Java, it will almost certainly already be interned.
null
CC BY-SA 2.5
null
2008-08-13T19:35:37.680
2008-08-13T19:35:37.680
null
null
1,035
null
10,292
2
null
10,274
10
null
To quarrelsome's answer, I would add that it's best not to use a ThreadPool thread if you need to guarantee that your thread will begin work immediately. The maximum number of running thread-pooled threads is limited per appdomain, so your piece of work may have to wait if they're all busy. It's called "queue user work...
null
CC BY-SA 2.5
null
2008-08-13T19:34:29.273
2008-08-13T19:34:29.273
null
null
1,135
null