Browsing Posts published by L. Preston Sego III

So, everyone knows IE’s existence is easily worse than anything Hitler ever did.  I needed to be able to detect what versions of browsers were coming to my site and give them an playful suggestion for them upgrade their browser, or face potential disgusting css bugs.  So… I wrote this script here, that I feel is a bit easier to understand than many other javascript people have found once upon a google.

Place this in a file, I called it browser.js, and include it in your <head> tag.
Then do something like

if (isClientBrowserTooOld()) alert("I'm sorry Dave, but your browser is older than you are. You'll need to download the latest version of your browser before I can let you continue, Dave");

or something to that effect.

And for zhe script:

function isClientBrowserTooOld(){
    var ua = window.navigator.userAgent
	var ie = msieVersion(ua);
	var chrome = chromeVersion(ua);
	var firefox = firefoxVersion(ua);
	var safari = safariVersion(ua);

	//alert(ie + ":" + chrome +  ":" + firefox +  ":" + safari); //debugging
	if (ie < 7.0 && ie > 0) return true;
	else if (chrome < 5.0 && chorme > 0) return true;
	else if (firefox < 3.4 && firefox > 0) return true;
	else if (safari < 4 && safari > 0) return true;
	else return false;
}

// Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
function msieVersion(ua){
      var msie = ua.indexOf("MSIE ");
      if ( msie > 0 )      // If Internet Explorer, return version number
         return parseInt(ua.substring(msie+5, ua.indexOf(".", msie )));
      else                 // If another browser, return 0
         return 0;
}

// Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.475.0 Safari/534.3
function chromeVersion(ua){
	var chrome = ua.indexOf("Chrome/");
	if (chrome > 0) return parseInt(ua.substring(chrome+7, ua.indexOf(".", chrome) + 1)); // returns 6.0
	else return 0;
}

// Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b2) Gecko/20100720 Firefox/4.0b2
function firefoxVersion(ua){
	var ff = ua.indexOf("Firefox");
	if (ff > 0) return parseInt(ua.substring(ff+8, ua.indexOf(".", ff) + 1)); // returns 4.0
	else return 0;
}

// Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-us) AppleWebKit/533.17.8 (KHTML, like Gecko) Version/5.0.1 Safari/533.17.8
function safariVersion(ua){
	var safari = ua.indexOf("Version");
	if (safari > 0 && ua.indexOf("Safari") > 0) return parseInt(ua.substring(safari+8, ua.indexOf(".", safari) + 1)); // returns 5.0
	else return 0;
}

So… I’m really surprised that chat bots are so terrible… Is it so hard to make a bot keep track of entire conversation? No. =)

Anyway… Here is my first chat bot convo.

http://www.cleverbot.com/

Bold is the chat bot talking…

continue reading…

So.. It’s been a while since I’ve blogged about anything. Been kinda busy with school and such.  Just wanted to talk about James Cameron‘sAvatar. =)

Avatar is a great movie. Great enough that I’ve seen it five times: twice in 2d (awesome), twice in 3d (zomg awesome), and once in the IMAX in 3d (zomg, I <3 more than anything).    I am very passionate about this movie and everything in it.  A couple of my friends, however, have offered to check me into rehab (not only for this movie, but for Lady Gaga‘s Bad Romance).  My friends have just never felt so passionate about anything before.

I’m not crazy about Lady Gaga’s Bad Romance but she has somehow figured out a way to inject crack into audio… I never get sick of the song… ’tis weird.

The most common complaints I hear about the movie are almost always related to the plot.  They say that it was too simple and too similar to Pocahontas… Well.. Not every movie needs to have the most original plot ever.  Look at The Shawshank Redemption (currently IMDB’s #1) … basically the guy breaks out of jail (the first half of the movie anyway)… how original is that? … But what I feel people need to see in movies is how the entire work of art appears as a whole.  Otherwise… almost every movie is going to suck.

I’ve watched a lot of videos of interviews with James Cameron (the director), Sam Worthington (Jake Sully) and Zoe Saldana (Neytiri)… and based on what they said, I don’t think the movie could have turned out any more perfect. James Cameron (who also did The TerminatorTerminator 2: Judgment Day (I <3 terminator) and Aliens which also had Sigourney Weaver) said that he couldn’t get too crazy with the plot because of how ‘out there’ the visuals were.  It needed to be simple. So that the 9 foot tall Na’vi wouldn’t scare people off.

Now here’s why I like the movie:

  • The way humans are portrayed as savages who will take what they want without really caring about the destruction of innocent lives.
  • How Grace Augustine  (Sigourney Weaver) and Norm Spellman  (Joel Moore) discover that Eywa is real and scientifically measurable… and not just some “pagan ritual” thing.  So… this made made me think about the possibility of religion on our planet being measurable somehow… so many people laugh at religion because they think it isn’t real… but maybe we just don’t have the technology do discover it?
  • File:Friday 25 December 09 - 001442.jpg
  • Before Jake Sully gets ready to link with his Avatar body for the first time, Grace says something along the lines of “why are you even here?”, he says “Maybe I got sick of doctors telling me what I can’t do.”  … Now I love determination and going against what people think of you.  Rebellian has it’s place and is exercised perfectly here.
  • In the beginning … When Jake Sully, after not having the use of his legs for an unspecified long time, enters his Avatar body: he is excited about having legs again in a way that words cannot explain.  While I still have the use of my legs, the way the situation was presented in the movie brought tears to my eyes.  After the first time he leaves his Avatar body, he is briefly filled with sadness as he remembers that he doesn’t have functional legs…
  • I absolutely love the scenery. Everything about the moon Pandora. Especially how everything is bioluminescent.  It puts our planet to shame (which isn’t that too hard from my perspective, considering I’ve never left the U.S.).
  • The little bioluminescent lizards that look similar to DaVinci’s helicopter. =)
    File:Fanlizard-flying.jpg
  • The spiral fly traps in the beginning that suck themselves into their stem. And as it turns out these are based off real plants… except they live underwater T_T
    File:Pandora5.jpg
  • I heart nature… and Pandora has nothing that mars its beauty. =)

