Posts

Showing posts from 2003

Dave's Quick Search Taskbar Toolbar Deskbar

Dave's Quick Search Taskbar Toolbar Deskbar . This tool is a toolbar for your desktop. It allows you to search many search engines. You can search for many things including dictionary definitions, stock quotes, newsgroups, weather, translated text/webpages, open websites and many more. You can add functionality to it through HTML configuration files. It is an Open Source project as well.

HTML-Kit

HTML-Kit is one of the best HTML editors available and it is completely free. As well as syntax highlighting for various file type (HTML, ASP, PHP, CSS, etc) it also allows you to validate you CSS and HTML with online validators - and check your HTML with HTML-Tidy offline. It is has a wide range of plugins available (you can even develop your own ). Check out the extensive feature list . My favourite plugins: hkDivStarter - create layouts using CSS and DIV tags (added 9 Jan 2004) hkTagTreeLite - display (X)HTML / XML as a tree structure, can be used to navigate the code (added 9 Jan 2004) cmBatchFind - find text in multiple files cmBatchDelete - delete multiple files cmBatchReplace - replace text in multiple files (supports regular expressions and can back up changed files) cmCodePublish - formats your code to allow you to publish it as HTML (with syntax highlighting) cmCodeCrusher - strips out superfluous whitespace and comments in your code cmCodeFinder -...

StumbleUpon

A very useful toolbar (for Internet Explorer / Mozilla / Netscape) that allows you to find websites that other users recommend. It is community based so you can also recommend sites as well. Download from http://www.stumbleupon.com/ Has two ratings - Not for me and I like it . Use on any sites you like (or dislike). The more sites you rate, the better results you get. Sites are put into interest categories (i.e. Web Developer, Programming) - so if you add your interests, you will get better results. A good way of browsing the web without using a search engine. Almost 300,000 sites listed and 83,000 members. Going since mid-2002 (site redesign January 2003 - approx 20,000 members). Hopefully the more users and the more websites, the better it will get. Update - Jan 9 2004 : 90,614 members, 309,229 websites - seems to be growing quickly, perhaps 10,000+ members by February Update - Mar 5 2004 : 104,872 members, 407,710 websites. Perhaps there will be 1/2 million sites by late Ap...

Editing Databases

Couple of free tools for editing databases. Office-QB Standard - free download for accessing databases via ADO and ODBC. Basic querying of data, so knowledege of SQL syntax recommended. Office-QB Pro has more features CuteSQL - free download, connects via ADO and ODBC DbaMgr - two versions available. DbaMgr is for SQL Server 7.0 and MSDE 1.0, DbaMgr2k is for SQL Server 2000 and MSDE 2000 SQLExecMS - version 1 is free. Can edit MSDE and SQL Server 7.0/2000 databases WinSQL - Lite version free (requires free registration after 30 days). Connects to any ODBC database MySQL Control Centre - edit MySQL databases Online editing via ASP: 1ClickDB - free (basic editing of data in tables and export from tables and views) and pro (extra features like stored procedures and import) versions available Universal Table Editor - using VBScript class Set permissions on the folders that you install these to, else anyone with the URL could edit the data.

List Cookies

List cookies that have been set for a web site: // split up cookie into array (; is deliminator) thisCookie = document.cookie.split('; '); // loop through array if(thisCookie.length > 0){ // open list document.write('<ul>'); for(i=0;i<thisCookie.length;i++){ // cookie name document.write('<li><strong>Cookie Name:<\/strong> ' + thisCookie[i].split('=')[0]); // cookie value document.write(', <strong>Value:<\/strong> ' + unescape(thisCookie[i].split('=')[1]) + '<\/li>'); } // close list document.write('<\/ul>'); } Use for seeing what cookies your site has set.

Favelet: Highlight A Tags

A favelet for highlighting anchor tags: Highlight A . How to use favelets (from Accessify.com). Accessify also have quite a few useful ones.

Multiple versions of Internet Explorer

There is a way of running several versions of Internet Explorer on one PC without resorting to dual booting. Details at Insert Title Web Designs . It looks like you can finally run IE5 on Windows XP for testing your HTML/CSS code. The method is very simple and it illustrates the fact that Internet Explorer is not completely integrated into Windows. There is a set of zipped files available. I wonder why developers were never told about this ? Update - Jan 9 2004: Downloads now available at: Skyzyx downloads - Internet Explorer versions 3, 4, 5 and 5.5 available

