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
33,190
2
null
33,055
19
null
I use [svnsync](http://svn.apache.org/repos/asf/subversion/trunk/notes/svnsync.txt), which sets up a remote server as a mirror/slave. We had a server go down two weeks ago, and I was able to switch the slave into primary position quite easily (only had to reset the UUID on the slave repository to the original). Anoth...
null
CC BY-SA 3.0
null
2008-08-28T19:33:27.940
2012-11-15T15:15:28.493
2012-11-15T15:15:28.493
2,314
2,314
null
33,213
2
null
33,199
1
null
This could work: ``` if (printf("Hello") - strlen("Hello")) printf("Hello") else printf("World") ``` This snippet emphasizes the return value of `printf`: The number of characters printed.
null
CC BY-SA 2.5
null
2008-08-28T19:43:03.643
2008-08-28T19:43:03.643
null
null
2,260
null
33,211
2
null
33,199
2
null
``` if (true) printf ("Hello"); if (false) printf ("Hello"); else printf("World"); ```
null
CC BY-SA 2.5
null
2008-08-28T19:41:58.810
2008-08-28T19:41:58.810
null
null
1,414
null
33,202
2
null
33,199
5
null
The `if` statement executes one or the other of the controlled statements (both `printf` in your example). No matter what you use for `condition`, that snippet will either print "Hello", or "World", but never both. Edit: Okay, so it's a trick question and you can put whatever you like in the condition (including a cal...
null
CC BY-SA 2.5
null
2008-08-28T19:39:32.420
2008-08-28T20:06:02.247
2008-08-28T20:06:02.247
893
893
null
33,208
2
null
33,199
85
null
``` if ( printf("Hello") == 0 ) printf ("Hello"); else printf ("World"); ``` :-)
null
CC BY-SA 2.5
null
2008-08-28T19:41:32.740
2008-08-28T19:41:32.740
null
null
863
null
33,181
2
null
32,851
13
null
Pros for MSMQ. - - - - - - - - Cons: - - - - Here is a good blog for [MSMQ](http://blogs.msdn.com/johnbreakwell/default.aspx)
null
CC BY-SA 2.5
null
2008-08-28T19:30:44.217
2008-08-28T19:30:44.217
null
null
1,834
null
33,214
2
null
33,079
0
null
Vitaly Friedman's Essential Bookmarks for web designers & web developers list a lot of online [color tools](http://www.alvit.de/web-dev/color-tools-mixers-palettes.html), also a [condensed version](http://www.alvit.de/handbook/#colortools) There is also a [list of color tools on twiki.org](http://twiki.org/cgi-bin/vie...
null
CC BY-SA 2.5
null
2008-08-28T19:43:05.703
2008-08-28T19:43:05.703
null
null
2,541
null
33,216
2
null
33,199
0
null
``` if (printf("Hello") < 1) printf("Hello"); else printf("World"); ```
null
CC BY-SA 2.5
null
2008-08-28T19:43:55.513
2008-08-28T19:43:55.513
null
null
3,447
null
33,204
1
33,246
null
5
3,010
Using Oracle 10g, accessed via Perl DBI, I have a table with a few tens of million rows being updated a few times per second while being read from much more frequently form another process. Soon the update frequency will increase by an order of magnitude (maybe two). Someone suggested that committing every N updates i...
When to commit changes?
CC BY-SA 4.0
null
2008-08-28T19:40:55.193
2018-06-06T08:00:53.243
2018-06-06T08:00:53.243
1,864,029
238
[ "sql", "oracle", "commit" ]
33,220
2
null
33,207
13
null
Check out [OCUnit](http://www.sente.ch/software/ocunit/). Apple's developer network has [a great introduction](http://developer.apple.com/tools/unittest.html).
null
CC BY-SA 2.5
null
2008-08-28T19:46:10.937
2008-08-28T19:46:10.937
null
null
2,836
null
33,219
2
null
33,199
6
null
``` #define CONDITION (0) if (0) {} else ``` or some such. If you see such a question on an interview, run away as fast as you can! The team that asks such questions is bound to be unhealthy. Edit - I forgot to clarify - this relies on "else" being matched with closest open "if", and on the fact that it's written a...
null
CC BY-SA 2.5
null
2008-08-28T19:45:53.260
2008-08-28T19:45:53.260
null
null
null
null
33,226
1
33,285
null
5
10,960
Assuming such a query exists, I would greatly appreciate the help. I'm trying to develop a permissions script that will grant "select" and "references" permissions on the user tables and views in a database. My hope is that executing the "grant" commands on each element in such a set will make it easier to keep permi...
In SQL Server 2000, is there a sysobjects query that will retrieve user views and not system views?
CC BY-SA 2.5
null
2008-08-28T19:48:49.527
2008-10-14T05:53:58.253
2008-10-14T05:53:58.267
1,786
3,475
[ "sql-server-2000", "sysobjects" ]
33,227
2
null
33,204
0
null
> Faster/Slower? It will probably be a little faster. However, you run a greater risk of running into deadlocks, losing uncommitted changes should something catastrophic happen (cleaning lady unplugs the server), FUD, Fire, Brimstone, etc. > Why would it help? Obviously fewer commit operations, which in turn mea...
null
CC BY-SA 2.5
null
2008-08-28T19:49:14.970
2011-03-15T21:58:32.663
2011-03-15T21:58:32.663
496,830
685
null
33,229
2
null
33,222
0
null
Actually, you can override the paint event. And the idea is that you offload long-running operations to a separate thread. That's no different from any other event-driven framework, really. that relies on a handling a Paint event is going to be susceptible to that. Also, there's no system that lets you determine w...
null
CC BY-SA 3.0
null
2008-08-28T19:49:57.463
2013-09-16T23:15:34.430
2013-09-16T23:15:34.430
3,043
3,043
null
33,231
2
null
33,223
0
null
As long as you use the Visual Studio designer, it's probably a pipe dream. I write all of my ASP.NET code (all markup, and CSS) by hand, simply to avoid the designer. Later versions of Visual Studio have gotten much better at not mangling your .aspx/.ascx files, but they're still far from perfect.
null
CC BY-SA 2.5
null
2008-08-28T19:50:10.193
2008-08-28T19:50:10.193
null
null
1,975,282
null
33,232
2
null
33,222
0
null
> a bit slow and you can't control the paint event so during processor intensive operations the UI might leave the user staring at a half rendered screen. It's generally a bad idea to do expensive tasks on the UI thread. To keep your UI responsive, these tasks should be performed by a [worker thread](http://msdn.micr...
null
CC BY-SA 2.5
null
2008-08-28T19:50:35.403
2008-08-28T19:50:35.403
null
null
2,773
null
33,233
1
33,247
null
1
309
Imagine you homebrew a custom gui framework that use windows handles (compact framework, so please don't argue with "whys"). One of the main disadvantages of developing such a framework is that you lose compatability with the winform designer. So my question is to all of you who know a lot about VS customisation, wou...
Integrating a custom gui framework with the VS designer
CC BY-SA 4.0
null
2008-08-28T19:51:37.617
2018-05-18T09:02:35.630
2018-05-18T09:02:35.630
886,001
1,143
[ "visual-studio", "gui-designer" ]
33,217
1
33,221
null
0
441
How can you implement trackbacks on a custom-coded blog (written in C#)?
How can you implement trackbacks on a custom-coded blog (written in C#)?
CC BY-SA 3.0
null
2008-08-28T19:45:03.543
2013-08-17T20:42:34.630
2012-06-29T08:03:04.683
918,414
337
[ "c#", "blogs", "trackback" ]
33,234
2
null
32,937
13
null
How about this? ``` public static class Extensions { public static bool In<T>(this T testValue, params T[] values) { return values.Contains(testValue); } } ``` Usage: ``` Personnel userId = Personnel.JohnDoe; if (userId.In(Personnel.JohnDoe, Personnel.JaneDoe)) { // Do something } ``` I c...
null
CC BY-SA 2.5
null
2008-08-28T19:51:51.407
2008-08-28T19:51:51.407
null
null
731
null
33,218
2
null
33,217
-4
null
If you're custom coding your own blog you have too much time on your hands. Start with something like [dasBlog](http://www.dasblog.info/) or [SubText](http://subtextproject.com/) and customize that to your needs. Then you get trackbacks for free.
null
CC BY-SA 2.5
null
2008-08-28T19:45:53.183
2008-08-28T19:45:53.183
null
null
3,043
null
33,235
2
null
33,174
3
null
Agree with Adam. Querying the Sharepoint Database is a big no-no, as Microsoft does not guarantee that the Schema is in any way stable. Only access the database if there is really no other way. As for Sharepoint, usually the Lists.asmx Web Service is what you want to look at first. [http://www.c-sharpcorner.com/UploadF...
null
CC BY-SA 4.0
null
2008-08-28T19:52:22.293
2022-07-24T14:03:25.573
2022-07-24T14:03:25.573
4,751,173
91
null
33,221
2
null
33,217
2
null
The TrackBack specification was created by Six Apart back in the day for their [Movable Type](http://www.movabletype.org/) blogging system. After some corporate changes it seems to be no longer available, but here's an archived version: [http://web.archive.org/web/20081228043036/http://www.sixapart.com/pronet/docs/tra...
null
CC BY-SA 3.0
null
2008-08-28T19:46:39.610
2013-08-17T20:42:34.630
2013-08-17T20:42:34.630
91
91
null
33,241
2
null
33,223
0
null
As DannySmurf said, hand building is the way to go. That said, you might look at Expression Web. At least it is pretty accurate in how it renders the pages.
null
CC BY-SA 2.5
null
2008-08-28T19:53:47.517
2008-08-28T19:53:47.517
null
null
2,424
null
33,242
1
null
null
125
58,845
Is there a method (other than trial and error) I can use to find unused image files? How about CSS declarations for ID's and Classes that don't even exist in the site? It seems like there might be a way to write a script that scans the site, profile it, and see which images and styles are never loaded.
How can I find unused images and CSS styles in a website?
CC BY-SA 4.0
0
2008-08-28T19:54:02.680
2022-02-10T14:37:46.457
2020-03-23T09:10:05.020
1,442,180
5
[ "html", "css" ]
33,243
2
null
33,223
13
null
The easiest way to generate elegant HTML and CSS is to use MVC framework, where you have much more control over HTML generation than with Web Forms.
null
CC BY-SA 2.5
null
2008-08-28T19:54:02.727
2008-08-28T19:54:02.727
null
null
9
null
33,244
2
null
33,113
0
null
Well, think of this from the point of view of the app designer. If you wrote an application, do you want users to be able to inject things into your application (more importantly, would you want to incur the support/revenue headache of clueless users doing this and then blaming you)? Each application's drag and drop in...
null
CC BY-SA 2.5
null
2008-08-28T19:54:49.230
2008-08-28T19:54:49.230
null
null
1,975,282
null
33,230
2
null
33,199
0
null
> Greg wrote:> No matter what you use for condition, that snippet will either print "Hello", or "World", but never both. Well, this isn't true, but why you would it to print both, I can't find a use case for. It's defeating the point of having an if statement. The likely "real" solution is to not use an if at all. Si...
null
CC BY-SA 2.5
null
2008-08-28T19:50:00.553
2008-08-28T19:50:00.553
null
null
3,423
null
33,223
1
33,243
null
9
812
I know Microsoft has made efforts in the direction of semantic and cross-browser compliant XHTML and CSS, but it still seems like a PitA to pull off elegant markup. I've downloaded and tweaked the CSS Friendly Adapters and all that. But I still find myself frustrated with bloated and unattractive code. Is elegant, sem...
Is elegant, semantic CSS with ASP.Net still a pipe dream?
CC BY-SA 2.5
0
2008-08-28T19:47:58.187
2008-09-18T06:54:24.750
2008-08-28T20:54:09.307
1,414
2,640
[ "asp.net", "css", "xhtml", "semantics" ]
33,246
2
null
33,204
4
null
A commit results in Oracle writing stuff to the disk - i.e. in the redo log file so that whatever the transaction being commited has done can be recoverable in the event of a power failure, etc. Writing in file is slower than writing in memory so a commit will be slower if performed for many operations in a row rather ...
null
CC BY-SA 2.5
null
2008-08-28T19:55:51.023
2008-08-28T19:55:51.023
2015-08-20T04:41:57.227
-1
2,811
null
33,240
2
null
33,223
0
null
A better question is: is it really worth it? I write web applications and rarely does the elegance of the resulting HTML/CSS/JavaScript add anything to the end goal. If your end goal is to have people do a "view source" on your stuff and admire it, then maybe this is important and worth all of the effort, but I doubt i...
null
CC BY-SA 2.5
null
2008-08-28T19:53:29.937
2008-08-28T19:53:29.937
null
null
1,790
null
33,247
2
null
33,233
1
null
I recently watched a video of these guys who [built a WoW AddOn designer for Visual Studio](http://channel9.msdn.com/posts/Dan/Gabor-Ratky-and-Attila-Kisko-AddOn-Studio-for-World-of-Warcraft/). They overcame the task of getting their completely custom controls to render correctly in the designer. I'm not sure if this...
null
CC BY-SA 2.5
null
2008-08-28T19:56:48.337
2008-08-28T19:56:48.337
null
null
2,773
null
33,250
1
39,091
null
4
5,351
In one of my applications, I am querying active directory to get a list of all users below a given user (using the "Direct Reports" thing). So basically, given the name of the person, it is looked up in AD, then the Direct Reports are read. But then for every direct report, the tool needs to check the direct reports of...
Caching Active Directory Data
CC BY-SA 2.5
0
2008-08-28T19:58:10.597
2011-07-20T05:40:53.963
2009-03-10T03:50:00.010
5,640
91
[ "c#", "asp.net", "active-directory" ]
33,249
2
null
33,144
0
null
Can't you use Visual Studio Express Editions for Mobile Development [http://www.microsoft.com/downloads/details.aspx?FamilyID=94DE806B-E1A1-4282-ABC5-1F7347782553&displaylang=en](http://www.microsoft.com/downloads/details.aspx?FamilyID=94DE806B-E1A1-4282-ABC5-1F7347782553&displaylang=en)
null
CC BY-SA 2.5
null
2008-08-28T19:57:30.020
2008-08-28T19:57:30.020
null
null
2,972
null
33,222
1
950,946
null
4
2,602
Winform on CF is a bit heavy, initialising a lot of windows handles takes serious time and memory. Another issue is the lack of inbuilt double buffering and lack of control you have over the UI rendering means that during processor intensive operations the UI might leave the user staring at a half rendered screen. Nice...
Compact Framework - Lightweight GUI Framework?
CC BY-SA 2.5
0
2008-08-28T19:47:24.710
2013-09-16T23:15:34.430
2008-09-24T15:26:50.327
12,870
1,143
[ "compact-framework", "gdi+", "windows-ce" ]
33,254
2
null
33,242
3
null
I seem to recall either Adobe Dreamweaver or Adobe Golive having a feature to find both orphaned styles and images; can't remember which now. Possibly both, but the features were well-hidden.
null
CC BY-SA 2.5
null
2008-08-28T19:59:11.153
2008-08-28T19:59:11.153
null
null
137
null
33,251
2
null
28,820
2
null
Once option that the devs over at xda-developers seem to enjoy is [Mortscript](http://www.sto-helit.de/index.php?module=page&entry=ms_overview&action=view) I have never bothered to use it, but I have used many cab installers that distribute mortscript so that they can do various tasks
null
CC BY-SA 2.5
null
2008-08-28T19:58:21.000
2008-08-28T19:58:21.000
null
null
3,494
null
33,238
2
null
32,621
0
null
According to [http://dev.live.com/virtualearth/sdk/](http://dev.live.com/virtualearth/sdk/) this should do the trick: ``` function GetInfo() { alert('The latitude,longitude at the center of the map is: '+map.GetCenter()); } ```
null
CC BY-SA 3.0
null
2008-08-28T19:52:37.583
2011-10-31T13:02:22.163
2011-10-31T13:02:22.163
496,830
2,972
null
33,236
2
null
33,207
317
null
Xcode includes XCTest, which is similar to [OCUnit](http://www.sente.ch/software/ocunit/), an Objective-C unit testing framework, and has full support for running XCTest-based unit tests as part of your project's build process. Xcode's unit testing support is described in the [Xcode Overview: Using Unit Tests](https:/...
null
CC BY-SA 3.0
null
2008-08-28T19:52:25.617
2016-07-15T07:40:01.863
2016-07-15T07:40:01.863
714
714
null
33,260
2
null
33,223
0
null
@JasonBunting - Yes, it's absolutely worth it. Semantic and cross-browser markup means that search engines have an easier (and thus higher rankings) time with your content, that browsers have an easier (and thus less error-prone) time parsing your content for display, and that future developers have an easier time mai...
null
CC BY-SA 2.5
null
2008-08-28T20:02:08.697
2008-08-28T20:02:08.697
null
null
1,902,010
null
33,212
2
null
33,199
21
null
``` "condition" === (printf("Hello"), 0) ``` Really lame: ``` int main() { if (printf("Hello"), 0) printf ("Hello"); else printf("World"); } ``` I prefer the use of the comma operator because you don't have to look up the return value of `printf` in order to know what the conditional does....
null
CC BY-SA 2.5
null
2008-08-28T19:42:40.180
2008-08-28T20:06:36.987
2008-08-28T20:06:36.987
338
338
null
33,256
2
null
32,986
27
null
Using the new `for (... in ...)` syntax in Objective-C 2.0 is generally the fastest way to iterate over a collection because it can maintain a buffer on the stack and get batches of items into it. Using `NSEnumerator` is generally the slowest way because it often copies the collection being iterated; for immutable col...
null
CC BY-SA 2.5
null
2008-08-28T19:59:48.500
2008-08-28T19:59:48.500
null
null
714
null
33,266
2
null
33,226
0
null
``` select * from information_schema.tables where table_type = 'view' ```
null
CC BY-SA 2.5
null
2008-08-28T20:06:37.300
2008-08-28T20:06:37.300
null
null
777
null
33,267
2
null
33,144
1
null
I looked into more affordable ways to do back in the VS 2003 days, but couldn't find anything. My guess is that you still need VS to do it. @MartinHN You CAN NOT use version older than 2005 or less then Pro for Windows Mobile 5/6 device development.
null
CC BY-SA 2.5
null
2008-08-28T20:06:44.630
2008-08-28T20:06:44.630
null
null
100
null
33,252
1
34,465
null
1
1,869
As a temporary stopgap until all the designers are in place we are currently hand-cranking a whole bunch of xml configuration files at work. One of the issues with this is file-versioning because people forget to update version numbers when updating the files (which is to be expected as humans generally suck at perfect...
Getting files and their version numbers from sharepoint
CC BY-SA 2.5
null
2008-08-28T19:58:58.673
2017-06-09T10:25:27.937
null
null
1,143
[ "sharepoint", "versioning" ]
33,265
1
33,391
null
108
11,113
There are two weird operators in C#: - [true operator](http://msdn.microsoft.com/en-us/library/6x6y6z4d.aspx)- [false operator](http://msdn.microsoft.com/en-us/library/6292hy1k.aspx) If I understand this right these operators can be used in types which I want to use instead of a boolean expression and where I don't w...
What's the false operator in C# good for?
CC BY-SA 2.5
0
2008-08-28T20:06:01.840
2017-05-01T11:47:15.863
2010-03-16T08:41:10.740
2,361
2,361
[ "c#", ".net", "syntax" ]
33,253
2
null
33,199
0
null
Very interesting guys, thanks for the answers. I never would have thought about putting the print statement inside the if condition. Here's the Java equivalent: ``` if ( System.out.printf("Hello").equals("") ) System.out.printf("Hello"); else System.out.printf("World"); ```
null
CC BY-SA 2.5
null
2008-08-28T19:59:11.107
2008-08-28T19:59:11.107
null
null
2,454
null
33,271
2
null
9,033
6
null
Thought about and decided to try it out a bit. Here's what I come up with that might be useful to some: ``` // using the concepts of dp's AnonCast static Func<T> TypeCurry<T>(Func<object> f, T type) { return () => (T)f(); } ``` And here's how it might be used: ``` static void Main(string[] args) { var get...
null
CC BY-SA 2.5
null
2008-08-28T20:07:41.743
2009-09-12T20:56:44.277
2009-09-12T20:56:44.277
63,550
3,055
null
33,277
2
null
32,835
0
null
VS2008 has a nicely integrated unit testing framework. (I assume you're using using the XNA 3.0 CTP with your Zune.)
null
CC BY-SA 2.5
null
2008-08-28T20:10:01.097
2008-08-28T20:10:01.097
null
null
3,431
null
33,262
1
33,283
null
108
137,527
I have a complete XML document in a string and would like a `Document` object. Google turns up all sorts of garbage. What is the simplest solution? (In Java 1.5) Thanks to [Matt McMinn](https://stackoverflow.com/users/1322/matt-mcminn), I have settled on this implementation. It has the right level of input flexibilit...
How do I load an org.w3c.dom.Document from XML in a string?
CC BY-SA 2.5
0
2008-08-28T20:03:19.477
2014-08-05T11:01:20.950
2017-05-23T12:18:10.243
-1
338
[ "java", "xml", "document", "w3c" ]
33,269
2
null
28,268
1
null
I would look into the [VMWare Fusion 2 Beta](http://www.vmware.com/landing_pages/fusion2_beta.html) to get around the quirks with the key bindings experienced by those using Parallels. Fusion will capture all key events inside the virtual machine unless you hit a special key sequence to escape from the VM. You will, ...
null
CC BY-SA 2.5
null
2008-08-28T20:07:35.300
2008-08-28T20:07:35.300
null
null
2,052
null
33,280
2
null
33,275
5
null
[ABCPDF](http://www.websupergoo.com)can do it
null
CC BY-SA 2.5
null
2008-08-28T20:10:30.707
2008-08-28T20:10:30.707
null
null
2,757
null
33,275
1
null
null
5
3,993
Is there a PDF library that one can use to automate creating PDFs from URLs? The current approach I use is to "Print" a page and select a PDF plugin like PrimoPDF to generate the PDF document but I was wanting to automate that.
Automated PDF Creation from URL
CC BY-SA 2.5
0
2008-08-28T20:09:27.603
2011-12-19T13:56:12.447
null
null
64
[ "pdf", "pdf-generation" ]
33,284
2
null
33,252
1
null
I am assuming you are talking about documents in a list or a library, not source files in the 12 hive. If so, each library has built-in versioning. You can access it by clicking on the Form Library Settings available from each library (with appropriate admin privs, of course). From there, select Versioning Settings,...
null
CC BY-SA 3.0
null
2008-08-28T20:11:02.313
2017-06-09T10:25:27.937
2017-06-09T10:25:27.937
1,055,241
2,470
null
33,285
2
null
33,226
6
null
``` select * from information_schema.tables WHERE OBJECTPROPERTY(OBJECT_ID(table_name),'IsMSShipped') =0 ``` Will exclude dt_properties and system tables add ``` where table_type = 'view' ``` if you just want the view
null
CC BY-SA 2.5
null
2008-08-28T20:11:35.087
2008-08-28T20:11:35.087
null
null
740
null
33,263
1
null
null
3
2,837
I'm using the [ASP.NET Login Controls](http://msdn.microsoft.com/en-us/library/ms178329.aspx) and [Forms Authentication](http://msdn.microsoft.com/en-us/library/aa480476.aspx) for membership/credentials for an ASP.NET web application. I've got two roles: - - I want pages to be viewable by four different groups: - ...
How do I best handle role based permissions using Forms Authentication on my ASP.NET web application?
CC BY-SA 3.0
null
2008-08-28T20:05:19.847
2012-04-01T20:43:32.583
2017-05-23T12:19:34.457
-1
83
[ "asp.net", "forms-authentication" ]
33,281
2
null
33,042
8
null
If you can use [GNU GCC](http://gcc.gnu.org/onlinedocs/gcc/index.html) as your complier, then the [gcov](http://gcc.gnu.org/onlinedocs/gcc/Gcov.html) tool works well. It's very easy to fully automate the whole process.
null
CC BY-SA 2.5
null
2008-08-28T20:10:31.267
2008-08-28T20:10:31.267
null
null
3,175
null
33,283
2
null
33,262
83
null
This works for me in Java 1.5 - I stripped out specific exceptions for readability. ``` import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; import org.w3c.dom.Document; import java.io.ByteArrayInputStream; public Document loadXMLFromString(String xml) throws Exception { Docu...
null
CC BY-SA 2.5
null
2008-08-28T20:11:00.160
2008-08-28T20:11:00.160
null
null
1,322
null
33,289
2
null
3,748
0
null
File system, for sure. Then you get to use all of the OS functionality to deal with these images - back ups, webserver, even just scripting batch changes using tools like imagemagic. If you store them in the DB then you'll need to write your own code to solve these problems.
null
CC BY-SA 2.5
null
2008-08-28T20:12:14.400
2008-08-28T20:12:14.400
null
null
null
null
33,288
1
33,295
null
4
2,028
Within an application, I've got Secret Keys uses to calculate a hash for an API call. In a .NET application it's fairly easy to use a program like Reflector to pull out information from the assembly to include these keys. Is obfuscating the assembly a good way of securing these keys?
Protecting API Secret Keys in a Thick Client application
CC BY-SA 2.5
null
2008-08-28T20:11:54.867
2017-03-17T21:51:08.813
null
null
2,723
[ "web-services", "security", "api" ]
33,261
2
null
33,117
4
null
There are a couple of interesting projects you could look into. But first: does it have to be a CD-ROM? That's probably the slowest possible storage (well, apart from tape, maybe) you could use. What about a fast USB stick or a an IEE1394 hard-disk or maybe even an eSATA hard-disk? Okay, there are several Live-CDs th...
null
CC BY-SA 2.5
null
2008-08-28T20:02:38.090
2008-08-28T20:02:38.090
null
null
2,988
null
33,290
2
null
33,113
0
null
If you're willing to do in-memory diddling while the application is loaded, you could probably finagle that. But if you're looking for an easy way to just inject code you want into another window's message pump, you're not going to find it. The skills required to accomplish something like this are formidable (unless s...
null
CC BY-SA 2.5
null
2008-08-28T20:12:24.603
2008-08-28T20:12:24.603
null
null
1,975,282
null
33,270
2
null
25,532
12
null
You should also check out [Facelets](https://facelets.java.net/); there is a [good introductory article](http://www.ibm.com/developerworks/java/library/j-facelets/) on DeveloperWorks. The Facelets `<ui:insert/>` tag is comparable to the ASP.NET `<asp:ContentPlaceHolder/>` tag used in master pages; it lets you provide ...
null
CC BY-SA 3.0
null
2008-08-28T20:07:37.267
2013-11-26T05:40:40.147
2013-11-26T05:40:40.147
1,102,512
3,344
null
33,295
2
null
33,288
8
null
Probably not. Look into cryptography and Windows' built-in information-hiding mechanisms (DPAPI and storing the keys in an ACL-restricted registry key, for example). That's as good as you're going to get for security you need to keep on the same system as your application. If you are looking for a way to stop someone...
null
CC BY-SA 2.5
null
2008-08-28T20:14:55.063
2008-08-28T20:14:55.063
null
null
1,975,282
null
33,292
2
null
32,020
4
null
There's an eclipse plugin that allows you to do web service discovery, testing, etc - see [Eclipse Web Services Tools](http://www.eclipse.org/webtools/ws/). I think it's much better than SoapUI, at least on Mac OS X.
null
CC BY-SA 2.5
null
2008-08-28T20:13:08.720
2008-08-28T20:13:08.720
null
null
2,811
null
33,299
2
null
33,250
2
null
Active Directory is pretty efficient at storing information and the retrieval shouldn't be that much of a performance hit. If you are really intent on storing the names, you'll probably want to store them in some sort of a tree stucture, so you can see the relationships of all the people. Depending on how the number ...
null
CC BY-SA 2.5
null
2008-08-28T20:23:47.303
2008-08-28T20:23:47.303
null
null
1,942
null
33,297
2
null
32,448
4
null
When I migrated a project from GCC 3 to GCC 4 I ran several tests to ensure that behavior was the same before and after. Can you just run a run a set of (hopefully automated) tests to confirm the correct behavior? After all, you want the "correct" behavior, not necessarily the GCC 3 behavior.
null
CC BY-SA 2.5
null
2008-08-28T20:23:39.537
2008-08-28T20:23:39.537
null
null
1,807
null
33,286
2
null
32,341
1
null
So i found an article on using [custom queries](http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query). I modified the script to pull a specific tag, in this case "Open Source". ``` <?php $querystr = "SELECT wposts.* FROM $wpdb->posts wposts, $wpdb->terms wterms, $wpdb->term_relation...
null
CC BY-SA 2.5
null
2008-08-28T20:11:40.983
2008-09-03T21:16:57.863
2008-09-03T21:16:57.863
2,863
2,863
null
33,301
1
33,440
null
4
6,743
I have a JavaScript method that I need to run on one of my pages, in particular, the `onresize` event. However, I don't see how I can set that event from my content page. I wish I could just put it on my master page, but I don't have the need for the method to be called on all pages that use that master page. Any ...
Call onresize from ASP.NET content page
CC BY-SA 3.0
0
2008-08-28T20:24:04.887
2016-02-08T14:48:56.613
2016-02-08T14:48:22.963
92,701
1,226
[ "asp.net", "javascript", "master-pages", "onresize" ]
33,306
1
33,313
null
6
1,463
I have a (potentially dumb) question about the C++ STL. When I make a container (vector, set, map, etc), is it allocated on the stack or on the heap? If I make a set and put 5 million strings, will I have to worry about a stack overflow?
C++ STL question: allocators
CC BY-SA 2.5
0
2008-08-28T20:26:14.193
2012-07-03T14:55:39.630
2008-08-29T05:14:19.573
342
2,147
[ "c++", "stl" ]
33,291
2
null
32,149
1
null
Here's a perhaps naive C# implementation:- ``` public class ProperCaseHelper { public string ToProperCase(string input) { string ret = string.Empty; var words = input.Split(' '); for (int i = 0; i < words.Length; ++i) { ret += wordToProperCase(words[i]); if (i < words.Length - 1) ret += " "...
null
CC BY-SA 2.5
null
2008-08-28T20:12:37.130
2008-08-28T20:22:28.073
2008-08-28T20:22:28.120
3,394
3,394
null
33,307
2
null
33,263
1
null
A couple solutions off the top of my head. 1. You could set up restrictions for each page in your web.config file. This would allow you to have whatever folder hierarchy you wish to use. However, it will require that you keep the web.config file up to date whenever you add additional pages. The nice part of having th...
null
CC BY-SA 2.5
null
2008-08-28T20:26:50.980
2008-08-28T20:26:50.980
null
null
1,574
null
33,308
2
null
33,113
0
null
Hm thats really too bad. I suppose there are sometimes reasons why apps don't exist yet. Basically what I'm trying to do is simplify the process of sending image links to people using various apps (mainly web browser text forms, but also anytime I'm editing in a terminal window) by hooking the process of pasting an i...
null
CC BY-SA 2.5
null
2008-08-28T20:26:59.077
2008-08-29T18:03:42.380
2008-08-29T18:03:42.393
327
327
null
33,313
2
null
33,306
9
null
STL classes by default allocate their internal buffers from the heap, although these classes also allow custom allocators that allow a user to specify an alternate location to allocate from - e.g. a shared memory pool.
null
CC BY-SA 2.5
null
2008-08-28T20:28:13.177
2008-08-28T20:28:13.177
null
null
3,114
null
33,316
2
null
33,204
1
null
Reducing the frequency of commits will certainly speed things up, however as you are reading and writing to this table frequently there is the potential for locks. Only you can determine the likelihood of the same data being updated at the same time. If the chance of this is low, commit every 50 rows and monitor the ...
null
CC BY-SA 2.5
null
2008-08-28T20:30:22.843
2008-08-28T20:30:22.843
null
null
2,981
null
33,315
2
null
33,265
14
null
The page you link to [http://msdn.microsoft.com/en-us/library/6x6y6z4d.aspx](http://msdn.microsoft.com/en-us/library/6x6y6z4d.aspx) says what they were for, which was a way of handling nullable bools before nullable value types were introduced. I'd guess nowadays they're good for the same sort of stuff as ArrayList -...
null
CC BY-SA 2.5
null
2008-08-28T20:28:54.640
2008-08-28T20:28:54.640
null
null
987
null
33,318
2
null
33,242
19
null
At a file level: use wget to aggressively spider the site and then process the http server logs to get the list of files accessed, diff this with the files in the site ``` diff \ <(sed some_rules httpd_log | sort -u) \ <(ls /var/www/whatever | sort -u) \ | grep something ```
null
CC BY-SA 2.5
null
2008-08-28T20:30:46.697
2008-08-28T20:30:46.697
null
null
1,343
null
33,314
2
null
33,275
0
null
Depends on what platform you are on Windows - Websupergoo's ABC PDF [http://www.websupergoo.com/](http://www.websupergoo.com/) *nix - Prince XML [http://www.princexml.com/overview/](http://www.princexml.com/overview/)
null
CC BY-SA 2.5
null
2008-08-28T20:28:39.883
2008-08-28T20:28:39.883
null
null
1,295
null
33,319
2
null
33,034
6
null
The particular bank I was interested in is Bank of America. I have confirmed that if I only clear my cookies or my LSOs, the site does not require me to re-enter info. If, however, I clear both, I had to go through additional authentication. Thus, that appears to be the answer in my particular case! But thank you a...
null
CC BY-SA 2.5
null
2008-08-28T20:31:26.927
2008-08-28T20:31:26.927
null
null
null
null
33,302
2
null
33,226
2
null
``` SELECT * FROM sysobjects WHERE xtype = 'V' AND type = 'V' AND category = 0 ``` Here is a list of the possible values for : - - - - - - - - - - - - - Here are the possible values for : - - - - - - - - - - - - - - - - Finally, the field looks like it groups based on different types of obj...
null
CC BY-SA 2.5
null
2008-08-28T20:24:08.973
2008-08-28T20:24:08.973
null
null
318
null
33,300
2
null
12,332
6
null
As far as Windows goes, the entry point functions are: - `void __cdecl mainCRTStartup( void ) {}`- `void __stdcall WinMainCRTStartup( void ) {}`- `BOOL __stdcall _DllMainCRTStartup(HINSTANCE hinstDLL,DWORD fdwReason,void* lpReserved) {}` The only reason to use these over the normal , , and is if you wanted to use your...
null
CC BY-SA 4.0
null
2008-08-28T20:23:52.437
2022-06-27T21:38:25.447
2022-06-27T21:38:25.447
3,501
3,501
null
33,323
2
null
33,204
0
null
If you "don't delete the original data used for updating till [you are] sure everything is fine", then why don't you remove all those incremental commits in between, and rollback if there's a problem? It sounds like you effectively have built a transaction systems on top of transactions.
null
CC BY-SA 2.5
null
2008-08-28T20:32:45.520
2008-08-28T20:32:45.520
null
null
685
null
33,304
2
null
33,288
1
null
I wouldn't think so, as obfuscating (as I understand it at least) will simply mess around with the method names to make it hard (but not impossible) to understand the code. This won't change the data of the actual key (which I'm guessing you have stored in a constant somewhere). If you just want to make it somewhat ...
null
CC BY-SA 2.5
null
2008-08-28T20:25:06.850
2008-09-11T21:30:21.350
2008-09-11T21:30:21.350
3,488
3,488
null
33,332
2
null
32,550
1
null
Yes they are one and the same
null
CC BY-SA 2.5
null
2008-08-28T20:34:59.180
2008-08-28T20:34:59.180
null
null
740
null
33,325
2
null
32,385
0
null
I had the same issue and I simply opened the file and did some replace: then reload the file in the Python interpreter. This works fine and is easy to do. Otherwise AFAIK you have to use some conf objects.
null
CC BY-SA 3.0
null
2008-08-28T20:33:29.917
2011-11-24T01:17:35.117
2011-11-24T01:17:35.117
331,508
3,504
null
33,312
2
null
32,877
11
null
A quick google reveals that this should get rid of it, get them to add it to the web.config or app.config for their application. ``` <configuration> <system.diagnostics> <switches> <add name="Remote.Disable" value="1" /> </switches> </system.diagnostics> </configuration> ``` The information is de...
null
CC BY-SA 2.5
null
2008-08-28T20:27:38.450
2008-08-28T20:36:38.960
2017-05-23T11:46:34.517
-1
1,834
null
33,320
2
null
33,263
1
null
One solution I've used in the past is this: 1. Create a base page called 'SecurePage' or something to that effect. 2. Add a property 'AllowedUserRoles' to the base page that is a generic list of user roles List or List where int is the role id. 3. In the Page_Load event of any page extending SecurePage you add each a...
null
CC BY-SA 2.5
null
2008-08-28T20:31:46.240
2008-08-28T20:31:46.240
null
null
null
null
33,341
1
33,365
null
8
16,621
Is there a way to hide radio buttons inside a RadioButtonList control programmatically?
ASP.Net RadioButton visibility inside a RadioButtonList
CC BY-SA 2.5
0
2008-08-28T20:37:19.067
2019-12-27T07:34:29.803
2008-08-28T20:42:51.190
1,414
877
[ "asp.net", "radio-button", "radiobuttonlist" ]
33,338
1
null
null
2
11,306
When trying to execute from within Visual Studio 2008 your application and you get the (uninformative) message "The operation could not be completed". The solution to this is to turn off the "Visual Studio Hosting Process". The problem with turning off this "hosting process" is that all the "run and rewrite" function...
Visual Studio Hosting Process and "The operation could not be completed"
CC BY-SA 2.5
null
2008-08-28T20:36:14.700
2023-02-07T21:17:50.680
null
null
445
[ "visual-studio" ]
33,324
2
null
7,237
1
null
Are you using in your queries? From my experience, a SELECT statement with subselects that runs fine on SQL Server 2000 can crawl on SQL Server 2005 (it can be like 10x slower!). Make an experiment - re-write one query to eliminate the subselects and see how its performance changes.
null
CC BY-SA 2.5
null
2008-08-28T20:33:29.747
2010-05-06T06:44:49.897
2010-05-06T06:44:49.897
95
95
null
33,342
2
null
23,083
12
null
The other alternative is SetProp/RemoveProp (When you are subclassing a window that already uses GWLP_USERDATA) Another good alternative is ATL style thunking of the WNDPROC, for more info on that, see - [http://www.ragestorm.net/blogs/?cat=20](http://www.ragestorm.net/blogs/?cat=20)- [http://www.hackcraft.net/cpp/wi...
null
CC BY-SA 2.5
null
2008-08-28T20:38:17.347
2008-08-28T20:38:17.347
null
null
3,501
null
33,334
1
33,683
null
4
3,063
In this [question](https://stackoverflow.com/questions/32877/how-to-remove-vsdebuggercausalitydata-data-from-soap-message) the answer was to flip on a switch that is picked up by the debugger disabling the extraneous header that was causing the problem. The Microsoft help implies these switched are user generated and ...
How do you find what debug switches are available? Or given a switch find out what is being disabled?
CC BY-SA 2.5
null
2008-08-28T20:35:07.060
2009-11-05T16:43:45.780
2017-05-23T12:13:34.533
-1
1,834
[ ".net", "app-config" ]
33,339
2
null
33,265
7
null
AFAIK, it would be used in a test for false, such as when the `&&` operator comes into play. Remember, && short-circuits, so in the expression ``` if ( mFalse && mTrue) { // ... something } ``` `mFalse.false()` is called, and upon returning `true` the expression is reduced to a call to 'mFalse.true()' (which sho...
null
CC BY-SA 3.0
null
2008-08-28T20:36:16.620
2017-05-01T11:47:15.863
2017-05-01T11:47:15.863
1,709,587
811
null
33,340
2
null
8,472
2
null
I wrote up a PHP class that lets you choose to use a certain class of Captcha Question (math, naming, opposites, completion), or to randomize which type is used. These are questions that most english-speaking children could answer. 1. Math: 2+5 = _ 2. Naming: The animal in this picture is a ____ 3. Opposites: The ...
null
CC BY-SA 2.5
null
2008-08-28T20:37:06.663
2008-08-28T20:37:06.663
null
null
3,407
null
33,352
2
null
33,204
0
null
@CodeSlave your your questions is answered by @stevechol , if i remove ALL the incremental commits there will be locks. I guess if nothing better comes along I'll follow his advice pick a random number , monitor the load and adjust accordingly. While applying @diciu twaks. PS: the transaction on top of transaction is ...
null
CC BY-SA 2.5
null
2008-08-28T20:46:11.587
2008-08-28T20:46:11.587
null
null
238
null
33,351
2
null
24,243
2
null
If you want a light-weight solution, I would recommend [sp_generate_inserts](http://vyaskn.tripod.com/code.htm#inserts). It is a store procedure you can create on your DB and pass in a variety of arguments to generate insert statements of all the data in the target table.
null
CC BY-SA 2.5
null
2008-08-28T20:45:38.313
2008-08-28T20:45:38.313
null
null
3,294
null
33,353
2
null
33,341
0
null
If you mean with JavaScript, and if I remember correctly, you've got to dig out the ClientID properties of each <input type="radio" ...> tag.
null
CC BY-SA 2.5
null
2008-08-28T20:46:32.290
2008-08-28T20:46:32.290
null
null
83
null
33,357
2
null
33,341
0
null
Have you tried to hide it through the itemdatabound event onload or do you need it to hide after it loads?
null
CC BY-SA 2.5
null
2008-08-28T20:48:57.900
2008-08-28T20:48:57.900
null
null
648
null
33,343
2
null
33,117
3
null
One key piece of advice I can give is that most LiveCDs use a compressed filesystem called squashfs to cram as much data on the CD as possible. Since you don't need compression, you could run the mksquashfs step (present in most tutorials) with -noDataCompression and -noFragmentCompression to save on decompression tim...
null
CC BY-SA 2.5
null
2008-08-28T20:38:27.440
2008-08-29T00:03:05.623
2008-08-29T00:03:05.623
1,990
1,990
null
33,359
2
null
24,954
5
null
@aku: Don't forget HKEY_CLASSES_ROOT\SystemFileAssociations\ Not sure if they are exposed in .NET, but there are COM interfaces (IQueryAssociations and friends) that deal with this so you don't have to muck around in the registry and hope stuff does not change in the next windows version
null
CC BY-SA 2.5
null
2008-08-28T20:49:35.247
2008-08-28T20:49:35.247
null
null
3,501
null
33,331
2
null
23,755
2
null
A mix of 2 and 3, really. Some haystacks don't have a specialized search strategy; an example of this is an array. The only way to find something is to start at the beginning and test each item until you find the one you want. For this kind of thing, a free function is probably best (like C++). Some haystacks can h...
null
CC BY-SA 2.5
null
2008-08-28T20:34:47.310
2008-08-28T20:34:47.310
null
null
2,131
null