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
25,592
2
null
22,764
3
null
OK, my joking answer didn't go down so well. [This mailing list question, with answer from Matz](http://www.nabble.com/String-upcase-downcase-with-UTF-8-strings-in-Ruby-1.9-td18372062.html) indicates that Ruby 1.9's built in `String#upcase` and `String#downcase` methods will only handle ASCII characters. Without test...
null
CC BY-SA 2.5
null
2008-08-25T02:47:49.070
2008-08-25T02:47:49.070
null
null
234
null
25,583
2
null
25,552
42
null
I think the best method out there is to implement the [SIGAR API by Hyperic](https://github.com/hyperic/sigar). It works for most of the major operating systems ( darn near anything modern ) and is very easy to work with. The developer(s) are very responsive on their forum and mailing lists. I also like that it is ...
null
CC BY-SA 3.0
null
2008-08-25T02:36:04.963
2017-09-27T19:24:20.887
2017-09-27T19:24:20.887
77,887
828
null
25,597
2
null
25,561
3
null
After reviewing your question and the answers given, I came up with this: ``` RegexOptions options = RegexOptions.None; Regex regex = new Regex(@"([ABCDEFGHJKLMNPQRSTVXYZ0123456789]{8})", options); string input = @"H3Y5NC8E-TGA5B6SB-2NVAQ4E0"; MatchCollection matches = regex.Matches(input); for (int i = 0; i != match...
null
CC BY-SA 2.5
null
2008-08-25T02:53:26.793
2008-08-25T03:51:21.193
2008-08-25T03:51:21.193
1,117
1,117
null
25,596
2
null
25,552
209
null
You can get some limited memory information from the Runtime class. It really isn't exactly what you are looking for, but I thought I would provide it for the sake of completeness. Here is a small example. Edit: You can also get disk usage information from the java.io.File class. The disk space usage stuff requires Jav...
null
CC BY-SA 3.0
null
2008-08-25T02:53:21.287
2014-01-10T19:34:10.053
2014-01-10T19:34:10.053
2,405
2,405
null
25,561
1
25,622
null
3
7,073
I am attempting to parse a string like the following using a .NET regular expression: ``` H3Y5NC8E-TGA5B6SB-2NVAQ4E0 ``` and return the following using Split: H3Y5NC8E TGA5B6SB 2NVAQ4E0 I validate each character against a specific character set (note that the letters 'I', 'O', 'U' & 'W' are absent), so ...
Capturing a repeated group
CC BY-SA 3.0
0
2008-08-25T01:59:45.020
2011-11-19T01:20:58.360
2011-11-19T01:20:58.360
419
2,754
[ "regex", ".net-2.0" ]
25,595
2
null
25,561
0
null
What are the defining characteristics of a valid block? We'd need to know that in order to really be helpful. My generic suggestion, validate the charset in a first step, then split and parse in a seperate method based on what you expect. If this is in a web site/app then you can use the ASP Regex validation on the f...
null
CC BY-SA 2.5
null
2008-08-25T02:51:18.920
2008-08-25T02:51:18.920
null
null
149
null
25,601
2
null
25,561
0
null
If you're just checking the value of the group, with group(i).value, then you will only get the last one. However, if you want to enumerate over all the times that group was captured, use group(2).captures(i).value, as shown below. ``` system.text.RegularExpressions.Regex.Match("H3Y5NC8E-TGA5B6SB-2NVAQ4E0","(([ABCD...
null
CC BY-SA 2.5
null
2008-08-25T02:57:23.727
2008-08-25T02:57:23.727
null
null
1,862
null
25,591
2
null
25,561
0
null
You can use this pattern: ``` Regex.Split("H3Y5NC8E-TGA5B6SB-2NVAQ4E0", "([ABCDEFGHJKLMNPQRSTVXYZ0123456789]{8}+)-?") ``` But you will need to filter out empty strings from resulting array. Citation from [MSDN](http://msdn.microsoft.com/en-us/library/8yttk7sy.aspx): > If multiple matches are adjacent to one another...
null
CC BY-SA 2.5
null
2008-08-25T02:44:24.567
2008-08-25T03:24:05.813
2008-08-25T03:24:05.830
1,196
1,196
null
25,598
2
null
24,451
15
null
`#ifdef TONGUE_IN_CHEEK` Perl has a `goto` that allows you to implement poor-man's tail calls. :-P ``` sub factorial { my ($n, $acc) = (@_, 1); return $acc if $n < 1; @_ = ($n - 1, $acc * $n); goto &factorial; } ``` `#endif` Okay, so that has nothing to do with C's `goto`. More seriously, I agree w...
null
CC BY-SA 2.5
null
2008-08-25T02:53:37.603
2008-08-25T02:53:37.603
null
null
13
null
25,550
1
25,631
null
4
11,370
We get a large amount of data from our clients in pdf files in varying formats [layout-wise], these files are typically report output, and are typically properly annotated [they don't usually need OCR], but not formatted well enough that simply copying several hundred pages of text out of acrobat is not going to work. ...
What's the best way to import/read data from pdf files?
CC BY-SA 2.5
0
2008-08-25T01:49:22.250
2011-01-16T22:13:07.523
null
null
2,775
[ "pdf", "import" ]
25,600
2
null
17,194
2
null
The trick is to do a FULL JOIN, with ISNULL's to get the joined columns from either table. I usually wrap this into a view or derived table, otherwise you need to use ISNULL in the WHERE clause as well. ``` SELECT Program, Month, ThisYearTotalRevenue, PriorYearTotalRevenue FROM ( SELECT I...
null
CC BY-SA 2.5
null
2008-08-25T02:57:03.663
2008-08-25T02:57:03.663
null
null
2,199
null
25,602
2
null
25,561
0
null
Mike, You can use character set of your choice inside character group. All you need is to add "+" modifier to capture all groups. See my previous answer, just change [A-Z0-9] to whatever you need (i.e. [ABCDEFGHJKLMNPQRSTVXYZ0123456789])
null
CC BY-SA 2.5
null
2008-08-25T02:57:40.480
2008-08-25T02:57:40.480
null
null
1,196
null
25,603
2
null
25,396
2
null
I'd guess (since I don't have IIS7 handy ATM) that you'd need to turn off Anonomyous Auth, and enable Forms Auth in the IIS7 sections.
null
CC BY-SA 2.5
null
2008-08-25T02:58:58.027
2008-08-25T02:58:58.027
null
null
2,199
null
25,612
2
null
22,503
0
null
Unless your 2nd dropdown is in a databound control (say, a Repeater) - I'm not sure what you're trying to bind SelectedValue to. Apparently, neither is .NET - since that's probably where the error is occurring. Where's Connect_ToProjectId supposed to come from?
null
CC BY-SA 2.5
null
2008-08-25T03:09:01.967
2008-08-25T03:09:01.967
null
null
2,199
null
25,611
2
null
20,376
1
null
YUI also provides a [profiler](http://developer.yahoo.com/yui/profiler/).
null
CC BY-SA 2.5
null
2008-08-25T03:08:44.727
2008-08-25T03:08:44.727
null
null
1,654
null
25,606
2
null
16,747
26
null
Take a look at the [JQuery Validation plugin](http://bassistance.de/jquery-plugins/jquery-plugin-validation/) this plugin is amazing,it's clean to implement and has all the features you could ever need, including remote validation via AJAX. Also a sample MVC controller method can be found [here](http://httpcode.com/bl...
null
CC BY-SA 2.5
null
2008-08-25T03:04:28.937
2008-08-25T03:04:28.937
null
null
2,758
null
25,617
2
null
696
1
null
Indeed, a webservice seems like a great way to solve the problem. One way to avoid having a completely separate OS for it would be to write the webservice in Java on top of the AS400 tools for Java (which are quite nice, btw). That should at least let you run your service layer on the OpenBSD box as well.
null
CC BY-SA 2.5
null
2008-08-25T03:20:53.200
2008-08-25T03:20:53.200
null
null
1,432
null
25,618
2
null
25,566
0
null
I think that if you do lots of copying then you can get a "reasonable" brute force search (N!) to take N^2 time per case giving N!*N^2
null
CC BY-SA 2.5
null
2008-08-25T03:23:09.280
2008-08-25T03:23:09.280
null
null
1,343
null
25,610
2
null
22,764
1
null
> I would love to see ``` my_proc = λ { |...| ... } x ∈ my_enumerable # same as my_enumerable.include?(x) my_infinite_range = (1..∞) return 'foo' if x ≠ y 2.21 ≈ 2.2 ``` I would love to see someone trying to type that program on an English keyboard :P
null
CC BY-SA 2.5
null
2008-08-25T03:07:52.077
2008-08-25T03:07:52.077
null
null
2,148
null
25,613
2
null
20,675
18
null
And, the most important difference (IME, at least)....is that CInt [overflows at 32,767](http://www.bellaonline.com/articles/art18651.asp).
null
CC BY-SA 2.5
null
2008-08-25T03:11:03.490
2008-08-25T03:11:03.490
null
null
2,199
null
25,628
2
null
25,546
0
null
Have you tried the award-winning [rsyncrypto](http://sourceforge.net/projects/rsyncrypto)?
null
CC BY-SA 2.5
null
2008-08-25T03:41:36.520
2008-08-25T03:41:36.520
null
null
573
null
25,622
2
null
25,561
4
null
I have discovered the answer I was after. Here is my working code: ``` static void Main(string[] args) { string pattern = @"^\s*((?<group>[ABCDEFGHJKLMNPQRSTVXYZ0123456789]{8})-?){3}\s*$"; string input = "H3Y5NC8E-TGA5B6SB-2NVAQ4E0"; Regex re = new Regex(pattern); Match m = re.Match...
null
CC BY-SA 2.5
null
2008-08-25T03:33:47.303
2008-08-25T03:33:47.303
null
null
2,754
null
25,637
1
25,644
null
71
106,167
Is there a way to shutdown a computer using a built-in Java method?
Shutting down a computer
CC BY-SA 3.0
0
2008-08-25T04:01:40.920
2022-08-31T13:44:50.710
2014-06-04T10:15:25.217
1,584,106
2,598
[ "java", "cross-platform", "shutdown" ]
25,631
2
null
25,550
3
null
We use [Xpdf](http://www.foolabs.com/xpdf/about.html) in one of our applications. Its a c++ library which is primarily used for pdf rendering, although it does have a text extractor which could be useful for this project.
null
CC BY-SA 2.5
null
2008-08-25T03:48:40.640
2008-08-25T03:48:40.640
null
null
716
null
25,607
2
null
25,449
16
null
I recommend that you take a close look at [the Java Service Provider (SPI) API](http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html). It provides a simple system for finding all of the classes in all Jars on the classpath that expose themselves as implementing a particular service. I've used it in the ...
null
CC BY-SA 3.0
null
2008-08-25T03:05:00.260
2013-11-26T05:23:09.390
2013-11-26T05:23:09.390
1,102,512
1,432
null
25,627
2
null
25,546
0
null
You could set up shared folders over a secure VPN with [Hamachi](http://www.hamachi.cc), then use a folder syncing app to sync them up.
null
CC BY-SA 2.5
null
2008-08-25T03:41:29.173
2008-08-25T03:41:29.173
null
null
1,384
null
25,630
2
null
24,451
-1
null
Edsger Dijkstra, a computer scientist that had major contributions on the field, was also famous for criticizing the use of GoTo. There's a short article about his argument on [Wikipedia](http://en.wikipedia.org/wiki/Goto).
null
CC BY-SA 2.5
null
2008-08-25T03:44:23.910
2008-08-25T03:44:23.910
null
null
1,328
null
25,605
2
null
25,566
2
null
There's always NeverSort, which is O(∞): ``` def never_sort(array) while(true) end return quicksort(array) end ``` PS: I really want to see your deterministic O(n!) sort; I can't think of any that are O(n!), but have a finite upper bound in classical computation (aka are deterministic). PPS: If you're worried...
null
CC BY-SA 2.5
null
2008-08-25T03:00:59.100
2008-08-25T10:44:42.260
2008-08-25T10:44:42.260
1,190
1,190
null
25,640
2
null
13,938
0
null
I have never used this but maybe it could help.... [http://www.codeplex.com/VS2008UnitTestGUI](http://www.codeplex.com/VS2008UnitTestGUI) "Project Description This project is about running all unit test inside multiple .NET Unit tests assembly coded with Visual Studio 2008."
null
CC BY-SA 2.5
null
2008-08-25T04:03:06.313
2008-08-25T04:03:06.313
null
null
2,786
null
25,650
2
null
25,637
2
null
You can use [JNI](http://en.wikipedia.org/wiki/Java_Native_Interface) to do it in whatever way you'd do it with C/C++.
null
CC BY-SA 2.5
null
2008-08-25T04:17:05.157
2008-08-25T04:17:05.157
null
null
1,693
null
25,648
2
null
25,637
22
null
The quick answer is no. The only way to do it is by invoking the OS-specific commands that will cause the computer to shutdown, assuming your application has the necessary privileges to do it. This is inherently non-portable, so you'd need either to know where your application will run or have different methods for dif...
null
CC BY-SA 2.5
null
2008-08-25T04:14:12.793
2008-08-25T04:14:12.793
null
null
107
null
25,614
1
25,701
null
3
2,537
I've used jdom in the past, and have looked briefly at XOM and `DOM4j`. Each seems to provide essentially the same thing, as they each provide a simplified wrapper over the (very obtuse) standard W3C DOM APIs. I know that JDOM went through some effort to develop a JSR and standardization process at one point, but as...
Which Java DOM Wrapper is the Best or Most Popular?
CC BY-SA 3.0
0
2008-08-25T03:11:58.497
2015-12-18T01:55:09.860
2015-12-18T01:55:09.860
1,997,093
1,432
[ "java", "xml", "dom" ]
25,652
1
25,673
null
2
2,794
I want to programatically create an NSTextView. How can I determine the correct frame height so that the view displays one line of text in the current default font?
Height of NSTextView with one line?
CC BY-SA 2.5
0
2008-08-25T04:19:25.777
2009-09-17T15:01:24.517
null
null
2,140
[ "cocoa", "macos" ]
25,644
2
null
25,637
95
null
Create your own function to execute an OS command through the [command line](http://www.computerhope.com/shutdown.htm)? For the sake of an example. But know where and why you'd want to use this as others note. ``` public static void main(String arg[]) throws IOException{ Runtime runtime = Runtime.getRuntime(); ...
null
CC BY-SA 4.0
null
2008-08-25T04:08:28.970
2021-05-08T02:29:47.657
2021-05-08T02:29:47.657
15,106,272
568
null
25,653
1
25,667
null
14
6,891
Is there any way to apply an attribute to a model file in ASP.NET Dynamic Data to hide the column? For instance, I can currently set the display name of a column like this: ``` [DisplayName("Last name")] public object Last_name { get; set; } ``` Is there a similar way to hide a column? : Many thanks to Christian H...
Hide a column in ASP.NET Dynamic Data
CC BY-SA 2.5
0
2008-08-25T04:21:05.913
2011-04-08T20:40:16.993
2008-09-26T19:01:55.960
2,134
364
[ "asp.net", "dynamic-data" ]
25,642
1
null
null
3
8,275
I want to catch the NavigationService.Navigating event from my Page, to prevent the user from navigating forward. I have an event handler defined thusly: ``` void PreventForwardNavigation(object sender, NavigatingCancelEventArgs e) { if (e.NavigationMode == NavigationMode.Forward) { e.Cancel = true; ...
When is NavigationService initialized?
CC BY-SA 2.5
null
2008-08-25T04:04:48.977
2013-04-26T13:12:26.330
null
null
615
[ ".net", "wpf", "navigation" ]
25,661
1
null
null
9
4,941
What is the best way to use PyGame (SDL) within a PyGTK application? I'm searching for a method that allows me to have a drawing area in the GTK window and at the same time being able to manage both GTK and SDL events.
pyGame within a pyGTK application
CC BY-SA 2.5
0
2008-08-25T04:36:48.980
2013-11-08T13:51:30.673
2008-08-25T08:31:28.477
269
2,772
[ "python", "gtk", "pygtk", "sdl", "pygame" ]
25,665
1
25,689
null
414
437,427
Is there any python module to convert PDF files into text? I tried [one piece of code](http://code.activestate.com/recipes/511465/) found in Activestate which uses pypdf but the text generated had no space between and was of no use.
Python module for converting PDF to text
CC BY-SA 4.0
0
2008-08-25T04:44:06.090
2020-05-18T17:56:23.060
2020-05-18T17:56:23.060
477,771
1,448
[ "python", "pdf", "text-extraction", "pdf-scraping" ]
25,669
2
null
24,901
0
null
An the reason why you ought to use ++i even on built-in types where there's no performance advantage is to create a good habit for yourself.
null
CC BY-SA 2.5
null
2008-08-25T04:52:45.850
2008-08-25T04:52:45.850
null
null
257
null
25,657
2
null
24,886
20
null
Taking a leaf from Scott Meyers, [More Effective c++](https://rads.stackoverflow.com/amzn/click/com/020163371X) . The prefix version is always preferred over the postfix in regards to objects, especially in regards to iterators. The reason for this if you look at the call pattern of the operators. ``` // Prefix Inte...
null
CC BY-SA 2.5
null
2008-08-25T04:29:02.587
2008-08-25T04:29:02.587
null
null
1,675
null
25,667
2
null
25,653
20
null
Had no idea what ASP.NET Dynamic Data was so you promted me to so some research :) Looks like the property you are looking for is ``` [ScaffoldColumn(false)] ``` There is also a similar property for tables ``` [ScaffoldTable(false)] ``` [source](http://davidhayden.com/blog/dave/archive/2008/05/15/DynamicDataWeb...
null
CC BY-SA 2.5
null
2008-08-25T04:47:22.323
2008-08-25T04:47:22.323
null
null
202
null
25,646
1
null
null
3
1,313
The following code writes no data to the back buffer on Intel integrated video cards,for example, on a MacBook. On ATI cards, such as in the iMac, it draws to the back buffer. The width and height are correct (and 800x600 buffer) and m_PixelBuffer is correctly filled with 0xAA00AA00. My best guess so far is that there...
What could prevent OpenGL glDrawPixels from working on some video cards?
CC BY-SA 2.5
null
2008-08-25T04:11:49.803
2008-09-30T18:57:06.860
2008-08-25T20:10:27.020
1,329,401
1,329,401
[ "macos", "opengl", "graphics" ]
25,666
2
null
25,637
84
null
Here's another example that could work cross-platform: ``` public static void shutdown() throws RuntimeException, IOException { String shutdownCommand; String operatingSystem = System.getProperty("os.name"); if ("Linux".equals(operatingSystem) || "Mac OS X".equals(operatingSystem)) { shutdownComman...
null
CC BY-SA 4.0
null
2008-08-25T04:47:04.010
2022-08-31T13:44:50.710
2022-08-31T13:44:50.710
6,947,906
2,783
null
25,672
1
26,725
null
14
20,263
Been going over my predecessor's code and see usage of the "request" scope frequently. What is the appropriate usage of this scope?
ColdFusion - When to use the "request" scope?
CC BY-SA 3.0
0
2008-08-25T04:59:25.180
2015-11-11T12:19:21.000
2013-03-08T14:47:10.533
1,430,996
null
[ "coldfusion", "railo", "cfml" ]
25,663
2
null
24,963
19
null
A classic, albeit a bit dated, book is [Fast Track to MDX](https://rads.stackoverflow.com/amzn/click/com/1846281741). It's a great overview and a quick read, though it doesn't cover the new MDX features of SQL Server 2005. The Spofford book [MDX Solutions](https://rads.stackoverflow.com/amzn/click/com/0471748080) is mo...
null
CC BY-SA 4.0
null
2008-08-25T04:42:46.437
2022-07-21T14:05:33.273
2022-07-21T14:05:33.273
4,751,173
9
null
25,675
1
25,678
null
9
1,883
In coding a traditional MVC application, what is the best practice for coding server-side form validations? Does the code belong in the controller, or the model layer? And why?
MVC - where to implement form validation (server-side)?
CC BY-SA 2.5
0
2008-08-25T05:04:30.923
2008-10-17T21:00:11.603
null
null
null
[ "model-view-controller", "validation", "forms" ]
25,673
2
null
25,652
4
null
The NSFont class has a method that can give you the size of a rectangle that would enclose a specific attributed string. Get the font used by your text view, create a string that serves as a reasonable example of what will be in the text view, and use that to inform your frame height. (The frame height will need to b...
null
CC BY-SA 2.5
null
2008-08-25T05:00:04.977
2008-08-25T05:00:04.977
null
null
714
null
25,679
2
null
6,113
3
null
Just assume that the bad guys WILL get the credentials out of your config file. This means that they'd be able to login to your database and do whatever that user is capable of. So just make sure that user can't do anything bad like access the tables directly. Make that user only capable of executing certain stored ...
null
CC BY-SA 2.5
null
2008-08-25T05:12:51.047
2008-08-25T05:12:51.047
null
null
1,975
null
25,668
2
null
24,886
49
null
A better answer is that `++i` will sometimes be faster but never slower. Everyone seems to be assuming that `i` is a regular built-in type such as `int`. In this case there will be no measurable difference. However if `i` is complex type then you may well find a measurable difference. For `i++` you must make a copy of...
null
CC BY-SA 4.0
null
2008-08-25T04:49:21.710
2021-10-18T08:39:17.860
2021-10-18T08:39:17.860
2,921,691
1,043
null
25,683
2
null
15,414
3
null
I recommend [Damien Guard's "Humane theme" for Visual Studio](http://damieng.com/blog/2007/10/14/colour-schemes-for-visual-studio). It includes a custom font he developed, Envy R, which uses a clever hack - the bold version of the font is actually italic, so his theme italicizes comments by telling Visual Studio to bol...
null
CC BY-SA 3.0
null
2008-08-25T05:15:05.517
2012-03-29T18:51:16.710
2012-03-29T18:51:16.710
1,219,121
5
null
25,678
2
null
25,675
4
null
From Wikipedia: > [Model-view-controller](http://en.wikipedia.org/wiki/Model_View_Controller) (MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic from user interface considerations, resulting in an application where it is easier to modify either the vis...
null
CC BY-SA 2.5
null
2008-08-25T05:09:41.800
2008-10-17T21:00:11.603
null
null
257
null
25,658
2
null
25,461
0
null
Logically, you are not able to share source code between C and C++ with conflicting declarations for bool and have them link to each other. The only way you can share code and link is via an intermediary datastructure. Unfortunately, from what I understand, you can't modify the code that defines the interface between...
null
CC BY-SA 2.5
null
2008-08-25T04:29:45.283
2008-08-25T04:29:45.283
null
null
257
null
25,677
2
null
15,414
1
null
I successfully used [FontForge](http://fontforge.sourceforge.net/) to create a copy of Consolas (although this should work with any font) with the bold style actually being italics. This [other answer of mine](https://stackoverflow.com/a/25676/369) has the details. Basically, change the name and GUID, then open the i...
null
CC BY-SA 3.0
null
2008-08-25T05:08:51.477
2014-07-20T01:33:11.660
2017-05-23T10:27:42.823
-1
369
null
25,698
2
null
25,450
2
null
Also check out [BlueprintCSS](http://code.google.com/p/blueprintcss/), a layout framework in CSS. It doesn't solve all your problems, but many, and you don't have to write the CSS yourself.
null
CC BY-SA 2.5
null
2008-08-25T05:46:00.187
2008-08-25T05:46:00.187
null
null
1,109
null
25,689
2
null
25,665
159
null
Try [PDFMiner](http://www.unixuser.org/~euske/python/pdfminer/index.html). It can extract text from PDF files as HTML, SGML or "Tagged PDF" format. The Tagged PDF format seems to be the cleanest, and stripping out the XML tags leaves just the bare text. A Python 3 version is available under: - [https://github.com/pd...
null
CC BY-SA 4.0
null
2008-08-25T05:21:22.927
2019-06-01T03:12:27.833
2019-06-01T03:12:27.833
7,385,033
2,783
null
25,692
2
null
25,675
4
null
I completely agree with Josh. However you may create a kind of validation layer between Controller and Model so that most of syntactical validations can be carried out on data before it reaches to model. For example, The validation layer would validate the date format, amount format, mandatory fields, etc... So tha...
null
CC BY-SA 2.5
null
2008-08-25T05:27:11.883
2008-10-17T21:00:11.603
null
null
959
null
25,702
2
null
24,648
1
null
Take Mike Stone's advice and start with Minix. That's what Linus did! The textbook is really well written, and Tannenbaum does a great job of showing how the various features are implemented in a real system.
null
CC BY-SA 2.5
null
2008-08-25T05:53:51.650
2008-08-25T05:53:51.650
null
null
116
null
25,694
2
null
25,546
0
null
I use SVN. It works (I think) over SSH and SSL. Full versioning, file syncing, what's not to like?
null
CC BY-SA 2.5
null
2008-08-25T05:30:09.990
2008-08-25T05:30:09.990
null
null
1,343
null
25,701
2
null
25,614
5
null
I like [XOM](http://www.xom.nu/), because I like the way Elliotte Rusty Harold thinks. Of the ones you mention I belive it's the one that strays away from the DOM standard API:s the most, but I consider that a benefit. I once implemented a DOM library for Cocoa, and XOM was my inspiration. I've worked with JDOM as we...
null
CC BY-SA 2.5
null
2008-08-25T05:52:22.433
2008-08-25T05:52:22.433
null
null
1,109
null
25,709
2
null
11
3
null
Surely an easy fix to get rid of the '1 hours ago' problem would be to increase the window that 'an hour ago' is valid for. Change ``` if (delta < 5400) // 90 * 60 { return "an hour ago"; } ``` into ``` if (delta < 7200) // 120 * 60 { return "an hour ago"; } ``` This means that something that occurred 110...
null
CC BY-SA 3.0
null
2008-08-25T06:12:29.623
2018-02-22T16:31:30.680
2018-02-22T16:31:30.680
305,953
1,612
null
25,726
2
null
7,517
1
null
A diferent approach could be: first get rid of the constraints, then drop the tables in a single shot. In other words, a DROP CONSTRAINT for every constraint, then a DROP TABLE for each table; at this point the order of execution shouldn't be an issue.
null
CC BY-SA 2.5
null
2008-08-25T07:18:16.000
2008-08-25T07:18:16.000
null
null
1,178
null
25,676
2
null
17,508
19
null
Alright, I've successfully used FontForge to create a copy of Consolas (although this should work with any font) with the bold style actually being italics. These are the steps that I followed: - [FontForge](http://fontforge.sourceforge.net/)- - - - - - - - - - - - Copy your two new ttf files into your \Windows\FON...
null
CC BY-SA 2.5
null
2008-08-25T05:07:30.903
2008-08-25T05:07:30.903
null
null
369
null
25,728
2
null
25,546
0
null
+1 for Chris's recommendation. This is exactly what I use FolderShare for, keeps folders in sync across 3 PCs running Windows and 2 Macs running OS X.
null
CC BY-SA 2.5
null
2008-08-25T07:28:31.250
2008-08-25T07:28:31.250
null
null
1,554
null
25,721
2
null
25,675
0
null
My experience with MVC thus far consists of entirely rails. Rails does it's validation 100% in the Model. For the most part this works very well. I'd say 9 out of 10 times it's all you need. There are some areas however where what you're submitting from a form doesn't match up with your model properly. There may be s...
null
CC BY-SA 2.5
null
2008-08-25T07:12:10.523
2008-10-17T21:00:11.603
null
null
234
null
25,727
2
null
25,546
0
null
I'd recommend [rdiff-backup](http://www.nongnu.org/rdiff-backup/). It supports incremental backups over SSH and is a free and proven solution. Being incremental, it also allows access to files that were deleted or to older versions of modified files.
null
CC BY-SA 2.5
null
2008-08-25T07:24:03.477
2008-08-25T07:24:03.477
null
null
2,794
null
25,730
1
25,831
null
51
112,635
I have a .exe and many plug-in .dll modules that the .exe loads. (I have source for both.) A cross-platform (with source) solution would be ideal, but the platform can be narrowed to WinXP and Visual Studio (7.1/2003 in my case). The built-in VS leak detector only gives the line where new/malloc was called from, but I...
What is the best free memory leak detector for a C/C++ program and its plug-in DLLs?
CC BY-SA 2.5
0
2008-08-25T07:31:46.110
2020-07-17T14:54:07.893
2009-08-10T08:05:48.533
51,425
2,666
[ "c++", "c", "visual-studio", "memory-leaks" ]
25,736
2
null
25,642
1
null
@Espo your link helped me find the workaround. I call it a workaround because it's , but it's what MS themselves do in their documentation: ``` public MyPage() // ctor { InitializeComponent(); this.Loaded += delegate { NavigationService.Navigating += MyNavHandler; }; this.Unloaded += delegate { NavigationS...
null
CC BY-SA 2.5
null
2008-08-25T07:36:17.020
2008-08-25T07:36:17.020
null
null
615
null
25,741
2
null
7,517
4
null
At the risk of sounding stupid, I don't believe SQL Server supports the delete / cascade syntax. I think you can configure a delete rule to do cascading deletes ([http://msdn.microsoft.com/en-us/library/ms152507.aspx](http://msdn.microsoft.com/en-us/library/ms152507.aspx)), but as far as I know the trick with SQL Serve...
null
CC BY-SA 2.5
null
2008-08-25T07:40:42.033
2008-08-25T07:40:42.033
null
null
5
null
25,747
2
null
25,730
8
null
I have had good experiences with [Rational Purify](http://www.ibm.com/software/awdtools/purify/). I have also heard nice things about Valgrind
null
CC BY-SA 2.5
null
2008-08-25T07:54:46.383
2008-08-25T07:54:46.383
null
null
1,709
null
25,724
2
null
7,517
0
null
The thing holding you back from dropping the tables in any order are foreign key dependencies between the tables. So get rid of the FK's before you start. 1. Using the INFORMATION_SCHEMA system views, retrieve a list of all foreign keys related to any of these tables 2. Drop each of these foreign keys 3. Now you shou...
null
CC BY-SA 2.5
null
2008-08-25T07:15:24.637
2008-08-25T07:15:24.637
null
null
51
null
25,719
2
null
7,517
0
null
I ended up using Apache's [ddlutils](http://db.apache.org/ddlutils/) to perform the dropping for me, which sorted it out in my case, though a solution which worked only within sql server would be quite a bit simpler. @Derek Park, I didn't know you could comma separate tables there, so that's handy, but it doesn't seem...
null
CC BY-SA 2.5
null
2008-08-25T07:08:17.587
2008-08-25T07:08:17.587
null
null
797
null
25,749
1
25,784
null
153
55,539
I'm learning objective-c and keep bumping into the @ symbol. It is used in different scenarios, for example at the start of a string or to synthesise accessor methods. What's does the @ symbol mean in objective-c?
What does the @ symbol represent in objective-c?
CC BY-SA 2.5
0
2008-08-25T07:57:59.183
2022-07-23T16:29:10.920
2008-11-10T16:14:19.757
21,755
2,799
[ "objective-c" ]
25,754
2
null
25,752
2
null
``` &nbsp; ``` Can you try that? Or is it the same?
null
CC BY-SA 3.0
null
2008-08-25T08:03:50.243
2013-02-25T16:15:00.347
2013-02-25T16:15:00.347
1,238,019
1,695
null
25,746
1
25,798
null
61
39,977
I'm learning objective-C and Cocoa and have come across this statement: > The Cocoa frameworks expect that global string constants rather than string literals are used for dictionary keys, notification and exception names, and some method parameters that take strings. I've only worked in higher level languages so hav...
What's the difference between a string constant and a string literal?
CC BY-SA 2.5
0
2008-08-25T07:54:29.080
2016-01-24T17:08:49.300
2010-08-28T22:11:41.010
379,897
2,799
[ "objective-c", "string" ]
25,752
1
25,758
null
33
85,281
In a drop down list, I need to add spaces in front of the options in the list. I am trying ``` <select> <option>&#32;&#32;Sample</option> </select> ``` for adding two spaces but it displays no spaces. How can I add spaces before option texts?
How do I put a space character before option text in a HTML select element?
CC BY-SA 2.5
0
2008-08-25T08:02:43.367
2019-08-08T14:23:47.310
2008-08-25T11:27:02.893
1
31,505
[ "html", "html-select" ]
25,760
2
null
20,233
0
null
I've found quite a sufficient compressed audio playback library [FMOD](http://www.fmod.org/). There are WM version of it. And I've found sample application on [CodeProject](http://www.codeproject.com/KB/mobile/simple_mp3_player_for_ppc.aspx) to start with.
null
CC BY-SA 2.5
null
2008-08-25T08:08:26.380
2008-08-25T08:08:26.380
null
null
2,313
null
25,761
2
null
25,661
1
null
You may be interested in [this message thread](http://www.daa.com.au/pipermail/pygtk/2006-September/012888.html). Looks like they recommend against it.
null
CC BY-SA 2.5
null
2008-08-25T08:08:46.253
2008-08-25T08:08:46.253
null
null
1,662
null
25,755
2
null
25,749
69
null
From [Objective-C Tutorial: The @ Symbol](http://guides.macrumors.com/Objective-C_Tutorial#The_.40_symbol), the reason it is on the front of various keywords: > Using @ should make it easier to bolt an Objective-C compiler on to an existing C compiler. Because the @ isn't valid in any context in C except a string lite...
null
CC BY-SA 2.5
null
2008-08-25T08:04:44.843
2008-08-25T08:10:15.597
2008-08-25T08:10:15.597
163
163
null
25,763
2
null
23,472
0
null
These links are not AS/400 specific, but generally a good place starting with Oracle: [http://tahiti.oracle.com](http://tahiti.oracle.com) [http://asktom.oracle.com](http://asktom.oracle.com)
null
CC BY-SA 2.5
null
2008-08-25T08:11:01.693
2008-08-25T08:11:01.693
null
null
1,069
null
25,750
2
null
25,746
3
null
Let's use C++, since my Objective C is totally non-existent. If you stash a string into a constant variable: ``` const std::string mystring = "my string"; ``` Now when you call methods, you use my_string, you're using a string constant: ``` someMethod(mystring); ``` Or, you can call those methods with the string...
null
CC BY-SA 2.5
null
2008-08-25T07:59:28.977
2008-08-25T08:16:25.707
2008-08-25T08:16:25.707
1,554
1,554
null
25,765
1
25,768
null
76
30,663
I'm in the process of weeding out all hardcoded values in a Java library and was wondering what framework would be the best (in terms of zero- or close-to-zero configuration) to handle run-time configuration? I would prefer XML-based configuration files, but it's not essential. Please do only reply if you have practi...
Java configuration framework
CC BY-SA 2.5
0
2008-08-25T08:17:54.297
2015-05-06T18:00:22.020
2010-12-21T10:26:03.277
63,550
1,448,983
[ "java", "xml", "configuration", "frameworks", "configurationmanager" ]
25,770
2
null
25,767
0
null
OK, this doesn't answer your question, but doesn't your current code leave you open to SQL Injection? I could be wrong, never worked in PHP, just saw the use of strings in the SQL and alarm bells started ringing! ### Edit: I am not trying to tamper with your post, I was correcting a spelling error, please do not rol...
null
CC BY-SA 2.5
null
2008-08-25T08:27:37.957
2008-08-25T08:27:37.957
2020-06-20T09:12:55.060
-1
832
null
25,772
2
null
14,330
5
null
As mentioned also, a grayscale translation (note that monochromatic images need not to be in grayscale) from an RGB-triplet is subject to taste. For example, you could cheat, extract only the blue component, by simply throwing the red and green components away, and copying the blue value in their stead. Another simpl...
null
CC BY-SA 2.5
null
2008-08-25T08:30:01.367
2008-08-25T08:30:01.367
null
null
2,238
null
25,759
2
null
25,752
15
null
I think you want `&nbsp;` or `&#160;` So a fixed version of your example could be... ``` <select> <option>&nbsp;&nbsp;Sample</option> </select> ``` or ``` <select> <option>&#160;&#160;Sample</option> </select> ```
null
CC BY-SA 2.5
null
2008-08-25T08:06:27.507
2008-08-25T08:14:09.377
2008-08-25T08:14:09.377
797
797
null
25,767
1
25,805
null
3
3,274
What is the quickest way to get a large amount of data (think golf) and the most efficient (think performance) to get a large amount of data from a MySQL database to a session without having to continue doing what I already have: ``` $sql = "SELECT * FROM users WHERE username='" . mysql_escape_string($_POST['username'...
Most efficient way to get data from the database to session
CC BY-SA 2.5
0
2008-08-25T08:23:14.957
2016-01-15T15:26:29.040
2008-08-31T01:07:20.947
305
115
[ "php", "mysql", "session" ]
25,768
2
null
25,765
29
null
If your hardcoded values are just simple key-value pairs, you should look at [java.util.Properties](http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html). It's a lot simpler than xml, easier to use, and mind-numbingly trivial to implement. If you are working with Java and the data you are storing or retr...
null
CC BY-SA 2.5
null
2008-08-25T08:23:22.227
2008-08-25T08:23:22.227
null
null
122
null
25,771
1
null
null
19
18,250
How can I insert compilation timestamp information into an executable I build with Visual C++ 2005? I want to be able to output something like this when I execute the program: > This build XXXX was compiled at dd-mm-yy, hh:mm. where date and time reflect the time when the project was built. They should not change wit...
Output compile time stamp in Visual C++ executable?
CC BY-SA 2.5
0
2008-08-25T08:28:19.890
2017-09-15T05:31:50.743
2012-09-01T22:58:41.280
1,561,378
null
[ "c++", "visual-c++", "execution", "compile-time" ]
25,780
2
null
25,771
10
null
``` __DATE__ __TIME__ ``` are predefined as part of the standards for C99 so should be available to you. They run once with the preprocessor.
null
CC BY-SA 2.5
null
2008-08-25T08:34:17.707
2008-08-25T08:39:21.143
2008-08-25T08:39:21.143
269
269
null
25,758
2
null
25,752
31
null
Isn't `&#160` the entity for space? ``` <select> <option>&#160;option 1</option> <option> option 2</option> </select> ``` Works for me... ### EDIT: Just checked this out, there be compatibility issues with this in older browsers, but all seems to work fine for me here. Just thought I should let you know as you ...
null
CC BY-SA 3.0
null
2008-08-25T08:06:18.490
2016-06-01T18:30:37.653
2020-06-20T09:12:55.060
-1
832
null
25,775
2
null
25,767
0
null
I am not sure what you mean by "large amounts of data", but it looks to me like you are only initializing data for one user? If so, I don't see any reason to optimize this unless you have hundreds of columns in your database with several megabytes of data in them. Or, to put it differently, why do you need to optimize...
null
CC BY-SA 2.5
null
2008-08-25T08:30:56.717
2008-08-25T08:30:56.717
null
null
1,709
null
25,782
2
null
25,767
0
null
> Try using json for example:``` $_SESSION['data'] = json_encode(mysql_fetch_array($result)); ``` Is the implementation of that function faster than what he is already doing? > Yes, it's bugged.
null
CC BY-SA 2.5
null
2008-08-25T08:35:34.757
2008-08-25T08:35:34.757
null
null
1,709
null
25,781
2
null
25,767
0
null
@Unkwntech Looks like you are correct, but following a Google, which led [here](http://shiflett.org/articles/sql-injection) looks like you may want to change to As for the edit, I corrected the spelling of as well as removed the "what is the".. Since that's not really required since the topic says it all. You can r...
null
CC BY-SA 2.5
null
2008-08-25T08:35:08.453
2008-08-25T08:35:08.453
2017-05-23T12:08:35.993
-1
832
null
25,787
2
null
25,767
0
null
> Again, unless this is actually causing performance problems in your application I would not bother with optimizing it. If, however, performance is a problem I would consider only getting some of the data initially and lazy-loading the other columns as they are needed.
null
CC BY-SA 2.5
null
2008-08-25T08:38:20.223
2008-08-25T08:38:20.223
null
null
1,709
null
25,785
1
34,862,475
null
200
148,616
Is there a simple way, in a pretty standard UNIX environment with bash, to run a command to delete all but the most recent X files from a directory? To give a bit more of a concrete example, imagine some cron job writing out a file (say, a log file or a tar-ed up backup) to a directory every hour. I'd like a way to ha...
Delete all but the most recent X files in bash
CC BY-SA 2.5
0
2008-08-25T08:37:03.287
2023-01-10T15:43:15.550
null
null
797
[ "bash", "unix", "scripting" ]
25,790
2
null
25,785
89
null
``` (ls -t|head -n 5;ls)|sort|uniq -u|xargs rm ``` This version supports names with spaces: ``` (ls -t|head -n 5;ls)|sort|uniq -u|sed -e 's,.*,"&",g'|xargs rm ```
null
CC BY-SA 3.0
null
2008-08-25T08:42:05.487
2014-05-19T06:10:00.270
2014-05-19T06:10:00.270
263,268
163
null
25,789
2
null
25,785
119
null
Remove all but 5 (or whatever number) of the most recent files in a directory. ``` rm `ls -t | awk 'NR>5'` ```
null
CC BY-SA 2.5
null
2008-08-25T08:41:24.227
2008-08-25T08:41:24.227
null
null
2,257
null
25,793
2
null
1,323
3
null
N maximally distant colors can be considered a set of well-distributed points in a 3-dimensional (color) space. If you can generate them from a [Halton sequence](http://en.wikipedia.org/wiki/Halton_sequence), then any prefix (the first M colors) also consists of well-distributed points.
null
CC BY-SA 2.5
null
2008-08-25T08:44:06.310
2008-08-25T08:44:06.310
null
null
2,686
null
25,776
2
null
25,767
0
null
Try using json for example: ``` $_SESSION['data'] = json_encode(mysql_fetch_array($result)); ``` Later you then `json_decode` the `$_SESSION['data']` variable and you got an array with all the data you need. You can use `json_encode` and `json_decode` if you want to reduce the number of lines of code you write. ...
null
CC BY-SA 3.0
null
2008-08-25T08:31:26.700
2016-01-15T15:26:29.040
2016-01-15T15:26:29.040
4,932,070
1,585
null
25,802
2
null
25,771
0
null
Visual C++ also supports `__TIMESTAMP__` which is almost exactly what you need. That being said, the tough part about build timestamps is keeping them up to date, that means compiling the file in which `__TIMESTAMP__` is used on every rebuild. Not sure if there's a way to set this up in Visual C++ though.
null
CC BY-SA 2.5
null
2008-08-25T08:59:08.990
2008-08-25T08:59:08.990
null
null
2,594
null
25,794
1
null
null
439
498,998
Without local access to the server, is there any way to duplicate/clone a MySQL db (with content and without content) into another without using `mysqldump`? I am currently using MySQL 4.0.
Copy/duplicate database without using mysqldump
CC BY-SA 3.0
0
2008-08-25T08:47:27.160
2020-03-20T01:11:53.523
2016-12-21T06:40:19.577
652,669
211
[ "mysql" ]