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
28,127
2
null
26,301
10
null
Huffman coding would be mine, I had originally made my own dumb version by minimizing the number of bits to encode text from 8 down to less, but had not thought about variable number of bits depending on frequency. Then I found the huffman coding described in an article in a magazine and it opened up lots of new possib...
null
CC BY-SA 2.5
null
2008-08-26T14:09:10.700
2008-08-26T14:09:10.700
null
null
267
null
28,112
2
null
28,051
1
null
The biggest problem I've noticed with controls in ASP.Net is that you can't easily get designer support for both building the control using the control in a site once you built it. The only way I've been able to do that is create an .ascx control with no code-behind (ie: all the server-side code is in a script tag i...
null
CC BY-SA 2.5
null
2008-08-26T14:02:31.903
2008-08-26T14:02:31.903
null
null
3,043
null
28,124
1
28,130
null
11
3,469
We would like to have user defined formulas in our c++ program. e.g. The value . Later in the program the user would define x,y and z -> the program should return the result of the calculation. Somewhen later the formula may get changed, so the next time the program should parse the formula and add the new values. An...
calculating user defined formulas (with c++)
CC BY-SA 2.5
0
2008-08-26T14:07:18.897
2019-08-01T17:43:34.667
null
null
3,056
[ "c++" ]
28,130
2
null
28,124
2
null
If it will be used frequently and if it will be extended in the future, I would almost recommend adding either Python or Lua into your code. [Lua](http://www.lua.org/) is a very lightweight scripting language which you can hook into and provide new functions, operators etc. If you want to do more robust and complicated...
null
CC BY-SA 4.0
null
2008-08-26T14:10:53.130
2019-08-01T17:43:34.667
2019-08-01T17:43:34.667
-1
2,973
null
28,105
2
null
27,258
1
null
Since you are using only ASP.NET 2.0 I would recommend [AjaxPro](http://www.ajaxpro.info/) will which create the .ashx file. All you have to do is to pull the AjaxPro.dll into your web site. I developed an entire application with [AjaxPro](http://www.ajaxpro.info/) and found it worked very well. It uses serializatio...
null
CC BY-SA 2.5
null
2008-08-26T13:59:54.700
2008-08-26T13:59:54.700
null
null
2,469
null
28,134
2
null
28,124
0
null
There's generally two ways of doing it, with three possible implementations: 1. as you've touched on yourself, a library to evaluate formulas 2. compiling the formula into code The second option here is usually done either by compiling something that can be loaded in as a kind of plugin, or it can be compiled into...
null
CC BY-SA 2.5
null
2008-08-26T14:12:11.537
2008-08-26T14:12:11.537
null
null
267
null
28,131
2
null
28,098
311
null
This is done with typecasting: ``` $strvar = (string) $var; // Casts to string echo $var; // Will cast to string implicitly var_dump($var); // Will show the true type of the variable ``` In a class you can define what is output by using the magical method [__toString](http://www.php.net/manual/en/language.oop5.magic...
null
CC BY-SA 3.0
null
2008-08-26T14:11:01.197
2011-12-04T00:17:10.270
2011-12-04T00:17:10.270
2,025
2,025
null
28,113
2
null
26,301
1
null
> The iterative algorithm for Fibonacci, because for me it nailed down the fact that the most elegant code (in this case, the recursive version) is not necessarily the most efficient.The iterative method, (curr = prev1 + prev2 in a forloop) does not tree out this way, nor does it take as much memory since it's only 3 t...
null
CC BY-SA 2.5
null
2008-08-26T14:02:56.113
2008-08-26T14:02:56.113
2020-06-20T09:12:55.060
-1
2,131
null
28,135
2
null
28,110
0
null
I would suggest cleaning up the mess and changing the column to a datetime because doing stuff like this ``` WHERE datediff(dd, convert(datetime, lastUpdate), getDate()) < 31 ``` cannot use an index and it will be many times slower than if you had a datetime colum,n and did ``` where lastUpdate > getDate() -31 ``` ...
null
CC BY-SA 2.5
null
2008-08-26T14:12:26.980
2011-08-28T09:41:25.297
2011-08-28T09:41:25.297
53,114
740
null
28,139
2
null
28,110
0
null
In your convert call, you need to specify a third style parameter, e.g., the format of the datetimes that are stored as varchar, as specified in this document: [CAST and CONVERT (T-SQL)](http://doc.ddart.net/mssql/sql70/ca-co_1.htm)
null
CC BY-SA 2.5
null
2008-08-26T14:13:25.277
2008-08-26T14:13:25.277
null
null
372
null
28,137
2
null
28,124
0
null
If you want to write your own, search for "formal automata" and/or "finite state machine grammar" In general what you will do is parse the string, pushing characters on a stack as you go. Then start popping the characters off and perform tasks based on what is popped. It's easier to code if you force equations to re...
null
CC BY-SA 2.5
null
2008-08-26T14:12:36.387
2008-08-26T14:12:36.387
null
null
1,097
null
28,138
2
null
26,301
3
null
For some reason I like the [Schwartzian transform](http://en.wikipedia.org/wiki/Schwartzian_transform) ``` @sorted = map { $_->[0] } sort { $a->[1] cmp $b->[1] } map { [$_, foo($_)] } @unsorted; ``` Where foo($ (each item of the list in turn) and produces the corresponding value...
null
CC BY-SA 2.5
null
2008-08-26T14:13:13.187
2008-08-26T14:13:13.187
null
null
238
null
28,132
2
null
27,774
2
null
I'm afraid I think the answer is no. From the help text on [http://docs.google.com/support/spreadsheets/bin/answer.py?answer=71291&query=arrayformula&topic=&type=](http://docs.google.com/support/spreadsheets/bin/answer.py?answer=71291&query=arrayformula&topic=&type=) > The real power of ARRAYFORMULA comes when you tak...
null
CC BY-SA 2.5
null
2008-08-26T14:11:18.933
2008-08-26T14:11:18.933
null
null
2,983
null
28,145
2
null
26,301
4
null
Quicksort in Haskell: ``` qsort [] = [] qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++ qsort (filter (>= x) xs) ``` Although I couldn'd write Haskell at the time, I did understand this code and with it recursion and the quicksort algorithm. It just made click and there it was...
null
CC BY-SA 2.5
null
2008-08-26T14:14:04.760
2008-08-26T14:14:04.760
null
null
2,450
null
28,129
2
null
28,124
0
null
Using [Spirit](http://spirit.sourceforge.net/) (for example) to parse (and the 'semantic actions' it provides to construct an expression tree that you can then manipulate, e.g., evaluate) seems like quite a simple solution. You can find a grammar for arithmetic expressions [there](http://www.cs.sunysb.edu/~warren/xsbbo...
null
CC BY-SA 2.5
null
2008-08-26T14:10:51.557
2008-08-26T14:10:51.557
null
null
2,638
null
28,146
2
null
28,110
0
null
Print out the records. Give the hardcopy to the idiot who decided to use a varchar(50) and ask them to find the problem record. Next time they might just see the point of choosing an appropriate data type.
null
CC BY-SA 2.5
null
2008-08-26T14:14:09.737
2008-08-26T14:14:09.737
null
null
2,084
null
28,148
2
null
28,011
1
null
If you only need dates (no times), the [Date](http://ruby-doc.org/stdlib-2.2.3/libdoc/date/rdoc/Date.html) class in ruby should handle dates before 1970. But it has only a resolution of days. I don't know if there are solutions, if you also need times before 1970 [(source)](http://safari.ibmpressbooks.com/0768667208/ch...
null
CC BY-SA 3.0
null
2008-08-26T14:14:26.943
2015-10-08T07:34:29.363
2015-10-08T07:34:29.363
67,579
1,870
null
28,153
2
null
28,150
0
null
This is all starting to sound a bit like [Yesterday's TDWTF](http://thedailywtf.com/Articles/SUSBSTITUTE_CODE.aspx). :-)
null
CC BY-SA 2.5
null
2008-08-26T14:16:26.363
2008-08-26T14:16:26.363
null
null
2,025
null
28,147
1
28,170
null
13
2,665
What do you think the future of GPU as a CPU initiatives like CUDA are? Do you think they are going to become mainstream and be the next adopted fad in the industry? Apple is building a new framework for using the GPU to do CPU tasks and there has been alot of success in the Nvidias CUDA project in the sciences. Would ...
Feasibility of GPU as a CPU?
CC BY-SA 3.0
0
2008-08-26T14:14:10.893
2014-12-09T02:16:29.613
2014-12-09T02:16:29.613
4,157,408
2,501
[ "cuda", "cpu", "gpu", "gpgpu" ]
28,152
2
null
28,098
18
null
For primitives just use `(string)$var` or print this variable straight away. PHP is dynamically typed language and variable will be casted to string on the fly. If you want to convert objects to strings you will need to define `__toString()` method that returns string. This method is forbidden to throw exceptions.
null
CC BY-SA 2.5
null
2008-08-26T14:15:46.787
2008-08-26T14:15:46.787
null
null
2,169
null
28,108
2
null
28,098
34
null
> How do I convert the value of a PHP variable to string? A value can be converted to a string using the [(string) cast](http://us3.php.net/manual/en/language.types.string.php#language.types.string.casting) or the [strval()](http://ca.php.net/strval) function. (Edit: As [Thomas](https://stackoverflow.com/users/2314/...
null
CC BY-SA 2.5
null
2008-08-26T14:00:48.460
2008-08-26T14:06:07.433
2017-05-23T10:31:31.273
-1
2,134
null
28,159
2
null
28,124
1
null
You can represent your formula as a tree of operations and sub-expressions. You may want to define types or constants for Operation types and Variables. You can then easily enough write a method that recurses through the tree, applying the appropriate operations to whatever values you pass in.
null
CC BY-SA 2.5
null
2008-08-26T14:17:51.180
2008-08-26T14:17:51.180
null
null
3,044
null
28,154
2
null
7,779
3
null
I've been doing Eclipse RCP development for almost 2 years now. When I first started, I wanted a book for help and many people told me, with Eclipse you're better off using the [Eclipsepedia](http://wiki.eclipse.org/index.php/Rich_Client_Platform) and Google. However, I started with "[The Java Developer's Guide to Ec...
null
CC BY-SA 2.5
null
2008-08-26T14:17:10.447
2008-08-26T14:17:10.447
null
null
3,033
null
28,162
2
null
28,110
0
null
The problem is most likely how the data is stored, there are only two safe formats ISO YYYYMMDD ISO 8601 yyyy-mm-dd Thh:mm:ss:mmm(no spaces) these will work no matter what your language is. You might need to do a SET DATEFORMAT YMD (or whatever the data is stored as) to make it work
null
CC BY-SA 2.5
null
2008-08-26T14:20:01.563
2008-08-26T14:20:01.563
null
null
740
null
28,161
2
null
28,150
3
null
If you consider a warning (which is what [Obsolete] throws up) build-breaking, then just use the [#warning](http://msdn.microsoft.com/en-us/library/963th5x3.aspx) compiler directive. Edit: I've never used it, but [#error](http://msdn.microsoft.com/en-us/library/x5hedts0.aspx) is also available.
null
CC BY-SA 2.5
null
2008-08-26T14:19:36.260
2008-08-26T14:25:41.847
2008-08-26T14:25:41.863
2,314
2,314
null
28,160
1
28,215
null
89
95,771
For whatever reason, our company has a coding guideline that states: `Each class shall have it's own header and implementation file.` So if we wrote a class called `MyString` we would need an associated and . Does anyone else do this? Has anyone seen any compiling performance repercussions as a result? Does 5000 ...
Multiple classes in a header file vs. a single header file per class
CC BY-SA 3.0
0
2008-08-26T14:19:34.967
2022-07-10T14:07:20.510
2012-04-26T01:14:46.407
1,332,690
1,881
[ "c++", "performance", "file-organization" ]
28,166
2
null
28,147
2
null
I think it's the right way to go. Considering that [GPUs have been tapped to create cheap supercomputers](http://www.geek.com/researchers-create-a-playstation-2-based-supercomputer/), it appears to be the natural evolution of things. With so much computing power and R&D already done for you, why not exploit the avail...
null
CC BY-SA 2.5
null
2008-08-26T14:20:51.500
2008-08-26T14:20:51.500
null
null
372
null
28,150
1
28,220
null
8
3,539
OK, this kind of follows on from [my previous question](https://stackoverflow.com/questions/27758/notify-developer-of-a-do-not-use-method). What I would really like to do is create some sort of attribute which allows me to decorate a method that will . Much like the attribute, but without falsely identifying obsolete...
Create an Attribute to Break the Build
CC BY-SA 2.5
null
2008-08-26T14:15:08.393
2012-08-08T03:00:43.833
2017-05-23T12:13:34.533
-1
832
[ ".net", "attributes" ]
28,170
2
null
28,147
5
null
First of all I don't think this questions really belongs on SO. In my opinion the GPU is a very interesting alternative whenever you do vector-based float mathematics. However this translates to: It will not become mainstream. Most mainstream (Desktop) applications do very few floating-point calculations. It has alre...
null
CC BY-SA 2.5
null
2008-08-26T14:22:02.963
2010-09-24T01:18:51.363
2010-09-24T01:18:51.363
38,765
1,870
null
28,142
2
null
28,051
1
null
I managed to do this by sacrificing some of the ease of building the controls in the first place. You can create a Control Library project that will generate a control library DLL for you. The drawback is that you have to create the controls with code only. In my last project, this was fine. In more complicated contro...
null
CC BY-SA 2.5
null
2008-08-26T14:13:52.843
2008-08-26T14:13:52.843
null
null
106
null
28,171
1
28,193
null
63
32,097
If I open a solution in Visual Studio 2008 and run a unit test then VS creates a new .vsmdi file in the Solution Items folder and gives it the next number available e.g. My Solution2.vsmdi. Any idea why VS is doing this and how I can get it to stop doing this?
Why does Visual Studio create a new .vsmdi file?
CC BY-SA 2.5
0
2008-08-26T14:22:42.713
2012-07-10T00:13:02.607
2012-06-29T17:29:13.283
182,371
1,463
[ "visual-studio-2010", "visual-studio", "visual-studio-2008", "mstest" ]
28,173
2
null
28,160
12
null
We do that at work, its just easier to find stuff if the class and files have the same name. As for performance, you really shouldn't have 5000 classes in a single project. If you do, some refactoring might be in order. That said, there are instances when we have multiple classes in one file. And that is when it's jus...
null
CC BY-SA 2.5
null
2008-08-26T14:23:12.040
2008-08-26T14:23:12.040
null
null
2,957
null
28,172
2
null
28,124
0
null
To make your life easier, I think getting this kind of input is best done through a GUI where users are restricted in what they can type in. If you plan on doing it from the command line (that is the impression I get from your post), then you should probably define a strict set of allowable inputs (e.g. only single l...
null
CC BY-SA 2.5
null
2008-08-26T14:22:55.287
2008-08-26T14:22:55.287
null
null
142
null
28,168
2
null
26,354
1
null
Thank you all for your thoughts. Printing directly to the serial port is likely the most flexible method. In this case we didn't want to replicate all of the work that was already built into the Intermec dll for handling the port, printer errors, etc. We were able to get this working by sending the printer the appropri...
null
CC BY-SA 2.5
null
2008-08-26T14:21:16.973
2008-08-26T14:21:16.973
null
null
620,435
null
28,176
2
null
28,110
1
null
How about writing a cursor to loop through the contents, attempting the cast for each entry? When an error occurs, output the primary key or other identifying details for the problem record. I can't think of a set-based way to do this. - ah yes, I forgot about ISDATE(). Definitely a better approach than using a cur...
null
CC BY-SA 2.5
null
2008-08-26T14:24:18.870
2008-08-26T14:35:07.877
2008-08-26T14:35:07.877
2,084
2,084
null
28,165
1
28,247
null
13
2,744
Python has this wonderful way of handling string substitutions using dictionaries: ``` >>> 'The %(site)s site %(adj)s because it %(adj)s' % {'site':'Stackoverflow', 'adj':'rocks'} 'The Stackoverflow site rocks because it rocks' ``` I love this because you can specify a value once in the dictionary and then replace i...
Does PHP have an equivalent to this type of Python string substitution?
CC BY-SA 3.0
0
2008-08-26T14:20:48.910
2012-10-29T21:02:13.727
2012-10-29T21:02:13.727
321,731
305
[ "php", "python", "string" ]
28,174
2
null
27,952
9
null
If you're looking to be more generic about the paths embedded in a pdb file, you could first use the MS-DOS `subst` command to map a particular folder to a drive letter. ``` subst N: <MyRealPath> ``` Then open your project relative to the N: drive and rebuild it. Your PDB files will reference the source files on N:...
null
CC BY-SA 2.5
null
2008-08-26T14:23:54.753
2008-08-26T14:23:54.753
null
null
863
null
28,186
2
null
28,110
0
null
> Wouldn't the isdate() check take care of this? Run this to see what happens ``` select isdate('20080131') select isdate('01312008') ```
null
CC BY-SA 2.5
null
2008-08-26T14:27:31.343
2008-08-26T14:27:31.343
null
null
740
null
28,181
2
null
28,160
4
null
It's common practice to do this, especially to be able to include .h in the files that need it. Of course the performance is affected but try not to think about this problem until it arises :). It's better to start with the files separated and after that try to merge the .h's that are commonly used together to improve ...
null
CC BY-SA 2.5
null
2008-08-26T14:25:31.287
2008-08-26T14:25:31.287
null
null
1,065
null
28,192
2
null
28,171
0
null
An [old post but](http://blogs.vertigosoftware.com/teamsystem/archive/2006/06/23/Beware_the_Team_Test_VSMDI_file.aspx) vsmdi is a meta data file created by the test system.
null
CC BY-SA 2.5
null
2008-08-26T14:28:09.750
2008-08-26T14:28:09.750
null
null
1,075
null
28,191
2
null
28,150
-2
null
Why not just make something up? An unknown attribute would surely break the build. ``` [MyMadeUpAttributeThatBreaksTheBuildForSure] public class NotDoneYet {} ```
null
CC BY-SA 2.5
null
2008-08-26T14:28:08.580
2008-08-26T14:28:08.580
null
null
35
null
28,187
2
null
28,092
0
null
You could create a user control (.ascx) to house the listbox. Then add a public event for the page. ``` Public Event btnRemove() ``` Then on the button click event in the usercontrol ``` RaiseEvent btnRemove() ``` You can also pass objects through the event just like any other method. This will allow your user co...
null
CC BY-SA 2.5
null
2008-08-26T14:27:40.517
2008-08-26T14:27:40.517
null
null
777
null
28,194
2
null
28,160
12
null
+1 for separation. I just came onto a project where some classes are in files with a different name, or lumped in with another class, and it is impossible to find these in a quick and efficient manner. You can throw more resources at a build - you can't make up lost programmer time because (s)he can't find the right ...
null
CC BY-SA 2.5
null
2008-08-26T14:28:28.050
2008-08-26T14:28:28.050
null
null
96
null
28,184
2
null
28,110
9
null
Place the `CASE` and `ISDATE` inside the `CONVERT()` function. ``` SELECT COUNT(*) FROM MyTable WHERE DATEDIFF(dd, CONVERT(DATETIME, CASE IsDate(lastUpdate) WHEN 1 THEN lastUpdate ELSE '12-30-1899' END), GetDate()) < 31 ``` Replace `'12-30-1899'` with the default date of your choice.
null
CC BY-SA 4.0
null
2008-08-26T14:27:08.053
2018-08-26T10:48:32.057
2018-08-26T10:48:32.057
1,630,171
3,067
null
28,193
2
null
28,171
30
null
It appears that the [VSMDI problem is a known bug and has been around since VS2005 Team System](http://web.archive.org/web/20080302162715/http://blogs.vertigosoftware.com/teamsystem/archive/2006/06/23/Beware_the_Team_Test_VSMDI_file.aspx) but it has no clear fix as yet. Another reason to NOT use MS Test. An MSDN blog ...
null
CC BY-SA 3.0
null
2008-08-26T14:28:15.537
2012-07-10T00:13:02.607
2012-07-10T00:13:02.607
85,661
372
null
28,199
2
null
28,165
1
null
Some of the user-contributed notes and functions in [PHP's documentation for sprintf](http://us3.php.net/sprintf) come quite close. Note: search the page for "sprintf2".
null
CC BY-SA 2.5
null
2008-08-26T14:30:17.437
2008-08-26T14:30:17.437
null
null
2,314
null
28,200
2
null
28,197
4
null
For the PSP, I have seen the [Software Process Dashboard](http://processdash.sourceforge.net/), but it seems awfully difficult to use.
null
CC BY-SA 2.5
null
2008-08-26T14:30:36.547
2008-08-26T14:30:36.547
null
null
572
null
28,198
2
null
28,160
1
null
The same rule applies here, but it notes a few exceptions where it is allowed Like so: - - -
null
CC BY-SA 2.5
null
2008-08-26T14:30:11.557
2008-08-26T14:30:11.557
null
null
1,830
null
28,197
1
106,682
null
15
4,287
For more information - [Personal Software Process on Wikipedia](http://en.wikipedia.org/wiki/Personal_Software_Process) and [Team Software Process on Wikipedia](http://en.wikipedia.org/wiki/Team_Software_Process). I have two questions: 1. What benefits have you seen from these processes? 2. What tools and/or methods...
Do you follow the Personal Software Process? Does your organization/team follow the Team Software Process?
CC BY-SA 2.5
0
2008-08-26T14:29:56.143
2014-05-02T04:21:23.613
2014-05-02T04:21:23.613
321,731
572
[ "process", "personal-software-process" ]
28,196
1
30,733
null
10
7,529
This is a very specific question regarding as implemented in . I'm trying to develop a plugin that will show (select) posts that have specific '' and belong to specific '' (both multiple) I was told it's impossible because of the way categories and tags are stored: 1. wp_posts contains a list of posts, each post have...
How to select posts with specific tags/categories in WordPress
CC BY-SA 4.0
0
2008-08-26T14:29:38.093
2021-07-28T18:38:03.760
2021-07-28T18:38:03.760
13,176,802
1,011
[ "php", "mysql", "sql", "wordpress", "plugins" ]
28,202
1
28,448
null
7
7,021
Every time I create a new project I copy the last project's ant file to the new one and make the appropriate changes (trying at the same time to make it more flexible for the next project). But since I didn't really thought about it at the beginning, the file started to look really ugly. Do you have an Ant template th...
Best Apache Ant Template
CC BY-SA 2.5
0
2008-08-26T14:31:28.777
2011-01-26T00:39:49.010
2010-08-03T00:50:19.300
18,196
2,644
[ "java", "ant" ]
28,210
2
null
28,150
0
null
I will have to agree with Greg: make up an attribute for it. And if you're really serious, maybe find a way to figure out if the constructor is being accessed by anything other than XMLSerializer and throw an exception if it is.
null
CC BY-SA 2.5
null
2008-08-26T14:32:44.450
2008-08-26T14:32:44.450
null
null
372
null
28,206
2
null
28,110
3
null
> How about writing a cursor to loop through the contents, attempting the cast for each entry?When an error occurs, output the primary key or other identifying details for the problem record. I can't think of a set-based way to do this. Not totally setbased but if only 3 rows out of 1 million are bad it will save yo...
null
CC BY-SA 2.5
null
2008-08-26T14:32:14.000
2008-08-26T14:32:14.000
null
null
740
null
28,216
2
null
28,160
10
null
In addition to simply being "clearer", separating classes into separate files makes it easier for multiple developers not to step on each others toes. There will be less merging when it comes time to commit changes to your version control tool.
null
CC BY-SA 2.5
null
2008-08-26T14:34:40.467
2008-08-26T14:34:40.467
null
null
863
null
28,215
2
null
28,160
93
null
The term here is and you really want to (if possible) have one class per translation unit ie, one class implementation per .cpp file, with a corresponding .h file of the same name. It's usually more efficient (from a compile/link) standpoint to do things this way, especially if you're doing things like incremental li...
null
CC BY-SA 2.5
null
2008-08-26T14:34:39.797
2008-08-26T14:34:39.797
null
null
null
null
28,204
2
null
28,160
8
null
Most places where I have worked have followed this practice. I've actually written coding standards for BAE (Aust.) along with the reasons why instead of just carving something in stone with no real justification. Concerning your question about source files, it's not so much time to compile but more an issue of being a...
null
CC BY-SA 4.0
null
2008-08-26T14:31:52.940
2022-04-26T16:15:40.060
2022-04-26T16:15:40.060
2,974
2,974
null
28,209
2
null
28,110
2
null
The ISDATE() would take care of the rows which were not formatted properly if it were indeed being executed first. However, if you look at the execution plan you'll probably find that the DATEDIFF predicate is being applied first - thus the cause of your pain. If you're using SQL Server Management Studio hit + to vie...
null
CC BY-SA 3.0
null
2008-08-26T14:32:32.313
2015-08-20T22:18:46.987
2015-08-20T22:18:46.987
7,226
3,067
null
28,214
2
null
22,988
1
null
> Are you initially loading the data only when !Page.IsPostBack? Also, is view state enabled for the text box? I had almost forgotten to check the ViewState, but ended up remembering to verify that it wasn't disabled before making my post here on SO. I even set EnableViewState="true" to make sure. I did find the sol...
null
CC BY-SA 2.5
null
2008-08-26T14:34:11.063
2008-08-26T14:34:11.063
null
null
418
null
28,223
2
null
28,212
0
null
It may not be feasible in your case, but I've seen people employ a little preprocessor-foo to massage the types into compatibility. Even this assumes that you are building one or both libraries. It is also possible that you don't want to do this at all, but want to re-evaulate some early decision. Or not.
null
CC BY-SA 3.0
null
2008-08-26T14:37:28.167
2015-10-08T07:41:07.507
2015-10-08T07:41:07.507
67,579
2,509
null
28,219
1
28,225
null
4
1,008
Can I get a 'when to use' for these and others? ``` <% %> <%# EVAL() %> ``` Thanks
In ASP.NET, what are the different ways to inline code in the .aspx?
CC BY-SA 2.5
0
2008-08-26T14:35:45.753
2011-12-13T11:29:11.920
2009-10-09T22:03:08.153
2,688
1,293
[ ".net", "asp.net", "syntax" ]
28,220
2
null
28,150
4
null
If this is for XML serialization and NHibernate, where you want the parameterless constructor to be accessible (as is the case in the [example](https://stackoverflow.com/questions/27758/notify-developer-of-a-do-not-use-method#27796) you referenced), then use a private or protected parameterless constructor for serializ...
null
CC BY-SA 2.5
null
2008-08-26T14:36:30.933
2008-08-26T14:47:45.693
2017-05-23T12:01:17.740
-1
2,314
null
28,218
2
null
28,011
0
null
You can also check out the section on dates on [ruby-doc.org](http://ruby-doc.org/stdlib/libdoc/date/rdoc/index.html). I'm still learning Ruby but it sounds like you could use either the [Civil or Commerical Date](http://ruby-doc.org/stdlib/libdoc/date/rdoc/index.html) to go back before 1970.
null
CC BY-SA 2.5
null
2008-08-26T14:35:15.367
2008-08-26T14:35:15.367
null
null
2,863
null
28,217
2
null
27,850
1
null
The seminal resource for this are chapters 28-30 of [SQL for Smarties](https://rads.stackoverflow.com/amzn/click/com/1558605762). (I've recommended this book so much I figure Celko owes me royalties by now!)
null
CC BY-SA 2.5
null
2008-08-26T14:35:13.760
2008-08-26T14:35:13.760
null
null
414
null
28,226
2
null
28,212
0
null
If the `struct`s were the same internally, you could do a [reinterpret_cast](http://en.cppreference.com/w/cpp/language/reinterpret_cast); however, since it looks like you have 16-bit vs 32-bit fields, you're probably stuck converting on each call, or writing wrappers for all functions of one of the libraries.
null
CC BY-SA 3.0
null
2008-08-26T14:38:11.800
2015-10-08T07:43:18.117
2015-10-08T07:43:18.117
67,579
414
null
28,230
2
null
27,952
12
null
You can use the source indexing feature of the Debugging Tools for Windows, which will save references to the appropriate revisions of the files in your source repository as an alternate stream in the PDB file.
null
CC BY-SA 2.5
null
2008-08-26T14:41:07.130
2008-08-26T14:41:07.130
null
null
2,150
null
28,227
2
null
28,219
2
null
You can also use `<%= Class.Method() %>` And it will print the result, just as you can do in Ruby on Rails.
null
CC BY-SA 2.5
null
2008-08-26T14:38:45.933
2008-08-26T14:38:45.933
null
null
1,344
null
28,224
1
113,250
null
4
1,984
Is there a way to run a regexp-string replace on the current line in the bash? I find myself rather often in the situation, where I have typed a long commandline and then realize, that I would like to change a word somewhere in the line. My current approach is to finish the line, press + (to get to the start of the l...
Bash reg-exp substitution
CC BY-SA 3.0
null
2008-08-26T14:37:31.773
2015-08-20T22:18:28.950
2015-08-20T22:18:28.950
7,226
1,870
[ "regex", "bash" ]
28,228
2
null
28,224
3
null
G'day, What about using vi mode instead? Just enter set -o vi Then you can go to the word you want to change and just do a cw or cW depending on what's in the word? Oops, forgot to add you enter a ESC k to o to the previous line in the command history. What do you normally use for an editor? cheers, Rob Edit: Wh...
null
CC BY-SA 2.5
null
2008-08-26T14:40:23.683
2008-08-27T13:04:57.117
2008-08-27T13:04:57.117
2,974
2,974
null
28,229
2
null
28,051
15
null
Scott Guthrie gives some great advice here on how to set up a User Control Library project, then use pre-build events to copy the user controls into multiple projects. It works really well. [http://webproject.scottgu.com/CSharp/usercontrols/usercontrols.aspx](http://webproject.scottgu.com/CSharp/usercontrols/usercontr...
null
CC BY-SA 2.5
null
2008-08-26T14:40:38.193
2008-08-26T14:40:38.193
null
null
null
null
28,212
1
28,244
null
0
1,301
I'm using two different libraries in my project, and both of them supply a basic rectangle `struct`. The problem with this is that there seems to be no way to insert a conversion between the types, so I can't call a function in one library with the result from a function in the other. If I was the author of either of t...
How can I convert types in C++?
CC BY-SA 3.0
null
2008-08-26T14:33:17.663
2015-10-08T07:43:18.117
2017-05-23T12:08:38.563
-1
1,421
[ "c++", "oop", "types" ]
28,235
1
28,472
null
52
64,483
Using [JDeveloper](http://www.oracle.com/technology/products/jdev), I started developing a set of web pages for a project at work. Since I didn't know much about JDev at the time, I ran over to Oracle to follow some tutorials. The JDev tutorials recommended doing [JSPX](http://www.fileinfo.net/extension/jspx) instead o...
Should I be doing JSPX instead of JSP?
CC BY-SA 2.5
0
2008-08-26T14:41:55.757
2014-05-12T08:55:13.777
null
null
null
[ "jsp", "jspx" ]
28,232
2
null
28,212
0
null
Why not something simple like this: (note this may/probably won't compile) but you get the idea... ``` private Rect* convert(const rectangle& src) { return new Rect(src.x,src.y,src.w,src.h); } int main() { rectangle r; r.x = 1; r.y = 2; r.w = 3; r.h = 4; Rect* foo = convert(&r); ... ...
null
CC BY-SA 3.0
null
2008-08-26T14:41:26.380
2015-10-08T07:42:01.297
2015-10-08T07:42:01.297
67,579
1,638
null
28,238
2
null
27,562
0
null
This seems to be a reasonable tutorial with a few simple examples [UTL_FILE example](http://www.adp-gmbh.ch/ora/plsql/utl_file.html)
null
CC BY-SA 2.5
null
2008-08-26T14:44:09.667
2008-08-26T14:44:09.667
null
null
2,985
null
28,233
2
null
28,196
2
null
What a gross DB structure. Anyway, I'd do something like this (note I prefer EXISTS to joins, but you can re-write them as joins if you like; most query analyzers will collapse them to the same query plan anyway). You may have to do some additional juggling one way or another to make it work... ``` SELECT * FROM wp...
null
CC BY-SA 2.5
null
2008-08-26T14:41:27.160
2008-08-26T14:41:27.160
null
null
2,590
null
28,239
2
null
28,212
-1
null
Maybe you could try it with operator overloading ? (Maybe a = operator which is not a method of your class) ? Rect operator= (const Rect&,const rectangle&) More about this in the C++ programming language by Bjarne Stroustrup or maybe on this page: [http://www.cs.caltech.edu/courses/cs11/material/cpp/donnie/cpp-ops.ht...
null
CC BY-SA 2.5
null
2008-08-26T14:44:27.200
2008-08-26T14:44:27.200
null
null
3,056
null
28,244
2
null
28,212
2
null
If you can't modify the structures then you have no alternative to writing a manual conversion function because overloading conversion operators only works within the class body. There's no other way.
null
CC BY-SA 2.5
null
2008-08-26T14:48:00.420
2008-08-26T14:48:00.420
null
null
1,968
null
28,241
1
28,255
null
15
26,535
I am merging a CVS branch and one of the larger changes is the replacement wherever it occurs of a Singleton pattern with abstract classes that have a static initialisation block and all static methods. Is this something that's worth keeping since it will require merging a lot of conflicts, what sort of situation woul...
Java Singleton vs static - is there a real performance benefit?
CC BY-SA 3.0
0
2008-08-26T14:45:48.617
2012-03-12T01:44:29.530
2012-03-12T01:44:29.530
1,288
null
[ "java", "design-patterns", "singleton" ]
28,240
2
null
28,212
4
null
Create an intermediate shim type "`RectangleEx`", and define custom conversions to/from the 3rd-party string types. Whenever you speak to either API, do so through the shim class. Another way would be to derive a `class` from either `rect` or `Rectangle`, and insert conversions/constructors there.
null
CC BY-SA 3.0
null
2008-08-26T14:44:41.257
2015-10-08T07:40:05.173
2015-10-08T07:40:05.173
67,579
null
null
28,242
2
null
28,150
0
null
I'd suggest you to use the #error directive. Another pretty unknown attribute that might do the work is the [conditional attribute](http://msdn.microsoft.com/en-us/library/system.diagnostics.conditionalattribute.aspx) (depending on what you're trying to ahieve) ``` [Conditional("CONDITION")] public static void MiMet...
null
CC BY-SA 2.5
null
2008-08-26T14:46:13.217
2008-08-26T14:46:13.217
null
null
2,695
null
28,225
2
null
28,219
15
null
Check out the [Web Forms Syntax Reference](http://quickstarts.asp.net/QuickStartv20/aspnet/doc/pages/syntax.aspx#expressions) on MSDN. For basics, - <% %> is used for pure code blocks. I generally only use this for if statements> - > <div class='<%= IsLoggedIn ? "authenticated" : "unauthenticated" %>'>- <%# Express...
null
CC BY-SA 2.5
null
2008-08-26T14:38:11.363
2008-08-26T14:47:44.977
2008-08-26T14:47:44.977
2,688
2,688
null
28,248
2
null
22,873
1
null
The defacto standard for learning Grails is the excellent [Getting Started with Grails](http://www.infoq.com/minibooks/grails) by Jason Rudolph. You can debate whether it is an online tutorial or a book since it can be purchased but is available as a free download. There are more "real" books being published and I reco...
null
CC BY-SA 2.5
null
2008-08-26T14:49:56.110
2008-08-26T14:49:56.110
null
null
3,014
null
28,247
2
null
28,165
5
null
``` function subst($str, $dict){ return preg_replace(array_map(create_function('$a', 'return "/%\\($a\\)s/";'), array_keys($dict)), array_values($dict), $str); } ``` You call it like so: ``` echo subst('The %(site)s site %(adj)s because it %(adj)s', array('site'=>'Stackoverflow', 'adj'=>'rocks')); ```
null
CC BY-SA 2.5
null
2008-08-26T14:49:54.707
2008-08-26T14:49:54.707
null
null
1,585
null
28,246
2
null
28,212
3
null
Not sure how sensible this is, but how about something like this: ``` class R { public: R(const rectangle& r) { ... }; R(const Rect& r) { ... }; operator rectangle() const { return ...; } operator Rect() const { return ...; } private: ... }; ``` Then you can just wrap every `rectangle` in `R()`...
null
CC BY-SA 3.0
null
2008-08-26T14:49:01.057
2015-10-08T07:40:32.130
2015-10-08T07:40:32.130
67,579
1,175
null
28,251
2
null
28,241
0
null
Does this discussion help? (I don't know if it's taboo to link to another programming forum, but I'd rather not just quote the whole discussion =) ) [Sun Discussion on this subject](http://forums.sun.com/thread.jspa?threadID=5221231&messageID=9898827) The verdict seems to be that it doesn't make enough of a differen...
null
CC BY-SA 2.5
null
2008-08-26T14:50:44.987
2008-08-26T14:50:44.987
null
null
3,068
null
28,255
2
null
28,241
16
null
From a strict runtime performance point of view, the difference is really negligible. The main difference between the two lies down in the fact that the "static" lifecycle is linked to the classloader, whereas for the singleton it's a regular instance lifecycle. Usually it's better to stay away from the ClassLoader bus...
null
CC BY-SA 2.5
null
2008-08-26T14:52:01.783
2008-08-26T14:52:01.783
null
null
3,069
null
28,249
2
null
21,294
3
null
i've used yet another solution i found on the net ... this one is under creativecommons and it ... you can find the file here: [include.js](http://xkr.us/code/javascript/include.js) ``` /** include - including .js files from JS - bfults@gmail.com - 2005-02-09 ** Code licensed under Creative Commons Attribution-Shar...
null
CC BY-SA 2.5
null
2008-08-26T14:50:30.803
2008-08-26T14:50:30.803
null
null
1,532
null
28,254
2
null
28,150
0
null
Create an FxCop rule, and add FxCop to your integration build in order to check for this. You'll get warnings, rather than a failing build. Attributes 'run' at reflection time rather than build time. Alternatively (and this is rather nasty) put a compiler directive around the method you don't want to be called. Then...
null
CC BY-SA 2.5
null
2008-08-26T14:51:54.343
2008-08-26T14:51:54.343
null
null
905
null
28,250
2
null
28,235
6
null
Hello fellow JDeveloper developer! I have been working with JSPX pages for over two years and I never had any problems with them being JSPX opposed to JSP. The choice for me to go with JSPX was kinda forced since I use JHeadstart to automatically generate ADF Faces pages and by default, JHeadstart generates everything...
null
CC BY-SA 2.5
null
2008-08-26T14:50:36.407
2008-08-26T14:50:36.407
null
null
506
null
28,257
2
null
18,783
1
null
Remove cursors wherever the are not neceesary.
null
CC BY-SA 2.5
null
2008-08-26T14:52:46.103
2009-03-05T17:40:33.863
2009-03-05T17:40:33.863
357
357
null
28,243
1
109,708
null
9
29,411
I'm trying to install some Ruby Gems so I can use Ruby to notify me when I get twitter messages. However, after doing a `gem update --system`, I now get a zlib error every time I try and do a `gem install` of anything. below is the console output I get when trying to install ruby gems. (along with the output from `gem ...
cannot install ruby gems - zlib error
CC BY-SA 3.0
0
2008-08-26T14:47:52.357
2014-11-26T09:34:17.727
2012-04-26T01:48:41.113
1,332,690
1,726
[ "ruby", "rubygems" ]
28,258
2
null
27,381
1
null
This should be decided on how complicated the design of your website is. The more complicated, graphically or component wise (amount of content divs), will determine how well your website will scale. Generally you will find most graphic designers website will not scale because they are graphically intensive. However in...
null
CC BY-SA 2.5
null
2008-08-26T14:53:23.683
2008-08-26T14:53:23.683
null
null
2,501
null
28,253
2
null
27,757
49
null
I find myself forgetting how to do this every time as well so I just wrap the two one-liners that I need in a little class: ``` public class Utility { /// <summary> /// Takes the full name of a resource and loads it in to a stream. /// </summary> /// <param name="resourceName">Assuming an embedded reso...
null
CC BY-SA 2.5
null
2008-08-26T14:51:12.533
2008-08-26T14:51:12.533
null
null
3,074
null
28,261
1
null
null
18
2,915
I've been looking for a tool to extract exception information from a C++ program. The most wanted feature I'm looking for: I want to know all the exceptions that can be thrown from a function (which would include all the function that is called from that function recursively). I've always thought that documenting erro...
Exception analysis tool for C++
CC BY-SA 2.5
0
2008-08-26T14:55:31.340
2015-10-29T06:22:05.907
null
null
2,957
[ "c++", "exception", "code-analysis" ]
28,263
2
null
28,219
2
null
Just want to add, there's also the resources expression ``` <%$ Resources:resource, welcome%> ``` and asp.net would look for localized version of "welcome" in satellite assemblies automatically.
null
CC BY-SA 2.5
null
2008-08-26T14:56:25.347
2008-08-26T14:56:25.347
null
null
3,055
null
28,260
2
null
28,241
3
null
If my original post was the correct understanding and the discussion from Sun that was linked to is accurate (which I think it might be), then I think you have to make a trade off between clarity and performance. Ask yourself these questions: 1. Does the Singleton object make what I'm doing more clear? 2. Do I need ...
null
CC BY-SA 2.5
null
2008-08-26T14:54:56.380
2008-08-26T14:54:56.380
null
null
572
null
28,262
2
null
27,077
4
null
G'day, Just wanted to expand on the suggestion from Jon to use -prune. It isn't the easiest of find options to use, for example to just search in the current directory the find command looks like: ``` find . \( -type d ! -name . -prune \) -o \( <the bit you want to look for> \) ``` this will stop find from descendi...
null
CC BY-SA 2.5
null
2008-08-26T14:55:46.377
2008-08-26T14:55:46.377
null
null
2,974
null
28,265
2
null
22,873
3
null
check out the [programming section of wikibooks](http://en.wikibooks.org/wiki/Wikibooks:Programming_languages_bookshelf) Many of them are fully formed, and quite a few have more advanced sections (which are in varying states of completion) on specific functionality. also, [w3 schools](http://www.w3schools.com/PHP/DEf...
null
CC BY-SA 2.5
null
2008-08-26T14:56:51.537
2008-08-26T14:56:51.537
null
null
2,908
null
28,270
2
null
28,268
0
null
Probably better not to run vista in a VM. Especially if you want the Aero UI turned on. VMs aren't very good with advanced graphics, so you'll probably want to run XP, or Vista in classic mode.
null
CC BY-SA 2.5
null
2008-08-26T14:59:13.747
2008-08-26T14:59:13.747
null
null
1,862
null
28,271
2
null
28,241
16
null
I would use a singleton if it needed to store any state, and static classes otherwise. There's no point in instantiating something, even a single instance, unless it needs to store something.
null
CC BY-SA 2.5
null
2008-08-26T14:59:20.503
2008-08-26T14:59:20.503
null
null
3,044
null
28,273
2
null
28,268
0
null
Not really, it should run just fine. Your dev environment will just be a little bit slower...but in my experience, it's not really all that bad. I wouldn't want it as my main machine, but it's perfectly usable.
null
CC BY-SA 2.5
null
2008-08-26T14:59:59.783
2008-08-26T14:59:59.783
null
null
194
null