instruction stringlengths 0 30k ⌀ |
|---|
If you're using VB.NET, you can tap into the very convenient ApplicationEvents.vb. This file comes for free with a VB.NET WinForms project and contains a method for handling [unhandled exceptions][1].
To get to this nifty file, it's "Project Properties >> Application >> Application Events"
If you're not using VB... |
Some object suppose the .dispose() method which forces the resource to be removed from memory. |
Clipboard manager.
http://www.csharper.net/blog/web_deployer_2005_version_1_0_0_2_available.aspx#new_clipboard_manager_upgrade_1_0_0_4.aspx
Maintains your clipboard data through removal of lines, a few other nice items but that one alone makes me happy.
Regionerate
http://www.rauchy.net/regionerate/
While s... |
[Clipboard Manager][1]
Maintains your clipboard data through removal of lines, a few other nice items but that one alone makes me happy.
[Regionerate][2]
While some have problems with regions I think if you use them, this tool is for you. Automatically region'izes your code into appropriate region blocks. Full... |
[PowerCommands][1] is a Microsoft-created plugin that offers a variety of new features that one would think probably should have been in Visual Studio in the first place.
These include
* Copying/Pasting project references!
* "Open Containing Folder" to jump straight to the hard-drive location of a file or projec... |
I'd go for:
1. Closures
2. Duck typing
3. Builders (XML builder and slurper)
4. GStrings
5. Grails
|
How is the best way to setup an integration testing server? |
|integration-testing|continuous-integration| |
Setting up an integration server, I’m in doubts about the best approach regarding multiple tasks to complete the build. Is the best way set all in just one big-job or make small dependents ones?
|
What is the best way to setup an integration testing server? |
|continuous-integration|integration-testing| |
Setting up an integration server, I’m in doubt about the best approach regarding using multiple tasks to complete the build. Is the best way to set all in just one big-job or make small dependent ones?
|
Is there a wxWidgets framework for C? |
|c|user-interface| |
My understanding is that [wxWidgets][1] is for a number of programming languages (C++, Python, Perl, and C#/.NET) but that does not include C. Is there a similar framework for the C programming language, or is this not something that C is used for?
[1]: http://www.wxwidgets.org |
|c|user-interface| |
GUI toolkit for rapid development? |
|user-interface| |
I want to write the front end to the application written in c/c++.
I use solaris 10 and plan to port app to other architectures also(Windows first). |
|user-interface|unix|solaris| |
I want to write a front-end to an application written in C/C++.
I use Solaris 10 and plan to port the application to some other architectures (Windows first). |
|user-interface|unix|solaris| |
IMO, this is the cleanest answer:
<html>
<head><title>title</title></head>
<body>
<form action="" method="get">
Name: <input type="text" name="name"/><br/>
Pwd: <input type="password" name="password"/><br/>
<div class="yourCustomDiv"/>
<input type="submit" style="dis... |
How do I download a file over HTTP using Python? |
|python|podcast|podcasting| |
I have a small utility that I use to download an MP3 from a website on a schedule and then builds/updates a podcast XML file which I've obviously added to iTunes.
The text processing that creates/updates the XML file is written in Python. I use wget inside a Windows .bat file to download the actual MP3 however. I ... |
Finding the storage card path on WM6. |
|windows-mobile| |
Is there an easy way to find the storage card's path on a Windows Mobile device
when there is a storage card and a bluetooth ftp connection? |
Check out this blog post on [kirupa][1].
![alt text][2]
[1]: http://www.kirupa.com/blend_wpf/custom_wpf_windows.htm
[2]: http://www.kirupa.com/blend_wpf/images/cwImage.png |
What's the best way to use SOAP with Ruby? |
|ruby|ruby-on-rails|soap| |
A client of mine has asked me to integrate a 3rd party API into their Rails app. The only problem is that the API uses SOAP. Ruby has basically dropped SOAP in favor of REST. They provide a Java adapter that apparently works with the Java-Ruby bridge, but we'd like to keep it all in Ruby, if possible. I looked into... |
In my experience, the "elegance" of an app typically has more to do with the database design than anything. If you have a _great_ database design, including a well-defined stored procedure interface, good application code tends to follow no matter what platform you use. If you have _poor_ database design, no matter w... |
The backend will be SQL Server 2005
Frontend / Application Logic will be .Net
Besides GUIDs, can you think of other ways to resolve the "merge" that happens when the offline computer syncs the new data back into the central database?
I mean, if the keys are INTs, i'll have to renumber everything when importing... |
Unless it's more than 1 argument, I always use arrays or objects as constructor parameters and rely on error checking to make sure the required parameters are there. |
Two approaches have worked well for me.
One is the "working prototype" which you sort of described in your question. In my experience, the company contracted a user interface expert to create fully functional HTML mocks. The data on the page was static, but it allowed for developers and management to see and play ... |
When shifting left, there is no difference between arithmetic and logical shift. When shifting right, the type of shift depends on the type of the value being shifted.
(As background for those readers unfamiliar with the difference, a "logical" right shift by 1 bit shifts all the bits to the right and fills in the l... |
Exactly what [Biri][1] said. Here is how I would reindex an entire database:
EXEC [sp_MSforeachtable] @command1="RAISERROR('DBCC DBREINDEX(''?'') ...',10,1) WITH NOWAIT DBCC DBREINDEX('?')"
[1]: http://stackoverflow.com/questions/7579/reorganise-index-vs-rebuild-index-in-sql-server-maintenance-plan?sort=V... |
According to [K&R Second edition (the bible)][1] the results are implementation-defined for right-shifts of signed values.
[Wikipedia][2] says that C/C++ 'usually' implements an arithmetic shift on signed values.
Basically you need to either test your compiler or not rely on it. My VS2008 help for the current MS ... |
Well, I looked [it up on wikipedia][1], and they have this to say:
> C, however, has only one right shift
> operator, >>. Many C compilers choose
> which right shift to perform depending
> on what type of integer is being
> shifted; often signed integers are
> shifted using the arithmetic shift,
> and unsigned... |
You more or less only have two alternatives when sending mail via the browser..<br /><br />
Nr 1 is to make a page that takes user input, and allows them to send the mail via your web-server. You need some kind of server-side scripting for this. <br />
Nr 2 is to use a mailto: link to trigger opening of the users reg... |
You more or less only have two alternatives when sending mail via the browser..
1. make a page that takes user input, and allows them to send the mail via your web-server. You need some kind of server-side scripting for this.
2. use a mailto: link to trigger opening of the users registered mail client. This has the... |
The easiest way is to look through the logs, but if that doesn't include the referrer than you may also want to monitor what is going out from your web to the app server. You can use tools like Wireshark or Microsoft Network Monitor to see this traffic.
The other "solution" and I use this loosely is to bind a speci... |
There are enough problems with exceptions that can be thrown on threads by other mechanisms, like aborting threads and the likes, that you should find another way of doing it.
An exception is a mechanism used to signal that a process has experienced something exceptional that it cannot deal with. You should try to a... |
I think it may be the version control we user, VSS in combination with a lack of time to learn the branching. I really like the idea of nightly check ins to help with development and avoid 'Going Dark'. I can see him being resistant to the trunks but perhaps building a development SS and when the code is production r... |
Use the Regex COM component built into Windows. You can find a step by step on referencing and using it in your project at: http://www.regular-expressions.info/vb.html |
From the practices I have seen the term production quality is used as a 'frightener' to ensure that people are scared of breaking top of tree, not a bad thing to be honest because top of tree should always work if possible.
I would say that best practice is that you should only be merging distinct (i.e. seperate) fu... |
Assuming that you are working in a centralized version control system (such as Subversion), and assuming that you have a concept of "the trunk" (where the latest well-working code lives):
If you work on new features in "features branches"/"experimental branches", then it's OK to commit code which is far from finishe... |
Yes, it's possible. Just set up an empty project and specify the desired <code>.exe</code> file as debug target. I don't remember exactly how, but I know it's doable, because I used to set <code>winamp.exe</code> as debug target when I developed plug-ins for Winamp.
Since you don't have the source file it will only ... |
ASP.NET - How do you Unit Test WebControls? |
|asp.net|unit-testing| |
Alright.
So I figure it's about time I get into unit testing, since everyone's been banging on about it for long enough. I've installed NUnit and gone through a few "intro to unit testing" type tutorials.
I'm currently putting together a small framework to help with the rebuild of one of our web apps, so I've cr... |
Yeah, my previous answer does not work because I didn't pay any attention to your code. :)
The problem is that the anonymous function is a callback function - i.e. getJSON is an async operation that will return at some indeterminate point in time, so even if the scope of the variable were outside of that anonymous f... |
If you're worried about forgetting to override the function, then make it abstract. |
Resources of techniques use for collision detection in 2D? |
|collision-detection|algorithms|techniques| |
What are in your opinion the best resources (books or web pages) describing algorithms or techniques use for collision detection in a 2D environment?
I'm just eager to learn different techniques to make more sophisticated and efficient games.
Thanks. :D |
|algorithm| |
Ues the [assembly:InternalsVisibleTo][1] attribute and you'll be able to access those private members
Put it in your webcontrol project's AssemblyInfo.cs (under Properties node)
[assembly:InternalsVisibleTo("YourTestProjectName")]
[1]: http://msdn.microsoft.com/en-us/library/system.runtime.compilerserv... |
Whole Tomato's [Visual Assist X][1]. I absolutely swear by it. I would like to see a better plug in for [Lint][2] than [Visual Lint][3] by Riverblade, but since that will eventually be moved onto the build server I don't mind running it every couple of days manually.
[1]: http://www.wholetomato.com/
[2]: http:/... |
I'm currently using **dhtmlxGrid** and we have the Excel copy/paste functionality working. dhtmlXGrid is the most full featured javascript grid package that I've found.
On their website, dhtmlXGrid claims to support [Clipboard functionality][1] in the Professional version. (However, I noticed the Sample on their s... |
Take a look at the [open street map project][1] to see how this sort of thing is being tackled in a truely free software project using only user supplied and licensed data and have a [wiki containing stuff you might find interesting][2].
A few years back the guys involved where pretty easy going and answered lots of... |
No. You can check out <http://codebetter.com/blogs/karlseguin/archive/2008/04/27/foundations-of-programming-pt-7-back-to-basics-memory.aspx> for more information, but setting things to null won't do anything, except dirty your code. |
No don't null objects. You can check out <http://codebetter.com/blogs/karlseguin/archive/2008/04/27/foundations-of-programming-pt-7-back-to-basics-memory.aspx> for more information, but setting things to null won't do anything, except dirty your code. |
- [Resharper][1]
- [Resharper MbUnit Test Runner Add-On][2]
- [SQL Prompt][3] for Database Projects (works inside your SQL Management Studio as well)
- [Ankh SVN 2.0][4]+ for free SVN support (v1.x pales in comparison)
- [TeamCity plug-in][5] to monitor your builds, personal builds, and bug tracking
[1]: htt... |
If you are doing this in .NET, there is an ExpectedException attribute that you can add to your test:
[Test, ExpectedException(typeof(SpecificException), "Exception's specific message")]
public void TestWhichHasException()
{
CallMethodThatThrowsSpecificException();
}
Test will pass if ... |
Look into DB Unit. It is a Java library, but there must be a C# equivalent. It lets you prepare the database with a set of data so that you know what is in the database, then you can interface with DB Unit to see what is in the database. It can run against many database systems, so you can use your actual database s... |
Naming convention for VB.NET private fields |
|vb.net|convention| |
Is there an official convention for naming private fields in VB.NET? For example, if I have a property called 'Foo', I normally call the private field '_Foo'. This seems to be frowned upon in the [Offical Guidelines](http://msdn.microsoft.com/en-us/library/ms229012.aspx):
"Do not use a prefix for field names. For ... |
What we used in a projet is a popup window that opens a mailto: link, it is the only way we found to compose a mail within the default mail client that works with all mail clients (at least all our clients used).
var addresses = [...];
var href = "mailto:" + addresses.splice(0, 1) + "?"
+ "cc=... |
I still use the _ prefix in VB for private fields, so I'll have _foo as the private field and Foo as the property. I do this for c# as well and pretty much any code I write. Generally I wouldn't get too caught up in "what is the right way to do it" because there isn't really a "right" way (altho there are some very bad... |
Official guidelines are just that -- guidelines. You can always go around them. That being said we usually prefix fields with an underscore in *both* C# and VB.NET. This convention is quite common (and obviously, the Official Guidelines ignored).
Private fields can then be referenced without the "me" keyword (the "t... |
[Regex Buddy has a VB6 library][1]
I use this in Delphi and it's very good - and Jeff has raved about RegexBuddy on several occasions.
I can't speak for the VB implementation, but it's certainly worth a look.
[1]: http://www.regexbuddy.com/vb.html |
I'm interested to know why you would want to do this. There's not an easy way to do it, because it's not a good practice. You should probably go back to your design and figure out a cleaner way to accomplish the end goal. |
I don't think that's a good idea..
Take another crack at this problem - Try using some other mechanism like shared data to signal between threads. |
You mentioned WebSphere, BizTalk, Mule. Each of which has very different characteristics with its good and bad points.
If just integration you are after, I will recommend Mule. I had very good experience with it and more important the architect is non invasive, so you could always migrate to a different ESB or other B... |
If you use the standard openssh console client (cygwin or from linux), host keys are stored, one-per-line, in ~/.ssh/known_hosts. From there, it's a simple matter of figuring out which bit of that host key is needed for your library.
Putty also stores host keys, but it appears to encode them in hex. Those can be fo... |
As you probably know, VB6 didn't ship with a built-in regular expression library. You can, however, use one provided by an ActiveX or COM library. [See this article][1] for details.
[1]: http://www.regular-expressions.info/vb.html |
Check in early and check in often for two main reasons -
1 - it might make it easier to integrate code
2 - in case your computer explodes your weeks of work isn't gone |
The controls generally show controls for: P1, Pn, Pc (current page), Pc+1, Pc-1. The only time this changes is at either ends of the paging range {Pc < P3 or Pc > (Pn-3)}
- The first step is to obviously work out the number of pages:
`numPages = ceiling(totalRecords / numPerPage)`
- If you've got 4 or less,... |
The controls generally show controls for: P1, Pn, Pc (current page), Pc+1, Pc-1. The only time this changes is at either ends of the paging range {Pc < P3 or Pc > (Pn-3)}
- The first step is to obviously work out the number of pages:
`numPages = ceiling(totalRecords / numPerPage)`
- If you've got 4 or less,... |
If you have unpalatably many arguments, then just package them together into structs / POD classes, preferably declared as inner classes of the class you are constructing. That way you can still require the fields while making the code that calls the constructor reasonably readable. |
Using GUIDs saved us a lot of work when we had to merge two databases into one. |
This is harder to do in applications that are only in maintenance mode because it is hard to convince management that rewriting something that is already 'working' is worth doing. I would start by applying the principles of MVC to any new code that you are able to work on (ie. move business logic to something akin to a... |
You might want to take a look at OpenVXI, I believe that a number of company's that sell very expensive IVR platforms (such as Avaya) have based their voice browser on it.
http://en.wikipedia.org/wiki/OpenVXI |
Mutex: exclusive-member access to a resource
Semaphore: n-member access to a resource
That is, a mutex can be used to syncronize access to a counter, file, database, etc.
A sempahore can do the same thing but supports a fixed number of simultaneous callers. For example, I can wrap my database calls in a semaph... |
Just use default arguments. In a language that supports default method arguments (PHP, for example), you could do this in the method signature:
`public function doSomethingWith($this = val1, $this = val2, $this = val3)`
There are other ways to create default values, such as in languages that support method overlo... |
I use following approach to finding memory leaks in Java. I've used jProfiler with great success, but I believe that any specialized tool with graphing capabilities (diffs are easier to analyze in graphical form) will work.
1. Start the application and wait until it get to "stable" state, when all the initializatio... |
The only time you should set a variable to null is when the variable does not go out of scope and you no longer need the data associated with it. Otherwise there is no need. |
Depending on the scaling, the relative image pixel could be anywhere in a number of pixels. For example, if the image is scaled down significantly, pixel 2, 10 could represent 2, 10 all the way up to 20, 100), so you'll have to do the math yourself and take full responsibility for any inaccuracies! :-) |
You can add a timestamp field to that table and update that timestamp value with an update trigger. |
Also:
using(SomeObject object = new SomeObject())
{
// do stuff with the object
}
// the object will be disposed of |
Currently in my winforms app I have handlers for `Application.ThreadException`, as above, but also `AppDomain.CurrentDomain.UnhandledException`
Most exceptions arrive via the `ThreadException` handler, but the AppDomain one has also caught a few in my experience |
Nice idea :)
I presume you've used wget's
--load-cookies (filename)
might help a little but it might be easier to use something like Mechanize (in Perl or python) to mimic a browser more fully to get a good spider. |
Your status page is available now without logging in (click [logout][1] and try it). When the beta-cookie is disabled, there will be nothing between you and your status page.
[1]: http://stackoverflow.com/users/logout?returnurl=%2fquestions%2f2815%2fhow-to-curl-or-wget-a-stackoverflow-page |
There are some cases where it makes sense to null references. For instance, when you're writing a collection--like a priority queue--and by your contract, you shouldn't be keeping those objects alive for the client after the client has removed them from the queue.
But this sort of thing only matters in long lived c... |
I couldn't figure out how to get the cookies to work either, but I was able to get to my status page in my browser while I was logged out, so I assume this will work once stackoverflow goes public.
This is an interesting idea, but won't you also pick up diffs of the underlying html code? Do you have a strategy to a... |
Thanks for those
xUnit.net looks like it provides a slightly different approach to N/MB/MS/Unit, which is interesting.
In my search for an rspec-like solution (because I LOVE the rspec), I also came across [NSpec](http://nspec.tigris.org/), which looks a bit wordy, but combined with the [NSpec Extensions](http://... |