instruction stringlengths 0 30k ⌀ |
|---|
I have a database containing stock price history. I want to select most recent prices for every stock that is listed. I know PostreSQL has a <a href="http://stackoverflow.com/questions/25224/joining-latest-of-various-usermetadata-tags-to-user-rows#27159">DISTINCT ON</a> statement that would suit ideally here.
Table ... |
I was just working on fixing up exception handling in a .NET 2.0 app, and I stumbled onto some weird issue with [Application.ThreadException][1].
What I want is to be able to catch all exceptions from events behind GUI elements (e.g. button_Click, etc.). I then want to filter these exceptions on 'fatality', e.g. wit... |
Firebird database replication |
|database|replication|firebird| |
I have reached the point where I've decided to replace my custom-built replication system with a system that has been built by someone else, mainly for reliability purposes. Can anyone recommend any replication system that is worth it? Is [FiBRE][1] any good?
What I need might be a little away from a generic system,... |
Casting is the **only** good answer.
You have to remember, that ToString and Parse results are not always exact - there are cases, when you cannot safely roundtrip between those two functions.
The documentation of ToString says, it uses current thread culture settings. The documentation of Parse says, it also use... |
One thing that I have seen lead to an improvement is the use of a "talking stick" (we actually use a soft ball). It provides some additional focus on who is currently speaking, and makes the transition to another person more obvious. |
GreaseMonkey scripts are themselves executed on DOMContentLoaded, so it's unnecessary to add a load event handler - just have your script do whatever it needs to to immediately.
http://wiki.greasespot.net/DOMContentLoaded |
http://weblogs.asp.net/ralfw/archive/2007/02/04/single-assembly-deployment-of-managed-and-unmanaged-code.aspx |
It isn't referring to a blank line, it's whether the last line (which can have content in it) is terminated with a newline.
Most text editors will put a newline at the end of the last line of a file, so if the last line doesn't have one, there is a risk that the file has been truncated. However, there are valid reas... |
Should I add the Visual Studio .suo and .user files to source control |
|visual-studio|svn| |
Visual Studio solutions contain two types of hidden user files. One is the solution .suo file which is a binary file. The other is the project .user file which is a text file. Does anyone know exactly what data these files contain? I've also been wondering whether I should be adding these files to source control (S... |
[Thinstall][1] is one solution. For a native windows application I would suggest embedding the DLL as a binary resource object, then extracting it at runtime before you need it.
[1]: https://thinstall.com/help/index.php?_netsupport.htm |
If you store user sessions in the database, you could simply check the existance of the Guid in the session table, if it exists, then the user already authenticated on the other domain. For this to work, you would have to included the session guid in the URL when you redirect the user over to the other website.
|
It depends on what you're doing. LINQ is going to be less efficient at the actual data/set manipulation than a real database. But you'll save a lot in not having to connect to the database over a network.
If your database is on the same machine or is formally 'well-connected', you're probably better off using it.
... |
Avoid the standard Asp.Net control and use the NeadUpload component from Brettle Development: http://www.brettle.com/neatupload<br/>
<br/>
Faster, easier to use, no worrying about the maxRequestLength parameter in config files and very easy to integrate. |
Another full blown IDE is SharpDevelop. It's OpenSource.
[http://www.icsharpcode.net/OpenSource/SD/][1]
[1]: http://www.icsharpcode.net/OpenSource/SD/ |
I'd suggest, to delete (outside subversionso with rm or similar), the directory above test, and then running svn update there.
That is, if you don't want to get a whole new working copy as others have suggested, which might be the safest approach. |
There are a couple of things to consider:
- Copy.CopyIntoItems needs the document to be already present at some server
- the 'http put' method (ie webdav...) will only put the document in the library, but not set field values
- to update field values you can call Lists.UpdateListItem after the 'http put'
... |
Read [Globalization Step-by-Step][1] by Microsoft.
I can answer the specifics on CJKV, but you probably want a book on this topic. I haven't read it but CJKV Information Processing is from O'Reilly (2nd ed due Dec, 2008).
> I understand that these use phonetic input converted to written characters.
> How does that... |
Ok, so in this application, there is an iframe in which the user is supplied with links or some capacity that allows that iframe to browse to some external site. You are then looking to capture the URL to which the user has browsed.
Something to keep in mind. Since the URL is to an external source, you will be lim... |
DIV's vs Tables or CSS vs. Being Stupid |
|css|layout| |
I know that tables are for tabular data, but it's so tempting to use them for layout ... i can handle DIV's to get a three column layout, but when you got 4 nested DIV's, it get tricky.
Is there a tutorial/reference out there to persuade me to use DIV's for layout?
I want to use DIV's, but i refuse to spend an h... |
DIV's vs Tables or CSS vs. Being Stupid [CSS's best kept secret revealed] |
I know that tables are for tabular data, but it's so tempting to use them for layout ... i can handle DIV's to get a three column layout, but when you got 4 nested DIV's, it get tricky.
Is there a tutorial/reference out there to persuade me to use DIV's for layout?
I want to use DIV's, but i refuse to spend an h... |
I know that tables are for tabular data, but it's so tempting to use them for layout ... i can handle DIV's to get a three column layout, but when you got 4 nested DIV's, it get tricky.
Is there a tutorial/reference out there to persuade me to use DIV's for layout?
I want to use DIV's, but i refuse to spend an h... |
DIV's vs Tables or CSS vs. Being Stupid |
I know that tables are for tabular data, but it's so tempting to use them for layout ... i can handle DIV's to get a three column layout, but when you got 4 nested DIV's, it get tricky.
Is there a tutorial/reference out there to persuade me to use DIV's for layout?
I want to use DIV's, but i refuse to spend an h... |
The danger in using a backslash to end a line is that if whitespace is added after the backslash (which, of course, is very hard to see), the backslash is no longer doing what you thought it was.
See [Python Idioms and Anti-Idioms](http://docs.python.org/dev/howto/doanddont.html#using-backslash-to-continue-statement... |
Not really seen this problem, although we do get intermittent Lazy Load errors - so perhaps we have the same problem, anyway, is it an option to use a different session for the loading of the Bar object - that should load it from scratch, I would expect... |
The periodic table example loads the printer-friendly version of the wiki artice into an iframe. http://en.wikipedia.org/wiki/Potasium?<b>printable=yes</b> |
The periodic table example loads the printer-friendly version of the wiki artice into an iframe. http://en.wikipedia.org/wiki/Potasium?<b>printable=yes</b>
it's done in <i>function click_wiki(e)</i> (line 534, interactivity.js)
<blockquote><pre>
var article = el.childNodes[0].childNodes[n_name].innerHTML;
...
wi... |
Nice.
> This suggests to me that maybe the key
> is tied to the user's current token.
That was it. Turns out I was using encrypted data from another machine (the XP one). Once I re-encrypted the data on the Vista machine, decryption works as expected.
Thanks. |
Nice. Hopefully this is my bone-head move of the week! ;-)
> This suggests to me that maybe the key
> is tied to the user's current token.
That was it. Turns out I was using encrypted data from another machine (the XP one). Once I re-encrypted the data on the Vista machine, decryption works as expected. So, noth... |
Nice. Hopefully this is my bone-head move of the week! ;-)
> This suggests to me that maybe the key
> is tied to the user's current token.
That was it. Turns out I was using encrypted data from another machine (the XP one) and trying to decrypt on the Vista machine.
As the MSDN documentation states:
> Usua... |
MPI was deisgned tightly-coupled compute clusters with fast, reliable networks. Spread and ØMQ are designed for large distributed systems. If you're designing a parallel scientific application, go with MPI, but if you are designing a persistent distributed system that needs to be resilient to faults and network insta... |
I used to. But now I find that CMM and CMMI don't really fit that well with agile approaches.
Oh sure you can squeeze things to get that square peg into the round hole, but when push comes to shove, you are still basing your approach on an ability to predict everything that is needed, and anticipating everything tha... |
If you do not want to use non-standard extensions, you've to provide extra brackets:
#define DBGPRINT(args) printf(args);
DBGPRINT(("%s\n", "Hello World")); |
P.S. Though a bit off-topic, I would like to mention that faked CMMI certifications are very common as well as real certifications obtained through bribery. |
Similar to a trigger (or even with) you can have every transaction fire a logging event asynchronously and have another process (or just thread) actually handle the logging. There would be many ways to implement this depending upon your application. I suggest having the application fire the event so that it does not ca... |
For disk space, if you have Java 6, you can use the [getTotalSpace][1] and [getFreeSpace][2] methods on File. If you're not on Java 6, I believe you can use [Apache Commons IO][3] to get some of the way there.
I don't know of any cross platform way to get CPU usage or Memory usage I'm afraid.
[1]: http://java... |
I use Perforce as well for my own personal stuff, mainly because we use it at work. There are emacs bindings for it as well, so you can sync, check stuff in or out, etc. all from within emacs. |
I think the best thing that you can do here is to subclass ListView and provide the events that you want. |
@Joel, I have to disagree.
select a,b,c
from Foo
where name like <cfqueryparam cfsqltype="columnType" value="%#variables.someName#%" />
1) Never suggest to someone that they should "select star." Bad form! Even for an example! (Even copied from the question!)
2) The query is pre-compiled and you ... |
Which Version of Python to Use for Maximum Compatibility |
|python|compatibility| |
If I was going to start an open source project using Python what version should I use to ensure that the vast majority of users can use it on their system?
I'm the kind of person who quickly jumps to the next version (which I'll do when Python 3 comes out) but many people may be more conservative if their current ve... |
@Domenic
Not too sure, Never quite got that far in the thought process.
Another solution might be to extend ListView, and when adding and removing stuff, instead of calling .items.add, and items.remove, you call your other functions. It would still be possible to add and remove without events being raised, but ... |
The computer term for what you're doing is [lexical analysis][1]; read that for a good summary of this common task.
Based on your example, I'm guessing that you want whitespace to separate your words, but stuff in quotation marks should be treated as a "word" without the quotes.
The simplest way to do this is to ... |
The computer term for what you're doing is [lexical analysis][1]; read that for a good summary of this common task.
Based on your example, I'm guessing that you want whitespace to separate your words, but stuff in quotation marks should be treated as a "word" without the quotes.
The simplest way to do this is to ... |
I prefer keeping the most common or simple implementations of the interface in a sub-folder (and namespace) following the name of the interface.
<pre>
\project\
\project\IAppender.cs
\project\Appender\
\project\Appender\FileAppender.cs
\project\Appender\ConsoleAppender.cs
</pre>
If I extend this class outsi... |
Saw a post regarding this for Java a while back, check out http://www.javaspecialists.eu/archive/Issue161.html . |
SMTP Mail Timeout Issue |
|smtp|email|.net|asp.net| |
You can do anything, especially since you have no constraints re language, environment, etc. |
Mc and Mac are common surname prefixes throughout the US, and there are others. TextInfo.ToTitleCase doesn't handle those cases and shouldn't be used for this purpose. Here's how I'm doing it:
public static string ToTitleCase(string str)
{
string result = str;
if (!string.I... |
from sys import exit
exit()
As a parameter you can pass an exit code, which will be returned to OS. Default is 0. |
Imagemaps I guess.
No seperate file describes the map, it is all part of the html document.
http://www.w3schools.com/TAGS/tag_map.asp |
There isn't an interactive console for Perl built in like Python does. You can however use the Perl Debugger to do debugging related things. You turn it on with the -d option, but you might want to check out 'man perldebug' to learn about it.
After a bit of googling, there is a separate project that implements a... |
In HTML, you could do:
<input type="button" src="/path/to/image.png" />
Alternately, assigning an onclick event to an image causes that image to work similarly to a button:
<img src="/path/to/image.png" onclick="function(){doSomething();}" /> |
string s = "/blah/blah";
s.TrimStart('/');
|
string s = ",liger, unicorn, snipe";
s.TrimStart(',');
|
You can use the perl debugger on a trivial program, like so:
perl -d -e 1
Alternatively there's software to be more of a console, but I haven't used it: http://www.sukria.net/perlconsole.html |
Like James (hopkin), for me, the hybrid approach is the best solution. Python and C++ is a good choice, but other style like C#/C++ works. All depends of your graphical context. For game, XNA is a good platform (limited to win32), in this case C#/C++ is the best solution. For scientific visualization, Python/C++ is acc... |
I doubt that there is a solution that will fit your needs exactly. The only option I see is to write your own recursive search that builds a report for you or use one of the apps/scripts that people have listed above. Basically, you are going to have to edit each page or approve all of the automated changes. |
If you are running a linux system you can set a [Cron Job][1] or you can use the windows task scheduler if you are on windows
[1]: http://www.sitepoint.com/article/introducing-cron/ |
The problem with using JNI is the overhead involved in making the call to JNI. The Java virtual machine is pretty optimized these days, and calls to the built-in Math.exp() are automatically optimized to call straight through to the C exp() function, and they might even be optimized into straight x87 floating-point as... |
If you just want the IP that's bound to the adapter, you can use WMI and the Win32_NetworkAdapterConfiguration class.
http://msdn.microsoft.com/en-us/library/aa394217(VS.85).aspx |
Maybe I don't understand the question.<br />
If you just want to change the image write a batch file/cron job and have it run every day.<br />
If you want to display a certain image on Monday, and a different one of Tuesday then do something like this:
<br />
<?php
switch(date('w'))
{
case '... |
I'd do it on first access after midnight. |
Do not use CVS!! If you want the CVS model, Subversion is a much better alternative. |
Sounds to me like what you really want is some sort of "meta-schema", a database schema which is capable of describing a flexible schema for storing the actual data. Dynamic schema changes are touchy and not something you want to mess with, especially not if users are allowed to make the change.
You're not going to... |
The real question is, has this become a bottle neck for you? Have you profiled your application and found this to be a major cause of slow down?<br><br> If not, I would recommend using Java's version. Try not to pre-optimize as this will just cause development slow down. You may spend an extended amount of time on a pr... |
Maybe a PXE boot scenario could help you? Simply boot on your crafted PXE image which modify the hardware registers you need to modify, and then return the control to the Master Boot Record or to the active partition's boot record.
This way you don't have to modify the boot records. |
I've not seen a system with less than 2.3 installed for some time. Mostly 2.4+ is installed by default for most OS I use now. 2.3 is just on an older Solaris machine. Linux distros tend to have 2.4+, as does OS X.
IIRC, 2.4 has a lot of the features 2.5 does, but usable only with
from __ future __ import *... |
What I found by Googling. This supposedly gets you CPU and RAM.
import java.lang.management.ManagementFactory;
import java.lang.management.OperatingSystemMXBean;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
private static void printUsage() {
OperatingSystem... |
What I found by Googling. This supposedly gets you CPU and RAM.
See [ManagementFactory][1] for more details.
import java.lang.management.ManagementFactory;
import java.lang.management.OperatingSystemMXBean;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
private sta... |
Once you put it in the blob, it's going to be difficult to be used for normal SQL comparison. See [Using Large-Value Data Types][1].
[1]: http://msdn.microsoft.com/en-us/library/ms178158.aspx |
Changing the order itself will require you store some sort of ordering along with each page in the database. Just the current highest / lowest value +/- 1 would probably be a fine starting point. Once you've got that ordering in there, reordering becomes a case of swapping two values or changing the value for one page ... |
You can retrieve a managed bean inside of a tag library using something like this:
FacesContext context = FacesContext.getCurrentInstance();
Object myBean = context.getELContext().getELResolver().getValue(context.getELContext(), null, "myBeanName"); |
You can retrieve a managed bean inside of a tag library using something like this:
FacesContext context = FacesContext.getCurrentInstance();
Object myBean = context.getELContext().getELResolver().getValue(context.getELContext(), null, "myBeanName");
However, you'd need to use the tag library from one of ... |
Does the value objects state identify that particular instance? If not you could just pass back the old value and the new value when the edit form is submitted, then update any objects with the old state to the new state.
I would rather have a page like Contact/C0001/ThelephoneNumber, and use both the contact id ... |
I've heard good things about SpiDynamics WebInspect as far as paid solutions go, as well as Nikto (for a free solution) and other open source tools. Nessus is an excellent tool for infrastructure in case you need to check that layer as well. You can pick up a live cd with several tools on it called Nubuntu (Auditor, He... |
@Sam: yeah, I was trying the same:
// ==UserScript==
// @name Stack Overflow highlight viewed questions
// @namespace *
// @include http://stackoverflow.com/questions
// @include http://stackoverflow.com/questions?*
// @include http://stackoverflow.com/questions
// @i... |
As a Gentoo user I have tried quite a few optimizations on the complete OS and there have been endless discussions on the [Gentoo forums][1] about it. Some good flags for GCC can be found in the [wiki][2].
In short, optimizing for size worked best on an old Pentium3 laptop with limited ram, but on my main desktop ma... |
As a Gentoo user I have tried quite a few optimizations on the complete OS and there have been endless discussions on the [Gentoo forums][1] about it. Some good flags for GCC can be found in the [wiki][2].
In short, optimizing for size worked best on an old Pentium3 laptop with limited ram, but on my main desktop ma... |
Build both, profile, choose which works better on specific project and hardware.
For performance critical code, that is - otherwise choose any and don't bother. |
One thing you can do is change the stack size (if you really want the array on the stack) with VC the flag to do this is [/F](http://msdn.microsoft.com/en-us/library/tdkhxaks(VS.80\).aspx).
But the solution you probably want is to put the memory in the heap rather than on the stack, for that you should use a `vecto... |
If you set the `border-collapse` property to `collapse`, IE7 will show empty cells. It also collapses the borders though so this might not be 100% what you want
Example:
td {
border: 1px solid red;
}
table {
border-collapse: collapse;
}
|
How many rows should be in the (main) buffer of a virtual Listview control? (win32, 'c') |
|winapi|c| |
How many rows should be in the (main) buffer of a virtual Listview control?
I am witting an application in pure 'c' to the Win32 API. There is an ODBC connection to a database which will retrieve the items (actually rows).
The sample code implies a fixed size buffer of 30.
My thinking is that the buffer s... |
How many rows should be in the (main) buffer of a virtual Listview control? |
|c|winapi| |
How many rows should be in the (main) buffer of a virtual Listview control?
I am witting an application in pure 'c' to the Win32 API. There is an ODBC connection to a database which will retrieve the items (actually rows).
The MSDN sample code implies a fixed size buffer of 30 for the end cache (Which would al... |
Is there a good Fogbugz client for Mac OS X? |
|macos|fogbugz| |
And/or: do I need one?
I've recently started using FogBugz for my hobby projects, and I'm very happy with things so far. Having read more about it, especially the evidence-based scheduling, I'd like to start using it for my PhD as well. (Heh; something tells me my supervisors won't be opening tickets for me, though.... |