• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

My Monkey Do

A Log of Coding Solutions

  • Home
  • Web Hosts
  • Tools
  • About

No Multiple Upload for IE

May 22, 2011 by Webhead

Problem:

I wanted a way for users to upload multiple files to a server on a webpage.  I found a great jQuery plugin that does drag & drop and multiple file upload.   Under browser support you can see that IE is supported, however there are special notes.  MSIE does not support drag & drop and multiple file support.  So basically, the script works with IE where users can upload 1 file at a time.

 

Solution:

From my research, it turns out that it is impossible to do multiple upload (same goes for drag and drop) to IE.  The browser just simply does not support it.  There are many scripts out there that say “multiple upload” and say it works with IE, but it’s not truly multiple file upload.  The script actually just allows you to upload multiple files with one request, not select multiple files at one time.  So in other words, the file browser opens and you can only select one file.  Then you can open the file browser again and select another file.  If you had 10 files, you would have to repeat this process 10 times instead of just highlighting multiple files if it had true multiple file support.

Anyway, that is the “workaround” which is not acceptable for me.  So IE users just won’t have a multiple upload feature in my project.

Filed Under: Coding Tagged With: IE crap, javascript

VARCHAR vs TEXT Performance

May 21, 2011 by Webhead

Ever wonder if VARCHAR(255) or TEXT is a better data type?  This thread suggests VARCHAR(255) is better because it is allowed to use MEMORY (or RAM).  The TEXT data type is not allowed in there.

http://forums.mysql.com/read.php?24,105964,105964#msg-105964

 

Although it was also found that a larger VARCHAR like VARCHAR(3000) has worse performance than TEXT (in MyISAM).

http://nicj.net/2011/01/20/mysql-text-vs-varchar-performance

 

The general rule appears to be to use VARCHAR if it is less than 255 characters and to use TEXT if it’s 255 or more.

Filed Under: Coding Tagged With: mysql, optimize

Optimize MySQL using EXPLAIN

May 20, 2011 by Webhead

If you need to optimize or find out how a MySQL query is doing, type in “EXPLAIN” before the query and you’ll get a table that shows a bunch of statistics.  I’m not going to try to explain them all.  It can be found on the MySQL docs site:

http://dev.mysql.com/doc/refman/5.0/en/explain-output.html

Filed Under: Coding Tagged With: mysql

Diff Merge

May 19, 2011 by Webhead

DiffMerge is an application to visually compare and merge files within Windows, Mac OS X, and Linux.  Best of all it is free! as in it’s free for you to use, you don’t need to pay anything, ever.  This is a very useful tool when you are trying to find a differences between two files.  You can use it as an external tool for CVS or SVN when diff-ing multiple versions.  Other features include:

  • Graphically shows differences between two files
  • Side by side comparison between two folders
  • Right click and compare two files in Windows Explorer
  • Configurable
  • Compatible with 42 different encodings
  • Cross-platform (Windows, Mac, Linux)

The best feature that makes DiffMerge stand out against the rest of the diff tools is their Folder Diff.  I work on a project I work on multiple files at a time and I loose track of what file I touched.  If I ever need to see the changes I’ve made in an entire folder, DiffMerge can easily show me that.

DiffMerge can be downloaded here: http://www.sourcegear.com/diffmerge/index.html

Filed Under: Tools

Favicon

May 17, 2011 by Webhead

Problem

When the simplest things don’t work it can drive you nuts.  I had a task to add a favicon to a website so that it shows in the browser.  To do this all I thought I had to do was get the PNG, convert it to a .ICO file on one of the many online converters and place it in the home directory of the website.  What do you do when the image shows at http://mydomain.com/favicon.ico but doesn’t show as the browser’s page icon?

Solution

  • Clear the browser cache
  • Make sure you have the link tag in the <head> part
    <link REL="SHORTCUT ICON" HREF="/favicon.ico">
  • Go here and make sure your icon is up to the standards

When I looked at Firebug I saw that there was a tag <link rel=”icon” href=”” type=”image/x-icon” >.  I thought it was a little strange, but I also thought Firebug was just interpreting the icon location since it wasn’t in the source code I was looking at.  (Firebug shows the real-time values of elements instead of the actual code.  ie. if you use javascript to move an element, it will show the new coordinates instead of the original ones).

After a while, I found the website that validates favicons.  Once I saw that extra “image/x-icon” again, I looked through my PHP code and saw that it was including that, which is why I didn’t see it in the main html code.

Filed Under: Coding Tagged With: html

TrueCrypt

May 16, 2011 by Webhead

TrueCrypt is an amazing free open source tool that allows you to encrypt files very easily.  Anyone can do it as long as you can remember your password.  It acts like another drive on your computer so you can view edit and delete the files as if it’s a normal drive.  Any files copied into the “drive” gets encrypted on the fly.  Once you’re done with the files you can dismount the drive and that’s it.  Best of all you can transfer the “drive” from a Mac to a PC without any hiccups.

Usage

I have company passwords that I share with a few other people.  Some are on Macs, some are on PC.  We don’t have an intranet or local server so what we do is we store all of our passwords in a TrueCrypt file which is stored on Google Docs.  That way all of us have access to it and if the file were to be compromised the file would be of no use without the file’s password.

So my typical usage of this is:

  1. Download the TrueCrypt file from Google Docs
  2. Open TrueCrypt
  3. Select the file in TrueCrypt
  4. Click a button and type in the password.
  5. View/edit/whatever to the files within what appears as another drive.
  6. Click on Dismount when done.
  7. Reupload the TrueCrypt file to Google Docs.

Looks like a lot of steps, but I just listed out each and every button press.  Anyway if you want to know more, you can head on to TrueCrypt’s website.

Filed Under: Tools

  • « Go to Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 36
  • Go to page 37
  • Go to page 38
  • Go to page 39
  • Go to page 40
  • Go to Next Page »

Primary Sidebar

Topics

apache apple bootstrap buddypress chrome cloudways cms css debug drupal eCommerce firebug firefox git gmail goDaddy google hosting htaccess html html 5 IE crap image iPad iPhone javascript jquery kinsta linux localization mac os x ms sql mysql open source optimize php php 7.2 svg tinymce woocommerce wordpress wpengine xss yii youtube




Categories

  • Coding
  • Off the Shelf
  • Plugins
  • Random Thoughts
  • Server Stuff
  • Tools
  • Uncategorized