Easter Eggs with a twist

My daughters gave dying eggs with some of my old silk neckties a try. The warmer colors like red came out really nice, even captured the patterns on the tie. Blues didn't do as well.  

Tumblr_m24ya5zu331qz5s0io1_1280

The process is super simple, just wrap up the egg in the tie, tie it with string and boil. 

Here is a Blog post with more details on the process => http://www.mommyknows.com/silk-tie-dye-easter-eggs-tutorial/

 

 

Posted via email from shocm

Seeing the world through rose colored Goggles

20111019_071701

 

I am close to tech, very close, and sometimes in my field we do things for the enjoyment of technology. Sometimes we do things to see if it can be done, how cool it is when it is done, and what we had to do in order to get it done. However, sometimes we also loose sight of the real world use cases of a particular technology. I recently had that happen to me and thought I would share the story of how Google Goggles brought peace into our house. (Ok, that might be a little dramatization but you get the point.) 

My wife loves to scrapbook. She's been doing it for years and she is pretty good at it. She enjoys it so much she will scrapbook other peoples pictures. I use to tell her she should think about doing web layout designs because it was very similar and we could us it as "together time". Her reply was "maybe you should learn scrapbooking"... I didn't approach that topic again, point was taken. When she scrapbooks for other people she gets pictures in all sorts of different states. Some are very organized with detailed information or what, when, and where a picture was taken, sometimes its just a box off random photos. 

My wife has learned that when I am coding not to worry or concern herself with the signs of frustration I may display and sometimes the colorful language I may use when in such a state of mind. As I have learned the similar lesson when she scrapbooks so when she was showing some of those signs of frustration with her latest project it wasn't unusual. She had received a bunch of photos of a families vacation that spanned a bunch of locations around the world. She was told the family had gone to China and then Italy but that this was over 5 years ago and no one was sure of exactly which landmarks they had photographed. 

The wife had spent days trying to decode what were in the photos and where they were taken. In one of her moments of frustration she says "I need to be able to feed these pictures into a computer and have the computer tell me what they are. Can you please write something like that." My reply went something like, "Sure honey I will get right on that .... Hey wait a minute, I think that already exist" I pulled out my HTC Evo running Android and asked her to give me a picture. I had seen that look she flashed me before, the look that borders on "you are full of BS" and "don't waste my time". I tell her, "No I am serious, give me a photo of something you can't identify" She hands me a photo of some old ruins with pillars. Nothing really special about the photo and nothing really stood out to me. I fired up Google Goggles on my Evo and scanned the picture and almost instantly it returned the results "Pompei Basilica, Pompei, Italy". We just looked at each other and said "COOL!", but was it right? We clicked on the link that Goggles presented to us in the results and sure enough there was another, almost exact same photo, on a site talking about the ruins. 

The wifes face lite up. "Let's do another". We did a couple more and thing were looking good until we ran into a little snag, "The Parthenon". The problem was the Parthenon was in Greece, not Italy. "No one mentioned a visit to Greece" the wife said. We did some research and it really seem liked Goggles properly identified it. We scanned some more and would run into more landmarks from Greece, then Istanbul, Turkey. Two places never mentioned to the wife that were part of the trip. Needless to say this dramatically impacted the scrapbook layout she was working on but she was ecstatic about the new tool she found. She managed to scan her entire book in less that an hour, catch, and make several geographical corrections. 

Wife walked away with a new appreciation of technology and I got to feel like a little bit of a Super Hero for a few hours. Just thought it was a cool series of events and thought I would share it.  

Posted via email from shocm

Getting some functionality back in the system tray on Ubuntu 11.04

Ubuntu 11.04 introduced a new, cleaner user interface called Unity. I'm not a huge desktop GUI guy, doing a large majority of my work in the command line, but I do like to try and stay current on the latest greatest interfaces.

I'm not overwhelmed with Unity. It's OK but not really earth shattering. You have the option to switch back to the "classic" Gnome interface if you wanted to but I haven't done that.

One huge annoyance I've noticed about the new Unity interface was a lack of a true "system tray". Many application in Ubuntu (or Linux in general) leverage a similar approach Windows machine do and allow applications to run in a System Tray, cleaning up any task bars you might have. In Unity, there were a couple applications that were visible, like Dropbox, the clock and Volume but several others were not such as Skype and Truecrypt.

