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 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
22,806 | 2 | null | 22,801 | 0 | null | I use the first loop when iterating over a conventional (indexed?) array and the foreach loop when dealing with an associative array. It just seems natural and helps the code flow and be more readable, in my opinion. As for do...while loops, I use those when I have to do more than just flip through an array.
I'm not s... | null | CC BY-SA 2.5 | null | 2008-08-22T16:34:58.387 | 2008-08-22T16:34:58.387 | null | null | 572 | null |
22,802 | 2 | null | 22,570 | 2 | null | Eric Z Beard:
> I do store all dates in GMT. Here's the use case: something happened at 11:00 PM EST on the 1st, which is the 2nd GMT. I want to see activity for the 1st, and I am in EST so I will want to see the 11PM activity. If I just compared raw GMT datetimes, I would miss things. Each row in the report can repre... | null | CC BY-SA 2.5 | null | 2008-08-22T16:33:13.243 | 2008-08-22T16:33:13.243 | null | null | 2,199 | null |
22,813 | 2 | null | 22,801 | 0 | null | In regards to performance, a foreach is more consuming than a for
[http://forums.asp.net/p/1041090/1457897.aspx](http://forums.asp.net/p/1041090/1457897.aspx)
| null | CC BY-SA 2.5 | null | 2008-08-22T16:38:39.363 | 2013-01-24T13:09:59.757 | 2013-01-24T13:09:59.757 | 1,782 | 1,782 | null |
22,810 | 2 | null | 22,801 | 0 | null | Performance is not significantly better in either case. While is useful for more complex tasks than iterating, but `for` and `while` are functionally equivalent.
`Foreach` is nice, but has one important caveat: you the enumerable you're iterating. So no removing, adding or replacing entries to/in it. Modifying entrie... | null | CC BY-SA 2.5 | null | 2008-08-22T16:37:42.983 | 2008-08-22T16:37:42.983 | null | null | 2,018 | null |
22,814 | 1 | 22,819 | null | 63 | 115,858 | I need to see the contents of the viewstate of an asp.net page. I looked for a viewstate decoder, found [Fridz Onion's ViewState Decoder](http://www.testingreflections.com/node/view/3424) but it asks for the url of a page to get its viewstate. Since my viewstate is formed after a postback and comes as a result of an op... | How to decode viewstate | CC BY-SA 2.5 | 0 | 2008-08-22T16:38:49.407 | 2020-08-13T13:13:32.260 | null | null | 31,505 | [
"asp.net",
"viewstate"
] |
22,804 | 2 | null | 3,748 | 140 | null | As with most issues, it's not as simple as it sounds. There are cases where it would make sense to store the images in the database.
- - - -
On the other hand there are problems associated
- - -
| null | CC BY-SA 2.5 | null | 2008-08-22T16:33:14.163 | 2011-03-31T22:43:38.043 | 2011-03-31T22:43:38.043 | 464,251 | 1,349 | null |
22,811 | 2 | null | 22,801 | 0 | null | With a foreach loop, a copy of the original array is made in memory to use inside. You shouldn't use them on large structures; a simple for loop is a better choice. You can use a while loop more efficiently on a large non-numerically indexed structure like this:
```
while(list($key, $value) = each($array)) {
```
But... | null | CC BY-SA 2.5 | null | 2008-08-22T16:37:44.857 | 2008-08-22T16:37:44.857 | null | null | 1,951 | null |
22,801 | 1 | 23,835 | null | 6 | 2,282 | It's about PHP but I've no doubt many of the same comments will apply to other languages.
Simply put, what are the differences in the different types of loop for PHP? Is one faster/better than the others or should I simply put in the most readable loop?
```
for ($i = 0; $i < 10; $i++)
{
# code...
}
foreach ($ar... | The difference between loops | CC BY-SA 2.5 | 0 | 2008-08-22T16:32:33.153 | 2013-01-24T13:09:59.757 | null | null | 1,384,652 | [
"php",
"loops"
] |
22,816 | 1 | 43,112 | null | 18 | 16,786 | I know the following libraries for drawing charts in an SWT/Eclipse RCP application:
- [Eclipse BIRT Chart Engine](http://www.eclipse.org/articles/article.php?file=Article-BIRTChartEngine/index.html)- [JFreeChart](http://www.jfree.org/jfreechart/)
Which other libraries are there for drawing pretty charts with SWT? Or... | Libraries for pretty charts in SWT? | CC BY-SA 2.5 | 0 | 2008-08-22T16:39:15.927 | 2017-11-16T21:05:22.397 | null | null | 1,793 | [
"java",
"eclipse",
"charts",
"swt"
] |
22,807 | 1 | null | null | 1 | 1,742 | Wondering if there is a better why in the WHERE clause of choosing records when you need to look at effective start and end dates?
Currently this how I've done it in the past on MS SQL Server. Just worried about the date and not the time. I'm using SQL Server 2005.
```
AND Convert(datetime, Convert(char(10), ep.Effe... | Comparing effective dates in SQL | CC BY-SA 2.5 | 0 | 2008-08-22T16:35:19.027 | 2016-08-03T15:59:26.013 | 2016-08-03T15:59:26.013 | 1,274,572 | 2,526 | [
"sql",
"sql-server",
"date",
"sql-server-2005"
] |
22,819 | 2 | null | 22,814 | 40 | null | Use [Fiddler](http://www.fiddlertool.com) and grab the view state in the response and paste it into the bottom left text box then decode.
| null | CC BY-SA 2.5 | null | 2008-08-22T16:40:16.457 | 2008-08-22T16:40:16.457 | null | null | 77 | null |
22,817 | 2 | null | 22,807 | 1 | null | That is terrible, take a look at [Only In A Database Can You Get 1000% + Improvement By Changing A Few Lines Of Code](http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/only-in-a-database-can-you-get-1000-impr) to see how you can optimize this since that is not sargable
Also check out [Get Datetime Without Tim... | null | CC BY-SA 2.5 | null | 2008-08-22T16:39:21.327 | 2008-08-22T16:39:21.327 | null | null | 740 | null |
22,820 | 2 | null | 22,807 | 0 | null | @Darren Kopp
Be carefull with BETWEEN, check out [How Does Between Work With Dates In SQL Server?](http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/how-does-between-work-with-dates-in-sql-)
| null | CC BY-SA 2.5 | null | 2008-08-22T16:40:49.187 | 2008-08-22T16:40:49.187 | null | null | 740 | null |
22,821 | 2 | null | 22,704 | 2 | null | Have you checked this out?
[Best practices for making web pages fast](http://developer.yahoo.com/performance/) from Yahoo!'s Exceptional Performance team
If you really are having trouble at the backend, this won't help. But we used their advice to great effect to make our site faster, and there is still more to do.
... | null | CC BY-SA 2.5 | null | 2008-08-22T16:41:31.010 | 2008-08-22T16:41:31.010 | null | null | 137 | null |
22,825 | 2 | null | 22,818 | 6 | null | I think it's a business logic vs. data logic thing. If there is logic that ensures the consistency of your data, put it in a stored procedure. Same for convenience functions for data retrieval/update.
Everything else should go into the code.
A friend of mine is developing a host of stored procedures for data analysis... | null | CC BY-SA 2.5 | null | 2008-08-22T16:43:09.927 | 2008-08-22T16:43:09.927 | null | null | 1,968 | null |
22,818 | 1 | null | null | 12 | 4,402 | I have been developing web/desktop applications for about 6 years now. During the course of my career, I have come across application that were heavily written in the database using stored procedures whereas a lot of application just had only a few basic stored procedures (to read, insert, edit and delete entity record... | Where to put your code - Database vs. Application? | CC BY-SA 2.5 | 0 | 2008-08-22T16:39:40.373 | 2016-01-06T12:18:52.577 | 2008-08-22T16:47:17.390 | 194 | 2,528 | [
"database"
] |
22,823 | 2 | null | 22,818 | 5 | null | I'm in the object oriented architects camp. It's not necessarily a crime to put code in the database, as long as you understand the caveats that go along with that. Here are some:
1. It's not debuggable
2. It's not subject to source control
3. Permissions on your two sets of code will be different
4. It will make it ... | null | CC BY-SA 2.5 | null | 2008-08-22T16:42:04.940 | 2008-08-22T16:42:04.940 | null | null | 1,975,282 | null |
22,824 | 2 | null | 22,807 | 1 | null | @Darren Kopp - you can use
```
set @date2 = '20201001'
```
this will let you lose the cast.
footndale - you can use date arithmetic to remove the time as well. Something like
```
select dateadd(d, datediff(d, 0, CURRENT_TIMESTAMP), 0)
```
to get today's date (without the time). I believe this is more efficie... | null | CC BY-SA 2.5 | null | 2008-08-22T16:42:30.787 | 2008-08-22T16:42:30.787 | null | null | 794 | null |
22,832 | 2 | null | 22,801 | 1 | null | This is CS101, but since no one else has mentioned it, while loops evaluate their condition before the code block, and do-while evaluates after the code block, so do-while loops are always guaranteed to run their code block at least once, regardless of the condition.
| null | CC BY-SA 2.5 | null | 2008-08-22T16:46:47.143 | 2008-08-22T16:46:47.143 | null | null | 430 | null |
22,830 | 2 | null | 22,816 | 0 | null | There's also JGraph, but I'm not sure if that's only for graphs (i.e. nodes and edges), or if it does charts also.
| null | CC BY-SA 2.5 | null | 2008-08-22T16:46:22.400 | 2008-08-22T16:46:22.400 | null | null | 2,132 | null |
22,839 | 2 | null | 3,748 | -1 | null | No, due to page splits. You're essentially defining rows that can be 1KB - n MB so your database will have a lot of empty spaces in its pages which is bad for performance.
| null | CC BY-SA 2.5 | null | 2008-08-22T16:48:58.307 | 2008-08-22T16:48:58.307 | null | null | 1,143 | null |
22,835 | 2 | null | 22,340 | 1 | null | In most firewall setups, the TCP connection will be torn down by the firewall if it is idle to conserve resources. The idle timeout is probably not something you can control. Some will tear them down if they are idle and a resource limit is being hit.
Most corp environments won't allow any machines to make an outbound... | null | CC BY-SA 2.5 | null | 2008-08-22T16:47:52.007 | 2008-08-22T16:47:52.007 | null | null | null | null |
22,833 | 2 | null | 22,792 | 5 | null | It's not open source, but is free (as in beer): [Sql Effects Accord (aka Clarity) Community Edition](http://www.sqleffects.com/Articles/Product/sqlAccordInfo/aboutSqlAccordCommunityEd.html)
| null | CC BY-SA 2.5 | null | 2008-08-22T16:46:57.657 | 2008-08-22T16:46:57.657 | null | null | 2,199 | null |
22,829 | 2 | null | 21,422 | 0 | null | The problem is to make the search engine use the fact that 'subversion' and 'svn' are to the point that they mean the same 'thing'.
It might be attractive to compute a simple similarity between tags based on frequency: 'subversion' and 'svn' appear very often together, so requesting 'svn' would return SVN-related que... | null | CC BY-SA 2.5 | null | 2008-08-22T16:46:04.647 | 2008-08-22T16:46:04.647 | null | null | 2,050 | null |
22,838 | 2 | null | 22,801 | 1 | null | [PHP Benchmarks](http://www.php.lt/benchmark/phpbench.php)
| null | CC BY-SA 2.5 | null | 2008-08-22T16:48:12.130 | 2008-08-22T16:48:12.130 | null | null | 1,993 | null |
22,836 | 1 | 22,896 | null | 205 | 231,476 | In Perl, what is a good way to perform a replacement on a string using a regular expression and store the value in a different variable, without changing the original?
I usually just copy the string to a new variable then bind it to the `s///` regex that does the replacement on the new string, but I was wondering if t... | How do I perform a Perl substitution on a string while keeping the original? | CC BY-SA 3.0 | 0 | 2008-08-22T16:47:55.597 | 2021-05-13T02:40:48.503 | 2013-08-01T18:12:12.927 | 128,421 | 277 | [
"regex",
"perl",
"replace"
] |
22,831 | 2 | null | 22,687 | 2 | null | I'd recommend you stick with PuTTY too. You might find it useful to run Pageant in conjunction with Plink to avoid having to type in the passphrase.
But if you want to research alternatives you should review this Wikipedia resource:
[http://en.wikipedia.org/wiki/Comparison_of_SSH_clients](http://en.wikipedia.org/wik... | null | CC BY-SA 2.5 | null | 2008-08-22T16:46:46.363 | 2008-08-22T16:46:46.363 | null | null | 1,969 | null |
22,845 | 2 | null | 22,814 | 2 | null | You can ignore the URL field and simply paste the viewstate into the Viewstate string box.
It does look like you have an old version; the serialisation methods changed in ASP.NET 2.0, so grab the [2.0 version](http://www.pluralsight.com/community/media/p/51688.aspx)
| null | CC BY-SA 2.5 | null | 2008-08-22T16:50:35.620 | 2008-08-22T16:50:35.620 | null | null | 2,525 | null |
22,843 | 2 | null | 22,818 | 3 | null | I'm coming from almost the same background and have heard the same arguments. I do understand that there are very valid reasons to put logic into the database. However, it depends on the type of application and the way it handles data which approach you should choose.
In my experience, a typical data entry app like so... | null | CC BY-SA 2.5 | null | 2008-08-22T16:49:52.283 | 2008-08-22T16:49:52.283 | null | null | 1,793 | null |
22,856 | 2 | null | 22,818 | 1 | null | My personal preference is to try and keep as much logic and configuration out of the database as possible. I am heavily dependent on Spring and Hibernate these days so that makes it a lot easier. I tend to use Hibernate named queries instead of stored procedures and the static configuration information in Spring applic... | null | CC BY-SA 2.5 | null | 2008-08-22T16:55:03.830 | 2008-08-22T16:55:03.830 | null | null | 1,969 | null |
22,869 | 1 | 22,966 | null | 2 | 1,530 | In a recent project, I built my own MVC framework in PHP. One of the things I implemented was a routing system. I used Apache's mod_rewrite to send all requests to index.php, and then parsed the URI to extract information and route the request.
I'm dabbling in ASP.NET now, and I'm wondering if/how I might perform som... | ASP.NET - Building your own routing system | CC BY-SA 2.5 | 0 | 2008-08-22T16:58:07.193 | 2012-08-11T16:15:14.310 | null | null | 1,344 | [
"asp.net",
"routes",
"url-rewriting"
] |
22,842 | 2 | null | 22,814 | 6 | null | As another person just mentioned, it's a base64 encoded string. In the past, I've used this website to decode it:
[http://www.motobit.com/util/base64-decoder-encoder.asp](http://www.motobit.com/util/base64-decoder-encoder.asp)
| null | CC BY-SA 2.5 | null | 2008-08-22T16:49:45.873 | 2008-08-22T16:49:45.873 | null | null | 2,527 | null |
22,879 | 1 | 22,908 | null | 7 | 6,804 | I'm able to connect to and read an excel file no problem. But when importing data such as zipcodes that have leading zeros, how do you prevent excel from guessing the datatype and in the process stripping out leading zeros?
| How do you prevent leading zeros from being stripped when importing an excel doc using c# | CC BY-SA 2.5 | 0 | 2008-08-22T17:02:14.483 | 2015-04-01T14:35:40.157 | null | null | 1,874 | [
"c#",
"asp.net",
"excel",
"ado.net"
] |
22,854 | 2 | null | 22,779 | 1 | null | Usable? Well, yes. To the extent that it ever was. It's always been horribly slow, text rendering has always been broken, and it's been apparent for some time now that it won't be The Next Official Graphics Layer for Windows.
If you can't live with that, then there are plenty of other graphics libraries out there, fas... | null | CC BY-SA 2.5 | null | 2008-08-22T16:54:01.290 | 2008-08-22T16:54:01.290 | null | null | 811 | null |
22,887 | 2 | null | 22,880 | 0 | null | To reduce the risk you can also associate the originating IP with the session. That way an attacker has to be within the same private network to be able to use the session.
Checking referer headers can also be an option but those are more easily spoofed.
| null | CC BY-SA 2.5 | null | 2008-08-22T17:04:53.527 | 2008-08-22T17:04:53.527 | null | null | 2,148 | null |
22,847 | 2 | null | 1,069 | 1 | null | So from the limited information you have, this can be a combination of one or more things:
- - - -
If it's at all the first two but not the last, you should have caught it by now with either pageheap.exe.
Which most likely means it is due to how the code is accessing shared memory. Unfortunately, tracking that down... | null | CC BY-SA 2.5 | null | 2008-08-22T16:51:06.710 | 2008-08-22T16:51:06.710 | null | null | 1,799 | null |
22,844 | 2 | null | 22,801 | 0 | null | Each looping construct serves a different purpose.
for - This is used to loop for a specific number of iterations.
foreach - This is used to loop through all of the values in a collection.
while - This is used to loop until you meet a condition.
Of the three, "while" will most likely provide the best performance ... | null | CC BY-SA 2.5 | null | 2008-08-22T16:50:34.123 | 2008-08-22T17:39:03.180 | 2008-08-22T17:39:03.180 | 581 | 581 | null |
22,880 | 1 | 22,913 | null | 133 | 149,899 | Specifically this is regarding when using a client session cookie to identify a session on the server.
Is the best answer to use SSL/HTTPS encryption for the entire web site, and you have the best guarantee that no man in the middle attacks will be able to sniff an existing client session cookie?
And perhaps second b... | What is the best way to prevent session hijacking? | CC BY-SA 2.5 | 0 | 2008-08-22T17:02:26.763 | 2021-03-11T06:30:30.023 | 2008-08-23T15:33:17.980 | 2,134 | 1,341 | [
"security",
"session",
"cookies"
] |
22,846 | 2 | null | 22,818 | -3 | null | Well, this one is difficult. As a programmer, you'll want to avoid TSQL and such "Database languages" as much as possible, because they are horrendous, difficult to debug, not extensible and there's nothing you can do with them that you won't be able to do using code on your application.
The only reasons I see writin... | null | CC BY-SA 2.5 | null | 2008-08-22T16:51:01.157 | 2008-08-22T16:51:01.157 | null | null | 2,384 | null |
22,892 | 2 | null | 20,148 | 4 | null | Every application has it's own performance profile for using a database, and chances are it will change over time.
The best thing you can do is to test your options. Switching between MyISAM and InnoDB is trivial, so load some test data and fire jmeter against your site and see what happens.
| null | CC BY-SA 2.5 | null | 2008-08-22T17:07:16.330 | 2008-08-22T17:07:16.330 | null | null | 2,506 | null |
22,900 | 2 | null | 22,879 | 0 | null | I think the way to do this would be to format the source excel file such that the column is formatted as Text instead of General. Select the entire column and right click and select format cells, select text from the list of options.
I think that would explicitly define that the column content is text and should be tr... | null | CC BY-SA 2.5 | null | 2008-08-22T17:08:51.317 | 2008-08-22T17:08:51.317 | null | null | 2,528 | null |
22,897 | 2 | null | 22,879 | 1 | null | Prefixing the contents of the cell with ' forces Excel to see it as text instead of a number. The ' won't be displayed in Excel.
| null | CC BY-SA 2.5 | null | 2008-08-22T17:08:31.287 | 2008-08-22T17:08:31.287 | null | null | 2,109 | null |
22,899 | 2 | null | 22,792 | 0 | null | Hmm, none that I know of. You can always retrieve the definitions as SQL and then run a diff tool on them, but it's a bit of a pain in the rear.
Probably the best solution for this is using some kind of "Migrations" tool, so you can keep your database definitions together with your code, and version them, etc.
| null | CC BY-SA 2.5 | null | 2008-08-22T17:08:32.783 | 2008-08-22T17:08:32.783 | null | null | 2,384 | null |
22,896 | 2 | null | 22,836 | 291 | null | This is the idiom I've always used to get a modified copy of a string without changing the original:
```
(my $newstring = $oldstring) =~ s/foo/bar/g;
```
In perl 5.14.0 or later, you can use the new `/r` [non-destructive substitution modifier](https://metacpan.org/pod/release/FLORA/perl-5.14.2/pod/perl5140delta.pod#No... | null | CC BY-SA 4.0 | null | 2008-08-22T17:08:29.197 | 2020-10-09T14:54:29.757 | 2020-10-09T14:54:29.757 | 967,621 | 164 | null |
22,851 | 2 | null | 22,818 | 1 | null | @DannySmurf:
Depending on your server, yes, they are debuggable. [This provides an example for SQL Server 2000](http://www.15seconds.com/issue/050106.htm). I'm guessing the newer ones also have this. However, the free MySQL server does not have this (as far as I know).
Yes, it is. Kind of. Database backups should... | null | CC BY-SA 2.5 | null | 2008-08-22T16:53:26.423 | 2008-08-22T16:53:26.423 | null | null | 572 | null |
22,891 | 2 | null | 22,879 | 1 | null | Prefix with '
| null | CC BY-SA 2.5 | null | 2008-08-22T17:06:41.837 | 2008-08-22T17:06:41.837 | null | null | 414 | null |
22,908 | 2 | null | 22,879 | 7 | null | I believe you have to set the option in your connect string to force textual import rather than auto-detecting it.
```
Provider=Microsoft.ACE.OLEDB.12.0;
Data Source=c:\path\to\myfile.xlsx;
Extended Properties=\"Excel 12.0 Xml;IMEX=1\";
```
Your milage may vary depending on the version you have installed. T... | null | CC BY-SA 2.5 | null | 2008-08-22T17:10:57.210 | 2008-08-22T17:10:57.210 | null | null | 312 | null |
22,907 | 1 | 22,970 | null | 54 | 58,633 | Assuming you can't use LINQ for whatever reason, is it a better practice to place your queries in stored procedures, or is it just as good a practice to execute queries against the database (say, SQL Server for argument's sake)?
| Which is better: Ad hoc queries or stored procedures? | CC BY-SA 4.0 | 0 | 2008-08-22T17:10:30.440 | 2018-10-21T03:50:58.390 | 2018-08-17T13:53:25.537 | 814,702 | null | [
"sql",
"stored-procedures"
] |
22,903 | 1 | 22,911 | null | 7 | 8,386 | I know this isn't strictly a programming question but y'all must have experienced this.
So...you have four or five RDP sessions open over the corp VPN, you're bashing away inside your favourite IDE, your VPN to the data centre bounces briefly then recovers, all your RDP sessions start re-establishing their connection... | How do I stop Windows applications from stealing focus | CC BY-SA 3.0 | 0 | 2008-08-22T17:09:14.593 | 2013-10-03T10:19:00.240 | 2017-05-23T12:13:37.900 | -1 | 419 | [
"terminal-services",
"rdp"
] |
22,911 | 2 | null | 22,903 | 6 | null | I use [Tweak UI](http://www.microsoft.com/windowsxp/Downloads/powertoys/Xppowertoys.mspx) to configure explorer so that apps don't steal focus; you can also configure how many times they flash in the taskbar as well.
EDIT: Once you are within Tweak UI, these options are found under General > Focus.
EDIT: @Kev, appare... | null | CC BY-SA 2.5 | null | 2008-08-22T17:11:21.500 | 2008-08-22T17:45:25.177 | 2008-08-22T17:45:25.177 | 1,790 | 1,790 | null |
22,904 | 2 | null | 22,818 | 0 | null | @Thomas Owens: (re source control) Yes, but that's not source control in the same sense that I can check in a .cs file (or .cpp file or whatever) and go and pick out any revision I want. To do that with database code requires a potentially-significant amount of effort to either retrieve the procedure from the database ... | null | CC BY-SA 2.5 | null | 2008-08-22T17:09:57.367 | 2008-08-22T17:09:57.367 | null | null | 1,975,282 | null |
22,914 | 2 | null | 22,907 | 1 | null | Stored Procedures are great because they can be changed without a recompile. I would try to use them as often as possible.
I only use ad-hoc for queries that are dynamically generated based on user input.
| null | CC BY-SA 2.5 | null | 2008-08-22T17:12:19.920 | 2008-08-22T17:12:19.920 | null | null | 106 | null |
22,913 | 2 | null | 22,880 | 145 | null | Encrypting the session value will have zero effect. The session cookie is already an arbitrary value, encrypting it will just generate another arbitrary value that can be sniffed.
The only real solution is HTTPS. If you don't want to do SSL on your whole site (maybe you have performance concerns), you might be able to... | null | CC BY-SA 3.0 | null | 2008-08-22T17:11:46.723 | 2016-08-31T20:51:36.707 | 2016-08-31T20:51:36.707 | 2,527 | 2,527 | null |
22,910 | 2 | null | 16,615 | 22 | null | `FindFirstChangeNotification` is fine, but for slightly more ultimate power you should be using `ReadDirectoryChangesW.` (In fact, it's even recommended in the documentation!)
It doesn't require a function pointer, it does require you to manually decode a raw buffer, it uses Unicode file names, but it is generally bet... | null | CC BY-SA 3.0 | null | 2008-08-22T17:11:16.007 | 2012-07-03T14:54:47.007 | 2012-07-03T14:54:47.007 | 142,162 | 1,799 | null |
22,912 | 2 | null | 1,069 | 8 | null | We've had pretty good luck by writing our own malloc and free functions. In production, they just call the standard malloc and free, but in debug, they can do whatever you want. We also have a simple base class that does nothing but override the new and delete operators to use these functions, then any class you write ... | null | CC BY-SA 3.0 | null | 2008-08-22T17:11:22.950 | 2013-02-07T12:32:29.477 | 2013-02-07T12:32:29.477 | 395,659 | 1,821 | null |
22,917 | 2 | null | 173 | 5 | null | We just started using Team Foundation Server. If your database is medium sized, then visual studio has some nice project integrations with built in compare, data compare, database refactoring tools, database testing framework, and even data generation tools.
But, that model doesn't fit very large or third party datab... | null | CC BY-SA 2.5 | null | 2008-08-22T17:13:23.350 | 2008-08-22T17:13:23.350 | null | null | 1,874 | null |
22,909 | 1 | 22,930 | null | 13 | 14,795 | I want to show HTML content inside Flash. Is there some way to do this?
I am talking about full blown HTML (with JavaScript if possible).
| Is there some way to show HTML content inside Flash? | CC BY-SA 3.0 | 0 | 2008-08-22T17:10:59.567 | 2016-12-22T06:10:30.837 | 2016-12-22T06:10:30.837 | 1,317,053 | 184 | [
"javascript",
"html",
"flash",
"adobe"
] |
22,915 | 2 | null | 22,566 | 19 | null | A quick and dirty solution is to use [glob](http://perldoc.perl.org/functions/glob.html)
```
@files = glob ('/path/to/dir/*');
```
| null | CC BY-SA 2.5 | null | 2008-08-22T17:12:40.653 | 2008-08-22T17:12:40.653 | null | null | 238 | null |
22,916 | 2 | null | 22,907 | 4 | null | My answer [from a different](https://stackoverflow.com/questions/15142/what-are-the-pros-and-cons-to-keeping-sql-in-stored-procs-versus-code#15206) post:
Stored Procedures are maintainable because:
- -
Code repetition is the thing you can do when you're trying to build a maintainable application!
What happens whe... | null | CC BY-SA 2.5 | null | 2008-08-22T17:13:19.887 | 2008-08-22T17:13:19.887 | 2017-05-23T11:46:38.520 | -1 | 357 | null |
22,919 | 2 | null | 22,907 | 0 | null | Depends what your goal is. If you want to retrieve a list of items and it happens once during your application's entire run for example, it's probably not worth the effort of using a stored procedure. On the other hand, a query that runs repeatedly and takes a (relatively) long time to execute is an excellent candidate... | null | CC BY-SA 2.5 | null | 2008-08-22T17:14:03.550 | 2008-08-22T17:14:03.550 | 2017-05-23T12:09:42.380 | -1 | 1,975,282 | null |
22,921 | 2 | null | 22,909 | 1 | null | How complex HTML are we talking about? Simple HTML, like <b> and <i> is supported in text fields if you use the `htmlText` property. You can also attach a CSS style sheet to the text field for more styling. Have a look at TextField in the Flash API documentation (I'm sure you can just google it).
| null | CC BY-SA 2.5 | null | 2008-08-22T17:14:59.727 | 2008-08-22T17:14:59.727 | null | null | 1,109 | null |
22,926 | 2 | null | 22,879 | 0 | null | Saving the file as a tab delimited text file has also worked well.
---old
Unfortunately, we can't rely on the columns of the excel doc to stay in a particular format as the users will be pasting data into it regularly. I don't want the app to crash if we're relying on a certain datatype for a column.
prefixing with ... | null | CC BY-SA 2.5 | null | 2008-08-22T17:16:36.867 | 2009-11-24T19:43:01.817 | 2009-11-24T19:43:01.817 | 1,874 | 1,874 | null |
22,918 | 2 | null | 22,873 | 2 | null | Python: [http://diveintopython.net/](http://diveintopython.net/)
JS: [a re-introduction to JavaScript](http://developer.mozilla.org/en/A_re-introduction_to_JavaScript) is the introduction to the (not the browser specifics) for programmers. Don't know a good tutorial on JS in browser.
Great idea by the way!
| null | CC BY-SA 3.0 | null | 2008-08-22T17:13:27.173 | 2012-03-08T14:43:38.930 | 2012-03-08T14:43:38.930 | 1,288 | 1,026 | null |
22,930 | 2 | null | 22,909 | 1 | null | [Here is a decent article](http://www.wdvl.com/Reviews/Graphics/Flash5/external.html) on how to accomplish that.
[@Flubba](https://stackoverflow.com/questions/22909/is-there-some-way-to-show-html-content-inside-flash#24396): I didn't say "" article, I said "" - there is a big difference. Besides, no one else had answe... | null | CC BY-SA 2.5 | null | 2008-08-22T17:18:39.983 | 2008-08-25T17:09:39.387 | 2017-05-23T12:13:57.183 | -1 | 1,790 | null |
22,922 | 2 | null | 22,814 | 0 | null | Normally, ViewState should be decryptable if you have the machine-key, right? After all, ASP.net needs to decrypt it, and that is certainly not a black box.
| null | CC BY-SA 2.5 | null | 2008-08-22T17:15:06.107 | 2008-08-22T17:15:06.107 | null | null | 91 | null |
22,929 | 2 | null | 22,907 | 1 | null | Procs for the reasons mentioned by others and also it is easier to tune a proc with profiler or parts of a proc. This way you don't have to tell someone to run his app to find out what is being sent to SQL server
If you do use ad-hoc queries make sure that they are parameterized
| null | CC BY-SA 2.5 | null | 2008-08-22T17:17:44.480 | 2008-08-22T17:17:44.480 | null | null | 740 | null |
22,931 | 2 | null | 22,873 | 33 | null | I know this is going to seem old-fashioned, but I don't think much of using online tutorials to learn programming languages or platforms. These generally give you no more than a little taste of the language. To really learn a language, you need the equivalent of a "book", and in many cases, this means a real dead-tre... | null | CC BY-SA 2.5 | null | 2008-08-22T17:18:47.033 | 2008-08-22T17:18:47.033 | null | null | 1,175 | null |
22,934 | 2 | null | 22,524 | 2 | null | I don't believe you can. You might be better off aliasing commonly used commands in a script that you call from your profile script.
Example -
Set-Alias np c:\windows\notepad.exe
Then you have your short, easily typeable name available from the command line.
| null | CC BY-SA 2.5 | null | 2008-08-22T17:19:16.067 | 2008-08-22T17:19:16.067 | null | null | 1,233 | null |
22,932 | 2 | null | 22,687 | 0 | null | TortoiseSVN, at least, has an option called Relocate which you can use if the location of the repository has changed.
Also, this is a good example why you should always, always use DNS/hostnames instead of the IP address directly.
| null | CC BY-SA 2.5 | null | 2008-08-22T17:19:03.070 | 2008-08-22T17:19:03.070 | null | null | 291 | null |
22,935 | 1 | 22,948 | null | 3 | 5,225 | Does anyone have a technique for generating SQL table create (and data insert) commands pragmatically from a CSV (or sheet in a .xls) file?
I've got a third party database system which I'd like to populate with data from a csv file (or sheet in a xls file) but the importer supplied can't create the table structure a... | CSV (or sheet in XLS) to SQL create (and insert) statements with .Net? | CC BY-SA 2.5 | 0 | 2008-08-22T17:19:24.130 | 2013-09-23T11:03:57.353 | null | null | 39,040 | [
".net",
"sql",
"csv",
"xls"
] |
22,946 | 2 | null | 22,732 | 3 | null | Paul's right.
In PowerShell, function parameters are not enclosed in parenthesis. (Method parameters still are.)
Your initial call was just passing one big array to the function, rather than the three separate parameters you wanted.
| null | CC BY-SA 2.5 | null | 2008-08-22T17:22:16.947 | 2008-08-22T17:22:16.947 | null | null | 1,233 | null |
22,901 | 1 | 23,145 | null | 8 | 1,714 | I am going to be using C/C++, and would like to know the best way to talk to a MySQL server. Should I use the library that comes with the server installation? Are they any good libraries I should consider other than the official one?
| What is the best way to communicate with a MySQL server? | CC BY-SA 3.0 | 0 | 2008-08-22T17:09:04.920 | 2012-10-18T21:25:57.030 | 2012-01-11T04:46:25.953 | 227,299 | 522 | [
"c++",
"sql",
"mysql",
"c",
"database"
] |
22,952 | 2 | null | 22,907 | 1 | null | Parametized SQL or SPROC...doesn't matter from a performance stand point...you can query optimize either one.
For me the last remaining benefit of a SPROC is that I can eliminate a lot SQL rights management by only granting my login rights to execute sprocs...if you use Parametized SQL the login withing your connectio... | null | CC BY-SA 2.5 | null | 2008-08-22T17:26:06.097 | 2008-08-22T17:26:06.097 | null | null | 1,975 | null |
22,943 | 1 | 23,038 | null | 3 | 1,113 | I have the need to read the Thunderbird address book on the fly. It is stored in a file format called Mork. Not a pleasant file format to read. I found a 1999 article explaining the file format. I would love to know if someone already has gone through this process and could make the code available. I found mork.pl... | Does anybody know of existing code to read a mork file (Thunderbird Address Book)? | CC BY-SA 2.5 | null | 2008-08-22T17:19:52.210 | 2010-03-20T02:36:25.133 | 2008-08-22T17:25:38.627 | 791 | 791 | [
".net",
"file-format",
"thunderbird",
"mork"
] |
22,948 | 2 | null | 22,935 | 1 | null | In SQL server it is as easy as
```
SELECT * INTO NewTablenNmeHere
FROM OPENROWSET( 'Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\testing.xls','SELECT * FROM [Sheet1$]')
```
| null | CC BY-SA 2.5 | null | 2008-08-22T17:23:06.040 | 2008-08-22T17:23:06.040 | null | null | 740 | null |
22,951 | 2 | null | 22,935 | 1 | null | ```
BULK
INSERT CSVTest
FROM 'c:\csvtest.txt'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
```
| null | CC BY-SA 3.0 | null | 2008-08-22T17:25:48.127 | 2013-09-23T11:03:57.353 | 2013-09-23T11:03:57.353 | 475,125 | 2,528 | null |
22,962 | 2 | null | 22,935 | 0 | null | Unfortunately I'm using an SQLEngine for embedded systems so it does not support BULK INSERT or OLEDB datasources, which is why I was thinking of taking the sql statement generation approach.
| null | CC BY-SA 2.5 | null | 2008-08-22T17:30:24.887 | 2008-08-22T17:30:24.887 | null | null | 39,040 | null |
22,959 | 2 | null | 22,708 | 0 | null | All these code samples that these good people have posted look fine.
There is one thing to be aware of. Starting with Office 2007, Excel actually has up to 16,384 columns. That translates to XFD (the old max of 256 colums was IV). You will have to modify these methods somewhat to make them work for three characte... | null | CC BY-SA 2.5 | null | 2008-08-22T17:30:09.253 | 2008-08-22T17:30:09.253 | null | null | 2,173 | null |
22,940 | 2 | null | 22,873 | 20 | null | These are all really good, written by and (some) are (an unpublished oreilly book --translated from French, but no issues I've found), for example). I've *'d my favorite ones that helped me the most.
1. *Introduction to ocaml
2. Using Understand and unraveling ocaml: practice to theory and vice versa
3. *Developi... | null | CC BY-SA 2.5 | null | 2008-08-22T17:19:38.407 | 2008-08-27T18:25:12.450 | 2008-08-27T18:25:12.450 | 157 | 157 | null |
22,955 | 2 | null | 22,524 | 0 | null | You can always use tab completion to type "s[TAB]" and press ENTER and that will execute it.
| null | CC BY-SA 2.5 | null | 2008-08-22T17:27:26.797 | 2008-08-22T17:27:26.797 | null | null | 1,954 | null |
22,965 | 2 | null | 4,234 | 0 | null | Does the Fox app use .CDX indexes? If so, you might be able to improve performance by adding indexes without needing to change any program code. If it uses .IDX indexes, though, the change would have to be done in the actual app.
| null | CC BY-SA 2.5 | null | 2008-08-22T17:30:58.737 | 2008-08-22T17:30:58.737 | null | null | 2,531 | null |
22,968 | 1 | 23,148 | null | 3 | 2,123 | I have a .NET webforms front end that allows admin users to upload two .xls files for offline processing. As these files will be used for validation (and aggregation) I store these in an image field in a table.
My ultimate goal is to create an SSIS package that will process these files offline. Does anyone know how... | How to process Excel files stored in an image data type column using SSIS package? | CC BY-SA 3.0 | null | 2008-08-22T17:32:11.993 | 2011-07-26T14:34:17.660 | 2011-07-26T14:34:17.660 | null | 105 | [
"ssis"
] |
22,970 | 2 | null | 22,907 | 107 | null | In my experience writing mostly WinForms Client/Server apps these are the simple conclusions I've come to:
1. For any complex data work. If you're going to be doing something truly requiring a cursor or temp tables it's usually fastest to do it within SQL Server.
2. When you need to lock down access to the data. If... | null | CC BY-SA 2.5 | null | 2008-08-22T17:32:28.000 | 2009-08-10T03:45:31.833 | 2009-08-10T03:45:31.833 | 45,935 | 1,314 | null |
22,975 | 2 | null | 22,907 | 2 | null | Some things to think about here: [Who Needs Stored Procedures, Anyways?](https://blog.codinghorror.com/who-needs-stored-procedures-anyways/)
Clearly it's a matter of your own needs and preferences, but one very important thing to think about when using ad hoc queries in a public-facing environment is security. Always ... | null | CC BY-SA 4.0 | null | 2008-08-22T17:36:53.480 | 2018-10-21T03:50:58.390 | 2018-10-21T03:50:58.390 | 1,033,581 | 1,354 | null |
22,978 | 2 | null | 22,873 | 1 | null | I second Kristopher's recommendation of K&R for C.
I've found the "Essential Actionscript 2.0" book quite useful for AS coding (there's an AS3 version out now I believe).
I've found that having real books to thumb through is more helpful than an online reference in some cases. Not really sure why though.
| null | CC BY-SA 2.5 | null | 2008-08-22T17:37:25.727 | 2008-08-22T17:37:25.727 | null | null | 1,409 | null |
22,979 | 1 | 22,991 | null | 8 | 13,806 | I'm looking for a way to poll different servers and check that SQL server is up and running. I'm writing my code in C#. I don't particularly care about individual databases, just that SQL server is running and responsive.
Any ideas?
| Detecting if SQL server is running | CC BY-SA 2.5 | null | 2008-08-22T17:37:48.707 | 2015-12-29T02:52:31.243 | null | null | 178 | [
"c#",
"sql-server"
] |
22,976 | 1 | 23,089 | null | 11 | 9,887 | I've got a JavaScript "object", built this way:
```
function foo()
{
this.length = 0;
}
foo.prototype.getLength = function()
{
return this.length;
}
...
```
I know how to emulate namespaces with singleton JavaScript objects, but what is the best way to "namepace" an object such as that above that will inta... | How to provide namespaces in JavaScript with instanced objects | CC BY-SA 2.5 | 0 | 2008-08-22T17:37:07.303 | 2017-04-21T10:19:40.200 | 2008-09-09T23:13:47.187 | -1 | 2,536 | [
"javascript",
"namespaces"
] |
22,986 | 2 | null | 22,907 | 15 | null | Stored procedures represent a software contract that encapsulates the actions taken against the database. The code in the procedures, and even the schema of the database itself can be changed without affecting compiled, deployed code, just so the inputs and outputs of the procedure remain the same.
By embedding queri... | null | CC BY-SA 2.5 | null | 2008-08-22T17:39:44.830 | 2008-08-22T17:39:44.830 | null | null | 1,219 | null |
22,981 | 1 | 22,992 | null | 0 | 1,981 | I'm using the Repeater control on my site to display data from the database. I need to do pagination ("now displaying page 1 of 10", 10 items per page, etc) but I'm not sure I'm going about it the best way possible.
I know the Repeater control doesn't have any built-in pagination, so I'll have to make my own. Is there... | ASP.Net: How to do pagination with a Repeater? | CC BY-SA 2.5 | null | 2008-08-22T17:37:54.617 | 2008-10-08T22:36:00.833 | 2008-10-08T22:36:00.833 | 15,401 | 2,527 | [
"asp.net",
"sql-server"
] |
22,966 | 2 | null | 22,869 | 6 | null | This is going to be a long answer, because I want to make sure you are fully aware of all the ways you can accomplish what you want to do.
The routing engine that powers the ASP.NET MVC Framework will work with the traditional ASP.NET Framework. You can take advantage of using the RouteTable and assigning routes, jus... | null | CC BY-SA 2.5 | null | 2008-08-22T17:31:20.873 | 2008-08-22T18:00:33.690 | 2017-05-23T12:24:51.663 | -1 | 1,117 | null |
22,991 | 2 | null | 22,979 | 5 | null | Well, the brute force solution is to attempt to initiate a connection with the database on each server. That will tell you whether it's running, though you could have timeout issues.
The more elegant (but more difficult... isn't that always the way?) solution would be to use WMI to connect to the remote machine and fi... | null | CC BY-SA 2.5 | null | 2008-08-22T17:41:22.050 | 2008-08-22T17:41:22.050 | null | null | 1,975,282 | null |
22,980 | 1 | 23,137 | null | 9 | 625 | I'm using Intridea's [Acts as Readable](http://www.intridea.com/2008/2/29/acts-as-readable-drop-in-mark-as-read-functionality) Rails plugin for a messaging system I'm currently building.
I've defined my message class accordingly:
```
class Post < ActiveRecord::Base
acts-as-readable
end
```
And everything seems to ... | Acts-as-readable Rails plugin Issue | CC BY-SA 3.0 | 0 | 2008-08-22T17:37:51.403 | 2017-01-29T01:55:47.177 | 2017-01-29T01:55:47.177 | 7,311,767 | 2,293 | [
"ruby-on-rails",
"ruby",
"plugins"
] |
22,996 | 2 | null | 22,873 | 1 | null | hmm, I don't know if I would say that online materials are useless, but I do agree that there is something about books. Maybe they are better written, or maybe it is the act of forking over $50 that makes you more inclined to study the material.
Either way, I agree that books should be part of this question. If any... | null | CC BY-SA 2.5 | null | 2008-08-22T17:41:51.487 | 2008-08-22T17:41:51.487 | null | null | 2,328 | null |
22,990 | 2 | null | 2,525 | 9 | null | I've been also using SmartAssembly.
I found that Ezrinz .Net Reactor much better for me on .net applications.
It obfuscates, support Mono, merges assemblies and it also also has a very nice licensing module to create trial version or link the licence to a particular machine (very easy to implement).
Price is also very ... | null | CC BY-SA 2.5 | null | 2008-08-22T17:41:21.020 | 2008-08-22T17:41:21.020 | null | null | 1,929 | null |
23,000 | 2 | null | 22,981 | 3 | null | You have to use the PagedDataSource, it allows you to turn a standard data source into one that can be paged. Here's an [example article](http://www.codeproject.com/Kb/aspnet/pagingBySreejith%20Thathanattu.aspx)
| null | CC BY-SA 2.5 | null | 2008-08-22T17:42:04.857 | 2008-08-22T17:42:04.857 | null | null | 2,272 | null |
22,992 | 2 | null | 22,981 | 2 | null | This isn't a way to page the data, but have you looked into the [ListView](http://msdn.microsoft.com/en-us/library/bb398790.aspx) control? It gives the flexibility of repeater / data list but with built in paging like the grid view.
And for paging in sql, you would want to do something like [this](http://www.davidhayd... | null | CC BY-SA 2.5 | null | 2008-08-22T17:41:23.127 | 2008-08-22T17:41:23.127 | null | null | 77 | null |
22,998 | 2 | null | 22,976 | 2 | null | Shouldn't be much different:
```
namespace.foo = function foo() {...}
namespace.foo.prototype.getLength = function() { ... }
```
or you could use
```
(function() {
function foo() { ... }
foo.prototype...
namespace.foo = foo;
})();
```
to save some typing.
| null | CC BY-SA 2.5 | null | 2008-08-22T17:41:59.380 | 2008-08-22T17:41:59.380 | null | null | 1,026 | null |
23,001 | 1 | 23,069 | null | 1 | 177 | I know I could write scripts and create jobs to run them, but at least some of what I'm wanting it to do is beyond my programming abilities for that to be an option.
What I'm imagining is something that can run on a regular schedule that will examine all the databases on a server and automatically shrink data and log ... | Any good tools to automate SQL Server management tasks? | CC BY-SA 2.5 | null | 2008-08-22T17:42:24.077 | 2008-10-08T22:35:45.233 | 2008-10-08T22:35:45.233 | 15,401 | 2,505 | [
"sql-server"
] |
23,004 | 2 | null | 22,524 | 9 | null | On my Vista system typing S won't launch a lnk file unless I have the environment variable PATHEXT set with .lnk in the list. When I do. S will work in cmd.exe and I have to do .\S in powershell.
| null | CC BY-SA 2.5 | null | 2008-08-22T17:42:52.500 | 2008-08-23T03:14:36.917 | 2008-08-23T03:14:36.917 | 791 | 791 | null |
23,007 | 2 | null | 22,988 | 9 | null | Are you initially loading the data only when !Page.IsPostBack? Also, is view state enabled for the text box?
| null | CC BY-SA 2.5 | null | 2008-08-22T17:43:41.560 | 2008-08-22T17:43:41.560 | null | null | 77 | null |