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
8,232
2
null
8,223
15
null
The connection pooling built-in to ADO.Net is robust and mature. I would recommend against attempting to write your own version.
null
CC BY-SA 2.5
null
2008-08-11T21:14:40.303
2008-08-11T21:14:40.303
null
null
729
null
8,230
2
null
8,213
5
null
Fabio, I've done what Vaibhav has done many times, and it's a good "quick and dirty" way to get data into a database. If you need to do this a few times, or on some type of schedule, then a more reliable way is to load the CSV data "as-is" into a work table (i.e customer_dataload) and then use standard SQL statements...
null
CC BY-SA 2.5
null
2008-08-11T21:14:21.897
2008-08-11T21:14:21.897
null
null
993
null
8,227
2
null
8,213
4
null
You could import the CSV file into a database table , then run an SQL query that does all the required transformations on the imported table and inserts the result into the target table. Assuming the CSV file is imported into `temp_table` with columns `n`, `city_name`: ``` insert into target_table select t.n, c.city_i...
null
CC BY-SA 4.0
null
2008-08-11T21:13:51.290
2022-05-11T19:46:06.870
2022-05-11T19:46:06.870
1,026
1,026
null
8,215
2
null
7,864
91
null
There's [ActiveRecord the Design Pattern](http://en.wikipedia.org/wiki/Active_record_pattern) and [ActiveRecord the Rails ORM Library](http://api.rubyonrails.com/classes/ActiveRecord/Base.html), and there's also a ton of knock-offs for .NET, and other languages. These are all different things. They mostly follow that ...
null
CC BY-SA 2.5
null
2008-08-11T21:02:03.870
2008-08-11T21:11:09.767
2008-08-11T21:11:09.767
234
234
null
8,233
2
null
7,864
1
null
@BlaM: Sometimes I justed implemented an active record for a result of a join. Doesn't always have to be the relation Table <--> Active Record. Why not "Result of a Join statement" <--> Active Record ?
null
CC BY-SA 2.5
null
2008-08-11T21:14:48.870
2008-08-11T21:14:48.870
null
null
925
null
8,235
2
null
8,223
3
null
I'm no expert on this matter, but I know ADO.NET has its own connection pooling system, and as long as I've been using it it's been faultless. My reaction would be that there's no point in reinventing the wheel... Just make sure you close your connections when you're finished with them and everything will be fine! I...
null
CC BY-SA 2.5
null
2008-08-11T21:16:24.577
2009-02-16T13:43:50.140
2009-02-16T13:43:50.140
4,200
475
null
8,236
1
8,384
null
162
150,743
How can I figure out the size of a file, in bytes? ``` #include <stdio.h> unsigned int fsize(char* file){ //what goes here? } ```
How do you determine the size of a file in C?
CC BY-SA 2.5
0
2008-08-11T21:16:30.147
2023-01-07T01:51:42.943
2011-04-05T00:08:32.067
527,702
432
[ "c", "file", "io", "filesize" ]
8,241
2
null
8,236
4
null
If you're fine with using the std c library: ``` #include <sys/stat.h> off_t fsize(char *file) { struct stat filestat; if (stat(file, &filestat) == 0) { return filestat.st_size; } return 0; } ```
null
CC BY-SA 3.0
null
2008-08-11T21:21:42.850
2016-10-01T12:26:46.787
2016-10-01T12:26:46.787
3,185,819
457
null
8,240
2
null
8,214
-1
null
I have not yet developed using WPF.. But I would assume that its the same as most other applications in that you want to keep the UI code as light as possible.. A number of design patterns may be used in this such as the obvious [MVC](http://en.wikipedia.org/wiki/Model-view-controller) and [Façade](http://en.wikipedia....
null
CC BY-SA 2.5
null
2008-08-11T21:21:31.977
2008-08-11T21:21:31.977
null
null
832
null
8,244
2
null
8,236
-3
null
You can open the file, go to 0 offset relative from the bottom of the file with ``` #define SEEKBOTTOM 2 fseek(handle, 0, SEEKBOTTOM) ``` the value returned from fseek is the size of the file. I didn't code in C for a long time, but I think it should work.
null
CC BY-SA 2.5
null
2008-08-11T21:23:59.787
2008-08-11T21:23:59.787
null
null
394
null
8,249
2
null
8,236
15
null
**Don't do this ([why?](https://www.securecoding.cert.org/confluence/display/c/FIO19-C.+Do+not+use+fseek%28%29+and+ftell%28%29+to+compute+the+size+of+a+regular+file)): > Quoting the C99 standard doc that i found online: "Setting the file position indicator to end-of-file, as with `fseek(file, 0, SEEK_END)`, has unde...
null
CC BY-SA 4.0
null
2008-08-11T21:28:05.737
2019-08-06T16:14:00.897
2019-08-06T16:14:00.897
7,508,077
432
null
8,250
2
null
8,236
3
null
I found [a method using fseek and ftell](http://computerprogramming.suite101.com/article.cfm/writing_a_file_size_function) and a thread with this question with answers that it can't be done in just C in another way. You could use a portability library like [NSPR](https://web.archive.org/web/20131023234554/https://devel...
null
CC BY-SA 4.0
null
2008-08-11T21:30:08.353
2021-01-09T17:20:34.550
2021-01-09T17:20:34.550
10,607,772
1,026
null
8,247
2
null
8,236
34
null
Matt's solution should work, except that it's C++ instead of C, and the initial tell shouldn't be necessary. ``` unsigned long fsize(char* file) { FILE * f = fopen(file, "r"); fseek(f, 0, SEEK_END); unsigned long len = (unsigned long)ftell(f); fclose(f); return len; } ``` Fixed your brace for you...
null
CC BY-SA 3.0
null
2008-08-11T21:26:15.493
2012-04-18T04:19:28.923
2012-04-18T04:19:28.923
872
872
null
8,264
2
null
8,263
1
null
++ (or Debug\Exceptions) From there you can select which exceptions break.
null
CC BY-SA 3.0
null
2008-08-11T21:53:57.713
2015-04-21T15:43:21.780
2015-04-21T15:43:21.780
3,906,965
905
null
8,272
2
null
7,990
4
null
Printing from a service is a bad idea. Network printers are connected "per-user". You can mark the service to be run as a particular user, but I'd consider that a bad security practice. You might be able to connect to a local printer, but I'd still hesitate before going this route. The best option is to have the servi...
null
CC BY-SA 2.5
null
2008-08-11T22:08:57.963
2008-08-11T22:08:57.963
null
null
645
null
8,274
2
null
8,219
1
null
Our build people use Mozilla Tinderbox. It seems to have some hooks for distributed testing. I'm sorry not to know the details but I thought I would at least pass on the pointer to you. It's also nice coz you can find out immediately when a build breaks, and what checkin might have been the culprit. [http://www.moz...
null
CC BY-SA 2.5
null
2008-08-11T22:09:16.827
2008-08-11T22:09:16.827
null
null
116
null
8,287
2
null
8,284
0
null
I can't imagine drawing icons online. Nowadays icons are usually as vectors, and I'm not aware of any online vector packages. In case you decide to draw off-line instead, I use Xara (www.xara.com) to draw all my computer artwork, and I use Gif Movie Gear to create .ico files. The former is a superb vector package,...
null
CC BY-SA 2.5
null
2008-08-11T22:25:28.493
2008-08-11T22:25:28.493
null
null
987
null
8,276
1
8,310
null
13
2,138
I have inherited an old crusty `PHP application`, and I'd like to refactor it into something a little nicer to deal with, but in a gradual manner. In perl's CPAN, there is a series of classes around Class::DBI that allow you to use database rows as the basis for objects in your code, with the library generating `access...
Class::DBI-like library for php?
CC BY-SA 3.0
null
2008-08-11T22:12:04.527
2015-12-14T06:03:08.213
2015-12-14T06:03:08.213
4,169,569
923
[ "php", "perl", "orm" ]
8,284
1
8,299
null
12
2,595
I'm looking for an online solution for generating .ICO files. I'd like the ICO files to have the ability to have transparency as well. What software or web site do you use to create them? [Update] To clarify, I have an existing image in PNG format, 32 x 32 pixels. I want to generate the icon from this existing fil...
Generating Icon Files
CC BY-SA 2.5
0
2008-08-11T22:20:04.697
2015-09-19T14:24:00.897
2008-08-31T00:30:58.663
305
519
[ "icons", "favicon" ]
8,280
2
null
8,228
0
null
davex.dll is the legacy webdav component for Exchange server, which Entourage uses. Your first step should be investigating why the application pool crashes. My guess is that Entourage can't do anything when the dll isn't present because webdav is not responding to any requests.
null
CC BY-SA 2.5
null
2008-08-11T22:14:01.683
2008-08-11T22:14:01.683
null
null
507
null
8,288
2
null
8,284
0
null
I use a simple program called MyViewPad, which can convert (almost) any old image to a .ico file. It's free and easy to use. This may not be what you are looking for though.
null
CC BY-SA 2.5
null
2008-08-11T22:26:09.693
2008-08-11T22:26:09.693
null
null
1,053
null
8,286
2
null
7,913
1
null
Seconding @[Matt Miller](https://stackoverflow.com/questions/7913/how-do-i-make-subversion-svn-send-email-on-checkins#7986) on RSS feeds. There's a useful tool called [WebSVN](http://websvn.tigris.org/) that offers RSS feeds of every repository and individual branches/tags/folders with full commit messages. It's also...
null
CC BY-SA 2.5
null
2008-08-11T22:22:55.767
2008-08-11T22:22:55.767
2017-05-23T12:18:28.387
-1
512
null
8,273
2
null
8,236
80
null
Don't use `int`. Files over 2 gigabytes in size are common as dirt these days Don't use `unsigned int`. Files over 4 gigabytes in size are common as some slightly-less-common dirt IIRC the standard library defines `off_t` as an unsigned 64 bit integer, which is what everyone should be using. We can redefine that to b...
null
CC BY-SA 2.5
null
2008-08-11T22:09:03.907
2008-08-11T22:14:19.497
2008-08-11T22:14:19.497
234
234
null
8,228
1
8,900
null
4
1,441
So this is IT more than programming but Google found nothing, and you guys are just the right kind of geniuses. Right now the big issue is that the entourage client will not connect to Exchange 2007 ( Entourage 2004 or 2008) The account settings are correct and use the proper format of `https://exchange2007.mydo...
Why won't Entourage work with Exchange 2007?
CC BY-SA 2.5
null
2008-08-11T21:13:59.340
2008-12-03T02:35:44.620
2008-12-03T02:35:44.620
5,314
703
[ "email", "dll", "exchange-server", "entourage" ]
8,263
1
8,347
null
4
2,803
I'm using Visual C++ 2003 to debug a program remotely via TCP/IP. I had set the Win32 exception c00000005, "Access violation," to break into the debugger when thrown. Then, I set it back to "Use parent setting." The setting for the parent, Win32 Exceptions, is to continue when the exception is thrown. Now, when I deb...
I can't get my debugger to stop breaking on first-chance exceptions
CC BY-SA 3.0
0
2008-08-11T21:51:06.813
2018-03-13T17:28:22.313
2018-03-13T17:28:22.313
560,648
179
[ "c++", "visual-studio", "debugging", "visual-studio-2003", "first-chance-exception" ]
8,289
2
null
8,147
5
null
Try this: ``` <%= Html.CheckBox("myCheckbox", "Click here", "True", false, new {_id ="test" })%> ``` For any keyword you can use an underscore before the name of the attribute. Instead of class you use _class. Since class is a keyword in C#, and also the name of the attribute in HTML. Now, "id" isn't a keyword i...
null
CC BY-SA 2.5
null
2008-08-11T22:26:29.177
2008-08-11T23:21:39.423
2008-08-11T23:21:39.423
571
571
null
8,291
2
null
8,284
0
null
Otto, if you could clarify what it is that you need this for, and we are more likely to have good suggestions. Provide a use-case, and someone will probably have some advice to fit it.
null
CC BY-SA 2.5
null
2008-08-11T22:27:38.690
2008-08-11T22:27:38.690
null
null
872
null
8,299
2
null
8,284
12
null
I have found the application [IcoFx](http://icofx.ro/) useful, you can import pretty much any image type to use for icon creation, including PNG's.
null
CC BY-SA 2.5
null
2008-08-11T22:33:41.613
2008-08-11T22:33:41.613
null
null
788
null
8,298
2
null
8,284
0
null
Is this something that needs to be done often and automatically, or is this just a one time thing for your app? If the latter is correct, MyViewPad will work.
null
CC BY-SA 2.5
null
2008-08-11T22:33:25.497
2008-08-11T22:33:25.497
null
null
1,053
null
8,294
2
null
8,284
1
null
I like [MicroAngelo](http://www.microangelo.us/).
null
CC BY-SA 2.5
null
2008-08-11T22:31:21.523
2008-08-11T22:31:21.523
null
null
369
null
8,300
2
null
8,284
3
null
I stumbled upon Icon Sushi a little while back and love it. It hasn't been updated in about a year, but it still works great, even in Vista. Plus it is free. [http://www.towofu.net/soft/e-aicon.php](http://www.towofu.net/soft/e-aicon.php)
null
CC BY-SA 2.5
null
2008-08-11T22:35:03.293
2008-08-11T22:35:03.293
null
null
71
null
8,304
2
null
8,263
5
null
Is this an exception that your code would actually handle if you weren't running in the debugger?
null
CC BY-SA 2.5
null
2008-08-11T22:36:58.470
2008-08-11T22:36:58.470
null
null
987
null
8,306
1
8,315
null
4
3,358
What is the best way to create redundant subversion repositories? I have a subversion repository (linked through apache2 and WebDAV) and would like to create a mirror repository on a different server in the event of outages, but I am not certain of the best way to proceed. I am thinking that post-commit scripts could...
Creating Redundancy for a Subversion Repository?
CC BY-SA 2.5
null
2008-08-11T22:37:47.983
2014-02-25T18:59:34.553
2008-09-10T05:13:43.047
-1
277
[ "svn", "repository", "redundancy" ]
8,301
2
null
8,284
1
null
I also use Gif Movie Gear to create `.ico` files. This online [Favicon Generator](http://tools.dynamicdrive.com/favicon/) tool also seems to work fine.
null
CC BY-SA 2.5
null
2008-08-11T22:35:05.913
2008-08-11T22:35:05.913
null
null
810
null
8,307
2
null
2,931
6
null
The `META-INF.services` stuff is known by its class name in the API: [ServiceLoader](http://java.sun.com/javase/6/docs/api/java/util/ServiceLoader.html). A Google search for [ServiceLoader](http://www.google.ca/search?hl=en&q=ServiceLoader) yields some information. I am not really familiar with it, but sometimes it's ...
null
CC BY-SA 3.0
null
2008-08-11T22:38:05.567
2017-09-01T23:52:23.993
2017-09-01T23:52:23.993
4,695,271
1,054
null
8,309
2
null
2,898
1
null
I agree with Mike, though I'm a Vim die-hard. I've been using GEdit quite frequently lately when I'm doing lightweight Ruby scripting. The standard editor (plus Ruby code snippets) is extremely usable and polished, and can provide a nice reprieve from full-strength, always-on programming editors.
null
CC BY-SA 2.5
null
2008-08-11T22:40:00.897
2008-08-11T22:40:00.897
null
null
null
null
8,320
2
null
742
2
null
Unless you want to do something a little complex, using the generic views are the way to go. They are far more powerful than their name implies, and if you are just displaying model data generic views will do the job.
null
CC BY-SA 2.5
null
2008-08-11T22:59:42.277
2008-08-11T22:59:42.277
null
null
1,057
null
8,315
2
null
8,306
4
null
Sounds like what you are looking for is basically federated (synced) servers... I asked the same question recently...and while I didn't find the exact solution I was looking for it came close. [See here:](https://stackoverflow.com/questions/1790/federated-synced-subversion-servers)
null
CC BY-SA 3.0
null
2008-08-11T22:49:02.610
2013-01-23T06:30:50.817
2017-05-23T12:24:34.877
-1
194
null
8,295
2
null
7,913
1
null
As someone else said, 'what platform'. On Windows I've used 'blat', which is a freebie command line SMTP mailer to do this, along with a post-commit and another batch file. The post commit looks like this: (Just calls another batch file) ``` call d:\subversion\repos\rts\hooks\mail %1 %2 ``` And mail.bat looked l...
null
CC BY-SA 2.5
null
2008-08-11T22:31:32.193
2008-08-11T22:31:32.193
null
null
987
null
8,314
2
null
8,306
2
null
Do you really need per-commit back-ups? There are almost certainly better ways of safe-guarding against failures than going down that route. For example, given that most failures are disk failures, move to a RAID array and/or NAS/SAN storage will provide you with better general protection and, if configured correctly, ...
null
CC BY-SA 2.5
null
2008-08-11T22:49:00.647
2008-08-11T22:49:00.647
null
null
1,035
null
8,311
2
null
8,284
1
null
My favorite method is a photoshop plugin to "Save as .ICO". [http://www.telegraphics.com.au/svn/icoformat/trunk/dist/README.html](http://www.telegraphics.com.au/svn/icoformat/trunk/dist/README.html) Fast, works offline, you're already in Photoshop, etc.
null
CC BY-SA 2.5
null
2008-08-11T22:40:16.730
2008-08-11T23:38:31.810
2008-08-11T23:38:31.810
109
109
null
8,324
2
null
7,694
4
null
@Dan, > Do I not need msdtc enabled for transactions to work? Only distributed transactions - Those that involve more than a single connection. Make doubly sure you are only opening a single connection within the transaction and it won't escalate - Performance will be much better too.
null
CC BY-SA 2.5
null
2008-08-11T23:02:13.597
2008-08-11T23:02:13.597
null
null
608
null
8,318
1
8,322
null
11
10,399
I need to prevent [Session Fixation](http://www.owasp.org/index.php/Session_Fixation), a particular type of session hijacking, in a Java web application running in JBoss. However, it appears that the standard idiom [doesn't work in JBoss](http://www.owasp.org/index.php/Session_Fixation_in_Java). Can this be worked arou...
Resolving Session Fixation in JBoss
CC BY-SA 2.5
0
2008-08-11T22:53:50.883
2018-08-01T16:04:52.207
null
null
1,054
[ "java", "security", "jboss" ]
8,325
2
null
8,214
2
null
You could consider [log4net](http://logging.apache.org/log4net). It is a robust logging framework that exists in a single DLL. It is also done in a "non demanding" type mode so that if a critical process is going on, it won't log until resources are freed up a bit more. You could easily setup a bunch of INFO level log...
null
CC BY-SA 2.5
null
2008-08-11T23:02:48.060
2008-08-11T23:02:48.060
null
null
71
null
8,310
2
null
8,276
4
null
It's now defunct but [phpdbi](http://phpdbi.sourceforge.net/web/) is possibly worth a look. If you're willing to let go of some of your caveats (the framework one), I've found that [Doctrine](http://www.phpdoctrine.org/) is a pretty neat way of accessing DBs in PHP. Worth investigating anyway.
null
CC BY-SA 2.5
null
2008-08-11T22:40:02.893
2008-08-11T22:40:02.893
null
null
1,035
null
8,335
2
null
7,596
0
null
One thing I've done in the past - if I'm extending a class I'll try and follow their conventions. For example, when working with the Spring Framework, I'll have my MVC Controller classes in a package called com.mydomain.myapp.web.servlet.mvc If I'm not extending something I just go with what is simplest. com.mydomain.d...
null
CC BY-SA 2.5
null
2008-08-11T23:25:44.503
2008-08-11T23:25:44.503
null
null
543
null
8,332
2
null
766
6
null
You could try setting up your own python installation using [Virtual Python](http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python). Check out how to setup Django using it [here](http://forums.site5.com/showthread.php?t=10236). That was written a long time ago, but it shows how I got MySQLdb s...
null
CC BY-SA 2.5
null
2008-08-11T23:16:33.757
2008-08-11T23:16:33.757
null
null
1,057
null
8,344
2
null
3,408
3
null
There probably isn't a definitive "right" answer - it's going to depend on how you like to develop. However, it's interesting to note that most of the "name" Rails folk seem to use Textmate on their Macs. So a fairly powerful editor rather than an IDE. I suspect this is at least in part because of the fairly strong TD...
null
CC BY-SA 2.5
null
2008-08-11T23:44:20.423
2008-08-11T23:44:20.423
null
null
1,060
null
8,327
2
null
7,873
3
null
I may have misunderstood your question but.... The 'grey bar telling you what type of control it is' only shows up if you are looking at the page in 'design view' in your IDE (are you using Visual Studio?). Once you run the page this label is not visible. It is very common for pages that have dynamic/server-si...
null
CC BY-SA 2.5
null
2008-08-11T23:03:23.970
2008-08-11T23:10:28.183
2008-08-11T23:10:28.183
242
242
null
8,322
2
null
8,318
9
null
[This defect](https://jira.jboss.org/jira/browse/JBAS-4436) (found [here](http://forum.springframework.org/showthread.php?t=54688)) points the way to the solution. The Tomcat instance that runs in JBoss is configured with emptySessionPath="true", rather than "false", which is the default. This can be modified in `.../d...
null
CC BY-SA 4.0
null
2008-08-11T23:00:58.467
2018-08-01T16:04:28.027
2018-08-01T16:04:28.027
1,018,611
1,054
null
8,330
2
null
3,150
1
null
I've used [CppUnit](http://cppunit.sourceforge.net/cppunit-wiki) with VS2005 and Eclipse. The wiki is very thorough (especially if you are familiar with JUnit).
null
CC BY-SA 2.5
null
2008-08-11T23:13:28.770
2008-08-11T23:13:28.770
null
null
1,059
null
8,347
2
null
8,263
5
null
I'd like to support [Will Dean's answer](https://stackoverflow.com/questions/8263/i-cant-get-my-debugger-to-stop-breaking-on-first-chance-exceptions#8304) An access violation sounds like an actual bug in your code. It's not something I'd expect the underlying C/++ Runtime to be throwing and catching internally. The '...
null
CC BY-SA 2.5
null
2008-08-11T23:48:33.927
2008-08-12T22:38:34.333
2017-05-23T12:01:17.740
-1
234
null
8,349
2
null
1,711
6
null
I've been arounda while, so most books that I have found influential don't necessarily apply today. I do believe it is universally important to understand the platform that you are developing for (both hardware and OS). I also think it's important to learn from other peoples mistakes. So two books I would recommend ...
null
CC BY-SA 2.5
null
2008-08-11T23:52:03.793
2008-08-11T23:52:03.793
null
null
791
null
8,338
2
null
8,276
0
null
The right thing to is to access the database via an abstraction layer in a way such if you change your RDBMS or how you implemented that access, you only have to modify this layer while all the rest of your application remains untouched. To do this, to free your application from knowing how to deal with the database,...
null
CC BY-SA 2.5
null
2008-08-11T23:34:10.243
2008-08-11T23:34:10.243
null
null
527
null
8,353
2
null
7,676
0
null
> I just confrim, Replicating between SqlServer 2005 and Compact Edition is something that can be done? Yes it can definately be done using either Merge Replication or Sync Services
null
CC BY-SA 2.5
null
2008-08-12T00:04:39.307
2008-08-12T00:04:39.307
null
null
493
null
8,352
2
null
8,348
-2
null
The latter is an acceptable solution. Although I would definitely catch on the specific exception (ElementNotFound?) that the collection throws in that case. Speedwise, it depends on the common case. If you're more likely to find the element than not, the exception solution will be faster. If you're more likely to fai...
null
CC BY-SA 2.5
null
2008-08-12T00:03:04.957
2008-08-12T00:03:04.957
null
null
429
null
8,350
2
null
8,348
0
null
If, while writing your code, you expect this object to be in the collection, and then during runtime you find that it isn't, I would call that an exceptional case, and it is proper to use an exception. However, if you're simply testing for the existence of an object, and you find that it is not there, this is not exce...
null
CC BY-SA 2.5
null
2008-08-12T00:01:59.110
2008-08-12T00:01:59.110
null
null
55
null
8,357
2
null
8,351
13
null
You can try [Firebug Lite](http://getfirebug.com/lite.html) or use Visual Studio to debug the JavaScript.
null
CC BY-SA 2.5
null
2008-08-12T00:07:37.070
2008-08-12T00:07:37.070
null
null
571
null
8,348
1
8,366
null
8
1,137
Imagine an object you are working with has a collection of other objects associated with it, for example, the Controls collection on a WinForm. You want to check for a certain object in the collection, but the collection doesn't have a `Contains()` method. There are several ways of dealing with this. - `Contains()`-...
Using unhandled exceptions instead of Contains()?
CC BY-SA 4.0
0
2008-08-11T23:49:32.503
2019-01-20T13:52:23.783
2019-01-20T13:52:23.783
567,854
940
[ "c#", ".net", "error-handling" ]
8,351
1
8,360
null
44
44,716
I'm trying to fix some JavaScript bugs. Firebug makes debugging these issues a lot easier when working in Firefox, but what do you do when the code works fine on Firefox but IE is complaining?
Is there something like "Firebug for IE" (for debugging JavaScript)?
CC BY-SA 3.0
0
2008-08-12T00:02:42.417
2020-06-07T05:23:35.480
2020-06-07T05:23:35.480
9,461,440
680
[ "javascript", "debugging", "internet-explorer", "firebug", "javascript-debugger" ]
8,358
2
null
8,351
5
null
Or [IE Developer Toolbar](http://www.microsoft.com/download/en/details.aspx?id=18359)
null
CC BY-SA 3.0
null
2008-08-12T00:09:26.583
2011-11-29T18:17:16.723
2011-11-29T18:17:16.723
95
364
null
8,360
2
null
8,351
23
null
you can also check out the [IE Developer Toolbar](http://www.microsoft.com/downloads/en/details.aspx?FamilyID=95e06cbe-4940-4218-b75d-b8856fced535) which isn't a debugger but will help you analyze the contents of your code. [Visual Studio](http://weblogs.asp.net/scottgu/archive/2007/07/19/vs-2008-javascript-debugging....
null
CC BY-SA 3.0
null
2008-08-12T00:11:03.303
2011-04-27T21:12:24.460
2011-04-27T21:12:24.460
48,523
493
null
8,356
2
null
8,348
0
null
I would have to think about it more as to how much I like it... my gut instinct is, eh, not so much... EDIT: Ryan Fox's comments on the exceptional case is perfect, I concur As for performance, it depends on the indexer on the collection. C# lets you override the indexer operator, so if it is doing a for loop like t...
null
CC BY-SA 2.5
null
2008-08-12T00:07:06.027
2008-08-12T00:07:06.027
null
null
122
null
8,359
2
null
8,348
0
null
In general, using exception handling for program flow and logic is bad practice. I personally feel that the latter option is unacceptable use of exceptions. Given the features of languages commonly used these days (such as Linq and lambdas in C# for example) there's no reason not to write your own Contains() method. A...
null
CC BY-SA 2.5
null
2008-08-12T00:10:19.297
2008-08-12T00:10:19.297
null
null
611
null
8,355
1
12,069
null
7
2,236
What is the best way to transparently rewrite a URL over an SSL connection with Apache 2.2? Apache 2 does not natively support multiple name-based virtual hosts for an SSL connection and I have heard that mod_rewrite can help with this. I would like to do something like this: I have set up the server so that the site...
Using mod_rewrite to Mimic SSL Virtual Hosts?
CC BY-SA 3.0
0
2008-08-12T00:06:36.073
2013-07-04T12:23:44.703
2013-07-04T12:23:44.703
1,584,286
277
[ "apache", "mod-rewrite", "https" ]
8,345
2
null
3,150
1
null
I'm not 100% sure about VS2008, but I know that the Unit Testing framework that microsoft shipped in VS2005 as part of their Team Suite was only for .NET, not C++ I've used CppUnit also and it was alright. Much the same as NUnit/JUnit/so on. If you've used boost, they [also have a unit testing library](http://www.boo...
null
CC BY-SA 2.5
null
2008-08-11T23:45:25.633
2008-08-11T23:45:25.633
null
null
234
null
8,362
2
null
8,236
4
null
And if you're building a Windows app, use the [GetFileSizeEx](http://msdn.microsoft.com/en-us/library/aa364957.aspx) API as CRT file I/O is messy, especially for determining file length, due to peculiarities in file representations on different systems ;)
null
CC BY-SA 2.5
null
2008-08-12T00:15:35.853
2008-08-12T00:15:35.853
null
null
null
null
8,364
2
null
8,351
4
null
Have a look at [DebugBar](http://www.debugbar.com/). License is free for personal use
null
CC BY-SA 2.5
null
2008-08-12T00:21:52.300
2008-08-14T12:22:41.870
2008-08-14T12:22:41.870
202
202
null
8,368
2
null
8,348
4
null
The general rule of thumb is to avoid using exceptions for control flow unless the circumstances that will trigger the exception are "exceptional" -- e.g., extremely rare! If this is something that will happen normally and regularly it definitely should not be handled as an exception. Exceptions are very, very slow d...
null
CC BY-SA 2.5
null
2008-08-12T00:30:43.390
2008-08-12T00:30:43.390
null
null
1
null
8,363
2
null
8,021
19
null
You'll probably want to set the user's shell to [the restricted shell](http://www.gnu.org/software/bash/manual/html_node/The-Restricted-Shell.html). Unset the PATH variable in the user's ~/.bashrc or ~/.bash_profile, and they won't be able to execute any commands. Later on, if you decide you want to allow the user(s) ...
null
CC BY-SA 2.5
null
2008-08-12T00:16:38.020
2008-08-12T00:16:38.020
null
null
737
null
8,379
2
null
8,351
0
null
The IE8 beta comes with what I think is the IE Developer toolbar, but it seems to be a lot more powerful than the last time I tried the toolbar on IE7
null
CC BY-SA 2.5
null
2008-08-12T00:43:37.980
2008-08-12T00:43:37.980
null
null
234
null
8,380
2
null
8,371
138
null
This has not been tested but I think this should work using mod_rewrite ``` RewriteEngine On RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} ```
null
CC BY-SA 3.0
null
2008-08-12T00:48:49.577
2011-07-04T14:58:29.457
2011-07-04T14:58:29.457
14,731
796
null
8,373
2
null
8,284
1
null
[png2ico](http://winterdrache.de/freeware/png2ico/) is what I've always used, and perfect for your situation.
null
CC BY-SA 2.5
null
2008-08-12T00:36:53.470
2008-08-12T00:36:53.470
null
null
619
null
8,366
2
null
8,348
3
null
I would have to say that this is pretty bad practice. Whilst some people might be happy to say that looping through the collection is less efficient to throwing an exception, there is an overhead to throwing an exception. I would also question why you are using a collection to access an item by key when you would be be...
null
CC BY-SA 2.5
null
2008-08-12T00:26:37.577
2008-08-12T01:13:20.883
2008-08-12T01:13:20.883
493
493
null
8,371
1
8,380
null
184
470,375
How do you redirect HTTPS to HTTP?. That is, the opposite of what (seemingly) everyone teaches. I have a server on HTTPS for which I paid an SSL certification for and a mirror for which I haven't and keep around for just for emergencies so it doesn't merit getting a certification for. On my client's desktops I have S...
How do you redirect HTTPS to HTTP?
CC BY-SA 3.0
0
2008-08-12T00:36:32.223
2021-02-18T06:29:42.707
2012-09-03T06:53:00.833
1,205,763
547
[ "apache", "ssl", "redirect", "https" ]
8,365
1
23,804
null
6
7,951
In Mysql Administrator, when doing backups, what exactly is "Compatibility Mode"? I'm trying to bridge backups generated by [webmin](http://www.webmin.com/) with the upload tool available inside [mysql administrator](http://www.mysql.com/products/tools/administrator/). My data already has a couple of inconsistencies ...
MySQL Administrator Backups: "Compatibility Mode", What Exactly is this doing?
CC BY-SA 3.0
null
2008-08-12T00:21:58.790
2012-08-11T16:12:21.410
2012-08-11T16:12:13.360
1,477,076
547
[ "mysql", "backup" ]
8,381
2
null
3,408
2
null
Seconded for e-texteditor. I use it daily and it's great (although not without it's share of BUGS). For the rails side of things though, I'd actually suggest a virtual machine running linux. Ubuntu works well, the only caveat is that you have to install `rubygems` manually, as it does not adhere to the great debian fi...
null
CC BY-SA 2.5
null
2008-08-12T00:50:26.827
2008-08-12T00:53:52.873
2008-08-12T00:53:52.873
234
234
null
8,399
2
null
8,398
0
null
In Internet Explorer, select -> -> . That should do it.
null
CC BY-SA 3.0
null
2008-08-12T01:23:36.417
2012-07-18T03:32:28.507
2012-07-18T03:32:28.507
63,550
233
null
8,389
2
null
8,355
0
null
There is apaches mod_rewrite, or you could setup apache to direct [https://dbadmin.example.com](https://dbadmin.example.com) to path/to/example.com/dbadmin on the server ``` <VirtualHost *> ServerName subdomain.domain.com DocumentRoot /home/httpd/htdocs/subdomain/ </VirtualHost> ```
null
CC BY-SA 2.5
null
2008-08-12T01:12:14.740
2008-08-12T01:12:14.740
null
null
115
null
8,405
2
null
8,351
6
null
Firebug lite doesn't work too well for me. The Developer Toolbar just isn't good enough. There really is no great solution.
null
CC BY-SA 2.5
null
2008-08-12T01:47:40.923
2008-08-12T01:47:40.923
null
null
106
null
8,398
1
8,433
null
17
10,870
I just saw this mentioned in Stack Overflow question [Best WYSIWYG CSS editor](http://web.archive.org/web/20090503103538/http://stackoverflow.com:80/questions/7975/best-css-editor) and didn't know it could be done. I'm a Visual Studio newbie, so how do you do it? Is there a separate debugger for JavaScript? I know how ...
How do I debug JavaScript in Visual Studio 2005?
CC BY-SA 4.0
0
2008-08-12T01:22:38.197
2020-06-25T14:09:55.607
2020-06-25T14:09:55.607
9,780,149
396
[ "javascript", "visual-studio", "visual-studio-2005", "debugging" ]
8,400
2
null
7,596
0
null
I like break my classes down into packages that are related to each other. For example: For database related calls Classes that deal with what you see Core functionality classes Any misc. classes that are used (typically static functions) etc.
null
CC BY-SA 2.5
null
2008-08-12T01:28:23.287
2008-08-12T01:28:23.287
null
null
396
null
8,414
2
null
8,355
2
null
Unless your SSL certificate is the "wildcard" or multi-site kind, then I don't think this will work. The rewrite will display in the browser and the name in the address bar must be valid against the certificate, or your users will see a security error (which they can always accept and continue, but that doesn't sound ...
null
CC BY-SA 2.5
null
2008-08-12T02:10:56.480
2008-08-12T02:10:56.480
null
null
809
null
8,401
2
null
8,398
2
null
TechRepublic has a good walk through - see [Visual Studio 2008 simplifies JavaScript debugging](https://web.archive.org/web/1/http://blogs.techrepublic%2ecom%2ecom/programming-and-development/?p=672).
null
CC BY-SA 3.0
null
2008-08-12T01:28:30.200
2012-11-01T20:07:43.710
2015-08-20T04:40:52.617
-1
202
null
8,413
2
null
8,398
2
null
Visual Studio 2008 ASP.NET projects has debugging enabled by default. You can set breakpoints within your .js file while the website/web app project is run in the ASP.NET debug server.
null
CC BY-SA 2.5
null
2008-08-12T02:09:13.940
2008-08-12T02:09:13.940
null
null
372
null
8,422
1
402,856
null
6
8,388
I have some reports in SQL Server Reporting Services 2005 that I need to keep audit logs for. The audit log should include who ran what report with what parameters. I can't use Windows authentication. What is the best way to log this information?
How do you handle audit logging with SSRS?
CC BY-SA 2.5
0
2008-08-12T02:39:06.437
2016-03-13T06:17:02.797
2016-03-13T06:17:02.797
4,211,866
571
[ "sql-server", "sql-server-2005", "reporting-services", "reportingservices-2005" ]
8,384
2
null
8,236
171
null
On Unix-like systems, you can use POSIX system calls: [stat on a path](https://en.wikipedia.org/wiki/Stat_(system_call)), or `fstat` on an already-open file descriptor (POSIX [man page](https://man7.org/linux/man-pages/man3/fstat.3p.html), Linux [man page](https://man7.org/linux/man-pages/man2/lstat.2.html)). (Get a fi...
null
CC BY-SA 4.0
null
2008-08-12T00:55:48.313
2021-11-25T02:45:16.093
2021-11-25T02:45:16.093
224,132
954
null
8,425
2
null
8,422
1
null
From memory SSRS has [built in logging](http://msdn.microsoft.com/en-us/library/ms159110.aspx) for this exact situation
null
CC BY-SA 2.5
null
2008-08-12T02:45:24.397
2008-08-12T02:45:24.397
null
null
493
null
8,417
2
null
8,213
5
null
I'd do this with [awk](http://www.grymoire.com/Unix/Awk.html). For example, if you had this information in a CSV file: ``` Bob,New York Jane,San Francisco Steven,Boston Marie,Los Angeles ``` The following command will give you what you want, run in the same directory as your CSV file (named `name-city.csv` in this ...
null
CC BY-SA 3.0
null
2008-08-12T02:25:36.200
2016-04-15T19:20:18.747
2016-04-15T19:20:18.747
809
809
null
8,421
2
null
6,430
-2
null
Aha, I was really just testing everyone once again! :) The real answer is, you rarely need to iterate the datagrid. Because even when binding to an ArrayList, the binding is 2 way. Still, it is handy to know how to itereate the grid directly, it can save a few lines of code now and then. But NotMyself and Orion ...
null
CC BY-SA 2.5
null
2008-08-12T02:37:15.893
2008-08-12T02:37:15.893
null
null
785
null
8,410
2
null
8,348
0
null
Exceptions should be exceptional. Something like 'The collection is missing because the database has fallen out from underneath it' is exceptional Something like 'the key is not present' is normal behaviour for a dictionary. For your specific example of a winforms Control collection, the `Controls` property has a `C...
null
CC BY-SA 2.5
null
2008-08-12T02:02:49.723
2008-08-12T02:02:49.723
null
null
234
null
8,431
2
null
6,378
2
null
I have to say that I don't use the hourly recurrence feature as really how many people have events that repeat in the same day? I could see if someone however was to schedule when they needed to take a particular medicine at recurring times throughout the day. I would say support full features in the application itsel...
null
CC BY-SA 2.5
null
2008-08-12T03:10:43.130
2008-08-12T03:10:43.130
null
null
657
null
8,427
2
null
8,422
2
null
Have a look at the ExecutionLog table in the ReportServer database. This contains information on who ran what report and with what parameters. I'm not sure how this is going to work without Windows authentication though, as it'll have no way of knowing who's running what report.
null
CC BY-SA 2.5
null
2008-08-12T02:47:23.597
2008-08-12T02:47:23.597
null
null
233
null
8,436
2
null
8,435
57
null
In Visual Studio, choose "File Open..." then "File...". Then pick the Shell32.dll. A folder tree should be opened, and you will find the icons in the "Icon" folder. To save an Icon, you can right-click on the icon in the folder tree and choose "Export".
null
CC BY-SA 3.0
null
2008-08-12T03:32:20.590
2016-02-06T13:42:13.020
2016-02-06T13:42:13.020
2,127,494
814
null
8,433
2
null
8,398
8
null
I prefer using [Firebug](http://en.wikipedia.org/wiki/Firebug_%28software%29) for projects I can't use [Visual Studio 2008](http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Visual_Studio_2008) on.
null
CC BY-SA 3.0
null
2008-08-12T03:12:49.317
2012-07-18T03:31:55.807
2012-07-18T03:31:55.807
63,550
225
null
8,446
2
null
8,439
0
null
Add a second (empty) table immediately after the first. Page break after that.
null
CC BY-SA 2.5
null
2008-08-12T04:04:44.610
2008-08-12T04:04:44.610
null
null
257
null
8,429
2
null
8,371
79
null
Keep in mind that the Rewrite engine only kicks in once the HTTP request has been received - which means you would still need a certificate, in order for the client to set up the connection to send the request over! However if the backup machine will appear to have the same hostname (as far as the client is concerned)...
null
CC BY-SA 2.5
null
2008-08-12T03:06:10.237
2008-08-12T03:06:10.237
null
null
588
null
8,443
1
null
null
6
1,399
Using Microsoft Visual Studio 98, Microsoft Visual C++ 6.0 SP6 When running under the debugger, there's only one problem. If I pause the program and resume, everything's fine. The problem? When I hit a breakpoint, my program stops. But not in a good way; execution halts, I'm thrown out of debug mode into edit mode...
MSVC6: Breakpoint stops program
CC BY-SA 3.0
null
2008-08-12T04:00:13.467
2017-04-15T17:53:51.233
2017-04-15T17:53:51.233
1,033,581
257
[ "c++", "windows", "debugging", "visual-c++", "visual-c++-6" ]
8,435
1
8,436
null
65
104,837
I'd like to get the Tree icon to use for a homegrown app. Does anyone know how to extract the images out as .icon files? I'd like both the 16x16 and 32x32, or I'd just do a screen capture.
How do you get the icons out of shell32.dll?
CC BY-SA 2.5
0
2008-08-12T03:26:38.557
2023-02-22T06:17:49.237
2023-02-22T05:58:58.180
15,339,544
733
[ "windows", "powershell", "icons" ]
8,438
2
null
7,596
2
null
I think keep it simple and don't over think it. Don't over abstract and layer too much. Just keep it neat, and as it grows, refactoring it is trivial. One of the best features of IDEs is refactoring, so why not make use of it and save you brain power for solving problems that are related to your app, rather then meta i...
null
CC BY-SA 2.5
null
2008-08-12T03:36:32.123
2008-08-12T03:36:32.123
null
null
699
null