Archive

Archive for the ‘Programming’ Category

Disabling the Return Key in Forms

February 15th, 2007 ^Lestat No comments

I had a few forms that included a delete button, and also a submit button together. Having filled out forms myself I have a habit of hitting the return key. I dug up an old form I made a few years ago and found this bit of javascript to disable the key. It doesn’t disable it 100%, but only when it doesn’t have focus. So it can still be tabbed to and then the return key will work. A mouse click will do at any time…

<html>

   <head>

   <!-- disable return key -->

   <script language="JavaScript" type="text/javascript">

	   function checkCR(evt) {
		   var evt  = (evt) ? evt : ((event) ? event : null);
		   var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
		   if ((evt.keyCode == 13) && (node.type=="text")) {return false;}
	     }

	    document.onkeypress = checkCR;

   </script>

   </head>

<body>...

</body>

</html>

javascript, forms, return key

Categories: General Interest, Programming Tags:

Looking for a file folder image

April 24th, 2006 ^Lestat No comments

I’ve been searching the web over an hour now looking for an image for a file folder to be used in a php FTP script I’m creating. Do any readers have suggestions where I could find such an animal? The closest I’ve come was a pay site over at istockphoto.com. I might add that I’m looking for something a little schnazzy like an OSX look. An ‘open’ version and a ‘closed’ version.

Update 10:57am I was able to locate a nice set of clipart at openclipart.org. Most of them are vector images too!
Suggestions? URL’s? Pointers??

Categories: Computing, General Interest, Programming Tags:

REGEX Library

March 9th, 2006 ^Lestat 2 comments

I was working up a form and needed to come up with an email regex. I know by now I probably should have my own regex library, or even be able to write my own – but I haven’t exercised my regex skills enough. Often time doesn’t allow an extensive learning period when your already half way through creating a form!

I came across this great regex library at regexlib.com. It’s searchable, offers on the fly tests of user contibuted regular expresssions, rss feeds of recently added patterns, and contains a Cheat Sheet for regex reference.

Of course, programmer beware. Be careful copying and pasting code. And definately test that code before you implement it.

regex, php

Categories: Programming, php, php Snippets Tags:

Code Search Engine With Plugins

February 15th, 2006 ^Lestat No comments

In the line of search engines Brandon pointed out, I am liking the koders.com search engine. You can search for code in all different kinds of languages. They have a firefox plugin as well as code to embedd the search on your site. Enter a snippet of code, or a function and try it out:


, code, code search, programming, koder

Categories: Computing, Internet, Programming Tags:

New Search Engine Designed For Programmers

February 14th, 2006 ^Lestat 3 comments

Currently in Beta and soon to be released is a search engine available for programmers and coders.

Krugle boasts:

Unlike conventional search engines, Krugle is designed to locate code. Krugle supports code search by crawling, parsing and indexing code found in all open source repositories, as well as code that exists in archives, mailing lists, blogs, and web pages.

According to their page you can search repositories, pages and resources that offer relevent code. You can even add comments to code, save and share the query’s. It also will deliver basic “basic API information about highlighted portions of code”.

By the sound of it, it looks like a stand alone ap.

You can signup for it at thier site to get a copy as soon as it’s live. I’m definately looking forward to it! I wish I had seen this sooner. I would love to have seen this Beta.

search engine, krugle

Categories: Computing, Programming Tags: