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
22,628
2
null
22,623
277
null
The way to preserve the stack trace is through the use of the `throw;` This is valid as well ``` try { // something that bombs here } catch (Exception ex) { throw; } ``` `throw ex;` is basically like throwing an exception from that point, so the stack trace would only go to where you are issuing the `throw ex;...
null
CC BY-SA 3.0
null
2008-08-22T15:13:25.197
2017-09-23T13:06:41.763
2017-09-23T13:06:41.763
8,517,948
77
null
22,638
2
null
22,469
5
null
You aren't gonna have a problem running Xcode on an iMac. Any iMac. Any development project can be done on an iMac. They're fast and modern machines. The cheapest iMac has a Dual Core Duo 2 chip with 1 gig RAM. Boost the RAM to 2 if you can (a cheap option - cheaper if you buy 3rd party RAM). Makes a huge difference ru...
null
CC BY-SA 2.5
null
2008-08-22T15:15:52.167
2008-08-22T15:15:52.167
null
null
534
null
22,639
2
null
22,623
22
null
When you `throw ex`, you're essentially throwing a new exception, and will miss out on the original stack trace information. `throw` is the preferred method.
null
CC BY-SA 2.5
null
2008-08-22T15:15:55.833
2008-08-22T15:15:55.833
null
null
1,960
null
22,641
2
null
22,590
0
null
A shared SAN with failover is a great solution with a great (high) cost. Are there any similar solutions with failover at a reasonable cost? Perhaps something like DRBD for windows? The problem with a simple shared filesystem is the lack of redundancy (what if the fileserver goes down)?
null
CC BY-SA 2.5
null
2008-08-22T15:16:24.287
2008-08-22T15:16:24.287
null
null
1,432
null
22,624
2
null
22,617
153
null
Starting with Python 3.6, formatting in Python can be done using [formatted string literals](https://docs.python.org/3/whatsnew/3.6.html#whatsnew36-pep498) or : ``` hours, minutes, seconds = 6, 56, 33 f'{hours:02}:{minutes:02}:{seconds:02} {"pm" if hours > 12 else "am"}' ``` or the [str.format](https://docs.python.o...
null
CC BY-SA 4.0
null
2008-08-22T15:12:41.613
2019-05-07T13:06:04.313
2019-05-07T13:06:04.313
1,968
1,968
null
22,643
2
null
22,465
0
null
I can't see how licensing would be any different than for a co-lo provider.
null
CC BY-SA 2.5
null
2008-08-22T15:16:43.380
2008-08-22T15:16:43.380
null
null
2,199
null
22,646
2
null
22,607
1
null
Unfortunately, there's no legal way to run OS X in a virtual machine. For developing iPhone apps you probably don't need a particularly beefy machine, so maybe look into grabbing a [mac mini](http://store.apple.com/us/browse/home/shop_mac/family/mac_mini?mco=MTE3MTA)? They're the cheapest Macs you can get, and should...
null
CC BY-SA 2.5
null
2008-08-22T15:17:48.010
2008-08-22T15:17:48.010
null
null
1,409
null
22,640
2
null
22,570
21
null
You pretty much have to keep the left side of your where clause clean. So, normally, you'd do something like: ``` WHERE MyDateTime >= @activityDateMidnight AND MyDateTime < (@activityDateMidnight + 1) ``` (Some folks prefer DATEADD(d, 1, @activityDateMidnight) instead - but it's the same thing). The TimeZone...
null
CC BY-SA 2.5
null
2008-08-22T15:16:00.980
2008-08-22T15:16:00.980
null
null
2,199
null
22,649
2
null
22,623
107
null
If you throw a new exception with the initial exception you will preserve the initial stack trace too.. ``` try{ } catch(Exception ex){ throw new MoreDescriptiveException("here is what was happening", ex); } ```
null
CC BY-SA 2.5
null
2008-08-22T15:18:25.577
2008-08-22T15:18:25.577
null
null
1,573
null
22,651
2
null
22,465
0
null
AT&T's [Synaptic Hosting](http://arstechnica.com/news.ars/post/20080806-atampt-has-head-in-the-clouds-with-synaptic-hosting.html) allows this, though I'm sure you'll pay through the nose, as it's "enterprise".
null
CC BY-SA 3.0
null
2008-08-22T15:19:48.147
2012-09-18T13:47:59.853
2012-09-18T13:47:59.853
895,646
2,131
null
22,650
2
null
22,623
3
null
I would definitely use: ``` try { //some code } catch { //you should totally do something here, but feel free to rethrow //if you need to send the exception up the stack. throw; } ``` That will preserve your stack.
null
CC BY-SA 3.0
null
2008-08-22T15:19:15.840
2015-04-30T04:25:10.030
2015-04-30T04:25:10.030
1,226
1,226
null
22,648
2
null
22,623
14
null
The rule of thumb is to avoid Catching and Throwing the basic `Exception` object. This forces you to be a little smarter about exceptions; in other words you should have an explicit catch for a `SqlException` so that your handling code doesn't do something wrong with a `NullReferenceException`. In the real world thoug...
null
CC BY-SA 2.5
null
2008-08-22T15:18:24.767
2008-08-22T15:18:24.767
null
null
736
null
22,654
2
null
22,607
2
null
I've run OSX under VMWare, and I can tell you with confidence that it is not an environment that you would find comfortable for developing applications in. It was barely (not really) usable for testing Mac specific browser bugs that couldn't be reproduced in Safari on Windows. On the other hand, if your hardware is s...
null
CC BY-SA 2.5
null
2008-08-22T15:20:20.597
2008-08-22T15:20:20.597
null
null
1,432
null
22,652
2
null
871
6
null
[Easy Git](http://www.gnome.org/~newren/eg/) has a nice page comparing actual usage of [Git and SVN](http://www.gnome.org/~newren/eg/git-for-svn-users.html) which will give you an idea of what things Git can do (or do more easily) compared to SVN. (Technically, this is based on Easy Git, which is a lightweight wrapper...
null
CC BY-SA 2.5
null
2008-08-22T15:19:57.163
2008-08-22T15:19:57.163
null
null
825
null
22,653
2
null
22,590
1
null
At a former job we had a cluster of web servers with an F5 load balancer in front of them. We had a very similar problem in that our applications allowed users to upload content which might include photo's and such. These were legacy applications and we did not want to edit them to use a database and a SAN solution w...
null
CC BY-SA 2.5
null
2008-08-22T15:20:19.673
2008-08-22T15:20:19.673
null
null
1,875
null
22,655
2
null
22,570
4
null
Make sure to read [Only In A Database Can You Get 1000% + Improvement By Changing A Few Lines Of Code](http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/only-in-a-database-can-you-get-1000-impr) so that you are sure that the optimizer can utilize the index effectively when messing with dates
null
CC BY-SA 2.5
null
2008-08-22T15:21:21.107
2008-08-22T15:21:21.107
null
null
740
null
22,663
2
null
22,566
9
null
This will do it, in one line (note the '*' wildcard at the end) ``` @files = </path/to/directory/*>; # To demonstrate: print join(", ", @files); ```
null
CC BY-SA 2.5
null
2008-08-22T15:27:15.633
2008-08-22T15:27:15.633
null
null
2,474
null
22,666
2
null
22,607
12
null
It is [legal](http://blogs.vmware.com/vmtn/2008/01/virtual-leopa-1.html) to run Mac OS X in a virtual machine . All other forms of Mac OS X virtualization are currently forbidden.
null
CC BY-SA 2.5
null
2008-08-22T15:29:14.223
2008-08-22T15:29:14.223
null
null
164
null
22,670
2
null
22,570
0
null
Regarding timezones, yet one more reason to store all dates in a single timezone (preferably UTC). Anyway, I think the answers using datediff, datepart and the different built-in date functions are your best bet.
null
CC BY-SA 2.5
null
2008-08-22T15:31:35.637
2008-08-22T15:31:35.637
null
null
1,453
null
22,658
2
null
871
8
null
One of the things about SubVersion that irks me is that it puts its own folder in each directory of a project, whereas git only puts one in the root directory. It's not big of a deal, but little things like that add up. Of course, SubVersion has Tortoise, which is [usually] very nice.
null
CC BY-SA 2.5
null
2008-08-22T15:24:44.907
2008-08-22T15:24:44.907
null
null
736
null
22,662
2
null
22,570
0
null
I would use the dayofyear function of datepart: ``` Select * from mytable where datepart(dy,date1) = datepart(dy,date2) and year(date1) = year(date2) --assuming you want the same year too ``` See the datepart reference [here](http://www.tizag.com/sqlTutorial/sqldatepart.php).
null
CC BY-SA 2.5
null
2008-08-22T15:27:02.123
2008-08-22T15:27:02.123
null
null
225
null
22,673
2
null
22,623
3
null
You may also use: ``` try { // Dangerous code } finally { // clean up, or do nothing } ``` And any exceptions thrown will bubble up to the next level that handles them.
null
CC BY-SA 2.5
null
2008-08-22T15:32:21.440
2008-08-22T15:32:21.440
null
null
1,373
null
22,674
1
22,731
null
11
2,087
From a desktop application developer point of view, is there any difference between developing for Windows XP and developing for Windows Vista?
What are the main differences between programming for Windows XP and for Vista?
CC BY-SA 3.0
0
2008-08-22T15:33:39.097
2014-12-13T07:58:01.867
2014-12-13T07:58:01.867
1,810,429
184
[ "windows-vista", "windows-xp" ]
22,669
2
null
3,033
2
null
I usually use `keys` and I can't think of the last time I used or read a use of `each`. Don't forget about `map`, depending on what you're doing in the loop! ``` map { print "$_ => $hash{$_}\n" } keys %hash; ```
null
CC BY-SA 2.5
null
2008-08-22T15:31:20.770
2008-08-22T15:31:20.770
null
null
2,506
null
22,656
2
null
22,570
1
null
You're spoilt for choice in terms of options here. If you are using Sybase or SQL Server 2008 you can create variables of type date and assign them your datetime values. The database engine gets rid of the time for you. Here's a quick and dirty test to illustrate (Code is in Sybase dialect): ``` declare @date1 date de...
null
CC BY-SA 2.5
null
2008-08-22T15:22:51.087
2008-08-22T15:22:51.087
null
null
1,349
null
22,676
1
22,682
null
1,092
1,446,838
I have a small utility that I use to download an MP3 file from a website on a schedule and then builds/updates a podcast XML file which I've added to iTunes. The text processing that creates/updates the XML file is written in Python. However, I use wget inside a Windows `.bat` file to download the actual MP3 file. I w...
How to download a file over HTTP?
CC BY-SA 4.0
0
2008-08-22T15:34:13.760
2023-01-27T12:17:45.593
2021-02-25T21:56:26.147
355,230
2,109
[ "python", "http", "urllib" ]
22,677
2
null
22,466
11
null
Please don't put your self in that world of pain. Instead use [UFRAME](http://msmvps.com/blogs/omar/archive/2008/05/24/uframe-goodness-of-updatepanel-and-iframe-combined.aspx) which is a lot faster and is implemented in jQuery. Now, to manage those 2000 lines of Javascript code I recommend splitting the code in differ...
null
CC BY-SA 3.0
null
2008-08-22T15:35:16.550
2012-08-11T16:15:41.953
2012-08-11T16:15:41.953
1,477,076
2,148
null
22,678
2
null
22,566
1
null
Here's an example of recursing through a directory structure and copying files from a backup script I wrote. ``` sub copy_directory { my ($source, $dest) = @_; my $start = time; # get the contents of the directory. opendir(D, $source); my @f = readdir(D); closedir(D); # recurse through the directory structure and cop...
null
CC BY-SA 4.0
null
2008-08-22T15:36:02.163
2022-09-16T07:28:45.713
2022-09-16T07:28:45.713
2,932,052
1,494
null
22,680
2
null
20,081
0
null
I couldn't agree with you more, HollyStyles. I also used to be a TSQL guy, and find some of Oracle's idiosyncrasies more than a little perplexing. Unfortunately, temp tables aren't as convenient in Oracle, and in this case, other existing SQL logic is expecting to directly query a table, so I give it this view instead....
null
CC BY-SA 2.5
null
2008-08-22T15:36:36.080
2008-08-22T15:36:36.080
null
null
726
null
22,660
2
null
20,718
1
null
You should look at the .NET Framework Configuration Tool. It's in the .NET SDK, and you can find instructions on running it here... [http://msdn.microsoft.com/en-us/library/2bc0cxhc.aspx](http://msdn.microsoft.com/en-us/library/2bc0cxhc.aspx) In the section you'll find 3 policy levels: Enterprise, Machine and User. ...
null
CC BY-SA 2.5
null
2008-08-22T15:25:24.157
2008-08-22T15:31:30.007
2008-08-22T15:31:30.007
1,529
1,529
null
22,686
2
null
18,717
8
null
Is there a benefit to not having foreign keys? Unless you are using a crappy database, FKs aren't that hard to set up. So why would you have a policy of avoiding them? It's one thing to have a naming convention that says a column references another, it's another to know the database is actually verifying that relations...
null
CC BY-SA 2.5
null
2008-08-22T15:40:17.847
2008-08-22T15:40:17.847
null
null
1,453
null
22,687
1
22,702
null
1
10,408
I have recently started having problems with TortoiseCVS, or more specifically with plink, the SSH application that comes with it. The IP address it tries to connect to can not be changed and is stuck with the old CVS repository's IP. Downloading plink from it's home site and calling from the command line still has thi...
Alternative SSH Application to Plink
CC BY-SA 2.5
null
2008-08-22T15:41:08.157
2008-10-22T02:26:21.740
null
null
2,118
[ "ssh", "cvs", "tortoisecvs", "plink" ]
22,684
2
null
22,674
5
null
Do not assume your user has access to certain key areas of the disc (i.e. program files, windows directory etc). Instead the default user account will only be able to write to a small section of their application data. Also, they won't be able to write to global areas of the registry - only the current user section. ...
null
CC BY-SA 2.5
null
2008-08-22T15:40:00.580
2008-08-22T15:40:00.580
null
null
986
null
22,675
2
null
888
8
null
For the really gritty problems that would be too time consuming to use print_r/echo to figure out I use my IDE's (PhpEd) debugging feature. Unlike other IDEs I've used, PhpEd requires pretty much no setup. the only reason I don't use it for any problems I encounter is that it's slow. I'm not sure that slowness is s...
null
CC BY-SA 2.5
null
2008-08-22T15:33:44.743
2008-08-22T15:33:44.743
null
null
2,494
null
22,689
2
null
21,133
6
null
For benchmarking, like in your example, I use the [pear Benchmark](http://pear.php.net/package/Benchmark) package. You set markers for measuring. The class also provides a few presentation helpers, or you can process the data as you see fit. I actually have it wrapped in another class with a __destruct method. When a ...
null
CC BY-SA 2.5
null
2008-08-22T15:43:20.133
2008-08-22T15:43:20.133
null
null
2,506
null
22,682
2
null
22,676
548
null
Use [urllib.request.urlopen()](https://docs.python.org/3/library/urllib.request.html#urllib.request.urlopen): ``` import urllib.request with urllib.request.urlopen('http://www.example.com/') as f: html = f.read().decode('utf-8') ``` This is the most basic way to use the library, minus any error handling. You can a...
null
CC BY-SA 4.0
null
2008-08-22T15:38:22.330
2020-06-21T15:33:21.917
2020-06-21T15:33:21.917
3,064,538
1,595
null
22,691
2
null
888
26
null
[XDebug](http://www.xdebug.org/) is essential for development. I install it before any other extension. It gives you stack traces on any error and you can enable profiling easily. For a quick look at a data structure use [var_dump()](http://www.php.net/manual/en/function.var-dump.php). Don't use `print_r()` because yo...
null
CC BY-SA 3.0
null
2008-08-22T15:43:34.563
2014-12-15T15:04:21.110
2014-12-15T15:04:21.110
983,912
2,148
null
22,692
2
null
22,687
2
null
Putty is probably the best SSH client out there: [http://www.chiark.greenend.org.uk/~sgtatham/putty/](http://www.chiark.greenend.org.uk/~sgtatham/putty/)
null
CC BY-SA 2.5
null
2008-08-22T15:44:05.530
2008-08-22T15:44:05.530
null
null
986
null
22,681
2
null
888
4
null
Manual debugging is generally quicker for me - `var_dump()` and `debug_print_backtrace()` are all the tools you need to arm your logic with.
null
CC BY-SA 2.5
null
2008-08-22T15:36:59.713
2008-08-22T15:36:59.713
null
null
2,025
null
22,688
2
null
22,687
0
null
It might be worth trying Tunnelier from [www.bitvise.com](http://www.bitvise.com)
null
CC BY-SA 2.5
null
2008-08-22T15:43:18.590
2008-08-22T15:43:18.590
null
null
636
null
22,694
1
250,676
null
4
523
When using 3rd party libraries/components in production projects, are you rigorous about using only released versions of said libraries? When do you consider using a pre-release or beta version of a library (in dev? in production, under certain circumstances)? If you come across a bug or shortcoming of the library ...
Use of 3rd party libraries/components in production
CC BY-SA 2.5
null
2008-08-22T15:44:28.603
2010-08-07T16:55:17.830
2010-08-07T16:55:17.830
304
1,960
[ "dependency-management" ]
22,690
2
null
22,674
1
null
There can be, but that's a conscious choice you make as the developer. You can use new Vista stuff, like UAC and CommandLinks and Aero and so forth. But you don't have to (even UAC can be programmed around -- just don't do anything that needs admin privileges). If you choose to ignore all of the Vista stuff, then there...
null
CC BY-SA 2.5
null
2008-08-22T15:43:33.597
2008-08-22T15:43:33.597
null
null
1,975,282
null
22,697
1
23,048
null
347
219,107
What's the best framework for creating mock objects in Java? Why? What are the pros and cons of each framework?
What's the best mock framework for Java?
CC BY-SA 2.5
0
2008-08-22T15:45:11.423
2015-03-04T14:35:35.687
2009-01-28T20:05:12.557
3,434
2,030
[ "java", "unit-testing", "mocking" ]
22,696
1
null
null
0
2,019
OK, here is my problem, without being too specific for reasons of being fired for putting company practices on the internet. There are spreadsheets made. These are uploaded to the database. I need to filter out duplicates from uploading. The only way to do this is by making sure that for each and every entry that two ...
How to filter by 2 fields when loading data into an access database table from an excel spreadsheet
CC BY-SA 2.5
0
2008-08-22T15:44:39.820
2019-01-22T19:44:44.400
2019-01-22T19:44:44.400
3,195,477
null
[ "sql", "ms-access" ]
22,695
2
null
888
2
null
Komodo IDE works well with xdebug, even for the remore debugging. It needs minimum amount of configuration. All you need is a version of php that Komodo can use locally to step through the code on a breakpoint. If you have the script imported into komodo project, then you can set breakpoints with a mouse-click just how...
null
CC BY-SA 2.5
null
2008-08-22T15:44:33.063
2008-08-22T15:44:33.063
null
null
null
null
22,699
2
null
7,252
20
null
For myself, I have started insisting that every bug I find and fix be expressed as a test: 1. "Hmmm, that's not right..." 2. Find possible problem 3. Write a test, show that the code fails 4. Fix the problem 5. Show that the new code passes 6. Loop if the original problem persists I try to do this even while bangi...
null
CC BY-SA 2.5
null
2008-08-22T15:46:16.663
2008-08-22T17:50:21.733
2008-08-22T17:50:21.733
2,509
2,509
null
22,705
2
null
22,694
0
null
- - -
null
CC BY-SA 2.5
null
2008-08-22T15:48:54.927
2008-08-22T15:48:54.927
null
null
1,453
null
22,693
2
null
22,319
0
null
You have two options: - - You should decide what makes most sense for your application. For example if the mailing time is always the same for all users, it makes more sense to go with option (2). If the events times can change between users and even per user, it may make development and debugging easier if you choo...
null
CC BY-SA 2.5
null
2008-08-22T15:44:23.033
2008-08-22T15:44:23.033
null
null
2,474
null
22,700
2
null
22,687
9
null
Are you sure this is a problem with plink? It sounds to me like you have CVS/Root files lying around that still point to the old cvs ip address. In general, CVS doesn't make changing repositories into a fun process. Since you are using Windows, if you install WinCVS with macros support (Python module loaded) it has ...
null
CC BY-SA 2.5
null
2008-08-22T15:47:14.697
2008-08-22T15:47:14.697
null
null
1,432
null
22,702
2
null
22,687
0
null
For what it's worth, [plink](http://the.earth.li/~sgtatham/putty/latest/x86/plink.exe) is just a command-line version of putty written by the same guy. I think [jsight](https://stackoverflow.com/questions/22687/alternative-ssh-application-to-plink#22700) probably has the right idea.
null
CC BY-SA 2.5
null
2008-08-22T15:48:25.707
2008-08-22T15:48:25.707
2017-05-23T11:54:47.530
-1
305
null
22,708
1
22,715
null
33
59,561
How would you determine the column name (e.g. "AQ" or "BH") of the nth column in Excel? Edit: A language-agnostic algorithm to determine this is the main goal here.
How do I find the Excel column name that corresponds to a given integer?
CC BY-SA 2.5
0
2008-08-22T15:49:53.380
2014-05-14T21:06:50.753
2008-08-22T16:17:38.600
940
940
[ "algorithm", "excel", "language-agnostic" ]
22,711
2
null
18,955
0
null
If you don't want an event interfering, you can set up the Validation Rule property for the textbox to be ``` NOT LIKE "*"+Chr(10)+"*" OR "*"+Chr(13)+"*" ``` You will probably also want to set the Validation Text to explain specifically why Access is throwing up an error box.
null
CC BY-SA 2.5
null
2008-08-22T15:52:32.000
2008-08-22T15:52:32.000
null
null
2,470
null
22,703
2
null
22,354
1
null
Sometimes I see the `ItemAdded` or `ItemUpdated` firing twice for a single operation. You can try to put a breakpoint in the `ItemAdded()` method to confirm that. The solution in my case was to single thread the `ItemAdded()` method: ``` private static object myLock = new object(); public override void ItemAdded(SPI...
null
CC BY-SA 2.5
null
2008-08-22T15:48:33.197
2008-08-22T15:48:33.197
null
null
1,287
null
22,715
2
null
22,708
44
null
I once wrote this function to perform that exact task: ``` public static string Column(int column) { column--; if (column >= 0 && column < 26) return ((char)('A' + column)).ToString(); else if (column > 25) return Column(column / 26) + Column(column % 26 + 1); else throw new Exc...
null
CC BY-SA 2.5
null
2008-08-22T15:53:47.503
2008-08-22T15:53:47.503
null
null
317
null
22,719
2
null
22,708
-1
null
I currently use this, but I have a feeling that it can be optimized. ``` private String GetNthExcelColName(int n) { String firstLetter = ""; //if number is under 26, it has a single letter name // otherwise, it is 'A' for 27-52, 'B' for 53-78, etc if(n > 26) { //the Converts to double and...
null
CC BY-SA 2.5
null
2008-08-22T15:58:03.157
2008-08-22T15:58:03.157
null
null
940
null
22,716
2
null
22,694
0
null
> There's no point using a beta version in dev if you aren't certain you'll use it in production. That just seems like a wasted exercise Good point, I was also considering the scenario of evaluation of the pre-release version in dev, but I supposed that taints the dev -> test/qa -> prod path. > I'll use the patch. Wh...
null
CC BY-SA 2.5
null
2008-08-22T15:54:38.967
2008-08-22T15:54:38.967
null
null
1,960
null
22,721
2
null
22,676
169
null
``` import urllib2 mp3file = urllib2.urlopen("http://www.example.com/songs/mp3.mp3") with open('test.mp3','wb') as output: output.write(mp3file.read()) ``` The `wb` in `open('test.mp3','wb')` opens a file (and erases any existing file) in binary mode so you can save data with it instead of just text.
null
CC BY-SA 3.0
null
2008-08-22T15:58:17.757
2016-03-10T17:14:43.633
2016-03-10T17:14:43.633
241,605
30
null
22,704
1
22,722
null
2
581
- - My development team works on a web application (JSP reports, HTML, JavaScript) that uses an Oracle database (PL/SQL). The key functionality the application delivers is in reporting, where a user can get PDFs of reports at a high level and drill down to lower levels of supporting details. As the number of suppor...
What strategies have you employed to improve web application performance?
CC BY-SA 2.5
null
2008-08-22T15:48:44.490
2016-12-20T07:26:53.533
2008-09-09T22:13:48.017
-1
null
[ "performance", "oracle", "web-applications" ]
22,714
2
null
22,694
1
null
I've used beta libraries in commercial projects before but mostly during development and when the vendor is likely to release a final version before I finish the product. For example, I developed a small desktop application using Visual Studio 2005 Beta 2 because I knew that the RTM version would be available before t...
null
CC BY-SA 2.5
null
2008-08-22T15:53:29.253
2008-08-22T15:53:29.253
null
null
2,148
null
22,722
2
null
22,704
6
null
While my answer may not contain any concrete steps to help this is always where I start. First thing I would do is try to throw away all of your assumptions about what the trouble is and take steps to install metrics everywhere you can. Let the metrics guide you rather than your intuition. I've chased many, many, ma...
null
CC BY-SA 2.5
null
2008-08-22T15:58:41.987
2008-08-22T15:58:41.987
null
null
1,975
null
22,718
2
null
1,669
5
null
I liked the [Crenshaw tutorial](http://compilers.iecc.com/crenshaw/) too, because it makes it absolutely clear that a compiler is just another program that reads some input and writes some out put. Read it. Work it if you want, but then look at another reference on how bigger and more complete compilers are really ...
null
CC BY-SA 2.5
null
2008-08-22T15:57:16.420
2008-09-02T04:52:41.310
2008-09-02T04:52:41.310
2,509
2,509
null
22,732
1
22,770
null
35
77,821
I am trying to do some string concatenation/formatting, but it's putting all the parameters into the first placeholder. ``` function CreateAppPoolScript([string]$AppPoolName, [string]$AppPoolUser, [string]$AppPoolPass) { # Command to create an IIS application pool $AppPoolScript = "cscript adsutil.vbs CREATE...
How do I pass multiple string parameters to a PowerShell script?
CC BY-SA 3.0
0
2008-08-22T16:03:00.227
2016-11-29T19:40:09.450
2016-11-29T19:39:44.447
1,324
636
[ "string", "powershell", "parameters", "arguments" ]
22,738
2
null
22,708
6
null
Joseph's code is good but, if you don't want or need to use a VBA function, try this. Assuming that the value of n is in cell `A2` Use this function: ``` =MID(ADDRESS(1,A2),2,LEN(ADDRESS(1,A2))-3) ```
null
CC BY-SA 3.0
null
2008-08-22T16:03:49.773
2012-01-08T10:49:01.680
2012-01-08T10:49:01.680
445,425
2,173
null
22,739
2
null
22,704
1
null
As Webjedi says, metrics are your friend. Also look at your stack and see where there are opportunities for caching - then employ mercilessly wherever possible!
null
CC BY-SA 2.5
null
2008-08-22T16:04:00.647
2008-08-22T16:04:00.647
null
null
1,025
null
22,733
2
null
20,148
271
null
I'm not a database expert, and I do not speak from experience. However: [MyISAM tables use table-level locking](http://dev.mysql.com/doc/refman/5.1/en/internal-locking.html). Based on your traffic estimates, you have close to 200 writes per second. With MyISAM, . You have to make sure that your hardware can keep up wi...
null
CC BY-SA 2.5
null
2008-08-22T16:03:00.493
2011-02-13T19:18:09.297
2011-02-13T19:18:09.297
238,419
2,474
null
22,737
2
null
22,704
2
null
Have you considered building your data ahead of time? In other words are there groups of data that are requested again and again? If so have them ready before the user asks. I'm not exactly talking about caching, but I think that is part of the equation. It might be worth it to take a step back from the code and ...
null
CC BY-SA 3.0
null
2008-08-22T16:03:46.513
2016-12-20T07:26:53.533
2016-12-20T07:26:53.533
1,997,093
1,227
null
22,746
2
null
22,687
-1
null
+1 for PuTTy... been using it for the last decade and never needed anything else!
null
CC BY-SA 2.5
null
2008-08-22T16:05:20.300
2008-08-22T16:05:20.300
null
null
1,025
null
22,749
2
null
17,054
0
null
If you are using Delphi, I highly recommend [Indy](http://www.indyproject.org/index.en.aspx) sockets, a set of classes for easy manipulation of sockets and many other internet protocols (HTTP, FTP, NTP, POP3 etc.)
null
CC BY-SA 2.5
null
2008-08-22T16:06:05.430
2008-08-22T16:06:05.430
null
null
2,474
null
22,720
1
22,803
null
4
3,044
I have a listening port on my server that I'm connecting to using a Java class and the `Socket` interface, i.e. ``` Socket mySocket = new Socket(host,port); ``` I then grab an `OutputStream`, decorate with a `PrintWriter` in autoflush mode and I'm laughing - except if the listening port closes. Then I get ``` tcp4...
Configure a Java Socket to fail-fast on disconnect?
CC BY-SA 3.0
0
2008-08-22T15:58:13.077
2014-02-22T22:47:06.493
2014-02-22T21:56:18.383
772,385
2,362
[ "java", "exception", "sockets", "networking" ]
22,741
2
null
22,704
1
null
As I said in [another question](https://stackoverflow.com/questions/12927/if-you-have-a-java-application-that-is-consuming-cpu-when-it-isnt-doing-anythin#19767): > Yes they cost money, and using them can occasionally be a bit awkward, but they do provide you with a great deal more real evidence rather than guesswork.H...
null
CC BY-SA 2.5
null
2008-08-22T16:04:19.867
2008-08-22T16:04:19.867
2020-06-20T09:12:55.060
-1
1,000
null
22,755
2
null
8,472
10
null
I just use simple questions that anyone can answer: What color is the sky? What color is an orange? What color is grass? It makes it so that someone has to custom program a bot to your site, which probably isn't worth the effort. If they do, you just change the questions.
null
CC BY-SA 2.5
null
2008-08-22T16:06:53.807
2008-08-22T16:06:53.807
null
null
2,363
null
22,759
2
null
3,748
0
null
Pulling loads of binary data out of your DB over the wire is going to cause huge latency issues and won't scale well. Store paths in the DB and let your webserver take the load - it's what it was designed for!
null
CC BY-SA 2.5
null
2008-08-22T16:08:52.537
2008-08-22T16:08:52.537
null
null
1,025
null
22,751
2
null
22,694
0
null
I use: - - - - I've found significant bugs in every one of these, so I try to limit their use as much as possible. Infragisitcs is pretty good for what it is, and National Instruments is by far the best, although quite limited. I would avoid LeadTools at all cost.
null
CC BY-SA 2.5
null
2008-08-22T16:06:26.163
2008-08-22T16:06:26.163
null
null
1,490
null
22,706
2
null
3,748
1
null
If you need to store lots of images on the file system a couple of things to think about include: - - -
null
CC BY-SA 2.5
null
2008-08-22T15:49:19.310
2008-08-22T15:49:19.310
null
null
636
null
22,723
2
null
22,676
15
null
I agree with Corey, urllib2 is more complete than [urllib](http://docs.python.org/lib/module-urllib.html) and should likely be the module used if you want to do more complex things, but to make the answers more complete, urllib is a simpler module if you want just the basics: ``` import urllib response = urllib.urlope...
null
CC BY-SA 2.5
null
2008-08-22T15:58:52.077
2008-08-22T15:58:52.077
null
null
145
null
22,765
2
null
9,301
1
null
Interestingly, if you click on the screen (remove the focus from the textbox) on second example with only one textbox, the event onClick fires... So it's not an expected behaviour since it only occurs when you have just one textbox you have the focus on the textbox. I'm afraid you've found a bug on the browser and you...
null
CC BY-SA 2.5
null
2008-08-22T16:09:58.697
2008-08-22T16:09:58.697
null
null
1,328
null
22,766
2
null
22,708
1
null
I suppose you need VBA code: ``` Public Function GetColumnAddress(nCol As Integer) As String Dim r As Range Set r = Range("A1").Columns(nCol) GetColumnAddress = r.Address End Function ```
null
CC BY-SA 2.5
null
2008-08-22T16:11:02.907
2008-08-22T16:11:02.907
null
null
394
null
22,761
2
null
22,674
0
null
By far the most painful part of moving an application from XP to Vista (from my point of view) is dealing with the numerous services and IPv6 stuff that uses ports which were previously free, and dealing with the Wireless Provisioning -> Native WiFi transition. The UAC stuff is basically a moot point; there is very li...
null
CC BY-SA 2.5
null
2008-08-22T16:09:29.057
2008-08-22T16:09:29.057
null
null
1,490
null
22,762
2
null
22,566
8
null
[IO::Dir](http://search.cpan.org/~gbarr/IO-1.2301/IO/Dir.pm) is nice and provides a tied hash interface as well. From the perldoc: ``` use IO::Dir; $d = IO::Dir->new("."); if (defined $d) { while (defined($_ = $d->read)) { something($_); } $d->rewind; while (defined($_ = $d->read)) { something_else($_); }...
null
CC BY-SA 3.0
null
2008-08-22T16:09:34.360
2014-12-26T05:43:06.633
2014-12-26T05:43:06.633
257,635
2,506
null
22,731
2
null
22,674
20
null
Looking at the [Windows Vista User Experience Guidelines](http://msdn.microsoft.com/en-us/library/aa511258.aspx) you can see that they have changed many UI elements, which you should be aware of. Some major things to take note of: - [Larger icons](http://msdn.microsoft.com/en-us/library/aa511280.aspx)- [font](http:...
null
CC BY-SA 2.5
null
2008-08-22T16:02:49.137
2008-08-24T15:00:19.427
2008-08-24T15:00:19.427
2,134
2,134
null
22,768
2
null
9,301
1
null
Out of curiosity, are you using a DOCTYPE, and if so, which one? I'm not saying incompatabilities with the DOCTYPE are the issue, but quirks mode is something to rule out before trying anything else.
null
CC BY-SA 2.5
null
2008-08-22T16:13:05.773
2008-08-22T16:13:05.773
null
null
1,344
null
22,775
2
null
22,696
1
null
I had a similar problem. My solution was to: 1. import into a staging-table. 2. delete the duplicates 3. copy what's left over into the live table It's a little BFI, but it just plain works.
null
CC BY-SA 2.5
null
2008-08-22T16:17:52.673
2008-08-22T16:17:52.673
null
null
685
null
22,779
1
22,800
null
3
1,278
I just wonder a bit whether or not GDI+ is still a technology worth using, especially in a .net sense. Granted, GDI+ is still THE technology to handle Images in Windows, but it is also unmanaged code (obviously). Now, after discovering that GDI+ is actually not supported on ASP.net¹, I just wonder: Is it actually feas...
Is GDI+ actually still a "usable" technology?
CC BY-SA 2.5
null
2008-08-22T16:20:55.287
2008-12-18T16:58:33.610
null
null
91
[ ".net", "gdi+" ]
22,745
2
null
22,431
2
null
I have recently integrated the [Compass](http://www.compass-project.org/) search engine into a Java EE 5 application. It is based on [Lucene Java](http://lucene.apache.org/java/docs/index.html) and supports different ORM frameworks as well as other types of models like XML or no real model at all ;) In the case of an ...
null
CC BY-SA 2.5
null
2008-08-22T16:05:16.197
2008-08-22T16:05:16.197
null
null
1,793
null
22,770
2
null
22,732
52
null
Lose the parentheses and commas. Calling your function as: ``` $s = CreateAppPoolScript "name" "user" "pass" ``` gives: ``` cscript adsutil.vbs CREATE "w3svc/AppPools/name" IIsApplicationPool cscript adsutil.vbs SET "w3svc/AppPools/name/WamUserName" "user" cscript adsutil.vbs SET "w3svc/AppPools/name/WamUserPass...
null
CC BY-SA 3.0
null
2008-08-22T16:15:03.320
2016-11-29T19:40:09.450
2016-11-29T19:40:09.450
1,324
1,324
null
22,785
2
null
22,696
0
null
How are you loading them into the database? Is this with your own code to read the Excel files? You can [read the Excel files using ADO/ADO.NET with the right connection string](https://stackoverflow.com/questions/15828/reading-excel-files-from-c#15839). Then you could read the data using a query that would weed out th...
null
CC BY-SA 2.5
null
2008-08-22T16:25:18.597
2008-08-22T16:25:18.597
2017-05-23T12:13:34.637
-1
1,627
null
22,790
2
null
22,779
6
null
System.Drawing is built on top of GDI+. It's just a wrapper. [http://msdn.microsoft.com/en-us/library/system.drawing.aspx](http://msdn.microsoft.com/en-us/library/system.drawing.aspx)
null
CC BY-SA 2.5
null
2008-08-22T16:26:16.833
2008-08-22T16:26:16.833
null
null
1,219
null
22,776
2
null
22,676
1,310
null
One more, using [urlretrieve](https://docs.python.org/3/library/urllib.request.html#module-urllib.request): ``` import urllib.request urllib.request.urlretrieve("http://www.example.com/songs/mp3.mp3", "mp3.mp3") ``` (for Python 2 use `import urllib` and `urllib.urlretrieve`)
null
CC BY-SA 4.0
null
2008-08-22T16:19:09.097
2023-01-27T12:17:45.593
2023-01-27T12:17:45.593
242,457
394
null
22,786
2
null
22,354
0
null
I'll have to look into that and get back to you. The problem on my end seems to be that there is code running in a different class, in a different feature, being controlled by a different thread, all of which are trying to access the same record. I am trying to avoid using a fixed delay. With any threading issue, th...
null
CC BY-SA 3.0
null
2008-08-22T16:25:21.967
2013-01-24T10:13:46.280
2013-01-24T10:13:46.280
1,410,342
2,470
null
22,793
2
null
21,999
3
null
Have you tried putting a [WindowsFormsHost](https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.integration.windowsformshost?redirectedfrom=MSDN&view=net-5.0) control on a WPF window/control? That will allow WPF to render a WinForms control. : This question and answer is 4 years old. [Text rendering has s...
null
CC BY-SA 4.0
null
2008-08-22T16:28:35.890
2020-12-29T17:46:40.427
2020-12-29T17:46:40.427
4,751,173
536
null
22,784
2
null
22,704
1
null
Not all profilers cost (extra) money. For .Net, I'm successfully using an old build of NProf (currently abandoned but it still works for me) for profiling my ASP.Net applications. For SQL Server, the query profiler is part of the package. There's also the CLF Profiler from MS but I've never been able to get it to wo...
null
CC BY-SA 2.5
null
2008-08-22T16:24:59.613
2008-08-22T16:24:59.613
null
null
1,862
null
22,796
2
null
17,721
8
null
Yes, you can use Hadoop on a local filesystem by using file URIs instead of hdfs URIs in various places. I think a lot of the examples that come with Hadoop do this. This is probably fine if you just want to learn how Hadoop works and the basic map-reduce paradigm, but you will need multiple machines and a distribute...
null
CC BY-SA 2.5
null
2008-08-22T16:29:08.793
2008-08-22T16:29:08.793
null
null
156
null
22,798
1
4,788,050
null
4
3,370
Has anyone got a working solution without some Java/COM-bridge? E.g. process the Email as a file (.msg) rather than locating the data that is referenced in the Clipboard?
Drag and Drop an Email from MS Outlook to Eclipse RCP
CC BY-SA 2.5
null
2008-08-22T16:30:20.117
2011-01-24T22:39:12.187
2008-09-26T18:41:34.073
2,134
1,793
[ "java", "eclipse", "ms-office", "integration", "desktop" ]
22,764
1
1,434,830
null
5
1,779
In Ruby 1.8 and earlier, ``` Foo ``` is a constant (a Class, a Module, or another constant). Whereas ``` foo ``` is a variable. The key difference is as follows: ``` module Foo bar = 7 BAZ = 8 end Foo::BAZ # => 8 Foo::bar # NoMethodError: undefined method 'bar' for Foo:Module ``` That's all well and go...
How does Ruby 1.9 handle character cases in source code?
CC BY-SA 2.5
null
2008-08-22T16:09:50.070
2010-12-15T16:01:47.543
2008-11-05T14:40:13.113
23,855
1,190
[ "ruby", "encoding", "utf-8" ]
22,797
2
null
22,503
0
null
Sounds like the controls aren't being databound properly after the postback. Are you databinding the first dropdown in the page or in the codebehind? If codebehind, are you doing it in on_init or on_load every time? There might be an issue of the SelectedValue of the second drop down being set to a non-existent item ...
null
CC BY-SA 2.5
null
2008-08-22T16:30:08.337
2008-08-22T16:30:08.337
null
null
1,976
null
22,792
1
546,633
null
42
24,945
I'm working on an open source project that uses SQL Server 2005 as the data store. We need a DB compare tool to generate diff scripts to be able to upgrade a DB from one version to another. Is there an open source or free SQL Server DB diff tool out there that generates a convert script?
Is there an open source SQL Server DB compare tool?
CC BY-SA 2.5
0
2008-08-22T16:26:31.170
2014-06-16T10:58:33.990
2014-06-16T10:58:33.990
1,407,421
1,463
[ "sql-server", "sql-server-2005", "compare" ]
22,800
2
null
22,779
5
null
It's still a technology worth using. There are lots of Windows Forms and unmanaged apps around that use GDI+ that either won't be upgraded, or that will be upgraded, but that don't need more advanced rendering capabilities. GDI+ is a good bolt-on solution for older applications, and for new applications written in Wind...
null
CC BY-SA 2.5
null
2008-08-22T16:32:04.557
2008-08-22T16:32:04.557
null
null
1,975,282
null
22,799
2
null
22,459
1
null
`wcstombs` doesn't get the size of the destination, so it can, in theory, buffer overflow. And why are you using `sprintf` with what I assume are constants? Just use: `EZMPPOST" " EZMPTAG "/" EZMPVER " " TYPETXT EOL` C and C++ combines string literal declarations into a single string.
null
CC BY-SA 3.0
null
2008-08-22T16:31:49.317
2012-07-03T15:02:03.293
2012-07-03T15:02:03.293
142,162
1,799
null
22,809
2
null
22,807
-1
null
try ``` ep.EffectiveStartDate BETWEEN @date1 AND @date2 ``` where you would do something like ``` declare @date1 datetime, @date2 datetime; set @date1 = cast('10/1/2000' as datetime) set @date2 = cast('10/1/2020' as datetime) ```
null
CC BY-SA 2.5
null
2008-08-22T16:36:33.313
2008-08-22T16:36:33.313
null
null
77
null
22,803
2
null
22,720
1
null
Set a short timeout? Does `isOutputShutdown()` not get you what you want? You could always build a `SocketWatcher` class that spins up in its own `Thread` and repeatedly tries to write empty strings to the `Socket` until that raises a `SocketClosedException`.
null
CC BY-SA 2.5
null
2008-08-22T16:33:13.820
2008-08-23T12:50:06.673
2008-08-23T12:50:06.673
1,190
1,190
null