Friday, September 10, 2010

WTF happened to Bob?

I guess he's dole'n it up bro. Come back in a month.

http://nodejs.org

There Ain't No Such Thing As Plain Text

This article definitely shines some like on character encodings. Especially UTF-8 and Unicode.

"It does not make sense to have a string without knowing what encoding it uses."

http://www.joelonsoftware.com/articles/Unicode.html

You have no choice but to read it or it will come back to haunt you if you don't. I'm not kidding. If you say you already know, then I say read it anyway. Wait, let me say it in not a rude way. Can you please, pretty please read this page so you don't screw yourself later on in your code.

I can think of a few instances where my code came back to haunt me when I didn't use a charset/encoding or used the wrong one. Learn from your mistakes, or better yet. Learn from others'.

Wednesday, September 8, 2010

Cohesion for source control by CVSDude

http://codesion.com/



I'm in love.

How to whet your Python and HTML5

Dive into Python by Mark Pilgrim, you can read the full thing online or buy the book.

Join the mailing list, but before you do so I would highly recommend you read dive into python first.

I personally like Python more than any other language I've worked with. It is more of a wrapper language thou. Meaning It's a good multi-platform language that you can develop code that can use other languages as well. You can write you heavy lifting in C/C++ or Java or C# and then use those libraries in python. It's so awesome in fact, that I was left speechless for a while during learning this language in the beginning.

Mark Pilgrim also wrote Dive into HTML5. BTW, If your doing any HTML5 dev work then you need to checkout HTML5Boilerplate which is done by Paul Irish.

Happy coding to you all.

exporting bash aliases and functions into a variable

I'm getting a little git gist happy. :) So here's something just for kicks. I'm gonna start posting other things than bash. Perhaps more python and php code. ATM I'm reading "JavaScript: The Good Parts" I highly recommend this book, it's a good read. Been meaning to read it for a while to brush up on my js coding skills, because I plan on doing a lot of nodejs development here in the near future for a import/export system.

running aliases and functions with sudo, and Blogger bashing

I don't remember where I got this like 3 years ago. Just thought I'd share it because it's very useful. Maybe it will be as useful for you as it is for me.

Blogger seems to always mess up my indentations. So it's not really good for python code. However, this is a bash function to wrap aliases and functions in sudo. I wish blogger wouldn't do that. But wait folks that's not all. It assists me in losing changes too. Gotta love that. If you see me switch over to posterous or not blog on here anymore, then you will know why. Not much incentive to use a system that screws with your text or text formating. hahaha, even Gov. Arnold has a posterous.

Better yet I will place code in a gist and keep ranting :) (I'll leave the below function declaration so you can see how ugly it looks)



sudo ()
{
local c o t parse

# Parse sudo args
OPTIND=1
while getopts xVhlLvkKsHPSb:p:c:a:u: t; do
if [ "$t" = x ]; then
parse=true
else
o="$o -$t"
[ "$OPTARG" ] && o="$o $OPTARG"
fi
done
shift $(( $OPTIND - 1 ))

# If no arguments are left, it's a simple call to sudo
if [ $# -ge 1 ]; then
c="$1";
shift;
case $(type -t "$c") in
"")
echo No such command "$c"
return 127
;;
alias)
c=$(type "$c"|sed "s/^.* to \`//;s/.$//")
;;
function)
c=$(type "$c"|sed 1d)";\"$c\""
;;
*)
c="\"$c\""
;;
esac
if [ -n "$parse" ]; then
# Quote the rest once, so it gets processed by bash.
# Done this way so variables can get expanded.
while [ -n "$1" ]; do
c="$c \"$1\""
shift
done
else
# Otherwise, quote the arguments. The echo gets an extra
# space to prevent echo from parsing arguments like -n
# Note the lovely interactions between " and ' ;-)
while [ -n "$1" ]; do
c="$c '$(echo " $1"|sed -e "s/^ //" -e "s/'/'\"'\"'/")'"
shift
done
fi
# Run the command with verbose options
echo Executing sudo $o -- bash -x -v -c "$c" >&2
command sudo $o bash -xvc "$c"
else
echo sudo $o >&2
command sudo $o
fi
}

