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 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
37,410 | 2 | null | 37,396 | 1 | null | I am writing this on a Centrino 1.5GHz, 512MB RAM running [Ubuntu](http://www.ubuntu.com/). It's Debian based and is the first Linux distro I have tried that actually worked with my laptop on first install. Find more info [here](http://en.wikipedia.org/wiki/Ubuntu).
| null | CC BY-SA 2.5 | null | 2008-09-01T03:16:06.387 | 2008-09-01T03:16:06.387 | null | null | 2,386 | null |
37,412 | 2 | null | 37,378 | 1 | null | You can't convince them otherwise. Pick a smaller challenge or move to a different organization. If your manager respects you see if you can do a project in the domain-driven style as a sort of technology trial.
| null | CC BY-SA 2.5 | null | 2008-09-01T03:17:54.340 | 2008-09-01T03:17:54.340 | null | null | 2,785 | null |
37,408 | 2 | null | 37,381 | 10 | null | One way would be to have the Erlang core of the application be a daemon that the Cocoa front-end communicates with over a Unix-domain socket using some simple protocol you devise.
The use of a Unix-domain socket means that the Erlang daemon could be launched on-demand by `launchd` and the Cocoa front-end could find th... | null | CC BY-SA 2.5 | null | 2008-09-01T03:11:18.473 | 2008-09-01T03:11:18.473 | null | null | 714 | null |
37,411 | 2 | null | 37,396 | 0 | null | I suggest you should checkout the following three distros:
- [Damn Small Linux](http://www.damnsmalllinux.org/) - Very lightweight. Includes its own lightweight browser (Dillo), but you can install Firefox easily. The entire distro fits on a 50MB LiveCD.- [Slackware](http://www.slackware.com/) - Performance wise Slack... | null | CC BY-SA 2.5 | null | 2008-09-01T03:16:10.473 | 2008-09-01T03:16:10.473 | null | null | 1,811 | null |
37,414 | 2 | null | 37,396 | 2 | null | I'm in a similar situation to [Schroeder](https://stackoverflow.com/questions/37396/linux-lightweight-distro-and-x-windows-for-development#37410); having a laptop with 512mb RAM is a PITA. I tried running Xubuntu but tbh I didn't find it that it was either useable or a great saver on RAM. So I switched to Ubuntu and it... | null | CC BY-SA 2.5 | null | 2008-09-01T03:23:16.010 | 2008-09-01T03:23:16.010 | 2017-05-23T10:27:49.720 | -1 | 1,666 | null |
37,415 | 2 | null | 37,396 | 1 | null | I would recommend [Xubuntu](http://www.xubuntu.org/). It's based on Ubuntu/Debian and optimized for small footprint with the Xfce desktop environment.
| null | CC BY-SA 2.5 | null | 2008-09-01T03:23:54.200 | 2008-09-01T03:23:54.200 | null | null | 720 | null |
37,417 | 2 | null | 37,378 | 2 | null | I think you should focus on the performance. If you can create an application that shows the performance difference when using DataSets vs Custom Entities. Also, try to show them Domain Driven Design principles and how it fits with entity frameworks.
| null | CC BY-SA 2.5 | null | 2008-09-01T03:26:23.290 | 2008-09-01T03:26:23.290 | null | null | 3,797 | null |
37,416 | 2 | null | 23,930 | 9 | null |
# F#: Functional
### Straight forward:
```
let rec fact x =
if x < 0 then failwith "Invalid value."
elif x = 0 then 1
else x * fact (x - 1)
```
### Getting fancy:
```
let fact x = [1 .. x] |> List.fold_left ( * ) 1
```
| null | CC BY-SA 2.5 | null | 2008-09-01T03:25:13.650 | 2008-10-14T15:09:02.000 | 2008-10-14T15:09:02.017 | 1,337 | 322 | null |
37,421 | 2 | null | 23,930 | 1 | null |
# Haskell: Functional
```
fact 0 = 1
fact n = n * fact (n-1)
```
| null | CC BY-SA 2.5 | null | 2008-09-01T03:34:45.577 | 2008-09-01T03:34:45.577 | null | null | 1,815 | null |
37,419 | 2 | null | 37,396 | 4 | null | Try using Gentoo, Most distros with X are targetted towards desktop user and by default includes a lot of other application you don't need and at the same time lacks a lot of the stuff you need. YOu could customize the install but usually a lot of useless stuff will get into the 'base' install anyway.
If you worried a... | null | CC BY-SA 2.5 | null | 2008-09-01T03:28:59.413 | 2008-09-01T03:28:59.413 | null | null | 2,976 | null |
37,422 | 2 | null | 37,391 | 3 | null | There are already various [classes](http://www.pear.php.net/package/Crypt_DiffieHellman/docs/latest/Crypt_DiffieHellman/BigInteger/Crypt_DiffieHellman_Math_BigInteger_Interface.html) [available](http://pear.php.net/package/Math_BigInteger/docs/latest/Math_BigInteger/_Math_BigInteger-1.0.0RC3---BigInteger.php.html) for ... | null | CC BY-SA 2.5 | null | 2008-09-01T03:37:26.117 | 2008-09-01T03:37:26.117 | null | null | 1,666 | null |
37,425 | 1 | 158,314 | null | 3 | 4,868 | Many of us have used Perfmon tool to do performance analysis. Especially with .Net counters, but there are so many variables going on in Perfmon, that it always becomes hard to interpret Perfmon results in to valuable feedback about my application. I want to use perfmon, (not a tool like [Ants Profiler](http://www.red-... | What is the best way to interpret Perfmon analysis into application specific observations/data? | CC BY-SA 2.5 | 0 | 2008-09-01T03:39:42.773 | 2014-04-23T10:58:17.403 | null | null | 1,747 | [
".net",
"performance",
"perfmon"
] |
37,427 | 2 | null | 23,930 | 48 | null |
# C++: Template Metaprogramming
Uses the classic enum hack.
```
template<unsigned int n>
struct factorial {
enum { result = n * factorial<n - 1>::result };
};
template<>
struct factorial<0> {
enum { result = 1 };
};
```
Usage.
```
const unsigned int x = factorial<4>::result;
```
Factorial is calculat... | null | CC BY-SA 2.5 | null | 2008-09-01T03:44:34.290 | 2010-11-03T11:19:09.540 | 2010-11-03T11:19:09.540 | 3,836 | 3,836 | null |
37,431 | 2 | null | 36,551 | 2 | null | Have you tried the [MySQL Query Browser](http://www.mysql.com/products/tools/query-browser/)? Works cross platform and is much nicer than the plain shell.
| null | CC BY-SA 2.5 | null | 2008-09-01T03:51:02.997 | 2008-09-01T03:51:02.997 | null | null | 3,715 | null |
37,428 | 1 | 37,461 | null | 9 | 1,314 | I haven't used `C++` since college. Even though I've wanted to I haven't needed to do any until I started wanting to write plugins for `Launchy`.
> Is there a good book to read to get back into it?
My experience since college is mainly `C#` and recently `ruby`. I bought some book for `C#` developers and it ended up... | Get back to basics. How do I get back into C++? | CC BY-SA 4.0 | null | 2008-09-01T03:47:54.657 | 2019-06-28T04:52:37.233 | 2019-06-28T04:52:37.233 | 6,144,643 | 3,965 | [
"c++"
] |
37,432 | 2 | null | 37,374 | 4 | null | It's right under your nose:
```
List<TableItem> myResult = (from t in db.Table select t).ToList();
```
Now, just cache myResult as you would have cached your old DAL's returned data.
| null | CC BY-SA 2.5 | null | 2008-09-01T03:53:12.680 | 2008-09-01T03:53:12.680 | null | null | 35 | null |
37,434 | 2 | null | 37,391 | 1 | null | As far as I can tell, the bcmath extension is the one you'll want. The data in the PHP manual is a little sparse, but you out to be able to set the precision to be exactly what you need by using the bcscale() function, or the optional third parameter in most of the other bcmath functions. Not too sure on the binary s... | null | CC BY-SA 2.5 | null | 2008-09-01T03:54:19.617 | 2008-09-01T03:54:19.617 | null | null | 2,227 | null |
37,436 | 2 | null | 37,095 | 3 | null | PostgreSQL also uses MVCC (Multi-Version Concurrency Control), so using the default transaction isolation level (read-committed), you should never block, unless somebody is doing maintainace on th DB (dropping / adding columns / tables / indexes / etc).
| null | CC BY-SA 2.5 | null | 2008-09-01T04:04:17.190 | 2008-09-01T04:04:17.190 | null | null | 1,265 | null |
37,441 | 1 | 37,446 | null | 5 | 531 | Why are SQL distributions so non-standard despite an ANSI standard existing for SQL? Are there really that many meaningful differences in the way SQL databases work or is it just the two databases with which I have been working: MS-SQL and PostgreSQL? Why do these differences arise?
| Reasons for SQL differences | CC BY-SA 3.0 | 0 | 2008-09-01T04:11:42.790 | 2015-12-18T09:41:48.230 | 2015-04-29T16:33:20.093 | 2,932,774 | 2,147 | [
"sql",
"sql-server",
"postgresql"
] |
37,438 | 2 | null | 20,696 | 4 | null | A hard keep like you have is only going to fix the size at initialization but elements could still be added or dropped later, are you trying to guard against this condition? The only way I can think of to guarantee that elements aren't added or dropped later is emitting an event synced on the size != the predetermined... | null | CC BY-SA 2.5 | null | 2008-09-01T04:05:48.810 | 2008-09-01T04:05:48.810 | null | null | 3,869 | null |
37,435 | 2 | null | 36,014 | 1 | null | > I traced through the external assembly with Reflector and found no evidence of threading whatsoever.
.NET has a 'thread pool' which is a set of 'spare' threads that sit around mostly idle. Certain methods cause things to run in one of the thread pool threads so they don't block your main app.
The blatant examples... | null | CC BY-SA 2.5 | null | 2008-09-01T04:02:01.177 | 2008-09-01T04:02:01.177 | 2017-05-23T12:00:06.253 | -1 | 234 | null |
37,443 | 2 | null | 37,441 | 8 | null | The ANSI standard specifies only a limited set of commands and data types. Once you go beyond those, the implementors are on their own. And some very important concepts aren't specified at all, such as auto-incrementing columns. SQLite just picks the first non-null integer, MySQL requires `AUTO INCREMENT`, PostgreSQL u... | null | CC BY-SA 2.5 | null | 2008-09-01T04:15:44.357 | 2008-09-01T04:22:31.267 | 2008-09-01T04:22:31.267 | 3,560 | 3,560 | null |
37,449 | 1 | 37,452 | null | 4 | 486 | I've used the StAX API in Java quite a bit, and find it quite a clean way of dealing with XML files. Is there any equivalent library I could use for performing similar processing in C?
| Equivalent to StAX for C | CC BY-SA 2.5 | null | 2008-09-01T04:18:59.153 | 2010-03-17T00:44:56.007 | null | null | 797 | [
"java",
"c",
"xml"
] |
37,451 | 2 | null | 37,428 | 10 | null | My favorites are Effective C++, More Effective C++, and Effective STL by Scott Meyers. Also C++ Coding Standards by Sutter and Alexandrescu.
| null | CC BY-SA 2.5 | null | 2008-09-01T04:21:57.960 | 2008-09-01T04:21:57.960 | null | null | 3,114 | null |
37,396 | 1 | 37,415 | null | 4 | 5,605 | I want to build a lightweight linux configuration to use for development. The first idea is to use it inside a Virtual Machine under Windows, or old Laptops with 1Gb RAM top. Maybe even a distributable environment for developers.
So the whole idea is to use a LAMP server, Java Application Server (Tomcat or Jetty) and ... | Linux Lightweight Distro and X Windows for Development | CC BY-SA 2.5 | 0 | 2008-09-01T02:44:04.170 | 2018-04-05T10:50:36.463 | 2017-05-23T10:32:50.377 | -1 | 2,274 | [
"linux",
"desktop"
] |
37,452 | 2 | null | 37,449 | 0 | null | [libxml](http://xmlsoft.org/) is a heavily used and documented XML library for C, which provides a SAX API. [Expat](http://expat.sourceforge.net/) is another, but in my experience is not as well documented.
| null | CC BY-SA 2.5 | null | 2008-09-01T04:22:00.707 | 2008-09-01T04:22:00.707 | null | null | 3,560 | null |
37,450 | 2 | null | 37,343 | 2 | null | The primary problem you are going to run into is that you'll have two login forms, and two logout methods. What you need to do is pick one of the login forms as the default, and redirect the other one over to it.
I've been able to [successfully integrate](http://www.howtogeek.com) bbPress + MediaWiki + WordPress + Wor... | null | CC BY-SA 2.5 | null | 2008-09-01T04:19:19.543 | 2008-09-01T04:19:19.543 | null | null | 291 | null |
37,454 | 2 | null | 25,332 | 0 | null | Thanks for those links. Looks like GROK is dead - but it may work still for my purposes.
2 more links:
- [http://classifier4j.sourceforge.net/](http://classifier4j.sourceforge.net/)- [http://www.corporasoftware.com/products/summarize.aspx](http://www.corporasoftware.com/products/summarize.aspx)
The Attempto Controll... | null | CC BY-SA 2.5 | null | 2008-09-01T04:24:05.117 | 2008-09-01T04:24:05.117 | null | null | 1,592 | null |
37,455 | 2 | null | 37,449 | 0 | null | I have used Expat pretty extensively - I like it for its simplicity and small footprint.
| null | CC BY-SA 2.5 | null | 2008-09-01T04:24:19.297 | 2008-09-01T04:24:19.297 | null | null | 3,114 | null |
37,459 | 2 | null | 23,930 | 1 | null | This one not only calculates n!, it is also O(n!). It may have problems if you want to calculate anything "big" though.
```
long f(long n)
{
long r=1;
for (long i=1; i<n; i++)
r=r*i;
return r;
}
long factorial(long n)
{
// iterative implementation should be efficient
long result;
for (... | null | CC BY-SA 2.5 | null | 2008-09-01T04:41:12.953 | 2008-09-01T04:41:12.953 | null | null | 3,146 | null |
37,456 | 2 | null | 35,528 | 0 | null | @rcreswick those sound like good references but fall a bit shy of what I'm thinking of. (However, for all I know, it's the best there is)
I'm going to not mark anything as accepted in hopes people might find a better reference.
Meanwhile, I'm going to list a few problems here, fell free to add more
Find an order fo... | null | CC BY-SA 2.5 | null | 2008-09-01T04:27:27.057 | 2009-01-09T21:30:27.940 | 2009-01-09T21:30:27.940 | 1,343 | 1,343 | null |
37,446 | 2 | null | 37,441 | 5 | null | It's a form of "Stealth lock-in". Joel goes into great detail here:
- [http://www.joelonsoftware.com/articles/fog0000000056.html](http://www.joelonsoftware.com/articles/fog0000000056.html)- [http://www.joelonsoftware.com/articles/fog0000000052.html](http://www.joelonsoftware.com/articles/fog0000000052.html)
Companies... | null | CC BY-SA 2.5 | null | 2008-09-01T04:17:30.653 | 2008-09-01T04:17:30.653 | null | null | 3,146 | null |
37,461 | 2 | null | 37,428 | 7 | null | The best way to get back into C++ is to jump in. You can't learn a real language without spending any serious time in a country where they speak it. I wouldn't try to learn a programming language without spending time coding in it either.
I wouldn't recommend learning C first though. That's a good way to pick up so... | null | CC BY-SA 2.5 | null | 2008-09-01T04:43:12.683 | 2008-09-01T04:43:12.683 | null | null | 2,147 | null |
37,463 | 2 | null | 37,428 | 6 | null | I haven't tried it myself but have heard from people and sources I trust that "Accelerated C++" by Koenig and Moo is a good book for people who want to pick up C++ quickly. Compared to the more traditional route of learning C first then C++ as a kind of C with classes the K+M approach helps you become productive quickl... | null | CC BY-SA 2.5 | null | 2008-09-01T04:50:22.493 | 2008-09-01T04:50:22.493 | null | null | 3,955 | null |
37,464 | 1 | 37,522 | null | 201 | 110,166 | If I create an application on my Mac, is there any way I can get it to run on an iPhone without going through the app store?
It doesn't matter if the iPhone has to be jailbroken, as long as I can still run an application created using the official SDK. For reasons I won't get into, I can't have this program going thro... | iPhone App Minus App Store? | CC BY-SA 3.0 | 0 | 2008-09-01T04:55:58.813 | 2016-12-21T18:12:47.180 | 2015-10-09T15:25:53.723 | 2,302,862 | 752 | [
"ios",
"iphone"
] |
37,466 | 2 | null | 37,335 | 150 | null | Run Java with the command-line option `-Xmx`, which sets the size of the heap.
[See here for details](http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html#nonstandard).
| null | CC BY-SA 4.0 | null | 2008-09-01T05:00:01.927 | 2019-03-23T08:51:15.490 | 2019-03-23T08:51:15.490 | 2,361,308 | 3,171 | null |
37,470 | 2 | null | 37,468 | 2 | null | One way is to throw an exception in Page Load, but don't catch it. At the bottom of the page, you'll see the version number.
| null | CC BY-SA 2.5 | null | 2008-09-01T05:07:22.483 | 2008-09-01T05:07:22.483 | null | null | 3,641 | null |
37,468 | 1 | 37,498 | null | 5 | 13,000 | I have a site running in a Windows shared hosting environment. In their control panel for the shared hosting account I have it set to use ASP.NET version 3.0 but it doesn't say 3.5 SP1 specifically.
How can I view the installed version running on the server where my website is hosted in an asp.net page?
| How to Determine the Installed ASP.NET Version of Host from a Web Page | CC BY-SA 2.5 | null | 2008-09-01T05:05:54.440 | 2011-12-19T22:23:25.033 | 2008-09-01T05:17:56.297 | 372 | 3,747 | [
".net",
"asp.net"
] |
37,467 | 2 | null | 9,033 | 28 | null |
Usually we do it like this:
```
StringBuilder sb = new StringBuilder();
using (StringWriter sw = new StringWriter()) {
using (IndentedTextWriter itw = new IndentedTextWriter(sw)) {
...
}
}
```
But we can do it this way:
```
StringBuilder sb = new StringBuilder();
using (StringWriter sw = new Stri... | null | CC BY-SA 2.5 | null | 2008-09-01T05:03:20.607 | 2008-09-01T05:03:20.607 | null | null | 718 | null |
37,409 | 2 | null | 37,378 | 7 | null | Of course, "it depends" on the situation. Sometimes DataSets or DataTables are more suited, like if it really is pretty light business logic, flat hierarchy of entities/records, or featuring some versioning capabilities.
Custom object collections shine when you want to implement a of objects that cannot be efficientl... | null | CC BY-SA 2.5 | null | 2008-09-01T03:12:35.287 | 2008-09-16T14:03:41.413 | 2008-09-16T14:03:41.413 | 2,663 | 2,663 | null |
37,473 | 1 | 37,474 | null | 27 | 24,522 | If I use `assert()` and the assertion fails then `assert()` will call `abort()`, ending the running program abruptly. I can't afford that in my production code. Is there a way to assert in runtime yet be able to catch failed assertions so I have the chance to handle them gracefully?
| How can I assert() without using abort()? | CC BY-SA 2.5 | 0 | 2008-09-01T05:15:05.790 | 2016-02-06T12:58:24.243 | 2008-10-03T20:04:38.147 | 13,913 | 456 | [
"c++",
"exception",
"assert"
] |
37,476 | 2 | null | 37,464 | 18 | null | Yes, once you have joined the iPhone Developer Program, and paid Apple $99, you can provision your applications on up to 100 iOS devices.
| null | CC BY-SA 3.0 | null | 2008-09-01T05:16:40.170 | 2011-10-28T20:19:40.127 | 2011-10-28T20:19:40.127 | 345,188 | 143 | null |
37,475 | 2 | null | 37,378 | 1 | null | If you can profile, just Do it and profile. Datasets are heavier then a simple `Collection<T>`
DataReaders are faster then using Adapters...
Changing behavior in an objects is much easier than massaging a dataset
Anyway: Just Do It, ask for forgiveness not permission.
| null | CC BY-SA 2.5 | null | 2008-09-01T05:15:19.953 | 2008-09-01T05:15:19.953 | null | null | 580 | null |
37,471 | 1 | null | null | 1 | 2,101 | The minimum spanning tree problem is to take a connected weighted graph and find the subset of its edges with the lowest total weight while keeping the graph connected (and as a consequence resulting in an acyclic graph).
The algorithm I am considering is:
- -
The impetus for this version is an environment that is ... | Is this minimum spanning tree algorithm correct? | CC BY-SA 4.0 | null | 2008-09-01T05:10:08.890 | 2019-05-15T01:35:44.673 | 2019-05-15T01:35:44.673 | 3,768,871 | 1,343 | [
"algorithm",
"correctness"
] |
37,482 | 2 | null | 36,551 | 0 | null | It sounds like a GUI is not really what you were after, but maybe [HeidiSQL](http://en.wikipedia.org/wiki/HeidiSQL) would be worth a look. It's a GUI frontend for MySQL which I wouldn't say I quite using, but I've certainly come across worse ways to talk with a database.
| null | CC BY-SA 2.5 | null | 2008-09-01T05:19:41.223 | 2008-09-01T05:19:41.223 | null | null | 1,157 | null |
37,483 | 1 | 37,485 | null | 0 | 4,835 | I suck at math. I need to figure out how to calculate a video duration with only a few examples of values. For example, a value of 70966 is displayed as 1:10 minutes. A value of 30533 displays as 30 seconds. A value of 7007 displays as 7 seconds.
| Calculate Video Duration | CC BY-SA 2.5 | null | 2008-09-01T05:20:41.330 | 2012-05-04T05:43:14.200 | 2012-05-04T05:43:14.200 | 68,304 | 2,601 | [
"math",
"video",
"duration"
] |
37,484 | 2 | null | 37,471 | 1 | null | Your algorithm isn't quite clearly defined. If you have a complete graph, your algorithm would seem to entail, in the first step, removing all but the two minimum elements. Also, listing the cycles in a graph can take exponential time.
Elaboration:
In a graph with n nodes and an edge between every pair of nodes, t... | null | CC BY-SA 2.5 | null | 2008-09-01T05:21:53.293 | 2008-09-01T22:04:20.607 | 2008-09-01T22:04:20.607 | 3,868 | 3,868 | null |
37,485 | 2 | null | 37,483 | 2 | null | Looks like the numbers are in milliseconds. So to convert to seconds, divide by 1000, then divide by 60 to find minutes etc.
| null | CC BY-SA 2.5 | null | 2008-09-01T05:23:53.490 | 2008-09-01T05:23:53.490 | null | null | 2,925 | null |
37,479 | 1 | 37,571 | null | 1 | 515 | Below I have a very simple example of what I'm trying to do. I want to be able to use HTMLDecorator with any other class. Ignore the fact it's called decorator, it's just a name.
```
import cgi
class ClassX(object):
pass # ... with own __repr__
class ClassY(object):
pass # ... with own __repr__
inst_x=ClassX(... | How can I simply inherit methods from an existing instance? | CC BY-SA 3.0 | null | 2008-09-01T05:17:35.190 | 2020-11-19T12:27:22.753 | 2017-08-09T20:13:30.127 | 1,836,618 | 1,057 | [
"python",
"oop",
"inheritance",
"object"
] |
37,486 | 1 | 37,512 | null | 18 | 26,599 | Because regular expressions scare me, I'm trying to find a way to remove all HTML tags and resolve HTML entities from a string in Python.
| Filter out HTML tags and resolve entities in python | CC BY-SA 2.5 | 0 | 2008-09-01T05:25:01.990 | 2017-09-26T12:04:21.563 | null | null | 3,971 | [
"python",
"html"
] |
37,383 | 2 | null | 37,378 | 3 | null | Datasets/tables aren't so bad are they?
Best advise I can give is to use it as much as you can in your own code, and hopefully through peer reviews and bugfixes, the other developers will see how code becomes more readable. (make sure to push the point when these occurrences happen).
Ultimately if the code works,... | null | CC BY-SA 2.5 | null | 2008-09-01T02:25:32.217 | 2008-09-01T02:25:32.217 | null | null | 952 | null |
37,487 | 2 | null | 37,483 | 0 | null | I'm not sure if I completely understand this, but:
```
70966 / 70 seconds = 1013.8
```
So dividing the "value" by 1013.8 should get the duration, approximately...
Edit: Yes, Ben is right, you should divide by 1000. I got 1013.8 because the 70 seconds was rounded down from 70.966 seconds to 70.
| null | CC BY-SA 2.5 | null | 2008-09-01T05:25:42.707 | 2008-09-01T05:25:42.707 | null | null | 813 | null |
37,489 | 2 | null | 37,483 | 0 | null | To expand on what [Ben](https://stackoverflow.com/questions/37483/calculate-video-duration#37485) said, it looks like they are milliseconds, and the display value is rounded slightly, possibly to the nearest 100 milliseconds and then 'cropped' to seconds. This would explain why 30533 is 30s and 70966 is 70s.
| null | CC BY-SA 2.5 | null | 2008-09-01T05:27:38.020 | 2008-09-01T05:27:38.020 | 2017-05-23T12:08:35.993 | -1 | 1,666 | null |
37,490 | 2 | null | 37,483 | 1 | null | It's a simple matter of division:
- - -
Looks like the numbers are nothing but milliseconds. 70966 displays as 1:10 minutes because it shaves of the millisecond part (last 3 digits).
| null | CC BY-SA 2.5 | null | 2008-09-01T05:27:48.240 | 2008-09-01T05:27:48.240 | null | null | 372 | null |
37,488 | 2 | null | 37,479 | 0 | null | > Is what I'm trying to do possible? If so, what am I doing wrong?
It's certainly possible. What's wrong is that `HTMLDecorator.__init__()` doesn't accept parameters.
Here's a simple example:
```
def decorator (func):
def new_func ():
return "new_func %s" % func ()
return new_func
@decorator
def a (... | null | CC BY-SA 2.5 | null | 2008-09-01T05:26:06.170 | 2008-09-01T05:26:06.170 | null | null | 3,560 | null |
37,492 | 2 | null | 37,471 | 1 | null | @shrughes.blogspot.com:
I don't know about removing all but two - I've been sketching out various runs of the algorithm and assuming that parallel runs may remove an edge more than once I can't find a situation where I'm left without a spanning tree. Whether or not it's minimal I don't know.
| null | CC BY-SA 2.5 | null | 2008-09-01T05:29:56.987 | 2008-09-01T05:29:56.987 | null | null | 658 | null |
37,491 | 2 | null | 37,473 | 6 | null | Asserts in C/C++ only run in debug builds. So this won't happen at runtime. In general asserts should mark things that if they happen indicate a bug, and generally show assumptions in your code etc.
If you want to have code that checks for errors at runtime (in release) you should probably use exceptions rather than ... | null | CC BY-SA 2.5 | null | 2008-09-01T05:27:55.760 | 2008-09-01T05:27:55.760 | null | null | 2,925 | null |
37,474 | 2 | null | 37,473 | 28 | null | Yes, as a matter of fact there is. You will need to write a custom assert function yourself, as C++'s `assert()` is exactly C's `assert()`, with the `abort()` "feature" bundled in. Fortunately, this is surprisingly straightforward.
```
template <typename X, typename A>
inline void Assert(A assertion)
{
if( !as... | null | CC BY-SA 2.5 | null | 2008-09-01T05:15:18.800 | 2008-09-01T05:36:35.783 | 2008-09-01T05:36:35.783 | 456 | 456 | null |
37,498 | 2 | null | 37,468 | 5 | null | Thanks!
I just dropped <%=Environment.Version%> on a page and got 2.0.50727.3053
| null | CC BY-SA 2.5 | null | 2008-09-01T05:41:46.990 | 2008-09-01T06:02:47.063 | 2008-09-01T06:02:47.063 | 3,747 | 3,747 | null |
37,496 | 2 | null | 37,486 | 4 | null | How about parsing the HTML data and extracting the data with the help of the parser ?
I'd try something like the author described in [chapter 8.3 in the Dive Into Python book](http://diveintopython.net/html_processing/extracting_data.html)
| null | CC BY-SA 3.0 | null | 2008-09-01T05:35:08.237 | 2012-08-04T01:53:52.517 | 2012-08-04T01:53:52.517 | 1,288 | 3,056 | null |
37,495 | 1 | null | null | 4 | 1,546 | I'm trying to get some stats on how many of the visitors to our website have Silverlight enabled browsers.
We currently use Google Analytics for the rest of our stats so ideally we'd like to just add 'Silverlight enabled' tracking in with the rest of our Google Analytics stats. But if it has to get written out to a... | How to track if browser is Silverlight enabled | CC BY-SA 3.0 | null | 2008-09-01T05:34:39.143 | 2016-03-04T15:51:56.473 | 2016-03-04T15:51:56.473 | 996,815 | 242 | [
"silverlight",
"browser",
"google-analytics",
"tracking"
] |
37,500 | 2 | null | 37,495 | 0 | null | I think you answered it yourself. The page you are linking to does just that: detect which version of Silverlight the user has (not if s/he installs it). From the page:
> After a little poking around, I found that Google Analytics has support for reporting a user-defined field.
...
> Basically this detects the prese... | null | CC BY-SA 2.5 | null | 2008-09-01T05:44:26.077 | 2008-09-01T05:44:26.077 | null | null | 1,265 | null |
37,503 | 1 | null | null | 1 | 106 | I have a bunch of wizards created for MSVS 2005. Is it possible to convert them to MSVS 2008 format automatically?
| Is it possible to convert projects wizard created for MSVS 2005 to MSVS 2008 format automatically | CC BY-SA 2.5 | null | 2008-09-01T05:49:14.817 | 2015-12-20T22:57:00.513 | 2015-12-20T22:57:00.513 | 3,618,581 | 1,196 | [
"visual-studio",
"templates",
"visual-studio-2008",
"visual-studio-2005",
"data-conversion"
] |
37,501 | 1 | 37,507 | null | 3 | 14,253 | Thanks to a Q&A on stackoverflow. I just found out how to determine the installed version on my hosting provider's server. Now I need to know what that number means.
Using `<%=Environment.Version%>` on my local machine returns 2.0.50727.3053.
Can someone give me a list of the version 1, 1.1, 2, etc. to the actual `En... | List of ASP.NET Versions? | CC BY-SA 4.0 | null | 2008-09-01T05:46:49.147 | 2019-05-31T07:04:24.433 | 2019-05-31T06:51:51.553 | 465,053 | 3,747 | [
"asp.net"
] |
37,502 | 2 | null | 37,486 | 6 | null | While I agree with Lucas that regular expressions are not all that scary, I still think that you should go with a specialized HTML parser. This is because the HTML standard is hairy enough (especially if you want to parse arbitrarily "HTML" pages taken off the Internet) that you would need to write a lot of code to han... | null | CC BY-SA 2.5 | null | 2008-09-01T05:49:04.287 | 2008-09-01T05:49:04.287 | null | null | 1,265 | null |
37,505 | 2 | null | 37,495 | 1 | null | In case you missed it, there's a link to a more detailed article as well in the comments: [http://blogs.msdn.com/jeffwilcox/archive/2007/10/01/using-google-analytics-with-rich-managed-web-applications-in-silverlight.aspx](http://blogs.msdn.com/jeffwilcox/archive/2007/10/01/using-google-analytics-with-rich-managed-web-a... | null | CC BY-SA 2.5 | null | 2008-09-01T05:51:25.903 | 2008-09-01T06:19:26.790 | 2008-09-01T06:19:26.790 | 380 | 380 | null |
37,506 | 2 | null | 37,486 | 16 | null | Use [BeautifulSoup](http://www.crummy.com/software/BeautifulSoup/)! It's perfect for this, where you have incoming markup of dubious virtue and need to get something reasonable out of it. Just pass in the original text, extract all the string tags, and join them.
| null | CC BY-SA 2.5 | null | 2008-09-01T05:53:39.410 | 2008-09-01T05:53:39.410 | null | null | 3,560 | null |
37,507 | 2 | null | 37,501 | 6 | null | [List of .NET Framework versions](https://en.wikipedia.org/wiki/.NET_Framework_version_history).
| null | CC BY-SA 4.0 | null | 2008-09-01T05:54:02.047 | 2019-05-31T06:39:58.320 | 2019-05-31T06:39:58.320 | 8,674,428 | 3,827 | null |
37,508 | 2 | null | 24,298 | 3 | null | Just a note, LoginGenerator and SaltedLoginGenerator have been superseded by Restful Authentication and are unsupported on newer Rails releases -- dont waste any time on them, though they were great at the time.
| null | CC BY-SA 2.5 | null | 2008-09-01T06:02:50.293 | 2008-09-01T06:02:50.293 | null | null | 3,972 | null |
37,504 | 2 | null | 37,486 | 1 | null | You might need something more complicated than a regular expression. Web pages often have angle brackets that aren't part of a tag, like this:
```
<div>5 < 7</div>
```
Stripping the tags with regex will return the string "5 " and treat
```
< 7</div>
```
as a single tag and strip it out.
I suggest looking for alr... | null | CC BY-SA 2.5 | null | 2008-09-01T05:50:44.080 | 2008-09-01T05:50:44.080 | null | null | 813 | null |
37,510 | 2 | null | 37,495 | 0 | null | @Vaibhav
The [Using Google Analytics with rich (managed) web applications in Silverlight](http://blogs.msdn.com/jeffwilcox/archive/2007/10/01/using-google-analytics-with-rich-managed-web-applications-in-silverlight.aspx) article is very interesing but is more focused on how to get your Silverlight app to send messages ... | null | CC BY-SA 2.5 | null | 2008-09-01T06:04:07.153 | 2008-09-01T06:04:07.153 | null | null | 242 | null |
37,513 | 2 | null | 37,479 | 0 | null | @John (37448):
Sorry, I might have misled you with the name (bad choice). I'm not really looking for a decorator function, or anything to do with decorators at all. What I'm after is for the html(self) def to use ClassX or ClassY's `__repr__`. I want this to work without modifying ClassX or ClassY.
| null | CC BY-SA 2.5 | null | 2008-09-01T06:10:04.317 | 2008-09-01T06:17:44.657 | 2008-09-01T06:17:44.657 | 1,057 | 1,057 | null |
37,516 | 1 | 37,548 | null | 1 | 330 | When writing production-quality VC++ code, is the use of recursion acceptable? Why or why not?
| Recursion in production-quality VC++ Code | CC BY-SA 3.0 | null | 2008-09-01T06:13:41.857 | 2013-04-17T20:52:16.640 | 2013-04-17T20:52:16.640 | 1,454,806 | 45,603 | [
"visual-c++",
"recursion"
] |
37,512 | 2 | null | 37,486 | 39 | null | Use [lxml](http://lxml.de/) which is the best xml/html library for python.
```
import lxml.html
t = lxml.html.fromstring("...")
t.text_content()
```
And if you just want to sanitize the html look at the lxml.html.clean [module](http://lxml.de/lxmlhtml.html#cleaning-up-html)
| null | CC BY-SA 3.0 | null | 2008-09-01T06:07:01.467 | 2017-09-26T12:04:21.563 | 2017-09-26T12:04:21.563 | 2,190,251 | 720 | null |
37,518 | 2 | null | 37,516 | 2 | null | Yes. But never in dead code. That would be silly.
| null | CC BY-SA 2.5 | null | 2008-09-01T06:15:28.467 | 2008-09-01T06:15:28.467 | null | null | 811 | null |
37,511 | 2 | null | 23,755 | 3 | null | I can think of situations where either of the first two flavours makes sense:
1. If the needle needs pre-processing, like in the Knuth-Morris-Pratt algorithm, needle.findIn(haystack) (or pattern.findIn(text))makes sense, because the needle object holds the intermediate tables created for the algorithm to work effecti... | null | CC BY-SA 2.5 | null | 2008-09-01T06:04:30.990 | 2008-09-01T06:04:30.990 | null | null | 3,973 | null |
37,519 | 1 | 37,578 | null | 9 | 1,229 | I used the LINQ to SQL designer in Visual Studio to create an object model of a database. Now, I want to add XML comments to each generated property but I can't figure out how to do it without erasing the properties the next time the dbml file is refreshed.
How can this be done?
| Add XML Comments to class properties generated by the LINQ to SQL designer | CC BY-SA 2.5 | null | 2008-09-01T06:15:44.880 | 2008-12-17T20:57:43.017 | 2008-11-11T16:26:03.337 | 1,559 | 3,742 | [
"xml",
"linq",
"xml-comments"
] |
37,520 | 2 | null | 37,516 | 0 | null | Sure - e.g. if you want to traverse a tree structure what else would you use ?
Maybe you would like to have something like a maximum depth to be sure you're not writing an infinite loop. (if this makes sense in your example)
| null | CC BY-SA 2.5 | null | 2008-09-01T06:17:54.127 | 2008-09-01T06:17:54.127 | null | null | 3,056 | null |
37,521 | 2 | null | 1,083 | 5 | null | Check out Chapter 6 of [Programming Collective Intelligence](https://rads.stackoverflow.com/amzn/click/com/0596529325)
| null | CC BY-SA 2.5 | null | 2008-09-01T06:19:15.760 | 2008-09-01T06:19:15.760 | null | null | 3,973 | null |
37,523 | 2 | null | 35,185 | 0 | null | The sorting method and the XOR method have the same time complexity. The XOR method is only O(n) if you assume that bitwise XOR of two strings is a constant time operation. This is equivalent to saying that the size of the integers in the array is bounded by a constant. In that case you can use Radix sort to sort the a... | null | CC BY-SA 2.5 | null | 2008-09-01T06:21:50.793 | 2008-09-01T06:21:50.793 | null | null | null | null |
37,525 | 1 | 37,527 | null | 2 | 216 | Imagine we have a program trying to write to a particular file, but failing.
On the Windows platform, what are the possible things which might be causing the file to be un-writable, and what steps could be suggested to an end user/administrator to fix it.
---
Please include steps which might require administrator pe... | What steps can I give a windows user to make a given file writeable | CC BY-SA 4.0 | null | 2008-09-01T06:25:36.790 | 2022-01-22T09:37:08.973 | 2022-01-22T09:37:08.973 | 17,700,155 | 797 | [
"windows",
"filesystems"
] |
37,526 | 2 | null | 37,479 | 0 | null | Ah, in that case, perhaps code like this will be useful? It doesn't really have anything to do with decorators, but demonstrates how to pass arguments to a class's initialization function and to retrieve those arguments for later.
```
import cgi
class ClassX(object):
def __repr__ (self):
return "<class X>... | null | CC BY-SA 2.5 | null | 2008-09-01T06:25:43.297 | 2008-09-01T06:25:43.297 | null | null | 3,560 | null |
37,529 | 1 | 37,784 | null | 11 | 10,265 | I'd like to pull a stream of PCM samples from a Mac's line-in or built-in mic and do a little live analysis (the exact nature doesn't pertain to this question, but it could be an FFT every so often, or some basic statistics on the sample levels, or what have you).
What's a good fit for this? Writing an AudioUnit that... | Simple audio input API on a Mac? | CC BY-SA 2.5 | 0 | 2008-09-01T06:31:32.953 | 2017-09-13T06:01:43.880 | null | null | 3,462 | [
"macos",
"audio"
] |
37,527 | 2 | null | 37,525 | 3 | null | Some suggestions:
- - - `attrib -r`
Edit 1: Only the second item (file is locked) has a possible solution that all users are likely to be able to do without help. For the first and third, you'll probably want to provide guidance (and hope the file wasn't made read-only intentionally!).
Edit 2: Technically, the user... | null | CC BY-SA 2.5 | null | 2008-09-01T06:28:56.453 | 2008-09-07T02:17:47.877 | 2008-09-07T02:17:47.877 | 1,879 | 1,879 | null |
37,532 | 1 | null | null | 3 | 5,405 | Does anyone know if you can and how to start off a scheduled Windows task on a Remote Server from within a SQL Server Integration Services (SSIS) package?
| Is it possible to start a scheduled Windows task from a package? | CC BY-SA 3.0 | null | 2008-09-01T06:36:54.877 | 2011-07-28T17:30:20.070 | 2011-07-28T17:30:20.070 | null | 2,375 | [
"sql-server",
"windows",
"ssis"
] |
37,533 | 2 | null | 31,312 | 0 | null | What does the generated Javascript look like?
Sounds (at first glance) like it's not being escaped.
| null | CC BY-SA 2.5 | null | 2008-09-01T06:37:45.247 | 2008-09-01T06:37:45.247 | null | null | 3,977 | null |
37,530 | 2 | null | 37,468 | 5 | null | @Jon Limjap: Unfortunately, this tells you the .NET CLR (runtime library) version, the version of the .NET Framework. These two version numbers are not always the same; in particular, the .NET Framework 3.0 and 3.5 both use the .NET CLR 2.0. So the OP may indeed have only .NET 2.0 SP1, as the Environment.Version ind... | null | CC BY-SA 2.5 | null | 2008-09-01T06:33:14.057 | 2008-09-01T06:33:14.057 | null | null | 1,879 | null |
37,537 | 2 | null | 37,471 | 1 | null | For this to work, you'd have to detail how you would want to find all cycles, apparently without any iterative constructs, because that is a non-trivial task. I'm not sure that's possible. If you really want to find a MST algorithm that doesn't use iterative constructs, take a look at [Prim's](http://en.wikipedia.org... | null | CC BY-SA 2.5 | null | 2008-09-01T06:46:27.300 | 2008-09-01T06:46:27.300 | null | null | 3,548 | null |
37,538 | 1 | 37,539 | null | 1,352 | 3,107,199 | How do I determine the size of my array in C?
That is, the number of elements the array can hold?
| How do I determine the size of my array in C? | CC BY-SA 3.0 | 0 | 2008-09-01T06:49:22.723 | 2023-01-20T16:31:07.510 | 2023-01-20T16:31:07.510 | 8,075,540 | 116 | [
"arrays",
"c"
] |
37,535 | 1 | 37,553 | null | 25 | 28,297 | I've got a bunch of FoxPro (VFP9) DBF files on my Ubuntu system, is there a library to open these in Python? I only need to read them, and would preferably have access to the memo fields too.
: Thanks @cnu, I used Yusdi Santoso's [dbf.py](http://www.physics.ox.ac.uk/users/santoso/dbf.py.src) and it works nicely. One... | What's the easiest way to read a FoxPro DBF file from Python? | CC BY-SA 2.5 | 0 | 2008-09-01T06:45:40.063 | 2016-08-02T21:18:47.013 | 2008-09-01T07:27:48.060 | 3,715 | 3,715 | [
"python",
"foxpro",
"dbf",
"visual-foxpro"
] |
37,541 | 2 | null | 37,538 | 14 | null | ```
sizeof(array) / sizeof(array[0])
```
| null | CC BY-SA 2.5 | null | 2008-09-01T06:50:31.253 | 2008-09-01T06:50:31.253 | null | null | 954 | null |
37,543 | 2 | null | 37,516 | 0 | null | > Is there a way to determine at what
point I would encounter a stack
overflow?
Depends how deep you go, and how large the actual recursion is. I take it you understand what recursion does?
| null | CC BY-SA 2.5 | null | 2008-09-01T06:54:29.967 | 2008-09-01T06:54:29.967 | null | null | 342 | null |
37,515 | 2 | null | 37,503 | 1 | null | Looking at these posts:
- [How to use solutions and projects between Visual Studio 2005 and 2008](http://blogs.msdn.com/djpark/archive/2007/11/07/how-to-use-solutions-and-projects-between-visual-studio-2005-and-2008.aspx)- [Running VS2008 & VS 2005 side by side - project file difference](http://codebetter.com/blogs/je... | null | CC BY-SA 2.5 | null | 2008-09-01T06:13:36.727 | 2008-09-01T06:13:36.727 | null | null | 718 | null |
37,546 | 2 | null | 37,525 | 1 | null | If you are having trouble working out if the file is locked, try using [Unlocker](http://www.emptyloop.com/unlocker/) - it's a really useful free utility that shows you the process that has locked the file and lets you force an unlock if you need to.
| null | CC BY-SA 2.5 | null | 2008-09-01T06:55:48.683 | 2008-09-01T06:55:48.683 | null | null | 2,608 | null |
37,545 | 2 | null | 37,538 | 175 | null | It is worth noting that `sizeof` doesn't help when dealing with an array value that has decayed to a pointer: even though it points to the start of an array, to the compiler it is the same as a pointer to a single element of that array. A pointer does not "remember" anything else about the array that was used to initia... | null | CC BY-SA 3.0 | null | 2008-09-01T06:55:23.053 | 2014-10-06T06:44:37.750 | 2014-10-06T06:44:37.750 | 2,971 | 2,971 | null |
37,549 | 2 | null | 37,516 | 0 | null | Recursion is almost essential to traverse File structures like folder/directories.
Traversing a tree like structure is very easy if recursion is used.
| null | CC BY-SA 2.5 | null | 2008-09-01T06:59:14.040 | 2008-09-01T06:59:14.040 | null | null | 184 | null |
37,539 | 2 | null | 37,538 | 1,652 | null |
```
int a[17];
size_t n = sizeof(a)/sizeof(a[0]);
```
---
To determine the size of your array in bytes, you can use the `sizeof`
operator:
```
int a[17];
size_t n = sizeof(a);
```
On my computer, ints are 4 bytes long, so n is 68.
To determine the number of elements in the array, we can divide
the total s... | null | CC BY-SA 4.0 | null | 2008-09-01T06:49:44.203 | 2020-04-27T19:55:16.057 | 2020-04-27T19:55:16.057 | 10,795,151 | 116 | null |
37,522 | 2 | null | 37,464 | 187 | null |
# Official Developer Program
For a standard iPhone you'll need to pay the US$99/yr to be a member of the developer program. You can then use the adhoc system to install your application onto up to 100 devices. The developer program has the details but it involves adding UUIDs for each of the devices to your applica... | null | CC BY-SA 2.5 | null | 2008-09-01T06:21:23.133 | 2010-01-06T05:54:17.747 | 2010-01-06T05:54:17.747 | 3,736 | 3,736 | null |
37,542 | 2 | null | 32,332 | 26 | null | By taking a C string the C++03 [std::fstream](http://en.cppreference.com/w/cpp/io/basic_fstream) class reduced dependency on the `std::string` class. In C++11, however, the `std::fstream` class does allow passing a `std::string` for its constructor parameter.
Now, you may wonder why isn't there a transparent conversio... | null | CC BY-SA 3.0 | null | 2008-09-01T06:53:24.820 | 2012-10-20T21:21:58.927 | 2012-10-20T21:21:58.927 | null | 456 | null |
37,544 | 2 | null | 37,479 | 0 | null | @John (37479):
Very close, but then I lose everything from ClassX. Below is something a collegue gave me that does do the trick, but it's hideous. There has to be a better way.
```
import cgi
from math import sqrt
class ClassX(object):
def __repr__(self):
return "Best Guess"
class ClassY(object):
pass #... | null | CC BY-SA 2.5 | null | 2008-09-01T06:55:13.317 | 2008-09-01T06:55:13.317 | null | null | 1,057 | null |