-
Recent Posts
Recent Comments
Archives
- April 2012
- January 2012
- November 2011
- June 2011
- May 2011
- March 2011
- January 2011
- September 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- July 2009
- June 2009
- May 2009
- March 2009
- February 2009
- January 2009
- November 2008
- October 2008
- September 2008
- July 2008
- April 2008
- March 2008
- February 2008
- January 2008
- October 2007
- September 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- November 2006
- July 2004
- May 2004
- May 2002
- April 2002
Categories
Meta
Category Archives: Technology
Convert Moodle Timestamp fields to Date
I get really frustrated with Moodle for using int fields to store dates. They store it in the Unix (Epoch) format. Here’s how to make it more readable. To convert it to a readable date, use FROM_UNIXTIME(int) You can also … Continue reading
Search through text of Stored Procedure
Code to search across the text of all stored procedures for a particular string. SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_DEFINITION LIKE ‘%foobar%’ AND ROUTINE_TYPE=’PROCEDURE’
Call parent class constructor in PHP5
This may be obvious to some, but I had a hard time figuring it out at first. I needed to call the constructor of a parent class in the child. This is handy when you have things that happen in … Continue reading
Long character fields from database weird in PHP
When you are returning longer text from a query in PHP, like from a varchar(MAX) or such you can get weird characters at the end. The problem is that the ODBC connection, which I used to query the MS SQL … Continue reading
Handling checkboxes in JQuery
Some quick notes on handling checkboxes (and probably radio buttons, but I haven’t tested that) in JQuery. To find a count of all checked items with the class Testbox. $(“.Testbox:checked”).size(); To get a count of all of the unchecked items use … Continue reading
Search and Replace across all tables
Search and replace all occurances of a string in all tables in a database. From http://vyaskn.tripod.com/ –To replace all occurences of ‘America’ with ‘USA’: EXEC SearchAndReplace ‘America’, ‘USA’ GO REATE PROC SearchAndReplace ( @SearchStr nvarchar(100), @ReplaceStr nvarchar(100) ) AS BEGIN — … Continue reading
Search all tables in a database
Search all text fields across all tables in a database. Taken from http://vyaskn.tripod.com/ –To search all columns of all tables in Pubs database for the keyword “Computer” EXEC SearchAllTables ‘Computer’ GO CREATE PROC SearchAllTables ( @SearchStr nvarchar(100) ) AS BEGIN … Continue reading
How to change the listening port for Remote Desktop
Often you’ll want to run Remote Desktop services on a non-standard port. Here’s the steps for changing the listening port on the “host” system. Taken from the MS Knowledge Base. View products that this article applies to. This article was … Continue reading
Order characters numerically
It may be simple, but this SQL will order items numerically (1,2,3,10,20) instead of alpha (1,10,2,20,3). SELECT ItemID, ItemName, ItemNum, CASE WHEN Len(ItemNum) = 0 THEN ‘Z’ ELSE SPACE(10- Len(ItemNum)) + ItemNum END OrderCol FROM table ORDER BY OrderCol
Using Alt and Title attributes on img tags
I was sent a tip about using alt and title attributes. I’ve noticed for a while now that Netscape 6+ doesn’t show the alt tags when you hover over them. Looking at the W3C specifications, the alt attribute is supposed … Continue reading
Posted in Technology
Leave a comment