rants about stuff and CourtesyFlush

I haven't blogged in a while. So, ummm. I really am not sure what to blog about. It kinda seems like an old fad for me to blog. I just like to mostly read what others have to say and learn from others. It's nice to give back though. I like to give back. Just I do it in a lot of other ways.

So I am still looking for a good job. I can't believe this has to be so difficult. Most places never give me a chance though. It's the recruiters that are the problem, because they aren't programmers looking to hire programmers. What ends up happening is they find someone that knows not a lot, but knows how to talk and brown-nose better than me. I wish to be interviewed by actual people that know what is going on. Not ones you can read about on TheDailyWTF. This is mostly the case when it comes to windows users. I laugh at windows. Because IT IS garbage. Ofcourse this is my personal opinion. I just prefer Linux. Not that I wouldn't write code on it or for it. Because it does get the job done, and in the end thats all that really matters. I'm sure my prayers will be answered though. I believe it with all my heart, brain and soul :)

I been running my computer business for a while now. It's not bad. Definitely beats working for someone else. That all depends on the conditions though. I love to work. It helps me deal.

A little while back I started another project. I have roughly 1000 bash aliases and functions now. It becomes very cumbersome to manage all those. So I created a little pyGTK application with quickly. I called it CourtesyFlush. It's on Launchpad. It scratches my itch. I added a bunch of code in there preparing for some new function in parsing the files and stuff like that. So look beyond that. I basically built it like junk. Because It's how I find out where to go with it. Once I figure out what features it requires I will rethink and OOP the code. I call it progressive building. Like climbing a ladder. As you climb up the ladder you progress up the ladder.

About the logo.


Yes, that is a toilet. Yes, that is python floating in the toilet. Yes, it looks like dung. Yes, It's funny to me, I find it amusing. I love python. It's an awesome language. I made the logo using InkScape (a opensource vector graphics application like Adobe Illustrator). Moving on.

I honestly barely ever use this application. Just once in a while. Mostly I just go with vim, nano, pico, cat or gedit.

Here are some of the current features this program has.

list functions and aliases and show source in a sourceview
display vte console to run aliases and functions
autorun and repeat running of aliases and functions up to 9999 times, no kidding(basically it just wraps your command in a for loop, no biggie. still saves even more time though)
and many more...

heres a screenshot(theres no guarantee this image will stay up)


Here are some features I still plan on adding at some point in time.

OliveGTK's gannotate
tilda's keybindings
commandlinefu in search
tabbed vte console
tabbed sourceview
and many more I can't remember atm...

This program is actually nothing really big. At least I don't think of it as a big deal. It just saves me some time at times.

If you like this program, let me know. If you find any bugs, let me know. If you want me to add more features, let me know. If you want to help, let me know. Anything else? let me know. Honestly, If you find bugs or something I expect you to try to fix it yourself. I may take a long while to fix it, depending on some life variables and such. If it pays though it'll get fixed 10 minutes ago. :) Like with anything else. Don't expect me to do any hand holding, unless it is your breast. haha, just kidding.

I like to know stuff, If you haven't figured it out yet. Knowledge is power, I thrive on that stuff. It's like food, only for my brain.

A lot of things in life are hit and miss. To make good stuff, you have to make a lot of garbage. Plus sometimes you may think something is so awesome that everyone needs or wants it, and the reality is that's not the case. Yet, sometimes you may do something as the spur of the moment and it'll get so much attention that it blows your mind. Anyway, I have nothing more to say now. Back to reading and learning more stuff.

English is not my primary/native language. Which means that you may get insulted. If you can get passed that though then more power to you. There's more important things to worry about than proper wording, pronunciation or the arrangement of words, IMHO. Some may say otherwise. Liba/Riba, same thing.