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 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
38,042 | 2 | null | 38,019 | 10 | null | If a good name doesn't spring to mind, I would probably question whether there is a deeper problem - is the class serving a good purpose? If it is, naming it should be pretty straightforward.
| null | CC BY-SA 2.5 | null | 2008-09-01T15:12:00.970 | 2008-09-01T15:12:00.970 | null | null | 3,974 | null |
38,041 | 2 | null | 38,002 | 1 | null | We use ClickOnce where I work; in terms of comparison to a web release I would base the case around the need for providing users with a rich client app, otherwise it might well actually be better to use web applications.
In terms of releasing a rich client app ClickOnce is fantastic; you can set it up to enforce updat... | null | CC BY-SA 2.5 | null | 2008-09-01T15:11:26.137 | 2008-09-01T15:11:26.137 | null | null | 3,394 | null |
38,049 | 2 | null | 38,039 | 12 | null | This would give you the preceding Sunday (I think):
```
DateTime t = DateTime.Now;
t -= new TimeSpan ((int) t.DayOfWeek, 0, 0, 0);
```
| null | CC BY-SA 3.0 | null | 2008-09-01T15:17:29.303 | 2012-07-03T13:14:22.773 | 2012-07-03T13:14:22.773 | 142,162 | 1,898 | null |
38,038 | 2 | null | 38,021 | 7 | null | The term you should be googling is "authoritative," not "definitive".
On Linux or Mac you can use the commands `whois`, `dig`, `host`, `nslookup` or several others. `nslookup` might also work on Windows.
An example:
```
$ whois stackoverflow.com
[...]
Domain servers in listed order:
NS51.DOMAINCONTROL.COM
... | null | CC BY-SA 2.5 | null | 2008-09-01T15:10:24.687 | 2008-12-25T13:07:45.440 | 2008-12-25T13:07:45.453 | null | null | null |
38,050 | 2 | null | 38,014 | 2 | null | This looks like an issue with name resolution, try creating a public synonym on the table:
CREATE PUBLIC SYNONYM for ;
Also, what exactly do you mean by , incorrect data, error message?
---
Edit: What is the name of the schema that the required table belongs to? It sounds like the table that you are trying to s... | null | CC BY-SA 2.5 | null | 2008-09-01T15:18:49.380 | 2008-09-02T16:04:26.437 | 2008-09-02T16:04:26.437 | 2,985 | 2,985 | null |
38,053 | 2 | null | 37,791 | 4 | null | First up, you should use placeholders in your query instead of interpolating the variables directly. PDO/MySQLi allow you to write your queries like:
```
SELECT * FROM sometable WHERE iUser = ?
```
The API will safely substitute the values into the query.
I also prefer to have my queries in the code instead of the ... | null | CC BY-SA 2.5 | null | 2008-09-01T15:19:37.707 | 2008-09-01T15:19:37.707 | null | null | 2,506 | null |
38,055 | 2 | null | 38,019 | 15 | null | If you're stuck with a name, sometimes just giving it [any](http://lbrandy.com/blog/2008/08/developer-timesink-name-paralysis/) half-sensible name with commitment to revising it later is a good strategy.
Don't get naming paralysis. Yes, names are very important but they're not important enough to waste huge amounts of... | null | CC BY-SA 2.5 | null | 2008-09-01T15:20:13.510 | 2008-09-01T15:20:13.510 | null | null | 854 | null |
38,051 | 2 | null | 38,039 | 1 | null | The following method should return the DateTime that you want. Pass in true for Sunday being the first day of the week, false for Monday:
```
private DateTime getStartOfWeek(bool useSunday)
{
DateTime now = DateTime.Now;
int dayOfWeek = (int)now.DayOfWeek;
if(!useSunday)
dayOfWeek--;
if(dayO... | null | CC BY-SA 2.5 | null | 2008-09-01T15:19:08.770 | 2008-09-01T15:43:49.273 | 2008-09-01T15:43:49.273 | 3,123 | 3,123 | null |
38,058 | 2 | null | 37,823 | 3 | null | In some cases (financial market data and process control for example) you might need to use a real-time database rather than a RDBMS. See [wiki link](http://en.wikipedia.org/wiki/Real_time_database)
| null | CC BY-SA 2.5 | null | 2008-09-01T15:21:12.960 | 2008-09-01T15:21:12.960 | null | null | 2,887 | null |
38,059 | 2 | null | 4,689 | 0 | null | It must be noted that the text editor/IDE that you use determines how good a font will look. I love UltraEdit, but the only font it renders properly is Courier New. It blurs out about all other useful monospace fonts. However, Visual Studio does a great job rendering any font accurately.
Currently, I will vote Cons... | null | CC BY-SA 2.5 | null | 2008-09-01T15:23:55.357 | 2008-09-01T15:23:55.357 | null | null | 3,347 | null |
38,048 | 2 | null | 38,019 | 40 | null | Always go for MyClassA, MyClassB - It allows for a nice alpha sort..
This is a good question, and something I experienced not too long ago. I was reorganising my codebase at work and was having problems of where to put what, and what to call it..
The problem?
I had classes doing too much. If you try to adhere to... | null | CC BY-SA 2.5 | null | 2008-09-01T15:16:21.413 | 2008-09-01T15:16:21.413 | null | null | 832 | null |
38,060 | 2 | null | 38,039 | 11 | null | This may be a bit of a hack, but you can cast the .DayOfWeek property to an int (it's an enum and since its not had its underlying data type changed it defaults to int) and use that to determine the previous start of the week.
It appears the week specified in the DayOfWeek enum starts on Sunday, so if we subtract 1 fr... | null | CC BY-SA 2.5 | null | 2008-09-01T15:42:09.150 | 2008-09-01T15:42:09.150 | null | null | 3,394 | null |
38,061 | 2 | null | 37,887 | 0 | null | @Andrew
To use git push to deploy your site you will need to do first set up a remote server in your .git/config file to push to. Then you need to configure a hook that will basically perform a git reset --hard to copy the code you just copied to the repository to the working directory.
I know this is a little vague,... | null | CC BY-SA 2.5 | null | 2008-09-01T15:43:15.483 | 2008-11-29T08:11:57.520 | 2017-05-23T12:33:59.957 | -1 | 658 | null |
38,063 | 2 | null | 38,035 | 0 | null | Use the INSTR() function to find the position of the word in the string, and then use SUBSTRING() function to select a portion of characters before and after the position.
You'd have to look out that your SUBSTRING instruction don't use negative values or you'll get weird results.
Try that, and report back.
| null | CC BY-SA 2.5 | null | 2008-09-01T15:45:20.627 | 2008-09-01T15:45:20.627 | null | null | 3,288 | null |
38,056 | 1 | 38,230 | null | 39 | 100,713 | The only way I've found is:
```
import sys
import os
try:
os.kill(int(sys.argv[1]), 0)
print "Running"
except:
print "Not running"
```
([Source](http://www.unix.com/unix-advanced-expert-users/79267-trick-bash-scripters-check-if-process-running.html))
But is this reliable? Does it work with ... | How to check if a process is still running using Python on Linux? | CC BY-SA 4.0 | 0 | 2008-09-01T15:20:52.277 | 2019-09-19T07:12:14.067 | 2019-09-19T07:11:47.703 | 608,639 | 1,531 | [
"python",
"linux",
"unix",
"process"
] |
38,069 | 2 | null | 37,823 | 1 | null | One might want to consider the use of an LDAP server in the place of a traditional SQL database if the application data is heavily key/value oriented and hierarchical in nature.
| null | CC BY-SA 2.5 | null | 2008-09-01T15:49:49.057 | 2008-09-01T15:49:49.057 | null | null | 4,063 | null |
38,067 | 2 | null | 38,039 | 76 | null | A little more verbose and culture-aware:
```
System.Globalization.CultureInfo ci =
System.Threading.Thread.CurrentThread.CurrentCulture;
DayOfWeek fdow = ci.DateTimeFormat.FirstDayOfWeek;
DayOfWeek today = DateTime.Now.DayOfWeek;
DateTime sow = DateTime.Now.AddDays(-(today - fdow)).Date;
```
| null | CC BY-SA 4.0 | null | 2008-09-01T15:47:47.953 | 2020-02-13T02:01:37.683 | 2020-02-13T02:01:37.683 | 45,375 | 3,920 | null |
38,071 | 2 | null | 38,056 | 29 | null | on linux, you can look in the directory /proc/$PID to get information about that process. In fact, if the directory exists, the process is running.
| null | CC BY-SA 2.5 | null | 2008-09-01T15:50:56.243 | 2008-09-01T15:50:56.243 | null | null | 116 | null |
38,064 | 2 | null | 38,039 | 905 | null | Use an extension method:
```
public static class DateTimeExtensions
{
public static DateTime StartOfWeek(this DateTime dt, DayOfWeek startOfWeek)
{
int diff = (7 + (dt.DayOfWeek - startOfWeek)) % 7;
return dt.AddDays(-1 * diff).Date;
}
}
```
Which can be used as follows:
```
DateTime dt = D... | null | CC BY-SA 4.0 | null | 2008-09-01T15:45:54.697 | 2022-10-21T21:00:56.220 | 2022-10-21T21:00:56.220 | 2,756,409 | 4,048 | null |
38,072 | 2 | null | 34,183 | 0 | null | What are the endlines of you batch? If the code hangs on ReadLine, then the problem might be that it's unable to read the batch file…
| null | CC BY-SA 2.5 | null | 2008-09-01T15:51:17.663 | 2008-09-01T15:51:17.663 | null | null | 2,684 | null |
38,076 | 2 | null | 38,039 | 3 | null | This would give you midnight on the first Sunday of the week:
```
DateTime t = DateTime.Now;
t -= new TimeSpan ((int) t.DayOfWeek, t.Hour, t.Minute, t.Second);
```
This gives you the first Monday at midnight:
```
DateTime t = DateTime.Now;
t -= new TimeSpan ((int) t.DayOfWeek - 1, t.Hour, t.Minute, t.Second);
```
| null | CC BY-SA 3.0 | null | 2008-09-01T15:53:42.697 | 2011-10-22T09:24:51.643 | 2011-10-22T09:24:51.643 | 63,550 | 2,975 | null |
38,068 | 1 | 38,102 | null | 10 | 2,495 | Is there any shorthand way of defining and using generic definitions without having to keep repeating a particular generic description such that if there is a change I don't have to change all definitions/usages though out the codebase for example is something like this possible:
```
Typedef myGenDef = < Object1, Obje... | Generics in Java | CC BY-SA 4.0 | 0 | 2008-09-01T15:49:48.713 | 2018-12-20T13:03:34.617 | 2018-12-20T13:03:34.617 | 1,997,093 | null | [
"java",
"generics"
] |
38,079 | 2 | null | 37,157 | 3 | null | You can use [Zend Cache](http://framework.zend.com/manual/en/zend.cache.html) to cache results of your queries among other things.
| null | CC BY-SA 2.5 | null | 2008-09-01T15:54:16.330 | 2008-09-01T15:54:16.330 | null | null | 1,926 | null |
38,080 | 2 | null | 37,979 | 0 | null | Whilst not strictly ActiveRecord, [Zend_Db_Table](http://framework.zend.com/manual/en/zend.db.table.html)
is pretty good.
| null | CC BY-SA 2.5 | null | 2008-09-01T15:54:35.160 | 2008-09-01T15:54:35.160 | null | null | 1,248 | null |
38,082 | 2 | null | 37,991 | 1 | null | Yes.
I don't have any experience using Access to hit PostgreSQL from a remote location but I have successfully used Access as a front-end to SQL Server & DB2 from a remote location with success.
Ironically, what you don't want to do is use Access to front-end an Access database (mdb) from a remote location over a ... | null | CC BY-SA 2.5 | null | 2008-09-01T15:56:06.450 | 2008-09-01T15:56:06.450 | null | null | 3,452 | null |
38,077 | 2 | null | 37,979 | 1 | null | Depends! ;)
For example there is [ADODB's Active Record implementation](http://phplens.com/lens/adodb/docs-active-record.htm), then there is Zend_Db_DataTable and [Doctrine](http://www.phpdoctrine.org/). Those are the ones I know of, I am sure there are more implementations.
Out of those three I'd recommend Doctrine.... | null | CC BY-SA 2.5 | null | 2008-09-01T15:53:57.050 | 2008-09-01T15:53:57.050 | null | null | 2,859 | null |
38,081 | 1 | 38,087 | null | 0 | 1,681 | I need to create a quick-n-dirty knob control in Visual Basic 2005 Express, the value of which is incremented/decremented by "grabbing" it with the mouse and moving the cursor up/down. Because the knob itself doesn't move, I need to keep tracking the mouse movement outside of the rectangle of the control.
I use a `Lab... | How to implement mouse dragging in Visual Basic? | CC BY-SA 3.0 | null | 2008-09-01T15:54:46.873 | 2012-07-03T14:15:17.107 | 2012-05-03T15:18:23.497 | 728,795 | 2,095 | [
"vb.net",
"user-controls",
"drag-and-drop"
] |
38,087 | 2 | null | 38,081 | 0 | null | You need the control to handle three events: Mouse Down, Mouse Move and Mouse Up. On the Mouse Down event, you will need to capture the mouse. This means the mouse messages are sent to the control that has the capture. In the mouse move event, if the input is captured then update the displayed image depending on the am... | null | CC BY-SA 3.0 | null | 2008-09-01T16:01:22.070 | 2012-07-03T14:15:17.107 | 2012-07-03T14:15:17.107 | 142,162 | 1,898 | null |
38,074 | 1 | 40,159 | null | 14 | 50,466 | If you create an Oracle dblink you cannot directly access LOB columns in the target tables.
For instance, you create a dblink with:
```
create database link TEST_LINK
connect to TARGETUSER IDENTIFIED BY password using 'DATABASESID';
```
After this you can do stuff like:
```
select column_a, column_b
from data_... | Best way to handle LOBs in Oracle distributed databases | CC BY-SA 3.0 | 0 | 2008-09-01T15:52:32.277 | 2016-10-06T11:12:51.123 | 2013-01-30T23:30:52.543 | 146,325 | 2,846 | [
"sql",
"oracle",
"distributed-transactions",
"dblink"
] |
38,090 | 1 | 39,031 | null | 7 | 3,114 | I am considering log-shipping of [Write Ahead Logs (WAL)](http://www.postgresql.org/docs/8.2/static/runtime-config-wal.html) in PostgreSQL to create a warm-standby database. However I have one table in the database that receives a huge amount of INSERT/DELETEs each day, but which I don't care about protecting the data ... | How to prevent Write Ahead Logging on just one table in PostgreSQL? | CC BY-SA 2.5 | 0 | 2008-09-01T16:03:55.463 | 2018-10-29T22:35:08.290 | null | null | 4,045 | [
"postgresql"
] |
38,089 | 2 | null | 37,070 | 46 | null | Espo is pretty much bang on target. Just wanted to add my two cents:
The "non temporal" phrase means lacking temporal locality. Caches exploit two kinds of locality - spatial and temporal, and by using a non-temporal instruction you're signaling to the processor that you don't expect the data item be used in the near ... | null | CC BY-SA 2.5 | null | 2008-09-01T16:03:35.810 | 2008-09-01T16:03:35.810 | null | null | 1,386,292 | null |
38,083 | 2 | null | 37,979 | 1 | null | I found a few examples of other implementations:
Luke Baker has one he is calling [Active Record in PHP](http://lukebaker.org/projects/activerecord-in-php/).
Flinn has a [post](http://www.actsasflinn.com/articles/2007/08/08/php-and-activerecord) about why it is not possible in PHP because in Ruby everything is an obje... | null | CC BY-SA 2.5 | null | 2008-09-01T15:58:21.953 | 2008-09-01T15:58:21.953 | null | null | 1,611 | null |
38,098 | 2 | null | 38,068 | 1 | null | No. Though, groovy, a JVM language, is dynamically typed and would let you write:
```
def map = new HashMap<complicated generic expression>();
```
| null | CC BY-SA 2.5 | null | 2008-09-01T16:12:11.107 | 2008-09-01T16:12:11.107 | null | null | 2,603 | null |
38,097 | 2 | null | 37,979 | 1 | null | This is more of a how-to-implement tip, but I started dabbling with creating an ActiveRecord/DataMapper implementation in PHP and quickly ran into many hurdles with array-like access. Eventually I found the SPL extensions to PHP, and particularly ArrayObject and ArrayIterator. These began to make my life a lot easier. ... | null | CC BY-SA 2.5 | null | 2008-09-01T16:10:51.127 | 2008-09-01T16:10:51.127 | null | null | 4,065 | null |
38,101 | 2 | null | 34,920 | 7 | null | CPAN to the rescue: [IO::LockedFile](http://search.cpan.org/~rani/IO-LockedFile-0.23/LockedFile.pm).
| null | CC BY-SA 2.5 | null | 2008-09-01T16:17:10.860 | 2008-09-01T16:17:10.860 | null | null | 2,506 | null |
38,096 | 2 | null | 38,057 | 1 | null | I think you need to annotate your super-class with [@MappedSuperclass](http://java.sun.com/javaee/5/docs/api/javax/persistence/MappedSuperclass.html) instead of .
| null | CC BY-SA 2.5 | null | 2008-09-01T16:09:47.947 | 2008-09-01T16:09:47.947 | null | null | 2,670 | null |
38,095 | 2 | null | 38,019 | 3 | null | If your "FooProcessor" really does process foos, then don't be reluctant to give it that name just because you already have a BarProcessor, BazProcessor, etc. When in doubt, obvious is best. The other developers who have to read your code may not be using the same thesaurus you are.
That said, more specificity wouldn'... | null | CC BY-SA 2.5 | null | 2008-09-01T16:08:49.540 | 2008-09-01T16:08:49.540 | null | null | 3,776 | null |
38,057 | 1 | 53,448 | null | 11 | 29,905 | ```
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
public class Problem {
@ManyToOne
private Person person;
}
@Entity
@DiscriminatorValue("UP")
public class UglyProblem extends Problem {}
@Entity
public class Person {
@OneToMany(mappedBy="person")
private List< UglyProblem > problems;
}... | Why @OneToMany does not work with inheritance in Hibernate | CC BY-SA 3.0 | 0 | 2008-09-01T15:21:01.310 | 2020-06-16T12:03:37.020 | 2013-07-13T12:52:31.677 | 1,288 | 4,052 | [
"java",
"hibernate",
"inheritance",
"orm"
] |
38,102 | 2 | null | 38,068 | 12 | null | There's the [pseudo-typedef antipattern](http://www.ibm.com/developerworks/java/library/j-jtp02216/index.html)...
```
class StringList extends ArrayList<String> { }
```
Good stuff, drink up! ;-)
As the article notes, this technique has some serious issues, primarily that this "typedef" is actually a separate class... | null | CC BY-SA 3.0 | null | 2008-09-01T16:17:14.823 | 2012-03-14T14:25:41.727 | 2012-03-14T14:25:41.727 | 1,268,844 | 811 | null |
38,092 | 2 | null | 36,932 | 84 | null | The typesafe enum pattern which was used in Java pre-JDK 5 has a
number of advantages. Much like in Alexandru's answer, you create a
class and class level fields are the enum values; however, the enum
values are instances of the class rather than small integers. This has
the advantage that your enum values don't inadve... | null | CC BY-SA 2.5 | null | 2008-09-01T16:05:25.540 | 2010-11-30T03:56:22.997 | 2010-11-30T03:56:22.997 | 2,603 | 2,603 | null |
38,105 | 2 | null | 19,838 | 3 | null | I haven't actually implemented any of this, so take it with a sack of salt.
There are two parts to a closure: the data environment and the code environment. Like you said, you can probably pass a void* to handle references to data. You could probably use setjmp and longjmp to implement the non-linear control flow jump... | null | CC BY-SA 2.5 | null | 2008-09-01T16:18:19.737 | 2008-09-04T04:57:20.033 | 2008-09-04T04:57:20.033 | 1,386,292 | 1,386,292 | null |
38,099 | 2 | null | 37,185 | 1 | null | > What is the normal way people writing
network code in Delphi use
Windows-style overlapped asynchronous
socket I/O?
Well, Indy has been the 'standard' library for socket I/O for a long while now - and it's based on blocking sockets. This means if you want asynchronous behaviour, you use additional thread(s) to ... | null | CC BY-SA 2.5 | null | 2008-09-01T16:12:18.800 | 2008-09-01T16:12:18.800 | null | null | 1,737 | null |
38,104 | 2 | null | 37,573 | 1 | null | Here's a tutorial: [http://ruby.meetup.com/73/boards/view/viewthread?thread=2203432](http://ruby.meetup.com/73/boards/view/viewthread?thread=2203432)
(I don't know if it's any good.)
And here's one with InstantRails+Netbeans: [https://web.archive.org/web/20100505044104/http://weblogs.java.net/blog/bleonard/archive/200... | null | CC BY-SA 3.0 | null | 2008-09-01T16:18:02.123 | 2017-08-09T20:24:17.533 | 2017-08-09T20:24:17.533 | 366,904 | 2,603 | null |
38,107 | 1 | 38,128 | null | 3 | 946 | I am using a cross page `postback` for Page A to pass data to Page B.
The button that causes the postback has its postbackurl set but is disabled until the user selects a value from a DDL at which point the button is enable using javascript. However this prevents the cross page postback from occurring, Page A just pos... | Cross Page Postback doesn't work for client-side enabled button | CC BY-SA 3.0 | null | 2008-09-01T16:20:44.550 | 2017-07-03T13:51:26.283 | 2017-07-03T13:51:26.283 | 5,423,108 | 1,127,460 | [
"asp.net",
"postback"
] |
38,114 | 2 | null | 37,821 | 2 | null | No, but there are two solutions I would recommend:
- Adiscon [EventLogger](http://www.eventreporter.com/en/) is a third-party product that will send your Windows EventLog to a SQL database. You can either send all events or create filters. Of course, once the events are in a SQL database, you can use any of the usual ... | null | CC BY-SA 2.5 | null | 2008-09-01T16:23:29.333 | 2008-09-01T16:23:29.333 | null | null | 1,690 | null |
38,110 | 2 | null | 37,702 | 3 | null | If you believe in a deterministic universe, true randomness doesn't exist. :-) For example, someone has suggested that radioactive decay is random, but IMHO, just because scientists haven't yet worked out the pattern, doesn't mean that there isn't a pattern there to be worked out. Usually, when you want "random" numbe... | null | CC BY-SA 2.5 | null | 2008-09-01T16:22:18.353 | 2008-09-01T16:22:18.353 | null | null | 3,408 | null |
38,113 | 2 | null | 1,711 | 4 | null | I recently read [Dreaming in Code](https://rads.stackoverflow.com/amzn/click/com/1400082471) and found it to be an interesting read. Perhaps more so since the day I started reading it Chandler 1.0 was released. Reading about the growing pains and mistakes of a project team of talented people trying to "change the world... | null | CC BY-SA 2.5 | null | 2008-09-01T16:22:53.967 | 2008-09-01T16:22:53.967 | null | null | 4,065 | null |
38,115 | 2 | null | 21,274 | 1 | null | For something minimalist, take a look at [Widg Editor](http://www.themaninblue.com/experiment/widgEditor/), it's truly tiny and very simple. It's only haphazardly supported as a hobby project though.
I'm currently using the RTE component of [DynarchLib](http://www.dynarchlib.com/), which is highly customisable - defin... | null | CC BY-SA 2.5 | null | 2008-09-01T16:23:46.227 | 2008-10-10T01:21:45.787 | 2008-10-10T01:21:45.787 | 1,000 | 1,000 | null |
38,121 | 2 | null | 38,117 | 3 | null | I switched to gMail and have never been happier.
You could also try using a tags plugin like [http://www.taglocity.com/index.html](http://www.taglocity.com/index.html)
| null | CC BY-SA 2.5 | null | 2008-09-01T16:27:25.033 | 2008-09-01T16:27:25.033 | null | null | 3,747 | null |
38,122 | 2 | null | 4,689 | 0 | null | I'm digging the DejaVu Sans Mono (it's supposed to be the same as Panic Sans) on my Mac.
| null | CC BY-SA 2.5 | null | 2008-09-01T16:28:18.743 | 2008-09-01T16:28:18.743 | null | null | 4,072 | null |
38,118 | 2 | null | 38,068 | 3 | null | Use [Factory Pattern](http://en.wikipedia.org/wiki/Abstract_factory_pattern) for creation of Generics:
Method Sample:
```
public Map<String, Integer> createGenMap(){
return new HashMap<String,Integer>();
}
```
| null | CC BY-SA 2.5 | null | 2008-09-01T16:26:14.740 | 2008-09-01T16:26:14.740 | null | null | 3,031 | null |
38,117 | 1 | null | null | 8 | 2,073 | I've gone back and forth between having an organized inbox and having an inbox with absolutely everything I've received in it.
Would you recommend leaving everything in an inbox, or organize it? If you organize it, is there any method to your madness or possibly an Outlook (2003) plug-in to aid in this task?
For w... | Inbox Management (in Outlook) | CC BY-SA 2.5 | 0 | 2008-09-01T16:24:14.603 | 2015-08-20T22:26:12.280 | 2008-09-01T18:07:41.673 | 305 | 4,066 | [
"email",
"outlook",
"gtd"
] |
38,124 | 2 | null | 37,532 | 0 | null | I invested a lot of time in the aforementioned COM API back in 2002. It was, to put it mildly, "flakey".
What we ended up doing instead is having our tasks run every minute. The first thing the task did was check the database to see if it should continue running or not.
Then "starting" a scheduled task from SSIS was ... | null | CC BY-SA 2.5 | null | 2008-09-01T16:28:55.047 | 2008-09-01T16:28:55.047 | null | null | 1,690 | null |
38,116 | 2 | null | 38,068 | 4 | null | In a generic method, you can use a limited form of type inferrence to avoid some repetitions.
Example: if you have the function
```
<K, V> Map<K, V> getSomething() {
//...
}
```
you can use:
```
final Map<String, Object> something = getsomething();
```
instead of:
```
final Map<String, Object> somet... | null | CC BY-SA 2.5 | null | 2008-09-01T16:23:54.387 | 2008-09-01T16:39:33.600 | 2008-09-01T16:39:33.600 | 2,797 | 2,797 | null |
38,120 | 2 | null | 38,117 | 2 | null | I'm going with the Microsoft way;
- - - -
It works for me great.
You can read about it at [http://www.microsoft.com/atwork/manageinfo/email.mspx](http://www.microsoft.com/atwork/manageinfo/email.mspx).
| null | CC BY-SA 2.5 | null | 2008-09-01T16:27:06.890 | 2008-09-01T16:27:06.890 | null | null | 936 | null |
38,125 | 1 | 38,189 | null | 6 | 1,127 | Was looking to get peoples thoughts on keeping a Lucene index up to date as changes are made to the domain model objects of an application.
The application in question is a Java/J2EE based web app that uses Hibernate. The way I currently have things working is that the Hibernate mapped model objects all implement a... | Strategies for keeping a Lucene Index up to date with domain model changes | CC BY-SA 2.5 | 0 | 2008-09-01T16:29:10.520 | 2017-03-09T12:51:18.183 | 2010-09-10T20:55:12.653 | 19,112 | 4,063 | [
"indexing",
"lucene"
] |
38,126 | 2 | null | 38,081 | 0 | null | Your problem will be to determine which bitmap you have to display based upon the coordinates the mouse reports in the mouse_move event. You'll need to perform some magic to transform the coordinates and come up with a value that you can use to pick the right image.
It doesn't sound too complicated, just a little bit... | null | CC BY-SA 2.5 | null | 2008-09-01T16:29:20.067 | 2008-09-01T16:29:20.067 | null | null | 2,684 | null |
38,128 | 2 | null | 38,107 | 2 | null | It looks like when the button is disabled .Net doesn't bother adding the necessary bits to handle the cross page postback on the client, so they will be missing when the button is enable client-side.
I guess one solution would be to have the button enabled to start with (so that .Net adds the cross page postback contr... | null | CC BY-SA 2.5 | null | 2008-09-01T16:29:49.630 | 2008-09-01T16:29:49.630 | null | null | 1,127,460 | null |
38,127 | 2 | null | 38,037 | 0 | null | If you aren't yet committed to Rapid XML, I can recommend some alternative libraries:
- Xerces - This is probably the defacto C++ implementation.- XMLite - I've had some luck with this minimal XML implementation. See the article at [http://www.codeproject.com/KB/recipes/xmlite.aspx](http://www.codeproject.com/KB/reci... | null | CC BY-SA 2.5 | null | 2008-09-01T16:29:22.300 | 2008-09-01T16:29:22.300 | null | null | 4,066 | null |
38,129 | 2 | null | 38,026 | 2 | null | There is a [60 day evaluation trial of Open Enterprise Server 2](https://secure-www.novell.com/center/regadmin/jsps/eval_app.jsp?buildid=GsODlkBPM2g~) available (requires free registration). If you install it in a VM, there's nothing stopping you from reinstalling it after 60 days (well except licence).
But you will n... | null | CC BY-SA 2.5 | null | 2008-09-01T16:29:57.023 | 2008-09-01T16:29:57.023 | null | null | 3,205 | null |
38,130 | 2 | null | 37,932 | 1 | null | Thanks for the link Keith, I'll have a look at that out of interest, as LINQ is on my list of things to learn. Unfortunately, I need to target .Net 2.0 for this app, so I think (please correct me if I'm wrong!) that LINQ is out of the question.
I've now included the CSS in the header of the XSLT, and I've found a way... | null | CC BY-SA 2.5 | null | 2008-09-01T16:30:31.283 | 2008-09-01T16:30:31.283 | null | null | 4,019 | null |
38,135 | 2 | null | 37,944 | 1 | null | People usually jump the technology bandwagon when there is a a real productivity to gain. Something to compensate for all the productivity loss that normally occurs when you adopt a new platform. WPF is just not there yet. It still takes more effort and more time to build a WPF app than a Forms app, and by a long shot.... | null | CC BY-SA 2.5 | null | 2008-09-01T16:32:55.830 | 2008-09-01T16:32:55.830 | null | null | 3,263 | null |
38,146 | 2 | null | 38,074 | 0 | null | In this specific case can the only way the two systems can communicate is using the dblink.
Also, the table solution is not that terrible, it's just messy to have to "cache" the data on my side of the dblink.
| null | CC BY-SA 2.5 | null | 2008-09-01T16:39:51.277 | 2008-09-01T16:39:51.277 | null | null | 2,846 | null |
38,142 | 2 | null | 38,074 | 0 | null | Do you have a specific scenario in mind?
For example, if the LOB holds files, and you are on a company intranet, perhaps you can write a stored procedure to extract the files to a known directory on the network and access them from there.
| null | CC BY-SA 2.5 | null | 2008-09-01T16:35:58.507 | 2008-09-01T16:35:58.507 | null | null | 3,590 | null |
38,133 | 2 | null | 4,149 | 8 | null | You might also take a look at java channel for locking a part of a file.
[http://java.sun.com/javase/6/docs/api/java/nio/channels/FileChannel.html](http://java.sun.com/javase/6/docs/api/java/nio/channels/FileChannel.html)
This function of the `FileChannel` might be a start
```
lock(long position, long size, boolean ... | null | CC BY-SA 2.5 | null | 2008-09-01T16:31:53.870 | 2008-09-01T16:31:53.870 | null | null | 4,064 | null |
38,143 | 2 | null | 35,026 | 15 | null | This is why a lot of companies store their applications' connection strings at the machine level instead of the application level.
Just take the connection string out of the source code entirely. Then have everyone put connection string in machine.config.
This has the added benefit of avoiding unnecessary app-speci... | null | CC BY-SA 3.0 | null | 2008-09-01T16:36:14.280 | 2017-08-10T10:24:13.363 | 2017-08-10T10:24:13.363 | 366,904 | 1,690 | null |
38,154 | 2 | null | 38,117 | 7 | null | I would recommend following the [inbox zero](http://video.google.com/videoplay?docid=973149761529535925) approach advocated by 43 folders. Joel Spolsky apparently uses it and a lot of people feel it's a great way of decluttering and organising your email life :-).
| null | CC BY-SA 2.5 | null | 2008-09-01T16:42:41.067 | 2008-09-01T16:42:41.067 | null | null | 3,394 | null |
38,151 | 1 | null | null | 1 | 853 | I've got a page with an control - the link is to a gif file. Right clicking on the link (in IE7) and selecting "open target in new window" correctly displays the image. However I can't then close the new IE window.
Works OK in Firefox 3
What might I be doing wrong ?
TIA
Tom
| <asp:hyperlink> after opening target in new window - new window cannot be closed | CC BY-SA 2.5 | null | 2008-09-01T16:41:44.157 | 2016-12-20T05:28:55.867 | 2008-09-01T19:04:58.400 | 2,839 | 2,839 | [
"asp.net"
] |
38,157 | 2 | null | 4,689 | 0 | null | +1 Verdana -- agree with pauldoo
A variable width font for coding is probably not to everyone's taste but I really like Verdana's legibility with ClearType.
| null | CC BY-SA 2.5 | null | 2008-09-01T16:46:44.847 | 2008-09-01T16:46:44.847 | null | null | 1,518 | null |
38,138 | 2 | null | 38,037 | 2 | null | If you do build XML yourself, don't forget to escape the special characters. This tends to be overlooked, but can cause some serious headaches if it is not implemented:
- - - - -
| null | CC BY-SA 2.5 | null | 2008-09-01T16:34:59.460 | 2008-09-01T16:34:59.460 | null | null | 4,066 | null |
38,158 | 1 | 38,179 | null | 16 | 6,908 | My company recently purchased TFS and I have started looking into the code analysis tools to help drive up code quality and noticed a good looking metric "maintainability index". Is anyone using this metric for code reviews/checkins/etc? If so, what is an acceptable index for developers to work toward?
| What is a good maintainability index using Visual Studio 2008 code analysis? | CC BY-SA 2.5 | null | 2008-09-01T16:46:46.500 | 2018-07-11T10:47:15.557 | null | null | 2,701 | [
"visual-studio",
"code-analysis"
] |
38,137 | 2 | null | 38,039 | 1 | null | You could use the excellent [Umbrella library](http://www.codeplex.com/umbrella):
```
using nVentive.Umbrella.Extensions.Calendar;
DateTime beginning = DateTime.Now.BeginningOfWeek();
```
However, they seem to have stored Monday as the first day of the week (see the property `nVentive.Umbrella.Extensions.Calendar.D... | null | CC BY-SA 2.5 | null | 2008-09-01T16:34:07.140 | 2008-09-01T16:43:01.843 | 2008-09-01T16:43:01.843 | 3,191 | 3,191 | null |
38,171 | 2 | null | 38,160 | 6 | null | Maybe try a parallelizing utility instead rewriting the loop? I'm a big fan of xjobs. I use xjobs all the time to mass copy files across our network, usually when setting up a new database server.
[http://www.maier-komor.de/xjobs.html](http://www.maier-komor.de/xjobs.html)
| null | CC BY-SA 2.5 | null | 2008-09-01T16:55:04.763 | 2008-09-01T16:55:04.763 | null | null | 3,075 | null |
38,167 | 2 | null | 38,117 | 0 | null | The best place to start with getting control of your email is definitely Merlin Mann's excellent [Inbox Zero](http://www.43folders.com/izero) series. In particular his [Google Tech Talk video](http://video.google.com/videoplay?docid=973149761529535925&hl=en) is a great talk.
| null | CC BY-SA 2.5 | null | 2008-09-01T16:50:18.660 | 2008-09-01T16:50:18.660 | null | null | 2,600 | null |
38,175 | 2 | null | 38,117 | 4 | null | If you don't want to actually clear out your inbox, you could use a good search utility like Google Desktop, Yahoo Desktop Search (is that what it's called) or my current favorite, Xobni.
With these tools you don't have to worry about where you put the mails you saved. Just save them all and let the tools find it.
| null | CC BY-SA 2.5 | null | 2008-09-01T17:00:51.460 | 2008-09-01T17:00:51.460 | null | null | 1,084 | null |
38,160 | 1 | 881,450 | null | 98 | 50,387 | Lets say I have a loop in Bash:
```
for foo in `some-command`
do
do-something $foo
done
```
`do-something` is cpu bound and I have a nice shiny 4 core processor. I'd like to be able to run up to 4 `do-something`'s at once.
The naive approach seems to be:
```
for foo in `some-command`
do
do-something $foo &
d... | Parallelize Bash script with maximum number of processes | CC BY-SA 3.0 | 0 | 2008-09-01T16:47:53.377 | 2019-02-01T02:39:07.080 | 2017-04-30T19:54:01.137 | 6,862,601 | 163 | [
"bash"
] |
38,164 | 2 | null | 34,183 | 3 | null | Why not just do all the work in C# instead of using batch files?
I was bored so i wrote this real quick, it's just an outline of how I would do it since I don't know what the command line switches do or the file paths.
```
using System;
using System.IO;
using System.Text;
using System.Security;
using System.Diagnosti... | null | CC BY-SA 2.5 | null | 2008-09-01T16:49:39.053 | 2008-09-01T16:49:39.053 | null | null | 1,147 | null |
38,166 | 2 | null | 38,160 | 12 | null | Instead of a plain bash, use a Makefile, then specify number of simultaneous jobs with `make -jX` where X is the number of jobs to run at once.
Or you can use `wait` ("`man wait`"): launch several child processes, call `wait` - it will exit when the child processes finish.
```
maxjobs = 10
foreach line in `cat file.... | null | CC BY-SA 2.5 | null | 2008-09-01T16:50:18.397 | 2008-09-01T17:01:16.137 | 2008-09-01T17:01:16.137 | 3,205 | 3,205 | null |
38,179 | 2 | null | 38,158 | 22 | null | The maintainability index is not as much a fixed value you look at, it's more of an indication that code is hard to understand, test and/or debug. I usually try to keep high-level code (basically anything except for the real plumbing code) above 80, where 90+ would be good. It adds a competitive element to programming ... | null | CC BY-SA 4.0 | null | 2008-09-01T17:04:33.837 | 2018-07-11T10:47:15.557 | 2018-07-11T10:47:15.557 | 9,959,912 | 909 | null |
38,180 | 2 | null | 38,117 | 1 | null | Keep to the ideal of inbox zero in the actual inbox, then employ a decent search engine (Google Desktop or Xobni for example).
I have a handful of project- or filter-specific folders (e.g. for system generated status messages that go to a mailing list), but generally all archived email is dumped in one folder.
In O... | null | CC BY-SA 2.5 | null | 2008-09-01T17:04:55.270 | 2008-09-01T17:04:55.270 | null | null | 2,902 | null |
38,123 | 2 | null | 36,350 | 77 | null | The `params` parameter modifier gives callers a shortcut syntax for passing multiple arguments to a method. There are two ways to call a method with a `params` parameter:
Calling with an array of the parameter type, in which case the `params` keyword has no effect and the array is passed directly to the method:
```
ob... | null | CC BY-SA 4.0 | null | 2008-09-01T16:28:37.793 | 2022-06-26T10:17:37.633 | 2022-06-26T10:17:37.633 | 4,751,173 | 2,495 | null |
38,181 | 1 | 38,256 | null | 179 | 74,695 | I have a basic understanding of mock and fake objects, but I'm not sure I have a feeling about when/where to use mocking - especially as it would apply to this scenario [here](https://stackoverflow.com/questions/37375/how-do-i-unit-test-a-wcf-service).
| When should I mock? | CC BY-SA 2.5 | 0 | 2008-09-01T17:07:24.440 | 2021-01-02T10:09:51.313 | 2017-05-23T11:55:01.607 | -1 | 781 | [
"unit-testing",
"language-agnostic",
"mocking"
] |
38,187 | 2 | null | 14,287 | 5 | null | I strongly suggest using [VideoInput lib](http://muonics.net/school/spring05/videoInput/), it supports any DirectShow device (even multiple devices at the same time) and is more configurable. You'll spend five minutes make it play with OpenCV.
| null | CC BY-SA 2.5 | null | 2008-09-01T17:15:00.380 | 2008-09-01T17:15:00.380 | null | null | 3,373 | null |
38,191 | 2 | null | 37,428 | 2 | null | A good starting place is "Thinking in C++" by Bruce Eckel, I've rarely had anyone complain about the book. Well written and also has a version available online.
| null | CC BY-SA 2.5 | null | 2008-09-01T17:29:38.970 | 2008-09-01T17:29:38.970 | null | null | 4,071 | null |
38,185 | 2 | null | 37,428 | 1 | null | My book recommendations:
(Lippman)
(Dewhurst)
...and I second the suggestion above.
A very handy alternative to buying books in meatspace is to subscribe to a service like [Safari Books Online](http://techbus.safaribooksonline.com/home). For a not unreasonable monthly fee you'll get access to all of the above bo... | null | CC BY-SA 2.5 | null | 2008-09-01T17:14:31.707 | 2008-09-01T17:14:31.707 | null | null | 4,069 | null |
38,189 | 2 | null | 38,125 | 4 | null | Change the message: just provide the primary key and the current date, not the key/value pairs. Your mdb fetches the entity by primary key and calls index(). After indexing you set a value "updated" in your index to the message date. You update your index only if the message date is after the "updated" field of the ind... | null | CC BY-SA 2.5 | null | 2008-09-01T17:26:13.630 | 2008-09-01T17:26:13.630 | null | null | 2,554 | null |
38,190 | 1 | 38,213 | null | 14 | 13,176 | Is it possible to read a disk directly with .NET? By directly, I mean via the device bypassing the file system. I think I would go about this by opening the device some way "\Device\Ide\IdeDeviceP2T0L0-1" for example.
If I can't open the device with a .NET API, knowing which Win32 API to use would be helpful.
| How do I read a disk directly with .NET? | CC BY-SA 4.0 | 0 | 2008-09-01T17:27:43.843 | 2022-09-08T00:40:20.620 | 2022-09-08T00:40:20.620 | 1,402,846 | 1,834 | [
".net",
"winapi",
"disk"
] |
38,183 | 1 | null | null | 5 | 3,275 | I am looking for an open source project that uses EJB3 as backend and JSF as frontend. It should be a tutorial but a real application that real people are using.
The application should be data-driven, i.e. the following aspects are fundamental and make 80% or more of the application.
- - - - - -
Typical applicatio... | Any data-driven open source JEE5 EJB3+JSF Sample Project out there? | CC BY-SA 2.5 | 0 | 2008-09-01T17:09:44.683 | 2018-12-20T13:04:03.623 | 2008-10-21T12:32:29.520 | 2,554 | 2,554 | [
"java",
"open-source",
"jsf",
"jakarta-ee",
"java-ee-5"
] |
38,188 | 2 | null | 38,035 | 0 | null | I don't think its possible to limit the number of words returned, however to limit the number of chars returned you could do something like
```
SELECT SUBSTRING(field_name, LOCATE('keyword', field_name) - chars_before, total_chars) FROM table_name WHERE field_name LIKE "%keyword%"
```
- -
i.e. the following exampl... | null | CC BY-SA 2.5 | null | 2008-09-01T17:26:03.443 | 2008-09-01T17:26:03.443 | null | null | 2,083 | null |
38,194 | 2 | null | 38,181 | 7 | null | You should mock an object when you have a dependency in a unit of code you are trying to test that needs to be "just so".
For example, when you are trying to test some logic in your unit of code but you need to get something from another object and what is returned from this dependency might affect what you are tryi... | null | CC BY-SA 3.0 | null | 2008-09-01T17:38:00.107 | 2014-01-29T23:07:21.867 | 2014-01-29T23:07:21.867 | 843,804 | 2,701 | null |
38,193 | 1 | 38,209 | null | 6 | 2,951 | Is there an easy way to tell if a ruby script is already running and then handle it appropriately? For example: I have a script called really_long_script.rb. I have it cronned to run every 5 minutes. When it runs, I want to see if the previous run is still running and then stop the execution of the second script. ... | Determine if a ruby script is already running | CC BY-SA 2.5 | 0 | 2008-09-01T17:34:06.590 | 2015-06-25T07:41:24.070 | null | null | 4,082 | [
"ruby"
] |
38,197 | 1 | 38,222 | null | 4 | 701 | The primary class in the `subprocess` module is name `Popen`, and represents a subprocess. `Popen` sounds like someone was trying to force the name to follow some function naming format, rather than chosing a name that actually represents what the object is. Does anyone know why it was chosen over something simple lik... | Why is the subprocess.Popen class not named Subprocess? | CC BY-SA 2.5 | 0 | 2008-09-01T17:40:52.220 | 2018-03-26T01:31:49.353 | null | null | 1,114 | [
"python",
"subprocess"
] |
38,196 | 2 | null | 38,056 | 13 | null | It should work on any POSIX system (although looking at the `/proc` filesystem, as others have suggested, is easier if you know it's going to be there).
However: `os.kill` may also fail if you don't have permission to signal the process. You would need to do something like:
```
import sys
import os
import errno
try:... | null | CC BY-SA 2.5 | null | 2008-09-01T17:40:47.417 | 2008-09-01T18:09:32.277 | 2008-09-01T18:09:32.277 | 3,002 | 3,002 | null |
38,195 | 2 | null | 38,117 | 1 | null | I use message flags for my "action folders" and shunt everything into one big Archive folder after I process it (use the ++ shortcut to do this). As an example, I might flag a received message with a red flag (reply), a blue flag (pending, meaning I have to do something about it first), or maybe a green flag (referenc... | null | CC BY-SA 3.0 | null | 2008-09-01T17:40:35.403 | 2015-08-20T22:26:12.280 | 2015-08-20T22:26:12.280 | 7,226 | null | null |
38,200 | 2 | null | 38,193 | 0 | null | In bash:
```
if ps aux | grep really_long_script.rb | grep -vq grep
then
echo Script already running
else
ruby really_long_script.rb
fi
```
| null | CC BY-SA 2.5 | null | 2008-09-01T17:45:22.460 | 2008-09-01T17:45:22.460 | null | null | 1,694 | null |
38,198 | 1 | 38,207 | null | 5 | 877 | `celsius = (5.0/9.0) * (fahr-32.0);`
Is it just a development choice that the C developers decided upon or is there a reason to this? I believe a float is smaller than a double, so it might be to prevent overflows caused by not knowing what decimal format to use. Is that the reason, or am I overlooking something?
| Why does this C code produce a double instead of a float? | CC BY-SA 2.5 | null | 2008-09-01T17:43:49.717 | 2009-08-20T15:37:01.273 | null | null | 572 | [
"c",
"types"
] |
38,201 | 2 | null | 37,991 | 1 | null | It depends a on the database you're using as a back-end. I've had [rather terrible experiences with MySQL as a back-end](https://stackoverflow.com/questions/5842/issues-using-ms-access-as-a-front-end-to-a-mysql-database-back-end#9200). Make sure the ODBC link you're using is actively developed, stable and complete ---... | null | CC BY-SA 2.5 | null | 2008-09-01T17:46:11.863 | 2008-09-01T17:46:11.863 | 2017-05-23T12:00:17.880 | -1 | 1,037 | null |
38,202 | 2 | null | 38,197 | -1 | null | I suppose the name was chosen because the functionality `subprocess` is replacing was formerly in the `os` module as the `os.popen` function. There could be even ways to automate migration between the two.
| null | CC BY-SA 2.5 | null | 2008-09-01T17:47:07.853 | 2008-09-01T17:47:07.853 | null | null | 2,954 | null |
38,186 | 2 | null | 37,791 | 1 | null | There are some libraries, such as MDB2 in PEAR that make querying a bit easier and safer.
Unfortunately, they can be a bit wordy to set up, and you sometimes have to pass them the same info twice. I've used MDB2 in a couple of projects, and I tended to write a thin veneer around it, especially for specifying the type... | null | CC BY-SA 2.5 | null | 2008-09-01T17:14:44.360 | 2008-09-01T17:36:32.480 | 2008-09-01T17:36:32.497 | 4,053 | 4,053 | null |
38,207 | 2 | null | 38,198 | 4 | null | I think the reason is to ensure that any result can be encompassed. so the natural choice is double as it is the largest data type.
| null | CC BY-SA 2.5 | null | 2008-09-01T17:51:13.553 | 2008-09-01T17:51:13.553 | null | null | 380 | null |