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
27,863
2
null
27,850
2
null
A variation is where you use a direct hierarchical representation (ie. parent link in node), but also store a path value. ie. for a directory tree consisting of the following: ``` C:\ Temp Windows System32 ``` You would have the following nodes ``` Key Name Parent Path 1 C: ...
null
CC BY-SA 2.5
null
2008-08-26T12:18:55.787
2008-08-26T12:18:55.787
null
null
267
null
27,904
2
null
27,065
9
null
If you are on a unix system you could just do a ``` find /target-folder -name \*.class | xargs file | grep "version 50\.0" ``` (my version of file says "compiled Java class data, version 50.0" for java6 classes).
null
CC BY-SA 2.5
null
2008-08-26T12:32:05.647
2008-08-26T12:32:05.647
null
null
2,844
null
27,888
2
null
15,376
21
null
[Visual Paradigm for UML http://content.usa.visual-paradigm.com/websiteimages/images/products/vpuml60/vpumltitle.gif](http://content.usa.visual-paradigm.com/websiteimages/images/products/vpuml60/vpumltitle.gif) I'm very fond of [Visual Paradigm for UML](http://www.visual-paradigm.com/product/vpuml/) It's very powerful...
null
CC BY-SA 2.5
null
2008-08-26T12:25:40.217
2008-08-26T12:25:40.217
null
null
1,830
null
27,899
1
5,040,105
null
38
28,013
Is there a way to make S3 default to an index.html page? E.g.: My bucket object listing: ``` /index.html /favicon.ico /images/logo.gif ``` A call to works great! But if one were to call we'd either get a 403 or a REST object listing XML document depending on how bucket-level ACL was configured. So, the question...
Is there a way to have index.html functionality with content hosted on S3?
CC BY-SA 3.0
0
2008-08-26T12:30:19.253
2019-09-17T07:51:26.657
2017-07-18T16:00:53.777
1,033,581
2,961
[ "amazon-s3", "amazon-web-services" ]
27,906
2
null
27,758
3
null
I would actually be inclined to disagree with everyone that is advocating the use of the [ObsoleteAttribute](http://msdn.microsoft.com/en-us/library/system.obsoleteattribute.aspx) as the MSDN documentation says that: > Marking an element as obsolete informs the users that the element will be removed in future versions...
null
CC BY-SA 3.0
null
2008-08-26T12:34:50.240
2015-10-08T08:09:12.430
2017-05-23T12:17:45.993
-1
1,185
null
27,910
1
10,324,802
null
59
14,479
The [DOI](http://doi.org/) system places basically no useful limitations on what constitutes [a reasonable identifier](http://doi.org/handbook_2000/enumeration.html#2.2). However, being able to pull DOIs out of PDFs, web pages, etc. is quite useful for citation information, etc. Is there a reliable way to identify a D...
Finding a DOI in a document or page
CC BY-SA 2.5
0
2008-08-26T12:37:33.387
2020-10-31T16:47:24.333
null
null
2,963
[ "regex", "doi" ]
27,914
2
null
27,663
0
null
Visual Studio Team system (database edition) does some refactoring. I read the Refactoring databases book. I think it's helpful. But in software dev, you build tests so that you are safe refactoring. They don't touch on tests in the Refactoring Databases book, which was my big disappointment with it.
null
CC BY-SA 2.5
null
2008-08-26T12:39:39.857
2008-08-26T12:39:39.857
null
null
2,342
null
27,916
1
28,519
null
2
569
What tools are people using for testing SQL Server databases? By this I mean all parts of the database: - - - - - Most likely, there is not one tool to do it all.
SQL Server - testing the database
CC BY-SA 3.0
null
2008-08-26T12:42:12.203
2012-04-25T21:54:49.817
2012-04-25T21:54:49.817
1,332,690
2,342
[ "sql-server", "unit-testing" ]
27,922
2
null
27,899
2
null
I would suggest reading [this thread](http://developer.amazonwebservices.com/connect/thread.jspa?threadID=10849&start=0&tstart=0) from 2006 (On Amazon web services developers connection). It seems there's no easy solution to this.
null
CC BY-SA 2.5
null
2008-08-26T12:47:37.357
2008-08-26T12:47:37.357
null
null
1,011
null
27,926
2
null
27,916
0
null
I personally use NHibernate with SqlCe, this provides a "throw-away" database that doesn't need any specialized tear down after the tests are run. It also provides a good way to test your nhibernate mappings if applicable. Here is a link to an article I wrote awhile ago on how to accomplish this: [http://www.codeproj...
null
CC BY-SA 2.5
null
2008-08-26T12:50:24.057
2008-08-26T12:50:24.057
null
null
2,993
null
27,921
1
27,938
null
23
27,402
Story: The user uploads an image that will be added to a photo gallery. As part of the upload process, we need to A) store the image on the web server's hard drive and B) store a thumbnail of the image on the web server's hard drive. "Best" here is defined as - - Performance and high-quality thumbnails are secon...
What is the "best" way to create a thumbnail using ASP.NET?
CC BY-SA 2.5
0
2008-08-26T12:47:35.123
2017-11-30T19:28:27.900
2008-09-10T00:13:45.233
-1
308
[ "asp.net", "image", "thumbnails" ]
27,889
1
28,346
null
0
374
I am trying to get SpecUnit to run in a continuous integration build using Nant. At the moment the files are in the correct place but no output is generated from SpecUnit.Report.exe. Here is the relevant task from the nant build script: ``` <echo message="**** Starting SpecUnit report generation ****" /> <copy file="$...
How to get SpecUnit to run within a TeamCity CI build
CC BY-SA 3.0
null
2008-08-26T12:26:10.620
2013-12-02T12:50:12.490
2013-12-02T12:50:12.490
2,432,317
2,993
[ "c#", "nant", "teamcity" ]
27,930
2
null
9,256
0
null
Thanks. A load of `callLater`-s added to our custom chart code seems to have done it.
null
CC BY-SA 2.5
null
2008-08-26T12:51:31.637
2008-08-26T12:51:31.637
null
null
905
null
27,928
1
27,943
null
1,130
1,102,549
How do I calculate the distance between two points specified by latitude and longitude? For clarification, I'd like the distance in kilometers; the points use the WGS84 system and I'd like to understand the relative accuracies of the approaches available.
Calculate distance between two latitude-longitude points? (Haversine formula)
CC BY-SA 3.0
0
2008-08-26T12:50:45.647
2022-10-27T14:37:03.290
2017-09-11T17:15:37.090
2,137,255
1,456
[ "algorithm", "math", "maps", "latitude-longitude", "haversine" ]
27,911
2
null
27,509
12
null
The solution is incorrect. In JavaScript, ``` null == undefined ``` will return true, because they both are "casted" to a boolean and are false. The correct way would be to check ``` if (something === undefined) ``` which is the identity operator...
null
CC BY-SA 3.0
null
2008-08-26T12:38:22.120
2014-11-09T12:07:51.397
2014-11-09T12:07:51.397
63,550
653
null
27,905
2
null
27,894
18
null
@wcm - actually to nit pick the Table Variable isn't Ram only - it can be partially stored on disk. A temp table can have indexes, whereas a table variable can only have a primary index. If speed is an issue Table variables can be faster, but obviously if there are a lot of records, or the need to search the temp tabl...
null
CC BY-SA 2.5
null
2008-08-26T12:33:10.293
2008-08-26T12:33:10.293
null
null
1,075
null
27,932
2
null
27,030
22
null
Honestly, with 8 objects max and 8 properties max per object, your best bet is to just traverse each object and make the comparisons directly. It'll be fast and it'll be easy. If you're going to be using these types of comparisons often, then I agree with Jason about JSON serialization...but otherwise there's no need...
null
CC BY-SA 2.5
null
2008-08-26T12:52:12.320
2008-08-26T12:52:12.320
null
null
1,335
null
27,936
2
null
27,663
0
null
I think those tools are very good, but for my purpose I have written a custom own. The main reason for this was because of I'm working on a SQL Server Compact 3.5 database, so none of the listed tools worked. Of course it isn't as powerful as the tools from Redgate but you get the most important features very quick. ...
null
CC BY-SA 2.5
null
2008-08-26T12:53:10.617
2008-08-26T12:53:10.617
null
null
2,078
null
27,894
1
64,891
null
422
406,757
In SQL Server 2005, we can create temp tables one of two ways: ``` declare @tmp table (Col1 int, Col2 int); ``` or ``` create table #tmp (Col1 int, Col2 int); ``` What are the differences between these two? I have read conflicting opinions on whether @tmp still uses tempdb, or if everything happens in memory. ...
What's the difference between a temp table and table variable in SQL Server?
CC BY-SA 3.0
0
2008-08-26T12:27:30.337
2022-05-26T11:48:03.743
2016-09-28T12:58:23.280
3,682,162
1,219
[ "sql-server", "temp-tables", "table-variable" ]
27,941
2
null
9,033
25
null
The C# ?? null coalescing operator - Not really hidden, but rarely used. Probably because a lot of developers run a mile when they see the conditional ? operator, so they run two when they see this one. Used: ``` string mystring = foo ?? "foo was null" ``` rather than ``` string mystring; if (foo==null) mystr...
null
CC BY-SA 2.5
null
2008-08-26T12:54:41.083
2010-04-17T11:45:34.530
2010-04-17T11:45:34.530
19,624
3,024
null
27,940
2
null
27,921
0
null
You can use the Image.GetThumbnailImage function to do it for you. [http://msdn.microsoft.com/en-us/library/system.drawing.image.getthumbnailimage.aspx](http://msdn.microsoft.com/en-us/library/system.drawing.image.getthumbnailimage.aspx) (.NET 3.5) [http://msdn.microsoft.com/en-us/library/system.drawing.image.getthum...
null
CC BY-SA 2.5
null
2008-08-26T12:54:38.447
2008-08-26T12:54:38.447
null
null
986
null
27,948
1
28,068
null
1
2,716
When desinging UI for mobile apps in general which resolution could be considered safe as a general rule of thumb. My interest lies specifically in web based apps. The iPhone has a pretty high resolution for a hand held, and the Nokia E Series seem to oriented differently. Is still considered safe?
Which resolution to target for a Mobile App?
CC BY-SA 3.0
null
2008-08-26T12:57:42.167
2015-04-17T18:10:11.053
2015-04-17T18:10:11.053
1,215,724
370,899
[ "mobile", "web-applications" ]
27,949
2
null
27,942
1
null
I wouldn't start learning ASM. If you want to learn C/C++ then start with that. As the quality of your code matures, you may find you have a need for ASM. 99% of the time you won't, but every now and then you might need it. Also, it does help to know ASM in terms of understanding what C/C++ is doing behind the scenes....
null
CC BY-SA 2.5
null
2008-08-26T12:57:49.467
2008-08-26T12:57:49.467
null
null
986
null
27,943
2
null
27,928
1,342
null
This [link](http://www.movable-type.co.uk/scripts/latlong.html) might be helpful to you, as it details the use of the [Haversine formula](http://en.wikipedia.org/wiki/Haversine_formula) to calculate the distance. Excerpt: > This script [in Javascript] calculates great-circle distances between the two points – tha...
null
CC BY-SA 3.0
null
2008-08-26T12:55:53.030
2014-07-31T01:25:14.147
2014-07-31T01:25:14.147
3,204,551
null
null
27,891
2
null
27,663
5
null
It's not a tool, but Ambler and Sadalage's book, [Refactoring Databases: Evolutionary Database Design](https://rads.stackoverflow.com/amzn/click/com/0321293533) is quite good.
null
CC BY-SA 2.5
null
2008-08-26T12:26:47.717
2008-08-26T12:26:47.717
null
null
1,190
null
27,951
2
null
27,894
10
null
For all of you who believe the myth that temp variables are in memory only First, the table variable is NOT necessarily memory resident. Under memory pressure, the pages belonging to a table variable can be pushed out to tempdb. Read the article here: [TempDB:: Table variable vs local temporary table](http://blogs.m...
null
CC BY-SA 2.5
null
2008-08-26T12:58:20.480
2008-08-26T12:58:20.480
null
null
740
null
27,950
2
null
27,921
37
null
GetThumbnailImage would work, but if you want a little better quality you can specify your image options for the BitMap class and save your loaded image into there. Here is some sample code: ``` Image photo; // your uploaded image Bitmap bmp = new Bitmap(resizeToWidth, resizeToHeight); graphic = Graphics.FromImage(bm...
null
CC BY-SA 2.5
null
2008-08-26T12:58:19.733
2008-08-26T12:58:19.733
null
null
2,993
null
27,938
2
null
27,921
15
null
I suppose your best solution would be using the [GetThumbnailImage](http://msdn.microsoft.com/en-us/library/system.drawing.image.getthumbnailimage.aspx) from the .NET [Image](http://msdn.microsoft.com/en-us/library/system.drawing.image.aspx) class. ``` // Example in C#, should be quite alike in ASP.NET // Assuming fil...
null
CC BY-SA 2.5
null
2008-08-26T12:53:53.800
2008-08-26T13:02:34.933
2008-08-26T13:02:34.933
1,830
1,830
null
27,955
2
null
27,942
1
null
I did, and I think it helped me at the time. It doesn't help me day to day anymore, but I think it would depend on your job. I learned assembler 20 years ago on a Commodore and again in University on an IBM mainframe. I can't say it helps me in my current job.
null
CC BY-SA 2.5
null
2008-08-26T12:59:45.830
2008-08-26T12:59:45.830
null
null
2,342
null
27,954
2
null
27,894
20
null
> In which scenarios does one out-perform the other? For smaller tables (less than 1000 rows) use a temp variable, otherwise use a temp table.
null
CC BY-SA 3.0
null
2008-08-26T12:59:38.590
2012-04-10T22:37:59.847
2012-04-10T22:37:59.847
13,531
740
null
27,971
2
null
27,942
1
null
I agree with Mark. I think it's similar to learning MSIL when writing in C#, VB.NET, or another .NET language. It helps to know what's going on under the hood, but you could go your entire life creating applications that work and never need it.
null
CC BY-SA 2.5
null
2008-08-26T13:05:26.440
2008-08-26T13:05:26.440
null
null
2,982
null
27,942
1
27,963
null
4
1,413
My goals are focused on software application development, and maybe web application development, but most likely desktop applications. I'm embarking on a path to becoming more familiar with C/C++, but should I go much lower than that, into assembly? Or would I not have a benefit for my long-term goals?
Is it worth it to learn a dialect of assembly?
CC BY-SA 2.5
null
2008-08-26T12:54:57.103
2012-05-02T12:17:24.100
2012-05-02T12:17:24.100
192,221
572
[ "assembly" ]
27,968
2
null
25,902
1
null
G'day, We actually faced this problem at a site where I was contracting previously. One bloke sat down and wrote tools, mainly shell scripts, to 1. check out the current code base every hour or so and do a build to check if it was broken, and 2. check out the latest good build and do a complete build and run about ...
null
CC BY-SA 2.5
null
2008-08-26T13:04:30.777
2008-08-26T13:04:30.777
null
null
2,974
null
27,963
2
null
27,942
1
null
It's probably not going to have a whole lot of benefit unless you have a direct application for it. If you're going for general knowledge, C/C++ is a fine place to start. That said, the challenges that assembly poses are very interesting and it requires a pretty different mindset to get things done. I spent a little...
null
CC BY-SA 2.5
null
2008-08-26T13:02:39.643
2008-08-26T13:02:39.643
null
null
305
null
27,902
2
null
22,140
1
null
If you are compiling Apache2 for a particular location but want your clients to be able to install it somewhere else (and I'm assuming they have the same architecture and OS as your build machine) then you can do it but the apachectl script will need some after-market hacking. I just tested these steps: 1. Unpacked th...
null
CC BY-SA 4.0
null
2008-08-26T12:31:09.937
2021-08-16T08:42:44.180
2021-08-16T08:42:44.180
13,389,904
2,997
null
27,952
1
28,230
null
25
11,749
Basically what I want to do it this: a pdb file contains a location of source files (e.g. `C:\dev\proj1\helloworld.cs`). Is it possible to modify that pdb file so that it contains a different location (e.g. `\more\differenter\location\proj1\helloworld.cs`)?
How do I change the locations of source files in a symbols file (pdb)
CC BY-SA 2.5
0
2008-08-26T12:58:31.073
2015-08-20T21:49:34.480
2015-08-20T21:49:34.480
3,001,626
2,822
[ "debugging", "symbols", "pdb-files" ]
27,979
2
null
27,742
6
null
Tess' blog was a great resource. Eventually I managed to figure out how to do remote debugging which means I didn't have to look at the crash dump. For the general community, here are some links I found useful: - [Remote debugging](http://msdn.microsoft.com/en-us/library/8x6by8d2.aspx)- [Crash dumps](http://blogs.msd...
null
CC BY-SA 2.5
null
2008-08-26T13:07:50.350
2008-08-26T13:07:50.350
null
null
2,973
null
27,931
1
27,988
null
14
23,758
I want to transform an XML document. The source XML looks like this: ``` <svc:ElementList> <svc:Element> <Year>2007</Year> </svc:Element> <svc:Element> <Year>2006</Year> </svc:Element> <svc:Element> <Year>2005</Year> </svc:Element> </svc:ElementList> ``` I want to turn...
Dynamic Element Names
CC BY-SA 3.0
0
2008-08-26T12:51:55.583
2014-03-21T16:06:26.140
2014-03-21T16:06:26.140
1,987,598
1,019
[ "xml", "xslt", "namespaces" ]
27,972
1
null
null
208
82,228
JavaScript needs access to cookies if AJAX is used on a site with access restrictions based on cookies. Will HttpOnly cookies work on an AJAX site? Microsoft created a way to prevent XSS attacks by disallowing JavaScript access to cookies if HttpOnly is specified. FireFox later adopted this. So my question is: If yo...
How do HttpOnly cookies work with AJAX requests?
CC BY-SA 2.5
0
2008-08-26T13:06:14.860
2016-07-16T03:25:29.827
2010-04-09T13:11:48.090
26
26
[ "ajax", "cookies", "httponly" ]
27,983
1
30,503
null
159
699,120
I have a table of tags and want to get the highest count tags from the list. Sample data looks like this ``` id (1) tag ('night') id (2) tag ('awesome') id (3) tag ('night') ``` using ``` SELECT COUNT(*), `Tag` from `images-tags` GROUP BY `Tag` ``` gets me back the data I'm looking for perfectly. However, I woul...
SQL Group By with an Order By
CC BY-SA 2.5
0
2008-08-26T13:09:15.883
2015-07-13T13:15:49.653
2011-04-26T23:28:35.010
135,152
1,477
[ "mysql", "sql", "mysql-error-1111" ]
27,981
2
null
27,942
1
null
No. Unless you want to for fun, you really don't need learn assembly. There are some things you need to know assembly for, like driver creation, OS development, exploit development, but aside from that, I personally believe you can quite happily code forever without knowing it. If you do need to learn assembly, you'l...
null
CC BY-SA 2.5
null
2008-08-26T13:08:46.790
2008-08-26T13:08:46.790
null
null
745
null
27,992
2
null
27,983
55
null
MySQL prior to version 5 did not allow aggregate functions in ORDER BY clauses. You can get around this limit with the deprecated syntax: ``` SELECT COUNT(id), `Tag` from `images-tags` GROUP BY `Tag` ORDER BY 1 DESC LIMIT 20 ``` 1, since it's the first column you want to group on.
null
CC BY-SA 2.5
null
2008-08-26T13:14:37.073
2008-08-26T13:14:37.073
null
null
267
null
27,991
2
null
27,942
1
null
If you are writing unmanaged C++, it is occasionally invaluable to know at least basic x86 assembly, binary number systems, etc. I primarily do C/C++ development, and I occasionally need to debug production code for errors that are so specific to the machine-code representation produced by the compiler that the only w...
null
CC BY-SA 2.5
null
2008-08-26T13:14:08.930
2008-08-26T13:14:08.930
2017-05-23T11:45:32.283
-1
2,134
null
27,994
2
null
27,983
12
null
I don't know about MySQL, but in MS SQL, you can use the column index in the `order by` clause. I've done this before when doing counts with `group by`s as it tends to be easier to work with. So ``` SELECT COUNT(id), `Tag` from `images-tags` GROUP BY `Tag` ORDER BY COUNT(id) DESC LIMIT 20 ``` Becomes ``` SELECT C...
null
CC BY-SA 2.5
null
2008-08-26T13:15:36.260
2008-08-26T17:18:21.543
2008-08-26T17:18:21.557
1,108
1,108
null
27,993
2
null
26,855
4
null
Just happened across [this article](http://blog.vipul.net/2008/08/24/redhat-perl-what-a-tragedy/) which point out shortcomings in Redhat/Centos/Fedora implementations of Perl which affect `URI` profoundly. If you are running one of these Linux flavours, you might want to recompile Perl from original source (not RPM sou...
null
CC BY-SA 2.5
null
2008-08-26T13:15:32.077
2008-08-27T23:56:18.363
2020-06-20T09:12:55.060
-1
199
null
27,939
2
null
27,921
3
null
Here is an extension method in VB.NET for the Image Class ``` Imports System.Runtime.CompilerServices Namespace Extensions ''' <summary> ''' Extensions for the Image class. ''' </summary> ''' <remarks>Several usefull extensions for the image class.</remarks> Public Module ImageExtensions ''' <su...
null
CC BY-SA 3.0
null
2008-08-26T12:54:31.707
2017-11-30T19:26:53.907
2017-11-30T19:26:53.907
1,600
2,936
null
28,000
2
null
27,972
4
null
Not necessarily, it depends what you want to do. Could you elaborate a bit? AJAX doesn't need access to cookies to work, it can make requests on its own to extract information, the page request that the AJAX call makes could access the cookie data & pass that back to the calling script without Javascript having to dir...
null
CC BY-SA 2.5
null
2008-08-26T13:18:50.043
2008-08-26T13:18:50.043
null
null
2,975
null
28,002
1
1,255,015
null
1,995
858,616
I've been writing C and C++ code for almost twenty years, but there's one aspect of these languages that I've never really understood. I've obviously used regular casts i.e. ``` MyClass *m = (MyClass *)ptr; ``` all over the place, but there seem to be two other types of casts, and I don't know the difference. What's...
Regular cast vs. static_cast vs. dynamic_cast
CC BY-SA 3.0
0
2008-08-26T13:20:55.357
2022-07-11T21:21:22.943
2014-05-15T15:15:29.143
46,642
1,821
[ "c++", "pointers", "casting" ]
28,003
1
28,008
null
3
2,842
I have a large database and would like to select table names that have a certain column name. I have done something like this in MySQL, but can't find any info on SQL Server. I want to do something like: ``` select [table] from [db] where table [has column 'classtypeid'] ``` How can I do something like this?
Use table metadata for select statement in SQL Server?
CC BY-SA 3.0
0
2008-08-26T13:20:57.087
2016-01-07T11:07:09.797
2013-06-25T20:06:37.090
426,671
1,638
[ "sql", "sql-server" ]
28,006
2
null
14,527
0
null
For reference, this problem is usually called "substring-after-last" in XSLT.
null
CC BY-SA 2.5
null
2008-08-26T13:21:52.203
2008-08-28T08:13:22.210
2008-08-28T08:13:22.210
2,679
2,679
null
28,008
2
null
28,003
5
null
Use the ANSI information_schema views, this will also work in MySQL ``` select table_name from information_schema.columns where column_name = 'classtypeid' ```
null
CC BY-SA 2.5
null
2008-08-26T13:23:08.580
2008-08-26T13:23:08.580
null
null
740
null
27,974
2
null
8,692
133
null
[libxml2](http://xmlsoft.org/python.html) has a number of advantages: 1. Compliance to the spec 2. Active development and a community participation 3. Speed. This is really a python wrapper around a C implementation. 4. Ubiquity. The libxml2 library is pervasive and thus well tested. Downsides include: 1. Compli...
null
CC BY-SA 3.0
null
2008-08-26T13:06:39.587
2016-02-07T18:16:49.647
2016-02-07T18:16:49.647
2,921,691
620
null
28,010
2
null
27,972
0
null
No, the page that the AJAX call requests has access to cookies too & that's what checks whether you're logged in. You can do other authentication with the Javascript, but I wouldn't trust it, I always prefer putting any sort of authentication checking in the back-end.
null
CC BY-SA 2.5
null
2008-08-26T13:23:43.837
2008-08-26T13:23:43.837
null
null
2,975
null
28,009
1
null
null
7
4,216
How do you determine when to use [table clusters](http://www.iselfschooling.com/mc4articles/mc4cluster.htm)? There are two types, index and hash, to use for different cases. In your experience, have the introduction and use of table clusters paid off? If none of your tables are set up this way, modifying them to use t...
When do you use table clusters?
CC BY-SA 2.5
0
2008-08-26T13:23:37.893
2011-06-22T08:30:35.253
null
null
null
[ "database", "performance", "oracle" ]
27,998
1
28,289
null
29
41,083
Most of my C/C++ development involves monolithic module files and absolutely no classes whatsoever, so usually when I need to make a with accessible functions I just export them using the standard `__declspec(dllexport)` directive. Then access them either dynamically via `LoadLibrary()` or at compile time with a head...
Exporting a C++ class from a DLL
CC BY-SA 3.0
0
2008-08-26T13:18:30.480
2015-02-03T10:30:57.460
2012-04-26T01:59:40.010
1,332,690
194
[ "c++", "windows", "dll" ]
28,011
1
28,148
null
2
665
Working with dates in ruby and rails on windows, I'm having problems with pre-epoch dates (before 1970) throwing out of range exceptions. I tried using both [Time](http://ruby-doc.org/core-2.2.0/Time.html) and [DateTime](http://ruby-doc.org/stdlib-1.9.3/libdoc/date/rdoc/DateTime.html) objects, but still have the same p...
Ruby / Rails pre-epoch dates on windows
CC BY-SA 3.0
null
2008-08-26T13:23:50.543
2015-10-08T07:37:51.560
2015-10-08T07:37:51.560
67,579
3,041
[ "ruby-on-rails", "ruby", "date" ]
27,988
2
null
27,931
13
null
Probably namespace issues and maybe one with current context. For source (with added namespace declaration to make it well-formed xml) ``` <svc:ElementList xmlns:svc="svc"> <svc:Element> <Year>2007</Year> </svc:Element> <svc:Element> <Year>2006</Year> </svc:Element> <svc:Element> <Year>2005</Year...
null
CC BY-SA 2.5
null
2008-08-26T13:12:30.917
2008-12-27T16:17:36.207
null
null
2,679
null
28,015
2
null
22,697
3
null
Mockito also provides the option of stubbing methods, matching arguments (like anyInt() and anyString()), verifying the number of invocations (times(3), atLeastOnce(), never()), [and more](http://mockito.googlecode.com/svn/branches/1.5/javadoc/org/mockito/Mockito.html). I've also found that Mockito is [simple and clea...
null
CC BY-SA 2.5
null
2008-08-26T13:24:53.630
2009-12-07T20:10:42.447
2017-05-23T12:18:01.060
-1
2,030
null
28,021
2
null
27,972
1
null
Cookies are automatically handled by the browser when you make an AJAX call, so there's no need for your Javascript to mess around with cookies.
null
CC BY-SA 2.5
null
2008-08-26T13:26:39.947
2008-08-26T13:26:39.947
null
null
2,504,504
null
28,020
2
null
28,002
13
null
`dynamic_cast` has runtime type checking and only works with references and pointers, whereas `static_cast` does not offer runtime type checking. For complete information, see the MSDN article [static_cast Operator](http://msdn.microsoft.com/en-us/library/c36yw7x9(VS.80).aspx).
null
CC BY-SA 3.0
null
2008-08-26T13:26:23.707
2014-01-22T21:05:29.670
2014-01-22T21:05:29.670
63,550
2,982
null
28,004
2
null
27,942
3
null
G'day, I learnt PDP assembler when I did my Elect. Eng. degree in the late '70's. The last dialect of assembler that I really used had four different modes of memory addressing. Last dialect I ooked at had 17 modes! Not sure what learning assembler really gives you nowadays. Back then it was an essential part of a CS...
null
CC BY-SA 2.5
null
2008-08-26T13:21:09.287
2008-08-26T13:21:09.287
null
null
2,974
null
28,018
2
null
27,998
12
null
I use some macros to mark the code for import or export Then declare the class in a header file: Then `#define ISDLL` in the libary, and `USEDLL` before including the header file in the place you want to use the class. I don't know if you might need to do anything differently for working with `LoadLibrary`
null
CC BY-SA 2.5
null
2008-08-26T13:26:01.133
2008-08-26T13:26:01.133
null
null
1,441
null
28,013
2
null
27,405
2
null
You probably meant to have some rounding in there, rather than truncating the result to an integer, otherwise the purpose of the operation is really limited. But since you asked the question with that specific formula, it brought to mind that your result set is really coarse. For the first 333 numbers, the result is:...
null
CC BY-SA 2.5
null
2008-08-26T13:24:14.273
2008-08-26T13:24:14.273
null
null
2,146
null
28,016
2
null
27,948
1
null
You mentioned Web based apps. Any particular framework you have in mind? In many cases, [WALL](http://wurfl.sourceforge.net/index.php) seems to help to large extent. Here's one Article, [Adapting to User Devices Using Mobile Web Technology](http://www.packtpub.com/article/adapting-user-devices-mobile-web-technology) ...
null
CC BY-SA 2.5
null
2008-08-26T13:25:04.380
2008-08-26T13:25:04.380
null
null
123
null
28,012
2
null
28,003
2
null
Here you go: ``` SELECT C.TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS AS C INNER JOIN INFORMATION_SCHEMA.TABLES AS T ON C.TABLE_NAME = T.TABLE_NAME AND C.TABLE_SCHEMA = T.TABLE_SCHEMA WHERE C.COLUMN_NAME = 'classtypeid' AND T.TABLE_TYPE = 'BASE TABLE' ``` --- : Note that this will not list views based on ...
null
CC BY-SA 2.5
null
2008-08-26T13:24:00.763
2008-08-26T13:33:52.080
2008-08-26T13:33:52.080
267
267
null
28,029
1
29,442
null
2
1,772
How can I have it so Visual Studio doesn't keep re-creating this folder that I never use. It's annoying ot keep looking and unnecessary.
How to get rid of VSMacros80 folder from project root?
CC BY-SA 2.5
null
2008-08-26T13:30:27.923
2014-03-20T09:01:06.340
null
null
2,993
[ "visual-studio" ]
28,022
2
null
27,998
17
null
When you build the DLL and the module that will use the DLL, have some kind of #define that you can use to distinguish between one and the other, then you can do something like this in your class header file: ``` #if defined( BUILD_DLL ) #define IMPORT_EXPORT __declspec(dllexport) #else #define IMPORT_EXPORT _...
null
CC BY-SA 2.5
null
2008-08-26T13:26:55.560
2008-08-26T13:26:55.560
null
null
1,821
null
28,031
2
null
27,972
1
null
> > Therefore I am assuming JavaScript needs access to your cookies. All HTTP requests from your browser transmit your cookie information for the site in question. JavaScript can both set and read cookies. Cookies are not by definition required for Ajax applications, but they are required for most web applications to ...
null
CC BY-SA 2.5
null
2008-08-26T13:31:37.670
2008-08-26T13:31:37.670
null
null
137
null
28,032
2
null
27,972
2
null
As clarification - from the server's perspective, the page that is requested by an AJAX request is essentially no different to a standard HTTP get request done by the user clicking on a link. All the normal request properties: user-agent, ip, session, cookies, etc. are passed to the server.
null
CC BY-SA 2.5
null
2008-08-26T13:31:41.167
2008-08-26T13:31:41.167
null
null
2,975
null
28,033
1
null
null
2
297
I have a backup of an SQL Server DB in .bak format which I've successfully managed to restore to a local instance of SQL Server Express. I now want to export both the structure and data in a format that MySQL will accept. The tools that I use for MySQL management typically allow me to import/export .sql files, but unfo...
SQL Server to MySQL
CC BY-SA 2.5
0
2008-08-26T13:31:55.330
2009-12-08T00:11:57.047
2009-12-08T00:11:57.047
76,337
1,025
[ "sql-server", "database" ]
28,051
1
28,055
null
15
12,355
Suppose you have 2 different ASP.NET applications in IIS. Also, you have some ASCX controls that you want to share across these 2 applications. What's the best way to create a "user control library", so that you can use the same control implementation in the 2 applications, withuot having to duplicate code? Controls ...
Best way to share ASP.NET .ascx controls across different website applications?
CC BY-SA 3.0
0
2008-08-26T13:38:04.160
2015-12-03T19:47:07.977
2012-09-12T11:05:23.837
1,288
2,868
[ "asp.net" ]
28,039
2
null
25,566
0
null
How about looping over all arrays t of n integers (n-tuples of integers are countable, so this is doable though it's an infinite loop of course), and for each of these: - - To check that two arrays a and b of length n contain the same elements, how about the following recursive algorithm: loop over all couples (i,j)...
null
CC BY-SA 2.5
null
2008-08-26T13:33:58.990
2008-08-26T14:02:46.207
2008-08-26T14:02:46.207
2,638
2,638
null
28,034
2
null
1,376
10
null
There's a couple of small cleanups you can make... ``` package { import flash.filesystem.File; public class UserUtil { public static function get currentOSUser():String { var userDir:String = File.userDirectory.nativePath; var userName:String = userDir.substr(userDi...
null
CC BY-SA 3.0
null
2008-08-26T13:32:08.387
2016-02-07T00:27:14.570
2016-02-07T00:27:14.570
2,921,691
3,023
null
28,065
2
null
28,051
1
null
An alternative is to use your source control tool to "share" the ASCX controls between your webapps. This will allow you to make changes to the controls in either application and have the source control ensure the changes are reflected in the our webapps.
null
CC BY-SA 2.5
null
2008-08-26T13:43:53.680
2008-08-26T13:43:53.680
null
null
1,453
null
28,059
2
null
79
3
null
I used the update url and I installed the JavaHL adapter, the Subclipse project itself the SVNKit adapter BETA. After this it worked fine for me, this is for linux platform hope it works for you.
null
CC BY-SA 2.5
null
2008-08-26T13:41:09.363
2008-08-26T13:41:09.363
null
null
3,050
null
28,001
2
null
5,511
11
null
I've been using an attached property to allow the user to use the up and down keys to change the values in the text box. To use it, you just use ``` <TextBox local:TextBoxNumbers.SingleDelta="1">100</TextBox> ``` This doesn't actually address the validation issues that are referred to in this question, but it addres...
null
CC BY-SA 3.0
null
2008-08-26T13:20:52.643
2016-02-07T17:50:05.983
2016-02-07T17:50:05.983
2,921,691
3,035
null
28,052
2
null
28,002
15
null
C-style casts conflate const_cast, static_cast, and reinterpret_cast. I wish C++ didn't have C-style casts. C++ casts stand out properly (as they should; casts are normally indicative of doing something bad) and properly distinguish between the different kinds of conversion that casts perform. They also permit simil...
null
CC BY-SA 2.5
null
2008-08-26T13:38:35.360
2008-08-26T13:38:35.360
null
null
2,131
null
28,055
2
null
28,051
6
null
You would need to create composite controls instead of .ASCX controls if you wanted to be able to use them in separate projects.
null
CC BY-SA 2.5
null
2008-08-26T13:39:47.870
2008-08-26T13:39:47.870
null
null
1,219
null
28,067
2
null
26,595
27
null
A word of caution: ``` if foo: # do something ``` Is exactly the same as: ``` if x is not None: # do something ``` The former is a boolean value test and can evaluate to false in different contexts. There are a number of things that represent false in a boolean value tests for example empty containers, bool...
null
CC BY-SA 3.0
null
2008-08-26T13:44:11.183
2012-05-31T11:06:10.340
2012-05-31T11:06:10.340
100,297
2,979
null
28,026
2
null
28,002
90
null
You should look at the article [C++ Programming/Type Casting](http://en.wikibooks.org/wiki/C%2B%2B_Programming/Programming_Languages/C%2B%2B/Code/Statements/Variables/Type_Casting). It contains a good description of all of the different cast types. The following taken from the above link: > const_castconst_cast(expre...
null
CC BY-SA 3.0
null
2008-08-26T13:28:43.793
2014-04-01T18:00:19.530
2014-04-01T18:00:19.530
1,570,282
3,022
null
28,054
2
null
28,002
34
null
FYI, I believe Bjarne Stroustrup is quoted as saying that C-style casts are to be avoided and that you should use static_cast or dynamic_cast if at all possible. [Barne Stroustrup's C++ style FAQ](http://www.stroustrup.com/bs_faq2.html) Take that advice for what you will. I'm far from being a C++ guru.
null
CC BY-SA 3.0
null
2008-08-26T13:39:35.950
2015-03-03T11:19:38.330
2015-03-03T11:19:38.330
2,876,962
2,147
null
28,068
2
null
27,948
3
null
Not enough information... You say you're targeting a "Mobile App" but the reality is that mobile could mean anything from a cell phone with 128x128 resolution to a MID with 800x600 resolution. There is no "safe" resolution for such a wide range, and if you're truly targeting all of them you need to design a custom in...
null
CC BY-SA 2.5
null
2008-08-26T13:45:07.420
2008-08-26T13:45:07.420
null
null
2,915
null
28,093
2
null
26,301
2
null
Quicksort: Until I got to college, I had never questioned whether brute force Bubble Sort was the most efficient way to sort. It just seemed intuitively obvious. But being exposed to non-obvious solutions like Quicksort taught me to look past the obvious solutions to see if something better is available.
null
CC BY-SA 2.5
null
2008-08-26T13:55:08.440
2008-08-26T13:55:08.440
null
null
311
null
28,024
2
null
27,942
0
null
I would not suggest to learn a "modern assembler language". However knowing a little about [MOS 6510](http://en.wikipedia.org/wiki/MOS_Technology_6510) Assembler and browsing through the disassembled [C64](http://en.wikipedia.org/wiki/C64) Kernel, a.k.a. it's OS and BASIC Interpreter, helped me a lot to understand wh...
null
CC BY-SA 2.5
null
2008-08-26T13:27:14.547
2008-08-26T13:27:14.547
null
null
999
null
28,092
1
28,252
null
7
8,265
I have a ListBox that has a style defined for ListBoxItems. Inside this style, I have some labels and a button. One that button, I want to define a click event that can be handled on my page (or any page that uses that style). How do I create an event handler on my WPF page to handle the event from my ListBoxItems s...
WPF Listbox style with a button
CC BY-SA 2.5
0
2008-08-26T13:54:45.167
2009-09-27T22:35:40.887
null
null
3,047
[ "c#", "wpf" ]
28,095
2
null
28,033
1
null
There will be 2 issues: 1) Datatypes. There isn't always a direct analog between an MS SQL type and a MySQL type. For example, MySQL handles timestamps very differently and has the cut-off for when you need to switch between varchar(n) and varchar(max)/text at a different value of n. There are also some small differ...
null
CC BY-SA 2.5
null
2008-08-26T13:55:32.200
2008-08-26T13:55:32.200
null
null
3,043
null
28,096
2
null
28,080
0
null
My current toy project uses dynamic_cast twice; once to work around the lack of multiple dispatch in C++ (it's a visitor-style system that could use multiple dispatch instead of the dynamic_casts), and once to special-case a specific subtype. Both of these are acceptable, in my view, though the former at least stems f...
null
CC BY-SA 2.5
null
2008-08-26T13:55:34.993
2008-08-26T13:55:34.993
null
null
2,131
null
28,098
1
28,111
null
566
1,514,783
How do I convert the value of a PHP variable to string? I was looking for something better than concatenating with an empty string: ``` $myText = $myVar . ''; ``` Like the `ToString()` method in Java or .NET.
PHP equivalent of .NET/Java's toString()
CC BY-SA 4.0
0
2008-08-26T13:56:49.873
2023-02-26T11:48:27.017
2018-12-12T16:08:22.040
431,725
2,680
[ "php", "string" ]
28,080
1
null
null
23
26,765
We often hear/read that one should avoid dynamic casting. I was wondering what would be 'good use' examples of it, according to you? Edit: Yes, I'm aware of [that other thread](https://stackoverflow.com/questions/28002/regular-cast-vs-staticcast-vs-dynamiccast): it is indeed when reading one of the first answers ther...
What are some 'good use' examples of dynamic casting?
CC BY-SA 3.0
0
2008-08-26T13:49:47.957
2017-09-20T00:06:49.633
2017-09-20T00:06:49.633
5,377,495
2,638
[ "c++", "casting", "rtti", "dynamic-cast" ]
28,100
2
null
25,566
1
null
You could always do a Random sort. It works by rearranging all the elements randomly, then checking to see if it's sorted. If not, it randomly resorts them. I don't know how it would fit in big-O notation, but it will definitely be slow!
null
CC BY-SA 2.5
null
2008-08-26T13:57:17.000
2008-08-26T13:57:17.000
null
null
1,365
null
28,104
2
null
28,098
1
null
You can always create a method named .ToString($in) that returns ``` $in . ''; ```
null
CC BY-SA 3.0
null
2008-08-26T13:59:23.470
2014-02-02T10:12:39.497
2014-02-02T10:12:39.497
63,550
3,043
null
28,082
2
null
28,051
0
null
I use StarTeam here and it allows you to "share" objects (files, change requests, requirements etc) across multiple folders. Not sure if Subversion (SVN) has that feature. If it doesn't, here's another trick you can use: create a junction from the primary location of the controls to a location in the other projects. A ...
null
CC BY-SA 2.5
null
2008-08-26T13:49:58.517
2008-08-26T13:49:58.517
null
null
1,453
null
28,111
2
null
28,098
792
null
You can use the [casting operators](http://us3.php.net/manual/en/language.types.type-juggling.php): ``` $myText = (string)$myVar; ``` There are more details for string casting and conversion in the [Strings section](http://us3.php.net/manual/en/language.types.string.php#language.types.string.casting) of the PHP manu...
null
CC BY-SA 2.5
null
2008-08-26T14:01:50.047
2008-08-26T14:01:50.047
null
null
2,314
null
28,115
2
null
28,098
1
null
If you're converting anything other than simple types like integers or booleans, you'd need to write your own function/method for the type that you're trying to convert, otherwise PHP will just print the type (such as array, GoogleSniffer, or Bidet).
null
CC BY-SA 3.0
null
2008-08-26T14:03:35.270
2014-02-02T10:17:41.940
2014-02-02T10:17:41.940
63,550
1,344
null
28,101
2
null
28,098
15
null
Putting it in double quotes should work: ``` $myText = "$myVar"; ```
null
CC BY-SA 3.0
null
2008-08-26T13:58:02.087
2014-02-02T10:11:28.787
2014-02-02T10:11:28.787
63,550
305
null
28,119
2
null
28,098
1
null
PHP is dynamically typed, so like Chris Fournier said, "If you use it like a string it becomes a string". If you're looking for more control over the format of the string then [printf](http://dk1.php.net/printf) is your answer.
null
CC BY-SA 3.0
null
2008-08-26T14:04:33.457
2014-02-02T10:19:21.807
2014-02-02T10:19:21.807
63,550
2,443
null
28,110
1
28,184
null
3
13,821
I have a large table with 1 million+ records. Unfortunately, the person who created the table decided to put dates in a `varchar(50)` field. I need to do a simple date comparison - ``` datediff(dd, convert(datetime, lastUpdate, 100), getDate()) < 31 ``` But it fails on the `convert()`: ``` Conversion failed when c...
SQL Server DateTime conversion failure
CC BY-SA 3.0
null
2008-08-26T14:01:43.090
2018-08-26T10:48:32.057
2017-05-23T11:46:49.353
-1
357
[ "sql-server", "datetime" ]
28,121
2
null
17,106
30
null
I think Oxygen ([http://www.oxygenxml.com/](http://www.oxygenxml.com/)) does it as well, but that's another commerical product. It's a nice one, though... I'd strongly recommend it for anyone doing a lot of XML work. It comes in a nice Eclipse plugin, too. I do believe there is a free, fully-featured 30 day trial.
null
CC BY-SA 2.5
null
2008-08-26T14:05:46.763
2008-08-26T14:05:46.763
null
null
3,044
null
28,118
2
null
26,301
3
null
[Minimax](http://en.wikipedia.org/wiki/Minimax) taught me that chess programs aren't smart, they can just think more moves ahead than you can.
null
CC BY-SA 2.5
null
2008-08-26T14:04:17.420
2010-08-17T16:06:45.290
2010-08-17T16:06:45.290
1,632
1,632
null
28,122
2
null
26,301
0
null
@Krishna Kumar The bitwise solution is even more fun than the recursive solution.
null
CC BY-SA 3.0
null
2008-08-26T14:05:57.200
2012-07-03T14:46:47.413
2012-07-03T14:46:47.413
142,162
1,799
null