This became a big problem for Truecrypt because once I closed the Truecrypt interface I couldn't figure out how to get back to it. If I tried to launch the application again the system would report that it the application was already running, which it was. In the past I would get back to the interface through the icon in the system tray but this icon would not display in Unity, at least not until I found a posting on Facebook http://www.facebook.com/topic.php?uid=6723083591&topic=17003

This simple command in a terminal window corrected my problem and life is good again

  1. gsettings set com.canonical.Unity.Panel systray-whitelist "['all']"

As you can see I got all my system tray icons back and I am now a little happier with Unity.

 

Screenshot-1

 

Posted via email from shocm

Why the Open Source Development Model Works

I’ve stumbled across this video several time, most recently on a blog post of an extremely talented developer and someone I’ve had the pleasure of working with.

If you’re not a developer it can be kind of hard to wrap your head around what is being outline but if you stop thinking of what is being talked about as work and more as a something you enjoy doing it makes more sense. They make a great reference comparing work to music in the video but it could be anything, painting, gardening, working on your car. The thing a lot of non-developers (managers, bosses, what have you) don’t get is that some of us in the IT field do this because its what we enjoy doing. I wasn't always in IT, at one time I was in a completely unrelated industry and even during that period, my free time was doing some sort of development or general computer hacking. Not because it was going to move me up in the company I was working at but because it was what I wanted to do in my free time and has been that way since my Dad got me a TRS-80 for Christmas ’85.

This is why Open Source Development works. Not because there is a big carrot hanging at the end of the stick, but because there is a passion and thirst for knowledge. The reward structure in Open Source is always difficult to explain to people but this video does a great job at capturing some of the attributes that does drive Open Source Development.

Posted via email from shocm

Reposting a great article I can across for all my PHP buddies out there who want to use Vi for development

The original posting can be found here

http://hameedullah.com/howto-setup-vim-ide-for-php-development.html#

Enjoy

Howto Setup Vim IDE for PHP Development

Howto Setup Vim IDE for PHP Development
As a PHP developer one has quiet a lot of choices of IDE. Some are graphical will built-in features like debugging, code completion, auto indentation, syntax highlighting, code checking and many more. But those IDEs are very heavy and slow to use, and I know many people like me who just can’t live without Vim and want to use Vim for all type of text editing they do, whether they are writing code, editing configuration files or may be creating simple text files.

Recently I posted a screenshot of my Vim editor and got a lot of emails that how did I setup Vim that way. So, I hope this howto will be easy enough for everyone to follow and setup their Vim as their PHP  IDE. For the sake of simplicity I am assuming you are using Vim on Linux or Linux like system. If you are a windows user then this guide should still work for you, but I might not be able to provide Windows related details where needed.

Features that we will add or enable in Vim to make it a complete IDE.

  • Code Completion
  • Tag Lists
  • Project Management
  • Syntax Highlighting
  • Code Checking

First we need to download following Vim scripts and extract them in our ~/.vim directory.

Download above scripts one by one and install them. Installing them is easy just unzip them in you .vim directory which is located in your home directory. Now we need to download few files in our .vim/plugin directory. Download the following Vim scripts directly into your .vim/plugin directory.

Now that you have installed above scripts, you are almost all set to go. You just need to paste the following content in your .vimrc file which is located in your home directory.

[bash]
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" ~/.vimrc "
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" "
" Version: 0.1 "
" "
" "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" Hightlight the ifs and buts
syntax on

" Plugins and indentation based on the file type
filetype plugin indent on

" Don't remember source of this, i think it was already in my .vimrc
" Tell vim to remember certain things when we exit
" '10 : marks will be remembered for up to 10 previously edited files
" "100 : will save up to 100 lines for each register
" :5000 : up to 5000 lines of command-line history will be remembered
" % : saves and restores the buffer list
" n... : where to save the viminfo files
set viminfo='10,"100,:5000,%,n~/.viminfo

" omnicomplete from: http://vim.wikia.com/wiki/VimTip1386
set completeopt=longest,menuone
inoremap <expr> <CR> pumvisible() ? "<C-y>" : "<C-g>u<CR>"
inoremap <expr> <C-n> pumvisible() ? '<C-n>' :
'<C-n><C-r>=pumvisible() ? "<lt>Down>" : ""<CR>'

"###########################
"## PHP ##
"###########################
" The php doc plugin
" source ~/.vim/php-doc.vim
inoremap <C-P> <ESC>:call PhpDocSingle()<CR>i
nnoremap <C-P> :call PhpDocSingle()<CR>
vnoremap <C-P> :call PhpDocRange()<CR>

