instruction
stringlengths
0
30k
Here is how they do it on StackOverflow.com: <http://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/>
Actually Process.MainWindowHandle is a handle of top-most window, it's not really the "Main Window Handle"
To add new method to jQuery You need to use jQuery.fn.methodName attribute, so in this case it will be: jQuery.fn.addOption = function (value, text) { jQuery(this).append(jQuery('<option></option>').val(value).text(text)); }; But keep in mind that this addOption will be accessible from result of...
C++ UI resources.
|c++|user-interface|resources|
No that I know C++ i want to get into desktop application that have a UI instead of Command Prompt stuff, where should I start, and what are some good online resources?
Now that I know C++ i want to get into desktop application that have a UI instead of Command Prompt stuff, where should I start, and what are some good **online** resources?
I use [Codegear][1]'s C++ Builder. It's C++ language support is not 100% but it more than makes up for it by having a great two-way RAD IDE and the ability to use a huge library of existing Delphi components. [1]: http://www.codegear.com
The "class" that you've constructed above is what most people would use a *struct* for in other languages. I'm not sure what the performance implications are in PHP, though I suspect instantiating the objects is probably more costly here, if only by a little bit. That being said, if the cost is relatively low, it IS...
Generally, I follow this rule: 1) Make it a class if multiple parts of your application use the data structure. 2) Make it a 2D array if you're using it for quick processing of data in one part of your application.
Anti aliasing workaround
|wpf|
Anti aliasing [cannot be turned off][1] in WPF. But I want to remove the blurred look of WPF fonts when they are small. One possibility would be to use a .net 2.0 component. This looks like it would lose the transparency capability and Blend support. Never tried it though. Anyone has a solution for this? Any dra...
WPF Anti aliasing workaround
|.net|wpf|
You can also programmatically determine the location of the class file by using structured naming conventions that map to physical directories. This is how Zend do it in [Zend Framework][1]. So when you call `Zend_Loader::loadClass("Zend_Db_Table");` it explodes the classname into an array of directories by splitting o...
One issue that hasn't been raised by others is whether **double** is the same as a **float**. On some systems a different format specifier was needed for a double compared to a float. Not least because the parameters passed could be of different sizes. <PRE> %f - float %lf - double %g - double </PRE>
At my work we use CCNET, but with builds on check-in more than nightly - although it's easily configured for either or both. You can very easily set up unit testing to run on every checkin as well, FXCop testing, and a slew of other products. I would also advise checking out [Team City][1] as an option, because i...
**UPDATE table SET X=Y, Y=X** will do precisely what you want. The values are taken from the old row and assigned to a new copy of the same row, then the old row is replaced. You do not have to resort to using a temporary table, a temporary column, or other swap tricks.
**UPDATE table SET X=Y, Y=X** will do precisely what you want. The values are taken from the old row and assigned to a new copy of the same row, then the old row is replaced. You do not have to resort to using a temporary table, a temporary column, or other swap tricks. @DAV360: I see. That is shocking and unexpecte...
Qt Child Window Placement
|user-interface|qt|
Is there a way to specify a child's initial window position in Qt? I have an application that runs on Linux and Windows and it looks like the default behavior of Qt lets the Window Manager determine the placement of the child windows. On Windows, this is in the center of the screen the parent is on which seems...
What is a resonable length limit on person "Name" fields?
|sql|html|textbox|
I have a simple webform that will allow unauthenticated users to input their information, including name. I gave the name field a limit of 50 characters to coincide with my database table where the field is varchar(50), but then I started to wonder. Is it more appropriate to use something like the Text column type o...
I have a simple webform that will allow unauthenticated users to input their information, including name. I gave the name field a limit of 50 characters to coincide with my database table where the field is varchar(50), but then I started to wonder. Is it more appropriate to use something like the Text column type o...
Both JavaScript's regex and PHP's preg_match are based on Perl, so there shouldn't be any porting problems. Do note, however, that Javascript only supports a subset of modifiers that Perl supports. For more info for comparing the two: * [Javascript Regular Expressions][1] * [PHP Regular Expressions][2] A...
@Ian Nelson: I'm wondering if others see the problem there. Let's say you have split fields. That's 70 characters total, 35 for first name and 35 for last name. However, if you have one field, you neglect the space that separates first and last names, short changing you by 1 character. Sure, it's "only" one characte...
MS do have a history of "fire and movement" with regards to introducing new technology into their development stack, but they also have a strong history of maintaining support for the older stuff, and backwards-compatibility. WPF seems to be getting stuff added to it with each new release of the framework but the thing...
I like it to. div tag with a fade. http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Walkthrough/UsingAnimations.aspx
I would also suggest Xml serialization as others have already mentioned. Here is a sample I threw together to demonstrate. Attributes are used to connect the names from the Xml to the actual property names and types in the data structure. Attributes also list out all the allowed types that can go into the `Things` c...
**UPDATE table SET X=Y, Y=X** will do precisely what you want. The values are taken from the old row and assigned to a new copy of the same row, then the old row is replaced. You do not have to resort to using a temporary table, a temporary column, or other swap tricks. @D4V360: I see. That is shocking and unexpecte...
While I'm not 100% sure what the Web Service behavior does, I recall it allows client-side script to call Web Services, which would make AJAX it's contemporary replacement. Since you're using .NET 1.1 how about using [Ajax.NET Professional][1] to connect to the web services? [1]: http://www.ajaxpro.info
Looking for a n-ary tree implementation in Perl
|perl|beginner|algorithm|tree|
I'm writing a Perl script and would like to use a n-ary tree data structure. Is there a good implementation that is available as source code (rather than part of a Perl library) ?
|algorithm|perl|beginner|
Swapping column values in MySQL
|mysql|database|
I have a MySQL table with coordinates, the column names are X and Y. Now I want to swap the column values in this table, so that X becomes Y and Y becomes X. The most apparent solution would be renaming the columns, but I don't want to make structure changes since I don't necessarily have permissions to do that. Is ...
|database|mysql|
I have a MySQL table with coordinates, the column names are X and Y. Now I want to swap the column values in this table, so that X becomes Y and Y becomes X. The most apparent solution would be renaming the columns, but I don't want to make structure changes since I don't necessarily have permissions to do that. Is ...
FinalBuilder does support emailing and just executing FinalBuilder each night will give you nightly builds. You don't really need other software for that if you don't want to. You could also use CCNet to trigger a build when needed and have it execute FinalBuilder for the build. You can then decide if FinalBuilder ...
I'm using the JSCalendar from Dynarch for a project I'm currently working on. It is LGPL licensed and really flexible (easy to customize to your needs). It has lots of features and looks good, too. http://www.dynarch.com/projects/calendar/
Fundamental Data Structures in C#
|c#|.net|data-structures|
I would like to know how people implement the following data structures in C# without using the base class library implementations:- - Linked List - Hash Table - Binary Search Tree - Red-Black Tree - B-Tree - Binomial Heap - Fibonacci Heap and any other fundamental data structures people can t...
Kronoz is right. After setting it at designtime it adds this to the .designer.cs: dataGridViewCellStyle1.NullValue = "null"; If I modify **"null"** to **null** then it works fine. I checked the DataGridViewCellStyle.NullValue set_NullValue(Object) and get_NullValue with reflector and I think that a string value ...
@edg, I guess it's an error in MSDN. You can clearly see in Relfector, that "Main window" check in .NET looks like: private bool IsMainWindow(IntPtr handle) { return (!(NativeMethods.GetWindow(new HandleRef(this, handle), 4) != IntPtr.Zero) && NativeMethods.IsWindowVisible(ne...
There's a series of [MSDN articles](http://msdn.microsoft.com/en-us/vcsharp/aa336800.aspx) on this subject. However, I haven't really read the text myself. I believe that the collections framework by .NET has a broken interface and cannot be extended very well. There's also [C5](http://www.itu.dk/research/c5/), a li...
Best Ruby on Rails social networking framework
|ruby|ruby-on-rails|website|socialnetworking|
I'm planning on creating a social networking + MP3 lecture downloading / browsing / commenting / discovery website using Ruby on Rails. Partially for fun and also as a means to learn some Ruby on Rails. I'm looking for a social networking framework that I can use as a basis for my site. I don't want to re-invent the wh...
As far as I know, the only direct ways to do it are: 1. Commit the txn - Probably not a reasonable option 2. Clear the Persistence Context - EntityManager.clear() - This is brutal, but would clear it out 3. Copy the object - Most of the time your JPA objects are serializable, so this should be easy (if not part...
For example the webserver username and group is <b>apache:www</b>, if you set your to check UID, the php process will only have access to any file owned by the user <b>apache</b>. So if you have another webserver running on your system,for example tomcat with the username and group of <b>tomcat:www</b>, any files cr...
We've been using WPF since it was first released and yes it had it's problems at the beginning that caused us headaches and had us scratching our heads to find a work around, but each new update the stack has actually become pretty stable. It definitely became easier and easier to develop with it with the addition o...
Uising Reflector you can see that Microsoft.ReportViewer.Common.dll has a dependency on "Microsoft.Build.Framework, Version=3.5.0.0" and "Microsoft.Build.Utilities.v3.5, Version=3.5.0.0". So strictly speaking it does have a 3.5 requirement. But if the reporting functionality you use never executes the code that uses/lo...
I recently did something very similar, I used an abstract factory. In fact, you can see the basic concept here: http://stackoverflow.com/questions/27294/abstract-factory-design-pattern
try using a static class member. class Shipment { public static $DefaultWeight = '0'; public function createShipment($startZip,$endZip,$weight=Shipment::DefaultWeight){ //you function } }
How do I check the active solution configuration Visual Studio built with at runtime?
|visual-studio|microsoft|
I would like to enable/disable some code based on a custom solution configuration I added in Visual Studio. How do I check this value at runtime?
Best way to test if a generic type is a string? (c#)
|c#|generics|
I have a generic class that should allow any type, primitive or otherwise. The only problem with this is using `default(T)`. When you call default on a value type or a string, it initializes it to a reasonable value (such as empty string). When you call `default(T)` on an object, it returns null. For various reasons we...
I recommend that if VS Express is not good enough, use Professional. Standard is missing some really useful features, like a Remote Debugger. Here is a detailed comparison: [http://msdn.microsoft.com/en-us/vs2008/products/cc149003.aspx][1] I'd say cancel TechNet and get one of the bottom two MSDN Subscriptions, V...
Most people here have mentioned SQL Injection and XSS, which is *kind of* correct, but don't be fooled - the most important things you need to worry about as a web developer is INPUT VALIDATION, which is where XSS and SQL Injection stem from. For instance, if you have a form field that will only ever accept integers...
I don't actually know the answer but I suspect that it has something to do with the aspect of invoking methods on string literals directly. If I recall correctly (I didn't actually verify this because I don't have an old IDE handy), early versions of the C# IDE had trouble detecting method calls against string liter...
>>It's the speed that I am thinking of mostly, for anything more complex than what I have here I'd probably go with classes but the question is, what is the cost of a class? This would seem to be premature optimisation. Your application isn't going to take any real-world performance hit either way, but using a class...
Note that many **cultures** have 'second surnames' often called family names. For example, if you are dealing with Spanish people, they will appreciate having a family name separated from their 'surname'. Best bet is to define a data type for the name components, use those for a data type for the surname and tweak d...
Aren't there environment settings? I have `VCToolkitInstallDir` and `VS71COMNTOOLS` although I'm using VS2003, I don't know if that changed for later versions. Type "set V" at the command line and see if you have them.
There is not a native way to do it, but you can achieve it with a macro. The details are described here in full: [http://www.helixoft.com/blog/archives/32][1] You just have to add a little VB Macro to the EvironmentEvents macro section and restart VS. Note: The path will not show up when you first load VS, but w...
If you need to consider localisation (for those of us outside the US!) and it's possible in your environment, I'd suggest: Define data types for each component of the name - NOTE: some cultures have more than two names! Then have a type for the full name, Then localisation becomes simple (as far as names are conc...
I have worked extensively with templated control and I have not found a better solution. Why are you referencing the contentLable in the event handler? The sender is the label you can cast it to the label and have the reference to the label. Like below. //add a custom data binding c...
As usually happens when I post questions like this, I found the problem. It turns out the Crypt::SSLeay module was not installed or at least not up to date. Of course the error messages didn't give me any clues. Updating it and all the problems go away and things are working fine now.
What does this javascript error mean? Permission denied to call method to Location.toString
|javascript|flash|
This error just started popping up all over our site. ***Permission denied to call method to Location.toString*** I'm seeing google posts that suggest that this is related to flash and our crossdomain.xml. What caused this to occur and how do you fix?
Using MVP - How to use Events Properly for Testing
|asp.net|design-patterns|mvp|
I've just started using the MVP pattern in the large ASP.NET application that I'm building (re-building actually) and I am having a hard time figuring out how I should be using Events applied to the view. Say I have 2 drop down lists in a User Control, where one is dependent on the other's value: <%@ Control ...
Usually when creating Cocoa applications that front UNIX commands or other headless programs you use an [`NSTask`][1]: > Using the NSTask class, your program can run another program as a subprocess and can monitor that program’s execution. An NSTask object creates a separate executable entity; it differs from NSThre...
replace URL with HTML Links javascript
|javascript|regex|
i am using the next function to match urls inside a given text and replace them for html links. The regex is working great but currently i am only replacing the first match. Does anyone knows how I can replace all the url? I guess i should be using *exec* command but i did not really figured how to do it. fun...
The portable way to get epsilon in C++ is #include <limits> std::numeric_limits<double>::epsilon() Then the comparison function becomes #include <cmath> #include <limits> bool AreSame(double a, double b) { return fabs(a - b) < std::numeric_limits<double>::epsilon(); }
Add a "g" to the end of the Regex to enable global matching. /ig;
Not massively. I've never had an issue with it in desktop development unless as Martin states you're using it in a silly location. I've heard a lot of people have utterly irrational fears about its performance in desktop development. In the Compact Framework (which i'm usually in) though it's pretty much anethema an...
Eclipse Plugin Dev: How do I get the paths for the currently selected project?
|java|eclipse|plugin-development|eclipse-api|
Best practices for integrating third-party modules into your app
|architecture|system-integration|
We have a few projects that involve building an application that is composed of maybe 50% custom functionality, but then pulls in, say, a wiki, a forum, and other components that are "wheels" that have already been invented that we do not wish to re-write from scratch. These third-party applications usually have the...
[wxWidgets](http://www.wxwidgets.org/) is a cross platform GUI library for C++ (and other languages). The main site should have enough pointers to resources to get going.
[wxWidgets](http://www.wxwidgets.org/) is a cross platform GUI library for C++ (and other languages). The main site should have enough pointers to resources to get going. You might also want to check out [this](http://stackoverflow.com/questions/4347/where-is-a-good-place-to-start-programming-guis-for-windows) quest...
I've started with Hibernate on Java project at my workplace, and then realized that there exist the .Net port (NHibernate) and used it again in a .Net project. I've also came across the article that *joesteele* mentions, and used it as a base for my projects with some minor modifications when needed, mostly when needed...
On Linux and maybe Windows, you can use [Gtk+](http://gtk.org) with [Glade](http://glade.gnome.org/). Gtk+ is the GUI toolkit. Glade is a GUI drag and drop GUI editor. If you came from Windows or Java and thought GUI programming is hard, this stuff is easy.
How about [QT](http://trolltech.com/products/qt/)? Its cross-platform and its is used in a lot of commercial softwares.
I think developing a custom solution for running background tasks doesn't always worth, so I recommend to use the [Quartz Scheduler][1] in Java. In your situation (need to run background tasks in a web application) you could use the ServletContextListener included in the distribution to [initialize the engine at the...