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,510
2
null
27,509
-21
null
``` if (somevariable == undefined) { alert('the variable is not defined!'); } ``` You can also make it into a function, as shown [here](http://verens.com/archives/2005/07/25/isset-for-javascript/): ``` function isset(varname){ return(typeof(window[varname]) != 'undefined'); } ```
null
CC BY-SA 2.5
null
2008-08-26T07:27:57.327
2008-08-26T07:27:57.327
null
null
1,662
null
27,511
2
null
27,442
1
null
There are [a](http://code.google.com/p/ar-backup/) [few](http://topfunky.net/svn/shovel/backup.rake) [solutions](http://snippets.dzone.com/posts/show/4777) already on google. I am going to guess that you are using activerecord as your orm? If you are running rails, then you can looks at the Rakefile that it uses for a...
null
CC BY-SA 2.5
null
2008-08-26T07:29:03.033
2008-08-26T07:29:03.033
2017-05-23T12:17:44.467
-1
716
null
27,505
2
null
27,065
153
null
Use the [javap](http://java.sun.com/javase/6/docs/technotes/tools/solaris/javap.html) tool that comes with the JDK. The `-verbose` option will print the version number of the class file. ``` > javap -verbose MyClass Compiled from "MyClass.java" public class MyClass SourceFile: "MyClass.java" minor version: 0 maj...
null
CC BY-SA 3.0
null
2008-08-26T07:16:23.953
2012-03-08T15:22:24.667
2012-03-08T15:22:24.667
-1
988
null
27,519
2
null
27,492
2
null
In the general case (resource management, where resource is not necessarily memory), you need to be familiar with the [RAII pattern](http://en.wikipedia.org/wiki/RAII). This is one of the most important pieces of information for C++ developers.
null
CC BY-SA 2.5
null
2008-08-26T07:37:48.787
2008-08-26T07:37:48.787
null
null
2,150
null
27,529
2
null
27,435
0
null
Thank you. I've used Django with MySQL and it's fine. Choose your database on the features you need. Hard to compare MySQL and Postgres. Better to compare Postgress to SQl Server.
null
CC BY-SA 2.5
null
2008-08-26T07:51:58.643
2008-08-26T07:51:58.643
null
null
534
null
27,513
2
null
27,482
3
null
Strange... I just finished my master thesis, using TexnicCenter and the MikTeX distribution, and comments worked just fine. What build profile do you use? Straight to PDF with `pdflatex`, or via the PS->PDF route? You might want to try the `pdflatex` method. (EDIT): ah, we used Acrobat Pro for commenting, so that's wh...
null
CC BY-SA 2.5
null
2008-08-26T07:32:51.513
2008-08-26T08:49:09.783
2008-08-26T08:49:09.783
1,037
1,037
null
27,502
2
null
25,552
6
null
Have a look at the APIs available in the [java.lang.management](http://java.sun.com/javase/6/docs/api/java/lang/management/package-summary.html) package. For example: - `OperatingSystemMXBean.getSystemLoadAverage()`- `ThreadMXBean.getCurrentThreadCpuTime()`- `ThreadMXBean.getCurrentThreadUserTime()` There are loads ...
null
CC BY-SA 2.5
null
2008-08-26T07:09:20.493
2008-08-26T07:09:20.493
null
null
988
null
27,532
1
27,536
null
33
48,115
Given 2 rgb colors and a rectangular area, I'd like to generate a basic linear gradient between the colors. I've done a quick search and the only thing I've been able to find is [this blog entry](http://jtauber.com/blog/2008/05/18/creating_gradients_programmatically_in_python/), but the example code seems to be missing...
Generating gradients programmatically?
CC BY-SA 3.0
0
2008-08-26T07:57:06.773
2017-11-16T08:09:50.353
2012-10-19T22:17:06.423
24,874
85
[ "java", "colors", "rgb", "gradient" ]
27,517
2
null
27,509
173
null
In JavaScript there is and there is . They have different meanings. - - Marijn Haverbeke states, in his free, online book "[Eloquent JavaScript](http://eloquentjavascript.net/)" (emphasis mine): > There is also a similar value, null, whose meaning is 'this value is defined, but it does not have a value'. The differe...
null
CC BY-SA 4.0
null
2008-08-26T07:36:13.453
2020-08-21T15:26:57.007
2020-08-21T15:26:57.007
63,550
2,273
null
27,537
2
null
16,689
0
null
If they are separate programs and running as independent applications,you may use sockets. I know it's bit complex to define communication protocol but it'll be quite straight-forward. However if you have just two separate programs but want to run them as single application, then I guess IKVM is a better approach as s...
null
CC BY-SA 2.5
null
2008-08-26T08:01:59.290
2008-08-26T08:01:59.290
null
null
959
null
27,523
2
null
26,458
7
null
Try [Instantiations](http://www.instantiations.com/index.html)' [Windows Builder Pro](http://www.instantiations.com/windowbuilder/index.html). It includes [Swing Designer](http://www.instantiations.com/windowbuilder/swingdesigner/index.html), which is a Swing UI builder. It is based on Eclipse.
null
CC BY-SA 2.5
null
2008-08-26T07:43:25.713
2008-08-26T07:43:25.713
null
null
2,823
null
27,538
2
null
27,535
1
null
Regarding the formatting of your post: If you use the quote-button instead of code-button, people do not have to scroll to see the complete error message.
null
CC BY-SA 2.5
null
2008-08-26T08:03:39.487
2008-08-26T08:03:39.487
null
null
2,257
null
27,494
2
null
27,492
5
null
Rules: 1. Wherever possible, use a smart pointer. Boost has some good ones. 2. If you can't use a smart pointer, null out your pointer after deleting it. 3. Never work anywhere that won't let you use rule 1. If someone disallows rule 1, remember that if you grab someone else's code, change the variable names and d...
null
CC BY-SA 3.0
null
2008-08-26T06:52:34.213
2013-04-04T13:58:49.203
2017-05-23T12:33:53.177
-1
257
null
27,541
2
null
27,499
42
null
Oracle has had an excellent multi version control system in place since very long(at least since oracle 8.0) Following should help. 1. User A starts a transaction and is updating 1000 rows with some value At Time T1 2. User B reads the same 1000 rows at time T2. 3. User A updates row 543 with value Y (original value...
null
CC BY-SA 2.5
null
2008-08-26T08:04:44.073
2008-08-26T08:04:44.073
null
null
2,528
null
27,535
1
33,940
null
1
550
Has anyone run into this error message before when using a timer on an ASP.NET page to update a `DataGrid` every x seconds? Searching google yielded this [blog entry](http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx) and man...
ASP.NET AJAX and PageRequestManagerParserErrorException
CC BY-SA 3.0
null
2008-08-26T07:59:57.827
2015-09-09T09:39:28.663
2015-09-09T09:39:28.663
1,537,726
1,865
[ "asp.net" ]
27,545
2
null
27,095
2
null
> It would seem like Google is using simple 32 bit floating precision (the error here), if you switch float for double in the above code, you fix the issue! Could this be it? No, you just defer the issue. doubles still exhibit the same issue, just with larger numbers.
null
CC BY-SA 2.5
null
2008-08-26T08:08:31.007
2008-08-26T08:08:31.007
null
null
2,131
null
27,543
2
null
27,407
1
null
What's the correct answer about VM Size? - In Coding Horror> How much of the processes' less frequently used memory has been paged to disk. - In Comment of Coding Horror> You're wrong on VM Size. It's the total of all private (not shared) bytes allocated by this process, whether currently in physical memory or not. It...
null
CC BY-SA 2.5
null
2008-08-26T08:07:00.370
2008-08-26T08:07:00.370
null
null
2,370,764
null
27,552
2
null
27,095
2
null
in C#, try (double.maxvalue == (double.maxvalue - 100)) , you'll get true ... but thats what it is supposed to be: [http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems](http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems) thinking about it, you have 64 bit representing a number greater than 2^64...
null
CC BY-SA 2.5
null
2008-08-26T08:19:56.813
2008-08-26T09:51:58.667
2008-08-26T09:51:58.667
195
195
null
27,536
2
null
27,532
44
null
you want an interpolation between the first and the second colour. Interpolating colours is easy by calculating the same interpolation for each of its components (R, G, B). There are many ways to interpolate. The easiest is to use linear interpolation: just take percentage of the first colour and percentage 1 - of th...
null
CC BY-SA 3.0
null
2008-08-26T08:00:29.183
2015-02-05T10:33:20.570
2017-05-23T12:10:27.907
-1
1,968
null
27,551
2
null
27,492
0
null
you could derive everything from some base class that implement smart pointer like functionality (using ref()/unref() methods and a counter. All points highlighted by @Timbo are important when designing that base class.
null
CC BY-SA 2.5
null
2008-08-26T08:19:49.933
2008-08-26T08:19:49.933
null
null
2,711
null
27,558
2
null
27,435
7
null
Although it's a bit out of date, it would be worth reading the [MySQL Gotchas](http://sql-info.de/mysql/gotchas.html) page. Many of the items listed there are still true, to the best of my knowledge. I use PostgreSQL.
null
CC BY-SA 2.5
null
2008-08-26T08:29:18.147
2008-08-26T08:29:18.147
null
null
893
null
27,501
2
null
27,492
14
null
I have worked with the embedded Symbian OS, which had an excellent system in place for this, based entirely on developer conventions. 1. Only one object will ever own a pointer. By default this is the creator. 2. Ownership can be passed on. To indicate passing of ownership, the object is passed as a pointer in the me...
null
CC BY-SA 2.5
null
2008-08-26T07:08:26.610
2008-08-26T07:08:26.610
null
null
2,928
null
27,553
2
null
27,532
9
null
Using the basic AWT classes, you could do something like this: ``` import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; import javax.swing.JPanel; public class LinearGradient extends JPanel { public void paint(Graphics g) { Graphics2D g2 = (Graphi...
null
CC BY-SA 2.5
null
2008-08-26T08:20:01.243
2008-08-26T08:20:01.243
null
null
2,783
null
27,559
1
null
null
1
300
The ones that stick out and make life usefull.
Do you have any recommended File templates for resharper for VB.Net
CC BY-SA 2.5
null
2008-08-26T08:31:18.610
2012-02-10T10:46:48.887
2008-09-03T16:12:47.173
-1
2,936
[ "vb.net", "templates", "file", "resharper" ]
27,562
1
27,693
null
5
59,172
I am running oracle and have a query which pulls some results from the database. I would like to write the results as a text file. How would I go about doing this? My prefered way would be by using UTL_FILE. Would some one have an example of how to do this?
Oracle write to file
CC BY-SA 2.5
0
2008-08-26T08:32:51.103
2011-12-24T23:42:30.790
2008-08-26T12:51:48.377
null
null
[ "oracle" ]
27,560
2
null
27,474
2
null
Don't take this the wrong way, but sending newsletters to more than a handful of people these days is a fairly serious matter. Yes, you need to be monitoring bounces (rejected emails) which can occur synchronously during the SMTP send (typically if the SMTP server you are connected to is authoritative), or asynchronou...
null
CC BY-SA 2.5
null
2008-08-26T08:31:51.527
2008-08-26T08:31:51.527
null
null
2,929
null
27,567
1
42,689
null
11
1,286
I've been having a hard time trying to understand PyPy's translation. It looks like something absolutely revolutionary from simply reading the description, however I'm hard-pressed to find good documentation on actually translating a real world piece of code to something such as LLVM. Does such a thing exist? The of...
Where can I learn more about PyPy's translation function?
CC BY-SA 2.5
0
2008-08-26T08:40:28.853
2009-06-25T02:07:47.700
null
null
1,662
[ "python", "translation", "pypy" ]
27,563
2
null
27,559
1
null
Here is one for a testClass with Nunit support. ``` Imports Nunit.FrameWork Namespace $NAMESPACE$ ''' ''' A TestClass ''' ''' _ Public Class $CLASSNAME$ #Region " Setup and TearDown " ''' ''' Sets up the Tests ''' ''' _ Public Sub Se...
null
CC BY-SA 2.5
null
2008-08-26T08:36:59.720
2008-08-26T08:36:59.720
null
null
2,936
null
27,503
2
null
27,442
1
null
I don't have a rake task for backing up my MySQL db, but I did write a script in Ruby to do just that for my WordPress DB: ``` filename = 'wp-config.php' def get_db_info(file) username = nil password = nil db_name = nil file.each { |line| if line =~ /'DB_(USER|PASSWORD|NAME)', '([[:alnum:]]*)'/ if $...
null
CC BY-SA 2.5
null
2008-08-26T07:12:22.763
2008-08-26T07:12:22.763
null
null
422
null
27,548
2
null
27,482
10
null
I think your problem is that acrobat reader doesn't allow commenting on documents not produced by abode approved products, which I don't think pdflatex would be. You should look at the free [PDF-XChange Viewer](http://www.docu-track.com/home/prod_user/PDF-XChange_Tools/pdfx_viewer) which allows you to comment and ann...
null
CC BY-SA 2.5
null
2008-08-26T08:11:51.200
2008-08-26T08:11:51.200
null
null
2,674
null
27,573
2
null
27,568
3
null
You may be interested in [this](http://retrospec.sgn.net/game.php?link=z80asm) for a Z80 simulator, and I've had good experiences with [WinAsm](http://www.winasm.net/).
null
CC BY-SA 2.5
null
2008-08-26T08:43:38.020
2008-08-26T08:43:38.020
null
null
1,662
null
27,572
1
764,188
null
2
388
We've been using the 32bit linux version of the [JavaServiceWrapper](http://wrapper.tanukisoftware.org/) for quite a while now and it's working perfectly. We are now considering also using it on 64bit linux systems. There are downloads for 64bit binaries on the website, but looking into Makefile for the 64bit version I...
JavaServiceWrapper on 64bit linux, any problems?
CC BY-SA 2.5
0
2008-08-26T08:43:37.457
2011-12-15T16:21:32.910
null
null
2,844
[ "java", "daemon" ]
27,574
2
null
27,570
0
null
Someone has to do the iterating part. AFAIK, there is no such method present in .NET already, so I guess that someone has to be you.
null
CC BY-SA 2.5
null
2008-08-26T08:44:28.627
2008-08-26T08:44:28.627
null
null
267
null
27,569
2
null
27,562
1
null
If you're running the query from you can use the spool command: After executing the spool command within a session, all output is sent to the sqlplus console as well as the /tmp/test.spool text file.
null
CC BY-SA 2.5
null
2008-08-26T08:42:04.793
2008-08-26T08:42:04.793
null
null
2,811
null
27,581
1
27,609
null
617
602,694
What issues / pitfalls must be considered when overriding `equals` and `hashCode`?
What issues should be considered when overriding equals and hashCode in Java?
CC BY-SA 3.0
0
2008-08-26T08:50:26.223
2017-01-26T11:00:31.550
2014-08-11T19:02:45.990
16,587
797
[ "java", "overriding", "equals", "hashcode" ]
27,578
1
19,061,110
null
260
68,024
In Java (or any other language with checked exceptions), when creating your own exception class, how do you decide whether it should be checked or unchecked? My instinct is to say that a checked exception would be called for in cases where the caller might be able to recover in some productive way, where as an uncheck...
When to choose checked and unchecked exceptions
CC BY-SA 2.5
0
2008-08-26T08:45:56.437
2022-09-05T09:39:02.703
2010-10-08T17:43:46.600
19,750
797
[ "java", "exception", "checked-exceptions" ]
27,579
2
null
27,562
5
null
If you're using Sql Plus, is as easy as: This three sentences will output the result of the query "SELECT * FROM USERS" to the file c:\temp\out.txt. You can format this query using the string manipulation functions of Oracle.
null
CC BY-SA 2.5
null
2008-08-26T08:47:39.430
2008-08-26T09:09:22.730
2008-08-26T09:09:22.730
1
2,937
null
27,583
2
null
26,897
2
null
If you are using eclipse, then I would recomend [JSEclipse](http://www.interaktonline.com/products/eclipse/jseclipse/overview/)
null
CC BY-SA 2.5
null
2008-08-26T08:51:45.457
2008-08-26T08:51:45.457
null
null
2,952
null
27,561
2
null
27,532
13
null
You can use the built in [GradientPaint](https://docs.oracle.com/javase/7/docs/api/java/awt/GradientPaint.html) class. ``` void Paint(Graphics2D g, Regtangle r, Color c1, Color c2) { GradientPaint gp = new GradientPaint(0,0,c1,r.getWidth(),r.getHeight(),c2); g.setPaint(gp); g.fill(rect); } ```
null
CC BY-SA 3.0
null
2008-08-26T08:32:19.997
2017-05-17T14:51:19.907
2017-05-17T14:51:19.907
2,350,083
838
null
27,586
2
null
26,458
13
null
For me, the best visual Swing editor is [JFormDesigner](http://www.jformdesigner.com), which you can run standalone or as a plugin for IntelliJ IDEA and Eclipse. It generates proper (actually readable) source code, it's very ergonomic and intuitive and, above all, very extensible. That last point is really important, ...
null
CC BY-SA 3.0
null
2008-08-26T08:53:53.423
2018-02-10T00:48:33.187
2018-02-10T00:48:33.187
63,550
2,945
null
27,568
1
36,972
null
19
44,036
I'd like to learn how to program in Assembler. I've done a bit of assembly before (during my A-Level Computing course) but that was very definitely a simplified 'pseudo-assembler'. I've borrowed my Dad's old Z80 Assembler reference manual, and that seems quite interesting so if possible I'd like to have a go with Z80 a...
Assembler IDE/Simulator for beginner
CC BY-SA 2.5
0
2008-08-26T08:40:39.803
2020-12-09T11:25:23.377
2012-05-02T12:14:07.020
192,221
1,912
[ "simulator", "assembly" ]
27,585
2
null
27,570
7
null
You can use this overload of GetFiles: > [Directory.GetFiles Method (String, String, SearchOption](http://msdn.microsoft.com/en-us/library/ms143316.aspx)) and this member of SearchOption: > - Includes the current directory and all the subdirectories in a search operation. This option includes reparse points like mount...
null
CC BY-SA 2.5
null
2008-08-26T08:53:50.867
2008-08-26T08:53:50.867
2020-06-20T09:12:55.060
-1
718
null
27,570
1
27,584
null
20
42,998
Is there a way to find the number of files of a specific type without having to loop through all results inn a Directory.GetFiles() or similar method? I am looking for something like this: ``` int ComponentCount = MagicFindFileCount(@"c:\windows\system32", "*.dll"); ``` I know that I can make a recursive function to...
Find number of files with a specific extension, in all subdirectories
CC BY-SA 3.0
0
2008-08-26T08:42:25.463
2018-01-15T08:36:04.673
2016-05-13T11:43:59.963
226,958
2,257
[ "c#", "file", "recursion" ]
27,589
2
null
27,568
3
null
You might also consider learning x86 assembly language, which you could do using in-line assembler in Visual Studio - although it's a larger instruction set than Z80, you would have the advantage of being able to use much better tools than would be available for the Z80. I've also just remembered that the Keil 8051 an...
null
CC BY-SA 2.5
null
2008-08-26T08:57:27.563
2008-08-26T08:57:27.563
null
null
987
null
27,576
2
null
27,568
1
null
Take a look at [Thomas Scherrer Z80 Emulators](http://www.z80.info/z80emu.htm) for a listing of potential emulators you could use.
null
CC BY-SA 2.5
null
2008-08-26T08:45:07.407
2008-08-26T08:45:07.407
null
null
2,257
null
27,584
2
null
27,570
37
null
You should use the [Directory.GetFiles(path, searchPattern, SearchOption)](http://msdn.microsoft.com/en-us/library/ms143316.aspx) overload of Directory.GetFiles(). Path specifies the path, searchPattern specifies your wildcards (e.g., *, *.format) and SearchOption provides the option to include subdirectories. The Le...
null
CC BY-SA 3.0
null
2008-08-26T08:53:42.380
2016-05-13T14:20:40.277
2016-05-13T14:20:40.277
4,401,282
372
null
27,582
2
null
27,578
63
null
From [A Java Learner](http://lankireddy.blogspot.com/2007/10/checked-vs-unchecked-exceptions.html): > When an exception occurs, you have to either catch and handle the exception, or tell compiler that you can't handle it by declaring that your method throws that exception, then the code that uses your method...
null
CC BY-SA 2.5
null
2008-08-26T08:51:27.593
2008-08-26T08:51:27.593
null
null
2,257
null
27,587
2
null
27,572
1
null
From [http://wrapper.tanukisoftware.org/doc/english/introduction.html](http://wrapper.tanukisoftware.org/doc/english/introduction.html) : > Binary distributions are provided for the following list of platforms and are available on the download page. Only OS versions which are known to work have been listed. (s...
null
CC BY-SA 2.5
null
2008-08-26T08:55:42.623
2008-08-26T08:55:42.623
null
null
2,257
null
27,592
2
null
27,570
1
null
Using recursion your MagicFindFileCount would look like this: ``` private int MagicFindFileCount( string strDirectory, string strFilter ) { int nFiles = Directory.GetFiles( strDirectory, strFilter ).Length; foreach( String dir in Directory.GetDirectories( strDirectory ) ) { nFiles += GetNumberOfFile...
null
CC BY-SA 2.5
null
2008-08-26T08:58:03.803
2008-08-26T08:58:03.803
2017-05-23T12:26:11.430
-1
1,830
null
27,597
2
null
12,368
0
null
@Curt Hagenlocher - that's back to front. I've no idea why so many have voted it up when it's wrong. `IDisposable` is for resources. Finalisers are for resources. As long as you only use managed resources both @Jon Limjap and myself are entirely correct. For classes that use unmanaged resources (and bear in mind ...
null
CC BY-SA 2.5
null
2008-08-26T09:01:30.970
2008-08-30T17:46:01.180
2017-05-23T12:02:02.617
-1
905
null
27,595
2
null
27,568
1
null
I write z80 asm for the ZX Spectrum (still, I know :) ) and use SJasmPlus to link to a spectrum emulator file. Lots of of the better Spectrum emulators like Fuse and ZXSpin have built in editors as well for on the fly debugging and patching.
null
CC BY-SA 2.5
null
2008-08-26T09:00:50.600
2008-08-26T09:00:50.600
null
null
269
null
27,607
1
null
null
5
1,473
Let's say I have a list of server names stored in a vector, and I would like to contact them one at a time until one has successfully responded. I was thinking about using STL's find_if algorithm in the following way: ``` find_if(serverNames.begin(), serverNames.end(), ContactServer()); ``` Where ContactServer is a ...
Is this code an abuse of STL's find_if?
CC BY-SA 2.5
null
2008-08-26T09:10:27.907
2012-05-25T16:08:05.563
null
null
2,150
[ "c++", "stl" ]
27,591
2
null
27,578
-13
null
The rule I use is: never use unchecked exceptions! (or when you don't see any way around it) From the point of view of the developer using your library or the end-user using your library/application it really sucks to be confronted with an application that crashes due to an uncought exception. And counting on a catch-...
null
CC BY-SA 2.5
null
2008-08-26T08:57:53.243
2008-08-26T09:19:11.867
2008-08-26T09:19:11.867
null
null
null
27,600
2
null
27,567
2
null
Are you looking for Python specific translation, or just the general "how do you compile some code to bytecode"? If the latter is your case, check [the LLVM tutorial](http://llvm.org/docs/tutorial/). I especially find chapter two, which teaches you to write a compiler for your own language, interesting.
null
CC BY-SA 2.5
null
2008-08-26T09:06:33.207
2008-08-26T09:06:33.207
null
null
2,018
null
27,603
2
null
27,599
0
null
PHP6 will have better unicode support but there are a few functions you can use. My first thought was [mb_convert_encoding](http://php.net/manual/en/function.mb-convert-encoding.php) but as you said this will shorten messages to 70 chars - so perhaps you can use this in conjunction with [mb_detect_encoding](http://php...
null
CC BY-SA 3.0
null
2008-08-26T09:08:45.697
2011-11-14T17:19:20.517
2011-11-14T17:19:20.517
2,025
2,025
null
27,611
2
null
27,578
1
null
Checked exceptions are useful for recoverable cases where you want to provide information to the caller (i.e. insufficient permissions, file not found, etc). Unchecked exceptions are used rarely, if at all, for informing the user or programmer of serious errors or unexpected conditions during run-time. Don't throw the...
null
CC BY-SA 2.5
null
2008-08-26T09:13:07.247
2008-08-26T09:13:07.247
null
null
2,783
null
27,602
2
null
26,842
-1
null
Well, from the [module source](http://search.cpan.org/src/OSALAUN/AuthCAS-1.3.1/lib/AuthCAS.pm) it looks like that IO::Socket error is coming from get_https2 ``` [...] unless ($ssl_socket) { $errors = sprintf "error %s unable to connect https://%s:%s/\n",&IO::Socket::SSL::errstr,$host,$port; return undef; } [....
null
CC BY-SA 2.5
null
2008-08-26T09:07:48.100
2008-08-26T09:07:48.100
null
null
1,612
null
27,608
2
null
12,368
0
null
@Keith: > IDisposable is for managed resources.Finalisers are for unmanaged resources. Sorry but that's just wrong. Normally, the finalizer does nothing at all. However, if the [dispose pattern](http://blogs.msdn.com/bclteam/archive/2007/10/30/dispose-pattern-and-object-lifetime-brian-grunkemeyer.aspx) has been correct...
null
CC BY-SA 2.5
null
2008-08-26T09:11:17.703
2008-08-26T09:11:17.703
2020-06-20T09:12:55.060
-1
1,968
null
27,614
2
null
27,607
4
null
I think I would go for it. The only thing I would worry about is the readability (and therefore maintainability) of it. To me, it reads something like "Find the first server I can contact", which makes perfect sense. You might want to rename `ContactServer` to indicate that it is a predicate; `CanContactServer`? (But...
null
CC BY-SA 2.5
null
2008-08-26T09:17:59.637
2008-08-26T09:17:59.637
null
null
2,971
null
27,619
2
null
27,607
0
null
Isn't that what `find_if` is for? Note though, that it will find the servers, if you iterate over the iterator - but you aren't going to do that (according to OP).
null
CC BY-SA 2.5
null
2008-08-26T09:21:00.020
2008-08-26T09:21:00.020
null
null
2,260
null
27,615
2
null
26,458
1
null
As I'm using Eclipse, I use the Visual Editor plugin. It generates clean source code, with good patterns and easy to patch/modify/extend. Unfortunately, it is not very stable. But it's worth trying.
null
CC BY-SA 3.0
null
2008-08-26T09:19:32.800
2018-02-10T00:49:02.623
2018-02-10T00:49:02.623
63,550
2,965
null
27,610
1
null
null
123
119,144
I want to introduce some tracing to a C# application I am writing. Sadly, I can never really remember how it works and would like a tutorial with reference qualities to check up on every now and then. It should include: - - Do you know the über tutorial that we should link to? --- Glenn Slaven pointed me in the rig...
How can I add (simple) tracing in C#?
CC BY-SA 4.0
0
2008-08-26T09:12:56.450
2020-08-21T15:22:12.373
2020-08-21T13:44:06.783
63,550
2,260
[ "c#", "trace" ]
27,620
2
null
27,607
0
null
> However, the same result will be returned regardless of which copy of the predicate is used (i.e. the predicate has no real state), so the original problem with state-keeping predicates is not relevant in this case. So where's the problem? Function objects don't necessarily have to be stateful. It's actually best pr...
null
CC BY-SA 2.5
null
2008-08-26T09:22:30.797
2008-08-26T09:22:30.797
null
null
1,968
null
27,609
2
null
27,581
1,472
null
### The theory (for the language lawyers and the mathematically inclined): `equals()` ([javadoc](http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#equals(java.lang.Object))) must define an equivalence relation (it must be , , and ). In addition, it must be (if the objects are not modified, then it mus...
null
CC BY-SA 3.0
null
2008-08-26T09:12:42.910
2015-07-29T19:23:43.410
2015-07-29T19:23:43.410
3,645,205
2,948
null
27,621
1
27,625
null
44
24,157
On the UNIX bash shell (specifically Mac OS X Leopard) what would be the simplest way to copy every file having a specific extension from a folder hierarchy (including subdirectories) to the same destination folder (without subfolders)? Obviously there is the problem of having duplicates in the source hierarchy. I wou...
Unix shell file copy flattening folder structure
CC BY-SA 2.5
0
2008-08-26T09:22:34.510
2010-07-12T12:19:56.993
2008-08-26T10:23:54.783
1,870
2,954
[ "unix", "shell" ]
27,625
2
null
27,621
62
null
In bash: ``` find /foo -iname '*.txt' -exec cp \{\} /dest/ \; ``` `find` will find all the files under the path `/foo` matching the wildcard `*.txt`, case insensitively (That's what `-iname` means). For each file, `find` will execute `cp {} /dest/`, with the found file in place of `{}`.
null
CC BY-SA 2.5
null
2008-08-26T09:26:18.137
2008-08-26T09:26:18.137
null
null
2,971
null
27,624
2
null
27,267
0
null
Delete all of the objects in the bucket first. Then you can delete the bucket itself. Apparently, one cannot delete a bucket with objects in it and S3Fox does not do this for you. I've had other little issues with S3Fox myself, like this, and now use a Java based tool, [jets3t](https://jets3t.dev.java.net/) which ...
null
CC BY-SA 2.5
null
2008-08-26T09:25:12.333
2008-08-26T09:25:12.333
null
null
2,961
null
27,628
2
null
27,622
1
null
In MFC, TRACE is defined as ATLTRACE. And in release mode that is defined as: ``` #define ATLTRACE __noop ``` So, using the out-the-box TRACE from MFC, you won't actually be able to read any TRACE text, because it won't even be written out. You could write your own TRACE function instead, then re-define t...
null
CC BY-SA 2.5
null
2008-08-26T09:30:12.260
2011-03-01T10:59:10.983
2011-03-01T10:59:10.983
366,904
986
null
27,629
2
null
27,578
56
null
> The rule I use is: never use unchecked exceptions! (or when you don't see any way around it) There’s a case for the opposite: use checked exceptions. I’m reluctant to take sides in the debate (there’s definitely good arguments on both sides!) but a fair number of experts feel that checked exceptions were a wrong dec...
null
CC BY-SA 4.0
null
2008-08-26T09:30:18.233
2022-09-05T09:39:02.703
2022-09-05T09:39:02.703
1,968
1,968
null
27,632
2
null
27,622
3
null
TRACE is just a macro for [OutputDebugString](http://msdn.microsoft.com/en-us/library/aa363362(VS.85).aspx). So you can easily just make your own TRACE macro (or call it something else) that will call [OutputDebugString](http://msdn.microsoft.com/en-us/library/aa363362(VS.85).aspx).
null
CC BY-SA 2.5
null
2008-08-26T09:31:32.913
2008-08-26T09:31:32.913
null
null
2,957
null
27,598
1
170,414
null
3
15,175
I've deployed some Managed Beans on WebSphere 6.1 and I've managed to invoke them through a standalone client, but when I try to use the application "jconsole" distributed with the standard JDK can can't make it works. Has anyone achieved to connect the jconsole with WAS 6.1? IBM WebSphere 6.1 it's supossed to suppor...
How can I make "jconsole" work with Websphere 6.1?
CC BY-SA 2.5
0
2008-08-26T09:03:21.077
2014-12-08T10:01:13.227
2009-02-03T11:00:33.070
1,820
2,937
[ "java", "websphere", "jmx", "mbeans" ]
27,617
2
null
20,047
18
null
I'm pretty uncomfortable about this question and the attendant answers. There's a lot of "try this magic dust! No that magic dust!" I can't see anywhere that you've anaylzed the locks that are taken, and determined what exact type of locks are deadlocked. All you've indicated is that some locks occur -- not what is d...
null
CC BY-SA 3.0
null
2008-08-26T09:20:03.580
2017-12-24T04:25:39.473
2017-12-24T04:25:39.473
16,076
49
null
27,622
1
41,046
null
15
15,498
The [TRACE macro](http://msdn.microsoft.com/en-us/library/4wyz8787(VS.80).aspx) can be used to output diagnostic messages to the debugger when the code is compiled in mode. I need the same messages while in mode. Is there a way to achieve this? (Please do waste your time discussing why I should not be using TRACE i...
How to enable the TRACE macro in Release mode?
CC BY-SA 2.5
0
2008-08-26T09:22:40.047
2014-09-04T05:13:32.310
null
null
1,630
[ "mfc", "macros", "trace" ]
27,630
2
null
12,368
0
null
Konrad Rudolph - yup, normally the finaliser does nothing at all. You shouldn't implement it unless you are dealing with unmanaged resources. Then, when you do implement it, you use [Microsoft's dispose pattern](http://msdn.microsoft.com/en-us/library/fs2xkftw.aspx) (as already described) - `public Dispose()` calls `...
null
CC BY-SA 2.5
null
2008-08-26T09:30:21.620
2008-08-28T16:06:28.140
2008-08-28T16:06:28.157
905
905
null
27,637
2
null
12,368
3
null
Complete explanation by Joe Duffy on "[Dispose, Finalization, and Resource Management](http://www.bluebytesoftware.com/blog/PermaLink.aspx?guid=88e62cdf-5919-4ac7-bc33-20c06ae539ae)": > Earlier in the .NET Framework’s lifetime, finalizers were consistently referred to as destructors by C# programmers. As we beco...
null
CC BY-SA 2.5
null
2008-08-26T09:36:18.907
2008-08-26T09:36:18.907
null
null
718
null
27,643
1
null
null
11
4,981
On a web page I want to dynamically render very basic flow diagrams, i.e. a few boxes joined by lines. Ideally the user could then click on one of these boxes (`DIVs`?) and be taken to a different page. Resorting to Flash seems like an overkill. Is anyone aware of any client-side (i.e. `server agnostic`) Javascript or ...
Is there a library for rendering basic flow diagrams in Javascript/CSS?
CC BY-SA 4.0
0
2008-08-26T09:39:34.453
2019-02-01T12:27:34.077
2019-02-01T12:27:34.077
6,766,919
2,966
[ "javascript", "css" ]
27,644
2
null
22,140
0
null
> I think the way to do(get around) this problem is to develop a "./configure && make" script that your client uses to install, specify and compile the binaries. That would offcourse require that the client has all the source-code installed on his server or you can make it available on an NFS share. Not to mention a c...
null
CC BY-SA 2.5
null
2008-08-26T09:45:37.887
2008-08-26T09:45:37.887
null
null
2,018
null
27,641
2
null
24,675
6
null
I run a website with 7-8 million page views a month. Not terribly much, but enough that our server felt the load. The solution we chose was simple: Memcache at the database level. This solution works well if the database load is your main problem. We started out using Memcache to cache entire objects and the database ...
null
CC BY-SA 2.5
null
2008-08-26T09:38:41.600
2008-08-26T09:38:41.600
null
null
1,606
null
27,642
2
null
27,492
1
null
G'day, I'd suggest reading the relevant sections of "Effective C++" by Scott Meyers. Easy to read and he covers some interesting gotchas to trap the unwary. I'm also intrigued by the lack of templates. So no STL or Boost. Wow. BTW Getting people to agree on conventions is an excellent idea. As is getting everyone to...
null
CC BY-SA 2.5
null
2008-08-26T09:39:16.717
2008-08-26T09:39:16.717
null
null
2,974
null
27,646
2
null
27,640
2
null
(This doesn't really answer your specific questions but...) I haven't personally used Qt, but it's not free for commercial Windows development. Have you looked at [wxWindows](http://wxwindows.org/) which is free? Nice article [here](http://www.linuxjournal.com/article/6778). Just as an aside, if you wanted a single co...
null
CC BY-SA 2.5
null
2008-08-26T09:46:26.307
2008-08-26T09:46:26.307
null
null
1,075
null
27,626
2
null
27,568
3
null
If you happen to already know .NET, then this may be of use: [http://www.viksoe.dk/code/asmil.htm](http://www.viksoe.dk/code/asmil.htm) It's a little bit limited, and may only work with .NET 1.1, but you could atleast use a "modern" IDE for it, and there are plenty of docs around for it. ``` <%@ page language="Asm80...
null
CC BY-SA 2.5
null
2008-08-26T09:26:43.703
2008-08-26T09:26:43.703
null
null
2,947
null
27,653
2
null
1,988
16
null
I'm not a Lisp expert, heck I'm not even a Lisp programmer, but after a bit of experimenting with the language I came to the conclusion that after a while the parenthesis start becoming 'invisible' and you start seeing the code as you want it to be. You start paying more attention to the syntactical constructs you crea...
null
CC BY-SA 2.5
null
2008-08-26T09:49:02.323
2008-08-26T09:49:02.323
null
null
2,954
null
27,652
2
null
27,054
1
null
You make a distinction between 'private' and 'public' branches, but the only real difference between these cases is whether the branch's repository is only available locally or company-wide. A central repository is to have company-wide availability. Instead, why not say that repositories must be publically available...
null
CC BY-SA 2.5
null
2008-08-26T09:48:55.850
2008-08-26T09:48:55.850
null
null
2,963
null
27,656
2
null
4,724
9
null
If you like programming you should learn Lisp for the pure joy of it. [XKCD](http://xkcd.com/224/) perfectly expresses the intellectual enlightenment that ensues. Learning Lisp is for the programmer what meditation is for the Buddhist monk (and I meant this without any blasphemous connotation).
null
CC BY-SA 2.5
null
2008-08-26T09:51:45.983
2008-08-26T09:51:45.983
null
null
1,968
null
27,640
1
27,811
null
9
6,687
We currently maintain a suit of MFC applications that are fairly well designed, however the user interface is beginning to look tired and a lot of the code is in need quite a bit of refactoring to tidy up some duplication and/or performance problems. We make use of quite a few custom controls that handle all their own...
Integrating Qt into legacy MFC applications
CC BY-SA 2.5
0
2008-08-26T09:37:52.320
2012-06-06T11:39:59.603
null
null
2,958
[ "c++", "qt", "mfc" ]
27,658
2
null
4,724
2
null
To add to the other answers: Because the [SICP](http://mitpress.mit.edu/sicp/) course (the videos are available [here](http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/)) is awesome: teaches you Lisp !
null
CC BY-SA 2.5
null
2008-08-26T09:53:07.057
2008-08-26T09:53:07.057
null
null
2,638
null
27,638
2
null
1,988
11
null
Regular macros operate on lists of objects. Most commonly, these objects are other lists (thus forming trees) and symbols, but they can be other objects such as strings, hashtables, user-defined objects, etc. These structures are called [s-exps](http://en.wikipedia.org/wiki/S-expression). So, when you load a source fi...
null
CC BY-SA 2.5
null
2008-08-26T09:36:27.020
2008-08-26T14:02:24.587
2008-08-26T14:02:24.587
2,967
2,967
null
27,659
2
null
27,610
3
null
DotNetCoders has a starter article on it: [http://www.dotnetcoders.com/web/Articles/ShowArticle.aspx?article=50](http://www.dotnetcoders.com/web/Articles/ShowArticle.aspx?article=50). They talk about how to set up the switches in the configuration file and how to write the code, but it is pretty old (2002). There's ano...
null
CC BY-SA 4.0
null
2008-08-26T09:53:13.093
2020-08-21T15:13:33.887
2020-08-21T15:13:33.887
63,550
2,975
null
27,663
1
null
null
25
11,941
I am looking for something to integrate to my CI workflow. I've heard of [dbdeploy](http://dbdeploy.com) but I'm looking for something else. The reason I don't like dbdeploy is I don't want to install java on my server. I would prefer of course that the solution doesn't involve stringing some shell scripts together.
What kind of database refactoring tools are there?
CC BY-SA 3.0
0
2008-08-26T09:55:44.540
2019-06-09T07:04:41.613
2013-01-30T03:02:18.163
1,399,920
2,976
[ "database", "refactoring" ]
27,668
2
null
27,643
2
null
Does the rendering have to be client side? If yes, you could try Processing: [http://ejohn.org/blog/processingjs/](http://ejohn.org/blog/processingjs/) If you can do it server side, then Graphviz is a good choice. [http://www.graphviz.org/](http://www.graphviz.org/)
null
CC BY-SA 2.5
null
2008-08-26T09:59:23.640
2008-08-26T09:59:23.640
null
null
2,954
null
27,651
2
null
27,640
0
null
It's a tricky problem, and I suspect that the answer depends on how much time you have. You will get a much better result if you port your custom controls to Qt - if you use the QStyle classes to do the actual drawing then you'll end up with theme-able code right out of the box. In general, my advice would be to bite ...
null
CC BY-SA 2.5
null
2008-08-26T09:48:34.430
2008-08-26T09:48:34.430
null
null
1,304
null
27,623
2
null
27,599
2
null
I know this isnt php code, but I think it might help anyway. This is how I do it in an app I wrote to detect if its possible to send as GSM 03.38 (you could do something similar for plain text). It has two translation tables, one for normal GSM and one for the extended. And then a function that loops through all charac...
null
CC BY-SA 2.5
null
2008-08-26T09:22:41.483
2008-08-26T09:22:41.483
null
null
2,957
null
27,655
1
27,661
null
1
630
This is starting to vex me. I recently decided to clear out my FTP, and stumbled across an old Wordpress install I forgot I had (oh yes, very security conscious me). Anyway, for some reason deleting the directory failed so I investigated to see what was causing the blockage and I've narrowed it down to a file in wp-con...
Cannot delete, a file with that name may already exist
CC BY-SA 4.0
null
2008-08-26T09:50:51.070
2018-12-27T22:22:37.630
2018-12-27T22:22:37.630
4,751,173
2,025
[ "file", "ftp", "symlink" ]
27,673
2
null
4,724
2
null
Killer app? [Franz Inc.](http://www.franz.com/) has a long list of [success stories](http://www.franz.com/success/), but this list only includes users of AllegroCL... There are probably others. My favourite is [the story about Naughty Dog](http://www.franz.com/success/customer_apps/animation_graphics/naughtydog.lhtml),...
null
CC BY-SA 2.5
null
2008-08-26T10:03:05.940
2008-08-26T10:03:05.940
null
null
2,935
null
27,677
2
null
27,670
1
null
[Here is an article describing what might be your problem.](http://blogs.msdn.com/astebner/archive/2007/08/24/4548657.aspx)
null
CC BY-SA 2.5
null
2008-08-26T10:04:11.647
2008-08-26T10:04:11.647
null
null
2,957
null
27,682
2
null
27,674
1
null
.NET 3.5 SP1 introduced a [DataRepeater](http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.powerpacks.datarepeater.aspx) Windows Forms control which sounds like it'd do what you want. Bind it to the list of "downloads" (or whatever your list represents) and customize each item panel to include the controls ...
null
CC BY-SA 2.5
null
2008-08-26T10:06:42.517
2008-08-26T10:06:42.517
null
null
615
null
27,687
2
null
26,002
8
null
I have had a lot of success using Oracle 10g Express Edition. It comes with Oracle Aplication Express which allows the simple admin and creation of software via a web interface. It is limited to 4Gb of Disk Space, 1Gb of Ram and will only use 1 processor. It's free and in my experience has been 100% reliable. It ca...
null
CC BY-SA 2.5
null
2008-08-26T10:13:14.840
2008-08-26T10:13:14.840
null
null
2,981
null
27,670
1
27,677
null
1
9,325
On my Vista machine I cannot install the .Net framework 3.5 SP1. Setup ends few moments after ending the download of the required files, stating in the log that: ``` [08/26/08,09:46:11] Microsoft .NET Framework 2.0SP1 (CBS): [2] Error: Installation failed for component Microsoft .NET Framework 2.0SP1 (CBS). MSI retur...
Microsoft .Net framework 3.5 SP1 Setup Fails
CC BY-SA 2.5
null
2008-08-26T10:01:56.740
2013-07-02T12:30:38.917
2008-09-10T14:13:53.670
-1
1,178
[ ".net", "frameworks", "installation" ]
27,692
2
null
12,877
-1
null
The latest version of SQL Developer is very good and I have experienced no problems with it on my Mac Pro. DB Solo 3 is also quite good.
null
CC BY-SA 2.5
null
2008-08-26T10:16:58.950
2008-08-26T10:16:58.950
null
null
2,981
null
27,664
2
null
27,663
5
null
[Redgate](http://www.red-gate.com/) will probably do everything you need. Expensive though. EDIT - Specifically: [http://www.red-gate.com/products/sql-development/readyroll/](http://www.red-gate.com/products/sql-development/readyroll/)
null
CC BY-SA 3.0
null
2008-08-26T09:56:34.630
2016-09-29T09:27:07.743
2016-09-29T09:27:07.743
167,364
1,122
null