instruction stringlengths 0 30k ⌀ |
|---|
I agree with jmatthias: use the MFC source code.
There's also [this page](http://msdn.microsoft.com/en-us/library/32wxt301%28VS.71%29.aspx) on MSDN that may be useful. |
I have been using GPGPU for motion detection (Originally using CG and now CUDA) and stabilization (using CUDA) with image processing.
I've been getting about a 10-20X speedup in these situations.
From what I've read, this is fairly typical for data-parallel algorithms. |
Is it because you are doing **return** confirm? seems like the return statement should prevent the rest of the code from firing. i would think an if statement would work
if (!confirm(...)) { return false; } _doPostBack(...);
Can you post all the js code in the OnClick of the link? |
Is it because you are doing **return** confirm? seems like the return statement should prevent the rest of the code from firing. i would think an if statement would work
if (!confirm(...)) { return false; } _doPostBack(...);
Can you post all the js code in the OnClick of the link?
**EDIT**: aha, forgot tha... |
|sql|stackoverflow| |
Feel free to edit the title if you know how to formulate the question better. (Tagging is a problem as well.) The problem may be too difficult in this general form, so let us consider a concrete example.
You get a screenful of stackoverflow questions by requesting `/questions ?sort=newest` page. Next page link leads... |
|sql|paging| |
Useful browser plugins for openid authentication? |
|stackoverflow|firefox|openid| |
I've read <http://stackoverflow.com/questions/41354/is-the-stackoverflow-login-situation-bearable> and must agree to a certain point that openid (for me) makes it more difficult to log in. Not a show stoper but I'm used to opening the front page of the site, there's a small login form, firefox' password manager already... |
I've read <http://stackoverflow.com/questions/41354/is-the-stackoverflow-login-situation-bearable> and must agree to a certain point that openid (for me) makes it more difficult to log in. Not a show stoper but I'm used to opening the front page of the site, there's a small login form, firefox' password manager already... |
I do asp.net development on a MacBook Pro, running VMWare Fusion and Vista x64. It works great for me.
As someone else mentioned, the keybindings are a little weird. I usually use a full size external keyboard, which helps a lot. |
I agree.. there are subtle differences between the two operating systems. Part of this is just font sizes and how line height and letter spacing is determined. So much of page flow is based on these whitespace elements interact with other page elements. |
Impose a total ordering on all instances of *any* class in Java |
|java|algorithm| |
I'm unsure whether the following code would ensure all conditions given in Comparator's Javadoc.
class TotalOrder<T> implements Comparator<T> {
public boolean compare(T o1, T o2) {
if (o1 == o2 || equal(o1, o2)) return 0;
int h1 = System.identityHashCod... |
Free Network Monitor |
|windows|sockets|network-monitoring| |
I am having trouble integrating two products, one of which is mine and they appear not to be talking. So I want to make sure they are communicating correctly. I had a look around for network monitor and found TCP Spy. This works but only shows 1 side of the conversation at a time (it has to run locally) I would ideally... |
I used to do exactly the same thing.... then I switched to [maven][1]. Maven relies on a simple xml file to configure your build and a simple repository to manage your build's dependencies (rather than checking these dependencies into your source control system with your code).
One feature I really like is how ea... |
Konrad said:
> As a consequence, a purely functional program always yields the same value for an input,
> and the order of evaluation is not well-defined; which means that uncertain values like
> user input or random values are hard to model in purely functional languages.
The order of evaluation in ... |
No one gives that up for free (any country in the world? Get real). The best source is Copp Clark (I'm unaffiliated). They provide all holidays for all countries broken down by financial market, currency, etc. |
JUnit stopped having graphical runners following the release of JUnit 4.
If you do have an earlier version of JUnit you can use a graphical test runner by entering on the command line[1]:
<pre>
java junit.swingui.TestRunner [optional TestClass]
</pre>
With the optional test class the specified tests will run s... |
C in the house. (not sure if you didn't want a C example here)
<pre><code>
bool Is_Palindrome(char *s)
{
int i,d;
int length = strlen(s);
char cf, cb;
for(i=0, d=length-1 ; i < length && d >= 0 ; i++ , d--)
{
while(cf= toupper(s[i]), (cf < 'A' || cf >'Z') && i < length-1)i++;
while(cb= toupper(... |
C in the house. (not sure if you didn't want a C example here)
bool IsPalindrome(char *s)
{
int i,d;
int length = strlen(s);
char cf, cb;
for(i=0, d=length-1 ; i < length && d >= 0 ; i++ , d--)
{
while(cf= toupper(s[i]), (cf < 'A' || cf >'Z') && i < length-1)i++;
... |
C in the house. (not sure if you didn't want a C example here)
bool IsPalindrome(char *s)
{
int i,d;
int length = strlen(s);
char cf, cb;
for(i=0, d=length-1 ; i < length && d >= 0 ; i++ , d--)
{
while(cf= toupper(s[i]), (cf < 'A' || cf >'Z') && i < length-1)i++;
... |
I would agree with @Martin and @Pilif's answer, but add;
Consider allowing your end-users to decide if they want to actually install the update there and then, or delay the installation of the update until they've finished using the program.
I don't know the purpose/function of your app but many applications are... |
This is quick and probably not that accurate, but if you calculate the PDF yourself, then at least you make it easier to lay several smaller/larger ones on a single timeline. `dev` is the std deviation in the Guassian noise, which controls the roughness. Note that this is *not* the 'right' way to generate what you want... |
@Graeme: You're right on that, too. I think the "C" compiler that the OP is using is not enforcing C99 standard, but compiling as C++, thus mangling the names. A true C compiler wouldn't understand the "C" part of the `extern "C"` keyword. |
See [Stoustrup's own words on the subject][1].
Basically a small class, that you instantiate somewhere, e.g. the templated classes constructor.
template<class T, class B> struct Derived_from {
static void constraints(T* p) { B* pb = p; }
Derived_from() { void(*p)(T*) = constraints; }
};
[1]: h... |
|firefox|openid| |
Real life examples of metodologys and lifecycles. |
|methodology|lyfe-cycle| |
Choosing the correct lifecycle and methodology isn't as easy as it was before (when there weren't so many methodologies, this days a new one emerges every day).
I've found that most projects require a certain level of evolution and that each project is different from the rest. That way, extreme programming works wit... |
|methodology|life-cycle| |
Real life examples of methodologies and lifecycles. |
Choosing the correct lifecycle and methodology isn't as easy as it was before (when there weren't so many methodologies, this days a new one emerges every day).
I've found that most projects require a certain level of evolution and that each project is different from the rest. That way, extreme programming works wit... |
Best way to implement request throttling in ASP.NET/IIS7 |
|asp.net|iis7|throttling| |
We're experimenting with various ways to throttle user actions.
For example, to limit how a question's view count is incremented, we're actually using the Cache:
if (HttpContext.Cache[key] == null)
{
log.Info(string.Concat("DoPostViewIncrement is adding '", key, "' to the Cache - total items: ... |
C in the house. (not sure if you didn't want a C example here)
bool IsPalindrome(char *s)
{
int i,d;
int length = strlen(s);
char cf, cb;
for(i=0, d=length-1 ; i < length && d >= 0 ; i++ , d--)
{
while(cf= toupper(s[i]), (cf < 'A' || cf >'Z') && i < length-1)i++;
... |
I would suggest that you can get free components at sites like [codeproject][1], but you are going to end up sinking a ton of time separating the wheat from the chaff and figuring out how to use them, and since they are not a unified library the APIs and integration will be a new learning curve for each different contr... |
Using stored procedures for CRUD operations is probably overkill, but it will depend on the tools be used and your own preferences (or requirements). I prefer inline SQL, but I make sure to use parameterized queries to prevent SQL injection attacks. I keep a print out of this [xkcd comic][1] as a reminder of what can... |
There are tools that also 'deobfuscate' obfuscated DLLs - I'd suggest turning the piece that needs to be protected into an unmanaged component. |
I recommend you read up here: http://msdn.microsoft.com/en-us/practices/default.aspx
Using a DAL will help you isolate your data access from your presentation and business logic. I use it a lot so that I can easily swap out (through reflection and dynamically loading assemblies) data providers.
Read up, lots of go... |
Yes, they are faster most of time. SQL composition is a huge performance tuning area too. If I am doing a back office type app I may skip them but anything production facing I use them for sure for all the reasons others spoke too...namely security. |
A data access layer follows the idea of "separation of concerns" whereby all of the logic required for your business logic to interact with your data layer (database) is isolated to a single set of classes (layer). This allows you to more easily change the backend physical data storage technology (move from XML files t... |
Or, if you don't want the designer adding any code at all... add this to the Property.
[System.ComponentModel.DesignerSerializationVisibilityAttribute.Hidden] |
Or, if you don't want the designer adding any code at all... add this to the Property.
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] |
You could check out a rev.7450 copy somewhere, then export your 7500 copy (to remove the .svn folders). Drag the exported copy (which is the latest copy) over the 7450 copy. All the new files should simply overwrite the older ones, leaving the .svn folders the same.
Subversion will assume you just made a bunch of c... |
In **The Pragmatic Programmer** Hunt and Thomas talk about a study they term the Law of Demeter and it focuses on the coupling of functions to modules other than there own. By allowing a function to never reach a 3rd level in it's coupling you significantly reduce the nuber of errors and increase the maintainability o... |
In **The Pragmatic Programmer** Hunt and Thomas talk about a study they term the Law of Demeter and it focuses on the coupling of functions to modules other than there own. By allowing a function to never reach a 3rd level in it's coupling you significantly reduce the nuber of errors and increase the maintainability o... |
Recovering from a slightly out of date subversion repository backup |
|svn|version-control|system-administration| |
A problem I ran into a while back I never found a good solution for...
Say you have a working copy checked out from subversion at revision 7500, and the disk holding the current repository dies. You've got a backup of the repository at, say, revision 7450. It's easy to restore the repository backup, but any attempt ... |
We're experimenting with various ways to throttle user actions in a **given time period**:
- Limit question/answer posts
- Limit edits
- Limit feed retrievals
For example, to limit how a question's view count is incremented, we're actually using the Cache:
if (HttpContext.Cache[key] == null)
{
... |
We're experimenting with various ways to throttle user actions in a **given time period**:
- Limit question/answer posts
- Limit edits
- Limit feed retrievals
For the time being, we're using the Cache to simply insert a record of user activity - if that record exists if/when the user does the same activity, we ... |
I'm not sure what is the best method. I used OPENXML construction:
INSERT INTO Test
SELECT Id, Data
FROM OPENXML (@XmlDocument, '/Root/blah',2)
WITH (Id int '@ID',
Data varchar(10) '@DATA')
To speed it up, you can create XML indecies. You can set index specifically for **v... |
I'm not sure what is the best method. I used OPENXML construction:
INSERT INTO Test
SELECT Id, Data
FROM OPENXML (@XmlDocument, '/Root/blah',2)
WITH (Id int '@ID',
Data varchar(10) '@DATA')
To speed it up, you can create XML indices. You can set index specifically for **va... |
This may be unhelpful but I somehow don't understand all these problems related to CSS. If a newspaper designer would try to embed a movie in the ad page, everybody would agree that he's a bit crazy. But still those same people pine after three-column layouts in HTML. HTML is just not apt to handle this kind of layout ... |
This may be unhelpful but I somehow don't understand all these problems related to CSS. If a newspaper designer would try to embed a movie in the ad page, everybody would agree that he's a bit crazy. But still those same people pine after three-column layouts in HTML. HTML is just not apt to handle this kind of layout ... |
ASP Server variable not working on local IIS |
|asp.net|iis|server-variables| |
I'm working on a simple ASP.Net page (handler, actually) where I check the value of the LOGON_USER server variable. This works using Visual Studio's built-in web server and it works in other sites deployed to the live intranet site. But it doesn't work on the IIS instance on my local XP machine. How can I fix it, or... |
The DAL should abstract your database from the rest of your project -- basically, there should be no SQL in any code other than the DAL, and only the DAL should know the structure of the database.
The purpose is mainly to insulate the rest of your app from database changes, and to make it easier to extend and suppor... |
Sphinx is mainly a tool for formatting docs written independently from the source code, as I understand it.
For generating API docs from Python docstrings, the leading tools are [Epydoc](http://epydoc.sf.net) and [pydoctor](http://codespeak.net/~mwh/pydoctor/). Here's pydoctor's generated API docs for [Twisted](http... |
In two words: [Loose Coupling][1]
To keep the code you use to pull data from your data store (database, flat files, web services, whatever) separate from business logic and presentation code. This way, if you have to change data stores, you don't end up rewriting the whole thing.
These days, various ORM framework... |
The purpose is to abstract out the database access details that other parts of your application need not be concerned about. |
WPF - Programmatic Binding on a BitmapEffect |
|wpf|data-binding|bitmapeffect| |
I would like to be able to **programmatically** bind some data to the dependency properties on a **BitmapEffect**. With a FrameworkElement like TextBlock there is a SetBinding method where you can programmatically do these bindings like:
myTextBlock.SetBinding(TextBlock.TextProperty, new Binding("SomeProperty"))... |
As a side note: If your intranet users also have access to the internet, you can use [slideshare][1] widget to embed your PowerPoint presentations in your website
(Remember to mark your presentation as private!)
[1]: http://www.slideshare.com |
I didn't actually understand your question completely but I store my connection settings in a configuration files usually one for each environment like dev, production etc. The packages read the connection settings from the config files when they are run. |
Using the [DirectX SDK][1], you can call [DirectSoundCaptureEnumerate][2], which will call your [DSEnumCallback][3] function for each DirectSoundCapture device on the system. The first parameter passed to your DSEnumCallback is an LPGUID, which is the "Address of the GUID that identifies the device being enumerated, o... |
Using the [DirectX SDK](http://www.microsoft.com/downloads/details.aspx?FamilyID=ea4894b5-e98d-44f6-842d-e32147237638&DisplayLang=en), you can call [DirectSoundCaptureEnumerate](http://msdn.microsoft.com/en-us/library/bb219778(VS.85).aspx), which will call your [DSEnumCallback](http://msdn.microsoft.com/en-us/library/b... |
Using the [DirectX SDK](http://www.microsoft.com/downloads/details.aspx?FamilyID=ea4894b5-e98d-44f6-842d-e32147237638&DisplayLang=en), you can call DirectSoundCaptureEnumerate, which will call your DSEnumCallback function for each DirectSoundCapture device on the system. The first parameter passed to your DSEnumCallba... |
c++ Having multiple graphics options |
|c++|graphics| |
Currently my app uses just Direct3D9 for graphics, however in the future I' m planning to extend this to D3D10 and possibly OpenGL. The question is how can I do this in a tidy way?
At present there are various Render methods in my code
void Render(boost::function<void()> &Call)
{
D3dDevice->Begi... |
|c++|graphics|opengl| |
|c++|graphics|opengl|direct3d| |
How to be notified of file/directory change in C/C++, ideally using POSIX |
|c++|c|posix| |
The subject says it all - normally easy and cross platform way is to poll, intelligently. But every OS has some means to notify without polling. Is it possible in a reasonably cross platform way? (I only really care about Windows and Linux, but I use mac, so I thought posix may help?) |
Ok, I found some free time finally.
Here we go:
class TreeNode
{
public string Value { get; set;}
public List<TreeNode> Nodes { get; set;}
public TreeNode()
{
Nodes = new List<TreeNode>();
}
}
Action<TreeNode> traverse = null;
... |
I don't think POSIX itself has facilities for that. The closest to cross-platform I've seen is [FAM](http://oss.sgi.com/projects/fam/), which seems to work for Linux, BSD, and Irix, but I'm not how easy it would be to port it to Windows and MacOS. |
I would add one more to what edg says up there. You need people with at last some talent as well.
As David Wheeler, author of the [Flawfinder][1] source code checker says:
> A fool with a tool is still a fool
[1]: http://www.dwheeler.com/flawfinder/ |
|svn|version-control|backup|system-administration| |
It boils down to whether the CPU in your machine has the the VT bit (Virtualization) and the BIOS enables you to turn it on. For instance, my laptop is a Core 2 Duo which is capable of using this. However, my BIOS doesn't enable me to turn it on.
Note that I've read that turning on this feature can slow normal operati... |
you must link against the lib generated after compiling the DLL. In the linker options of the project, you must add the .lib file. |
you must link against the lib generated after compiling the DLL. In the linker options of the project, you must add the .lib file.
And yes, you should also declare the variable as:
extern "C" { declspec(dllimport) char MyNewVariable; }
|
System.Boolean -> valid values : true, false
bool -> alias for System.Boolean
Nullable<bool> -> valid values : true, false, null
bool? -> alias for Nullable<bool>
Hope this helps. |
No there is no difference. In summary:
System.Boolean -> valid values : true, false
bool -> alias for System.Boolean
Nullable<bool> -> valid values : true, false, null
bool? -> alias for Nullable<bool>
Hope this helps. |
What is the best way to convert between char* and System::String in C++/CLI |
|.net|c++|string|c++-cli| |
What is the approved way to convert from char* to System::string and back in C++/CLI? I found a few references to marshal_to<> templated functions on Google, but it appears that this feature never made the cut for Visual Studio 2005 (and isn't in Visual Studio 2008 either, AFAIK). I have also seen some code on [Stan Li... |
You do not specifically say whether it is supposed to be a GUI application or not. From the other answers, I would guess so.
Therefore, you need to clarify what your goals are. RoR is a specialized framework for web applications. If your goal is to learn RoR, I'd say to get yourself some inexpensive web hosting an... |
What is the proper regular expression for an unescaped backslash before a character? |
|regex| |
You could always consider compiling your Ruby to JVM byte-code (via [JRuby][1]) or .NET byte-code (via [IronRuby][2]) to distribute to people who have those virtual machines and don't want to install a Ruby runtime.
You might want to check out [Shoes][3] for building desktop applications in Ruby. Rails really is tu... |