So, this movie pretty much made me not want to be human anymore.   We all know Earth is heading to hell anyway… and the greed of humans and the destruction they leave behind them is pushing it there faster than ever.  I’ve never liked people as a whole… This movie made me feel like I had a choice… but in reality (with current technology)… I don’t …  Given the option, though, I’d switch in a heart beat.

Alright, so after trying to use my first solution: I decided terminal is faster. I will probably right some sort of plugin for the finder in the future, if someone doesn’t beat me to it.

Anyway, here is how I currently do SVN

Open Terminal

type cd then drag your SVN folder to the terminal and hit enter.

Most common svn commands:

svn status | grep “^\?” | sed -e ‘s/? *//’ | sed -e ‘s/ /\\ /g’ | xargs svn add

• recursively adds all files..

Adding Files: svn add –force ./* adds all new files in a directory.
Committing: svn commit -m”message” Commit Message is needed, or commit won’t always work
Deleting Files: svn delete file.name
Updating: svn up
File list: svn ls
Latest stats: svn info

For everything else, svn help will bring up more commands

svn help <command> will bring up help for that command. ^_^

I have an idea for the 24-Hour Play Festivals that, I feel, would be AMAZING!

For those who don’t know what the 24-Hour Play Festival is: It is a series of small plays that are written, directed, and rehearsed within 24 hours.  Example: A group of people meet at 8pm on a friday to assign writers, directors, and actors into small groups.  The script is written from about 9-10pm Friday until 4-5am Saturday.  From 9am till 7~ish pm, the directors help the actors rehearse, and the plays are performed starting at 8pm Saturday!

Anyway, my idea…
Perform the 24-play as usual. Once done with the performance, and everyone has showered: the writers become directors or actors, and the actors/directors become writers. The ol’ switcheroo to accommodate those who can’t stay up for more than 40 hours (rare situation which occurs when a writer also wants to direct).  By 8pm the next day, ANOTHER PERFORMANCE!!! YAY!  And then repeat the process for about a week or so.  ^_^

So, this is a script that will automate the installation required for converting mkv dts to ac3 for use on the tv.

original article with full installation and use instructions

when finished, you can run

$>mkvdts2ac3 path/to/file.mkv

or

$>mkvdts2ac3 -n path/to/file.mkv to remove the original dts track.

enjoy!

mkdir /ConverterTemp


This installs CMake

cd /ConverterTemp/

curl -O http://www.cmake.org/files/v2.6/” && cmake_install && tar xvzf  && cmake_install

./configure

make

sudo make install

This installs Aften

cd /ConverterTemp

svn co http://aften.svn.sourceforge.net/svnroot/aften Aften

cd Aften

mkdir default

cd default

cmake /ConverterTemp/Aften/

make

sudo make install

This installs MKVInfo

cd /ConverterTemp

curl -O http://iamthekiller.net/downloads/mkvinfo.zip

unzip mkvinfo.zip

sudo chmod 755 mkvinfo

sudo cp mkvinfo /usr/local/bin

This installs libdca

cd /ConverterTemp

svn co svn://svn.videolan.org/libdca/trunk libdca

cd libdca

sudo ./bootstrap

sudo ./configure

sudo make

sudo make install

This installs MKVDTS2AC3

cd ConverterTemp

curl -O http://iamthekiller.net/downloads/mkvdts2ac3.zip

unzip mkvdts2ac3.zip

cd mkvdts2ac3

sudo chmod 755 mkvdts2ac3.sh

cp /ConverterTemp/mkvdts2ac3/mkvdts2ac3.sh /ConverterTemp/mkvdts2ac3/mkvdts2ac3

sudo cp /ConverterTemp/mkvdts2ac3/mkvdts2ac3 /usr/local/bin/

This installs MKVMerge

cd /ConverterTemp

curl -O http://iamthekiller.net/downloads/mkvmerge

sudo chmod 755 mkvmerge

cp mkvmerge /usr/local/bin/

This installs MKVExtract

cd /ConverterTemp

curl -O http://iamthekiller.net/downloads/mkvextract

sudo chmod 755 mkvextract

If you want to make this into a .sh file, simply add semi-colons after each command for every  section.


I like to think of myself as an honest person… So I’ll throw this out there: I like cracking networks. I mean.. I would never crack a network that didn’t belong to me. Anyway, there are many tools out their for wireless network activities. Everything here is open source – so, there are no laws against having the software (unless you are in Germany (poor unfortunate souls (here is a link about the law in Germany))).

 


kismac logo
Originally from Germany, KisMAC is a wireless stumbler, sniffer, and cracker. I’ve been using KisMAC for a few years, and have been happy with it. Though the program faces challenges in making any progress in getting its self up to date with current hacking methods, It is the friendliest for Mac OS X users. It has a brand new Leopard-style GUI on the way… at least… it’s been submitted… Why the new interface is being delayed, I don’t know.

 


Kismet Logo
Kismet has some really interesting features. I haven’t used it much, but it is client-sever based, so, people can expand on it if they want ( I started an OS X GUI for Kismet a while back, but have since lost my ambition for the project. It’s open source if anyone wants to continue work on it. ).  But basically, Kismet is a stumbler, and has some REALLY nice analysis features and graphs. Also, it’s plugin system allows for the possibility of adding hacking capabilities.

 


AirCrack logo
Aircrack-ng is the leading WEP and WPA-PSK cracking program. It also has the broadest support for wireless cards. I haven’t used it much, because it doesn’t support the mac, and I don’t really like switching operating systems too much. But they just recently hit version 1.0, and updated their website.  — One of my favorite Operating Systems, BackTrack, users Aircrack-ng. ^_^

Expose:

Almost 3 weeks into using Snow Leopard, and I haven’t found too many new things, but here is a list of things I’ve found that are neat.

Being able to select a different application while in Expose, even if that app isn’t
Minimized windows have their own little section so that we don’t forget about them (This happened to me a lot back in leopard: I’d go file->open, and the file would just un-minimize.). Total time saver ^_^

System Preferences

One of my biggest complaints in leopard was that the folders for desktop backgrounds would all say ‘Aperture’ (only if you had aperture installed). So, my temporary fix was to close System Preferences, move my Aperture library, and re-open System Preferences before OS X found out where I moved the Aperture library to.

Keyboard shortcuts are finally organized and not terribly chaotic!


What I’d like to see:

Multiple monitor support is terrible in OS X. I mean, It works flawlessly. But If i have multiple screens, I don’t want my spaces to get bigger. I want Space 1 on my main screen. and Space 2 on my secondary screen. I am a Software Engineer in training and I just can’t believe Apple’s engineers haven’t fixed this problem yet.

Back in Leopard, and maybe even Tiger (that was a long time ago), whenever I wanted to show someone the multi-tasking power, that is the mac, (or when I got really bored) I would open about 50 Finder windows, hold shift, and minimize all of them one at a time – starting a new window when the last was about a third of the way to it’s destination.  ’Twas pretty entertaining–watching a whole bunch of windows get sucked into the Dock in slow motion.  But in Snow Leopard, only one window can be minimized at a time within an application. Have Apple computers lost their ability to excessively multi-task?!?!?!?

When I upgraded from Leopard to Snow Leopard, my contextual menu for using SVN within the Finder died. So here is the first working solution I found. I’m not a fan of using apple script for SVN, but it was quick and easy. Tortoise SVN is a great solution for Windows, but only for Windows… They should make a mac version.

http://svn-finder.sourceforge.net/

Enabling the Apple Script Menu

1. Open AppleScript Editor (Located in /Applications/Utilities/

2. Hit Command + , to bring up the Preferences

3. Make sure “Show Script menu in menu bar” is checked

Installing the scripts

1. Download the scripts from the link above

2. From the Scripts menu in the menu bar, select “Open Scripts Folder” then “Open User Scripts Folder”

3. Make your way to ~/Library/Scripts/Applications/Finder if step 2 didn’t bring you there

4. Drag the downloaded scripts to the folder in step 3 and your done installing!

or, Alternatively, You can install the scripts to /Library/Scripts/SVN if you want all the SVN stuff to be in a sub menu.

Using SVN

The URL for your SVN account is http://USERNAME@SVN_ADDRESS

Terminal will then open and you will be prompted to type your SVN password.

Congratulations! you now have a GUI shortcut for using SVN in Snow Leopard!

Powered by WordPress Web Design by SRS Solutions © 2012 L. Preston Sego III Design by SRS Solutions