Friday, January 9, 2009

Wednesday, January 7, 2009

The Music of Four Loves Four - 2008

As the 2008 comes to a close, here are the top ten artists that the author's of Four Loves Four listened to.

Ditto's Top Ten
  1. Radiohead
  2. Coldplay
  3. Van Morrison
  4. Pearl Jam
  5. Death Cab for Cutie
  6. Kanye West
  7. Mat Kearney
  8. Counting Crows
  9. The Decemberists
  10. Incubus
Doodah's Top Ten
  1. Tokyo Police Club
  2. Say Anything
  3. Owen
  4. Sufjan Stevens
  5. Someone Still Loves You Boris Yeltsin
  6. Vampire Weekend
  7. Royksopp
  8. The Appleseed Cast
  9. Pompeii
  10. Nada Surf
Mig's Top Ten
  1. Radiohead
  2. Death Cab for Cutie
  3. Christopher O'Riley
  4. Dave Matthew Band 
  5. Broken Social Scene
  6. Snow Patrol
  7. Jack Johnson
  8. Feist
  9. Van Morrison
  10. The Decemberists
A look at the musical tastes of the people who drive this site.
Thanks to all who subscribe.

Monday, January 5, 2009

I'm Boycotting the Progressive Insurance Commercial Girl...

...and so should you. Flo is bothering me just like Joe Buck did in 2004. We all know what happened there. (To refresh your memory)

Just so I know what I'm working against, I did a little detective work. Her name is Stephanie Courtney and here is a list of films and works I will not be watching until Progressive takes my demands suriously and ends these commercials.

Join my Cause.

-migs out

btw, I will be entertaining myself at the Nova/Seton Hall game tomorrow night at the ROCK and then watching the premier of Scrubs on ABC.


Thursday, December 18, 2008

Pretty Plots in MATLAB

Using MATLAB to crank through some calculations, but having trouble making the plots pretty? Here's an example that should make a nice looking plot that's ready to be inserted into a report.

figure
set(gca,'fontsize',14)
set(gcf, 'PaperSize', [8. 6.],'PaperPositionMode', 'auto');
plot(X,Y,'k^','markersize',10,'markerfacecolor','auto')
legend('mylegend','location','northeast');
xlabel('myxlabel','Interpreter','latex','fontsize',16);
ylabel('myylabel','Interpreter','latex','fontsize',16)
AXIS([xmin xmax ymin ymax])
print('-r600','-dpdf',['filename','.pdf'])

Alright, a quick rundown.

1. The 'figure' command is letting MATLAB know that we're making a picture with all the following attributes.
2. The 'set gca' command is setting the axes, which have the default handle 'gca', to have a font size of 14 here. This will control the size of the numbering on the axes, as well as the size of the font in the legend.
3. The 'set gcf' command is setting the paper size to 8" by 6", a size I find works well with the default figure output of MATLAB. This will prevent you from having to crop the plot later in a third-party photo editor.
4. The 'plot' command lists the X and Y arrays youd like to plot, 'k^' plots black upward facing triangles in a 'marker size' of 10pt, and automatically filled.
The 'legend' command puts in your legend, one entry per pair of vectors being plotted, in the northwest position.
5. The 'xlabel' and 'ylabel' commands are pretty straightforward, but the interpretter command displays the labels in the default LaTeX font instead of the MATLAB font. You can use the '$$' pairing to put in maths.
6. The 'axis' command sets the range for x and y, just comment this out if you like what MATLAB does.
7. The 'print' command will save your figure as .pdf with the filename you specify in the current directory (where your .m file is). Here, you can always specficy a path if you'd like to save figures in a different folder.

Still to come, using str2num and num2str to automatically number plots that are part of a for loop, or to name output graphs based on input data.

Wednesday, November 19, 2008

MATLAB: Don't ', transpose(it)

