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
17,304
2
null
17,225
19
null
I don't know of any default way to do this, but you can define a subroutine to do it for you: ``` sub execute { my $cmd = shift; print "$cmd\n"; system($cmd); } my $cmd = $ARGV[0]; execute($cmd); ``` And then see it in action: ``` pbook:~/foo rudd$ perl foo.pl ls ls file1 file2 foo.pl ```
null
CC BY-SA 2.5
null
2008-08-20T01:47:02.190
2008-08-20T01:47:02.190
null
null
219
null
17,299
1
17,312
null
1
4,079
I am trying to build a function in C/C++ to sort an array and replace each value with its "score" or rank. It takes in a double pointer array to an array of ints, and sorts the double pointers based on the dereferenced value of the integers. I have tried quite a few times to make it work, but can't get it down. Once...
How can I sort an array of double pointers based on the values they point to?
CC BY-SA 3.0
null
2008-08-20T01:44:58.323
2017-01-23T22:54:01.290
2017-01-23T22:54:01.290
4,492,932
522
[ "c++", "c", "arrays", "pointers", "reference" ]
17,307
2
null
17,289
0
null
While using IFrames as a sort of master page/template for your pages might be a good thing, IFrames have a known negative impact to searchability/SEO. It might also be unnecessary in the first place because once your images are loaded the first time (and with the large high-def images you have on your site, that woul...
null
CC BY-SA 3.0
null
2008-08-20T01:49:17.270
2015-08-20T22:22:29.690
2015-08-20T22:22:29.690
7,226
372
null
17,305
2
null
4,432
1
null
I've used this method before. The Length property of StringBuilder is NOT readonly so subtracting it by one means truncate the last character. But you have to make sure your length is not zero to start with (which would happen if your list is empty) because setting the length to less than zero is an error. ``` public ...
null
CC BY-SA 3.0
null
2008-08-20T01:47:02.920
2016-02-07T14:33:38.247
2016-02-07T14:33:38.247
2,921,691
2,051
null
17,312
2
null
17,299
5
null
You're close. You're referencing the address of the array items when you swap, which isn't necessary. The items in the array are pointers, and that's what needs to be swapped. See below: ``` void SortArray( int ** pArray, int ArrayLength ) { int i, j, flag = 1; // set flag to 1 to begin initial pass int * ...
null
CC BY-SA 2.5
null
2008-08-20T01:53:47.837
2008-08-20T02:05:08.213
2008-08-20T02:05:08.213
611
611
null
17,290
2
null
17,194
5
null
The Case Statement is my best sql friend. You also need a table for time to generate your 0 rev in both months. Assumptions are based on the availability of following tables: > sales: Category | Revenue | Yearh | Month and > tm: Year | Month (populated with all dates required for reporting) Example 1 with...
null
CC BY-SA 2.5
null
2008-08-20T01:28:08.567
2008-08-20T01:39:02.987
2008-08-20T01:39:02.987
1,293
1,293
null
17,320
1
17,345
null
8
8,703
I am a student studying software development, and I feel programming, in general, is too broad of a subject to try to know everything. To be proficient, you have to decide which areas to focus your learning and understanding. Certain skill sets synergize with each other, like data-driven web development and SQL experie...
What areas of specialization within programming would you recommend to a beginner
CC BY-SA 2.5
0
2008-08-20T01:59:08.710
2013-04-10T04:08:53.100
2013-04-10T04:08:53.100
null
1,880
[ "language-agnostic" ]
17,323
2
null
17,289
1
null
> I should also have mentioned that I would like the banner rotation to keep moving. When the visitor clicks on a link, the banner rotation starts over. It would be nice if the "animation" kept rotating, regardless of the page the user visits.Blockquote Well, in that case I would strongly recommend not doing that. The...
null
CC BY-SA 2.5
null
2008-08-20T02:00:59.470
2008-08-20T02:00:59.470
null
null
1,951
null
17,324
2
null
17,289
0
null
You could have it load the main page once, then asynchronously load the other elements when needed (ajax). If you did that, an iFrame would not be necessary. [Here is an example of loading only the new material](http://www.dubioussecurity.com).
null
CC BY-SA 3.0
null
2008-08-20T02:01:01.250
2013-04-02T15:15:15.730
2013-04-02T15:15:15.730
830,691
522
null
17,329
2
null
17,228
6
null
[Eclipse CDT](http://www.eclipse.org/cdt) is really quite nice. I still have to resort to Emacs from time to time but I really love the indexing, call trees, type trees, refactoring support (thought it's nothing like Java refactoring), etc. Syntax highlighting is quite powerful if you customize it (can have separate ...
null
CC BY-SA 2.5
null
2008-08-20T02:05:37.043
2008-08-20T02:05:37.043
null
null
825
null
17,332
2
null
17,299
3
null
> Heh, this isnt homework. If thats the case then consider using the STL to manage arrays and sort. Its easier to develop and maintain and the std::sort algorithm is asymptotically faster than bubble sort.
null
CC BY-SA 2.5
null
2008-08-20T02:08:49.593
2008-08-20T02:08:49.593
null
null
1,254
null
17,326
2
null
17,274
-2
null
Personally, I'd never use JPEG images on a website, mainly because of three reasons: 1. JPEGs often contains artifacts. 2. Quality is often proportional with filesize. 3. Does not support alpha transparency. That said, I'd recommend you to use PNGs for images since it's lossless and a 24-bit palette (meaning full ...
null
CC BY-SA 2.5
null
2008-08-20T02:03:19.187
2008-08-20T02:03:19.187
null
null
1,993
null
17,331
2
null
17,225
2
null
Hmm, interesting how different people are answering this different ways. It looks to me like [mk](https://stackoverflow.com/questions/17225/echo-system-commands-to-terminal-in-perl#17245) and [Daniel Fone](https://stackoverflow.com/questions/17225/echo-system-commands-to-terminal-in-perl#17293) interpreted it as wanti...
null
CC BY-SA 2.5
null
2008-08-20T02:06:10.490
2008-08-20T02:06:10.490
2017-05-23T12:08:36.867
-1
430
null
17,316
2
null
16,550
8
null
I use MSBuild completely for building. Here's my generic MSBuild script that searches the tree for .csproj files and builds them: ``` <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build"> <UsingTask AssemblyFile="$(MSBuildProjectDirectory)\bin\xUnit\xunitext.runner.msbuild.dll...
null
CC BY-SA 2.5
null
2008-08-20T01:56:06.473
2008-08-20T01:56:06.473
null
null
1,954
null
17,336
2
null
17,320
5
null
Not to directly reject your premise but I actually think being a generalist is a good position in programming. You will certainly develop expertise in specific areas but it is likely to be a product of either personal interest or work necessity. Over time the stuff you are able to transfer across languages and problem ...
null
CC BY-SA 2.5
null
2008-08-20T02:12:21.190
2008-08-20T02:12:21.190
null
null
1,104
null
17,337
2
null
16,167
1
null
I'm not familiar with the tools you mentioned but the refactoring support for C++ in [Eclipse 3.4](http://www.eclipse.org/downloads/packages/) is getting pretty useful and growing.
null
CC BY-SA 2.5
null
2008-08-20T02:13:17.290
2008-08-20T02:13:17.290
null
null
825
null
17,339
2
null
17,320
3
null
I think the more important question is: What areas of specialization are you most interested in? Once you know, begin learning in that area!
null
CC BY-SA 2.5
null
2008-08-20T02:14:12.000
2008-08-20T02:14:12.000
null
null
868
null
17,333
1
null
null
640
603,618
What would be the most efficient way to compare two `double` or two `float` values? Simply doing this is not correct: ``` bool CompareDoubles1 (double A, double B) { return A == B; } ``` But something like: ``` bool CompareDoubles2 (double A, double B) { diff = A - B; return (diff < EPSILON) && (-diff < ...
What is the most effective way for float and double comparison?
CC BY-SA 3.0
0
2008-08-20T02:09:33.647
2022-09-04T13:44:52.200
2016-12-21T03:17:41.073
1,459,996
2,057
[ "c++", "algorithm", "optimization", "floating-point" ]
17,335
2
null
17,299
2
null
You should consider using `std::swap()` to do your swapping. If you do, call it as such: ``` swap( obj1, obj2 ); ``` rather than: ``` std::swap( obj1, obj2 ); ``` As the first calling semantic will allow the proper namespace lookup to find the correct overload if one exists. Be sure to have either: ``` using nam...
null
CC BY-SA 3.0
null
2008-08-20T02:12:01.927
2011-10-17T13:41:54.433
2011-10-17T13:41:54.433
496,830
1,366
null
17,341
2
null
17,333
206
null
The comparison with an epsilon value is what most people do (even in game programming). You should change your implementation a little though: ``` bool AreSame(double a, double b) { return fabs(a - b) < EPSILON; } ``` --- Edit: Christer has added a stack of great info on this topic on a [recent blog post](h...
null
CC BY-SA 3.0
null
2008-08-20T02:14:51.013
2015-11-20T02:59:35.297
2015-11-20T02:59:35.297
908,939
611
null
17,340
2
null
4,432
5
null
I know it sounds like overkill for something that appears so simple, but as you can tell by the comments and code snippets, there's more than meets the eye. In addition to handling full CSV compliance, you'll eventually want to handle both reading and writing CSVs... and you may want file manipulation. I've used [O...
null
CC BY-SA 2.5
null
2008-08-20T02:14:42.013
2008-08-20T02:14:42.013
null
null
237
null
17,343
2
null
17,274
1
null
I had the same problem myself, I was just looking for something really easy to smash together a website quickly. First I went with just plain old HTML, but then I realised a simple CMS would be better. I went for Wordpress. Wordpress is mostly known as a blogging platform, but in my opinion it is really great as a dea...
null
CC BY-SA 2.5
null
2008-08-20T02:16:46.143
2008-08-20T02:16:46.143
null
null
1,542
null
17,322
2
null
16,963
2
null
I like the GridView control and have used it in several custom DotNetNuke modules for my company's web site. For one thing, using the built-in controls means less dependencies to worry about. And once I had it set up how I wanted it, I basically copied the code to other pages and just had to do minor tweaks. I've foun...
null
CC BY-SA 2.5
null
2008-08-20T02:00:51.767
2008-08-20T02:00:51.767
null
null
741
null
17,342
2
null
17,274
2
null
If you're familiar with html/javascript basics I'd look into a CMS - [wordpress](http://www.wordpress.org), [drupal](http://www.drupal.org), [joomla](http://www.joomla.org/), [nuke](http://phpnuke.org/), etc. All of these are free. Very often your web hosting company will install one of these by default which takes a...
null
CC BY-SA 2.5
null
2008-08-20T02:16:31.667
2008-08-20T02:16:31.667
null
null
225
null
17,344
2
null
16,689
4
null
I realize you're talking about programs on the same machine, but I've always liked the idea of passing messages in XML over HTTP. Your server could be a web server that's ready to accept an XML payload. Your client can send HTTP messages with XML in the body, and receive an HTTP response with XML in it. One reason I...
null
CC BY-SA 2.5
null
2008-08-20T02:19:53.450
2009-11-24T00:45:57.390
2009-11-24T00:45:57.390
2,030
2,030
null
17,345
2
null
17,320
21
null
Ben, Almost all seasoned programmers are still students in programming. You never stops learning anything when you are a developer. But if you are really starting off on your career then you should be least worried about the specialization thing. All APIs, frameworks and skills that you expect that gives you a long ter...
null
CC BY-SA 2.5
null
2008-08-20T02:20:32.873
2008-08-20T02:20:32.873
null
null
1,781
null
17,346
2
null
17,320
3
null
I would think the greatest skill of all would be to adapt with the times, because if your employer can see this potential in you then they would be wise to hold on tightly. That said, I would advise you dive into the area YOU would enjoy. . Since my current employ is with an internet provider, I've found networki...
null
CC BY-SA 2.5
null
2008-08-20T02:22:26.673
2008-08-20T02:22:26.673
null
null
952
null
17,350
2
null
16,963
2
null
They are one of the benefits of asp.net. Up until just recently I hated them, but the more you use them the easier they become, once you learn what setting you must change for which instances. Mainly I like the form view and listview the gridview still needs some work.
null
CC BY-SA 2.5
null
2008-08-20T02:38:46.353
2008-08-20T02:38:46.353
null
null
1,925
null
17,348
2
null
16,340
0
null
[RuntimeHelpers.GetHashCode](http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.runtimehelpers.gethashcode.aspx) might help: > From Msdn:Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures such as a hash table.
null
CC BY-SA 2.5
null
2008-08-20T02:32:20.193
2008-08-20T02:32:20.193
null
null
718
null
17,318
2
null
17,289
0
null
This may work without CSS also, but if you use CSS to load the background and your server is configured correctly, the image should already only be downloaded once. Usually the browser will request a resource by asking for it only if it has not been modified since the last time it was downloaded. In this case, the onl...
null
CC BY-SA 2.5
null
2008-08-20T01:58:19.633
2008-08-20T01:58:19.633
null
null
392
null
17,347
2
null
17,032
12
null
I use it only when it's clearly obvious what var is. clear to me: ``` XmlNodeList itemList = rssNode.SelectNodes("item"); var rssItems = new RssItem[itemList.Count]; ``` not clear to me: ``` var itemList = rssNode.SelectNodes("item"); var rssItems = new RssItem[itemList.Count]; ```
null
CC BY-SA 3.0
null
2008-08-20T02:26:04.950
2013-01-09T16:59:25.533
2013-01-09T16:59:25.533
1,147
1,147
null
17,354
2
null
16,963
4
null
Every single app we development at my company has grids (the apps are all behind the firewall). That includes both web apps and Winform apps. For the web apps it's the good ole gridview with custom sorting for the winform apps we use Janus grid. I'm trying to get the developers/users to think of a better user interf...
null
CC BY-SA 2.5
null
2008-08-20T02:42:26.953
2008-08-20T02:42:26.953
null
null
1,351
null
17,351
2
null
17,172
6
null
In the interest of not reinventing the wheel, why not take a look at ACL/Authentication systems like [Zend ACL](http://framework.zend.com/manual/en/zend.acl.html) and [Zend Auth](http://framework.zend.com/manual/en/zend.auth.html)? Both can be used independently from the Zend Framework as a whole. Access Control is a t...
null
CC BY-SA 2.5
null
2008-08-20T02:39:00.863
2008-11-03T18:15:12.807
null
null
204
null
17,352
1
17,390
null
17
4,546
In relation to this question on [Using OpenGL extensions](https://stackoverflow.com/questions/14413/using-opengl-extensions-on-windows), what's the purpose of these extension functions? Why would I want to use them? Further, are there any tradeoffs or gotchas associated with using them?
What are OpenGL extensions, and what are the benefits/tradeoffs of using them?
CC BY-SA 3.0
0
2008-08-20T02:40:40.953
2014-12-13T07:56:07.970
2017-05-23T12:33:29.600
-1
803
[ "opengl" ]
17,357
2
null
17,231
2
null
It is probably shell scripts that help take a company the future. I know just from a programming standpoint that I would waste a lot of time doing repetitive tasks that I have delegated to shell scripts. For example, I know most of the subversion commands for the command line but if I can lump all those commands into ...
null
CC BY-SA 2.5
null
2008-08-20T02:46:48.737
2008-08-20T02:46:48.737
null
null
204
null
17,364
2
null
14,413
0
null
@Kronikarz: From the looks of it, seems to be the way of the future. NVIDIA already ships it along with its [OpenGL SDK](http://developer.nvidia.com/object/sdk_home.html). And its latest release was in 2007 compared to GLEE which was in 2006. But, the usage of both libraries looks almost the same to me. (GLEW has an ...
null
CC BY-SA 2.5
null
2008-08-20T03:01:42.273
2008-08-20T03:01:42.273
null
null
1,630
null
17,359
1
9,524,359
null
306
734,298
I've created a script that runs every night on my Linux server that uses `mysqldump` to back up each of my MySQL databases to .sql files and packages them together as a compressed .tar file. The next step I want to accomplish is to send that tar file through email to a remote email server for safekeeping. I've been abl...
How do I send a file as an email attachment using Linux command line?
CC BY-SA 4.0
0
2008-08-20T02:48:50.433
2022-12-07T15:40:00.707
2022-06-21T10:52:12.383
1,145,388
1,339
[ "linux", "email", "command-line" ]
17,366
2
null
17,359
13
null
You can use [mutt](http://www.mutt.org/doc/manual/) to send the email with attachment ``` mutt -s "Backup" -a mysqldbbackup.sql backup@example.com < message.txt ```
null
CC BY-SA 4.0
null
2008-08-20T03:09:39.137
2022-07-11T09:52:31.997
2022-07-11T09:52:31.997
1,145,388
1,750
null
17,367
2
null
17,231
16
null
Using shell scripts is fine when you're using their strengths. My company has some class 5 soft switches and the call processing code and the provisioning interface is written in java. Everything else is written in KSH - DB dumps for backups, pruning, log file rotation, and all the automated reporting. I would argue...
null
CC BY-SA 2.5
null
2008-08-20T03:12:01.313
2008-08-20T03:12:01.313
null
null
430
null
17,370
1
17,371
null
23
43,666
I've been using OpenGL extensions on Windows the [painful way](https://stackoverflow.com/questions/14413/using-opengl-extensions-on-windows). Is GLEW the easier way to go? How do I get started with it?
Using GLEW to use OpenGL extensions under Windows
CC BY-SA 2.5
0
2008-08-20T03:19:34.400
2013-10-10T11:25:08.680
2017-05-23T12:33:29.757
-1
1,630
[ "opengl", "glew" ]
17,365
2
null
17,359
41
null
From looking at `man mailx`, the mailx program does not have an option for attaching a file. You could use another program such as mutt. ``` echo "This is the message body" | mutt -a file.to.attach -s "subject of message" recipient@example.com ``` Command line options for mutt can be shown with `mutt -h`.
null
CC BY-SA 4.0
null
2008-08-20T03:05:57.147
2022-07-11T09:52:14.460
2022-07-11T09:52:14.460
1,145,388
1,653
null
17,372
2
null
17,175
28
null
Full cross-platform support for Windows, Mac and Linux with complete feature parity for each OS. ;)
null
CC BY-SA 2.5
null
2008-08-20T03:19:55.710
2008-08-20T03:19:55.710
null
null
1,347
null
17,363
2
null
16,829
0
null
We migrated from the bad world of VSS with one giant repository (over 4G) before switching to SVN. I really struggled with how to set up the new repository for our company. Our company is very "old" school. It's difficult to get change I'm one of the younger developers and I'm 45! I am part of a corporate developme...
null
CC BY-SA 2.5
null
2008-08-20T02:59:28.240
2008-08-20T02:59:28.240
null
null
1,351
null
17,311
2
null
17,140
18
null
If you want to perform more complicated operations, like reading the output of the external program, you may be better served by the [popen](http://man.he.net/man3/popen) system call. For example, to programmatically access a directory listing (this is a somewhat silly example, but useful an example), you could write ...
null
CC BY-SA 2.5
null
2008-08-20T01:52:59.040
2008-08-20T01:52:59.040
null
null
1,199
null
17,373
1
27,791
null
13
18,496
How do I open the default mail program with a Subject and Body in a cross-platform way? Unfortunately, this is for a a client app written in Java, not a website. I would like this to work in a cross-platform way (which means Windows and Mac, sorry Linux). I am happy to execute a VBScript in Windows, or AppleScript in...
How do I open the default mail program with a Subject and Body in a cross-platform way?
CC BY-SA 2.5
0
2008-08-20T03:20:02.090
2013-01-22T03:35:58.493
2008-08-26T02:56:18.230
338
338
[ "java", "windows", "macos", "email" ]
17,377
2
null
1,644
24
null
- - - - -
null
CC BY-SA 2.5
null
2008-08-20T03:28:03.507
2010-07-14T15:14:13.027
2010-07-14T15:14:13.027
1,432
1,432
null
17,376
1
17,414
null
6
3,526
I have a PHP script that runs as a CGI program and the HTTP `Authenticate` header gets eaten and spit out. So I would like to implement some kind of FORM based authentication. As an added constraint, there is no database so no session data can be stored. I am very open to having a master username and password. I just ...
How would you implement FORM based authentication without a backing database?
CC BY-SA 2.5
0
2008-08-20T03:27:08.343
2019-08-24T16:08:46.053
2008-09-17T07:56:49.710
2,961
338
[ "php", "http", "authentication", "cookies", "cgi" ]
17,387
1
222,016
null
4
1,358
I have a blogengine.net install that requires privatization. I'm doing research work at the moment, but I have to keep my blog/journal private until certain conditions are met. How can I privatize my blogEngine.net install so that readers must log in to read my posts?
Privatizing a BlogEngine.Net Installation
CC BY-SA 2.5
0
2008-08-20T03:39:30.857
2012-12-04T21:03:17.350
2008-09-01T06:10:26.607
209
209
[ "c#", ".net", "asp.net", "blogs" ]
17,371
2
null
17,370
37
null
Yes, the (GLEW) is a painless way to use OpenGL extensions on Windows. Here's how to get started on it: Identify the OpenGL extension and the extension APIs you wish to use. OpenGL extensions are listed in the [OpenGL Extension Registry](http://www.opengl.org/registry/). Check if your graphic card supports the exten...
null
CC BY-SA 2.5
null
2008-08-20T03:19:50.827
2008-08-20T03:19:50.827
null
null
1,630
null
17,392
2
null
17,387
0
null
I would think it's possible to do this in the web config file by doing something like the following: ``` <system.web> <authorization> <allow roles="Admin" /> <deny users="*" /> </authorization> </system.web> ```
null
CC BY-SA 2.5
null
2008-08-20T03:49:49.943
2008-08-20T03:49:49.943
null
null
493
null
17,391
2
null
7,540
1
null
There's a [thorough discussion of this](http://shaver.off.net/diary/2008/05/25/fsyncers-and-curveballs/) that explains all of the fsync related problems that affected pre-3.0 versions of FF. In general, I have not seen the behaviour since then either, and really it shouldn't be a problem at all if your system isn't al...
null
CC BY-SA 2.5
null
2008-08-20T03:47:03.833
2008-08-20T03:47:03.833
null
null
1,432
null
17,374
2
null
16,963
4
null
Using controls like the GridView are great for simple apps. Even if you are a server-side HTML bracket-twiddling ninja, they can make developing simple stuff much less time consuming. The problem is that they usually start to expose their shortcomings eventually, and you end up having to spend time tweaking them anywa...
null
CC BY-SA 2.5
null
2008-08-20T03:24:46.760
2008-08-20T03:24:46.760
null
null
1,436
null
17,390
2
null
17,352
23
null
The OpenGL standard allows individual vendors to provide additional functionality through extensions as new technology is created. Extensions may introduce new functions and new constants, and may relax or remove restrictions on existing OpenGL functions. Each vendor has an alphabetic abbreviation that is used in nam...
null
CC BY-SA 2.5
null
2008-08-20T03:43:32.627
2008-08-20T03:43:32.627
null
null
1,043
null
17,393
2
null
17,352
7
null
are new features added to the , they are added by the OpenGL standards body and by the various graphics card vendors. These are exposed to the programmer as new function calls or variables. Every new version of the OpenGL specification ships with newer functionality and (typically) includes all the previous functional...
null
CC BY-SA 2.5
null
2008-08-20T03:51:09.863
2008-08-20T10:48:40.467
2008-08-20T10:48:40.467
1,630
1,630
null
17,394
2
null
17,373
0
null
I have implemented this, and it works well on OS X. (Ryan's mention of the max URL length has not been codified.) ``` public void email(String subject, String body) throws Exception { String cmd = "open mailto:"; cmd += "?subject=" + urlEncode(subject); cmd += "&body=" + urlEncode(body); Runtim...
null
CC BY-SA 2.5
null
2008-08-20T03:56:38.460
2008-08-20T03:56:38.460
null
null
338
null
17,313
2
null
17,032
0
null
There's a [really good MSDN article](http://msdn.microsoft.com/en-us/library/bb384061.aspx) on this topic and it outlines some cases where you can't use var: The following restrictions apply to implicitly-typed variable declarations: > - - - - - I would recommend checking it out to understand the full implications of ...
null
CC BY-SA 4.0
null
2008-08-20T01:53:58.333
2021-07-11T16:38:08.297
2021-07-11T16:38:08.297
2,667,173
493
null
17,398
2
null
17,373
3
null
> I had to re-implement URLencode because Java's would use + for space and Mail took those literally. I don't know if Java has some built-in method for urlencoding the string, but this link [http://www.permadi.com/tutorial/urlEncoding/](http://www.permadi.com/tutorial/urlEncoding/) shows some of the most common ch...
null
CC BY-SA 2.5
null
2008-08-20T04:03:44.200
2008-08-20T04:03:44.200
null
null
1,627
null
17,408
2
null
15,851
1
null
I think that labelled loops are so uncommon that you can pick whatever method of labelling works for you - what you have there makes your intentions with the continues perfectly clear. ---
null
CC BY-SA 2.5
null
2008-08-20T04:26:04.957
2008-08-20T04:26:04.957
null
null
943
null
17,403
2
null
1,644
0
null
I listen to and watch: * this week in tech * Cranky Geeks * Security Now * This Week in Media * Tech5
null
CC BY-SA 2.5
null
2008-08-20T04:15:35.717
2008-08-20T04:15:35.717
null
null
522
null
17,381
2
null
17,359
52
null
Depending on your version of Linux it may be called mail. To quote @David above: ``` mail -s "Backup" -a mysqldbbackup.sql backup@email.example < message.txt ``` or also: ``` cat message.txt | mail -s "Backup" -a mysqldbbackup.sql backup@email.example ```
null
CC BY-SA 4.0
null
2008-08-20T03:36:24.250
2022-06-21T10:52:28.510
2022-06-21T10:52:28.510
1,145,388
1,084
null
17,379
2
null
17,373
2
null
Mailto isn't a bad route to go. But as you mentioned, you'll need to make sure it is encoded correctly. The main problem with using mailto is with breaking lines. Use %0A for carriage returns, %20 for spaces. Also, keep in mind that the mailto is considered the same as a URL of sorts and therefore will have the same...
null
CC BY-SA 2.5
null
2008-08-20T03:30:31.487
2008-08-20T03:59:15.943
2008-08-20T03:59:15.943
1,627
1,627
null
17,414
2
null
17,376
5
null
A few ways you could do this. 1. htaccess -- have your webserver handle securing the pages in question (not exactly cgi form based though). 2. Use cookies and some sort of hashing algorithm (md5 is good enough) to store the passwords in a flat file where each line in the file is username:passwordhash. Make sure to sa...
null
CC BY-SA 2.5
null
2008-08-20T04:37:35.243
2008-08-20T04:43:15.573
2008-08-20T04:43:15.573
92
92
null
17,411
1
null
null
20
10,992
How can you make the display frames per second be independent from the game logic? That is so the game logic runs the same speed no matter how fast the video card can render.
How do you separate game logic from display?
CC BY-SA 2.5
0
2008-08-20T04:30:24.543
2019-10-26T10:12:43.697
2008-08-24T15:39:04.747
2,134
null
[ "algorithm" ]
17,389
2
null
17,373
4
null
You can prefill the subject line in the email by adding the subject preceded by '' after the email address. So the link now becomes: ``` <a href="mailto:someone@yoursite.com?subject=Mail from Our Site">Email Us</a> ``` Mail can be sent to additional recipients either as carbon copies (cc) or blind carbon co...
null
CC BY-SA 3.0
null
2008-08-20T03:42:35.547
2013-01-22T03:35:58.493
2013-01-22T03:35:58.493
242
242
null
17,420
2
null
17,411
-2
null
From my experience (not much) Jesse and Adam's answers should put you on the right track. If you are after further information and insight into how this works, i found that the sample applications for [TrueVision 3D](http://www.truevision3d.com/) were very useful.
null
CC BY-SA 2.5
null
2008-08-20T04:45:36.003
2008-08-20T04:45:36.003
null
null
1,061
null
17,419
2
null
17,376
-1
null
... About salt, add the username in your hash salt will prevent someone who knows your salt and have access to your password file to write a rainbow table and crack number of your users's password.
null
CC BY-SA 2.5
null
2008-08-20T04:44:37.987
2008-08-20T04:44:37.987
null
null
446,497
null
17,422
2
null
17,359
80
null
Or, failing mutt: ``` gzip -c mysqldbbackup.sql | uuencode mysqldbbackup.sql.gz | mail -s "MySQL DB" backup@email.com ```
null
CC BY-SA 2.5
null
2008-08-20T04:48:25.263
2008-08-20T04:48:25.263
null
null
1,848
null
17,426
2
null
17,373
4
null
`start` works fine in Windows (see below). I would use Java's built in UrlEscape then just run a second replacement for '+' characters. ``` start mailto:"?subject=My%20Subject&body=The%20Body" ```
null
CC BY-SA 2.5
null
2008-08-20T04:53:10.837
2008-08-20T04:53:10.837
null
null
1,414
null
17,415
2
null
17,411
4
null
You could make your game loop look like: ``` int lastTime = GetCurrentTime(); while(1) { // how long is it since we last updated? int currentTime = GetCurrentTime(); int dt = currentTime - lastTime; lastTime = currentTime; // now do the game logic Update(dt); // and you can render Dra...
null
CC BY-SA 2.5
null
2008-08-20T04:37:39.860
2008-08-20T04:37:39.860
null
null
112
null
17,396
2
null
419
27
null
I'm pretty sure there's no good way to force VB6 to unload the control. Here's what I do... instead of running Visual C and Visual Basic side-by-side, run VB6 VC : 1. Load up VC 2. Open the project containing your COM objects 3. Edit, change, etc. 4. In VC, set the Output Executable to be VB6.EXE with appropriate c...
null
CC BY-SA 3.0
null
2008-08-20T03:58:09.347
2015-12-29T06:31:29.563
2015-12-29T06:31:29.563
3,787,519
4
null
17,424
2
null
17,411
8
null
Koen Witters has a [very detailed article](https://dewitters.com/dewitters-gameloop/) about different game loop setups. He covers: - - - - (These are the headings pulled from the article, in order of desirability.)
null
CC BY-SA 4.0
null
2008-08-20T04:52:20.683
2019-10-26T10:12:43.697
2019-10-26T10:12:43.697
4,466,800
55
null
17,430
1
null
null
-1
157
We created a tool which converts a language called P2, a language similar to assembly which I think exists only in Japan, to C#. There are at least a hundred modules written in P2 and we want to verify if the conversion to C# is right? How can we test this?
Language Conversion Testing
CC BY-SA 2.5
null
2008-08-20T05:18:22.337
2014-04-02T23:12:25.200
2014-04-02T23:12:25.200
193,717
718
[ "c#", "testing" ]
17,412
2
null
17,333
15
null
The code you wrote is bugged : ``` return (diff < EPSILON) && (-diff > EPSILON); ``` The correct code would be : ``` return (diff < EPSILON) && (diff > -EPSILON); ``` (...and yes this is different) I wonder if fabs wouldn't make you lose lazy evaluation in some case. I would say it depends on the compiler. You m...
null
CC BY-SA 2.5
null
2008-08-20T04:32:25.537
2008-08-20T05:20:55.153
2008-08-20T05:20:55.153
446,497
446,497
null
17,435
1
null
null
14
1,483
Does anyone see server-side JavaScript taking off? There are a couple of implementations out there, but it all seems to be a bit of a stretch (as in, "doing it BECAUSE WE CAN" type of attitude). I'm curious to know if anyone actually writes JavaScript for the server-side and what their experiences with it have been t...
Will server-side JavaScript take off? Which implementation is most stable?
CC BY-SA 2.5
0
2008-08-20T05:33:28.680
2012-09-23T16:02:09.863
2009-07-24T03:02:53.640
6,010
1,693
[ "javascript", "server-side" ]
17,436
2
null
17,434
0
null
When implementing tree algorithms for class, the framework code the prof gave us had the tree class as a friend of the node class. It doesn't really do any good, other than let you access a member variable without using a setting function.
null
CC BY-SA 2.5
null
2008-08-20T05:33:58.337
2008-08-20T05:33:58.337
null
null
55
null
17,438
2
null
17,435
1
null
I've never even heard of this, but it strikes me as using the wrong tool for the job. Since programming languages are just tools designed to help us solve some problem. Why would you want to process something in Javascript when you can process it in PHP or ASP.NET which are designed specifically for this task? Sure y...
null
CC BY-SA 2.5
null
2008-08-20T05:37:47.780
2008-08-20T05:37:47.780
null
null
1,366
null
17,429
2
null
17,370
6
null
Personally I wouldn't use an exit command. I would throw an exception so you can clear any other initialisation up at the end of the function. ie: ``` try { // init opengl/directx // init directaudio // init directinput if (GLEW_OK != glewInit()) { throw std::exception("glewInit failed")...
null
CC BY-SA 2.5
null
2008-08-20T05:08:59.083
2008-08-20T05:08:59.083
null
null
342
null
17,441
2
null
3,234
0
null
Yup [Keith](https://stackoverflow.com/users/905/keith) ugly but true. I ended up placing the MIME types that we would use into a database and then pull them out when I was publishing a file. I still can't believe that there is no autoritive list of types out there or that there is no mention of what is available in MSD...
null
CC BY-SA 3.0
null
2008-08-20T05:42:47.130
2017-09-25T19:34:53.857
2017-09-25T19:34:53.857
6,761,181
231
null
17,427
2
null
17,411
2
null
There was an excellent article on flipcode about this back in the day. I would like to dig it up and present it for you. [http://www.flipcode.com/archives/Main_Loop_with_Fixed_Time_Steps.shtml](http://www.flipcode.com/archives/Main_Loop_with_Fixed_Time_Steps.shtml) It's a nicely thought out loop for running a game: ...
null
CC BY-SA 2.5
null
2008-08-20T05:06:03.600
2008-08-20T05:06:03.600
null
null
338
null
17,437
2
null
17,435
-1
null
I can't see most developers getting over their distaste for client-side JavaScript programming. I'd rather go to Java for server-side stuff before choosing JavaScript.
null
CC BY-SA 2.5
null
2008-08-20T05:36:57.987
2008-08-20T05:36:57.987
null
null
680
null
17,431
2
null
17,430
2
null
You don't test the converter, you test the final code. If the code doesn't compile, clearly your converter is failing. If the code compiles and your functionality tests fail, then you can tweak the code so that it passes the test. If you are fairly successful you should see that you only need to fix the modules that ...
null
CC BY-SA 2.5
null
2008-08-20T05:21:20.177
2008-08-20T05:21:20.177
null
null
372
null
17,434
1
17,443
null
385
184,778
I have been reading through the [C++ FAQ](http://yosefk.com/c++fqa/) and was curious about the [friend](http://yosefk.com/c++fqa/friend.html) declaration. I personally have never used it, however I am interested in exploring the language. What is a good example of using `friend`? --- Reading the FAQ a bit longer...
When should you use 'friend' in C++?
CC BY-SA 3.0
0
2008-08-20T05:29:32.793
2022-12-02T06:49:45.073
2017-06-15T18:54:27.863
3,980,929
716
[ "c++", "oop", "encapsulation", "friend" ]
17,417
2
null
17,411
31
null
I think the question reveals a bit of misunderstanding of how game engines should be designed. Which is perfectly ok, because they are damn complex things that are difficult to get right ;) You are under the correct impression that you want what is called Frame Rate Independence. But this does not only refer to Render...
null
CC BY-SA 3.0
null
2008-08-20T04:41:16.140
2012-05-31T19:29:19.050
2012-05-31T19:29:19.050
-1
1,366
null
17,450
2
null
17,435
1
null
Well, plain ol' ASP supported JavaScript server-side years ago and everyone onad their dog used VBShiate instead. But I have to agree with the others: JS does not seem to be the right tool here - and I love to do client-side JS :)
null
CC BY-SA 2.5
null
2008-08-20T06:10:06.847
2008-08-20T06:10:06.847
null
null
1,814
null
17,444
2
null
17,434
1
null
The tree example is a pretty good example : Having an object implemented in a few different class without having an inheritance relationship. Maybe you could also need it to have a constructor protected and force people to use your "friend" factory. ... Ok, Well frankly you can live without it.
null
CC BY-SA 2.5
null
2008-08-20T05:51:21.850
2008-08-20T05:51:21.850
null
null
446,497
null
17,457
2
null
17,274
3
null
Plain old HTML is fine, just as long as you don't use tags like blink and marquee.
null
CC BY-SA 2.5
null
2008-08-20T06:18:48.820
2008-08-20T06:18:48.820
null
null
372
null
17,451
2
null
17,434
8
null
You control the access rights for members and functions using Private/Protected/Public right? so assuming the idea of each and every one of those 3 levels is clear, then it should be clear that we are missing something... The declaration of a member/function as protected for example is pretty generic. You are saying ...
null
CC BY-SA 2.5
null
2008-08-20T06:10:58.263
2008-08-20T06:10:58.263
null
null
350
null
17,453
2
null
17,274
1
null
why not simply use [Google pages](http://pages.google.com)? Here is an [example](http://yellowfoxsoftware.googlepages.com/) of a website I did, takes about 2 hours, easy to maintain (not that I do (-: ) and FREE. I think that suggesting you mess with HTML for what you need is crazy!
null
CC BY-SA 2.5
null
2008-08-20T06:15:46.817
2008-08-20T06:15:46.817
null
null
350
null
17,458
2
null
15,979
1
null
Actually, I have been using a workaround for this. I append a character to the id, eg: A1, A2, etc. With such values in the field, it is possible to search using the query `id:A*` But would love to find whether a true solution exists.
null
CC BY-SA 2.5
null
2008-08-20T06:19:10.023
2008-08-20T06:19:10.023
null
null
1,448
null
17,443
2
null
17,434
362
null
Firstly (IMO) don't listen to people who say `friend` is not useful. It IS useful. In many situations you will have objects with data or functionality that are not intended to be publicly available. This is particularly true of large codebases with many authors who may only be superficially familiar with different area...
null
CC BY-SA 3.0
null
2008-08-20T05:48:22.717
2017-01-17T14:09:28.503
2017-01-17T14:09:28.503
null
1,043
null
17,456
2
null
17,435
1
null
I personally did a whole site in server side JavaScript using ASP. I found it quite enjoyable because I was able to have some good code reuse. This included: - - - Coupled with a higher-level modeling tool and code gen, I had fun with that project. I have no numbers on perf unfortunately, since it is used only on a...
null
CC BY-SA 2.5
null
2008-08-20T06:18:23.457
2008-08-20T06:18:23.457
null
null
338
null
17,448
2
null
15,023
4
null
You've got to love .NET reflection. I worked on the WPF team and can't quite think of anything better off the top of my head. The following code produces this list on my machine: ``` Bitmap Encoders: System.Windows.Media.Imaging.BmpBitmapEncoder System.Windows.Media.Imaging.GifBitmapEncoder System.Windows.Media.Imagin...
null
CC BY-SA 2.5
null
2008-08-20T06:03:18.313
2008-08-20T06:03:18.313
null
null
338
null
17,465
2
null
17,175
0
null
What about some way to be able to wrap Silverlight around AIR and be able to run it as a client in a multi platform way... I guess this is more of a request to the Adobe team rather than the Microsoft one, yet I should be cool! Cheers!
null
CC BY-SA 2.5
null
2008-08-20T06:26:22.360
2008-08-20T06:26:22.360
null
null
1,549
null
17,471
2
null
17,469
0
null
It is possible for other applications to register themselves as a handler for files with a particular extension. Quicktime has (or at least had) a tendency to do this with .png files, so a .png file would display fine inline in an HTML page, but with an URL referring directly to the .png file, IE would immediately dele...
null
CC BY-SA 2.5
null
2008-08-20T06:38:57.527
2008-08-20T06:38:57.527
null
null
893
null
17,468
2
null
17,225
2
null
Another technique to combine with the others mentioned in the answers is to use the `tee` command. For example: ``` open(F, "ls | tee /dev/tty |"); while (<F>) { print length($_), "\n"; } close(F); ``` This will both print out the files in the current directory (as a consequence of `tee /dev/tty`) and also print...
null
CC BY-SA 2.5
null
2008-08-20T06:33:49.673
2008-08-20T06:33:49.673
null
null
893
null
17,459
2
null
17,274
3
null
I personally love tools like [CityDesk](http://www.fogcreek.com/CityDesk/). And I'm not just plugging Joel. (There are others out there in this class I'm sure.) The point is they make making a static website very easy: - - - - For a dynamic collaborative site, I would just install one of many open source CMSs avail...
null
CC BY-SA 2.5
null
2008-08-20T06:23:16.347
2008-08-20T06:23:16.347
null
null
338
null
17,476
2
null
17,469
1
null
Maybe it is related to this: [http://photo.net/bboard/q-and-a-fetch-msg?msg_id=003j8d](http://photo.net/bboard/q-and-a-fetch-msg?msg_id=003j8d)
null
CC BY-SA 2.5
null
2008-08-20T06:44:48.073
2008-08-20T06:44:48.073
null
null
1,786
null
17,480
2
null
17,469
3
null
It won't load in IE7 on my Vista x64 box. Also Paint.net won't save the file, saying "There was an unspecified error while saving the file." EDIT: In paint.net I did a Select All, New File, Paste, Save, and now it works fine. I'm guessing that file has some weird corruption.
null
CC BY-SA 2.5
null
2008-08-20T06:49:10.950
2008-08-20T06:49:10.950
null
null
100
null
17,485
2
null
17,483
0
null
If you address the child class as a type of its parent, then a non-virtual function will call the parent class's version. ie: ``` Parent* obj = new Child(); ```
null
CC BY-SA 2.5
null
2008-08-20T06:53:36.647
2008-08-20T06:53:36.647
null
null
55
null
17,483
1
17,486
null
39
21,623
Is anyone aware of a language feature or technique in C++ to prevent a child class from over riding a particular method in the parent class? ``` class Base { public: bool someGuaranteedResult() { return true; } }; class Child : public Base { public: bool someGuaranteedResult() { return false; /* Haha I broke ...
Is there a way to prevent a method from being overridden in subclasses?
CC BY-SA 3.0
0
2008-08-20T06:50:32.910
2017-07-26T18:35:15.660
2013-06-05T07:50:02.870
1,025,391
1,366
[ "c++", "overriding", "metrowerks" ]