Id
int64
4
8.51M
PostTypeId
int64
1
7
AcceptedAnswerId
int64
7
75.5M
ParentId
int64
4
41.8M
Score
int64
-208
27.7k
ViewCount
int64
11
12.4M
Body
stringlengths
0
45k
Title
stringlengths
2
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
225
CreationDate
stringdate
2008-07-31 21:42:52
2011-12-14 18:48:47
LastActivityDate
stringdate
2008-08-01 12:19:17
2023-03-05 04:40:26
LastEditDate
stringdate
2008-08-01 13:54:25
2023-03-05 03:12:45
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
-1
21.1M
Tags
listlengths
1
6
37,715
2
null
37,672
1
null
I have not done this, but here it goes. 1. Convert Visio file to Visio XML format. 2. Use Dia for Windows and Dia VDX plug-in to convert Visio XML into Dia. 3. Use tedia2sql to generate SQL.
null
CC BY-SA 2.5
null
2008-09-01T10:35:06.520
2008-09-01T10:35:06.520
null
null
3,827
null
37,716
2
null
37,702
5
null
[According to Wikipedia](http://en.wikipedia.org/wiki/Urandom) `/dev/random`, in Unix-like operating systems, is a special file that serves as a true random number generator. The /dev/random driver gathers environmental noise from various non-deterministic sources including, but not limited to, inter-keyboard timings ...
null
CC BY-SA 2.5
null
2008-09-01T10:35:56.737
2008-09-01T10:35:56.737
null
null
2,257
null
37,733
2
null
37,731
1
null
The argument he uses is the argument you need to views. Both result in only changing it in one place. However, in his version, you are mixing view markup with business code. I would suggest using more of a templated design. Do all your business logic in the PHP, setup all variables that are needed by your page. Then ...
null
CC BY-SA 2.5
null
2008-09-01T10:58:36.523
2008-09-01T10:58:36.523
null
null
986
null
37,731
1
37,768
null
5
413
I seem right now to be embroiled in a debate with another programmer on this project who thinks that views have no merits. He proposes a system that PHP looks something like this: ``` $draw = new Draw; $nav = $draw->wideHeaderBox(). $draw->left(). $draw->image(). Image::get($image,60,array('id'=>'header_i...
To use views or not to use views
CC BY-SA 2.5
null
2008-09-01T10:55:18.000
2017-07-04T08:49:46.877
null
null
2,594
[ "php", "model-view-controller" ]
37,724
2
null
37,696
1
null
As far as I'm aware SQL92 doesn't define how string concatenation should be done. This means that most engines have their own method. If you want a database independent method, you'll have to do it outside of the database. (untested in all but Oracle) ``` SELECT field1 | ', ' | field2 FROM table; ``` ``` SEL...
null
CC BY-SA 3.0
null
2008-09-01T10:50:28.790
2016-12-02T08:11:30.920
2016-12-02T08:11:30.920
2,571,493
3,839
null
37,736
2
null
23,930
8
null
# Recursive Prolog ``` fac(0,1). fac(N,X) :- N1 is N -1, fac(N1, T), X is N * T. ``` # Tail Recursive Prolog ``` fac(0,N,N). fac(X,N,T) :- A is N * X, X1 is X - 1, fac(X1,A,T). fac(N,T) :- fac(N,1,T). ```
null
CC BY-SA 2.5
null
2008-09-01T11:00:07.783
2008-10-14T15:18:09.453
2008-10-14T15:18:09.453
1,337
null
null
37,732
1
37,767
null
67
167,026
What is the RegEx pattern for DateTime (2008-09-01 12:35:45 ) ? I get this error: > No ending delimiter '^' found Using: ``` preg_match('(?n:^(?=\d)((?<day>31(?!(.0?[2469]|11))|30(?!.0?2)|29(?(.0?2)(?=.{3,4}(1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(16|[2468][048]|[3579][26])00))|0?[1-9]|1\d|2[0-8])(?<sep>[/....
What is the regex pattern for datetime (2008-09-01 12:35:45 )?
CC BY-SA 3.0
0
2008-09-01T10:58:24.607
2022-11-19T13:59:13.290
2012-04-27T06:41:19.163
41,956
4,013
[ "php", "regex", "datetime" ]
37,740
2
null
37,591
0
null
See [XML data binding](http://en.wikipedia.org/wiki/XML%5FData%5FBinding). Use Visual Studio or [xsd.exe](http://msdn.microsoft.com/en-us/library/x6c1kb0s%28VS.71%29.aspx) to generate DataSet or classes from XSD, then use [System.Xml.Serialization.XmlSerializer](http://msdn.microsoft.com/en-us/library/system.xml.serial...
null
CC BY-SA 2.5
null
2008-09-01T11:01:40.760
2008-09-01T11:01:40.760
null
null
3,827
null
37,747
2
null
37,731
1
null
I've done something like that in the past, and it was a waste of time. For instance, you basically have to write wrappers for everything you can already with HTML and you WILL forget some things. When you need to change something in the layout you will think "Shoot, I forgot about that..now I gotta code another metho...
null
CC BY-SA 2.5
null
2008-09-01T11:05:10.440
2008-09-01T11:05:10.440
null
null
795
null
37,629
2
null
36,054
2
null
You could try integrating Sphinx with [Asterisk](http://www.asterisk.org/): - [http://www.syednetworks.com/asterisk-integration-with-sphinx-voice-recognition-system](http://www.syednetworks.com/asterisk-integration-with-sphinx-voice-recognition-system)- [http://www.voip-info.org/wiki/view/Sphinx](http://www.voip-info....
null
CC BY-SA 2.5
null
2008-09-01T08:42:19.177
2008-09-01T08:49:27.537
2008-09-01T08:49:27.537
2,783
2,783
null
37,750
2
null
37,743
11
null
Untested, but should work: ``` select * from users where points in (select distinct top 3 points from users order by points desc) ```
null
CC BY-SA 2.5
null
2008-09-01T11:07:41.993
2008-09-01T11:07:41.993
null
null
2,257
null
37,737
2
null
37,649
7
null
Ok, so just for fun, you could do this! (assuming you're swapping string values) ``` mysql> select * from swapper; +------+------+ | foo | bar | +------+------+ | 6 | 1 | | 5 | 2 | | 4 | 3 | +------+------+ 3 rows in set (0.00 sec) mysql> update swapper set -> foo = concat(foo, "###", bar)...
null
CC BY-SA 2.5
null
2008-09-01T11:00:32.573
2008-09-01T11:00:32.573
null
null
1,951
null
37,743
1
37,750
null
7
23,181
I'd like to find the different ways to solve a real life problem I had: imagine to have a contest, or a game, during which the users collect points. You have to build a query to show the list of users with the best "n" scores. I'm making an example to clarify. Let's say that this is the Users table, with the points e...
SQL query to get the top "n" scores out of a list
CC BY-SA 2.5
null
2008-09-01T11:03:34.907
2017-07-24T11:25:40.873
2015-06-05T06:01:13.817
2,958,272
1,178
[ "sql", "sql-server", "puzzle" ]
37,742
2
null
37,732
7
null
[http://regexlib.com/REDetails.aspx?regexp_id=610](http://regexlib.com/REDetails.aspx?regexp_id=610) > ^(?=\d)(?:(?:31(?!.(?:0?[2469]|11))|(?:30|29)(?!.0?2)|29(?=.0?2.(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))(?:\x20|$))|(?:2[0-8]|1\d|0?[1-9]))([-./])(?:1[012]|0?[1...
null
CC BY-SA 2.5
null
2008-09-01T11:03:12.113
2008-09-01T11:22:41.380
2008-09-01T11:22:41.380
2,257
2,257
null
37,755
2
null
34,638
2
null
When using Hibernate filters you need to be aware that the additional restrictions will not be applied to SQL statements generted by the `load()` or `get()` methods.
null
CC BY-SA 2.5
null
2008-09-01T11:13:42.120
2008-09-01T11:13:42.120
null
null
1,969
null
37,758
2
null
37,732
31
null
A simple version that will work for the format mentioned, but not all the others as per @Espos: ``` (\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) ```
null
CC BY-SA 2.5
null
2008-09-01T11:14:40.200
2008-09-01T11:14:40.200
null
null
3,715
null
37,756
2
null
37,731
1
null
It looks pretty verbose and hard to follow to be honest and some of the code looks like it is very much layout information. We always try to split the logic from the output as much as possible. However, it is often the case that the view and data are very tightly linked with both part dictating how the other should be...
null
CC BY-SA 2.5
null
2008-09-01T11:13:49.530
2008-09-01T11:13:49.530
null
null
4,012
null
37,763
2
null
37,759
2
null
Add the following to the virtual directory's web.config file: ``` <httpModules> <remove name="ChartStreamHandler"/> </httpModules> ```
null
CC BY-SA 2.5
null
2008-09-01T11:19:58.283
2008-09-01T11:19:58.283
null
null
4,007
null
37,761
2
null
37,696
3
null
> Sergio del Amo:> However, I am not getting the pages without tags. I guess i need to write my query with left outer joins. ``` SELECT pagetag.id, page.name, group_concat(tag.name) FROM ( page LEFT JOIN pagetag ON page.id = pagetag.pageid ) LEFT JOIN tag ON pagetag.tagid = tag.id GROUP BY page.id; ``` Not a ver...
null
CC BY-SA 3.0
null
2008-09-01T11:17:34.483
2016-12-02T09:32:58.137
2016-12-02T09:32:58.137
2,571,493
2,287
null
37,759
1
37,762
null
17
7,524
I have the following code in a web.config file of the default IIS site. ``` <httpModules> <add type="MDL.BexWebControls.Charts.ChartStreamHandler,Charts" name="ChartStreamHandler"/> </httpModules> ``` Then when I setup and browse to a virtual directory I get this error Could not load file or assembly 'Charts' o...
How do you prevent the IIS default site web.config file being inherited by virtual directories?
CC BY-SA 2.5
0
2008-09-01T11:15:11.557
2010-04-22T13:14:02.707
2008-09-26T18:48:21.717
2,134
2,471
[ ".net", "asp.net", "configuration", "configuration-files" ]
37,764
1
null
null
3
4,500
I'm customizing a SugarCRM 5, and in my I have all invoices which were imported from our ERP. Now, I would like to know if it is possible to create a new sub-panel in the Accounts Panel , so that my client invoices index are visible in that interface.
SugarCRM 5 - Create a sub-panel for invoices in Account Panel
CC BY-SA 2.5
null
2008-09-01T11:20:22.527
2012-11-30T07:05:18.577
2011-03-15T22:05:06.657
496,830
2,019,426
[ "crm", "sugarcrm" ]
37,762
2
null
37,759
20
null
I've found the answer. Wrap the HttpModule section in location tags and set the inheritInChildApplications attribute to false. ``` <location path="." inheritInChildApplications="false"> <system.web> <httpModules> <add type="MDL.BexWebControls.Charts.ChartStreamHandler,Charts" name="ChartStreamHandler"/> ...
null
CC BY-SA 2.5
null
2008-09-01T11:19:03.607
2008-09-01T12:01:43.893
2008-09-01T12:01:43.910
2,471
2,471
null
37,765
2
null
37,743
0
null
@Rob#37760: ``` select top N points from users order by points desc ``` This query will only select 3 rows if N is 3, see the question. "Top 3" should return 5 rows.
null
CC BY-SA 2.5
null
2008-09-01T11:21:20.073
2008-09-01T11:21:20.073
null
null
2,257
null
37,766
2
null
37,759
-2
null
[According to Microsoft](http://msdn.microsoft.com/en-us/library/ms178685.aspx), other websites do not inherit settings from the Default Website. Do you mean you are editing the default web.config which is located in the same folder as the machine.config?
null
CC BY-SA 2.5
null
2008-09-01T11:22:45.890
2008-09-01T11:22:45.890
null
null
383
null
37,753
2
null
37,743
0
null
@bosnic, I don't think that will work as requested, I'm not that familiar with MS SQL but I would expect it to return only 3 rows, and ignore the fact that 3 users are tied for 3rd place. Something like this should work: ``` select userid, points from scores where points in (select top 3 points ...
null
CC BY-SA 2.5
null
2008-09-01T11:12:00.377
2008-09-01T11:12:00.377
null
null
3,715
null
37,760
2
null
37,743
0
null
@Espo thanks for the reality check - added the sub-select to correct for that. I think the easiest response is to: ``` select userid, points from users where points in (select distinct top N points from users order by points desc) ``` If you want to put that in a stored proc which takes N as a parameter, then you'l...
null
CC BY-SA 2.5
null
2008-09-01T11:15:53.630
2008-09-01T11:31:11.737
2008-09-01T11:31:11.737
149
149
null
37,735
2
null
35,615
11
null
. They do not specifically provide the HTML and/or CSS in order to achieve the desired results, but they do provide examples of live sites that you can on (or, even better, use [Firebug](http://getfirebug.com/)). ## UI-patterns This is probably the best of the bunch. It breaks things down into categories that cov...
null
CC BY-SA 2.5
null
2008-09-01T10:59:02.717
2008-09-08T12:51:50.077
2008-09-08T12:51:50.077
1,944
1,944
null
37,781
2
null
37,743
1
null
How about: ``` select top 3 with ties points from scores order by points desc ``` Not sure if "with ties" works on anything other the SQL Server. On SQL Server 2005 and up, you can pass the "top" number as an int parameter: ``` select top (@n) with ties points from scores order by points desc ```
null
CC BY-SA 2.5
null
2008-09-01T11:32:25.913
2008-09-01T12:09:27.040
2008-09-01T12:09:27.040
615
615
null
37,768
2
null
37,731
5
null
HTML time-savers are useful, but they're only useful when they're intuitive and easy-to-understand. Having to instantiate a `new Draw` just doesn't sound very natural. Furthermore, `wideHeaderBox` and `left` will only have significance to someone who intimately knows the system. And what if there a redesign, like your...
null
CC BY-SA 2.5
null
2008-09-01T11:23:44.920
2008-09-01T11:23:44.920
null
null
1,344
null
37,767
2
null
37,732
87
null
@Espo: I just have to say that regex is incredible. I'd hate to have to write the code that did something useful with the matches, such as if you wanted to actually find out what date and time the user typed. It seems like Tom's solution would be more tenable, as it is about a zillion times simpler and with the additi...
null
CC BY-SA 2.5
null
2008-09-01T11:23:07.433
2008-09-01T11:23:07.433
null
null
893
null
37,778
2
null
35,745
0
null
David, thanks for the suggestions. I spent the weekend trialing the programs. Doxygen seems to be the most comprehensive of the 3, but it still leaves some things to be desired in regard to callers of methods. All 3 seem to have problems with C++ templates to varying degrees. CC-Rider simply crashed in the middle of ...
null
CC BY-SA 2.5
null
2008-09-01T11:30:19.023
2008-09-01T11:30:19.023
null
null
1,398
null
37,774
2
null
20,059
7
null
I'd go with [Scratch](http://scratch.mit.edu/), some points regarding it. - - - I'd like to note that although many of us started programing at a young age in basic or logo and because programmer later in life doesn't mean those are good languages to start with. I think that kids today have much better options, like...
null
CC BY-SA 2.5
null
2008-09-01T11:28:22.600
2008-09-01T11:35:15.110
2008-09-01T11:35:15.110
1,509,946
1,509,946
null
37,784
2
null
37,529
5
null
I think [portaudio](http://www.portaudio.com/) is what you need. Reading from the mike from a console app is a 10 line C file (see patests in the portaudio distrib).
null
CC BY-SA 2.5
null
2008-09-01T11:33:42.400
2008-09-01T11:33:42.400
null
null
2,811
null
37,788
2
null
35,745
1
null
When I have used Doxygen it has produced a full list of callers and callees. I think you have to turn it on.
null
CC BY-SA 2.5
null
2008-09-01T11:36:38.413
2008-09-01T11:36:38.413
null
null
3,836
null
37,783
1
83,332
null
2
1,557
I am creating an application for a Windows Mobile computer. The catch is that the device ([Motorola MC17](http://www.motorola.com/business/v/index.jsp?vgnextoid=d4397b103d175110VgnVCM1000008406b00aRCRD)) does not have a touch screen or universal keys - there are only six programmable hardware keys. [Fitt's law](http://...
Are there any guidelines for designing user interface for mobile devices?
CC BY-SA 4.0
0
2008-09-01T11:33:31.120
2018-12-27T22:23:26.857
2018-12-27T22:23:26.857
4,751,173
3,205
[ "user-interface", "windows-mobile", "usability" ]
37,782
2
null
30,319
1
null
Here's an example for the hidden div way: ``` <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style> *[data-when-js-is-on] { display: none; } </style> <script> document.getElementsByTagName("style")[0]...
null
CC BY-SA 2.5
null
2008-09-01T11:32:46.303
2008-09-01T11:32:46.303
null
null
1,697
null
37,787
2
null
37,696
1
null
I got a solution playing with joins. The query is: ``` SELECT page.id AS id, page.name AS name, tagstable.tags AS tags FROM page LEFT OUTER JOIN ( SELECT pagetag.pageid, GROUP_CONCAT(distinct tag.name) AS tags FROM tag INNER JOIN pagetag ON tagid = tag.id GROUP BY pagetag.pageid ) AS tagstab...
null
CC BY-SA 3.0
null
2008-09-01T11:34:36.110
2016-12-02T08:22:09.940
2016-12-02T08:22:09.940
2,571,493
2,138
null
37,789
2
null
37,696
0
null
> pagetag.id and group_concat(tag.name) will be null for page 4 in the example you've posted above, but the page shall appear in the results. You can use the [COALESCE](http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#function_coalesce) function to remove the Nulls if you need to: ``` select COALESCE(...
null
CC BY-SA 2.5
null
2008-09-01T11:37:58.787
2008-09-01T11:37:58.787
null
null
3,715
null
37,785
1
38,825
null
2
1,095
Is it possible to have a fixture change between test methods? If so, how can I do this? My syntax for this problem : In the cakephp framework i am building tests for a behavior that is configured by adding fields to the table. This is intended to work in the same way that adding the "created" and "modified" fields...
Can a fixture be changed dynamically between test methods in CakePHP?
CC BY-SA 3.0
null
2008-09-01T11:33:49.343
2013-01-18T15:41:23.850
2013-01-18T15:41:23.850
287,583
4,013
[ "unit-testing", "cakephp", "fixture" ]
37,793
2
null
37,702
1
null
One of the best method to generate a random number is through [Clock Drift](http://en.wikipedia.org/wiki/Hardware_random_number_generator#Clock_drift). This primarily works with two oscillators. An analogy of how this works is imagine a race car on a simple oval circuit with a while line at the start of the lap and al...
null
CC BY-SA 2.5
null
2008-09-01T11:40:07.143
2008-09-01T11:40:07.143
null
null
383
null
37,786
2
null
31,128
0
null
The article referred to by @Lee Theobald is a good start. Some basic ideas I try to keep in mind when marking up: Try to write for the next person - that is, think about how easy or difficult it might be for someone else to come and pick up your work and carry on. To support this principle, you should try and mak...
null
CC BY-SA 3.0
null
2008-09-01T11:34:22.633
2017-02-23T10:45:47.193
2017-02-23T10:45:47.193
6,670,723
2,977
null
37,791
1
89,454
null
16
7,053
At the moment my code (PHP) has too many SQL queries in it. eg... ``` // not a real example, but you get the idea... $results = $db->GetResults("SELECT * FROM sometable WHERE iUser=$userid"); if ($results) { // Do something } ``` I am looking into using stored procedures to reduce this and make things a little m...
How do you manage SQL Queries
CC BY-SA 2.5
0
2008-09-01T11:38:36.773
2017-04-11T07:15:26.710
null
null
4,012
[ "php", "sql", "mysql" ]
37,799
1
38,317
null
6
3,880
Is it possible to use gcov for coverage testing of multi-threaded applications? I've set some trivial tests of our code-base up, but it would be nice to have some idea of the coverage we're achieving. If gcov isn't appropriate can anyone recommend an alternative tool (possible oprofile), ideally with some good docume...
GCOV for multi-threaded apps
CC BY-SA 2.5
0
2008-09-01T11:44:09.113
2013-12-11T12:42:32.130
2008-11-18T03:07:36.620
14,343
2,246
[ "c++", "testing", "code-coverage" ]
37,802
2
null
37,189
0
null
When you run a schedule task you can have it run under a user. Verify the user that is running the schedule task has the same rights for the fax resource as you. Which is why you can run it when you double click in Windows explore.
null
CC BY-SA 2.5
null
2008-09-01T11:48:05.563
2008-09-01T11:48:05.563
null
null
2,469
null
37,801
2
null
37,791
2
null
We were in a similar predicament at one time. We queried a specific table in a variety of ways, over 50+. What we ended up doing was creating a single Fetch stored procedure that includes a parameter value for the WhereClause. The WhereClause was constructed in a Provider object, we employed the Facade design patt...
null
CC BY-SA 2.5
null
2008-09-01T11:48:01.693
2008-09-01T11:48:01.693
null
null
1,768
null
37,800
2
null
37,783
3
null
[Guidelines for Handheld & Mobile Device User Interface](http://www.scribd.com/doc/833751/Guidelines%2Dfor%2DHandheld%2DMobile%2DDevide%2DUser%2DInterface): > While there has been much successful work in developing rules to guide the design and implementation of interfaces for desktop machines and their applications, ...
null
CC BY-SA 2.5
null
2008-09-01T11:46:28.673
2008-09-01T11:46:28.673
null
null
3,827
null
37,790
2
null
37,593
2
null
The [Tango project](http://tango.freedesktop.org/Tango_Desktop_Project) has some good icons For areas that only need , the silk icons from [famfamfam](http://www.famfamfam.com/lab/icons/) are good too Both are Creative Commons licensed
null
CC BY-SA 3.0
null
2008-09-01T11:38:21.140
2017-07-04T08:52:56.990
2017-07-04T08:52:56.990
5,423,108
4,007
null
37,795
2
null
37,791
2
null
Use a ORM package, any half decent package will allow you to 1. Get simple result sets 2. Keep your complex SQL close to the data model If you have very complex SQL, then views are also nice to making it more presentable to different layers of your application.
null
CC BY-SA 2.5
null
2008-09-01T11:41:16.080
2008-09-01T11:41:16.080
null
null
3,839
null
37,808
1
37,824
null
23
8,236
Are you working on a (probably commercial) product which uses RDF/OWL/SPARQL technologies? If so, can you please describe your product?
Examples of using semantic web technologies in real world applications
CC BY-SA 2.5
0
2008-09-01T11:55:27.560
2010-11-02T14:38:18.517
null
null
4,018
[ "rdf", "semantic-web" ]
37,805
1
37,810
null
20
42,533
I have a `List<int>` and a `List<customObject>`. The customObject class has an ID property. How can I get a `List<customObject>` containing only the objects where the ID property is in the `List<int>` using LINQ? : I accepted Konrads answer because it is easier/more intuitive to read.
Filter linq list on property value
CC BY-SA 2.5
0
2008-09-01T11:49:07.620
2013-11-04T10:27:48.760
2008-09-01T12:02:18.977
2,257
2,257
[ ".net", "linq", "linq-to-objects" ]
37,807
2
null
37,805
6
null
Untested, but it'll be something like this: ``` var matches = from o in objList join i in intList on o.ID equals i select o; ``` @Konrad just tested it, and it does work - I just had a typo where I'd written "i.ID" rather than "i".
null
CC BY-SA 2.5
null
2008-09-01T11:51:34.073
2008-09-01T11:57:42.827
2008-09-01T11:57:42.827
615
615
null
37,810
2
null
37,805
17
null
``` var result = from o in objList where intList.Contains(o.ID) select o ```
null
CC BY-SA 3.0
null
2008-09-01T11:56:21.190
2012-03-02T22:14:49.267
2012-03-02T22:14:49.267
2,343
1,968
null
37,809
1
37,880
null
28
16,947
How can I go about generating a Friendly URL in C#? Currently I simple replace spaces with an underscore, but how would I go about generating URL's like Stack Overflow? For example how can I convert: > How do I generate a Friendly URL in C#? Into > how-do-i-generate-a-friendly-url-in-C
How do I generate a Friendly URL in C#?
CC BY-SA 2.5
0
2008-09-01T11:55:57.620
2019-11-13T10:40:19.957
null
null
383
[ "c#", "friendly-url" ]
37,814
2
null
23,930
1
null
``` factorial() { if [ $1 -eq 0 ] then echo 1 return fi a=`expr $1 - 1` expr $1 \* `factorial $a` } ``` Also works for Korn Shell and Bourne Again Shell. :-)
null
CC BY-SA 2.5
null
2008-09-01T11:59:16.567
2008-09-01T12:04:27.350
2008-09-01T12:04:27.350
3,171
3,171
null
37,818
2
null
37,809
5
null
This gets part of the way there (using a whitelist of valid characters): ``` new Regex("[^a-zA-Z-_]").Replace(s, "-") ``` It does, however, give you a string that ends with "--". So perhaps a second regex to trim those from the beginning/end of the string, and maybe replace any internal "--" to "-".
null
CC BY-SA 2.5
null
2008-09-01T12:03:58.287
2008-09-01T12:03:58.287
null
null
615
null
37,804
1
38,359
null
18
36,268
I have a bunch of different files on a bunch of different computers. It's mostly media and there is quite a bit of it. I'm looking into various ways of consolidating this into something more manageable. Currently there are a few options I'm looking at, the insane of which is some kind of samba share indexer that wo...
Link to samba shares in html
CC BY-SA 2.5
0
2008-09-01T11:49:00.570
2008-09-25T11:00:48.570
2008-09-01T12:38:40.933
1,666
1,666
[ "html", "samba", "smb" ]
37,812
1
37,891
null
5
7,043
Is there anything which can help with msmq monitoring? I'd like to get some event/monit when a message appears in queue and the same on leave.
MSMQ monitoring
CC BY-SA 2.5
0
2008-09-01T11:59:03.587
2015-03-23T07:23:04.377
null
null
3,182
[ "monitoring", "msmq" ]
37,823
1
37,852
null
139
21,492
Can you please point to alternative data storage tools and give good reasons to use them instead of good-old relational databases? In my opinion, most applications rarely use the full power of SQL--it would be interesting to see how to build an SQL-free application.
Good reasons NOT to use a relational database?
CC BY-SA 3.0
0
2008-09-01T12:05:52.010
2013-12-19T05:17:27.847
2013-01-22T22:58:10.813
1,950,848
4,018
[ "sql", "database", "nosql" ]
37,830
1
37,878
null
25
14,802
I want to show a chromeless modal window with a close button in the upper right corner. Is this possible?
How do I implement a chromeless window with WPF?
CC BY-SA 2.5
0
2008-09-01T12:07:38.903
2020-06-13T19:24:29.777
null
null
2,374
[ "wpf", "user-interface" ]
37,824
2
null
37,808
6
null
O'Reilly's Practical RDF has a chatper titled [Commercial Uses of RDF/XML](http://safari.oreilly.com/0596002637/pracrdf-CHP-15-SECT-1). The table at the left lists the subsections: [Chandler](http://chandlerproject.org/), [RDF Gateway](http://www.intellidimension.com/), [Seamark](http://siderean.com/), and Adobe's [XMP...
null
CC BY-SA 2.5
null
2008-09-01T12:05:56.893
2008-09-01T12:05:56.893
null
null
3,948
null
37,817
2
null
37,809
18
null
Here's how we do it. Note that there are probably more edge conditions than you realize at first glance.. ``` if (String.IsNullOrEmpty(title)) return ""; // remove entities title = Regex.Replace(title, @"&\w+;", ""); // remove anything that is not letters, numbers, dash, or space title = Regex.Replace(title, @"[^A-Za...
null
CC BY-SA 2.5
null
2008-09-01T12:03:30.520
2008-09-01T12:10:53.230
2008-09-01T12:10:53.230
383
1
null
37,821
1
38,114
null
4
2,430
I'd like to be able to view the event `log` for a series of `asp.net` websites running on IIS. Can I do this externally, for example, through a web interface?
Viewing event log via a web interface
CC BY-SA 3.0
0
2008-09-01T12:05:22.887
2018-10-13T20:34:25.137
2018-10-13T20:34:25.137
3,995,261
2,252
[ "asp.net", "iis", "logging", "monitoring" ]
37,839
2
null
37,808
1
null
Have a look at the [Calais Viewer](http://sws.clearforest.com/calaisviewer/) for a real world application.
null
CC BY-SA 2.5
null
2008-09-01T12:13:04.583
2008-09-01T12:13:04.583
null
null
2,569
null
37,831
2
null
37,791
0
null
[This other question](https://stackoverflow.com/questions/22278/whats-a-good-way-to-encapsulate-data-access-with-phpmysql) also has some useful links in it...
null
CC BY-SA 2.5
null
2008-09-01T12:08:03.753
2008-09-01T12:08:03.753
2017-05-23T12:02:33.263
-1
4,012
null
37,841
2
null
37,823
10
null
The filesystem's prety handy for storing binary data, which never works amazingly well in relational databases.
null
CC BY-SA 2.5
null
2008-09-01T12:14:38.620
2008-09-01T12:14:38.620
null
null
2,562
null
37,832
1
37,853
null
2
444
So I know that unit testing is a must. I get the idea that TDD is the way to go when adding new modules. Even if, in practice, I don't actually do it. A bit like commenting code, really. The real thing is, I'm struggling to get my head around how to unit-test the UI and more generally objects that generate events: us...
UI and event testing
CC BY-SA 2.5
null
2008-09-01T12:09:10.553
2016-12-23T18:47:38.437
2008-09-02T05:08:24.190
305
2,902
[ "visual-studio", "unit-testing", "user-interface", "tdd" ]
37,847
2
null
23,930
1
null
``` (defun factorial (x) (if (<= x 1) 1 (* x (factorial (- x 1))))) ```
null
CC BY-SA 2.5
null
2008-09-01T12:17:22.030
2008-09-01T12:17:22.030
null
null
2,450
null
37,822
1
null
null
9
5,820
I have read that the iPhone SDK (part of Xcode 3) is restricted to Mac's with the intel chipset. Does this restriction apply to only the simulator part of the SDK or the complete shebang? I have a Powerbook G4 running Leopard and would very much like to do dev on it rather than fork out for a new machine. It is also ...
Is it just the iPhone simulator that is restricted to Intel only Mac's?
CC BY-SA 3.0
0
2008-09-01T12:05:29.953
2017-09-05T11:22:59.713
2017-09-05T11:22:59.713
1,000,551
2,438
[ "ios", "xcode", "macos", "ios-simulator" ]
37,844
2
null
37,823
4
null
G'day, One case that I can think of is when the data you are modelling cannot be easily represented in a relational database. Once such example is the database used by mobile phone operators to monitor and control base stations for mobile telephone networks. I almost all of these cases, an [OO DB](http://en.wikipedi...
null
CC BY-SA 2.5
null
2008-09-01T12:16:40.237
2008-09-01T12:16:40.237
null
null
2,974
null
37,846
2
null
37,804
1
null
To make the links work cross platform you could look at the User Agent either in a CGI script or in JavaScript and update your URLs appropriately. Alternatively, if you want to consolidate SMB shares you could try using [Microsoft DFS](http://en.wikipedia.org/wiki/Distributed_File_System_(Microsoft)) (which also works...
null
CC BY-SA 2.5
null
2008-09-01T12:17:03.887
2008-09-01T12:55:45.103
2008-09-01T12:55:45.103
3,171
3,171
null
37,843
1
37,870
null
17
9,018
I have seen lots of questions recently about WPF... - - -
What exactly is WPF?
CC BY-SA 3.0
0
2008-09-01T12:15:14.687
2012-05-03T20:42:23.077
2012-05-03T20:42:23.077
107,899
383
[ "wpf", "windows" ]
37,842
2
null
37,832
0
null
You should separate logic and presentation. Using MVP(Model-View-Presenter)/MVC (Model-View-Controller) patterns you can unit test you logic without relying on UI events. Also you can use [White framework](http://www.codeplex.com/white) to simulate user input. I would highly recommend you to visit Microsoft's [Patterns...
null
CC BY-SA 2.5
null
2008-09-01T12:15:04.970
2008-09-01T12:15:04.970
null
null
1,196
null
37,849
2
null
37,843
0
null
Windows Presentation Foundation. It's basically Microsoft's latest attempt to make development easier, and provide a whole heap of nice functionality out of the box. I'm not sure where to start, but googling "WPF 101" should throw up a few useful links.
null
CC BY-SA 2.5
null
2008-09-01T12:18:54.133
2008-09-01T12:18:54.133
null
null
377
null
37,813
2
null
37,743
4
null
Here's one that works - I don't know if it's more efficient, and it's SQL Server 2005+ ``` with scores as ( select 1 userid, 100 points union select 2, 75 union select 3, 50 union select 4, 50 union select 5, 50 union select 6, 25 ), results as ( select userid, points, RANK() over (order by...
null
CC BY-SA 2.5
null
2008-09-01T11:59:05.537
2008-09-01T11:59:05.537
null
null
3,717
null
37,855
2
null
37,823
3
null
Object databases are not relational databases. They can be really handy if you just want to stuff some objects in a database. They also support versioning and modify classes for objects that already exist in the database. [db4o](http://www.db4o.com/) is the first one that comes to mind.
null
CC BY-SA 2.5
null
2008-09-01T12:20:28.387
2008-09-01T12:20:28.387
null
null
3,836
null
37,851
1
37,884
null
1
1,331
I'm looking for some software that allows me to control a server based application, that is, there are bunch of interdependent processes that I'd like to be able to start up, shut down and monitor in a controller manner. I've come across programs like Autosys, but that's expensive and very much over the top for what I...
Application Control Scripts on Unix
CC BY-SA 2.5
null
2008-09-01T12:19:13.943
2012-02-03T04:20:31.330
2008-09-09T23:13:49.277
-1
2,998
[ "linux", "unix", "solaris", "scripting" ]
37,854
2
null
37,441
2
null
It's certainly effective lock-in, as 1800 says. But in fairness to the database vendors, the SQL standard is always playing catch-up to current databases' feature sets. Most databases we have today are of pretty ancient lineages. If you trace Microsoft SQL Server back to its roots, I think you'll find Ingres - one of t...
null
CC BY-SA 2.5
null
2008-09-01T12:20:04.893
2008-09-01T12:20:04.893
null
null
619
null
37,848
2
null
37,832
0
null
The parts of your application that talk to the outside world (ie UI, database etc.) are always a problem when unit-testing. The way around this is actually not to test those layers but make them as thin as possible. For the UI you can use a humble dialog or a view that doesn't do anything worth testing and then put all...
null
CC BY-SA 2.5
null
2008-09-01T12:18:02.387
2008-09-01T12:18:02.387
null
null
3,320
null
37,853
2
null
37,832
2
null
the thing to remember is that unit testing is about testing the units of code you write. Your unit tests shouldn't test that clicking a button raises an event, but that the code being executed by that click event does as it's supposed to. What you're really wanting to do is test the underlying code does what it should...
null
CC BY-SA 2.5
null
2008-09-01T12:19:14.367
2008-09-01T12:19:14.367
null
null
493
null
37,850
2
null
104
11
null
Why do people think that an memory leak in .NET is not the same as any other leak? A memory leak is when you attach to a resource and do not let it go. You can do this both in managed and in unmanaged coding. Regarding .NET, and other programming tools, there have been ideas about garbage collecting, and other ways o...
null
CC BY-SA 3.0
null
2008-09-01T12:19:13.210
2017-05-06T09:04:13.903
2017-05-06T09:04:13.903
4,099,598
3,308
null
37,861
2
null
37,851
1
null
G'day, Have a look in /etc/init.d for something similar and use that as a basis. See also crontab, or maybe at, to run on a regular basis. cheers, Rob
null
CC BY-SA 2.5
null
2008-09-01T12:21:18.213
2008-09-01T12:21:18.213
null
null
2,974
null
37,859
2
null
37,823
6
null
Try Prevayler: [http://www.prevayler.org/wiki/](http://www.prevayler.org/wiki/) Prevayler is alternative to RDBMS. In the site have more info.
null
CC BY-SA 2.5
null
2008-09-01T12:20:55.063
2008-09-01T12:32:01.107
2008-09-01T12:32:01.107
3,031
3,031
null
37,858
2
null
37,823
1
null
You can go a long way just using files stored in the file system. RDBMSs are getting better at handling blobs, but this can be a natural way to handle image data and the like, particularly if the queries are simple (enumerating and selecting individual items.) Other things that don't fit very well in a RDBMS are hier...
null
CC BY-SA 2.5
null
2008-09-01T12:20:52.707
2008-09-01T12:20:52.707
null
null
3,715
null
37,864
2
null
37,306
3
null
I second the usage of TableLayoutPanel for single-line inline controls. I usually set each column and the first row to AutoSize and set each child control's Dock property to Fill in the designer. That gets the horizontal layout to display properly. To make the the text line up between labels/textboxes, set the TextAli...
null
CC BY-SA 2.5
null
2008-09-01T12:25:29.110
2008-09-01T12:25:29.110
null
null
4,007
null
37,869
2
null
37,823
1
null
There are a large number of ways to store data - even "relational databse" covers a range of alternatives from a simple library of code that manipulates a local file (or files) as if it were a relational database on a single user basis, through file based systems than can handle multiple-users to a generous selection o...
null
CC BY-SA 2.5
null
2008-09-01T12:31:15.040
2008-09-01T12:31:15.040
null
null
1,070
null
37,867
2
null
37,843
1
null
WPF is the Windows Presentation Foundation. It is Microsoft's newest API for building applications with User Interfaces (UIs), working for both standalone and web-based applications. Unsurprisingly, there is a very detailed but not all that helpful [Windows Presentation Foundation page at Wikipedia](http://en.wikiped...
null
CC BY-SA 2.5
null
2008-09-01T12:28:51.770
2008-09-01T12:28:51.770
null
null
3,171
null
37,871
1
null
null
3
3,447
On my way through whipping up a Windows Forms application I thought it might have been a good idea to use the settings file to store miscellaneous application options (instead of the registry) and user parameters (window positions, column orderings, etc.). Out of the box, quick and simple, or so I thought. All works a...
Roaming settings with LocalFileSettingsProvider
CC BY-SA 2.5
null
2008-09-01T12:32:20.090
2009-08-28T07:49:53.367
2008-09-25T11:19:44.810
615
3,709
[ ".net", "winforms" ]
37,870
2
null
37,843
10
null
WPF is a new technology that will supersede Windows Forms. WPF stands for Windows Presentation Foundation Here are some useful topics on SO: 1. What WPF books would you recommend 2. What real world WPF applications are out there From my practice I can say that WPF is a truly amazing technology however it takes som...
null
CC BY-SA 2.5
null
2008-09-01T12:31:39.610
2008-09-01T12:55:28.240
2017-05-23T12:25:03.437
-1
1,196
null
37,862
2
null
37,702
10
null
At the end of the post, I will answer your question of why you might want to use multiple random number generators for "more randomness". There are philosophical debates about what randomness means. Here, I will mean "indistinguishable in every respect from a uniform(0,1) iid distribution over the samples drawn" I...
null
CC BY-SA 2.5
null
2008-09-01T12:21:57.900
2010-01-26T15:24:09.583
2010-01-26T15:24:09.583
279
279
null
37,879
2
null
37,843
1
null
Check out Eric Sink's [Twelve days of WPF 3D](http://www.ericsink.com/wpf3d/index.html).
null
CC BY-SA 2.5
null
2008-09-01T12:34:58.477
2008-09-01T12:34:58.477
null
null
1,688,440
null
37,865
2
null
37,843
1
null
Take a look here [http://windowsclient.net/](http://windowsclient.net/) and here [Windows Presentation Foundation (WPF)](http://msdn.microsoft.com/en-us/netframework/aa663326.aspx) Basically WPF is created to make windows form easier to design because of the use of XAML, designers can work on the design and programmer...
null
CC BY-SA 2.5
null
2008-09-01T12:26:50.150
2008-09-01T12:26:50.150
null
null
740
null
37,878
2
null
37,830
33
null
You'll pretty much have to roll your own Close button, but you can hide the window chrome completely using the WindowStyle attribute, like this: ``` <Window WindowStyle="None"> ``` That will still have a resize border. If you want to make the window non-resizable then add ResizeMode="NoResize" to the declaration.
null
CC BY-SA 2.5
null
2008-09-01T12:34:31.363
2008-09-01T12:34:31.363
null
null
615
null
37,852
2
null
37,823
148
null
Plain text files in a filesystem - - - --- XML or JSON files on disk - --- Spreadsheet / CSV file - --- Subversion (or similar disk based version control system) - --- [Berkeley DB](http://www.oracle.com/technology/products/berkeley-db/index.html) (Basically, a disk based hashtable) - - - -...
null
CC BY-SA 3.0
null
2008-09-01T12:19:14.193
2013-10-31T00:18:49.240
2013-10-31T00:18:49.240
179,675
797
null
37,876
2
null
37,843
1
null
Is the new Windows Gui system. I don't believe its aim is to make development easier per se but more to address fundamental issues with WinForm, such as transparency and scaling, neither of which WinForm can effectively address. Furthermore it seeks to address the "one resolution only" paradigm of WinForm by mapping si...
null
CC BY-SA 2.5
null
2008-09-01T12:33:52.990
2008-09-01T12:33:52.990
null
null
1,143
null
37,874
2
null
37,843
5
null
WPF is the next frontier with Windows UIs. - - - - - - - You can get either Adam Nathan's WPF Unleashed Book or Chris Sells Programming WPF .. those seem to be the way to go. I just read the first chapter of Adam's (Lead for WPF at MS) book. Hence the WPF praise fountains :)
null
CC BY-SA 2.5
null
2008-09-01T12:33:26.280
2008-09-01T12:33:26.280
null
null
1,695
null
37,875
2
null
37,732
-1
null
PHP preg functions needs your regex to be wrapped with a delimiter character, which can be any character. You can't use this delimiter character without escaping inside the regex. This should work (here the delimiter character is /): ``` preg_match('/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/', '2008-09-01 12:35:45'); // o...
null
CC BY-SA 3.0
null
2008-09-01T12:33:36.657
2011-07-11T04:38:06.000
2011-07-11T04:38:06.000
1,897
1,897
null
37,884
2
null
37,851
1
null
Try Supervise, which is what qmail uses to keep track of it's services/startup applications: [http://cr.yp.to/daemontools/supervise.html](http://cr.yp.to/daemontools/supervise.html)
null
CC BY-SA 2.5
null
2008-09-01T12:53:37.793
2008-09-01T12:53:37.793
null
null
2,257
null
37,888
2
null
37,882
0
null
If you are in the scenario where you have reordered the columns in the database, and you now want to have this new order be reflected in the designer, I think that you have to delete the table from the designer and then put it in again. Or if you use [SqlMetal](http://msdn.microsoft.com/en-us/library/bb386987.aspx) to ...
null
CC BY-SA 2.5
null
2008-09-01T12:56:44.667
2008-09-01T13:11:12.633
2008-09-01T13:11:12.633
51
51
null
37,883
2
null
37,830
1
null
``` <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300" WindowStyle="None" ResizeMode="NoResize"> <Button HorizontalAlignment="Right" Name="button1" Ver...
null
CC BY-SA 2.5
null
2008-09-01T12:53:20.307
2008-09-01T12:53:20.307
null
null
1,196
null
37,882
1
38,259
null
0
1,511
When designing LINQ classes using the LINQ to SQL designer I've sometimes needed to reorder the classes for the purposes of having the resultant columns in a DataGridView appear in a different order. Unfortunately this seems to be exceedingly difficult; you need to cut and paste properties about, or delete them and re-...
How can you easily reorder columns in LINQ to SQL designer?
CC BY-SA 2.5
null
2008-09-01T12:37:30.500
2016-02-05T16:39:56.363
2008-09-01T14:37:33.627
3,394
3,394
[ "c#", "linq", "linq-to-sql" ]