instruction
stringlengths
0
30k
There's no cross-browser JS debugger that I know of (because most browsers use different JS engines). For firefox, I'd definitely recommend firebug (http://www.getfirebug.com) For IE, the best I've found is Microsoft Script Debugger (http://www.microsoft.com/downloads/details.aspx?familyid=2f465be0-94fd-4569-b3c4...
1. You can use Visual Studio and enable debugging in browser 2. You can install FireBug plugin for Firefox, it's really good! 3. You can try to install IE8 beta 2 and use it in compatibility mode with built-in debugger. Also in any line of your JS code you can write debugger; and this will be threated a...
Thawte offers code signing certificates [here][1]. I imagine other Certificate Authorities offer this service as well. You can also create self-signed certificates, with [Java keytool][2]. [1]: https://www.thawte.com/process/retail/new_devel [2]: http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/keytool.ht...
If you're using a Mac I recommend using Rspactor over autotest as it uses a lot fewer resources for polling changed files than autotest. There is both a full Cocoa version [RSpactor.app][1] or the gem version that I maintain at [Github][2] sudo gem install pelle-rspactor While these don't speed up ind...
libxml2-p25 on OS X 10.5 needs sudo?
|python|macos|libxml2|
When trying to use libxml2 as myself I get an error saying the package cannot be found. If I run as as super user I am able to import fine. I have installed python25 and all libxml2 and libxml2-py25 related libraries via fink and own the entire path including the library. Any ideas why I'd still need to sudo?
I think your team has to be on-board with your changes. If you're doing large refactorings, making big changes to your codebase and object hierarchy, you're going to want to discuss the changes as a team.
Best Practice for Creating Data Tables Without Controls in ASP.net
|.net|asp.net|
So, I am kinda new to ASP.net development still, and I already don't like the stock ASP.net controls for displaying my database query results in table format. (I.e. I would much rather handle the HTML myself and so would the designer!) So my question is: What is the best and most secure practice for doing this witho...
You can insert the animated image into the DOM right before the AJAX call, and do an inline function to remove it... $("#myDiv").html('<img src="images/spinner.gif" alt="Wait" />'); $('#message').load('index.php?pg=ajaxFlashcard', null, function() { $("#myDiv").html(''); }); This will make su...
$ touch {1,2}.txt $ ls [12].txt 1.txt 2.txt $ rm !:1 rm [12].txt $ history | tail -10 ... 10007 touch {1,2}.txt ... $ !10007 touch {1,2}.txt $ for f in *.txt; do mv $f ${f/txt/doc}; done
how to get through spam filters?
|bouncedemail|email|
I sent 3 emails last week as replies from our website. None recieved them. One was yahoo, hotmail and an overseas domain. I am wondering if its not a good idea to open a yahoo account ith our domain name as the user just to reply to prospective buyers.
I have written a post here concerning [unit testing the data layer][1] which covers this exact problem. Apologies for the (shameful) plug, but the article is too long to post here. I hope that helps you - it has worked very well for me over the last 6 months on 3 active projects. Regards, Rob G [1]: http:...
If you only need read-only access to the mirrored repository, you can use [svnsync](http://svn.collab.net/repos/svn/trunk/notes/svnsync.txt) which was added in SVN 1.4 for mirroring. We use a secondary repository on our build server to run CruiseControl.Net against. But the mirrored repository is read-only.
I think Patrick nailed this one -- my only suggestion is to remember that named regex groups exist, too, so you don't *have* to use array index numbers. Regex.Match(s, @"Index (?<num>\d*)").Groups["num"].Value I find the regex is a bit more readable this way as well, though [opinions vary](http://www.codingho...
Hmm... as nice as it is to call the stored proc from the report and have it all contained in one location, however we found (like you) that you eventually hit a point where you can't get crystal to do what you want even tho the data is right there. We ended up introducing a business layer which sits under the report...
Lingering assembly dependency in C# .NET
|c#|.net|dependencies|
My C# project - we'll call it the SuperUI - used to make use of a class from an external assembly. Now it doesn't, but the compiler won't let me build the project without the assembly reference in place. Let me elaborate. This project used to throw and catch a custom exception class - the *SuperException* - which wa...
|php|mysql|bookingcalendar|homework|
|php|mysql|homework|
Unit tests are also especially useful when it comes to refactoring or re-writing a piece a code. If you have good unit tests coverage, you can refactor with confidence. Without unit tests, it is often hard to ensure the you didn't break anything.
stl::set is basically a sorted container.
In the past some of my solutions have been: 1. Fix the default time out settings of the sqlcommand: Dim myCommand As New SqlCommand("[dbo].[spSetUserPreferences]", myConnection) myCommand.CommandType = CommandType.StoredProcedure **myCommand.CommandTimeout = 120** 2. Increase connection timeo...
Unit testing helps a lot in projects that are larger than any one developer can hold in their head. They allow you to run the unit test suite before checkin and discover if you broke something. This cuts down a *lot* on instances of having to sit and twiddle your thumbs while waiting for someone else to fix a bug the...
Run Profiler to measure the execution time of your queries. Check application logging for any deadlocks.
Unit Testing is definitely worth the effort. Unfortunately you've chosen a difficult (but unfortunately common) scenario into which to implement it. The best benefit from unit testing you'll get is when using it from the ground up - on a few, select, small projects I've been fortunate enough to write my unit tests ...
What's wrong with that? logging each date that the customer is staying allows for what I'd imagine are fairly standard reports such as being able to display the number of booked rooms on any given day.
Have you tried using: System.loadLibrary("mylibrary.dll"); Not sure if this will work with a pure C library but it's probably worth a shot. :)
strpos function problem in PHP not finding the needle
|php|string|code-review|
In php I have open a .php file and want to evaluate certain lines. Specifically when the $table_id and $line variables are assigned a value. Within the text file I have: ... $table_id = 'crs_class'; // table name $screen = 'crs_class.detail.screen.inc'; // file identifying screen str...
Since I develop for both .net and compact .net framework, I sometimes decompile the full .net assemblies to "copy" existing functionality to the compact framework. Other than that I don't spend that much time decompiling libs. Mostly only when something doesn't works and the problem clearly points to an assebmly and...
The C99 Standard ([PDF of latest draft](http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf)) says in section 6.5.3.4 about <code>sizeof</code> constraints: > The <code>sizeof</code> operator shall not be applied to an expression that has function type or an incomplete type, to the parenthesized name of such ...
The C99 Standard ([PDF of latest draft](http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf)) says in section 6.5.3.4 about <code>sizeof</code> constraints: > The <code>sizeof</code> operator shall not be applied to an expression that has function type or an incomplete type, to the parenthesized name of such ...
Your example code is missing but here's one way to do it using mod_rewrite: RewriteEngine on RewriteRule ^$ http://guardthe.net/punbb/ [L,R=301]
`ESC gg=G` to reindent code and `:retab` to convert tabs to spaces or spaces to tabs was what hooked me to vim. So actually you don't need to be forced to use it, you just have to learn when it can help you increase your speed. Go through `vimtutor`. Start using vim for simple editing, like config files or html...
Apropos history -- using cryptic carets etc is not entirely intuitive. To print all history items containing a given string: function histgrep { fc -l -$((HISTSIZE-1)) | egrep "$@" ;}
Delayed Write Failed on Windows 2003 Clustered Fileshare
|c#|windows|iis|2003|
I am trying to solve a persistent IO problem when we try to read or write to a Windows 2003 Clustered Fileshare. It is happening regularly and seem to be triggered by traffic. We are writing via .NET's FileStream object. Basically we are writing from a Windows 2003 Server running IIS to a Windows 2003 file share c...
|c#|iis|windows-server-2003|
You may also want to have a look at [httplib2](http://code.google.com/p/httplib2/), with [examples](http://bitworking.org/projects/httplib2/doc/html/libhttplib2.html#examples). I find using httplib2 is more concise than using the built-in HTTP modules.
How to check for memory leaks in Guile extension modules?
|guile|memory-leaks|python|valgrind|
I develop an extension module for Guile, written in C. Since this extension module invokes the Python interpreter, I need to verify that it properly manages the memory occupied by Python objects.
|python|memory-leaks|guile|valgrind|
I develop an extension module for Guile, written in C. This extension module embeds a Python interpreter. Since this extension module invokes the Python interpreter, I need to verify that it properly manages the memory occupied by Python objects. I found that the Python interpreter is well-behaved in its own...
How do I programatically set the value of an select box element using javascript?
|javascript|html|dom|
I have the following HTML select element: <select id="leaveCode" name="leaveCode"> <option value="10">Annual Leave</option> <option value="11">Medical Leave</option> <option value="14">Long Service</option> <option value="17">Leave Without Pay</option> </select> Using a javasc...
There are two main classes of exception: 1) System exception (eg Database connection lost) or 2) User exception. (eg User input validation, 'password is incorrect') I found it helpful to create my own User Exception Class and when I want to throw a user error I want to be handled differently (ie resourced erro...
Tk does not natively support windows bitmap files. However, the "Img" extension does and is freely available on just about every platform. You do not need to read the data in, you can create the image straight from the file on disk. In plain tcl/tk your code might look something like this: package require Img ...
Use a **with** statment to handle query filtering. <br> Limit each subquery to the minimum number of rows possible. <br> then join the subqueries.<BR> WITH<BR> master AS<BR> (<BR> SELECT SSN, FIRST_NAME, LAST_NAME<BR> FROM MASTER_SSN<BR> WHERE STATE = 'PA' AND<BR> GENDER = 'M'<BR> ),<B...
[Here you go](http://www.databaseanswers.org/data_models/hotels/hotel_reservations_popkin.htm) I found it at this page: [A list of free database models](http://www.webmastersbydesign.com/2008/08/04/library-of-over-500-free-database-models/).
Run your main server on a port other than 80. Stick a lightweight server (e.g. nginx) in front of it on port 80. When you update your site, start another instance on a new port. Test. When you are satisfied that it has been deployed correctly, edit your proxy config file, and restart it. In nginx's case, this resu...
Serving dynamically generated ZIP archives in Django
|python|django|
How to serve users a dynamically generated ZIP archive in Django? I'm making a site, where users can choose any combination of available books and download them as ZIP archive. I'm worried that generating such archives for each request would slow my server down to a crawl. I have also heard that Django doesn't curre...
At work, we spend a period of time with the code frozen in the test environment. Then after a few weeks of notice, we take the site down at midnight Friday night, work through the night deploying and validating, and put it up Saturday late morning. Traffic statistics showed us this was the best time frame to do it.
Tansparent Web Page Overlays in C#
|c#|
How can I show a web page in a transparent window and have the white part of the web page also transparent.
Grundlefleck wrote: > if [ -d $DIRECTORY ]; then Remember to always wrap variables in double quotes when interpolating them in a bash script. Kids these days grow up with the idea that they can have spaces and lots of other funny characters in their directory names. (Spaces! Back in my days, we didn't have no fanc...
What I have is an intranet Maven-like repository where all 3rd party libraries are stored (not only the libraries, but their respective source distribution with documentation, Javadoc and everything). The reason are the following: 1. why storing files that don't change into a system specifically designed to manage...
Depending on the applications use, **I would recommend using SQL Lite** because it doesn't require you to install any other software (SQL CE or Express, etc. usually would require a separate install). Since you're using WPF I can assume you're using at least .NET 3.0. I would then recommend going to .NET 3.5 SP1 (s...
File and directory with same name in same parent directory - Solaris 8, ufs
|solaris|delete|file|directory|filesystems|
Ok, I have been working with Solaris for a 10+ years, and have never seen this... I have a directory listing which includes both a file and subdirectory with the same name: -rw-r--r-- 1 root other 15922214 Nov 29 2006 msheehan drwxrwxrwx 12 msheehan sysadmin 2048 Mar 25 15:39 msheehan I ...
|filesystems|file|solaris|directory|delete|
Ok, I have been working with Solaris for a 10+ years, and have never seen this... I have a directory listing which includes both a file and subdirectory with the same name: -rw-r--r-- 1 root other 15922214 Nov 29 2006 msheehan drwxrwxrwx 12 msheehan sysadmin 2048 Mar 25 15:39 msheehan I ...
Here's a simple example. I didn't get fancy with the html or the servlet, but you should get the idea. I hope this helps you out. <html> <body> <form method="post" action="/myServlet"> <input type="text" name="username" /> <input type="password" name="password" /> <input type="submit"...
Here's a simple example. I didn't get fancy with the html or the servlet, but you should get the idea. I hope this helps you out. <html> <body> <form method="post" action="/myServlet"> <input type="text" name="username" /> <input type="password" name="password" /> <input type="submit"...
I sent 3 emails last week as replies from our website. None recieved them. One was yahoo, hotmail and an overseas domain. I am wondering if it's not a good idea to open a yahoo account with our domain name as the user just to reply to prospective buyers.
|email|bouncedemail|
I sent 3 emails last week as replies from our website. None received them. One was yahoo, hotmail and an overseas domain. I am wondering if it's not a good idea to open a yahoo account with our domain name as the user just to reply to prospective buyers.
And this one is key for me actually: set -o vi /Allan
It's up to you. Sometimes "spagehetti" code is easier to maintain than building/using a full on templating system for something simple, but once you get fairly complicated pages, or more specifically, once you start including a lot of logic into the page itself, it can get dirty really quickly.
In my experience, merge conflicts are rarely an issue when doing small and medium scale refactoring on agile projects. Large refactoring efforts can introduce some merge pain, but if it's done in bite size chunks, the pain can be reduced significantly. Merge pain can also be reduced by using Subversion as your SCM as...
With svnmerge.py, you initialize both branches (when going in one direction, you only need to initialize one of the branches). Then merge using the -b (For bidirectional flag). Here is a summary starting from branch one to branch two. $REPO is the protocol and path to your repository. >svn copy $REPO/branches/one...
How do you stop a Visual Studio generated web service proxy class from encoding?
|visual-studio|web-services|wsdl|proxy-classes|
I'm using a Visual Studio generated proxy class to access a web service (added the web service as a web reference to my project). The problem is that the function the web service exposes expects a CDATA element, i.e.: <Function><![CDATA[<Blah></Blah>]]></Function> Unfortunately, when I pass in "<Blah></Blah>...
I believe you're looking for a `<Repeater>` control. It contains some functionality similar to the GridViews, but allows you hand-craft all of the HTML for the Header, Item, and Footers yourself. Simply call the databinding code as you would for a gridview, and change the ASPX page to suit your exact HTML needs. h...
What is the easiest way to get total number for lines of code (LOC) in SQL Server?
|sql-server|database|t-sql|statistics|
I need to provide statistics on how many lines of code (LOC) associated with a system. The application part is easy but I need to also include any code residing within the SQL Server database. This would apply to stored procedures, functions, triggers, etc. How can I easily get that info? Can it be done (accurately...
Included in ASP.NET 3.5 SP1: - customErrors now supports "redirectMode" attribute with a value of "ResponseRewrite". Shows error page without changing URL. - The form tag now recognizes the action attribute. Great for when you're using URL rewriting
Yes, it is possible, we were able to do this at my previous place of work. What's required is tricky though: 1. Compile for the lowest common denominator BREW version. Version 1.1 is the base for all current handsets out there. 2. Your code must be able to handle multiple resolutions. The methods for detecting sc...
While testing, you can have emails sent to a folder on your computer instead of an SMTP server. Put this in your web.config: <system.net> <mailSettings> <smtp deliveryMethod="SpecifiedPickupDirectory"> <specifiedPickupDirectory pickupDirectoryLocation="c:\Temp\" /> ...
The technical term for what you are thinking of is "code snippets", and googling for that will find you many programs designed to store them for a variety of platforms, including entirely web-based ones such as [this one][1]. [1]: http://snippets.dzone.com/
The two simplest metrics to check for are: 1. Length. I'd say 8 characters as a minimum. 2. Number of different character classes the password contains. These are usually, lowercase letters, uppercase letters, numbers and punctuation and other symbols. A strong password will contain characters from at least t...
I use a personal Wiki, my del.icio.us bookmarks and my own blog for that. Usually my blog: When I learn something that I know I might stumble on again I write a short post in my blog.
Depending on how much accurate results you need, you can simply break the images in n x n pixels blocks and analyze them. If you get different results in the first block you can't stop processing, resulting in some performance improvements. For analyzing the squares you can for example get the sum of the color value...
I'd say less than 1% of my time is spent in Reflector. I can see why it might be a good learning tool but I don't often need to know what goes on under the covers, as long as it works as I'd expect then I'm happy. It's an interesting idea though.
How do I call an Sql Server stored procedure from Powershell?