instruction
stringlengths
0
30k
|asp.net|
Has anyone run into this error message before when using a timer on an ASP.Net page to update a datagrid every x seconds? Searching google yielded this [blog entry][1] [1]: http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.as...
|asp.net|
Has anyone run into this error message before when using a timer on an ASP.Net page to update a datagrid every x seconds? Searching google yielded this [blog entry][1] [1]: http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.as...
Apparently aspnet_merge.exe (and all the other SDK tools) is NOT packaged in Visual Studio 2008. Visual Studio 2005 packaged these tools as part of its installation. The place to get this is an installation of the Windows SDK ([latest download][1]). The solution is to install the Windows SDK and make sure you se...
sp_settriggerorder only applies to AFTER triggers.
You could always use *shutil.copyfileobj*, in your example: shutil.copyfileobj(f, 'bar.txt')
I use the Resco MobileForms toolkit for a variety of functionality: [http://www.resco.net/developer/mobileformstoolkit/overview.aspx][1] It includes a good ZIP library. [1]: http://www.resco.net/developer/mobileformstoolkit/overview.aspx
Just guessing here, but are you sure that statSVN is compatible with working copies created with version 1.5 of the client? The format changed with svn 1.5...
I'm going to interpret this as simply as possible, if I'm not answering your question, I apologize. When you really get the answer to this question, it's your first step to really thinking Object Orientedly. In OO, when two objects both "has a" 'nother object, it's perfectly acceptable for both to refer to that o...
I'm going to interpret this as simply as possible, if I'm not answering your question, I apologize. When you really get the answer to this question, it's your first step to really thinking Object Orientedly. In OO, when two objects both "has a" 'nother object, it's perfectly acceptable for both to refer to that o...
One solution I have seen used is to configure the staging environment so that it is identical to the production environment. This means each environment has a VLAN with the same IP range, and machine roles on the same IP addresses (e.g. the db cluster IP is always 192.168.1.101 in each environment). The firewalls mappe...
That's exactly what you should do. The more centralized you can make your css, the easier it will be to make changes in the future. And let's be serious, you will want to change colors in the future. You should almost never hard-code any css into your html, it should **all** be in the css. Also, somethi...
select cast(right(column_name,charindex(' ',reverse(column_name))) as int)
CSS is not your answer. You want to look into an abstraction on top of CSS like [SASS][1]. This will allow you to define constants and generally clean up your css. Here is a list of [CSS Frameworks][2]. [1]:http://haml.hamptoncatlin.com/docs/rdoc/classes/Sass.html [2]:http://speckyboy.com/2008/03/28/top-12-css-...
Andy Beaulieu has beein doing a lot of work to make Farseer easier to use in Silverlight, you can read about it here: http://www.andybeaulieu.com/Home/tabid/67/EntryID/115/Default.aspx
An execution plan is theory, the execution time is reality. The plan shows you how the engine goes about performing your query, but some steps might cause an inordinate amount of work to resolve the query. The use of "x is null or x = y" smells bad. If r and d are big tables you might have some sort of combinatorial...
An execution plan is theory, the execution time is reality. The plan shows you how the engine goes about performing your query, but some steps might cause an inordinate amount of work to resolve the query. The use of "x is null or x = y" smells bad. If r and d are big tables you might have some sort of combinatorial...
|c#|bestpractices|windowsforms|controls|
|c#|bestpractices|winforms|controls|
|c#|winforms|controls|
First off, this is a question about a desktop app using Windows Forms, not an ASP.Net question. I need to interact with controls on other forms. Trying to access the controls by using, for example, the following... otherForm.Controls["nameOfControl"].Visible = false; ...doesn't work the way I would expect....
Testing a function that throws on failure
|unittesting|bestpractices|
What is the best way of testing a function that throws on failure? Or testing a function that is fairly immune to failure? For instance; I have a I/O Completion Port class that throws in the constructor if it can't initialise the port correctly. This uses the Win32 function of CreateIoCompletionPort in the initialis...
Possibly [Hashed Adapter Objects][1] (if you can find a good explanation of it on the web - they seem to be lacking.) [1]: http://www.mindspring.com/~mgrand/pattern_synopses2.htm#Hashed%20Adapter%20Objects
Well... for one thing rather than a single event class with a union of all the properties, or 61 event classes (1 base, 60 subs), in a scenario with that much variation, I'd be tempted to have a single event class that uses a property bag (dictionary, hashtable, w/e floats your boat) to store event information. The ty...
If your problem happens in Internet Explorer, but it renders the way you'd expect in FireFox or Safari, [this link][1] was extraordinarily helpful for me with a [similar problem][2]. It appears to boil down to the idea that marking an element as "position:relative;" in CSS causes IE6&7 to mess with it's z-index rela...
[Watir](http://wtr.rubyforge.org/) or [Watin](http://sourceforge.net/projects/watin/) are a great place to start. More info [here](http://www.hanselman.com/blog/WATIRForNETWatiNApproaches08ReleaseAndAutomatingIEFromPowerShell.aspx)
Using RFs/RFile/RDir APIs from within a file server plugin is not safe and can potentially lead to deadlock if you're not very careful. Symbian 9.5 will introduce new APIs (RFilePlugin, RFsPlugin and RDirPlugin) which should be used instead.
How do I stop the "Found new hardware wizard" appearing?
|windows|hardware|drivers|
As part of our product we use 3rd party hardware and drivers. Unfortunately, these drivers aren't signed so up pops the "Found new hardware wizard" when installing or upgrading our product. Our product is web based and allows the users access to everything they need remotely, apart from this one case. Is there a r...
You can guarantee which trigger is fired first, which trigger is fired last and which ones fire in the middle by using sp_settriggerorder. If you need to synchronize more than three it does not appear possible in SQL Server 2005. Here is a sample taken from [here][1] (The linked article has much more information). ...
You also get a "soft delete" feature so you can give the(certain) end-users the power of "undo" - there would have to be a pretty strong downside in the mix to cancel the benefits of soft deleting.
This would be fine as long as your appliction does not require that the data is immediately deleted since you have to wait for the next interval of the cron job. I think a better solution and the more common practice is to use a development server and a production server. If your development database gets blown out,...
I keep a list of all the colors I've used at the top of the file.
I believe flex generates a small anonymous function to deal with this. You could do similar using a ChangeWatcher. You could probably even make a new anonymous function in the changewatcher call.
When you say the "query plan is lower", do you mean it is shorter, or that the actual cost estimates are lower? One obvious problem with your replacement view is that the join with cust_dept_roll_up_tbl uses almost exclusively unindexable criteria (the "is null" tests can be satisfied by an index, but the ones involvin...
See Herb Sutter's [Guru of the Week 54][1] for the relative merits of vector and queue where either would do. I imagine the inconsistency between priority_queue and queue is simply that different people implemented them. [1]: http://www.gotw.ca/gotw/054.htm
Have separate images for every possible arrangement **of each row**. That would only require 30 images (16+8+4+2)
A lot of people have a delete flag or a row status flag. But if someone is doing a change through the back end (and they will be doing it since often people need batch changes done that can't be accomplished through the front end) and they make a mistake they will still often go for delete. Ultimately this is no subs...
For windows, unix, or Mac? On the Mac or *nix you can use command line or GUI versions of emacs or vim. For the Mac: TextWrangler to handle big files well. I'm not versed enough on the Windows landscape to help out there.
Apparently aspnet_merge.exe (and all the other SDK tools) are NOT packaged in Visual Studio 2008. Visual Studio 2005 packaged these tools as part of its installation. The place to get this is an installation of the Windows SDK ([latest download][1]). The solution is to install the Windows SDK and make sure you s...
EDIT: Okay, I type too slow so most of what I had to say was already mentioned, so I'll strip it out except for... The BIG thing to take note of is that the WSYWIG designer they used in Expression Web made it's way into Visual Studio 2008, which is a VERY GOOD thing. There is now EXCELLENT support for CSS, a better ...
Are they participating in the stand-up meetings? You could propose to have a representative at each (or some) of them, to ask them for input before the end of the sprint
IDA Pro will definitely do ARM disassembly. And they (Datarescue) once arranged me a licence at about 11PM local time, so I like to recommend them... I see from http://www.datarescue.com/idabase/ that there's been some rearrangement of the company, but I guess it's still a good product. Here's the link to the ne...
> Good suggestions, but rest assured, we have tried all of the usual troubleshooting. What I'm hoping is that this is a .NET issue that someone might know about, that we can work on solving. My feeling is that no matter how bizarre the underlying cause, the usual troubleshooting steps are your best bet for locating ...
What Steve says is right, but I guess that if your code had to support several languages, you could have a factory method that encapsulates a set of methods that do the relevant toUpper or toLower based on that language.
The idea is that designers will work in Expression Design (to design vector artwork) and Expression Blend (to build and style XAML interactions, as well as to define timeline based animations and interactions). Developers will work on the application in Visual Studio. Visual Studio includes very basic XAML editing c...
Quite loosely defined question so a good answer is almost impossible. Would dare to suggest that using [Selenium](http://selenium.openqa.org/) might help with automating the task.
How to switch back to a previous version of a file without deleting its subsequent revisions?
|svn|
I have 4 versions of file A.txt in my subversion repository, say: A.txt.r1, A.txt.r2, A.txt.r3 and A.txt.r4. My working copy of the file is r4 and I want to switch back to r2. I don't want to use "*svn update -r 2 A.txt*" because this will delete all the revisions after r2, namely r3 and r4. So is there any way tha...
Be careful, increasing your typing speed can increase the risk of carpal tunnel syndrome: "The typing speed may affect risk, in some cases, however. For example, the fingers of typists whose speed is 60 words per minute exert up to 25 tons of pressure each day." [[source]][1] [1]: http://www.umm.edu/patiented...
There are a few differences between Temporary Tables (#tmp) and Table Variables (@tmp). As a rule of thumb, for small to medium volumes of data and simple usage scenarios you should use table variables. (This is an overly broad guideline with of course lots of exceptions - see below and following articles.) Some...
I've just started using [qgit][1] and it seem pretty nice. I installed it on my Mac via [MacPorts][2], there's a Windows installer (I haven't tried it) and I'm sure it's easy to get for Linux as well. [1]: http://digilander.libero.it/mcostalba/ [2]: http://www.macports.org/
As far as the interpreter is concerned, an underscore is just another character allowed in identifiers. It can be used as an alternative to concatenation or camel case to form multi-word identifiers. A leading underscore is often used to mean an identifier is for local use only, *e.g.* for non-exported parts of a m...
My guess would be memory consumption - but, set up [IIS to log recycles][1] and you'll know for sure. [1]: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/87892589-4eda-4003-b4ac-3879eac4bf48.mspx?mfr=true
CSS Margin Collapsing
|css|
So essentially does margin collapsing occur when you don't set any margin or padding or border to a given div element?
|css|margin|
Too complicated. The standard approach to this is to do all your work inside a transaction, so if you screw up and forget a WHERE clause, then you simply roll back when you see the "2,349,325 rows affected" result.
[Emacs](http://www.gnu.org/software/emacs/) can handle [huge file sizes](http://www.freelists.org/archives/glug_t/03-2005/msg00032.html) and you can use it on Windows or *nix.
I would develop your website locally and ftp it to your godaddy website after or use the publish website feature in VS
The "WHERE to_be_deleted <> 1" on every other query is a huge one. Another is once you've ran your accidentally rogue query, how will you determine which of the 2,349,325 were *previously* marked as deleted? I think the practical solution is regular backups, and failing that, perhaps a delete trigger that captures ...
How can I get Datetime to display in military time in oracle?
|sql|oracle-database|
I am running some queries to track down a problem with our backup logs and would like to display datetime fields in 24-hour military time. Is there a simple way to do this? I've tried googling and could find nothing.
Here is a recursive solution in Python. #!/usr/bin/env/python import sys ENCODING = {'0':['N'], '1':['L'], '2':['T'], '3':['D'], '4':['R'], '5':['V', 'F'], '6':['B', 'P'], '7':...
I have done something similar in the past and used an in-memory XML document as a quick and dirty hierachical database for storage. You can store each show/season/episode as an element (nested appropriately) and attributes of these things as xml attributes on the elements. Then you can use XQuery to get info back out. ...
Mapping my custom keys in Debian
|debian|linux|keyboard|
I have a Microsoft keyboard with a series of non-standard buttons such as "Mail", "Search" , "Web/Home" etc. I would really like to be able to bind these keys so they execute arbitrary programs. Does anybody know how to do this in Debian Etch? Thanks in advance, Simon
|linux|keyboard|debian|
I have a Microsoft keyboard with a series of non-standard buttons such as "Mail", "Search" , "Web/Home" etc. It would be nice to be able to bind these keys so they execute arbitrary programs. Does anybody know how to do this in Debian Etch? Thanks in advance, Simon
If your data file contains all your records (i.e. it includes records that do not have dupicate ids within the file) you could pre-process it and produce a file that only contains records that have duplicate (ids). If this is the case that would reduce the size of file you need to process.
If your data file contains all your records (i.e. it includes records that do not have dupicate ids within the file) you could pre-process it and produce a file that only contains records that have duplicate (ids). If this is the case that would reduce the size of file you need to process with your AWK program.
I can't say for certain because I'm not using Debian but if you're using Gnome the easiest way is to run gnome-keybinding-properties (System > Preferences > Keyboard Shortcuts) Instead of typing a shortcut such as Ctrl+M, hit the button on your keyboard. If you would prefer to do this via command line or with a d...
Different implementations of the gzip algorithm will always produce slightly different but still correct files, also the compression level of the original file may be different then what you are running it at.
I try to keep my applications very simple. Simplicity and usability can be a good design in-and-of itself if done intelligently. Take all of the buttons for Stackoverflow for example. It shouldn't be very difficult to implement something similar in your own application. They are simple and they get the job done.
Robert Read wrote a useful guide, [How to be a Programmer][1], which covers a wide area of programming issues that a beginner would find helpful. [1]: http://samizdat.mines.edu/howto/HowToBeAProgrammer.html
There are a few differences between Temporary Tables (#tmp) and Table Variables (@tmp), although using tempdb isn't one of them, as spelt out in the MSDN link below. As a rule of thumb, for small to medium volumes of data and simple usage scenarios you should use table variables. (This is an overly broad guideline w...
There are a few differences between Temporary Tables (#tmp) and Table Variables (@tmp), although using tempdb isn't one of them, as spelt out in the MSDN link below. As a rule of thumb, for small to medium volumes of data and simple usage scenarios you should use table variables. (This is an overly broad guideline w...
If you're interested in Linux, [Linux Action Show][1] is a wonderful podcast ! It's about Linux news, distributions and softwares releases and also Linux based hardware testing (like drobo, Amazon Kindle and so on). It's very good quality and the hosts, Brian and Chris, sounds amazing. It's my number one podcast...
Sometimes the easiest way to get input from people is to force it out of them. My company used SCRUM on a project, and found very quickly that people tend to keep to themselves when they already know what they're doing. We ended up organizing weekly meetings where team members were required to display something that ...
I don't know of any tool that can help you, but if you are writing your own, I can save you from one headace: Directories in CVS cannot be tagget. Only the files within them have tags (and that is what determines what is checked out when you check out a directory on a specific tag).
The finalize method is never invoked more than once by a JVM for any given object. You shouldn't be relying on finalize anyway because there's no guarantee that it will be invoked. If you're calling finalize because you need to execute clean up code then better to put it into a separate method and make it explicit, e.g...
This is a CSS question: the width includes the border and padding widths, which have different defaults for INPUT and TEXTAREA in different browsers, so make those the same as well: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>width</title> ...
Brad's list is pretty good. I also listen to: - [Sparkling Client][1] (Silverlight specific) - Jon Udell's [Perspectives][2] series - [Herding Code][3] (shameless plug for a podcast I put on with Kevin Dente, Scott "lazycoder" Koon, and K. Scott Allen. [1]: http://www.sparklingclient.com/ [2]: http...
Brad's list is pretty good. I also listen to: - [Sparkling Client][1] (Silverlight specific) - Jon Udell's [Perspectives][2] series - [Herding Code][3] (shameless plug for a podcast I put on with Kevin Dente, Scott "lazycoder" Koon, and K. Scott Allen. We recently [interviewed Jeff Atwood about StackOverflow...
* One Owner: Aka delete on Copy * std::auto_ptr When the creator of the object wants to explicitly hand ownership to somebody else. This is also a way documenting in the code I am giving this to you and I am no longer tracking it so make sure you delete it when you are finished.
Not sure about the "best" way, that's probably quite a loaded question... One way is to use the Web Tests in the Test edition of Visual Studio, see [MSDN documentation.][1] Also here's a [simple tutorial.][2] [1]: http://msdn.microsoft.com/en-us/library/ms182536(VS.80).aspx [2]: http://blogs.vertigosoftwa...
Adding to Jacco's response, [vbAccelerator][1] has a great String Builder class that accomplishes much the same thing but is a little more robust. The author also walks through the solution explaining how it works. [1]: http://www.vbaccelerator.com/home/Vb/Code/Techniques/StringBuilder/article.asp
You could implement a lock-free queue: http://www.boyet.com/Articles/LockfreeQueue.html Or handle the synchronization yourself using locks: http://www.albahari.com/threading/part2.html#_Locking
[FunFX](http://funfx.rubyforge.org/) is an option for automating UI testing. I haven't used it extensively, but I've heard of some having success with it. [Here](http://blog.objectmentor.com/articles/2008/06/22/observations-on-test-driving-user-interfaces) is the article where I first learned about it.
In Blend you could convert the TextBlock to a Path, and then use the normal Stroke properties. But I'm assuming you wanted something that you could make dynamic... Otherwise I would think it would have to be some sort of bitmap effect or special brush.
Hashtable.Synchronized method returns a synchronized (thread safe) wrapper for the Hashtable. http://msdn.microsoft.com/en-us/library/system.collections.hashtable.synchronized(VS.80).aspx This also exists for other collections.
Mono has just recently announced that it has full support for .NET 3.5 and overall Mono handles the majority of things well. A lot of the work is done by volunteers so you will still hit corner cases that will cause problems but they are very responsive on bugzilla and mailing lists. Another great feature they've ju...