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
2,825
2
null
2,811
3
null
try ``` SELECT 1 AS Tag, 0 AS Parent, AccountNumber AS [Root!1!AccountNumber!element] FROM Location.LocationMDAccount WHERE LocationID = 'long-guid-here' FOR XML EXPLICIT ```
null
CC BY-SA 3.0
null
2008-08-05T20:51:03.547
2017-05-21T15:48:10.330
2017-05-21T15:48:10.330
1,450,348
289
null
2,831
2
null
1,760
6
null
xUnit.net looks like it provides a slightly different approach to NUnit, MbUnit, and [MSTest](https://en.wikipedia.org/wiki/Visual_Studio_Unit_Testing_Framework), which is interesting. In my search for an RSpec-like solution (because I the RSpec), I also came across [NSpec](http://nspec.tigris.org/), which looks a bit...
null
CC BY-SA 4.0
null
2008-08-05T20:53:00.903
2020-07-30T11:16:51.963
2020-07-30T11:16:51.963
63,550
234
null
2,822
2
null
2,815
2
null
I couldn't figure out how to get the cookies to work either, but I was able to get to my status page in my browser while I was logged out, so I assume this will work once stackoverflow goes public. This is an interesting idea, but won't you also pick up diffs of the underlying html code? Do you have a strategy to avo...
null
CC BY-SA 2.5
null
2008-08-05T20:46:22.930
2008-08-05T20:46:22.930
null
null
75
null
2,832
2
null
2,811
0
null
Try this, Chris: ``` SELECT AccountNumber as [clientId] FROM Location.Location root WHERE LocationId = 'long-guid-here' FOR XML AUTO, ELEMENTS ``` TERRIBLY SORRY! I mixed up what you were asking for. I prefer the XML AUTO just for ease of maintainance, but I believe either one is effective. My apolog...
null
CC BY-SA 2.5
null
2008-08-05T20:53:13.230
2008-08-05T21:58:18.463
2008-08-05T21:58:18.463
318
318
null
2,834
2
null
2,811
0
null
I got it with: ``` select 1 as tag, null as parent, AccountNumber as 'root!1!clientID!element' from Location.LocationMDAccount where locationid = 'long-guid-here' for xml explicit ```
null
CC BY-SA 3.0
null
2008-08-05T20:53:19.157
2013-01-09T05:42:01.790
2013-01-09T05:42:01.790
1,471,203
448
null
2,835
2
null
2,742
13
null
I've only done a small bit of coding in Erlang but I found the most useful method was just to write the code in a text editor and have a terminal open ready to build my code as I need to (this was in Linux, but a similar idea would work in Windows, I'm sure). Your question didn't mention it, but if you're looking for ...
null
CC BY-SA 2.5
null
2008-08-05T20:54:06.660
2009-08-07T15:40:46.410
2009-08-07T15:40:46.410
271
271
null
2,840
1
2,843
null
42
7,380
How do I page results in SQL Server 2005? I tried it in SQL Server 2000, but there was no reliable way to do this. I'm now wondering if SQL Server 2005 has any built in method? What I mean by paging is, for example, if I list users by their username, I want to be able to only return the first 10 records, then the nex...
Paging SQL Server 2005 Results
CC BY-SA 3.0
0
2008-08-05T20:57:00.787
2018-02-22T17:01:24.063
2012-05-04T09:48:29.470
1,039,608
383
[ "sql", "sql-server-2005", "paging" ]
2,823
2
null
564
21
null
Regarding Java 1.5 and [autoboxing](http://en.wikipedia.org/wiki/Autoboxing#Autoboxing) there is an important "quirk" that comes to play when comparing Integer objects. In Java, Integer objects with the values -128 to 127 are immutable (that is, for one particular integer value, say 23, all Integer objects instantiate...
null
CC BY-SA 2.5
null
2008-08-05T20:49:13.017
2008-08-05T20:54:33.337
2008-08-05T20:54:33.337
446
446
null
2,850
2
null
2,844
585
null
Use the ll (el-el) long-long modifier with the u (unsigned) conversion. (Works in windows, GNU). ``` printf("%llu", 285212672); ```
null
CC BY-SA 3.0
null
2008-08-05T21:02:35.237
2012-04-25T22:13:14.720
2012-04-25T22:13:14.720
32,453
200
null
2,843
2
null
2,840
36
null
You can use `the Row_Number()` function. Its used as follows: ``` SELECT Row_Number() OVER(ORDER BY UserName) As RowID, UserFirstName, UserLastName FROM Users ``` From which it will yield a result set with a `RowID` field which you can use to page between. ``` SELECT * FROM ( SELECT Row_Number() OVER(ORDER BY...
null
CC BY-SA 2.5
null
2008-08-05T20:59:21.563
2009-04-15T19:03:06.910
2009-04-15T19:03:06.910
36
36
null
2,839
2
null
2,785
77
null
Karl is absolutely correct, there is no need to set objects to null after use. If an object implements `IDisposable`, just make sure you call `IDisposable.Dispose()` when you're done with that object (wrapped in a `try`..`finally`, or, a `using()` block). But even if you don't remember to call `Dispose()`, the finalise...
null
CC BY-SA 4.0
null
2008-08-05T20:56:28.667
2018-11-28T12:51:42.013
2018-11-28T12:51:42.013
419
419
null
2,854
2
null
2,809
0
null
[OmniAudit](http://www.krell-software.com/omniaudit/index.asp) is a commercial package which implments auditng across an entire database. A free method would be to write a trigger for each table which addes entries to an audit table when fired.
null
CC BY-SA 2.5
null
2008-08-05T21:04:47.153
2008-08-05T21:04:47.153
null
null
383
null
2,851
2
null
2,844
2
null
Non-standard things are always strange :) for the long long portion under GNU it's `L`, `ll` or `q` and under windows I believe it's `ll` only
null
CC BY-SA 2.5
null
2008-08-05T21:03:07.810
2008-08-05T21:03:07.810
null
null
269
null
2,811
1
2,825
null
13
4,484
I have a table with a structure like the following: --- | LocationID | AccountNumber | | ---------- | ------------- | | long-guid-here | 12345 | | long-guid-here | 54321 | To pass into another stored procedure, I need the XML to look like this: ``` <root> <clientID>12345</clientID> <clientID>54321</c...
SQL Server 2005 For XML Explicit - Need help formatting
CC BY-SA 4.0
null
2008-08-05T20:35:56.150
2020-12-16T21:16:50.043
2020-12-16T21:16:50.043
1,367,454
448
[ "sql", "xml", "sql-server-2005", "formatting", "for-xml" ]
2,855
2
null
2,840
0
null
I believe you'd need to perform a separate query to accomplish that unfortionately. I was able to accomplish this at my previous position using some help from this page: [Paging in DotNet 2.0](https://web.archive.org/web/20210510021915/http://aspnet.4guysfromrolla.com/articles/031506-1.aspx) They also have it pulling...
null
CC BY-SA 2.5
null
2008-08-05T21:05:10.863
2008-08-05T21:05:10.863
null
null
36
null
2,844
1
2,850
null
450
942,307
``` #include <stdio.h> int main() { unsigned long long int num = 285212672; //FYI: fits in 29 bits int normalInt = 5; printf("My number is %d bytes wide and its value is %ul. A normal number is %d.\n", sizeof(num), num, normalInt); return 0; } ``` Output: ``` My number is 8 bytes wide and its value i...
How do you format an unsigned long long int using printf?
CC BY-SA 4.0
0
2008-08-05T20:59:29.330
2022-09-13T22:20:13.030
2018-09-14T02:32:40.570
3,650,362
432
[ "c", "syntax", "printf", "format-specifiers", "long-long" ]
2,842
2
null
2,809
5
null
SQL Server 2000 does not keep track of this information for you. There may be creative / fuzzy ways to guess what this date was depending on your database model. But, if you are talking about 1 table with no relation to other data, then you are out of luck.
null
CC BY-SA 2.5
null
2008-08-05T20:58:17.477
2008-08-05T20:58:17.477
null
null
449
null
2,873
1
2,927
null
69
56,970
I'm working on a project where I'm coding in C in a UNIX environment. I've been using the lint tool to check my source code. Lint has been around a long time (since 1979), can anyone suggest a more recent code analysis tool I could use ? Preferably a tool that is free.
Choosing a static code analysis tool
CC BY-SA 2.5
0
2008-08-05T21:19:40.913
2021-07-29T13:26:50.977
null
null
381
[ "c", "unix", "testing" ]
2,867
2
null
805
3
null
The way I have done this is to create a command script file and pass this on the command line via the /b command to psftp.exe. I have also tried this in Perl and have yet to find a neater way of doing it. There is an issue with this method, in that you already have to have accepted the RSA finger-print. If not, the...
null
CC BY-SA 2.5
null
2008-08-05T21:13:47.150
2008-08-06T08:34:55.917
2008-08-06T08:34:55.917
274
274
null
2,878
2
null
2,815
2
null
And here's what works... ``` curl -s --cookie soba=. http://stackoverflow.com/users ```
null
CC BY-SA 2.5
null
2008-08-05T21:22:42.467
2008-08-05T21:22:42.467
null
null
116
null
2,877
2
null
2,767
15
null
I find [Ghost Doc](http://www.roland-weigelt.de/ghostdoc/) to be very useful. > GhostDoc is a free add-in for Visual Studio that automatically generates XML documentation comments for C#. Either by using existing documentation inherited from base classes or implemented interfaces, or by deducing comments from n...
null
CC BY-SA 2.5
null
2008-08-05T21:22:06.867
2008-08-05T21:22:06.867
null
null
233
null
2,862
2
null
2,756
9
null
I bounce about between Mac, Windows and Ubuntu and while Emacs used to be my editor of choice, I'm finding that in my old age I prefer to something GUI-based (using command-line for the shell is still fine by me). My preferred editor is [Komodo Edit](http://www.activestate.com/Products/komodo_ide/komodo_edit.mhtml), wh...
null
CC BY-SA 2.5
null
2008-08-05T21:10:30.353
2008-08-05T21:10:30.353
null
null
216
null
2,881
2
null
2,871
-1
null
If you have a byte[] you should be able to use the BinaryReader class and set values on NewStuff using the available ReadX methods.
null
CC BY-SA 2.5
null
2008-08-05T21:24:27.283
2008-08-05T21:24:27.283
null
null
449
null
2,890
2
null
2,809
1
null
You can't check for changes without some sort of audit mechanism. You are looking to extract information that ha not been collected. If you just need to know when a record was added or edited, adding a datetime field that gets updated via a trigger when the record is updated would be the simplest choice. If you also...
null
CC BY-SA 2.5
null
2008-08-05T21:32:01.013
2008-08-05T21:32:01.013
null
null
206
null
2,880
2
null
2,786
9
null
@Chris I have found that Visual Studio is the best IDE for developing against .NET -- I think the best way to target Mono is really just to develop and build in Visual Studio under Windows then just run those binaries directly on Linux (or whatever other Mono platform you are using). There are free versions of Visual ...
null
CC BY-SA 2.5
null
2008-08-05T21:23:45.490
2008-08-05T21:23:45.490
null
null
327
null
2,871
1
2,887
null
95
62,123
What would be the best way to fill a C# struct from a byte[] array where the data was from a C/C++ struct? The C struct would look something like this (my C is very rusty): ``` typedef OldStuff { CHAR Name[8]; UInt32 User; CHAR Location[8]; UInt32 TimeStamp; UInt32 Sequence; CHAR Tracking[16];...
Reading a C/C++ data structure in C# from a byte array
CC BY-SA 3.0
0
2008-08-05T21:19:03.147
2018-08-30T14:44:24.823
2016-02-07T01:06:32.437
2,921,691
206
[ "c#", ".net", "data-structures", "marshalling" ]
2,883
2
null
2,773
5
null
I had followed a different tutorial on setting up my xen on ubuntu before 8.04 but now upgraded to 8.04. I used the extra line in my cfg as folows: ``` extra = ' TERM=xterm xencons=tty console=tty1' ``` It allows me to "xm console hostname" from dom0. I think this was from a problem with the xen setup in the version...
null
CC BY-SA 2.5
null
2008-08-05T21:27:45.763
2011-03-02T02:28:39.917
2011-03-02T02:28:39.917
60,777
360
null
2,874
1
null
null
35
5,307
I have a control that is modelled on a . I want to render the control so that the control looks like that of a standard . Specifically, I have followed the MSDN documentation and all the rendering of the control is correct except for rendering when the control is disabled. Just to be clear, this is for a system with ...
How to render a control to look like ComboBox with Visual Styles enabled?
CC BY-SA 3.0
0
2008-08-05T21:19:57.170
2013-11-01T16:26:52.507
2013-11-01T16:26:52.507
2,416,538
441
[ "c#", ".net", "winforms" ]
2,897
2
null
2,873
16
null
For C code, you definitely should definitely use [Flexelint](http://www.gimpel.com/html/lintinfo.htm). I used it for nearly 15 years and swear by it. One of the really great features it has is that warnings can be selectively turned off and on via comments in the code ("/* lint -e123*/"). This turned out to be a pow...
null
CC BY-SA 2.5
null
2008-08-05T21:42:22.427
2008-08-05T21:42:22.427
null
null
116
null
2,898
1
2,905
null
51
130,001
Let me preface this question by saying I use TextMate on Mac OSX for my text needs and I am in love with it. Anything comparable on the Linux platform? I'll mostly use it for coding python/ruby. Doing a google search yielded outdated answers. Edit: Since there has been some concern about the 'merit' of this questi...
Text Editor For Linux (Besides Vi)?
CC BY-SA 2.5
0
2008-08-05T21:42:37.763
2021-01-13T14:01:19.757
2012-07-28T00:24:43.417
168,868
25
[ "linux", "editor" ]
2,895
2
null
2,844
0
null
Well, one way is to compile it as x64 with VS2008 This runs as you would expect: ``` int normalInt = 5; unsigned long long int num=285212672; printf( "My number is %d bytes wide and its value is %ul. A normal number is %d \n", sizeof(num), num, normalInt); ``` For 32 bit code, we need to us...
null
CC BY-SA 3.0
null
2008-08-05T21:40:24.757
2012-06-25T16:23:00.967
2012-06-25T16:23:00.967
null
224
null
2,887
2
null
2,871
126
null
From what I can see in that context, you don't need to copy `SomeByteArray` into a buffer. You simply need to get the handle from `SomeByteArray`, pin it, copy the `IntPtr` data using `PtrToStructure` and then release. No need for a copy. That would be: ``` NewStuff ByteArrayToNewStuff(byte[] bytes) { GCHandle ha...
null
CC BY-SA 4.0
null
2008-08-05T21:29:39.647
2018-08-30T14:44:24.823
2018-08-30T14:44:24.823
424,129
42
null
2,884
2
null
2,786
3
null
My first instinct would be the rather unhelpful "Install Linux". You are somewhat [swimming against the current](http://tirania.org/blog/archive/2006/Jan-11.html) to try and develop in mono under windows. Installing GTK and everything is a bit of a bother in my experience. If you do feel like using linux, then you cou...
null
CC BY-SA 2.5
null
2008-08-05T21:27:58.183
2008-08-05T21:27:58.183
null
null
170
null
2,901
2
null
2,872
13
null
method displays one (or more) forms and initiates the standard message loop which runs until all the forms are closed. You cannot force a return from that method except by closing all your forms or forcing an application shutdown. You can, however, pass an (instad of a new Form()) to Application.Run method and Appli...
null
CC BY-SA 2.5
null
2008-08-05T21:45:17.663
2008-08-05T21:45:17.663
null
null
227
null
2,900
1
2,975
null
29
9,764
I am getting the following error: > Access denied for user 'apache'@'localhost' (using password: NO) When using the following code: ``` <?php include("../includes/connect.php"); $query = "SELECT * from story"; $result = mysql_query($query) or die(mysql_error()); echo "<h1>Delete Story</h1>"; if (mysql_num_rows(...
MySQL/Apache Error in PHP MySQL query
CC BY-SA 3.0
0
2008-08-05T21:45:11.033
2021-03-04T02:52:21.673
2018-03-01T16:07:28.547
6,906,028
454
[ "php", "mysql", "apache" ]
2,903
2
null
2,898
2
null
SciTE [http://www.scintilla.org/SciTE.html](http://www.scintilla.org/SciTE.html)
null
CC BY-SA 2.5
null
2008-08-05T21:46:29.220
2008-08-05T21:46:29.220
null
null
455
null
2,910
2
null
2,767
4
null
[Sonic File Finder](http://jens-schaller.de/sonictools/sonicfilefinder/) for when you have loads of files in your solutions and searching for them in the solution explorer becomes a pain in the wrist. You might also find [DPack](http://www.usysware.com/dpack/) interesting. Several tools and enhancements rolled into on...
null
CC BY-SA 2.5
null
2008-08-05T21:55:00.950
2008-08-05T21:55:00.950
null
null
227
null
2,908
2
null
2,900
1
null
Just to check, if you use this part you get an error? ``` <?php include("../includes/connect.php"); $query = "SELECT * from story"; $result = mysql_query($query) or die(mysql_error()); ``` If so, do you still get an error if you copy and paste one of those Inserts into this page, I am trying to see if it's local t...
null
CC BY-SA 3.0
null
2008-08-05T21:52:44.123
2016-02-07T01:04:38.680
2016-02-07T01:04:38.680
2,921,691
1,384,652
null
2,872
1
2,901
null
26
1,454
I would like to have a main processing thread (non GUI), and be able to spin off GUIs in their own background threads as needed, and having my main non GUI thread keep working. Put another way, I want my main non GUI-thread to be the owner of the GUI-thread and not vice versa. I'm not sure this is even possible with ...
Possible to "spin off" several GUI threads? (Not halting the system at Application.Run)
CC BY-SA 3.0
0
2008-08-05T21:19:37.280
2016-02-07T01:06:01.593
2016-02-07T01:06:01.593
2,921,691
446
[ "c#", ".net", "winforms" ]
2,905
2
null
2,898
43
null
Emacs is a wonderful text editor. It has huge power once you become a power user. You can access a shell, have as many files open as you want in as many sub-windows and an extremely powerful scripting support that lets you add all kinds of neat features. I have been using a ruby-mode which adds syntax highlighting a...
null
CC BY-SA 2.5
null
2008-08-05T21:49:12.180
2008-08-05T22:21:48.090
2008-08-05T22:21:48.090
122
122
null
2,914
1
2,917
null
152
129,115
Occasionally, I've come across a webpage that tries to pop open a new window (for user input, or something important), but the popup blocker prevents this from happening. What methods can the calling window use to make sure the new window launched properly?
How can I detect if a browser is blocking a popup?
CC BY-SA 3.0
0
2008-08-05T22:01:36.977
2022-09-16T12:36:30.633
2022-02-05T19:48:38.050
1,595,451
434
[ "javascript", "html", "popup" ]
2,911
2
null
2,900
1
null
Does the apache user require a password to connect to the database? If so, then the fact that it says "using password: NO" would lead me to believe that the code is trying to connect without a password. If, however, the apache user doesn't require a password, a double-check of the permissions may be a good idea (whic...
null
CC BY-SA 3.0
null
2008-08-05T21:56:20.607
2018-02-22T16:58:33.257
2018-02-22T16:58:33.257
305,953
271
null
2,915
2
null
2,900
1
null
If indeed you are able to insert using the same connection calls, your problem most likely lies in the user "apache" not having SELECT permissions on the database. If you have phpMyAdmin installed you can look at the permissions for the user in the Privileges pane. phpMyAdmin also makes it very easy to modify the permi...
null
CC BY-SA 4.0
null
2008-08-05T22:02:23.777
2021-03-04T02:52:21.673
2021-03-04T02:52:21.673
9,193,372
457
null
2,913
1
2,918
null
17
2,043
Does anyone have some good hints for writing test code for database-backend development where there is a heavy dependency on state? Specifically, I want to write tests for code that retrieve records from the database, but the answers will depend on the data in the database (which may change over time). Do people usua...
How to Test Web Code?
CC BY-SA 2.5
0
2008-08-05T21:58:51.927
2008-09-10T12:02:14.610
2008-08-23T15:19:50.650
2,134
277
[ "database", "testing" ]
2,917
2
null
2,914
191
null
If you use JavaScript to open the popup, you can use something like this: ``` var newWin = window.open(url); if(!newWin || newWin.closed || typeof newWin.closed=='undefined') { //POPUP BLOCKED } ```
null
CC BY-SA 3.0
null
2008-08-05T22:03:27.953
2018-02-22T16:54:20.377
2018-02-22T16:54:20.377
305,953
453
null
2,919
2
null
2,913
1
null
I have the exact same problem with my work and I find that the best idea is to have a PHP script to re-create the database and then a separate script where I throw crazy data at it to see if it breaks it. I have not ever used any Unit testing or suchlike so cannot say if it works or not sorry.
null
CC BY-SA 2.5
null
2008-08-05T22:03:33.260
2008-08-05T22:03:33.260
null
null
1,384,652
null
2,918
2
null
2,913
6
null
You should look into DBUnit, or try to find a PHP equivalent (there must be one out there). You can use it to prepare the database with a specific set of data which represents your test data, and thus each test will no longer depend on the database and some existing state. This way, each test is self contained and wi...
null
CC BY-SA 2.5
null
2008-08-05T22:03:29.750
2008-08-05T22:03:29.750
null
null
122
null
2,923
2
null
2,913
1
null
If you can setup the database with a known quantity prior to running the tests and tear down at the end, then you'll know what data you are working with. Then you can use something like Selenium to easily test from your UI (assuming web-based here, but there are a lot of UI testing tools out there for other UI-flavour...
null
CC BY-SA 2.5
null
2008-08-05T22:08:11.050
2008-08-05T22:08:11.050
null
null
376
null
2,930
2
null
1,005
-2
null
A quick hack you can consider is doing a chmod on the file you're editing, save with vim, and then chmod back to what the file was originally. ``` ls -l test.file (to see the permissions of the file) chmod 777 test.file [This is where you save in vim] chmod xxx test.file (restore the permissions you found in the first...
null
CC BY-SA 2.5
null
2008-08-05T22:20:58.403
2008-08-05T22:20:58.403
null
null
306
null
2,938
2
null
2,756
10
null
Joey, I believe anything is lighter than Eclipse! :o)
null
CC BY-SA 2.5
null
2008-08-05T22:34:56.440
2008-08-05T22:34:56.440
null
null
431
null
2,933
1
2,937
null
305
209,313
Python works on multiple platforms and can be used for desktop and web applications, thus I conclude that there is some way to compile it into an executable for Mac, Windows and Linux. The problem being I have no idea where to start or how to write a GUI with it, can anybody shed some light on this and point me in the...
Create a directly-executable cross-platform GUI app using Python
CC BY-SA 4.0
0
2008-08-05T22:26:00.797
2021-08-28T08:04:40.667
2020-10-11T06:50:09.827
9,361,512
1,384,652
[ "python", "user-interface", "deployment", "tkinter", "release-management" ]
2,920
2
null
2,815
6
null
From [Mark Harrison](https://stackoverflow.com/questions/2815/#2878) > And here's what works...curl -s --cookie soba=. [https://stackoverflow.com/users](https://stackoverflow.com/users) And for wget: ``` wget --no-cookies --header "Cookie: soba=(LookItUpYourself)" https://stackoverflow.com/users/30/myProfile.html ```
null
CC BY-SA 2.5
null
2008-08-05T22:04:12.947
2008-08-05T22:04:12.947
2020-06-20T09:12:55.060
-1
30
null
2,944
2
null
2,786
15
null
I'd recommend getting VMWare Player and using the free Mono development platform image that is provided on the website. [Download Mono](http://www.go-mono.com/mono-downloads/download.html) Setup time for this will be minimal, and it will also allow you to get your code working in .NET and then focus on porting issues...
null
CC BY-SA 3.0
null
2008-08-05T22:43:57.013
2013-01-27T12:20:05.970
2013-01-27T12:20:05.970
null
71
null
2,931
1
null
null
25
1,539
I have been working with 2.3 for the last year or so for a peer-to-peer computing platform I am developing. I am migrating to 2.5 and in the process I am trying to clean up a lot of my use of . For the most part, I approached with a attitude. I used it to jumpstart creating and managing my peer-to-peer overlay netw...
Getting started with a custom JXTA PeerGroup
CC BY-SA 3.0
0
2008-08-05T22:23:16.183
2021-06-15T15:55:33.300
2015-10-27T09:35:19.443
2,553,431
360
[ "java", "p2p", "jxta" ]
2,941
2
null
2,933
1
null
You don't need to python for Mac/Windows/Linux. It is an interpreted language, so you simply need to have the Python interpreter installed on the system of your choice (it is available for all three platforms). As for a GUI library that works cross platform, Python's [Tk/Tcl](http://www.tcl.tk/) widget library works...
null
CC BY-SA 2.5
null
2008-08-05T22:40:17.473
2008-08-05T22:52:16.560
2008-08-05T22:52:16.560
92
92
null
2,927
2
null
2,873
35
null
Don't overlook the compiler itself. Read the compiler's documentation and find all the warnings and errors it can provide, and then enable as many as make sense for you. Also make sure to tell your compiler to treat warnings like errors so you're forced to fix them right away (`-Werror` on gcc). By the way, don't be fo...
null
CC BY-SA 4.0
null
2008-08-05T22:17:24.777
2021-07-29T13:26:50.977
2021-07-29T13:26:50.977
null
103
null
2,940
2
null
2,786
1
null
I liked the idea of trying to use MonoDevelop mostly just to make sure my stuff would work against the Mono runtimes. I guess it would also be possible to get crazy with msbuild and write some custom targets that tried to build against Mono, but that's basically emulating the now-defunct plug-in's functionality which ...
null
CC BY-SA 3.0
null
2008-08-05T22:37:07.107
2013-01-09T05:41:41.850
2013-01-09T05:41:41.850
1,471,203
404
null
2,943
2
null
2,900
1
null
> Just to check, if you use just this part you get an error?If so, do you still get an error if you copy and paste one of those Inserts into this >page, I am trying to see if it's local to the page or that actual line.Also, can you post a copy of the connection calls (minus passwords), unless the inserts >use exactly t...
null
CC BY-SA 3.0
null
2008-08-05T22:40:40.720
2016-02-07T01:04:51.153
2016-02-07T01:04:51.153
2,921,691
454
null
2,950
2
null
1,949
5
null
I'd been wrangling over the same question whilst retro fitting LINQ to SQL over a legacy DB. Our database is a bit of a whopper (150 tables) and after some thought and experimentation I elected to use multiple DataContexts. Whether this is considered an anti-pattern remains to be seen, but for now it makes life managea...
null
CC BY-SA 2.5
null
2008-08-05T22:51:08.217
2011-02-02T12:23:25.680
2011-02-02T12:23:25.680
419
419
null
2,947
2
null
104
9
null
> I guess in a managed environment, a leak would be you keeping an unnecessary reference to a large chunk of memory around. Absolutely. Also, not using the .Dispose() method on disposable objects when appropriate can cause mem leaks. The easiest way to do it is with a using block because it automatically execute...
null
CC BY-SA 2.5
null
2008-08-05T22:47:49.440
2008-08-05T22:47:49.440
null
null
357
null
2,962
2
null
2,872
0
null
I'm sure this is possible if you hack at it hard enough, but I'd suggest it is not a good idea. 'Windows' (that you see on the screen) are highly coupled to processes. That is, each process which displays any GUI is expected to have a Message Loop, which processes all of the messages which are involved with creating a...
null
CC BY-SA 2.5
null
2008-08-05T23:22:00.743
2008-08-05T23:22:00.743
null
null
234
null
2,968
1
2,985
null
55
67,613
For parsing player commands, I've most often used the [split](http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#split%28java.lang.String%29) method to split a string by delimiters and then to then just figure out the rest by a series of `if`s or `switch`es. What are some different ways of parsing strings i...
What are the different methods to parse strings in Java?
CC BY-SA 3.0
0
2008-08-05T23:49:53.560
2015-10-27T10:00:40.993
2014-05-13T17:34:45.040
362
362
[ "java", "string", "parsing" ]
2,969
2
null
2,968
19
null
I really like regular expressions. As long as the command strings are fairly simple, you can write a few regexes that could take a few pages of code to manually parse. I would suggest you check out [http://www.regular-expressions.info](http://www.regular-expressions.info) for a good intro to regexes, as well as specif...
null
CC BY-SA 3.0
null
2008-08-05T23:54:05.533
2012-04-03T05:18:33.757
2012-04-03T05:18:33.757
1,035,257
124
null
2,959
1
52,219,708
null
75
2,508
I have configured Indexing Service to index my files, which also include scanned images saved as hi-res [TIFF](https://en.wikipedia.org/wiki/TIFF) files. I also installed MS Office 2003+ and configured MS Office Document Imaging (MODI) correctly, so I can perform [OCR](https://en.wikipedia.org/wiki/Optical_character_re...
How to get Indexing Service and MODI to produce Full-text over OCR?
CC BY-SA 4.0
null
2008-08-05T23:16:30.163
2020-10-10T16:17:37.247
2020-10-10T16:17:37.247
9,361,512
227
[ "ocr", "modi", "indexing-service" ]
2,961
2
null
2,658
2
null
It's not that difficult to switch between version control systems. As others have mentioned the important thing is to start using anything as soon as possible. The benefits of using source control over not using source control vastly outweigh the differential benefits between different types of source control. Remembe...
null
CC BY-SA 2.5
null
2008-08-05T23:20:03.510
2008-08-05T23:20:03.510
null
null
332
null
2,937
2
null
2,933
310
null
First you will need some GUI library with Python bindings and then (if you want) some program that will convert your python scripts into standalone executables. Of course, there are many, but the most popular that I've seen in wild are: - [Tkinter](http://wiki.python.org/moin/TkInter)[Tk GUI toolkit](http://www.tcl...
null
CC BY-SA 4.0
null
2008-08-05T22:34:25.397
2020-06-02T08:22:28.690
2020-06-02T08:22:28.690
11,811,255
275
null
2,928
2
null
2,155
84
null
There is also the possibility to use attributes which automatically takes care of the plumbing, as well as providing the ability to easily add constraints. I here present an example from code I use myself in one of my sites. With a constraint I dictate the maximum amount of disk space any one user is allowed to use....
null
CC BY-SA 3.0
null
2008-08-05T22:17:29.610
2016-10-04T15:40:48.040
2016-10-04T15:40:48.040
107,009
446
null
2,975
2
null
2,900
12
null
> And if it matters at all, apache@localhost is not the name of the user account that I use to get into the database. I don't have any user accounts with the name apache in them at all for that matter. If it is saying 'apache@localhost' the username is not getting passed correctly to the MySQL connection. 'apache' is ...
null
CC BY-SA 2.5
null
2008-08-06T00:05:34.790
2008-08-06T00:05:34.790
null
null
204
null
2,971
2
null
2,968
1
null
A simple string tokenizer on spaces should work, but there are really many ways you could do this. Here is an example using a tokenizer: ``` String command = "kick person"; StringTokenizer tokens = new StringTokenizer(command); String action = null; if (tokens.hasMoreTokens()) { action = tokens.nextToken(); } i...
null
CC BY-SA 2.5
null
2008-08-05T23:57:02.577
2008-08-05T23:57:02.577
null
null
122
null
2,973
2
null
2,970
3
null
With a six word character password, he may have been brute forced. That is more likely than his ftp being intercepted, but it could be that too. Start with a stronger password. (8 characters is still fairly weak) See if this link to an internet [security blog](http://blog.modsecurity.org/2008/01/is-your-website.html...
null
CC BY-SA 2.5
null
2008-08-06T00:00:22.180
2008-08-06T00:04:46.867
2008-08-06T00:04:46.867
92
92
null
2,978
2
null
2,970
2
null
Is the site just plain static HTML? i.e. he hasn't managed to code himself an upload page that permits anyone driving by to upload compromised scripts/pages? Why not ask webhost4life if they have any FTP logs available and report the issue to them. You never know, they may be quite receptive and find out for you exact...
null
CC BY-SA 2.5
null
2008-08-06T00:24:23.927
2008-08-06T00:24:23.927
null
null
419
null
2,967
2
null
622
39
null
I recommend a sieve, either the [Sieve of Eratosthenes](http://web.archive.org/web/20140705111241/http://primes.utm.edu/links/programs/sieves/Eratosthenes/C_source_code/) or the [Sieve of Atkin.](http://cr.yp.to/primegen.html) The sieve or Eratosthenes is probably the most intuitive method of finding a list of prime...
null
CC BY-SA 3.0
null
2008-08-05T23:49:43.963
2015-03-12T13:52:14.613
2015-03-12T13:52:14.613
-1
306
null
2,979
2
null
2,898
7
null
I use pico or nano as my "casual" text editor in Linux/Solaris/etc. It's easy to come to grips with, and whilst you lose a couple of rows of text to the menu, at least it's easy to see how to exit, etc. You can even extend nano, I think, and add syntax highlighting.
null
CC BY-SA 2.5
null
2008-08-06T00:26:27.370
2008-08-06T00:26:27.370
null
null
188
null
2,980
2
null
2,933
6
null
Since python is installed on nearly every non-Windows OS by default now, the only thing you really need to make sure of is that all of the non-standard libraries you use are installed. Having said that, it is possible to build executables that include the python interpreter, and any libraries you use. This is likely ...
null
CC BY-SA 2.5
null
2008-08-06T00:29:36.897
2008-08-06T00:29:36.897
null
null
188
null
2,977
2
null
2,968
7
null
I would look at [Java migrations](http://www.google.com/search?q=Zork+in+Java) of [Zork](http://en.wikipedia.org/wiki/Zork), and lean towards a simple [Natural Language Processor](http://en.wikipedia.org/wiki/Natural_language_processing) (driven either by tokenizing or regex) such as the following (from this link): ...
null
CC BY-SA 2.5
null
2008-08-06T00:16:25.020
2008-08-06T16:20:17.193
2008-08-06T16:20:17.193
92
null
null
2,984
2
null
2,873
13
null
I've heard good things about [clang static analyzer](http://clang-analyzer.llvm.org/), which IIRC uses LLVM as it's backend. If that's implemented on your platform, that might be a good choice. From what I understand, it does a bit more than just syntax analysis. "Automatic Bug Finding", for instance.
null
CC BY-SA 3.0
null
2008-08-06T00:40:03.597
2014-05-21T14:28:40.033
2014-05-21T14:28:40.033
104,446
188
null
2,976
2
null
2,970
15
null
Try and gather as much information as you can. See if the host can give you a log showing all the FTP connections that were made to your account. You can use those to see if it was even an FTP connection that was used to make the change and possibly get an IP address. If you're using a prepacked software like Wordpres...
null
CC BY-SA 2.5
null
2008-08-06T00:16:07.797
2008-08-06T00:16:07.797
null
null
204
null
2,986
2
null
2,742
2
null
I like Justin's suggestion, but I'll add to it: this solution is great for learning a language. If you don't rely on something like code-completion, then it forces you to learn the language better. (If you are working with something with a huge API, like Java or Cocoa, then you'll want the code completion, however!) ...
null
CC BY-SA 2.5
null
2008-08-06T00:46:01.480
2008-08-06T00:46:01.480
null
null
188
null
2,987
1
2,992
null
47
16,567
I am writing an application that needs to bring window of an external app to the foreground, and not necessarily steal focus (there is a setting the user can toggle to steal/not steal focus). What is the best way to go about this using the win32 API? I have tried SetForeground() but it always steals focus and does no...
Bringing Window to the Front in C# using Win32 API
CC BY-SA 2.5
0
2008-08-06T00:55:48.277
2011-05-06T14:44:47.903
null
null
324
[ "c#", "winapi" ]
2,985
2
null
2,968
17
null
I assume you're trying to make the command interface as forgiving as possible. If this is the case, I suggest you use an algorithm similar to this: 1. Read in the string Split the string into tokens Use a dictionary to convert synonyms to a common form For example, convert "hit", "punch", "strike", and "kick" all to ...
null
CC BY-SA 2.5
null
2008-08-06T00:42:00.817
2008-08-06T00:42:00.817
null
null
432
null
2,992
2
null
2,987
17
null
SetForegroundWindow is supposed to steal focus and there are certain cases where it will fail. > The SetForegroundWindow function puts the thread that created the specified window into the foreground and activates the window. Keyboard input is directed to the window Try capturing the focus with [SetCapture](http://ms...
null
CC BY-SA 2.5
null
2008-08-06T01:06:45.197
2008-08-06T01:06:45.197
null
null
null
null
2,988
1
2,999
null
17
5,700
What are the most common problems that can be solved with both these data structures? It would be good for me to have also recommendations on books that: - -
What problems can be solved, or tackled more easily, using graphs and trees?
CC BY-SA 3.0
0
2008-08-06T00:56:05.937
2017-03-22T18:37:54.817
2017-03-22T18:37:54.817
1,571,709
861
[ "algorithm", "data-structures", "tree", "computer-science", "graph-theory" ]
2,996
2
null
2,988
1
null
There's a course for such things at my university: [CSE 326](http://www.cs.washington.edu/education/courses/326/). I didn't think the book was too useful, but the projects are fun and teach you a fair bit about implementing some of the simpler structures. As for examples, one of the most common problems (by number of...
null
CC BY-SA 2.5
null
2008-08-06T01:18:12.773
2008-08-06T01:18:12.773
null
null
429
null
3,003
2
null
2,987
2
null
You can try the BringWindowToTop function to not steal focus. I haven't used it, but it seems to be what you're looking for.
null
CC BY-SA 2.5
null
2008-08-06T01:37:37.710
2008-08-06T01:37:37.710
null
null
457
null
3,008
2
null
3,004
5
null
The solution is to delete and re-add BOTH tables to the LINQ to SQL diagram, not just the one you have added the second field and keys to. Alternatively, it appears you can make two associations using the LINQ to SQL interface - just don't try and bundle them into a single association.
null
CC BY-SA 2.5
null
2008-08-06T01:53:45.510
2008-08-06T02:00:24.543
2008-08-06T02:00:24.543
364
364
null
3,009
2
null
36
18
null
Unfortunately, I do not think that there is a clean way to do this in SQL2000. If you narrow your requirements to SQL Server 2005 (and later), then you are in business. You can use the `SQLDependency` class in `System.Data.SqlClient`. See [Query Notifications in SQL Server (ADO.NET)](http://msdn.microsoft.com/en-us/lib...
null
CC BY-SA 3.0
null
2008-08-06T01:54:21.687
2012-05-25T20:42:28.917
2012-05-25T20:42:28.917
63,550
313
null
3,004
1
3,008
null
14
2,264
I am using ASP.NET Dynamic Data for a project and I have a table that has two seperate fields that link to the same foreign key in a different table. This relationship works fine in SQL Server. However, in the LINQ to SQL model in the ASP.NET Dynamic Data model, only the first field's relationship is reflected. If I...
Using ASP.NET Dynamic Data / LINQ to SQL, how do you have two table fields have a relationship to the same foreign key?
CC BY-SA 2.5
null
2008-08-06T01:42:51.333
2008-09-26T19:02:03.573
2008-09-26T19:02:03.573
2,134
364
[ "asp.net", "dynamic-data" ]
2,999
2
null
2,988
17
null
The first thing I think about when I read this question is: and then I think backwards to how I could use them. For example, take two common uses of a tree: - - The DOM, and XML for that matter, resemble tree structures. ![alt text](https://i.stack.imgur.com/bk5RY.gif) It makes sense, too. . A file system, too. ...
null
CC BY-SA 3.0
null
2008-08-06T01:28:13.063
2012-03-28T22:21:18.000
2012-03-28T22:21:18.000
1,219,121
402
null
3,010
2
null
371
12
null
You need a reverse DNS entry. You need to not send the same content to the same user twice. You need to test it with some common webmail and email clients. Personally I ran mine through a freshly installed spam assassin, a trained spam assassin, and multiple hotmail, gmail, and aol accounts. But have you seen that spa...
null
CC BY-SA 2.5
null
2008-08-06T01:54:22.433
2008-08-06T01:54:22.433
null
null
459
null
2,993
1
5,544,777
null
22
10,999
I'm in an environment with a lot of computers that haven't been properly inventoried. Basically, no one knows which IP goes with which mac address and which hostname. So I wrote the following: ``` # This script goes down the entire IP range and attempts to # retrieve the Hostname and mac address and outputs them # int...
Reverse DNS in Ruby?
CC BY-SA 3.0
0
2008-08-06T01:07:52.933
2013-10-11T00:49:43.380
2013-10-11T00:48:37.003
128,421
155
[ "ruby", "sockets", "dns", "nslookup" ]
3,013
2
null
2,709
1
null
You seem to have answered your own question there Nathan ;-) "GetLastInputInfo" is the way to go. One trick is that if your application is running on the desktop, and the user connects to a virtual machine, then GetLastInputInfo will report no activity (since there is no activity on the host machine). This can be dif...
null
CC BY-SA 2.5
null
2008-08-06T01:58:18.353
2008-08-06T01:58:18.353
null
null
49
null
3,019
2
null
3,017
0
null
I don't have Visual Studio installed on my machine anymore (and I'm using Linux), but I do remember that there was an wizard hidden somewhere inside one of the menus that gave access to a class builder. With this wizard, you could define all your classes' details, including methods and attributes. If I remember well, ...
null
CC BY-SA 4.0
null
2008-08-06T02:24:29.130
2019-12-09T18:05:15.310
2019-12-09T18:05:15.310
63,550
431
null
3,012
2
null
2,993
8
null
I would check out `getaddrinfo`. If you replace the line: ``` host_name = Socket.gethostbyname(current_ip) ``` with: ``` host_name = Socket.getaddrinfo(current_ip, 0, Socket::AF_UNSPEC, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)[0][1] ``` The `getaddrinfo` function returns an array of arrays. You can read mo...
null
CC BY-SA 3.0
null
2008-08-06T01:56:58.780
2013-10-11T00:49:16.817
2013-10-11T00:49:16.817
128,421
457
null
3,020
2
null
1,683
11
null
Ive only built 2 applications that used the profile provider. Since then I have stayed away from using it. For both of the apps I used it to store information about the user such as their company name, address and phone number. This worked fine until our client wanted to be able to find a user by one of these fields....
null
CC BY-SA 2.5
null
2008-08-06T02:26:35.333
2008-08-06T02:26:35.333
null
null
468
null
3,021
1
null
null
121
217,574
One of the topics that seems to come up regularly on mailing lists and online discussions is the merits (or lack thereof) of doing a Computer Science Degree. An argument that seems to come up time and again for the negative party is that they have been coding for some number of years and they have never used recursion....
What is recursion and when should I use it?
CC BY-SA 2.5
0
2008-08-06T02:29:51.210
2016-12-26T01:59:29.493
2008-08-25T05:15:53.457
2,134
358
[ "recursion", "computer-science" ]
3,017
1
3,029
null
257
546,627
By "generate", I mean auto-generation of the code necessary for a particular selected (set of) variable(s). But any more explicit explication or comment on good practice is welcome.
How can we generate getters and setters in Visual Studio?
CC BY-SA 4.0
0
2008-08-06T02:15:14.123
2022-06-19T21:36:35.593
2019-12-09T17:56:00.820
63,550
391
[ "c#", "visual-studio", "setter", "getter" ]
3,026
2
null
3,017
6
null
If you are using Visual Studio 2005 and up, you can create a setter/getter real fast using the insert snippet command. Right click on your code, click on (+,), and then choose "prop" from the list.
null
CC BY-SA 4.0
null
2008-08-06T02:35:37.547
2019-12-09T18:07:56.560
2019-12-09T18:07:56.560
63,550
453
null
3,023
2
null
3,017
29
null
By generate, do you mean auto-generate? If that's not what you mean: Visual Studio 2008 has the easiest implementation for this: ``` public PropertyType PropertyName { get; set; } ``` In the background this creates an implied instance variable to which your property is stored and retrieved. However if you want to ...
null
CC BY-SA 2.5
null
2008-08-06T02:31:37.990
2008-08-06T02:31:37.990
null
null
372
null
3,029
2
null
3,017
334
null
Rather than using + , you can also just type `prop` and then hit twice.
null
CC BY-SA 4.0
null
2008-08-06T02:43:21.477
2019-12-09T18:02:25.533
2019-12-09T18:02:25.533
63,550
234
null
3,027
1
null
null
21
2,617
What is the best unobtrusive CAPTCHA for web forms? One that does not involve a UI, rather a non-UI Turing test. I have seen a simple example of a non UI CAPTCHA like the [Nobot](http://www.asp.net/AJAX/AjaxControlToolkit/Samples/NoBot/NoBot.aspx) control from Microsoft. I am looking for a CAPTCHA that does not ask th...
Is there an Unobtrusive Captcha for web forms?
CC BY-SA 2.5
0
2008-08-06T02:36:23.160
2013-01-09T05:40:10.370
2008-08-12T10:37:28.983
1
439
[ "security", "usability", "captcha" ]