" run file with PHP CLI (CTRL-M)
:autocmd FileType php noremap <C-M> :w!<CR>:!/usr/bin/php %<CR>

" PHP parser check (CTRL-L)
:autocmd FileType php noremap <C-L> :!/usr/bin/php -l %<CR>

" Do use the currently active spell checking for completion though!
" (I love this feature 🙂
set complete+=kspell

" disable tabs
set expandtab
set shiftwidth=4
set softtabstop=4

" highlt matches
set hlsearch

" Taken from http://peterodding.com/code/vim/profile/vimrc
" Make Vim open and close folded text as needed because I can't be bothered to
" do so myself and wouldn't use text folding at all if it wasn't automatic.
set foldmethod=marker foldopen=all,insert foldclose=all

" Enable enhanced command line completion.
set wildmenu wildmode=list:full

" Ignore these filenames during enhanced command line completion.
set wildignore+=*.aux,*.out,*.toc " LaTeX intermediate files
set wildignore+=*.jpg,*.bmp,*.gif " binary images
set wildignore+=*.luac " Lua byte code
set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest " compiled object files
set wildignore+=*.pyc " Python byte code
set wildignore+=*.spl " compiled spelling word lists
set wildignore+=*.sw? " Vim swap files

" Enable completion dictionaries for PHP buffers.
autocmd FileType php set complete+=k~/.vim/dict/PHP.dict

" PHP Autocomplete
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
set ofu=syntaxcomplete#Complete

" You might also find this useful
" PHP Generated Code Highlights (HTML & SQL)
let php_sql_query=1
let php_htmlInStrings=1
let g:php_folding=2
set foldmethod=syntax

" --------------------
" Project
" --------------------
map <A-S-p> :Project<CR>
map <A-S-o> :Project<CR>:redraw<CR>/
nmap <silent> <F3> <Plug>ToggleProject
"let g:proj_window_width = 30
"let g:proj_window_increment = 150

nnoremap <silent> <F8> :TlistToggle<CR>
let Tlist_Exit_OnlyWindow = 1 " exit if taglist is last window open
let Tlist_Show_One_File = 1 " Only show tags for current buffer
let Tlist_Enable_Fold_Column = 0 " no fold column (only showing one file)
let tlist_sql_settings = 'sql;P:package;t:table'
let tlist_ant_settings = 'ant;p:Project;r:Property;t:Target'

" auto change directory from: http://vim.wikia.com/wiki/Set_working_directory_to_the_current_file
autocmd BufEnter * if expand("%:p:h") !~ '^/tmp' | lcd %:p:h | endif

