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
29,370
1
29,914
null
4
22,885
I am trying to get the DB2 data provider from a 32-bit .Net application to connect to DB2 running as a 32-bit application on Vista 64 (is that confusing enough yet)? Unfortunately, I am getting the following error: > SQL1159 Initialization error with DB2 .NET Data Provider, reason code 7, tokens 9.5.0.DEF.2, SOFTWARE...
SQL1159 Initialization error with DB2 .NET Data Provider, reason code 7, tokens 9.5.0.DEF.2, SOFTWARE\IBM\DB2\InstalledCopies
CC BY-SA 2.5
null
2008-08-27T02:20:39.913
2016-07-22T20:11:20.847
2016-07-22T20:11:20.847
1,227,152
1,432
[ ".net", "db2", "db2-luw", "vista64" ]
29,377
2
null
26,002
2
null
We ended up using Oracle XE. Install client, install express, reboot, it just works.
null
CC BY-SA 2.5
null
2008-08-27T02:28:38.147
2008-08-27T02:28:38.147
null
null
2,676
null
29,357
1
null
null
2
642
I have a project to build a voting desktop application for a class in Java. While security isn't the focus of the project, I would like to be as realistic as I can. What are some of the primary tools to integrate security into a Java application. Edit: I'm not primarily worried about physical security, we are simply b...
Security For Voting Application
CC BY-SA 2.5
null
2008-08-27T02:09:29.767
2016-11-11T19:21:37.397
2008-08-27T03:32:06.823
657
657
[ "java", "security", "desktop" ]
29,340
2
null
29,292
1
null
@Damian - Good point about the tagging and cross referencing. That's true; while I haven't working with many designers on a software development project, I have worked for a company that had a design department and know that this is an issue. Designers are still (perpetually) looking for the perfect system to handle ...
null
CC BY-SA 2.5
null
2008-08-27T01:43:01.250
2008-08-27T01:43:01.250
null
null
1,875
null
29,354
2
null
29,346
3
null
Given everyone already has domain accounts. Try IIS integrated authentication. You will get an ugly logon box off network but your creds should pass down to the file share. @lomaxx Are you saying that only you have perms to the share or that you manually mapped it to a drive letter. If the later you can use ucn \ho...
null
CC BY-SA 2.5
null
2008-08-27T01:59:39.010
2008-08-27T03:09:19.873
2008-08-27T03:09:19.873
1,293
1,293
null
29,383
1
29,571
null
114
232,839
Maybe this is a dumb question, but is there any way to convert a boolean value to a string such that 1 turns to "true" and 0 turns to "false"? I could just use an if statement, but it would be nice to know if there is a way to do that with the language or standard libraries. Plus, I'm a pedant. :)
Converting bool to text in C++
CC BY-SA 2.5
0
2008-08-27T02:32:34.953
2022-09-04T07:42:06.297
null
null
2,147
[ "c++", "string", "boolean" ]
29,390
2
null
28,369
1
null
Although that code looks quite secure, I've always held the opinion that any sufficiently motivated person could break it given adequate time. I do think it will take quite a bit of determination to get through that, but I'm relatively sure it could be done.
null
CC BY-SA 2.5
null
2008-08-27T02:37:05.973
2008-08-27T02:37:05.973
null
null
3,119
null
29,394
2
null
29,383
-3
null
I agree that a macro might be the best fit. I just whipped up a test case (believe me I'm no good with C/C++ but this sounded fun): ``` #include <stdio.h> #include <stdarg.h> #define BOOL_STR(b) (b?"true":"false") int main (int argc, char const *argv[]) { bool alpha = true; printf( BOOL_STR(alpha) ); re...
null
CC BY-SA 2.5
null
2008-08-27T02:41:52.560
2008-08-27T02:41:52.560
null
null
792
null
29,396
2
null
29,383
-7
null
Try this Macro. Anywhere you want the "true" or false to show up just replace it with PRINTBOOL(var) where var is the bool you want the text for. ``` #define PRINTBOOL(x) x?"true":"false" ```
null
CC BY-SA 2.5
null
2008-08-27T02:42:28.987
2008-08-27T02:42:28.987
null
null
171
null
29,397
2
null
29,099
0
null
To further what aib said, I would say that a language isn't really object oriented unless the standard libraries that are available are object oriented. The biggest example of this is PHP. Although it supports all the standard object oriented concepts, the fact that such a large percentage of the standard libraries a...
null
CC BY-SA 2.5
null
2008-08-27T02:42:56.677
2008-08-27T02:42:56.677
null
null
1,862
null
29,382
1
29,404
null
0
1,219
I'm deploying to Ubuntu slice on slicehost, using Rails 2.1.0 (from `gem`) If I try `mongrel_rails` start or script/server I get this error: ``` Rails requires RubyGems >= 0.9.4. Please install RubyGems ``` When I type `gem -v` I have version `1.2.0` installed. Any quick tips on what to look at to fix?
Rails requires RubyGems >= 0.9.4. Please install RubyGems
CC BY-SA 3.0
null
2008-08-27T02:32:15.033
2017-12-13T19:52:31.010
2017-12-13T19:52:31.010
1,380,867
2,477
[ "ruby-on-rails", "deployment", "rubygems" ]
29,401
2
null
29,382
1
null
Have you tried reinstalling RubyGems? I had a pretty similar error message until I reuninstalled and for some reason, it installed into a different directory and then the problem went away.
null
CC BY-SA 2.5
null
2008-08-27T02:46:13.173
2008-08-27T02:46:13.173
null
null
422
null
29,404
2
null
29,382
0
null
Just finally found [this answer](http://www.shorepound.net/wpblog/?p=65)... I was missing a gem, and thrown off by bad error message from Rails...
null
CC BY-SA 3.0
null
2008-08-27T02:47:39.380
2015-10-08T08:14:43.370
2015-10-08T08:14:43.370
67,579
2,477
null
29,399
1
29,471
null
27
8,077
I'm working on building a development tool that is written in JavaScript. This will not be an open source project and will be sold (hopefully) as a commercial product. I'm looking for the best way to protect my investment. Is using an obfuscator (code mangler) enough to reasonably secure the code? Are there other al...
Is using an obfuscator enough to secure my JavaScript code?
CC BY-SA 2.5
0
2008-08-27T02:44:58.107
2012-03-07T12:43:43.030
2011-03-15T21:58:06.563
496,830
2,490
[ "javascript", "obfuscation" ]
29,407
2
null
29,399
0
null
That's probably about the best you can do. Just be aware that anybody with enough dedication, can probably de-obfuscate your program. Just make sure you're comfortable with that before embarking on your project. I think the biggest problem with this would be to control who's using it on their site. If somebody g...
null
CC BY-SA 2.5
null
2008-08-27T02:49:43.243
2008-08-27T02:49:43.243
null
null
1,862
null
29,406
1
29,411
null
8
7,451
I'm faced with writing a framework to simplify working with a large and complex object library ([ArcObjects](http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/ao_start.htm)). What guidelines would you suggest for creating a framework of this kind? Are static methods preferred? How do you handle things like lo...
Guidelines for writing a framework
CC BY-SA 2.5
null
2008-08-27T02:48:39.550
2008-10-13T09:56:20.867
2008-09-10T14:13:52.750
-1
3,074
[ "frameworks" ]
29,408
2
null
29,399
0
null
A obfuscator won't help you at all if someone wants to figure out the code. The code still exists on the client machine and they can grab a copy of it and study it at their leisure. There is simply no way to hide code written in Javascript since the source code has to be handed to the browser for execution. If you w...
null
CC BY-SA 2.5
null
2008-08-27T02:50:11.370
2008-08-27T02:50:11.370
null
null
2,284
null
29,411
2
null
29,406
5
null
Brad Abrams' [Framework Design Guidelines](https://rads.stackoverflow.com/amzn/click/com/0321246756) book is all about this. Might be worth a look.
null
CC BY-SA 2.5
null
2008-08-27T02:51:35.987
2008-08-27T02:51:35.987
null
null
615
null
29,395
2
null
29,242
6
null
The unix tool `xxd` is distributed as part of [vim](http://www.vim.org/download.php), and according to [http://www.vmunix.com/vim/util.html#xxd](http://www.vmunix.com/vim/util.html#xxd), the source for xxd is [ftp://ftp.uni-erlangen.de:21/pub/utilities/etc/xxd-1.10.tar.gz](ftp://ftp.uni-erlangen.de:21/pub/utilities/etc...
null
CC BY-SA 2.5
null
2008-08-27T02:42:07.507
2008-08-27T02:42:07.507
null
null
3,101
null
29,403
2
null
29,357
0
null
I believe that physical security is more important for voting booth system rather than you know, code security. These machine by their very nature shouldn't be connected to any kind of public networks, especially not the the internet. But having a good physical security to prevent any sort of physical tampering is very...
null
CC BY-SA 3.0
null
2008-08-27T02:46:59.647
2016-11-11T19:21:37.397
2016-11-11T19:21:37.397
2,225,646
2,976
null
29,413
2
null
29,399
0
null
I'd say yes, it's enough if you also make sure than you compress the code as well using a tool like [Dean Edward's Packer](http://dean.edwards.name/packer/) or similar. If you think about what is possible with tools like .NET Reflector in terms of reverse engineering compiled code / IL in .NET, you realize that there's...
null
CC BY-SA 2.5
null
2008-08-27T02:52:30.087
2008-08-27T02:52:30.087
null
null
3,074
null
29,414
2
null
26,041
3
null
I'd definitely suggest PHP. I've developed browser based games (pbbgs) for about 10 years now. I've tried .Net, Perl and Java. All of them worked, but by far PHP was the best because: - - - Ruby is not to bad, but the last time I tried it I rapidly ran into scaling/performance issues. I have not tried Python yet.....
null
CC BY-SA 3.0
null
2008-08-27T02:52:39.103
2013-11-19T17:19:43.120
2013-11-19T17:19:43.120
832,136
2,490
null
29,419
2
null
29,406
1
null
I think that you're consistent is more important than what conventions you go with. As far as future-proofing yourself, that's a matter of the code that you're making a framework for. It's a lot easier to build on a brick house than a sand one.
null
CC BY-SA 2.5
null
2008-08-27T02:57:41.103
2008-08-27T02:57:41.103
null
null
2,147
null
29,416
2
null
29,399
1
null
You're always faced with the fact that any user that comes to your webpage will download some working version of your Javascript source. They have the source code. Obfuscating it may make it very difficult to be reused by someone with the intent to your hard work. However, in many cases someone can even reuse the ...
null
CC BY-SA 2.5
null
2008-08-27T02:53:19.320
2008-08-27T02:53:19.320
null
null
792
null
29,380
2
null
29,308
0
null
From Linq in Action > Microsoft has a Query Visualizer tool that can be downloaded separetly from VS 2008. it is at [http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx](http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx)
null
CC BY-SA 2.5
null
2008-08-27T02:29:37.927
2008-08-27T02:29:37.927
null
null
2,469
null
29,423
1
29,449
null
7
278
I have `ci`, so our staging environment builds itself. Should I have a script that not only builds production but does all the branching for it as well? When you have one code base on two different urls with skinning, should they be required to build at once?
How automated is too automated when it comes to deployment?
CC BY-SA 3.0
null
2008-08-27T03:02:00.250
2016-01-12T09:47:29.113
2016-01-12T09:47:29.113
607,407
1,220
[ "build-automation", "production" ]
29,422
2
null
29,399
3
null
You are going to be fighting a losing battle if you try to obfuscate your code in the hopes of someone not stealing it. You may stop the casual browser from getting at it, but someone dedicated would almost certainly be able to overcome any measure you use. In the past I have seen people do several things: 1. Paste ...
null
CC BY-SA 2.5
null
2008-08-27T03:01:02.560
2011-03-15T21:59:03.880
2011-03-15T21:59:03.880
496,830
3,431,280
null
29,425
2
null
29,370
1
null
I vaguely remember having a similar sounding problem with the DB2 for as/400 oledb driver when trying to set up a linked server from sql 2005 to the as/400. It was a permissions issue and I eventually found that only sql server accounts (not windows) could use the linked server because (i think) then the driver was loa...
null
CC BY-SA 2.5
null
2008-08-27T03:02:42.433
2008-08-27T03:02:42.433
null
null
1,433
null
29,426
1
3,816,214
null
125
422,534
I'm looking for a good GUI designer for swing in eclipse. My preference is for a free/open-source plugin.
Best GUI designer for eclipse?
CC BY-SA 2.5
0
2008-08-27T03:06:06.760
2012-06-10T23:23:39.830
null
null
2,612
[ "java", "eclipse", "swing", "gui-designer" ]
29,430
2
null
29,399
0
null
If this is for a website, which by its very nature puts viewing of its code one menu click away, is there any reason to hide anything? If someone wants to steal your code they will most likely go through the effort of making even the most mangled code human readable. Look at commercial websites, they don't obfuscate t...
null
CC BY-SA 2.5
null
2008-08-27T03:06:46.900
2008-08-27T03:06:46.900
null
null
3,119
null
29,434
2
null
29,426
7
null
'Jigloo' is a very cool GUI designer. It is not free for commercial use however. It auto-generates code and allows for custom editing of the code it creates. [http://www.cloudgarden.com/jigloo/](http://www.cloudgarden.com/jigloo/)
null
CC BY-SA 2.5
null
2008-08-27T03:10:36.453
2008-08-27T03:10:36.453
null
null
2,598
null
29,436
1
29,472
null
6
5,060
I'm using the .NET CF 3.5. The type I want to create does not have a default constructor so I want to pass a string to an overloaded constructor. How do I do this? Code: ``` Assembly a = Assembly.LoadFrom("my.dll"); Type t = a.GetType("type info here"); // All ok so far, assembly loads and I can get my type string s...
Compact Framework - how do I dynamically create type with no default constructor?
CC BY-SA 2.5
null
2008-08-27T03:12:43.267
2019-11-21T12:48:44.133
2008-09-24T15:27:31.150
12,870
636
[ "c#", "reflection", "compact-framework" ]
29,439
2
null
29,244
4
null
Must be a `Vista` problem. I have `XP SP 2` and it looks normal.
null
CC BY-SA 3.0
null
2008-08-27T03:13:46.680
2017-02-23T10:32:31.573
2017-02-23T10:32:31.573
6,670,723
648
null
29,437
1
29,492
null
15
21,786
I want to shift the contents of an array of bytes by 12-bit to the left. For example, starting with this array of type `uint8_t shift[10]`: ``` {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0xBC} ``` I'd like to shift it to the left by 12-bits resulting in: ``` {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0...
How to shift an array of bytes by 12-bits
CC BY-SA 3.0
0
2008-08-27T03:13:12.283
2020-12-03T07:49:19.360
2016-05-27T17:19:40.313
609
609
[ "c", "arrays", "bit-shift", "bitset" ]
29,442
2
null
28,029
-4
null
``` Tools->Options->Addin/Macro Security ``` Change Paths there.
null
CC BY-SA 2.5
null
2008-08-27T03:14:51.797
2008-08-27T03:14:51.797
null
null
1,965
null
29,417
2
null
29,399
0
null
code obfuscator is enough for something that needs minimal protection, but I think it will definitely not enough to really protect you. if you are patient you can realy de-mangle the whole thing.. and i'm sure there are programs to do it for you. That being said, you can't stop anyone from pirating your stuff because ...
null
CC BY-SA 2.5
null
2008-08-27T02:56:06.177
2008-08-27T03:01:43.870
2008-08-27T03:01:43.870
2,976
2,976
null
29,428
2
null
29,370
1
null
I assume you have seen the writeup of [SQL1159](http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.msg.doc/doc/sql1159.htm) in the [DB2 Reference Guide](http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp)? Unfortunately for you, the reason codes stop at 6 and don't continue t...
null
CC BY-SA 2.5
null
2008-08-27T03:06:15.827
2008-08-27T03:06:15.827
null
null
1,958
null
29,443
2
null
27,779
5
null
- [Visual C++ Team Blog](http://blogs.msdn.com/vcblog/default.aspx)- [Programming Windows with MFC](https://rads.stackoverflow.com/amzn/click/com/1572316950)- [search google for various tutorials on MFC](http://www.google.ca/search?q=mfc+tutorial&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a) ...
null
CC BY-SA 3.0
null
2008-08-27T03:15:43.947
2012-03-29T21:17:00.767
2012-03-29T21:17:00.767
1,219,121
3,153
null
29,392
2
null
29,099
0
null
Disregarding the theoretical implications, it seems to be "Any language that has a keyword called 'class'" :-P
null
CC BY-SA 2.5
null
2008-08-27T02:39:00.273
2008-08-27T02:39:00.273
null
null
234
null
29,248
2
null
29,104
12
null
[Steve Yegge](http://steve-yegge.blogspot.com/2008/08/business-requirements-are-bullshit.html) talks fun but there is money to be made in working out what other people's requirements are so i'd take his article with a pinch of salt. Requirements gathering is incredibly tough because of the manner in which communicatio...
null
CC BY-SA 3.0
null
2008-08-27T00:30:51.050
2011-08-03T16:23:26.073
2011-08-03T16:23:26.073
1,143
1,143
null
29,444
2
null
29,436
0
null
See if this works for you (untested): ``` Type t = a.GetType("type info here"); var ctors = t.GetConstructors(); string s = "Pass me to the ctor of t"; MyObj o = ctors[0].Invoke(new[] { s }) as MyObj; ``` If the type has more than one constructor then you may have to do some fancy footwork to find the one that accep...
null
CC BY-SA 2.5
null
2008-08-27T03:17:16.143
2008-08-27T03:50:56.560
2017-05-23T12:10:48.007
-1
615
null
29,449
2
null
29,423
8
null
The only way to be too automated is if you are spending more time fighting with building or fixing automation scripts than you would just doing the job manually. As long as your automation scripts take less time and produce fewer errors than doing the job manually, then automation is great. Scripts to build and branc...
null
CC BY-SA 2.5
null
2008-08-27T03:21:03.467
2008-08-27T03:21:03.467
null
null
1,432
null
29,454
2
null
29,357
0
null
I'm not primarily worried about physical security, we are simply building an application not a whole system. I want to ensure votes are recorded correctly and not able to be changed or read by someone else.
null
CC BY-SA 2.5
null
2008-08-27T03:31:27.747
2008-08-27T03:31:27.747
null
null
657
null
29,460
1
29,491
null
5
6,680
I know I can programatically make the taskbar item for a particular window start flashing when something changes, but is there any way I can stop it from flashing either programatically after a certain period of time or at least is there a keyboard shortcur I can give to my users to somehow stop the flashing?
Stop the taskbar flashing
CC BY-SA 2.5
0
2008-08-27T03:38:10.537
2013-10-29T20:53:28.990
null
null
493
[ "c#", "winforms", "taskbar" ]
29,445
2
null
29,423
3
null
In my opinion anything the computer is capable of doing automatically it should do, because it can do it faster, easier and without thought from you. Within reason of course, but stuff like that can be very trivial to automate, so I've always been a proponent of automating that whole process. and plus it can be fun to...
null
CC BY-SA 2.5
null
2008-08-27T03:18:04.830
2008-08-27T03:18:04.830
null
null
3,119
null
29,308
1
null
null
7
2,805
In the [herding code](http://herdingcode.com/) podcast 14 someone mentions that stackoverflow displayed the queries that were executed during a request at the bottom of the page. It sounds like an excellent idea to me. Every time a page loads I want to know what sql statements are executed and also a count of the tot...
How to Track Queries on a Linq-to-sql DataContext
CC BY-SA 3.0
0
2008-08-27T01:20:29.183
2015-09-13T18:22:25.877
2015-09-13T18:22:25.877
4,111,568
2,785
[ "asp.net", "linq-to-sql" ]
29,466
1
29,523
null
22
13,900
I'd like to write a game for the Nintendo Wii. How do I go about obtaining an SDK and/or any other tools necessary for writing a game?
Writing a game for the Nintendo Wii
CC BY-SA 2.5
0
2008-08-27T03:43:11.743
2020-09-27T01:01:59.160
2008-08-27T09:45:13.417
3,051
3,051
[ "wii" ]
29,463
2
null
29,437
3
null
Lets make it the best way to shift `N` bits in the array of 8 bit integers. ``` N - Total number of bits to shift F = (N / 8) - Full 8 bit integers shifted R = (N % 8) - Remaining bits that need to be shifted ``` I guess from here you would have to find the most optimal way to make use of this data to mov...
null
CC BY-SA 2.5
null
2008-08-27T03:40:39.347
2008-08-27T04:10:58.180
2008-08-27T04:10:58.180
792
792
null
29,467
2
null
29,437
0
null
@Joseph, notice that the variables are 8 bits wide, while the shift is 12 bits wide. Your solution works only for N <= variable size. If you can assume your array is a multiple of 4 you can cast the array into an array of uint64_t and then work on that. If it isn't a multiple of 4, you can work in 64-bit chunks on a...
null
CC BY-SA 2.5
null
2008-08-27T03:44:18.200
2008-08-27T03:44:18.200
null
null
1,084
null
29,472
2
null
29,436
9
null
``` MyObj o = null; Assembly a = Assembly.LoadFrom("my.dll"); Type t = a.GetType("type info here"); ConstructorInfo ctor = t.GetConstructor(new Type[] { typeof(string) }); if(ctor != null) o = ctor.Invoke(new object[] { s }); ```
null
CC BY-SA 2.5
null
2008-08-27T03:48:10.140
2008-08-27T03:48:10.140
null
null
2,773
null
29,468
2
null
29,466
4
null
You would have to get in contact with Nintendo of America and obtain a developer kit from them. Be prepared to spend a wad of dough though. Check this out: [http://www.nintendo.com/corp/developer.jsp](http://www.nintendo.com/corp/developer.jsp)
null
CC BY-SA 2.5
null
2008-08-27T03:45:26.887
2008-08-27T03:45:26.887
null
null
1,238
null
29,477
2
null
28,197
6
null
I got into this once, even tried using PSP Dashboard. It's just too hard to keep up with. Who wants to use a stop watch for all their activities? Follow Joel's advice on Painless Scheduling and Evidence Based Scheduling. +1 this question, -1 to PSP.
null
CC BY-SA 2.5
null
2008-08-27T03:53:04.497
2008-08-27T03:53:04.497
null
null
809
null
29,474
2
null
29,423
2
null
I like to separate the build and deploy steps into two separate steps. The output of the build step should be a package that is placed in a repository or staging area. This package should be independent of the target environments. The deploy step is responsible for configuring the target environment and installing th...
null
CC BY-SA 2.5
null
2008-08-27T03:49:32.617
2008-08-27T03:49:32.617
null
null
1,969
null
29,461
1
29,573
null
11
1,028
I'm working on getting an Introduction to [Groovy](http://en.wikipedia.org/wiki/Groovy_%28programming_language%29) presentation ready for my local Java User's Group and I've pretty much got it together. What I'd like to see is what you all think I just have to cover. Remember, this is an introductory presentation. ...
What is a MUST COVER in my Groovy presentation?
CC BY-SA 3.0
0
2008-08-27T03:40:05.807
2015-07-14T07:50:14.947
2015-07-14T07:50:14.947
3,218,692
3,030
[ "java", "groovy" ]
29,471
2
null
29,399
146
null
I'm going to tell you a secret. Once you understand it, you'll feel a lot better about the fact that Javascript obfuscation is only really useful for saving bandwidth when sending scripts over the wire. Your source-code is not worth stealing. I know this comes as a shock to the ego, but I can say this confidently wit...
null
CC BY-SA 3.0
null
2008-08-27T03:48:07.377
2012-03-07T12:43:43.030
2012-03-07T12:43:43.030
324,381
3,052
null
29,453
2
null
29,308
3
null
``` System.IO.StreamWriter httpResponseStreamWriter = new StreamWriter(HttpContext.Current.Response.OutputStream); dataContext.Log = httpResponseStreamWriter; ``` Stick that in your page and you'll get the SQL dumped out on the page. Obviously, I'd wrap that in a little method that you can enable/disable.
null
CC BY-SA 2.5
null
2008-08-27T03:30:42.600
2008-08-27T03:30:42.600
null
null
1,965
null
29,482
1
29,485
null
3,803
1,897,158
How do I cast an `int` to an `enum` in C#?
How do I cast int to enum in C#?
CC BY-SA 4.0
0
2008-08-27T03:58:21.253
2022-07-10T23:29:04.723
2022-07-10T23:22:40.560
365,102
493
[ "c#", "enums", "casting", "integer" ]
29,479
2
null
29,335
1
null
In the occasions when this has been relevant to me (which, truth be told, is not often) we have tended to do a combination of hosting a dev copy of the solution in-house and mocking what we can't host. I personally think that the more you can host on individual dev boxes the better-- if your dev's PCs are powerful eno...
null
CC BY-SA 2.5
null
2008-08-27T03:55:35.177
2008-08-27T03:55:35.177
null
null
1,666
null
29,488
2
null
29,482
141
null
Take the following example: ``` int one = 1; MyEnum e = (MyEnum)one; ```
null
CC BY-SA 3.0
null
2008-08-27T04:00:38.877
2016-12-25T09:39:23.650
2016-12-25T09:39:23.650
5,120,235
2,279
null
29,481
2
null
29,436
1
null
Ok, here's a funky helper method to give you a flexible way to activate a type given an array of parameters: ``` static object GetInstanceFromParameters(Assembly a, string typeName, params object[] pars) { var t = a.GetType(typeName); var c = t.GetConstructor(pars.Select(p => p.GetType()).ToArray()); if ...
null
CC BY-SA 2.5
null
2008-08-27T03:57:25.030
2008-08-27T04:02:46.687
2008-08-27T04:02:46.687
615
615
null
29,483
2
null
29,466
10
null
You could spend literally thousands of dollars on the dev kit or you could be a bad person and go look at the [homebrew stuff](http://hbc.hackmii.com/). It is technically hacking though, so I only hypothetically recommend it.
null
CC BY-SA 2.5
null
2008-08-27T03:58:46.010
2008-08-27T03:58:46.010
null
null
3,119
null
29,485
2
null
29,482
4,562
null
From an int: ``` YourEnum foo = (YourEnum)yourInt; ``` From a string: ``` YourEnum foo = (YourEnum) Enum.Parse(typeof(YourEnum), yourString); // The foo.ToString().Contains(",") check is necessary for // enumerations marked with a [Flags] attribute. if (!Enum.IsDefined(typeof(YourEnum), foo) && !foo.ToString().Conta...
null
CC BY-SA 4.0
null
2008-08-27T03:59:42.483
2022-07-10T23:27:18.967
2022-07-10T23:27:18.967
365,102
1,965
null
29,489
2
null
29,482
1,115
null
Just cast it: ``` MyEnum e = (MyEnum)3; ``` Check if it's in range using [Enum.IsDefined](http://msdn.microsoft.com/en-us/library/system.enum.isdefined.aspx): ``` if (Enum.IsDefined(typeof(MyEnum), 3)) { ... } ```
null
CC BY-SA 4.0
null
2008-08-27T04:01:14.600
2022-07-10T23:29:04.723
2022-07-10T23:29:04.723
365,102
615
null
29,475
2
null
7,252
0
null
The main reason junior engineers/programmers don't take lots of time to design and perform test scripts, is because most CS certifications do not heavily require this, so other areas of engineering are covered further in college programs, such as design patters. In my experience, the best way to get the junior profess...
null
CC BY-SA 2.5
null
2008-08-27T03:52:11.673
2008-08-27T03:52:11.673
null
null
3,081
null
29,497
2
null
29,466
2
null
Yes the SDKs (and dev hardware) are expensive, and you must be an actual company with an actual office to get one.
null
CC BY-SA 2.5
null
2008-08-27T04:09:30.260
2008-08-27T04:09:30.260
null
null
1,366
null
29,499
1
29,515
null
2
2,539
If all you see is the ugly no-char boxes, what tools or strategies do you use to figure out what went wrong? (The specific scenario I'm facing is no-char boxes within a <select> when it should be showing Japanese chars.)
How do you troubleshoot character encoding problems?
CC BY-SA 2.5
null
2008-08-27T04:11:18.820
2017-09-13T09:13:17.673
null
null
337
[ "encoding", "localization" ]
29,500
2
null
28,823
2
null
Model, model, model, model, model. Skinny controllers, simple views. The RedHandedHomePage model does the parsing on initialization, then call 'def render' in the controller, set output to an instance variable, and print that in a view.
null
CC BY-SA 2.5
null
2008-08-27T04:12:04.077
2008-08-27T04:12:04.077
null
null
809
null
29,491
2
null
29,460
5
null
The [FlashWindowEx](http://msdn.microsoft.com/en-us/library/ms679347%28VS.85%29.aspx) function which controls the flashing takes a [FLASHWINFO](http://msdn.microsoft.com/en-us/library/ms679348%28VS.85%29.aspx) struct which has a uCount field to control how many times it flashes. Also, a possible value for the dwFlags ...
null
CC BY-SA 2.5
null
2008-08-27T04:02:17.640
2008-08-27T04:11:52.687
2008-08-27T04:11:52.687
2,508
2,508
null
29,493
2
null
8,472
30
null
Avoid the [worst CAPTCHAs of all time](http://www.docstoc.com/docs/1048763/Worst-Captchas-of-All-Time). > Trivia is OK, but you'll have to write each of them :-( would have to write them. You could do trivia questions in the same way ReCaptcha does printed words. It offers two words, one of which it knows the answer ...
null
CC BY-SA 2.5
null
2008-08-27T04:04:26.263
2008-08-27T04:57:21.610
2020-06-20T09:12:55.060
-1
257
null
29,496
1
29,609
null
15
29,412
I'd like to write a script/batch that will bunch up my daily IIS logs and zip them up by month. ex080801.log which is in the format of ex.log ex080801.log - ex080831.log gets zipped up and the log files deleted. The reason we do this is because on a heavy site a log file for one day could be 500mb to 1gb so we zip t...
Automated script to zip IIS logs?
CC BY-SA 2.5
0
2008-08-27T04:08:39.980
2014-02-19T09:27:26.793
2008-09-09T23:13:44.830
-1
648
[ "iis", "batch-file", "zip", "scripting", "logging" ]
29,507
2
null
29,496
0
null
Regex will do the trick... create a perl/python/php script to do the job for you.. I'm pretty sure windows batch file can't do regex.
null
CC BY-SA 2.5
null
2008-08-27T04:18:41.330
2008-08-27T04:18:41.330
null
null
2,976
null
29,505
1
29,524
null
6
5,034
The log4j network adapter sends events as a serialised java object. I would like to be able to capture this object and deserialise it in a different language (python). Is this possible? The network capturing is easy; its just a TCP socket and reading in a stream. The difficulty is the deserialising part
Deserialize in a different language
CC BY-SA 2.5
0
2008-08-27T04:18:10.347
2009-02-20T17:34:13.313
null
null
3,431,280
[ "java", "serialization", "log4j" ]
29,503
2
null
29,067
0
null
I think that @Craig is on the right track depending on the details of the problem you are solving. Add it to the repeater and remove it or set Visible="false" to hide it where needed. Viewstate gets tricky with dynamically created controls/user controls, so google that or check [here](http://www.aspnet4you.com/articl...
null
CC BY-SA 3.0
null
2008-08-27T04:15:45.597
2016-12-20T05:25:40.300
2016-12-20T05:25:40.300
1,380,867
1,865
null
29,512
2
null
29,511
7
null
You want `a[0,1]` instead of `a[0]`.
null
CC BY-SA 4.0
null
2008-08-27T04:22:04.020
2022-04-03T21:43:39.103
2022-04-03T21:43:39.103
15,261,315
1,666
null
29,508
2
null
29,437
1
null
The 32 bit version... :-) Handles 1 <= count <= num_words ``` #include <stdio.h> unsigned int array[] = {0x12345678,0x9abcdef0,0x12345678,0x9abcdef0,0x66666666}; int main(void) { int count; unsigned int *from, *to; from = &array[0]; to = &array[0]; count = 5; while (count-- > 1) { *to++ = (*from<<12...
null
CC BY-SA 2.5
null
2008-08-27T04:19:09.970
2008-09-03T06:55:02.240
2008-09-03T06:55:02.240
3,148
3,148
null
29,511
1
29,521
null
16
11,606
In Ruby, trying to print out the individual elements of a String is giving me trouble. Instead of seeing each character, I'm seeing their ASCII values instead: ``` >> a = "0123" => "0123" >> a[0] => 48 ``` I've looked online but can't find any way to get the original "0" back out of it. I'm a little new to Ruby to ...
Ruby - Convert Integer to String
CC BY-SA 2.5
null
2008-08-27T04:19:42.047
2022-04-03T21:43:39.103
2008-08-27T04:39:48.847
422
422
[ "ruby", "arrays" ]
29,515
2
null
29,499
3
null
Firstly, "ugly no-char boxes" might not be an encoding problem, they might just be a sign you don't have a font installed that can display the glyphs in the page. Most character encoding problems happen when strings are being passed from one system to another. For webapps, this is usually between the browser and the a...
null
CC BY-SA 2.5
null
2008-08-27T04:26:58.737
2008-08-27T04:26:58.737
null
null
3,052
null
29,509
2
null
29,383
3
null
I use a ternary in a printf like this: ``` printf("%s\n", b?"true":"false"); ``` If you macro it : ``` B2S(b) ((b)?"true":"false") ``` then you need to make sure whatever you pass in as `'b'` doesn't have any side effects. And don't forget the brackets around the `'b'` as you could get compile errors.
null
CC BY-SA 3.0
null
2008-08-27T04:19:16.540
2015-11-16T14:28:18.800
2015-11-16T14:28:18.800
1,084
null
null
29,469
2
null
5,473
23
null
If you have not yet garbage collected your repository (e.g. using `git repack -d` or `git gc`, but note that garbage collection can also happen automatically), then your commit is still there – it's just no longer reachable through the HEAD. You can try to find your commit by looking through the output of `git fsck --...
null
CC BY-SA 2.5
null
2008-08-27T03:45:40.223
2008-08-29T01:49:54.603
2008-08-29T01:49:54.603
2,988
2,988
null
29,518
2
null
29,511
1
null
[@Chris](https://stackoverflow.com/questions/29511/ruby-convert-integer-to-string#29513), That's just how [] and [,] are defined for the String class. Check out the [String API](http://ruby-doc.org/core/classes/String.html#M000786).
null
CC BY-SA 2.5
null
2008-08-27T04:31:17.447
2008-08-27T04:31:17.447
2017-05-23T12:19:30.550
-1
1,666
null
29,521
2
null
29,511
15
null
Or you can convert the integer to its character value: ``` a[0].chr ```
null
CC BY-SA 2.5
null
2008-08-27T04:34:03.493
2008-08-27T04:34:03.493
null
null
792
null
29,504
2
null
29,437
5
null
Here's my solution, but even more importantly my approach to solving the problem. I approached the problem by - - - This showed me the pattern: - `iL``a[i]`- `iH``a[i]`- `iH = (i+1)L`- `iL = (i+2)H` This pattern holds for all bytes. Translating into C, this means: ``` a[i] = (iH << 4) OR iL a[i] = ((a[i+1] & 0x...
null
CC BY-SA 3.0
null
2008-08-27T04:16:29.633
2016-02-12T17:53:39.540
2016-02-12T17:53:39.540
116
116
null
29,525
1
29,570
null
1
661
Can anyone tell me what is the ? I've seen a lot of reviews of `opcode cache` but all of them only concentrate on the performance increase. I have a small entry level are a concern for me.
Opcode cache impact on memory usage
CC BY-SA 3.0
0
2008-08-27T04:36:49.757
2016-11-08T16:32:12.907
2016-11-08T16:32:12.907
4,311,889
2,976
[ "php", "opcode-cache" ]
29,524
2
null
29,505
5
null
Generally, no. The stream format for Java serialization is defined [in this document](http://java.sun.com/j2se/1.4/pdf/serial-spec.pdf), but you need access to the original class definitions (and a Java runtime to load them into) to turn the stream data back into something approaching the original objects. For example...
null
CC BY-SA 2.5
null
2008-08-27T04:35:57.700
2008-08-27T05:58:59.390
2008-08-27T05:58:59.390
3,052
3,052
null
29,530
2
null
26,715
7
null
In terms of how you arrange your views, you can put your views in subfolders if you'd like and create your own view structure. All views can always be referenced by their full path using the ~syntax. So if you put Index.aspx in \Views\Feature1\Home then you could reference that view using ~/Views/Feature1/Home/Index.as...
null
CC BY-SA 2.5
null
2008-08-27T04:41:48.920
2008-08-27T04:41:48.920
null
null
598
null
29,531
1
29,534
null
4
2,671
I want to use CodeDOM to both declare and initialize my static field in one statement. How can I do this? ``` // for example public static int MyField = 5; ``` I can seem to figure out how to declare a static field, and I can set its value later, but I can't seem to get the above effect. @lomaxx, Naw, I just want ...
Using .NET CodeDOM to declare and initialize a field in one statement
CC BY-SA 2.5
null
2008-08-27T04:43:00.537
2014-06-24T20:49:53.063
2008-08-27T05:01:36.483
404
404
[ ".net", "codedom" ]
29,533
2
null
4,225
2
null
[CGAL](http://cgal.org/) is a C++ library that has data structures and algorithms used in Computational Geometry.
null
CC BY-SA 2.5
null
2008-08-27T04:43:58.633
2008-08-27T04:43:58.633
null
null
1,630
null
29,529
2
null
29,505
1
null
In theory it's possible. Now how difficult in practice it might be depends on whether Java serialization format is documented or not. I guess, it's not. [oops, I was wrong, thanks Charles](http://java.sun.com/j2se/1.4/pdf/serial-spec.pdf). 1. capture from log4j & deserialize Java object in your own little Java pro...
null
CC BY-SA 2.5
null
2008-08-27T04:41:41.133
2008-08-27T05:18:17.583
2008-08-27T05:18:17.583
275
275
null
29,523
2
null
29,466
25
null
The Wii Remote and Wii Balance Board use bluetooth. You can [pair them with your PC](http://www.wiiprojects.org/bluetooth.html) and write your own PC apps that interact with them (like [this guy](http://www.cs.cmu.edu/~johnny/projects/wii/)). If you want to make something that actually runs on the Wii, you can try fi...
null
CC BY-SA 3.0
null
2008-08-27T04:35:02.540
2013-09-09T14:31:50.610
2013-09-09T14:31:50.610
744
744
null
29,535
2
null
29,505
1
null
I would recommend moving to a third-party format (by creating your own log4j adapters etc) that both languages understand and can easily marshal / unmarshal, e.g. XML.
null
CC BY-SA 2.5
null
2008-08-27T04:45:58.377
2008-08-27T04:45:58.377
null
null
1,666
null
29,532
2
null
29,437
0
null
There are a couple of edge-cases which make this a neat problem: - - Here's a simple solution which loops over the array copying the low-order nibble of the next byte into its high-order nibble, and the high-order nibble of the next-next (+2) byte into its low-order nibble. To save dereferencing the look-ahead point...
null
CC BY-SA 2.5
null
2008-08-27T04:43:40.770
2008-08-27T05:15:40.880
2008-08-27T05:15:40.880
878
878
null
29,537
2
null
29,423
1
null
In my opinion it's only too automated if no one in your production support group can deploy an application manually in a pinch. Automated deployments really cut down on simple but common errors such as configuration mistakes. However, a manual deployment must always be an option.
null
CC BY-SA 2.5
null
2008-08-27T04:47:31.213
2008-08-27T04:47:31.213
null
null
1,644
null
29,534
2
null
29,531
8
null
Once you create your CodeMemberField instance to represent the static field, you can assign the InitExpression property to the expression you want to use to populate the field.
null
CC BY-SA 2.5
null
2008-08-27T04:45:27.617
2008-08-27T04:45:27.617
null
null
3,163
null
29,538
2
null
29,531
1
null
[This post](http://weblogs.asp.net/okloeten/archive/2005/10/15/427549.aspx) by Omer van Kloeten seems to do what you want. Notice that the output has the line: ``` private static Foo instance = new Foo(); ```
null
CC BY-SA 2.5
null
2008-08-27T04:48:30.150
2008-08-27T04:48:30.150
null
null
598
null
29,517
2
null
29,511
6
null
I believe this is changing in Ruby 1.9 such that "asdf"[2] yields "d" rather than the character code
null
CC BY-SA 2.5
null
2008-08-27T04:29:45.313
2008-08-27T04:29:45.313
null
null
3,162
null
29,539
1
86,325
null
213
105,970
Is there a one line function call that quits the program and displays a message? I know in Perl it's as simple as: ``` die("Message goes here") ``` I'm tired of typing this: ``` puts "Message goes here" exit ```
How to create an exit message
CC BY-SA 3.0
0
2008-08-27T04:48:50.417
2017-04-19T08:51:30.933
2017-02-03T17:30:21.967
128,421
422
[ "ruby" ]
29,536
2
null
29,383
4
null
If you decide to use macros (or are using C on a future project) you should add parenthesis around the 'b' in the macro expansion (I don't have enough points yet to edit other people's content): ``` #define BOOL_STR(b) ((b)?"true":"false") ``` This is a [defensive programming](http://www.embedded.com/1999/9912/9912f...
null
CC BY-SA 2.5
null
2008-08-27T04:46:15.413
2008-09-05T17:58:15.233
2008-09-05T17:58:15.233
346
346
null
29,543
2
null
29,067
0
null
If you are going to do it from a place where you don't have an instance of a page then you need to go one step further (e.g. from a webservice to return html or from a task rendering emails) ``` var myPage = new System.Web.UI.Page(); var myControl = (Controls.MemberRating)myPage.LoadControl("~/Controls/MemberRating.as...
null
CC BY-SA 2.5
null
2008-08-27T04:52:59.797
2008-08-27T04:52:59.797
null
null
2,279
null
29,542
2
null
4,849
1
null
If you can find out the on screen position of the part of the page you are interested in, you could compare this with the position of the mouse when you receive the drop event. I'm not sure how practical this is if you can get the info out of the DOM or whatnot. As an alternative could you implement the mouse events o...
null
CC BY-SA 2.5
null
2008-08-27T04:52:30.250
2008-08-27T04:52:30.250
null
null
2,925
null
29,545
2
null
27,009
13
null
Make liberal use of [SuppressMessage] attribute to begin with. At least at the beginning. Once you get the count to 0 via the attribute, you then put in a rule that new checkins may not introduce FxCop violations. Visual Studio 2008 has a nice code analysis feature that allows you to ensure that code analysis runs on...
null
CC BY-SA 2.5
null
2008-08-27T04:53:45.520
2008-08-27T04:53:45.520
null
null
598
null