Archive for the ‘Web Design’ Category

PHP Weekly (May 18, 2008)

Today, were talking about dates, specifically getting the difference between two dates.

We will be using GregorianToJD(); which converts a Gregorian date to Julian Day Count.

This is handy when you need to find out how many days have passed since a specific date or the difference in days between two dates.

Here is an example:

  1. dateDiff('8','25','1975','2','26','2004');
  2.  
  3. function dateDiff($m1,$d1,$y1,$m2,$d2,$y2)
  4. {
  5. $date1 = gregoriantojd($m1,$d1,$y1);
  6. $date2 = gregoriantojd($m2,$d2,$y2);
  7.  
  8. $diff = $date2 - $date1;
  9.  
  10. echo $diff;
  11. }

Above is a simple function that you send in to dates and you get back the difference in days. Simple, but can be very useful.

Posted by mnoga on May 17th, 2008 No Comments

Google App Engine giveth and then takes it away….

Google App Engine no worky

So I received my invitation to Google’s App Engine last night, actually I got three of them, but their not invite codes or anything like that, the invites are tied to your email address so don’t bother asking me to give you one.

One major problem though, when I click on the link in the emails, up pops a web page telling me space is limited and asking me if I would like to be notified when more space becomes available.

Umm, I thought thats what the email was all about, the subject even says “Invitation to try Google App Engine”. Something not working quite right in Google land today……

I guess it’s back to the waiting game. I supposed I can use this time to brush up on my Python skills.

UPDATE - May 6 2008

Nick Johnson suggeested a different login URL for those who signed up for Google App Engine with an and email on a Google Hosted Domain, which is what I did. I use Googel Hosted Gmail for realdimensions.com.

http://appengine.google.com/a/yourdomain

This worked perfect for me, I’m not logged in and working on my obligatory “hello World” app. I’ll post more when I have something to show (and say).

Thanks for the suggestion and link Nick!!!!

Posted by mnoga on May 4th, 2008 2 Comments

Google Gears, a new home for Web Apps

Google has announced a new toolkit and set of browser extensions that allow web applications to run on your desktop (but still in the browser) without an internet connection. Google Reader is already running Google Gears.

You can get the browser extensions here. They have them for both IE and Firefox on Mac, Linux and Windows.

I’ve read how others are wondering why Google made this when Adobe already has Apollo and Joyent had Slingshot. Well for starters Joyent’s Slingshot is for Ruby on Rails apps only and Adobe’s Apollo, while do you don’t “need” to use Flash it really is directed more towards the Flash and Flex developers. On top of this Google Gears is the only one out (in bete, but they are all in bete) that works in Both Major Browsers , Firefox and IE, and also works on all three major platforms.

Initially, the tools will enable Google Reader to work off line, but the more obvious candidates for off line use are the documents and spread sheeting applications. I expect this in the not too distant future. As well as anything that any one else wants to develop.
And one of the really cool things is that Google Gears is open source software, licensed under the New BSD license. This license is very permissive.

If your looking got he plug-in you can get info here.

If your a developer you can get more info here.

Hopefully I will have some time to build something with and, if I do I will post it for anyone interested in taking a look. If anyone has any ideas for a great Web application that needs to be taken off line as well, let me know.

Posted by mnoga on June 4th, 2007 No Comments

Rails link with a class

  1. <%= link_to "Some Page", { :controller => 'controller_name', :action => 'action_name' }, :class => 'your_class' -%>

Posted by mnoga on April 4th, 2007 No Comments

Hidding email addresses from Spammers

Spam is already out of control and it’s virtually impossible not to get any spam. But there are ways to help prevent your address from being copied from your website. I use a little JavaScript.

Here is the function that I have in my utilities.js file;

  1. function showAddress(add) {
  2. address_to_replace=document.getElementById(add).firstChild;
  3. real_address=address_to_replace.nodeValue.replace("_at_", "@");
  4. address_to_replace.nodeValue=real_address;
  5. address_to_replace.parentNode.setAttribute("href", "mailto:"+real_address);
  6. }
  7. }
  8. window.onload = function() { howAddress('email1'); }

Then all you need to do is create your mailto link like this;

  1. <a id="email1">me_at_mydoamin.com</a>

Now when the page loads this JavaScript function will replace this text “_at_” in the element with an ID of “email1″ with an @ symbol.

This prevents bots and spiders from finding your email address.

Posted by mnoga on February 4th, 2007 No Comments

New Service and website to go with it!

I just finished a new website geared towards offering a new service. The website is called Bake it! offering Web Design Conversion.

What does that mean, well you give me your design and I will turn it into a Standards Compliant web page, it’s that simple.

Take a look, you can find it at http://www.Bakeit.ws

Posted by mnoga on February 4th, 2007 No Comments

IconBuffet Free Delivery trading

I signed up for an account with IconBuffet, it’s a great resource for high quality Icons and illustrations for use in Website, Applications and software.

They have a great feature called Free Delivery where once a month you will get a free set of Icons. But not everyone gets the same Icons. They do allow you to share them with up to five other people per set.

So I would like to start a trading session for Icons, I will list the ones I have and you can post a reply to this telling me what set you want an what set you can give me, now I would really appreciate getting a set in return but if you ask really nicely maybe I will send you the set you want for nothing in return.

Update:

I received a duplicate set of Icons so I am posting the link to claim the Blinksale set here.
This one is Taken

