Thursday 29 August 2013

Simulink: Multiple Scope Ports

In order to obtain a scope block with multiple inputs, open the graph, open settings, and change the number of axes.

This allows you to avoid the hassle of using muxes to parse and plot multiple input signals.

Source: http://www.mathworks.com/matlabcentral/answers/5687

Wednesday 21 August 2013

Ubuntu - mouse wheel scrolls too much per scroll click

In order to fix the problem, where the mouse scrolls too much down a page each time you move the scroll wheel, unplug and plug the receiver dongle back in. It should reset the settings that cause the scroll wheel to jump too much.

This problem occurs probably because of dual booting ubuntu and windows 7.

Wednesday 14 August 2013

Neat indentation in vim

In order to neatly indent your code in vim, type:

gg=G

, while no command is active.

Thursday 1 August 2013

Another piece by James Altucher


TWO LIFEHACKS THAT WILL GET PEOPLE TO LIKE YOU

I'm taking a day off from writing about crying on the floor. I feel like I've written 600 posts about either failure or naked people. 

Instead, I'm going to share two things I've done that have changed my life for the better and I don't know anyone else who does them. 

A) Get yourself 1000 $2 bills. You can get $2 bills by going to your local bank and asking them to order it from the Federal Reserve. 

The Federal Reserve threw out all of their antique copy machines that were set aside for $2 bills. That said, they still have a million vintage 2003 (signed by John Snow) $2 bills lying around. If you go to your local bank branch and ask for $2 bills it will take about 2-3 weeks to get one thousand of them. 

Why? 

1) When you go to a place where you plan on being a regular, always tip 30% and do it all with $2 bills. Nobody is ever going to forget you and you will always be treated well. Plus people will fight with each other to be the one serving you. That's a nice feeling. You don't have to be rich. You just have to have $2 bills.

Note: DON'T waste $2 bills on tips for cab drivers. They are never going to see you again. 

2) When you are breaking into a new scene, always use $2 bills. For instance, when I started playing chess for money at Washington Square Park I would always pay off with $2 bills but when I won I'd get $1s or $5s. Pretty soon, everyone was hoarding their $2 bills. My currency was flowing through the local economy. Everyone knew who I was. It was a shortcut to popularity because that's how desperate I was for friends among a bunch of drug addict homeless chessplayers. 

3) When I was dating, I would carry a thick wad of cash. A $100 bill on top, $2 bills filling out the whole wad. Time to pay for dinner, I'd bring out the wad (impressive), peel off a $100 bill (pathetic) and then amaze by tipping with non-stop $2 bills. "Where did you get those?" people always ask. Give a cryptic answer. "I do some projects with the government." 

Extra tip: it helps to go to the same restaurant the night before the date so everyone who works there is excited, anticipating what you will do. 

4) Conversation piece. If you pull out a $2 bill people say three things: "what is that?", "where did you get that?", "they are so beautiful"

5) Because as far as money goes, they are beautiful. I love the back of the 2 dollar bill. So much detail. 

 Buy 100 waiters pads. I've written about it before but I can't stress it enough. 

1) It's easy to write ideas. And the width is too short for you to put a lot of details or write a novel or whatever. It's just for writing down ideas. I write at least ten ideas a day on waiter's pads. Over the course of a year that's almost 4000 ideas. I do it seven days a week. 

2) If you are writing down ideas in a restaurant then the waiter thinks you are in the business and serves you faster. 

Trust me, this always works. In fact, if I am getting poor service I just pull out my waiter's pad, put it on the table, and suddenly everyone is very attentive. 

3) At the beginning of a business meeting I pull out the waiters pad and someone always says, "I'll take two cheeseburgers and a coke" and everyone laughs. It's a good conversation starter. 

4) It's a good way of showing you're frugal. When everyone pulls out their moleskin notebooks that cost $40 a pad you can say you paid 10 cents for your waiter's pad. Frugality is great when you are trying to raise money. 

5) I'm bad at remembering names. At the top of every page in the waiter's pad are small shapes representing the different different types of tables. The shapes have numbers representing every sitting position. You can write down the names of who is at the meeting and where they sat. 

6) they fit in your shirt pocket. As opposed to almost every other pad. 

I tried to think of a third lifehack but I couldn't. For 10 years I've carried around waiter's pads and $2 bills every day and have had enormous success with both of them. 

The key is you are inviting people into your universe. To keep them guessing about what might happen next. It's a mystery! $2 bills and waiter's pads are a good start. 

Oh! And my special handshake. But I'll save that for another post.

[Note on rewriting: first draft of this was 1041 words. Final draft: 773 words]