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,431
1
22,745
null
1
299
I am looking for information on handling search in different ORMs. Currently I am redeveloping some old application in PHP and one of requirements is: make everything or almost everything searchable, so user just types "punkrock live" and the app finds videos clips, music tracks, reviews, upcoming events or even user ...
Search strategies in ORMs
CC BY-SA 2.5
null
2008-08-22T14:05:05.410
2014-05-21T20:14:02.347
2014-05-21T20:14:02.347
321,731
2,169
[ "search", "orm", "doctrine", "propel" ]
22,435
2
null
22,346
1
null
Doing anything with RTF is pretty difficult unless you're using the windows forms. As stated above, using forms is the easiest way to go. You could write something yourself, but the RTF spec is pretty complicated. [http://www.biblioscape.com/rtf15_spec.htm](http://www.biblioscape.com/rtf15_spec.htm) Or you could use ...
null
CC BY-SA 2.5
null
2008-08-22T14:06:54.610
2008-08-22T14:06:54.610
null
null
1,726
null
22,440
2
null
17,609
1
null
Are you sure you need do this mail queuing yourself? Just deliver all mail to the local machine's mail transfer agent (sendmail...) and let that take care of the queuing and sending. After all, that's what was designed for. In other words: don't worry about it!
null
CC BY-SA 2.5
null
2008-08-22T14:08:36.383
2008-08-22T14:08:36.383
null
null
2,474
null
22,446
2
null
22,346
1
null
I think you should just shake this feeling of "odd". There's nothing odd about it.
null
CC BY-SA 2.5
null
2008-08-22T14:11:01.823
2008-08-22T14:11:01.823
null
null
2,491
null
22,438
2
null
22,429
1
null
If I understand your question, you are asking if it is possible to allow a user to type in a query that will search the text of page they are on? You can certainly do that. I would suggest looking into one of the javascript libraries, [jQuery](http://jquery.com) is my library of choice, for your functionality. It ha...
null
CC BY-SA 2.5
null
2008-08-22T14:07:24.420
2008-08-22T14:07:24.420
null
null
312
null
22,448
2
null
22,417
2
null
If I understand your schema and question correctly, how about something like this: ``` select student_name, score from students join (select student_answers.student_id, count(*) as score from student_answers, answer_key group by student_id where student_answers.question_id = answer_key.questi...
null
CC BY-SA 2.5
null
2008-08-22T14:11:58.577
2008-08-22T14:11:58.577
null
null
60
null
22,447
2
null
3,452
3
null
I use [AquaFold](http://www.aquafold.com/) at work on Windows, but it's based on Java and supports Mac OS X.
null
CC BY-SA 3.0
null
2008-08-22T14:11:15.143
2012-06-14T21:16:16.017
2012-06-14T21:16:16.017
63,550
1,293
null
22,449
2
null
22,444
176
null
Make `.*` non-greedy by adding '`?`' after it: ``` Project name:\s+(.*?)\s+J[0-9]{7}: ```
null
CC BY-SA 3.0
null
2008-08-22T14:12:01.243
2016-12-15T09:27:19.287
2016-12-15T09:27:19.287
4,519,059
430
null
22,451
2
null
22,187
3
null
For python you can try using [processing module](http://pyprocessing.berlios.de/).
null
CC BY-SA 2.5
null
2008-08-22T14:13:05.890
2008-08-22T14:13:05.890
null
null
1,448
null
22,456
2
null
22,187
6
null
Mike Rettig created a .NET library called [Retlang](http://code.google.com/p/retlang/) and a Java port called Jetlang that is inspired by Erlang's concurrency model.
null
CC BY-SA 2.5
null
2008-08-22T14:15:46.303
2008-08-22T14:15:46.303
null
null
748
null
22,441
2
null
21,564
10
null
Use the read(1) command to read one line at a time from standard input, then output the line prepended with the date in the format of your choosing using date(1). ``` $ cat timestamp #!/bin/sh while read line do echo `date` $line done $ cat somefile.txt | ./timestamp ```
null
CC BY-SA 2.5
null
2008-08-22T14:09:11.500
2008-08-22T14:09:11.500
null
null
2,406
null
22,442
2
null
3,088
1
null
Python is easy for new developers to learn. You don't get tangled up in the specifics of memory management and type definition. [Dive Into Python](http://diveintopython.net/) is a good beginners guide to python programming. When my sister wanted to learn programing I pointed her to the "Head Start" line of books which ...
null
CC BY-SA 3.0
null
2008-08-22T14:09:28.643
2012-08-04T01:54:34.093
2012-08-04T01:54:34.093
1,288
2,482
null
22,444
1
22,449
null
115
73,452
I have this gigantic ugly string: ``` J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully ``` I'm trying to extract pieces from it using regex. In this case, I want to grab everything a...
My regex is matching too much. How do I make it stop?
CC BY-SA 4.0
0
2008-08-22T14:10:40.170
2020-09-18T11:22:46.167
2020-09-18T11:22:46.167
3,832,970
305
[ "regex" ]
22,464
2
null
22,459
0
null
Have you tried using Valgrind? That is usually the fastest and easiest way to debug these sorts of errors. If you are reading or writing outside the bounds of allocated memory, it will flag it for you.
null
CC BY-SA 2.5
null
2008-08-22T14:18:58.433
2008-08-22T14:18:58.433
null
null
1,618
null
22,457
2
null
22,444
15
null
Using non-greedy quantifiers here is probably the best solution, also because it is more efficient than the greedy alternative: Greedy matches generally go as far as they can (here, until the end of the text!) and then trace back character after character to try and match the part coming afterwards. However, consider ...
null
CC BY-SA 4.0
null
2008-08-22T14:15:57.287
2018-08-13T18:11:24.923
2018-08-13T18:11:24.923
495,157
1,968
null
22,459
1
22,473
null
4
5,205
I'm getting some strange, intermittent, data aborts (< 5% of the time) in some of my code, when calling `memset()`. The problem is that is usually doesn't happen unless the code is running for a couple days, so it's hard to catch it in the act. I'm using the following code: ``` char *msg = (char*)malloc(sizeof(char)...
memset() causing data abort
CC BY-SA 3.0
0
2008-08-22T14:17:01.747
2017-08-03T16:07:16.533
2017-08-03T16:07:16.533
8,150,685
194
[ "c++", "c", "memory", "windows-mobile" ]
22,455
2
null
22,001
8
null
FYI, in this particular case, the reason the `IBOutlet` even exists is simply so that Interface Builder can parse the source file and glean bits of understanding from it. It's a clue (well, a bit stronger than a clue) that the variable preceded by `IBOutlet` should show up as an Outlet in Interface Builder when design...
null
CC BY-SA 2.5
null
2008-08-22T14:15:09.317
2008-08-22T14:15:09.317
null
null
863
null
22,466
1
22,613
null
24
13,324
We've got a page with a ton of jQuery (approximately 2000 lines) that we want to trim down b/c it is a maintenance nightmare, and it might be easier to maintain on the server. We've thought about using UpdatePanel for this. However, we don't like the fact that the UpdatePanel is sending the whole page back to the ser...
jQuery AJAX vs. UpdatePanel
CC BY-SA 3.0
0
2008-08-22T14:19:49.570
2017-11-07T11:10:20.583
2017-11-07T11:10:20.583
220,272
1,446
[ "javascript", "jquery", "asp.net", "ajax", "updatepanel" ]
22,469
1
27,771
null
48
38,424
I'm going to be working on some iPhone apps so I've been given a golden ticket to buy a Mac. However the golden ticket isn't worth that much, and I'm thinking iMac. Now, Macs are great, I love 'em and use 'em at home, but I know that the iMac is geared more towards the average consumer than the professional. Is an iMac...
What's a good machine for iPhone development?
CC BY-SA 2.5
0
2008-08-22T14:20:35.730
2017-09-05T12:13:55.213
2017-09-05T12:13:55.213
1,000,551
543
[ "ios", "macos" ]
22,467
2
null
22,465
0
null
Seems like dealing with licensing issues would be nightmarish for the host.
null
CC BY-SA 2.5
null
2008-08-22T14:20:02.550
2008-08-22T14:20:02.550
null
null
1,902,010
null
22,473
2
null
22,459
21
null
`malloc` can return `NULL` if no memory is available. You're not checking for that.
null
CC BY-SA 2.5
null
2008-08-22T14:21:43.030
2008-08-22T14:21:43.030
null
null
4
null
22,465
1
158,640
null
1
416
I've come to love [Amazon's EC2 service](http://en.wikipedia.org/wiki/Amazon_Elastic_Compute_Cloud) and I'm looking for something similar that supports the ability to save a running Windows server image and start new instances from it. I contacted [GoGrid](http://www.gogrid.com/) (the feature is planned in future) and...
I'm looking for a Windows hosting provider that supports custom os images (like AMZN EC2)
CC BY-SA 2.5
null
2008-08-22T14:19:13.223
2012-09-18T13:47:59.853
2008-08-23T05:03:41.800
308
635
[ "hosting", "windows-server-2003", "amazon-ec2", "virtual", "cloud" ]
22,475
2
null
22,469
3
null
I run XCode on a 17" iMac (2 yrs old) with 2GB of RAM and haven't had any trouble.
null
CC BY-SA 2.5
null
2008-08-22T14:22:29.143
2008-08-22T14:22:29.143
null
null
1,667
null
22,478
2
null
22,474
0
null
Look into the LIKE clause
null
CC BY-SA 2.5
null
2008-08-22T14:23:27.783
2008-08-22T14:23:27.783
null
null
1,616
null
22,474
1
22,476
null
2
345
How do I select all records that contain "LCS" within the title column in sql.
How do I display records containing specific information in SQl
CC BY-SA 2.5
null
2008-08-22T14:21:47.460
2008-10-08T22:37:41.453
2008-10-08T22:37:41.453
15,401
453,046
[ "sql", "sql-server" ]
22,470
2
null
22,356
2
null
As an interesting side note, WPF's binding handles marshaling automatically so you can bind the UI to object properties that are modified on background threads without having to do anything special. This has proven to be a great timesaver for me. In XAML: ``` <TextBox Text="{Binding Path=Name}"/> ```
null
CC BY-SA 2.5
null
2008-08-22T14:20:36.213
2008-08-22T14:20:36.213
null
null
1,667
null
22,461
2
null
22,444
1
null
I would also recommend you experiment with regular expressions using "Expresso" - it's a utility a great (and free) utility for regex editing and testing. One of its upsides is that its UI exposes a lot of regex functionality that people unexprienced with regex might not be familiar with, in a way that it would be eas...
null
CC BY-SA 2.5
null
2008-08-22T14:17:21.603
2008-08-22T14:22:55.647
2008-08-22T14:22:55.647
1,596
1,596
null
22,480
2
null
22,444
7
null
Well, `".*"` is a greedy selector. You make it non-greedy by using `".*?"` When using the latter construct, the regex engine will, at every step it matches text into the `"."` attempt to match whatever make come after the `".*?"`. This means that if for instance nothing comes after the `".*?"`, then it matches nothing....
null
CC BY-SA 3.0
null
2008-08-22T14:24:12.243
2017-01-02T16:36:48.677
2017-01-02T16:36:48.677
2,142,994
2,491
null
22,476
2
null
22,474
2
null
``` SELECT * FROM TABLE WHERE TABLE.TITLE LIKE '%LCS%'; ``` % is the wild card matcher.
null
CC BY-SA 2.5
null
2008-08-22T14:22:40.563
2008-08-22T14:28:06.587
2008-08-22T14:28:06.587
2,109
2,109
null
22,482
2
null
22,469
8
null
The iMac is a very fast machine and will be more than suitable for iPhone development. In most cases, a Mac Mini with maxed out ram is good enough. Keep in mind that out of the box, the Mac Mini can only accommodate one monitor.
null
CC BY-SA 2.5
null
2008-08-22T14:24:56.000
2008-08-22T14:24:56.000
null
null
1,877
null
22,481
2
null
22,469
6
null
I run XCode for Mac development on a 20" current-gen iMac and it works perfectly with plenty of other processes running. You can definitely use the iMac to develop software.
null
CC BY-SA 2.5
null
2008-08-22T14:24:35.907
2008-08-22T14:24:35.907
null
null
1,344
null
22,489
2
null
22,474
0
null
Are you looking for all the tables with a column name which contains the LCS in them? If yes the do this ``` select table_name from information_schema.columns where column_name like '%lcs%' ```
null
CC BY-SA 2.5
null
2008-08-22T14:27:01.377
2008-08-22T14:27:01.377
null
null
740
null
22,487
2
null
22,156
0
null
Just to clarify the question. I was reading the Hanselman post [http://www.hanselman.com/blog/CompositingTwoImagesIntoOneFromTheASPNETServerSide.aspx](http://www.hanselman.com/blog/CompositingTwoImagesIntoOneFromTheASPNETServerSide.aspx) and thinking that I would never solved the problem with a HttpHandler, maybe with ...
null
CC BY-SA 2.5
null
2008-08-22T14:26:26.933
2008-08-22T14:26:26.933
null
null
2,385
null
22,494
2
null
22,417
0
null
This query should be quite easy... assuming you have the correct answer stored in the question table. You do have the correct answer stored in the question table, right?
null
CC BY-SA 2.5
null
2008-08-22T14:28:35.353
2008-08-22T14:28:35.353
null
null
414
null
22,495
2
null
22,459
0
null
> You're using sprintf which is inherently unsafe; unless you're 100% positive that you're not going to exceed the size of the buffer, you should almost always prefer snprintf. The same applies to strcat; prefer the safer alternative strncat. Yeah..... I mostly do .NET lately and old habits die hard. I li...
null
CC BY-SA 2.5
null
2008-08-22T14:28:36.007
2008-08-22T14:28:36.007
null
null
194
null
22,485
2
null
22,469
6
null
An iMac is easily powerful enough to use for development work.
null
CC BY-SA 2.5
null
2008-08-22T14:25:46.357
2008-08-22T14:25:46.357
null
null
1,450
null
22,488
2
null
22,459
3
null
> malloc can return NULL if no memory is available. You're not checking for that. Right you are... I didn't think about that as I was monitoring the memory and it there was enough free. Is there any way for there to be available memory on the system but for malloc to fail? > Yes, if memory is fragmented. Also, w...
null
CC BY-SA 2.5
null
2008-08-22T14:26:28.930
2008-08-22T14:42:05.570
2008-08-22T14:42:05.570
4
194
null
22,500
1
22,547
null
47
42,572
The [Wikipedia article on ANSI C](http://en.wikipedia.org/wiki/ANSI_C) says: > One of the aims of the ANSI C standardization process was to produce a superset of K&R C (the first published standard), incorporating many of the unofficial features subsequently introduced. However, the standards committee also included s...
What are the major differences between ANSI C and K&R C?
CC BY-SA 2.5
0
2008-08-22T14:29:27.410
2017-01-05T21:47:58.177
2010-06-19T22:13:12.417
151,292
572
[ "c", "kr-c", "c89" ]
22,496
2
null
22,459
0
null
You know it might not even be your code... Are there any other programs running that could have a memory leak?
null
CC BY-SA 2.5
null
2008-08-22T14:28:47.147
2008-08-22T14:28:47.147
null
null
1,816
null
22,497
2
null
21,817
86
null
There are a few issues at play here. The first is the issue of declaring a static method without defining it. This is the difference between ``` public interface Foo { public static int bar(); } ``` and ``` public interface Foo { public static int bar() { ... } } ``` The first is impossible for the re...
null
CC BY-SA 3.0
null
2008-08-22T14:29:02.467
2015-11-07T17:40:08.087
2017-05-23T12:18:19.107
-1
1,190
null
22,493
1
null
null
3
1,768
Ever since moving to Vista some time ago on my development machine, connecting to SQL Servers in our DMZ active directory domain from client tools like SSMS has not worked like it used to. In XP, as long as I had authenticated in some way on the server (for example directing Explorer to \server.dmzdomain\c$ and enteri...
Using cached credentials to connect to SQL 2005 across a domain boundary
CC BY-SA 2.5
null
2008-08-22T14:28:18.177
2015-05-12T15:40:22.297
2015-05-12T15:40:22.297
1,118,488
205
[ "sql-server", "ssms" ]
22,486
2
null
22,459
4
null
There's a couple of things. You're using `sprintf` which is inherently unsafe; unless you're 100% positive that you're not going to exceed the size of the buffer, you should almost prefer `snprintf`. The same applies to `strcat`; prefer the safer alternative `strncat`. Obviously this may not fix anything, but it goes...
null
CC BY-SA 2.5
null
2008-08-22T14:26:14.860
2008-08-22T14:26:14.860
null
null
2,132
null
22,512
2
null
22,466
6
null
I don't know if there is a way to optimize UpdatePanels, but my company has found its performance to be pretty poor. jQuery is much much faster at doing pretty much anything. There can be a lot of lag between the time when an UpdatePanel triggers an update and when the UpdatePanel actually updates the page. The only ...
null
CC BY-SA 2.5
null
2008-08-22T14:34:08.397
2008-08-22T14:34:08.397
null
null
392
null
22,516
2
null
22,500
13
null
There are some minor differences, but I think later editions of K&R are for ANSI C, so there's no real difference anymore. "C Classic" for lack of a better terms had a slightly different way of defining functions, i.e. ``` int f( p, q, r ) int p, float q, double r; { // Code goes here } ``` I believe t...
null
CC BY-SA 2.5
null
2008-08-22T14:35:12.060
2008-08-22T14:35:12.060
null
null
2,132
null
22,503
1
null
null
4
2,221
I have a form view, in the edit template I have two drop downs. Drop down 1 is explicitly set with a list of allowed values. It is also set to autopostback. Drop down 2 is databound to an objectdatasource, this objectdatasource uses the first dropdown as one of it's parameters. (The idea is that drop down 1 limits wha...
Formview Dropdown 2 depends on Dropdown 1
CC BY-SA 3.0
0
2008-08-22T14:30:33.087
2012-10-21T13:50:23.920
2012-10-21T13:50:23.920
1,571,407
2,496
[ "asp.net", "formview" ]
22,504
2
null
22,500
1
null
The biggest single difference, I think, is function prototyping and the syntax for describing the types of function arguments.
null
CC BY-SA 2.5
null
2008-08-22T14:31:19.120
2008-08-22T14:31:19.120
null
null
2,131
null
22,510
2
null
22,278
1
null
I would try a framework. has been cited. [Symfony](http://www.symfony-project.org/) seems interesting. It's based on ideas from .
null
CC BY-SA 2.5
null
2008-08-22T14:33:06.043
2008-08-22T14:33:06.043
null
null
341
null
22,525
2
null
972
3
null
What Jason Pratt posted is correct. ``` >>> class Test(object): ... def a(self): ... pass ... >>> def b(self): ... pass ... >>> Test.b = b >>> type(b) <type 'function'> >>> type(Test.a) <type 'instancemethod'> >>> type(Test.b) <type 'instancemethod'> ``` As you can see, Python doesn't consider b() any diff...
null
CC BY-SA 2.5
null
2008-08-22T14:40:21.033
2008-08-22T14:40:21.033
null
null
2,482
null
22,532
2
null
22,528
1
null
I don't have much PHP experience, although I'm using it at my current job. In general, I find that larger systems benefit from the readability and understandability that OO provides. But things like consistency (don't mix OO and non-OO) and your personal preferences (although only really on personal projects) are also ...
null
CC BY-SA 2.5
null
2008-08-22T14:43:22.913
2008-08-22T14:43:22.913
null
null
572
null
22,547
2
null
22,500
33
null
There may be some confusion here about what "K&R C" is. The term refers to the language as documented in the first edition of "The C Programming Language." Roughly speaking: the input language of the Bell Labs C compiler circa 1978. Kernighan and Ritchie were involved in the ANSI standardization process. The "ANSI C" ...
null
CC BY-SA 3.0
null
2008-08-22T14:48:18.003
2013-08-26T13:43:02.383
2013-08-26T13:43:02.383
1,412
1,412
null
22,551
2
null
22,528
1
null
I've learned never to use `include` in PHP except inside the core libraries that I use and one central `include` of these libraries (+ config) in the application. Everything else is handled by a global `__autoload` handler that can be configured to recognize the different classes needed. This can be done easily using a...
null
CC BY-SA 2.5
null
2008-08-22T14:49:13.900
2008-08-22T14:49:13.900
null
null
1,968
null
22,537
2
null
22,528
0
null
Can you be a bit more specific? For the example you give you need to use include in both ways. In case 1 you only include a file, in case 2 you need to include the class file (for instance user.class.php) to allow instantiation of the User class. It depends how the rest of the application is built, is it OO? Use OO.
null
CC BY-SA 2.5
null
2008-08-22T14:46:03.250
2008-08-22T14:46:03.250
null
null
1,830
null
22,519
1
49,821
null
4
5,269
I have a folder in my web server used for the users to upload photos using an ASP page. Is it safe enough to give IUSR write permissions to the folder? Must I secure something else? I am afraid of hackers bypassing the ASP page and uploading content directly to the folder. I'm using ASP classic and IIS6 on Windows 20...
How do I secure a folder used to let users upload files?
CC BY-SA 2.5
null
2008-08-22T14:38:15.110
2010-04-21T12:18:01.630
2010-04-21T12:18:01.630
63,550
2,385
[ "security", "iis", "asp-classic", "iis-6", "windows-server-2003" ]
22,509
1
22,585
null
10
3,628
I have an ASP.NET webforms application (3.5 SP1) that I'm working on, and attempting to enable gzip fpr HTML and CSS that comes down the pipe. I'm using [this implementation](http://www.stardeveloper.com/articles/display.html?article=2007110401&page=1) (and tried a few others that hook into Application_BeginRequest), a...
Why is ASP.NET gzip compression corrupting CSS?
CC BY-SA 3.0
0
2008-08-22T14:33:00.973
2015-11-05T14:12:06.077
2015-11-05T14:12:06.077
350,080
1,212
[ "asp.net", "compression", "gzip" ]
22,528
1
22,587
null
11
3,144
I would like to have a reference for the pros and cons of using include when developing PHP applications. I know I would benefit from having one place to go for this answer...I have a few opinions of my own but I look forward to hearing others. Certain pages on my site are only accessible to logged in users. I hav...
PHP includes vs OOP
CC BY-SA 3.0
0
2008-08-22T14:41:20.597
2016-05-18T13:09:34.780
2016-05-18T13:09:34.780
4,311,889
2,490
[ "php", "coding-style" ]
22,552
1
22,572
null
2
1,020
I have a regex that is going to end up being a bit long and it'd make it much easier to read to have it across multiple lines. I tried this but it just barfs. ``` preg_match( '^J[0-9]{7}:\s+ (.*?) #Extract the Transaction Start Date msg \s+J[0-9]{7}:\s+Project\sname:\s+ (.*?) #...
Passing a commented, multi-line (freespace) regex to preg_match
CC BY-SA 4.0
null
2008-08-22T14:49:36.037
2018-09-18T10:43:34.763
2018-09-18T10:43:34.763
152,422
305
[ "php", "regex" ]
22,559
2
null
21,992
0
null
I think trying to use XmlHttpRequest will be a huge headache, unless its the type of headache you don't mind - to do it properly you're almost reinventing the wheel. Then again, people like to reinvent wheels in their spare time, just to say, "Hey, I did it". Not me... I would get a framework like prototype or Extj...
null
CC BY-SA 2.5
null
2008-08-22T14:51:23.927
2008-08-22T14:51:23.927
null
null
1,935
null
22,524
1
23,004
null
16
31,779
Example: You have a shortcut `s` to `SomeProgram` in the current directory. In `cmd.exe`, you can type `s` and it will launch the program. In PowerShell, typing `s` gives: > `The term 's' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.` If you type `s.lnk` o...
Execute shortcuts like programs
CC BY-SA 3.0
0
2008-08-22T14:39:14.033
2016-02-23T09:23:56.390
2016-02-23T09:23:56.390
452,775
2,495
[ "powershell" ]
22,572
2
null
22,552
5
null
You can use the extended syntax: ``` preg_match("/ test /x", $foo, $bar); ```
null
CC BY-SA 2.5
null
2008-08-22T14:54:20.267
2008-08-22T14:54:20.267
null
null
1,968
null
22,577
1
22,637
null
-3
1,137
How do we create a search plugin for Safari? Like [this post](https://stackoverflow.com/questions/20830/firefox-users-here-is-your-stackoverflow-search-plugin)
Search Plugin for Safari
CC BY-SA 2.5
null
2008-08-22T14:55:59.327
2012-10-23T04:41:14.720
2017-05-23T12:08:38.563
-1
1,154
[ "search", "safari" ]
22,573
2
null
22,566
57
null
``` opendir(D, "/path/to/directory") || die "Can't open directory: $!\n"; while (my $f = readdir(D)) { print "\$f = $f\n"; } closedir(D); ``` EDIT: Oh, sorry, missed the "into an array" part: ``` my $d = shift; opendir(D, "$d") || die "Can't open directory $d: $!\n"; my @list = readdir(D); closedir(D); foreach...
null
CC BY-SA 3.0
null
2008-08-22T14:54:22.857
2014-01-08T12:05:36.263
2017-05-23T10:29:47.460
-1
430
null
22,574
2
null
22,552
1
null
OK, here's a solution: ``` preg_match( '/(?x)^J[0-9]{7}:\s+ (.*?) #Extract the Transaction Start Date msg \s+J[0-9]{7}:\s+Project\sname:\s+ (.*?) #Extract the Project Name \s+J[0-9]{7}:\s+Job\sname:\s+ ...
null
CC BY-SA 2.5
null
2008-08-22T14:54:40.063
2008-08-22T15:02:32.777
2017-05-23T10:32:51.507
-1
305
null
22,535
2
null
1,607
50
null
We use something similar to bcwoord to keep our database schemata synchronized across 5 different installations (production, staging and a few development installations), and backed up in version control, and it works pretty well. I'll elaborate a bit: --- To synchronize the database structure, we have a single sc...
null
CC BY-SA 3.0
null
2008-08-22T14:44:37.607
2013-12-05T15:03:26.737
2013-12-05T15:03:26.737
356
2,474
null
22,579
2
null
22,570
6
null
``` where year(date1) = year(date2) and month(date1) = month(date2) and day(date1) = day(date2) ```
null
CC BY-SA 2.5
null
2008-08-22T14:56:16.363
2008-08-22T14:56:16.363
null
null
1,293
null
22,571
2
null
10,898
0
null
From the [Sql 2005 February 2007 Feature Pack](http://www.microsoft.com/downloads/details.aspx?FamilyID=50b97994-8453-4998-8226-fa42ec403d17&DisplayLang=en): > The Microsoft OLE DB Provider for DB2 is a COM component for integrating vital data stored in IBM DB2 databases with new solutions based on Microsoft SQL Serve...
null
CC BY-SA 2.5
null
2008-08-22T14:53:58.287
2008-08-22T14:53:58.287
null
null
2,199
null
22,563
2
null
22,509
0
null
If you will be deploying on IIS 6 or IIS 7, just use the built-in IIS compression. We're using it on production sites for compressing HTML, CSS, and JavaScript with no errors. It also caches the compressed version on the server, so the compression hit is only taken once.
null
CC BY-SA 2.5
null
2008-08-22T14:52:16.233
2008-08-22T14:52:16.233
null
null
729
null
22,580
2
null
22,552
0
null
In PHP the comment syntax looks like this: ``` preg_match(' ^J[0-9]{7}:\s+ (.*?) (?#Extract the Transaction Start Date msg) \s+J[0-9]{7}:\s+Project\sname:\s+ (.*?) (?#Extract the Project Name) \s+J[0-9]{7}:\s+Job\sname:\s+ ...
null
CC BY-SA 2.5
null
2008-08-22T14:56:35.707
2008-08-22T15:01:36.973
2020-06-20T09:12:55.060
-1
1,830
null
22,588
2
null
22,469
7
null
My main Mac is a MacBook, juiced with 4GB of RAM, and I find that perfectly good for development (in either Windows or OSX). I could have got an iMac for a bit more money, but I already had a 20" LCD monitor laying around, and I wanted the portability. The MacBooks are as powerful as the iMacs (excluding the graphics ...
null
CC BY-SA 2.5
null
2008-08-22T14:58:29.587
2008-08-22T14:58:29.587
null
null
1,975,282
null
22,585
2
null
22,509
5
null
Is it only CSS files that get corrupted? Do JS files (or any other static text files) come through ok? Also can you duplicate the behavior if you browse directly to the CSS file? I've only enabled compression on Windows 2003 server's IIS using this approach: 1. IIS → Web Sites → Properties → Service tab, check both...
null
CC BY-SA 2.5
null
2008-08-22T14:57:38.433
2008-08-22T14:57:38.433
null
null
1,414
null
22,587
2
null
22,528
13
null
These are not really opposite choices. You will have to include the checking code anyway. I read your question as procedural programming vs. OO programming. Writing a few lines of code, or a function, and including it in your page header was how things were done in PHP3 or PHP4. It's simple, it works (that's how we di...
null
CC BY-SA 2.5
null
2008-08-22T14:57:46.547
2008-08-22T14:57:46.547
null
null
341
null
22,570
1
22,592
null
34
58,810
Here is the issue I am having: I have a large query that needs to compare datetimes in the where clause to see if two dates are on the same day. My current solution, which sucks, is to send the datetimes into a UDF to convert them to midnight of the same day, and then check those dates for equality. When it comes to ...
What's a good way to check if two datetimes are on the same calendar day in TSQL?
CC BY-SA 2.5
0
2008-08-22T14:53:47.710
2010-07-22T11:21:02.210
2010-07-22T11:21:02.210
4,271
1,219
[ "sql", "sql-server", "tsql", "datetime", "user-defined-functions" ]
22,582
2
null
22,552
1
null
- -
null
CC BY-SA 2.5
null
2008-08-22T14:56:57.233
2008-08-22T14:56:57.233
null
null
2,474
null
22,590
1
22,653
null
5
739
We have a situation where users are allowed to upload content, and then separately make some changes, then submit a form based on those changes. This works fine in a single-server, non-failover environment, however we would like some sort of solution for sharing the files between servers that supports failover. Has a...
How do I cluster an upload folder with ASP.Net?
CC BY-SA 2.5
0
2008-08-22T15:02:06.630
2012-01-15T13:22:14.187
2012-01-15T13:22:14.187
1,060,350
1,432
[ "asp.net", "iis-6", "windows-server-2003", "cluster-computing", "failover" ]
22,586
2
null
21,697
3
null
As Cheekysoft suggests, I would tend to move all major exceptions into an ExceptionHandler and let those exceptions bubble up. The ExceptionHandler would render the appropriate view for the type of exception. Any validation exceptions however should be handled in the view but typically this logic is common to many pa...
null
CC BY-SA 2.5
null
2008-08-22T14:57:41.133
2008-08-22T14:57:41.133
null
null
1,851
null
22,593
2
null
22,590
1
null
In our scenario, we have a separate file server that both of our front end app servers write to, that way you either server has access to the same sets of files.
null
CC BY-SA 2.5
null
2008-08-22T15:03:07.377
2008-08-22T15:03:07.377
null
null
2,272
null
22,589
2
null
22,552
3
null
Yes, you can add the `/x` [Pattern Modifier](http://us.php.net/manual/en/reference.pcre.pattern.modifiers.php). > This modifier turns on additional functionality of PCRE that is incompatible with Perl. Any backslash in a pattern that is followed by a letter that has no special meaning causes an error, thus r...
null
CC BY-SA 2.5
null
2008-08-22T14:59:36.353
2008-08-22T14:59:36.353
null
null
792
null
22,594
2
null
22,528
5
null
While the question touches on a couple of very debatable issues (OOP, User authentication) I'll skip by those and second Konrad's comment about __autoload. Anyone who knows C/C++ knows how much of a pain including files can be. With autoload, a PHP5 addition, if you choose to use OOP (which I do almost exclusively) y...
null
CC BY-SA 2.5
null
2008-08-22T15:03:56.203
2008-08-22T15:03:56.203
null
null
2,494
null
22,595
2
null
22,519
1
null
How will the user upload the photos? If you are writing an ASP page to accept the uploaded files then only the user that IIS runs as will need write permission to the folder, since IIS will be doing the file I/O. Your ASP page should check the file size and have some form of authentication to prevent hackers from filli...
null
CC BY-SA 2.5
null
2008-08-22T15:03:59.417
2008-08-22T15:03:59.417
null
null
2,453
null
22,578
2
null
22,528
0
null
Whether you do it in classes or in a more procedural style, you simply need to check to ensure that: 1. There is a session; 2. That the session is valid; and, 3. That the user in possession of the session has proper privileges. You can encapsulate all three steps into one function (or a static method in a Session ...
null
CC BY-SA 2.5
null
2008-08-22T14:56:08.127
2008-08-22T14:56:08.127
null
null
1,344
null
22,591
2
null
22,469
6
null
I run XCode on a current-gen Macbook with only ONE GB of RAM and it runs fine, so long as I limit the amount of total applications running.
null
CC BY-SA 2.5
null
2008-08-22T15:02:16.597
2008-08-22T15:02:16.597
null
null
2,293
null
22,566
1
22,573
null
38
62,642
How do I get Perl to read the contents of a given directory into an array? [Backticks](https://en.wikipedia.org/wiki/Grave_accent#Use_in_programming) can do it, but is there some method using 'scandir' or a similar term?
How do I read in the contents of a directory in Perl?
CC BY-SA 3.0
0
2008-08-22T14:53:21.970
2022-09-16T07:28:45.713
2014-01-08T11:57:57.010
63,550
277
[ "perl", "file-io", "filesystems" ]
22,592
2
null
22,570
78
null
This is much more concise: ``` where datediff(day, date1, date2) = 0 ```
null
CC BY-SA 2.5
null
2008-08-22T15:02:46.300
2008-08-22T15:02:46.300
null
null
null
null
22,604
2
null
18,082
14
null
It can be done without RegExp as ``` function IsNumeric(data){ return parseFloat(data)==data; } ```
null
CC BY-SA 2.5
null
2008-08-22T15:08:05.757
2008-08-22T15:08:05.757
null
null
2,080
null
22,600
2
null
22,570
2
null
this will remove time component from a date for you: ``` select dateadd(d, datediff(d, 0, current_timestamp), 0) ```
null
CC BY-SA 2.5
null
2008-08-22T15:06:59.410
2008-08-22T15:06:59.410
null
null
794
null
22,605
2
null
22,598
0
null
MVC www.asp.net/mvc great videos Asp.net www.asp.net
null
CC BY-SA 2.5
null
2008-08-22T15:08:35.193
2008-08-22T15:08:35.193
null
null
1,154
null
22,598
1
22,627
null
2
683
can you recommend some good ASP.NET tutorials or a good book? Should I jump right to ASP.NET MVC/html/javascript or learn web forms first? Thanks
ASP.NET Tutorials
CC BY-SA 2.5
null
2008-08-22T15:06:36.883
2009-12-04T11:02:00.287
null
null
2,099,426
[ "asp.net", "asp.net-mvc" ]
22,609
2
null
22,607
2
null
Legally, you need to buy a Mac. It is "possible" to run (at least Tiger) in VMWare -- the experience is not optimal, but you can do it. It's also possible to run OS X on PC hardware; however, it's an exercise in illegal software and hacks.
null
CC BY-SA 2.5
null
2008-08-22T15:09:25.007
2008-08-22T15:09:25.007
null
null
1,875
null
22,596
2
null
22,590
0
null
The best solution for this is usually to provide the shared area on some form of SAN, which will be accessible from all servers and contain failover. This also has the benefit that you don't have to provide sticky load balancing, the upload can be handled by one server, and the edit by another.
null
CC BY-SA 2.5
null
2008-08-22T15:04:40.290
2008-08-22T15:04:40.290
null
null
1,908
null
22,607
1
22,666
null
10
2,676
I’m thinking about trying some development for the iPhone, is it possible to install Leopard inside VMWare? I already have a pretty high spec PC with a comfy setup that I’d like to use, or do I need to buy a real Mac?
Install Leopard inside VMWare
CC BY-SA 4.0
0
2008-08-22T15:08:50.840
2022-03-18T09:04:51.047
2022-03-18T09:04:51.047
5,446,749
1,367
[ "iphone", "macos", "virtualization" ]
22,615
2
null
20,389
2
null
If you go into the submit options, there is an option to perform custom action using rules. If you have all of the data connections set up, you can configure rules to select which connection to submit to.
null
CC BY-SA 2.5
null
2008-08-22T15:10:07.907
2008-08-22T15:10:07.907
null
null
2,470
null
22,614
2
null
22,598
0
null
If you're going to use ASP.NET MVC, then go straight to it. But it's a fairly new technology, not even in beta yet, so have that in mind. However, the application model is totally different compared to ASP.NET, so it is not in fact a replacement. For tutorials, you can surely check out [http://www.asp.net](http://www.a...
null
CC BY-SA 2.5
null
2008-08-22T15:09:58.747
2008-08-22T15:09:58.747
null
null
1,801
null
22,613
2
null
22,466
41
null
Don't move to UpdatePanels. After coming from jQuery, [the drop in performance](http://encosia.com/2007/07/11/why-aspnet-ajax-updatepanels-are-dangerous/) would be untenable. Especially on a page as complex as yours sounds. If you have 2,000 lines of JavaScript code, the solution is to refactor that code. If you pu...
null
CC BY-SA 2.5
null
2008-08-22T15:09:44.770
2008-08-22T15:28:11.747
2008-08-22T15:28:11.747
60
60
null
22,622
2
null
22,469
7
null
I'd say that any of the current iMac models are more that good enough for development with their dual core, 6MB cache, 1066MHz FSB cpus. You might consider going with more than 1GB of ram, but compare aftermarket prices at places like [NewEgg](http://www.newegg.com/) to what Apple wants (for example, I upgraded my MacB...
null
CC BY-SA 2.5
null
2008-08-22T15:12:01.240
2008-08-22T15:12:01.240
null
null
1,441
null
22,617
1
22,624
null
127
388,118
I need to find out how to format numbers as strings. My code is here: ``` return str(hours)+":"+str(minutes)+":"+str(seconds)+" "+ampm ``` Hours and minutes are integers, and seconds is a float. the str() function will convert all of these numbers to the tenths (0.1) place. So instead of my string outputting "5:30...
Format numbers to strings in Python
CC BY-SA 2.5
0
2008-08-22T15:10:46.360
2021-12-06T06:14:40.160
2010-07-26T15:49:42.040
12,855
2,504
[ "python", "string-formatting" ]
22,623
1
22,628
null
304
191,286
What are the best practices to consider when catching exceptions and re-throwing them? I want to make sure that the `Exception` object's `InnerException` and stack trace are preserved. Is there a difference between the following code blocks in the way they handle this? ``` try { //some code } catch (Exception ex) ...
Best practices for catching and re-throwing .NET exceptions
CC BY-SA 3.0
0
2008-08-22T15:12:15.340
2018-10-12T09:41:04.033
2018-10-12T09:41:04.033
5,395,773
357
[ "c#", ".net", "exception", "rethrow" ]
22,627
2
null
22,598
2
null
A great book if you're just beginning is Matthew MacDonald's [Beginning ASP.NET 3.5 in C# 2008: From Novice to Professional](https://rads.stackoverflow.com/amzn/click/com/1590598911). Once you're done with that a great reference (also by MacDonald) is [Pro ASP.NET 3.5 in C# 2008](https://rads.stackoverflow.com/amzn/cli...
null
CC BY-SA 2.5
null
2008-08-22T15:13:13.577
2008-08-22T15:13:13.577
null
null
2,503
null
22,635
2
null
22,598
1
null
MVC or WebForms...it's your choice but if I can offer one piece of advice regarding webforms...I know it'll be tempting to start dropping controls and playing with code, but it will help you A LOT if you don't skip over learning about the request and page lifecycles...a couple weeks later you'll thank yourself for spen...
null
CC BY-SA 2.5
null
2008-08-22T15:14:04.977
2008-08-22T15:14:04.977
null
null
1,975
null
22,637
2
null
22,577
0
null
If you're looking for a search plugin specifically for this site, someone will have to write one.
null
CC BY-SA 2.5
null
2008-08-22T15:15:30.497
2008-08-22T15:15:30.497
null
null
1,975,282
null
22,630
2
null
22,617
4
null
You can use C style string formatting: ``` "%d:%d:d" % (hours, minutes, seconds) ``` See here, especially: [https://web.archive.org/web/20120415173443/http://diveintopython3.ep.io/strings.html](https://web.archive.org/web/20120415173443/http://diveintopython3.ep.io/strings.html)
null
CC BY-SA 3.0
null
2008-08-22T15:13:45.667
2015-09-01T00:24:11.420
2015-09-01T00:24:11.420
1,315,962
736
null
22,633
2
null
21,652
0
null
While you can differenciate the code execution looking the exception don't matter if it's done by the "catch exceptionType hierarchy mode" or by "if(...) else...exception code mode" but if you are developing software wich is going to be used by other people, like a library i think it's usefull create your own exceptio...
null
CC BY-SA 2.5
null
2008-08-22T15:13:56.227
2008-08-22T15:13:56.227
null
null
518
null