Doing a little homework for ME 7040, I discovered that there is more to transposing a matrix than just rows becoming columns and vice versa. I was doing a simple stress, strain, displacement analysis of a beam under static load. The code snippet in question is when the elemental stiffness matrix needed to be calculated by:
k = int(int(B'*D*B,r,-0.5,0.5),s,-0.5,0.5)
B is a 3xn matrix of shape functions and D a 3x3 relationship of Modulus of Elasticity and Poisson's ratio. There is obviously more to this code, including the calculations of stress and strain and the writing of an output file.

Running the code using the prime ('), the code took 143.106 seconds to run. I was initally confused by how long it took because the matrices were not that large. I then heard about the function transpose() and decided to use that. In code form:
k = int(int(transpose(B)*D*B,r,-0.5,0.5),s,-0.5,0.5)
This took only 19.735 seconds to run. So digging a little further, the operator ', also checks for complex conjugates of the matrix as well.

In conclusion, if you know that you are not dealing with complex numbers, you may want to use the transpose function and not its operator.

Tip: To time the running time of your code, put tic on the top line and toc on the last line.

Tuesday, November 18, 2008

SCP + SSH: Copying files from Windows to Linux

At the university I attend, it is mostly all about Windows and there is no support for linux so many things have to be done by the user to get anything done. However, most linux users are used to trying this on your own. Here I will show you how to successfully transfer files from your linux box at home to a windows computer at work/school. Linux commands refer to Ubuntu. Please see your distro's guide on installing packages.

Software Required:
Windows: Cygwin
Linux: openssh

Configuring linux box:
To install openssh, in terminal type
sudo apt-get install openssh-server
If the linux box is behind a router, please open the port corresponding to ssh. Default is 22. For more information please visit portforward.com.

To test the installation of ssh type:
ssh localhost
If everything works, then that should be up for setting up the linux box.

Configuring Windows:
After downloading setup.exe from the link above, double click to run. The important part of the installation is "Selecting Packages" diaglog box.
Expand the Net tree by pressing the +. Scroll down and look for openssh and click on "Skip" to change it to "Install". You will notice a check box under column B. Click Next when finished and complete the installation.

Operating the Windows Box:
After installation, open cygwin and a terminal will appear. The syntax for scp is:
scp [options] [[user@]host1:]filename1 ... [[user@]host2:]filename2

To copy 'report.pdf' from your Fall 2008 folder on your home directory, you would type:
scp report.pdf user@serverip:"/home/user/Fall 2008/" .
This will save report.pfg into your home directory. Notice the "."

More Information:

Good Luck.

Saturday, October 11, 2008

Conky: Display Last Pidgin Message

Recently, I removed the gnome-panels, added awn, and had a conky bar at the top. However, I missed having a system notification of when I would receive a message via Pidgin. So I browsed the pidgin wiki and create somewhat of a hack to display the last IM that received from Pidgin. This method is probably not the best way however I had some diffuculty.

The DBus method that listens for the received messages was chocking conky and not allowing the conky script to load correctly. So I had to create two files. getim.py would run at startup, listen for a new message and then write that message to a data file. lastim.py would be executed within conky and check the data file for the new message. I know its not real efficient and redundant but it just works. If you have any brilliant ideas please let me know.

Here is the getim.py file:
#!/usr/bin/python

# ----- GETIM.PY // LISTEN FOR AN RECEIVED MESSAGE ------------#
################################################################
# MOST OF THIS SCRIPT WAS TAKEN FROM THE PIDGIN DEVELOPER WIKI#
# PLEASE VISIT http://developer.pidgin.im/ FOR MORE INFORMATION#
################################################################

def conky_im(account, sender, message, conversation, flags):
reg = '<(.|\n)+?>' # REGEX FOR HTML TAGS
message = re.sub(reg,'',message) # REMOVE HTML TAGS
sender = sender.split("@")[0] # GET GCHAT NAME
message = message[0:24] # LIMIT TO 25 CHARS
file = ' ' # LOCATION OF DATA FILE
fim = open(file,"w")
IM = sender + " said: " + message
fim.write(IM)
fim.close()

import dbus, gobject, re
from dbus.mainloop.glib import DBusGMainLoop
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus = dbus.SessionBus()

bus.add_signal_receiver(conky_im,
dbus_interface="im.pidgin.purple.PurpleInterface",
signal_name="ReceivedImMsg")

loop = gobject.MainLoop()
loop.run()



Copy and paste the following and save as lastim.py:
#!/usr/bin/python

# SHOW LAST IM
f=" " # REPLACE WITH YOUR DATA FILE. ie.CONKYIM.DAT
fim = open(f,'r')
im = fim.read()
print im
fim.close


Finally, add this to your .conkyrc script
${execi 1 python ~/scripts/lastim.py}

Any questions/comments let me know. Here is a screen shot of what my conky looks like:

Thursday, September 11, 2008

Top Ten Radiohead Songs

My first experience with Radiohead, besides hearing Creep on the radio, was my brother playing The Bends album for me. At first I wasn't a real fan, probably because the first song I heard I didnt like so didnt give them the time of day. I would randomly listen to their songs here and there but it wasn't until this past year that I came to appreciate them more. I find myself listening to them the most and never get tired of them.

I decided to compile a list of top ten Radiohead songs with a link to a video and a listing of their lyrics. I bolded lyrics that particulary strike a chord with me. Enjoy!

  1. There There

  2. in pitch dark i go walking in your landscape.
    broken branches trip me as i speak.
    just because you feel it doesnt mean it's there.
    just because you feel it doesnt mean it's there.

    there's always a siren
    singing you to shipwreck.
    (don't reach out, don't reach out)
    steer away from these rocks
    we'd be a walking disaster.
    (don't reach out, don't reach out)

    just because you feel it doesn't mean it's there.
    (there's someone on your shoulder)
    just because you feel it doesn't mean it's there.
    (there's someone on your shoulder)

    there there

    why so green and lonely?
    heaven sent you to me.

    we are accidents
    waiting waiting to happen.

    we are accidents
    waiting waiting to happen.




  3. Karma Police

  4. Karma police
    arrest this man,
    he talks in maths,
    he buzzes like a fridge,
    he's like a detuned radio.

    Karma police
    arrest this girl,
    her Hitler hairdo
    is making me feel ill
    and we have crashed her party.

    This is what you get,
    this is what you get,
    this is what you get,
    when you mess with us.

    Karma police
    I've given all I can,
    it's not enough,

    I've given all I can
    but we're still on the payroll.

    This is what you get,
    this is what you get,
    this is what you get,
    when you mess with us.

    For a minute there
    I lost myself, I lost myself.
    Phew, for a minute there,
    I lost myself, I lost myself.

    For a minute there
    I lost myself, I lost myself.
    Phew, for a minute there,
    I lost myself, I lost myself.




  5. House of Cards

  6. I don't want to be your friend
    I just want to be your lover

    No matter how it ends
    No matter how it starts

    Forget about your house of cards
    And I'll do mine
    Forget about your house of cards
    And I'll do mine

    Fall off the table,
    Get swept under
    Denial, denial

    The infrastructure will collapse
    Voltage spikes
    Throw your keys in the bowl
    Kiss your husband goodnight

    Forget about your house of cards
    And I'll do mine
    Forget about your house of cards
    And I'll do mine

    Fall off the table,
    And get swept under

    Denial, denial
    Denial, denial
    Your ears should be burning
    Denial, denial
    Your ears should be burning
    Denial, denial




  7. Fake Plastic Trees

  8. A green plastic watering can
    For a fake chinese rubber plant
    In the fake plastic earth

    That she bought from a rubber man
    In a town full of rubber plans
    To get rid of itself

    It wears her out, it wears her out
    It wears her out, it wears her out

    She lives with a broken man
    A cracked polystyrene man
    Who just crumbles and burns

    He used to do surgery
    On girls in the eighties
    But gravity always wins

    And it wears him out, it wears him out
    It wears him out, it wears him out

    She looks like the real thing
    She tastes like the real thing
    My fake plastic love

    But I can't help the feeling
    I could blow through the ceiling
    If I just turn and run

    And it wears me out, it wears me out
    It wears me out, it wears me out

    And if I could be who you wanted
    If I could be who you wanted
    All the time, all the time





  9. Paranoid Android

  10. Please could you stop the noise, I'm trying to get some rest
    From all the unborn chicken voices in my head
    What's that...? (I may be paranoid, but not an android)
    What's that...? (I may be paranoid, but not an android)

    When I am king, you will be first against the wall
    With your opinion which is of no consequence at all
    What's that...? (I may be paranoid, but no android)
    What's that...? (I may be paranoid, but no android)

    Ambition makes you look pretty ugly
    Kicking and squealing gucci little piggy
    You don't remember
    You don't remember
    Why don't you remember my name?
    Off with his head, man
    Off with his head, man
    Why don't you remember my name?
    I guess he does....

    Rain down, rain down
    Come on rain down on me
    From a great height
    From a great height... height...
    Rain down, rain down
    Come on rain down on me
    From a great height
    From a great height... height...
    Rain down, rain down
    Come on rain down on me

    That's it, sir
    You're leaving
    The crackle of pigskin
    The dust and the screaming
    The yuppies networking
    The panic, the vomit
    The panic, the vomit
    God loves his children, God loves his children, yeah!




  11. Everything in its Right Place

  12. Kid A, Kid A
    Kid A, Kid A
    Everything
    Everything
    Everything
    Everything in its right place
    In its right place
    In its right place
    In its right place

    Yesterday I woke up sucking a lemon
    Yesterday I woke up sucking a lemon
    Yesterday I woke up sucking a lemon
    Yesterday I woke up sucking a lemon

    Everything
    Everything
    Everything
    Everything in its right place
    In its right place
    In its right place
    Right place

    There are two colours in my head
    There are two colours in my head
    What, what is that you tried to say?
    What, what was that you tried to say?
    Tried to say
    Tried to say
    Tried to say
    Tried to say

    Everything in its right place...




  13. True Love Waits

  14. I'll drown my beliefs
    To have you be in peace
    I'll dress like your niece
    To wash your swollen feet

    Just don't leave
    Don't leave

    I'm not living
    I'm just killing time
    Your tiny hands
    Your crazy kitten smile

    Just don't leave
    Don't leave

    And true love waits
    In haunted attics
    And true love lives
    On lollipops and crisps

    Just don't leave
    Don't leave

    Just don't leave
    Don't leave




  15. High and Dry

  16. Two jumps in a week,
    I bet you think that's pretty clever don't you boy?
    Flying on your motorcycle,
    watching all the ground beneath you drop
    You'd kill yourself for recognition,
    kill yourself to never, ever stop
    You broke another mirror,
    you're turning into something you are not

    Don't leave me high, don't leave me dry
    Don't leave me high, don't leave me dry

    Drying up in conversation,
    you'll be the one who cannot talk

    All your insides fall to pieces,
    you just sit there wishing you could still make love
    They're the ones who'll hate you
    when you think you've got the world all sussed out
    They're the ones who'll spit on you,
    you'll be the one screaming out

    Don't leave me high, don't leave me dry
    Don't leave me high, don't leave me dry

    Oh, it's the best thing that you ever had,
    the best thing that you ever, ever had.
    It's the best thing that you ever had,
    the best thing you have had has gone away.

    Don't leave me high, don't leave me dry
    Don't leave me high, don't leave me dry
    Don't leave me high,
    Don't leave me high, don't leave me dry




  17. Idioteque

  18. Who's in a bunker?
    Who's in a bunker?
    Women and children first
    And the children first
    And the children
    I'll laugh until my head comes off
    I'll swallow till I burst
    Until I burst
    Until I

    Who's in a bunker?
    Who's in a bunker?
    I have seen too much
    I haven't seen enough
    You haven't seen it
    I'll laugh until my head comes off
    Women and children first
    And children first
    And children

    Here I'm alllowed
    Everything all of the time
    Here I'm allowed
    Everything all of the time

    Ice age coming
    Ice age coming
    Let me hear both sides
    Let me hear both sides
    Let me hear both
    Ice age coming
    Ice age coming
    Throw it on the fire
    Throw it on the fire
    Throw it on the

    We're not scaremongering
    This is really happening
    Happening
    We're not scaremongering
    This is really happening
    Happening
    Mobiles skwrking
    Mobiles chirping
    Take the money run
    Take the money run
    Take the money

    Here I'm allowed
    Everything all of the time
    Here I'm allowed
    Everything all of the time

    Here I'm allowed
    Everything all of the time
    Here I'm allowed
    Everything all of the time

    The first of the children




  19. Bodysnatchers

  20. I do not
    Understand
    What it is
    I've done wrong
    Full of holes
    Check for pulse
    Blink your eyes
    One for yes
    Two for no

    I have no idea what I am talking about
    I am trapped in this body and can't get out
    Ooooohhhh

    You killed the sound
    removed backbone
    A pale imitation
    With the edges
    Sawn off

    I have no idea what you are talking about
    Your mouth moves only with someone's hand up your ass
    Ooooohhhh

    Has the light gone out for you?
    Because the light's gone for me
    It is the 21st century
    It is the 21st century
    It can follow you like a dog
    It brought me to my knees
    They got a skin and they put me in
    They got a skin and they put me in
    All the lines wrapped around my face
    All the lines wrapped around my face
    And for anyone else to see
    And for anyone else to see

    I'm a lie

    I've seen it coming
    I've seen it coming
    I've seen it coming
    I've seen it coming

    We're not scaremongering
    This is really happening
    Happening
    We're not scaremongering
    This is really happening
    Happening
    Mobiles skwrking
    Mobiles chirping
    Take the money run
    Take the money run
    Take the money

    Here I'm allowed
    Everything all of the time
    Here I'm allowed
    Everything all of the time

    Here I'm allowed
    Everything all of the time
    Here I'm allowed
    Everything all of the time

    The first of the children






Perhaps you can enjoy Radiohead as much as I do.

Monday, August 11, 2008

Dear NBC, I run Linux

After seeing the amazing comeback by Jason Lezak in the 400 free relay last night, I was eager to watch it this morning and relive the experience. However, I was disappointed when I clicked on "play video" and was unwelcomed with:


I run linux and am very very happy with it, but there are times where I feel almost neglected because of the operating that I use. Who knows, maybe there could be some discrimination suit against them.

But seriously, can someone enlighten me as to how hard it would be for them to make it available on linux systems?

Thursday, August 7, 2008

Find Files in BASH

This is really just a reminder to me so I dont have to keep looking it up. Who knows, maybe you will find it useful.

To search folder and subfolders for python scripts.

find . -name "*.py"
Sweet now I wont forget.