" when we reload, tell vim to restore the cursor to the saved position
augroup JumpCursorOnEdit
au!
autocmd BufReadPost *
if expand("<afile>:p:h") !=? $TEMP |
if line("'"") > 1 && line("'"") <= line("$") |
let JumpCursorOnEdit_foo = line("'"") |
let b:doopenfold = 1 |
if (foldlevel(JumpCursorOnEdit_foo) > foldlevel(JumpCursorOnEdit_foo - 1)) |
let JumpCursorOnEdit_foo = JumpCursorOnEdit_foo - 1 |
let b:doopenfold = 2 |
endif |
exe JumpCursorOnEdit_foo |
endif |
endif
" Need to postpone using "zv" until after reading the modelines.
autocmd BufWinEnter *
if exists("b:doopenfold") |
exe "normal zv" |
if(b:doopenfold > 1) |
exe "+".1 |
endif |
unlet b:doopenfold |
endif
augroup END

" PHP code sniffer
" If code sniffer is installed you can run it on current php file by running
" :Phpcs
function! RunPhpcs()
let l:filename=@%
let l:phpcs_output=system('phpcs --report=csv --standard=YMC '.l:filename)
" echo l:phpcs_output
let l:phpcs_list=split(l:phpcs_output, "n")
unlet l:phpcs_list[0]
cexpr l:phpcs_list
cwindow
endfunction

set errorformat+="%f"\,%l\,%c\,%t%*[a-zA-Z]\,"%m"
command! Phpcs execute RunPhpcs()
[/bash]

Thats it, now you are all set to go. Following are the few quick commands to get you started to use all the features you have just enabled in your Vim IDE.

F3: To start using project manager.
C: After starting project manager this key combination will allow you to add new project.
F8: Tag list window
Ctrl+L: To run the syntax checking on your php file
Ctrl+P: On any class/function definition to add php doc strings
“:PhpCs”: To run PHP Code sniffer on your php script. (this requires code sniffer to be installed).
Ctrl+n: On any word to use Auto completion feature of PHP.

I will soon write another howto to explain how can you use further features of your IDE. You should subscribe to the feed or follow me on twitter to stay updated. :)

Posted via email from shocm

My Non-Open Source (Proprietary) Guilty Pleasures

Being an "Open Source" guy there is a certain stigma that goes along with that title, one being that everything you use has to be Open Source. Where I take great pride in the knowledge there isn't really any aspect of my digital life I couldn't do without an Open Source solution, I personally don't necessarily make Open Source a "requirement". I always look for the best solution and tool for a particular task, for me freedom and access to the code weighs heavily in that decision but is not the only parameters in picking a solution.

In the interest of full discloser, and because there are people who enjoy pointing out when they "catch me" not using Open Source (as if I don't know), I present to you a list of my Non-Open Source guilty pleasures that I use frequently (with some justification for using them)

Note: with the exceptions of OSX and the Microsoft products all solutions below do offer free versions of their products though I typically pay for the upgraded products.

Desktop

  • Evernote (http://www.evernote.com) - There are several alternatives to Evernote, including Open Sources ones such as Tomboy but they all seem to lack either features or cross platform compatibility. Evernote does have a OSX and Windows client but no client for Linux which has always been a huge draw back. Evernote does have a pretty good web interface, which continues to improve and this helps a lot when I am on my Linux desktops. Evernote also have a lot of open APIs and there has been some activity to writing alternative Evernote clients that will run on Linux desktops including one I've checked out called Nevernote (http://nevernote.sourceforge.net/)
  • Navicat (http://www.navicat.com/) - I simple like this tool. The user interface and feature set is wonderful. There are tons of Open Source GUI clients to connect to MySQL database and even though 99% on my database activity is connecting to a MySQL backend every now and then I need to connect to MSSQL, Oracle, or PostgreSQL and my Navicat Premium allows me to do this in one client. It also has a wonderful feature of establishing my MySQL connections over SSH which I love when I need to work on my Windows boxes. It's baked in so I don't have to establish my own separate SSH tunnel. They also have clients for Windows, OSX, and Linux
  • Dropbox (http://db.tt/AyOLUYV) – I have to be honest, I’ve used Dropbox for several years but it is always on my hit list to move to an alternative Open Source solution. There seems to be a new one that drops every month. When I get comfortable with the staying power and feature set that Dropbox offer, I will probably drop Dropbox.
  • OSX (http://www.apple.com/macosx/) - This is really a decision of convince than anything else. There are typically a greater number “vendor support” desktop application that are not support on Linux desktops such as the previously mentioned Evernote. However OSX is BSD at heart and lets me retain a lot of the Open Source tools I am accustomed to on my Linux desktop including a very power command line and scripting ability. My OSX desktop also affords me the unique benefit of running virtualization software such as Virtualbox (http://www.virtualbox.org/) and allow me to run Windows, several Linux distributions, and OSX all on one physical machine. This is really nice especially when needing to do testing.

Continue reading My Non-Open Source (Proprietary) Guilty Pleasures

Powerful Validation from Respect

All developers have had to, and one time or another, write a validation class. Over the years, I've personally tweaked my own validation class and it has become a pretty standard part of all my coding project; However that may all change now.

Respect is not the first PHP validation class to hit the tubes of the Net but it does appear to be one of the better implemented and flexible ones out there.

More powerful Validation from Respect - http://pulsene.ws/1atzk

Posted via email from shocm

Getting Git to work in Textmate, Resolving "sh: git: command not found" error

I've been doing a lot of work with Git lately and its great. I downloaded and installed the Git Bundle for Textmate but it didn't  seem to work, always returning the error message "sh: git: command not found". Since I did most of my Git work from the command line I just ignored it but for some reason tonight I decided I needed to fix.

Since I knew Git worked on my system, it must have been something with the way Textmate was configured. I couldn't figure out how to confiugre Textmate to point to my Git install so I guess I cheated and I created a symbolic link on my system to point to my Git install. It seems to have corrected my issue with Textmate.

The command I ran was pretty simple

sudo ln -s /usr/local/git/bin/git /usr/bin/git

That's it, Textmate is now happy with my Git install.

Posted via email from shocm