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
20,024
2
null
19,995
2
null
It's possible to achive what you're aiming at through the use of persistent http connections. Check out the [Comet article](http://en.wikipedia.org/wiki/Comet_%28programming%29) over at wikipedia, that's a good place to start. You're not providing much info but if you're looking at building some kind of event-driven ...
null
CC BY-SA 2.5
null
2008-08-21T14:11:10.597
2008-11-28T09:26:47.317
2008-11-28T09:26:47.317
745
2,114
null
20,056
2
null
20,047
7
null
> Will you care if your user profile is a few seconds out of date? Nope - that's perfectly acceptable. Setting the base transaction isolation level is probably the best/cleanest way to go.
null
CC BY-SA 2.5
null
2008-08-21T14:22:43.563
2008-08-21T14:22:43.563
null
null
35
null
20,054
1
20,072
null
5
2,341
I shudder to ask, but my client might offer no other SQL (or SQL-like) solution. I know Access has some SQL hooks; are they enough for basic ActiveRecord? I appreciate all the suggestions to use other databases, but trust me: I've tried convincing them. There is an "approved" list, and no SQL databases are on it. ...
Any tips on getting Rails to run with an Access back-end?
CC BY-SA 2.5
0
2008-08-21T14:21:55.687
2009-03-10T04:13:42.590
2009-01-27T06:15:22.063
1,348
1,190
[ "ruby-on-rails", "ruby", "ms-access", "activerecord" ]
20,049
2
null
930
4
null
If you are querying a SQL Server database (Version 7 and up) you should replace the OleDb classes with corresponding classes in the [System.Data.SqlClient](https://learn.microsoft.com/en-us/dotnet/api/system.data.sqlclient) namespace ([SqlConnection](https://learn.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sq...
null
CC BY-SA 4.0
null
2008-08-21T14:19:29.530
2019-12-18T12:26:06.507
2019-12-18T12:26:06.507
5,407,188
202
null
20,058
2
null
20,040
2
null
Start with the basics before you get to the higher level stuff like web services (though that is important too). The most important things you need to learn, as a project manager, are the things you're going to be questioning your underlings about later. For example, my PM (also a PHP guy) has absolutely no knowledge o...
null
CC BY-SA 2.5
null
2008-08-21T14:23:40.753
2008-08-24T07:13:01.827
2008-08-24T07:13:01.827
1,975,282
1,975,282
null
20,047
1
21,158
null
82
29,254
We're seeing some pernicious, but rare, deadlock conditions in the Stack Overflow SQL Server 2005 database. I attached the profiler, set up a trace profile using [this excellent article on troubleshooting deadlocks](http://www.simple-talk.com/sql/learn-sql-server/how-to-track-down-deadlocks-using-sql-server-2005-profi...
Diagnosing Deadlocks in SQL Server 2005
CC BY-SA 3.0
0
2008-08-21T14:18:41.640
2017-12-24T04:25:39.473
2011-12-06T23:55:00.027
396,458
1
[ "sql-server", "sql-server-2005", "deadlock" ]
20,061
1
20,130
null
16
9,393
I've recently taken up learning some C# and wrote a Yahtzee clone. My next step (now that the game logic is in place and functioning correctly) is to integrate some method of keeping stats across all the games played. My question is this, how should I go about storing this information? My first thought would be to u...
Store data from a C# application
CC BY-SA 3.0
0
2008-08-21T14:24:25.120
2012-07-03T13:29:48.633
2012-07-03T13:29:48.633
50,776
271
[ "c#", ".net" ]
20,067
2
null
20,059
7
null
I recently saw a presentation about [GreenFoot](http://www.greenfoot.org/) (a java based learning environment for children). It looked awesome. If I would have kids, I would give it a try [Link to the presentation](http://www.youtube.com/watch?v=Tcwx-I6Arwk) It is a very playful environment, where you could start wit...
null
CC BY-SA 2.5
null
2008-08-21T14:25:51.980
2008-08-21T14:25:51.980
null
null
1,870
null
20,068
2
null
20,059
1
null
I think Java might be a good choice simply because you can make GUIs easily, and see "cool things" happening. For the same reason, maybe any of the .NET languages. I've also heard good things about scripting languages (Ruby and Python, especially) for getting kids to learn how to program.
null
CC BY-SA 2.5
null
2008-08-21T14:26:29.017
2008-08-21T14:26:29.017
null
null
572
null
20,072
2
null
20,054
3
null
It's a long shot but there's an [ODBC adapter for ActiveRecord](http://odbc-rails.rubyforge.org/) that might work.
null
CC BY-SA 2.5
null
2008-08-21T14:27:24.880
2008-08-21T14:27:24.880
null
null
1,450
null
20,071
2
null
20,059
6
null
Check out [Phrogram](http://phrogram.com/) (formerly KPL) and [Alice](http://www.alice.org/)
null
CC BY-SA 2.5
null
2008-08-21T14:27:00.030
2008-08-21T14:27:00.030
null
null
1,097
null
20,059
1
20,132
null
45
8,592
What languages and tools do you consider a youngster starting out in programming should use in the modern era? Lots of us started with proprietary Basics and they didn't do all of us long term harm :) but given the experiences you have had since then and your knowledge of the domain now are there better options? Ther...
Suggestions on starting a child programming
CC BY-SA 2.5
0
2008-08-21T14:23:53.483
2010-12-04T12:16:34.267
2017-05-23T12:13:37.900
-1
269
[ "language-agnostic", "children" ]
20,075
2
null
20,040
1
null
The biggest thing you'll probably want to learn is the differences between Windows and non-Windows programmers. They approach fundamental things differently. Knowing the difference will be key to successfully managing the project. If you listen to the stack overflow podcast, and Jeff and Joel have multiple discussio...
null
CC BY-SA 2.5
null
2008-08-21T14:27:46.203
2008-08-21T14:27:46.203
null
null
1,942
null
20,023
2
null
9,173
2
null
I don't think this is a code issue. What I can see happening is that one of your existing references probably rely on that type in their own types which you are probably creating in your application. If that is the case you do need that reference even if you don't explicitly use the type and even though the other refe...
null
CC BY-SA 2.5
null
2008-08-21T14:11:02.750
2008-08-21T14:11:02.750
null
null
1,120
null
20,069
2
null
20,063
15
null
Pretty much everybody is using [getopt](http://python.active-venture.com/lib/module-getopt.html) Here is the example code for the doc : ``` import getopt, sys def main(): try: opts, args = getopt.getopt(sys.argv[1:], "ho:v", ["help", "output="]) except getopt.GetoptError: # print help informa...
null
CC BY-SA 3.0
null
2008-08-21T14:26:57.097
2014-07-16T17:36:53.513
2014-07-16T17:36:53.513
296,460
446,497
null
20,078
2
null
20,059
3
null
How old? Lots of us stared with BASIC at some point, but before then, I learned the concepts of stringing commands together, variables, and looping with LOGO. Figuring out how to draw a circle with a triangle that can only go in a straight line and turn was my very first programming accomplishment. Edit: This questi...
null
CC BY-SA 2.5
null
2008-08-21T14:28:41.583
2008-08-21T14:44:42.653
2008-08-21T14:44:42.670
35
35
null
20,077
2
null
20,059
8
null
For a child, I would go with [Alice](http://www.alice.org/). Any kid is going to like the drag-and-drop interaction that Alice uses better than trying to remember how to spell and punctuate any programming language. He/She will learn the basic programming structures (conditionals, loops, etc.) and will experience the...
null
CC BY-SA 2.5
null
2008-08-21T14:28:23.567
2008-08-21T14:28:23.567
null
null
271
null
20,080
2
null
20,059
5
null
I'd recommend python, because it's so terse and expressive. Seems less likely to frustrate when getting started, but offers plenty of room to learn more advanced concepts as well.
null
CC BY-SA 2.5
null
2008-08-21T14:29:47.230
2009-01-17T16:29:19.660
2009-01-17T16:29:19.660
31,615
794
null
20,063
1
26,910
null
340
326,771
What's the , , and most method or library for parsing Python command line arguments?
What's the best way to parse command line arguments?
CC BY-SA 3.0
0
2008-08-21T14:24:41.530
2022-07-02T02:39:15.133
2018-03-19T23:35:19.367
6,622,817
1,335
[ "python", "command-line", "command-line-arguments" ]
20,065
2
null
20,063
14
null
Use `optparse` which comes with the standard library. For example: ``` #!/usr/bin/env python import optparse def main(): p = optparse.OptionParser() p.add_option('--person', '-p', default="world") options, arguments = p.parse_args() print 'Hello %s' % options.person if __name__ == '__main__': main() ``` ...
null
CC BY-SA 3.0
null
2008-08-21T14:25:19.767
2015-05-01T19:37:29.157
2017-05-23T11:54:59.723
-1
1,595
null
20,021
1
20,215
null
11
1,708
I'm currently looking at the Python framework Django for future db-based web apps as well as for a port of some apps currently written in PHP. One of the nastier issues during my last years was keeping track of database schema changes and deploying these changes to productive systems. I haven't dared asking for being a...
Version track, automate DB schema changes with django
CC BY-SA 2.5
null
2008-08-21T14:10:25.123
2013-07-23T15:19:07.270
2017-05-23T11:48:37.237
-1
2,077
[ "database", "django", "svn" ]
20,082
2
null
20,040
1
null
The #1 thing you need to be aware of (and I'm guessing you probably already are) is that the guys doing the coding know what they are doing. Depending on the personailties of the members of your team, you should be able to find someone who is willing and able to explain any of the intricacies to you on an as-required...
null
CC BY-SA 2.5
null
2008-08-21T14:30:19.037
2008-08-21T14:30:19.037
null
null
377
null
20,089
2
null
20,061
3
null
I don't know if a database is necessarily what you want. That may be overkill for storing stats for a simple game like that. Databases are good; but you should not automatically use one in every situation (I'm assuming that this is a client application, not an online game). Personally, for a game that exists only on t...
null
CC BY-SA 2.5
null
2008-08-21T14:32:19.923
2008-08-21T14:32:19.923
null
null
1,975,282
null
20,087
2
null
20,061
13
null
A database would probably be overkill for something like this - start with storing your information in an XML doc (or series of XML docs, if there's a lot of data). You get all that nifty XCopy deployment stuff, you can still use LINQ, and it would be a smooth transition to a database if you decided later you really n...
null
CC BY-SA 2.5
null
2008-08-21T14:31:47.863
2008-08-21T14:31:47.863
null
null
35
null
20,086
2
null
20,061
7
null
A database may be overkill - have you thought about just storing the scores in a file? If you decide to go with a database, you might consider [SQLite](http://sqlite.org/), which you can distribute just like a file. There's an open source .NET provider - [System.Data.SQLite](http://sqlite.phxsoftware.com/) - that incl...
null
CC BY-SA 2.5
null
2008-08-21T14:31:45.353
2008-08-21T14:31:45.353
2017-05-23T12:17:02.420
-1
521
null
20,081
1
97,091
null
4
6,337
I've written PL/SQL code to denormalize a table into a much-easer-to-query form. The code uses a temporary table to do some of its work, merging some rows from the original table together. The logic is written as a [pipelined table function](http://www.oreillynet.com/lpt/a/3136), following the pattern from the linked ...
Best way to encapsulate complex Oracle PL/SQL cursor logic as a view?
CC BY-SA 2.5
0
2008-08-21T14:29:48.773
2019-02-05T07:06:14.957
2008-09-18T16:10:23.977
726
726
[ "sql", "oracle", "plsql" ]
20,083
2
null
20,059
2
null
Though _why hasn't given it much love in the past year or so, for a while I was really excited about [Hackety Hack](http://hacketyhack.net/). I think the key for most new programmers, especially children who are more than apt to losing interest in things, is instantaneous feedback. That was the really wonderful thing a...
null
CC BY-SA 2.5
null
2008-08-21T14:30:52.827
2008-08-21T14:30:52.827
null
null
2,286
null
20,088
1
20,114
null
109
302,633
I am maintaining a few web applications. The development and qa environments use invalid/outdated ssl-certificates. Although it is generally a good thing, that Firefox makes me click like a dozen times to accept the certificate, this is pretty annoying. Is there a configuration-parameter to make Firefox (and possibly...
Is there a way to make Firefox ignore invalid ssl-certificates?
CC BY-SA 3.0
0
2008-08-21T14:31:50.063
2022-04-16T01:24:50.773
2022-04-16T01:24:50.773
114,029
1,870
[ "debugging", "ssl", "firefox", "ssl-certificate" ]
20,090
2
null
20,059
5
null
> For a child, I would go with Alice. Here is another vote for Alice. My 4 kids have had a ton of fun working with it and learning the basic concepts of programming. Of course to them it's all about socializing with fairies and ogres, but heck the darn legacy system I work on could use some faries and ogres too.
null
CC BY-SA 2.5
null
2008-08-21T14:32:34.803
2008-08-21T14:32:34.803
null
null
1,327
null
20,092
2
null
20,059
2
null
I think you should start them off in C. The sooner they can get the hang of pointers the better. See [Understanding Pointers](https://stackoverflow.com/questions/5727/understanding-pointers) and [Should I learn C](https://stackoverflow.com/questions/296/should-i-learn-c).
null
CC BY-SA 2.5
null
2008-08-21T14:32:55.193
2008-08-21T14:32:55.193
2017-05-23T11:48:37.237
-1
381
null
20,093
2
null
20,059
13
null
I'll second Geoff's suggestions of [Phrogram (used to be KPL)](http://phrogram.com/), and [Alice](http://www.alice.org/). My only other suggestion is [Lego Mindstorms NXT](http://mindstorms.lego.com/). The NXT's programming language is drag-and-drop, is very easy to use, and can do some very complicated tasks once yo...
null
CC BY-SA 2.5
null
2008-08-21T14:33:45.817
2008-08-21T14:33:45.817
null
null
100
null
20,095
2
null
20,061
4
null
[SQL Express](http://www.microsoft.com/sql/editions/express/default.mspx) from MS is a great free, lightweight version of their SQL Server database. You could try that if you go the DB route. Alternatively, you could simply create datasets within the application and serialize them to xml, or you could use something li...
null
CC BY-SA 2.5
null
2008-08-21T14:34:15.300
2008-08-21T14:34:15.300
null
null
1,365
null
20,101
2
null
20,047
14
null
Are you instantiating a new LINQ to SQL DataContext object for every operation or are you perhaps sharing the same static context for all your calls? I originally tried the latter approach, and from what I remember, it caused unwanted locking in the DB. I now create a new context for every atomic operation.
null
CC BY-SA 2.5
null
2008-08-21T14:35:41.973
2008-08-21T14:35:41.973
null
null
1,436
null
20,084
1
985,495
null
86
57,618
Following on from my [previous question](https://stackoverflow.com/questions/19454/enforce-attribute-decoration-of-classesmethods) I have been working on getting my object model to serialize to XML. But I have now run into a problem (quelle surprise!). The problem I have is that I have a collection, which is of a abst...
XML Serialization and Inherited Types
CC BY-SA 3.0
0
2008-08-21T14:30:53.497
2015-08-21T12:46:19.117
2017-05-23T12:00:17.880
-1
832
[ "c#", "xml", "inheritance", "serialization", "xml-serialization" ]
20,094
2
null
20,047
0
null
I would have to agree with Greg so long as setting the isolation level to read uncommitted doesn't have any ill effects on other queries. I'd be interested to know, Jeff, how setting it at the database level would affect a query such as the following: ``` Begin Tran Insert into Table (Columns) Values (Values) Select ...
null
CC BY-SA 2.5
null
2008-08-21T14:33:57.843
2008-08-21T14:33:57.843
null
null
383
null
20,098
2
null
20,084
9
null
One thing to look at is the fact that in the XmlSerialiser constructor you can pass an array of types that the serialiser might be having difficulty resolving. I've had to use that quite a few times where a collection or complex set of datastructures needed to be serialised and those types lived in different assemblies...
null
CC BY-SA 2.5
null
2008-08-21T14:35:04.173
2008-08-21T14:40:35.317
2008-08-21T14:40:35.317
1,120
1,120
null
20,097
2
null
20,084
1
null
I've done things similar to this. What I normally do is make sure all the XML serialization attributes are on the concrete class, and just have the properties on that class call through to the base classes (where required) to retrieve information that will be de/serialized when the serializer calls on those properties....
null
CC BY-SA 2.5
null
2008-08-21T14:34:43.910
2008-08-21T14:34:43.910
null
null
1,975,282
null
20,105
2
null
20,047
1
null
> Will you care if your user profile is a few seconds out of date? A few seconds would definitely be acceptable. It doesn't seem like it would be that long, anyways, unless a huge number of people are submitting answers at the same time.
null
CC BY-SA 2.5
null
2008-08-21T14:36:37.930
2008-08-21T14:36:37.930
null
null
1,497
null
20,113
2
null
20,088
2
null
Using a free certificate is a better idea if your developers use Firefox 3. Firefox 3 complains loudly about self-signed certificates, and it is a major annoyance.
null
CC BY-SA 2.5
null
2008-08-21T14:37:31.687
2008-08-21T14:37:31.687
null
null
400,427
null
20,100
2
null
20,088
2
null
Instead of using invalid/outdated SSL certificates, why not use self-signed SSL certificates? Then you can add an exception in Firefox for just that site.
null
CC BY-SA 2.5
null
2008-08-21T14:35:41.723
2008-08-21T14:35:41.723
null
null
1,960
null
20,111
2
null
20,088
0
null
The [MitM Me addon](https://addons.mozilla.org/en-US/firefox/addon/6843) will do this - but I think self-signed certificates is probably a better solution.
null
CC BY-SA 2.5
null
2008-08-21T14:37:26.290
2008-08-21T14:37:26.290
null
null
521
null
20,117
2
null
20,061
1
null
You can either use the `System::Xml` namespace or the `System::Data` namespace. The first gives you raw XML, the latter gives you a handy wrapper to the XML.
null
CC BY-SA 3.0
null
2008-08-21T14:38:57.863
2012-07-03T13:20:51.900
2012-07-03T13:20:51.900
142,162
1,898
null
20,115
2
null
20,059
3
null
I think python is a good alternative; it is a very powerful language also you can easily do a lot of things (not boring at all).
null
CC BY-SA 2.5
null
2008-08-21T14:37:51.750
2008-08-21T14:37:51.750
null
null
2,143
null
20,114
2
null
20,088
26
null
Go to Tools > Options > Advanced "Tab"(?) > Encryption Tab Click the "Validation" button, and uncheck the checkbox for checking validity Be advised though that this is pretty unsecure as it leaves you wide open to accept any invalid certificate. I'd only do this if using the browser on an Intranet where the validity ...
null
CC BY-SA 2.5
null
2008-08-21T14:37:43.293
2008-08-21T14:37:43.293
null
null
392
null
20,120
2
null
20,107
2
null
As long as your styles are loaded after the reset ones they should work. What browser is this? because I work in a similar way myself and I've not hit this problem I wonder if it's something in my testing at fault.
null
CC BY-SA 2.5
null
2008-08-21T14:39:43.023
2008-08-21T14:39:43.023
null
null
269
null
20,126
2
null
20,084
3
null
Seriously, an extensible framework of POCOs will never serialize to XML reliably. I say this because I can guarantee someone will come along, extend your class, and botch it up. You should look into using XAML for serializing your object graphs. It is designed to do this, whereas XML serialization isn't. The Xaml...
null
CC BY-SA 3.0
null
2008-08-21T14:41:03.693
2015-08-21T12:46:19.117
2015-08-21T12:46:19.117
null
null
null
20,118
2
null
20,107
19
null
If your strong declaration comes after YUI's yours should override it. You can force it like this: ``` strong, b, strong *, b * { font-weight: bold; } em, i, em *, i * { font-style: italic; } ``` If you still support IE7 you'll need to add `!important`. ``` strong, b, strong *, b * { font-weight: bold !important; }...
null
CC BY-SA 3.0
null
2008-08-21T14:39:10.810
2015-08-06T20:52:31.960
2015-08-06T20:52:31.960
437
521
null
20,119
2
null
20,054
1
null
Another option that is more complicated but could work if you were forced to do it, is to write a layer of RESTful web services that will expose Access to rails. If you are careful in your design, those RESTful web services can be consumed directly by ActiveResoure which will give you a lot of the functionality of Acti...
null
CC BY-SA 2.5
null
2008-08-21T14:39:27.283
2008-08-21T14:39:27.283
null
null
1,486
null
20,131
2
null
20,059
1
null
Well, if they're young and haven't learnt their ABC's you could try them on BF - non of those pesky letters and numbers to deal with. I'll get me' coat. Skizz
null
CC BY-SA 2.5
null
2008-08-21T14:42:57.277
2008-08-21T14:42:57.277
null
null
1,898
null
20,133
2
null
18,324
6
null
The problem turned out to be that I wasn't setting up my descriptor tables correctly. I had one bit flipped wrong so instead of going to 16-bit mode I was going to 32-bit mode (with segments that happened to have a limit of one meg). Thanks for the suggestions! Terry
null
CC BY-SA 2.5
null
2008-08-21T14:43:15.480
2008-08-21T14:43:15.480
null
null
2,171
null
20,130
2
null
20,061
17
null
Here is one idea: use Xml Serialization. Design your GameStats data structure and optionally use Xml attributes to influence the schema as you like. I like to use this method for small data sets because its quick and easy and all I need to do is design and manipulate the data structure. ``` using (FileStream fs = ne...
null
CC BY-SA 2.5
null
2008-08-21T14:42:36.560
2008-08-21T14:42:36.560
null
null
1,254
null
20,132
2
null
20,059
43
null
I would suggest [LEGO Mindstorm](http://mindstorms.lego.com/Products/Default.aspx), it provides an intuitive drag and drop interface for programming and because it comes with hardware it provides something tangible for a child to grasp. Also, because it is "LEGO" they might think of it as more of a game then a programm...
null
CC BY-SA 2.5
null
2008-08-21T14:43:13.670
2008-08-21T14:43:13.670
null
null
1,377
null
20,138
2
null
20,107
7
null
I would use this rule to override the YUI reset: ``` strong, b, strong *, b * { font-weight: bold; } em, i, em *, i * { font-style: italic; } ```
null
CC BY-SA 3.0
null
2008-08-21T14:46:44.723
2016-01-14T20:07:02.937
2016-01-14T20:07:02.937
2,678,454
1,414
null
20,141
2
null
20,127
0
null
Optimising bytecode is probably an oxymoron in most cases. Unless you control the VM, you have no idea what it does to speed up code execution, if anything. The compiler would need to know the details of the VM in order to generate optimised code.
null
CC BY-SA 3.0
null
2008-08-21T14:47:55.953
2012-07-03T13:22:36.597
2012-07-03T13:22:36.597
142,162
1,898
null
20,140
2
null
20,061
1
null
I would recommend just using a database. I would recommend using LINQ or an ORM tool to interact with the database. For learning LINQ, I would take a look at Scott Guthrie's posts. I think there are 9 of them all together. I linked part 1 below. If you want to go with an ORM tool, say nhibernate, then I would reco...
null
CC BY-SA 2.5
null
2008-08-21T14:47:24.363
2008-08-21T14:47:24.363
null
null
1,117
null
20,116
2
null
20,040
3
null
The number one rule is do NOT just ask for status updates. It is Especially when phrases like "where are we on this?" are used. If you aren't directly involved in the details then just make sure you have established communication times or plans so that you know whats going on rather than asking for updates.
null
CC BY-SA 2.5
null
2008-08-21T14:37:57.710
2008-08-21T14:37:57.710
null
null
1,940
null
20,127
1
20,870
null
12
4,117
I am messing around with [a toy interpreter in Java](http://code.google.com/p/zemscript/) and I was considering trying to write a simple compiler that can generate bytecode for the Java Virtual Machine. Which got me thinking, how much optimization needs to be done by compilers that target virtual machines such as JVM a...
Virtual Machine Optimization
CC BY-SA 2.5
null
2008-08-21T14:41:31.023
2012-07-03T13:22:57.827
2008-08-21T14:42:13.737
35
486
[ "java", "jvm", "jit", "cil" ]
20,139
2
null
19,843
2
null
One more way to do it, this time some reflection in the mix: ``` static class Parser { public static bool TryParse<TType>( string str, out TType x ) { // Get the type on that TryParse shall be called Type objType = typeof( TType ); // Enumerate the methods of TType foreach( Met...
null
CC BY-SA 2.5
null
2008-08-21T14:46:46.097
2008-08-21T14:46:46.097
null
null
1,810
null
20,129
2
null
20,059
3
null
Checkout [Squeak](http://squeak.org/) developed by [Alan Kay](http://en.wikipedia.org/wiki/Alan_Kay) who think programming should be taught at early ages.
null
CC BY-SA 2.5
null
2008-08-21T14:42:15.017
2008-08-21T14:42:15.017
null
null
842
null
20,143
2
null
20,047
0
null
It's fine with me if my profile is even several minutes out of date. Are you re-trying the read after it fails? It's certainly possible when firing a ton of random reads that a few will hit when they can't read. Most of the applications that I work with are very few writes compared to the number of reads and I'm sur...
null
CC BY-SA 2.5
null
2008-08-21T14:48:35.343
2008-08-21T14:48:35.343
null
null
791
null
20,144
2
null
20,061
2
null
I'd recommend saving your data in simple POCOs and either serializing them to xml or a binary file, like Brian did above. If you're hot for a database, I'd suggest [Sql Server Compact Edition](http://www.microsoft.com/sql/editions/compact/default.mspx), or [VistaDB](http://www.vistadb.net/). Both are hosted inproc wi...
null
CC BY-SA 2.5
null
2008-08-21T14:49:24.843
2008-08-21T14:49:24.843
null
null
null
null
20,150
2
null
20,146
0
null
I don't know of any built in (within the framework) classes to do this, but I imagine it wouldn't be too much of an issue to roll your own.. Obviously it depends on the type of data you want to write to it, and the "security" required.. [This article](http://www.developerfusion.co.uk/show/3913/) on DevFusion may be a...
null
CC BY-SA 2.5
null
2008-08-21T14:52:41.887
2008-08-21T14:52:41.887
null
null
832
null
20,151
2
null
20,127
4
null
> Optimising bytecode is probably an oxymoron in most cases I don't think that's true. Optimizations like hoisting loop invariants and propagating constants can never hurt, even if the JVM is smart enough to do them on its own, by simple virtue of making the code do less work.
null
CC BY-SA 2.5
null
2008-08-21T14:52:55.690
2008-08-21T14:52:55.690
null
null
2,131
null
20,147
2
null
20,047
3
null
@Jeff - I am definitely not an expert on this, but I have had good results with instantiating a new context on almost every call. I think it's similar to creating a new Connection object on every call with ADO. The overhead isn't as bad as you would think, since connection pooling will still be used anyway. I just use...
null
CC BY-SA 2.5
null
2008-08-21T14:50:34.450
2008-08-21T15:22:45.230
2008-08-21T15:22:45.230
1,436
1,436
null
20,154
2
null
19,838
10
null
The concept of closures requires the concept of contexts. C's context is based on the stack and the registers of the CPU, so to create a block/closure, you need to be able to manipulate the stack pointer in a correct (and reentrant) way, and store/restore registers as needed. The way this is done by interpreters or vi...
null
CC BY-SA 3.0
null
2008-08-21T14:53:49.933
2011-12-26T02:00:48.957
2011-12-26T02:00:48.957
39,992
2,018
null
20,153
2
null
20,146
9
null
Path.GetTempFileName and Path.GetTempPath. Then you can use [this link](https://web.archive.org/web/20091108030151/http://www.csharphelp.com/archives2/archive315.html) to read/write encrypted data to the file. Note, .NET isn't the best platform for critical security apps. You have to be well versed in how the CLR wo...
null
CC BY-SA 3.0
null
2008-08-21T14:53:04.473
2014-11-03T09:21:50.857
2014-11-03T09:21:50.857
2,213,647
null
null
20,148
1
null
null
891
303,419
I'm working on a projects which involves a lot of database writes, I'd say (). This ratio would also include updates which I consider to be one read and one write. The reads can be dirty (e.g. I don't need 100% accurate information at the time of read). The task in question will be doing over 1 million database trans...
MyISAM versus InnoDB
CC BY-SA 3.0
0
2008-08-21T14:50:52.780
2020-02-07T10:14:28.370
2013-02-26T21:30:14.330
19,679
2,013
[ "mysql", "database", "performance", "innodb", "myisam" ]
20,146
1
null
null
17
39,801
I'm looking for something like the `tempfile` module in Python: A (preferably) secure way to open a file for writing to. This should be easy to delete when I'm done too... It seems, .NET does not have the "batteries included" features of the `tempfile` module, which not only creates the file, but returns the file descr...
How to create a temporary file (for writing to) in C#?
CC BY-SA 4.0
null
2008-08-21T14:50:03.623
2022-06-03T09:39:19.540
2022-06-03T09:39:19.540
366,904
2,260
[ "c#", ".net", "windows", "temporary-files" ]
20,145
2
null
20,107
6
null
If in addition to using YUI reset.css, you also use YUI base.css, then you will be all set with a standard set of cross browser base styles. LINK: [http://developer.yahoo.com/yui/base/](http://developer.yahoo.com/yui/base/)
null
CC BY-SA 2.5
null
2008-08-21T14:49:52.767
2008-08-21T14:49:52.767
null
null
653
null
20,156
1
20,175
null
225
66,154
Is there an easy way in C# to create [Ordinals](http://en.wikipedia.org/wiki/Ordinal_numbers_%28linguistics%29) for a number? For example: - - - - Can this be done through `String.Format()` or are there any functions available to do this?
Is there an easy way to create ordinals in C#?
CC BY-SA 3.0
0
2008-08-21T14:55:48.947
2022-09-01T21:33:02.320
2011-09-26T13:04:21.650
95
383
[ "c#", ".net", "ordinals" ]
20,160
2
null
18,943
2
null
Prefer applications that integrate with [Gnome Keyring](http://live.gnome.org/GnomeKeyring). Another possibility is to use an SSH tunnel to an external machine and run apps through that. Take a look at the `-D` option for creating a local SOCKS proxy interface, rather than single-serving `-L` forwards.
null
CC BY-SA 2.5
null
2008-08-21T14:57:38.333
2008-08-21T14:57:38.333
null
null
954
null
20,107
1
20,118
null
12
11,520
This line in YUI's [Reset CSS](http://developer.yahoo.com/yui/reset/) is causing trouble for me: ``` address,caption,cite,code,dfn,em,strong,th,var { font-style: normal; font-weight: normal; } ``` It makes my `em` not italic and my `strong` not bold. Which is okay. I know how to override that in my own style...
YUI Reset CSS Makes <strong><em>this not work</em></strong>
CC BY-SA 3.0
0
2008-08-21T14:36:41.097
2016-01-14T20:07:02.937
2016-01-14T19:55:06.183
2,678,454
437
[ "css", "yui" ]
20,168
1
20,181
null
3
5,294
Regarding the same program as [my question a few minutes ago](https://stackoverflow.com/questions/20061/store-data-from-a-c-application)... I added a setup project and built an MSI for the program (just to see if I could figure it out) and it works great except for one thing. When I tried to install it on my parent's ...
C# application detected as a virus
CC BY-SA 2.5
0
2008-08-21T14:59:48.157
2009-02-13T23:47:57.587
2017-05-23T12:19:33.570
-1
271
[ "c#", ".net", "antivirus" ]
20,162
2
null
20,107
3
null
I had a similar problem when I added the YUI Reset to the top of my stock CSS file. I found that the best thing for me was to simply remove all of the ``` font-weight: normal; ``` declarations from the YUI Reset. I haven't noticed that this has affected anything "cross-browser." All my declarations were after the ...
null
CC BY-SA 3.0
null
2008-08-21T14:58:44.180
2013-06-01T02:36:22.973
2013-06-01T02:36:22.973
2,156,756
666
null
20,170
2
null
20,059
2
null
I think the first question is: what sort of program would it be interesting to create? One of the things that got me started with programming as a kid (in BBC basic and then QBasic) was the ease of writing graphical programs. I could write a couple of lines of code and see my program draw a line on the screen straight ...
null
CC BY-SA 2.5
null
2008-08-21T15:01:07.590
2008-08-21T15:01:07.590
null
null
1,105
null
20,173
1
20,178
null
7
2,108
Does anyone have any experience getting MSTest to copy hibernate.cfg.xml properly to the output directory? All my MSTests fail with a cannot find hibernate.cfg.xml error (I have it set to Copy Always), but my MBUnit tests pass.
MSTest and NHibernate
CC BY-SA 2.5
0
2008-08-21T15:02:53.110
2008-12-27T15:01:53.240
null
null
1,975
[ "nhibernate", "mstest", "mbunit" ]
20,166
2
null
20,156
16
null
You'll have to roll your own. From the top of my head: ``` public static string Ordinal(this int number) { var work = number.ToString(); if ((number % 100) == 11 || (number % 100) == 12 || (number % 100) == 13) return work + "th"; switch (number % 10) { case 1: work += "st"; break; case 2: work += ...
null
CC BY-SA 3.0
null
2008-08-21T14:59:10.967
2014-08-04T21:20:18.347
2014-08-04T21:20:18.347
414
414
null
20,165
2
null
20,059
1
null
I would go with what I wish I had known first: a simple MS-DOS box and the integrated assembler (debug). It is great to really learn and understand the basics of talking to a computer. If that does not scare away a child, then I would go the "next level up" and introduce C. This shouldn't be hard given that the basic ...
null
CC BY-SA 2.5
null
2008-08-21T14:58:59.530
2008-08-21T14:58:59.530
null
null
1,398
null
20,142
2
null
482
22
null
A better workaround (depending on the size of the datasource) is to declare two `BindingSource` objects (new as of 2.00) bind the collection to those and then bind those to the comboboxes. I enclose a complete example. ``` using System; using System.Collections.Generic; using System.ComponentModel; using System.Data;...
null
CC BY-SA 3.0
null
2008-08-21T14:48:34.283
2012-10-14T12:35:23.653
2012-10-14T12:35:23.653
967,315
1,143
null
20,177
2
null
20,168
-1
null
The very first thing to do would be to scan your build PC for viruses.
null
CC BY-SA 2.5
null
2008-08-21T15:05:37.097
2008-10-10T07:21:17.543
2008-10-10T07:21:17.543
3,560
35
null
20,178
2
null
20,173
12
null
You can try adding the DeploymentItemAttribute to one of your tests, or edit your .testrunconfig file and add the file to the Deployment list.
null
CC BY-SA 2.5
null
2008-08-21T15:07:13.223
2008-08-21T15:07:13.223
null
null
null
null
20,169
2
null
20,063
7
null
Just in case you might need to, this may help if you need to unicode arguments on Win32 (2K, XP etc): ``` from ctypes import * def wmain(argc, argv): print argc for i in argv: print i return 0 def startup(): size = c_int() ptr = windll.shell32.CommandLineToArgvW(windll.kernel32.GetComman...
null
CC BY-SA 2.5
null
2008-08-21T14:59:54.193
2008-08-21T14:59:54.193
null
null
1,697
null
20,181
2
null
20,168
3
null
Indeed, boot from a clean CD (use a known good machine to build [BartPE](http://nu2.nu/pebuilder/) or something similar) and scan your machine thoroughly. Another good thing to check, though, would be exactly which virus Avast! thinks your program is. Once you know that, you should be able to look it up in one of the...
null
CC BY-SA 2.5
null
2008-08-21T15:10:33.777
2008-08-21T15:10:33.777
null
null
1,432
null
20,186
2
null
20,107
2
null
Reset stylesheets are best used as a base. If you don't want to reset em or strong, remove them from the stylesheet.
null
CC BY-SA 2.5
null
2008-08-21T15:13:15.627
2008-08-21T15:13:15.627
null
null
96
null
20,175
2
null
20,156
345
null
This page gives you a complete listing of all custom numerical formatting rules: [Custom numeric format strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-numeric-format-strings) As you can see, there is nothing in there about ordinals, so it can't be done using `String.Format`. However its no...
null
CC BY-SA 4.0
null
2008-08-21T15:03:47.973
2020-08-17T22:56:58.297
2020-08-17T22:56:58.297
1,364,007
1,908
null
20,185
1
20,200
null
5
1,472
I have a collection of classes that inherit from an abstract class I created. I'd like to use the abstract class as a factory for creating instances of concrete implementations of my abstract class. Is there any way to hide a constructor from all code except a parent class. I'd like to do this basically ``` public ...
Is there a way to make a constructor only visible to a parent class in C#?
CC BY-SA 2.5
null
2008-08-21T15:12:48.063
2008-09-21T07:39:13.313
2017-05-23T12:18:32.893
-1
392
[ "c#", "inheritance", "oop" ]
20,198
1
20,219
null
13
3,261
I thought .Net code gets compiled into MSIL, so I always wondered how do Yellow Screens produce the faulty code. If it's executing the compiled code, how is the compiler able to produce code from the source files in the error message? Feel free to edit this question/title, I know it doesn't really make sense.
How does the ASP.NET "Yellow Screen of Death" display code?
CC BY-SA 2.5
0
2008-08-21T15:14:44.827
2009-07-16T22:50:43.217
2009-07-16T22:50:43.217
135,138
40
[ ".net", "asp.net", "yellow-screen-of-death" ]
20,195
2
null
17,717
27
null
Steve, I had to migrate my old application the way around, that is PgSQL->MySQL. I must say, you should consider yourself lucky ;-) Common gotchas are: - - - - - - - I hope that helps at least a bit. Have lots of fun playing with Postgres!
null
CC BY-SA 2.5
null
2008-08-21T15:14:27.840
2008-08-21T15:14:27.840
null
null
2,169
null
20,179
2
null
20,054
1
null
There are some wierd things in Access that might cause issues and I don't know if ODBC takes care of it. If it does @John Topley is right, ODBC would be your only cance. 1. True in access = -1 not 1 2. Access treats dates differently than regular TSQL. 3. You might run into trouble creating relations. If you go w...
null
CC BY-SA 2.5
null
2008-08-21T15:08:31.193
2008-08-21T15:08:31.193
null
null
1,632
null
20,199
2
null
20,185
1
null
No, I don't think we can do that.
null
CC BY-SA 2.5
null
2008-08-21T15:15:00.333
2008-08-21T15:25:19.327
2008-08-21T15:25:19.327
380
380
null
20,202
2
null
20,198
3
null
I believe the pdb files that are output when you do a debug build contain a reference to the location of the source code files.
null
CC BY-SA 2.5
null
2008-08-21T15:15:53.670
2008-11-03T18:10:49.727
null
null
1,194
null
20,200
2
null
20,185
2
null
You can make the sub classes child classes, something like this: ``` public abstract class AbstractClass { public static AbstractClass MakeAbstractClass(string args) { if (args == "a") return new ConcreteClassA(); if (args == "b") return new ConcreteClassB(); } ...
null
CC BY-SA 2.5
null
2008-08-21T15:15:20.647
2008-09-10T12:27:43.503
2017-05-23T10:32:51.507
-1
1,908
null
20,205
2
null
20,198
0
null
I think this is down to the debug information that can be included with the compiled assemblies..(although I could definately be wrong)
null
CC BY-SA 2.5
null
2008-08-21T15:16:35.947
2008-11-03T18:10:49.727
null
null
832
null
20,201
1
null
null
0
1,724
I have a collection of crystal reports that contains charts. They look fine locally and when printed, but when viewing them through a web application using a `CrystalReportViewer` the charts dispay as broken images. Viewing the properties of the broken image show the url as `...CrystalImageHandler.aspx?dynamicimage...
Broken chart images in Crystal Reports in web application
CC BY-SA 3.0
null
2008-08-21T15:15:41.363
2015-09-07T08:37:32.137
2015-09-07T08:37:32.137
5,139,222
1,744
[ "web-applications", "crystal-reports" ]
20,206
1
84,997
null
54
158,974
Anyone have any good urls for templates or diagram examples in Visio 2007 to be used in software architecture?
Where can I find decent visio templates/diagrams for software architecture?
CC BY-SA 2.5
0
2008-08-21T15:16:45.963
2020-06-18T22:52:01.303
null
null
1,940
[ "templates", "visio" ]
20,204
2
null
20,047
2
null
One thing that has worked for me in the past is making sure all my queries and updates access resources (tables) in the same order. That is, if one query updates in order Table1, Table2 and a different query updates it in order of Table2, Table1 then you might see deadlocks. Not sure if it's possible for you to chang...
null
CC BY-SA 2.5
null
2008-08-21T15:16:15.450
2008-08-21T15:16:15.450
null
null
1,958
null
20,209
2
null
20,061
1
null
For this situation, the `[Serializable]` attribute on a nicely modelled `Stats` class and `XmlSerializer` are the way to go, IMO.
null
CC BY-SA 3.0
null
2008-08-21T15:17:01.157
2012-07-03T13:21:07.640
2012-07-03T13:21:07.640
142,162
96
null
20,210
2
null
20,198
0
null
I believe the information that maps the source to the MSIL is stored in the PDB file. If this is not present then that mapping won't happen. It is this lookup that makes an exception such a expensive operation ("exceptions are for exceptional situations").
null
CC BY-SA 2.5
null
2008-08-21T15:17:08.503
2008-11-03T18:10:49.727
null
null
1,490
null
20,207
1
20,243
null
3
6,483
I'm packaging up a .NET 2.0 based web app for deployment through a Windows Installer based package. Our app uses Report Viewer 2008 and I'm including the Microsoft Report Viewer Redistributable 2008 installer. When I check the [download page for Report Viewer 2008](http://www.microsoft.com/downloads/details.aspx?Fami...
Does the Microsoft Report Viewer Redistributable 2008 really require .NET Framework version 3.5?
CC BY-SA 2.5
null
2008-08-21T15:16:53.513
2008-09-22T12:49:50.143
2008-08-31T01:03:11.817
305
206
[ ".net-3.5", "reportviewer", "web-deployment-project", "reportviewer2008" ]
20,208
2
null
20,107
2
null
As Chris said, you don't have to use the exact CSS they provide religiously. I would just save a copy to your server, and edit to your needs.
null
CC BY-SA 2.5
null
2008-08-21T15:16:54.527
2008-12-25T01:37:23.880
null
null
40
null