http://www.iconbuffet.com/deliveries/fb655751fc67f7ee

Here are a few more;

Yuletide Snow - http://www.iconbuffet.com/deliveries/131d7924653f3926

Alexandria Cosmonauts - http://www.iconbuffet.com/deliveries/7b3cd949951df60a

Dresden Auto - http://www.iconbuffet.com/deliveries/91e96a60dd6c62f6

I just want to see how long it will take someone to claim it. All I
ask is that you leave me a comment, nothing big just a simple thanks
will do.

Posted by mnoga on January 11th, 2007 3 Comments

Basic HTML - a brief explanation

To start out with there are 2 main sections of an HTML document (aka - a web page). The HEAD and the BODY. Using these two section you have a standard skeleton for your HTML document. Here is an example below;

  1. <html>
  2.        <head>
  3.            <title> </title>
  4.           HEAD Content Here
  5.        </head>
  6.        <body>
  7.            BODY Content Here
  8.        </body>
  9.     </html>

Now, lets take a close look at each part of the HTML document.

For starters, the whole document should be wrapped inside of the <HTML> </HTML> tags. You will notice that the is one at the beginning as well as the the end, the only difference between them is the / in the end one. This / is used to close a tag. All HTML tags should be closed, either by using a close tag such as the </html> or for some tags that do not have a close to them you close it with in it’s self. You will learn over time which way to close each tag.

Examples;

Tags with closing tags;

  1. <html> </html>
  2. <p> </p>
  3. <table> </table>

Tags that do not have a close tag (you close these with in it’s self);

  1. <br />
  2. <meta />
  3. <hr />

Ok, now lets look at the HEAD section.

Anything you put in the HEAD section will not show up in the browser. This is where you put your <style> tags for using CSS, and your <script> tags when working with JavaScript, and all your <meta> tags. I will try to get into what each of these are in other posts.

This is also where you set the title of your web page using the <title> tag. This is one of those tags that has a close tag with it (<title>Your Title</title>). What you enter in the title tags is what shows up in the browsers title bar. Like if you look up at the tile bar right now, you will see “MichaelNoga.com << Blog Archive << Basic HTML - a brief explanation. Normally you would want to keep this title short and relevant to the info on that web page. It will help with search engines as well.

And now, the BODY section.

The BODY is where all your content goes, everything you want visitors to see goes right here. What you’re reading right now is content between the BODY tags. I will get into more detail about how to format your content and what other HTML tags you can use to make it look good.

As always, let me know if you have any questions for would like to request a topic for me to cover.

Posted by mnoga on November 13th, 2006 No Comments

Clearing an SWFObject Instance

A coworker of mine today was having trouble dynamically loading a Flash movie using the SWFObject. Actually he was having problems loading a new one once the first one was loaded.

Here is the situation, the web page loads, the user clicks a link (any trigger will work just fine) to load the first movie. Then the user clicks a different link to load a different movie, but nothing changes. The SWFObject will not let go of the div that it was loaded into. Heres how you get around this.

You first remove the child div from the DOM then recreate the div before the SWFObject tries to load the flash movie in it.

  1. function loadvid(thefile, theCatagory){
  2.     var div = document.getElementById('clipPlayer');
  3.          div.parentNode.removeChild(div);
  4.     var newdiv = document.createElement(div);
  5.          newdiv.setAttribute('id','clipPlayer');
  6.          newdiv.innerHTML = '';
  7.          document.body.appendChild(newdiv);
  8.     var so = new SWFObject('best_player.swf', 'clipPlayer', '250', '65', '6', '#ffffff');
  9.           so.addVariable('clipName', thefile);
  10.           so.addVariable('clipInfo', theCatagory);
  11.           so.addVariable('cacheKill', '');
  12.           so.write(&quot;clipPlayer&quot;);
  13. }

The only problem with this is that when it recreates the div it does so at the bottom of the page. I will work on how to place the div where you need it.

Posted by mnoga on November 2nd, 2006 No Comments

Open links with Firefox by right clicking

While developing web sites and applications I primarily use Firefox, but I don’t have Firefox set as my default browser. I do this for an important reason, by leaving IE as my default browser I often just double click on files to view them and they open in IE. This reminds me (forces me) to test my pages in IE.

However, there are many occasions where I really just want to view the link or file in Firefox so having a right click context menu item to allow this would be great., and here is how you can make one.

Just be careful, this is a registry hack!!!

Open a text file, I use notepad, and add the code below to it;

REGEDIT4

[HKEY_CLASSES_ROOTInternetShortcutshellFoxOpen]

@=”Open with Firefox”

[HKEY_CLASSES_ROOTInternetShortcutshellFoxOpencommand]

@=”\”C:Program FilesMozilla Firefoxfirefox.exe\”\”%l\”"

If you did a custom install of Firefox you will have to change the last line to the location of your firefox.exe file. Make sure you use the double slashes as I have. Now save the file as “FFopen.reg” and double click on it, click OK on the pop up and you’re all set. If the file just opens and you see the text you entered then the file extension was not changed to .reg and is still .txt. Try saving the file again and this time include the quotes “FFopen.reg”, this will force notepad to save it as you named it and not FFOpen.reg.txt.

Now when you right click you should see an extra menu item that says “Open with Firefox”

Posted by mnoga on September 5th, 2006 5 Comments