CSS

A table of CSS rules that you can apply to pages to hide CSS from certain browsers. Useful for working around CSS display bugs in certain browsers. CSS properties list is a list of CSS1/2 properties and which browsers they will work in (plus any quirks there might be)

Get File Size

This handy tool ( download ) enables you to find out the file size of a linked document within Internet Explorer. It also tells you when it was last modified.

CSS / XML Editors

Free CSS editor provided by Morphon (11.7MB download). Requires Java Runtime (or download a 24.8MB file which includes the runtime.) There is also an XML editor available (13.3MB download, 28.4MB with runtime)

DevGuru

DevGuru contains a quick reference guide for the following: ADO , ASP , CSS2 , HTML , Javascript , JetSQL , VBScript , WML , WMLScript , WSH , XHTML , XML DOM and XSLT . Very comprehensive. Downloadable PDF versions for $10.

JavaScript Sites

http://webdeveloper.earthweb.com/webjs/ - many useful scripts found here including a style switcher (very little code involved, so simple one line of code is needed to switch the style sheet) There is also a navigation tree menu, a chart generator (using an object based approach) and a HTML > JavaScript converter. Some of the scripts are standards compliant, using the latest DOM standards. Not quite beginner orientated, but good functional code. You can also add your own code as well. http://www.javascript.com/ - this site brings together links to other sites and also includes a tip of the day feature http://javascript.internet.com/ - this is the internet.com javascript source and also allows additions. Code has comments and also shows you the amount of code there is in the script at a quick glance. Over 2000 scripts here. http://www.brainjar.com/ - this is the home of the DOM Viewer , a tool that list the methods and properties of various objects. It is a stand alone H...

Programming Tools (Open Source)

A few tools that I have used (with syntax highlighting for various languages - HTML, JavaScipt, CSS, C++, etc...): Programmers Notepad 2 (based on Scintilla) (which is the one I often use) Scintilla - SciTE Syn Text editor SynEdit (not the same thing as Syn Text Editor) jEdit (requires Java) Update (30 Nov 05) : Added SynEdit, jEdit Tags: Web Developer Blog , Text Editors

Redirect to secure site (ASP)

The following will redirect from http://www.domain.com/path/to/file.asp to https://www.domain.com/path/to/file.asp: VBScript: <% If Request.ServerVariables("HTTPS") = "off" Then Response.Redirect("https://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("URL")) End If %> JScript: <% if(Request.ServerVariables("HTTPS") == "off"){ Response.Redirect("https://" + Request.ServerVariables("HTTP_HOST") + Request.ServerVariables("URL")) } %>

Open maximised window (JavaScript)

The following will open a maximised window, with scrollbars, menubar, but no toolbar (only works with links to pages on the same site - ../folder/file.htm or /folder/file.html not http://www.google.com - Access denied error will occur): function showDocument(sDocURL){ var newwin = window.open(sDocURL,'newwin','scrollbars=yes,toolbar=no,menubar=yes'); newwin.window.moveTo(0,0); newwin.window.resizeTo(screen.availWidth,screen.availHeight); newwin.focus(); return false; } Call function as follows: <a href="../folder/file.htm" onclick="showDocument(this.href); return false">File</a> Will set focus on page and replace any existing page that was called in the same way.

Convert ASP page to Microsoft Word document

Insert the following at the top of an ASP page to convert it to a Word document (Word 97+ required on client desktop). It uses Microsoft Word's HTML parser to generate the page. JScript: <%@LANGUAGE="JSCRIPT" CODEPAGE="1252"%> <% Response.ContentType = "application/msword"; Response.AddHeader("Content-Disposition","attachment;filename=filename.doc"); %> VBScript: <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Response.ContentType = "application/msword" Response.AddHeader "Content-Disposition","attachment;filename=filename.doc" %> Note that only the text will be saved if you save the file to disk (i.e. images will not be downloaded and embedded into the document)

CSS Design

css Zen Garden: The Beauty in CSS Design site layouts done in CSS - all images that are displayed on the page are defined in the style sheet. It shows that you can add images to pages using nothing but CSS. Other CSS Sites: CSS Creator - added on 25/09/2003 Bluerobot Glish css/edge css-discuss - css mailing list house of style the noodle incident

Delete file (ASP)

Delete file using ASP JScript (pass filename on in form [hidden input called 'deletefile'] or QueryString [page.asp?deletefile=myfile.doc]): <% // delete file var oFSO = Server.CreateObject("Scripting.FileSystemObject"); // get path to file (relative to current document) sPathToFile = Server.MapPath("/path/to/upload/folder/"+Request("deletefile")); // if file exists, delete it if(oFSO.FileExists(sPathToFile)) oFSO.DeleteFile(sPathToFile) // file deleted %> Or using ASP VBScript <% ' delete file Dim oFSO, sPathToFile Set oFSO = Server.CreateObject("Scripting.FileSystemObject") ' get path to file (relative to current document) sPathToFile = Server.MapPath("/path/to/upload/folder/"&Request("deletefile")); ' if file exists, delete it If oFSO.FileExists(sPathToFile) Then oFSO.DeleteFile(sPathToFile) ' file deleted %> N.B. Folder must have modify permissions set for the Internet Gu...

Connect to Database (ASP)

The following connects to a database with ASP JScript: <% // create connection var oConn = Server.CreateObject("ADODB.Connection"); // open connection to database oConn.Open(CONNECTION_STRING); // generate SQL sSQL = "SELECT * FROM tablename"; // create recordset from SQL var oRS = oConn.Execute(sSQL); // work with recordset Response.Write(oRS("fieldname")); // close recordset and connection oRS.Close(); oConn.Close; %> And with ASP VBScript: <% Dim oConn, sSQL, oRS ' create connection Set oConn = Server.CreateObject("ADODB.Connection") ' open connection to database oConn.Open(CONNECTION_STRING) ' generate SQL sSQL = "SELECT * FROM tablename" ' create recordset from SQL Set oRS = oConn.Execute(sSQL) ' work with recordset Response.Write(oRS("fieldname")) ' close recordset and connection oRS.Close() Set oRS = Nothing oConn.Close() Set oConn = Nothing %>

Folder Size Browser program

Found this .NET program that shows folder sizes for the various drives in My Computer: Folder Size Browser program . .NET Framework Required Folder Size Shell Extension adds to the properties dialog of all folders the amount of space that is used up - this is good, but a standalone utility (i.e. running off a floppy disk) will also be good.

Blogging

Blogger sites Movable Type - uses Perl (needs hosting account with Perl support) Typepad - hosted service (not free) Blogspot - hosting for Blogger (free) EraBlog.NET - hosted service (free) Upsaid - hosted service (free) b2 - PHP and MySQL needed Nucleus - PHP and MySQL needed Drupal - PHP and MySQL, PostgreSQL or mSQL needed Blogging tools w.blogger - freeware blogBuddy - open source Radio Userland - not free (also offers hosting)

ASP.NET Forums / Groups

Some ASP.NET discussion groups: DevASP www.asp.net forums DotNet Forums Directory of Forums Newgroups (via Google) microsoft.public.dotnet.general microsoft.public.dotnet.csharp.general microsoft.public.dotnet.vb.general microsoft.public.dotnet.languages

.NET Weblogs @ ASP.NET

.NET Weblogs @ ASP.NET - good weblog site with many bloggers. Of interest is Datagrid Girl - using the datagrid in ASP.NET

Google Toolbar 2.0

Google Toolbar 2.0 is no longer beta: http://toolbar.google.com/ Features: Search the web with Google from any site New! Eliminate pop-up ads New! Fill in forms with one click New! Link a weblog to the page you're visiting New! Restrict your search to pages located in a specific country Search just within the pages of a site Highlight search terms on a page

VBScript - Set Homepage (MSIE) / Add Notepad to Send To

The following will set up your homepage (in Internet Explorer) via a VBScript file. Create a blank text file called 'sethome.vbs'. Running it will change your default home page. Useful for setting the home page via a login script (or after some spyware may have changed your homepage). Set WSHShell = WScript.CreateObject("WScript.Shell") ' home page URL StartPage = "http://www.google.co.uk" WSHShell.RegWrite "HKLM\Software\Microsoft\Internet Explorer\Main\Start Page", StartPage WSHShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\Main\Start Page", StartPage This code will add notepad to the Send To menu (when you right click a file). Create a new file called 'sendtonotepad.vbs', containing the following code. Set WSHShell = WScript.CreateObject("WScript.Shell") Set oFSO = WScript.CreateObject("Scripting.FileSystemObject") sWinDir = oFSO.GetSpecialFolder(WindowsFolder) sSendTo = WSHShell.Special...

Overflow PRE tag (HTML & CSS)

Text doesn't wrap with the <pre> tag, so you need to scroll horizontally if there is a lot of text on one line: Nulla neque diam, accumsan nec, egestas non, facilisis sed, wisi. Donec lacinia vestibulum arcu. Suspendisse ligula. Donec tortor. Maecenas pharetra eros at odio. Morbi feugiat tempus orci. Cras vitae tellus. Sed congue nonummy magna. In sed neque id nisl tempus congue. Duis varius egestas tellus. Suspendisse potenti. Nunc rhoncus, eros eget malesuada rhoncus, mi purus pharetra eros, sit amet porta lectus tortor ac erat. In hac habitasse platea dictumst. However, if you wrap it as follows <pre style="overflow: auto; width: 100%">Text</pre> it adds scroll bars when needed: Nulla neque diam, accumsan nec, egestas non, facilisis sed, wisi. Donec lacinia vestibulum arcu. Suspendisse ligula. Donec tortor. Maecenas pharetra eros at odio. Morbi feugiat tempus orci. Cras vitae tellus. Sed congue nonummy magna. In sed neque id nisl tem...

File Functions (JScript):

Various JScript functions for manipulating files: They should all work whichever format you use for the folder (c:\webroot\folder\subfolder\ or /folder/subfolder/) Get files (returned as enumerator): /* sFolder = which folder (e.g. '/folder/subfolder/', 'c:\webroot\folder\subfolder\') return enumerator of files */ function getFiles(sFolder){ // create filesystemobject var oFSO = Server.CreateObject("Scripting.FileSystemObject") // get folder object try{ var oFolder = oFSO.getFolder((sFolder.indexOf("/")==-1)?sFolder:Server.MapPath(sFolder)) }catch(e){ // if error occurs return blank enumerator return new Enumerator() } // create enumerator for files var eFiles = new Enumerator(oFolder.Files) // return files list return eFiles } Get file name: /* sPTF = path to file, bExt = include extension, default yes returns filename as string */ function getFileName(sPTF,bExt){ // new method using filesystemobject if(bExt!=false) bExt = tr...

SQL: Date Searching

Just some useful tips for searching on date fields (Microsoft SQL Server 2000+): You can use the LIKE operator to do a search: SELECT * FROM [tablename] WHERE [datecolumn] LIKE '%Aug%2003%' This would match everything that had August 2003 in datecolumn e.g. August 12 2003, August 18 2003 The other way is to use DATEPART as follows: SELECT * FROM [tablename] WHERE DATEPART(month,[datecolumn]) = 8 AND DATEPART(year,[datecolumn]) = 2003 The final way is to use MONTH and YEAR : SELECT * FROM [tablename] WHERE MONTH([datecolumn]) = 8 AND YEAR([datecolumn]) = 2003 N.B. If you use DATEPART , MONTH , or YEAR , the supplied value has to be numeric (8 instead of August)

Javascript: Remove Items from Array

I required some javascript for removing an item (or series of items) from an array. Thankfully, I found out how to do it from this thread in Google Groups. e.g. (paste into HTML document): <script language="javascript"> // this is the original array var theArray = [17,2,5,675]; // these are the items I wish to remove from the array var toRemove = [17,2]; // it can be done with one item only as well // var toRemove = 5; // adding it as a prototype object enables it to be used from any array Array.prototype.removeItems = function(itemsToRemove) { if (!/Array/.test(itemsToRemove.constructor)) { itemsToRemove = [ itemsToRemove ]; } var j; for (var i = 0; i < itemsToRemove.length; i++) { j = 0; while (j < this.length) { if (this[j] == itemsToRemove[i]) { this.splice(j, 1); } else { j++; } } } } theArray.removeItems(toRemove); alert(theArray); ...

First Weblog - Toolbars

This weblog was set up using Google Toolbar BETA 2.0 . Best feature of this is probably the popup blocker (no need for installing standalone software for doing the same thing, IE 5.5 and up only). Some other useful toolbars: The Dictionary.com Toolbar is also very good - online dictionary and thesaurus search. DevelopersDex Toolbar for developers in ASP , C# , SQL , VB and XML . Lots of examples, articles and tutorials are available in the DevelopersDex Site as well as the possibility to post to USENET (Newsgroups). The toolbars for Internet Explorer only