Posts Tagged With: Improvement

Goals for 2011

1. Don’t talk anyone out of their assumptions about my talent level, fitness, etc.

2. Immediately reply to all emails that require less than 2 minutes to write (once my email script downloads them).

3. Make $1,000 selling things online

4. Maximize serendipitous opportunities – send low-cost emails, meet people, get people in my corner.

5. Spend more money

6. Go to Joshua Tree

Some tools I used for the first time/got good at using over winter break

Running apps with Flask
Jinja templating
Vim
Cron jobs
Parsing XML with etree
Photoshop
Mercurial
One-click deploys with Fabric and Mercurial
UNIX/Bash scripting
Google Apps
Writing Chrome extensions
Mental math (don’t ask)

Liked what you read? I am available for hire.

Escaping from your email

I only download my email once every four hours. Otherwise I check it too much. This works really well and my "need to check" email addiction has totally shut off.

For this to work on your own email, you want to set up a Gmail account with an address that no one knows, as well as access to a cron task scheduler. Cron is an application that runs tasks on a set schedule, so every minute or every year or every Monday at 5pm, etc. If you have Mac or Linux, and you're the type of person that keeps their computer on 24/7, you can run "cron jobs" from your local machine (you want to edit the /etc/crontab file - here are some instructions). I use my web hosting provider's cron service, because it will run even when my laptop is shut down.

Here's the script:

 
import imaplib
from datetime import datetime
import email
import smtplib
import sys
import os
import random
import base64

def main():
    #check user
    if os.isatty(sys.stdin.fileno()):
        #i'm trying to get my email by cheating, not a cron
        print "Are you sure you want to do this?"
        ans = raw_input()
        if ans != "yes":
            return
        no_of_mults = 3
        for i in range(no_of_mults):
            a = random.randint(1000,9999)
            b = random.randint(1000,9999)
            print "What is " + str(a) + " * " + str(b) + "?"
            ans = float(raw_input())
            if ans != a*b:
                print "Sorry, incorrect answer."
                return

    imap_domain = "imap.gmail.com"
    imap_port = 993
    imap_username =  base64.b64decode('my_gmail_username_encoded')
    imap_password = base64.b64decode('my_gmail_pass_encoded')

    #smtp settings
    smtp_domain = "my_smtp_host.com"
    smtp_port = 587
    smtp_username = "my_smtp_user"
    smtp_password = "my_smtp_pass"

    email_recipients = ['kburkeorg@gmail.com']

    imap_server = imaplib.IMAP4_SSL(imap_domain, imap_port)
    imap_server.login(imap_username, imap_password)

    server = smtplib.SMTP(smtp_domain, smtp_port)
    server.ehlo()
    server.starttls()
    server.ehlo()
    server.login(smtp_username, smtp_password)

    imap_server.select('INBOX')

    status, email_ids = imap_server.search(None, '(UNSEEN)')

    recipient = email_recipients

    count = 0
    for e in email_ids[0].split(' '):
        if e is not '':
            try:
                raw_msg = imap_server.fetch(e, '(RFC822)')
                msg = email.message_from_string(raw_msg[1][0][1])

                #modify reply-to so we preserve email address
                if not msg['Reply-To']:
                    msg['Reply-To'] = msg['From']

                result = server.sendmail(msg['From'], recipient, msg.as_string())
                count += 1

            except smtplib.SMTPRecipientsRefused, e:
                print "SMTPRecipientRefused" + str(e)
                continue
            except Exception, err:
                print err
                continue

    # so I can see how many messages were printed
    print "Sent " + str(count) + " messages."
    filename = "/home/kevinburke/webapps/b/sent.txt"
    with open(filename, 'w') as f:
        f.write(str(count))
    print datetime.now()

    server.quit()

if __name__ == "__main__":
    main()

Then in your cron file, you want to add the following line:

0 */4 * * * /usr/bin/python /path/to/email/file.py

where

/path/to/email/file
is the filepath to wherever you saved the script above. The 0 means run the script at the top of the hour, and the */4 means run it once every 4 hours.

Liked what you read? I am available for hire.

Preaching the opposite of what you practice

Half a century ago, nursing books warned against being too cuddly and warm with children. Harry Harlow is an extremely famous psychologist who experimented with monkeys to show the opposite - that children seek affection and warmth, and it helps them grow. He gave monkeys a choice between two 'mothers' - a wire mother that dispensed milk and a cloth mother that had no food - and the monkeys overwhelmingly chose the cloth mother. Furthermore, monkeys that could choose only the wire mother later had psychological problems. This was groundbreaking work at the time. So you would expect that Harlow would apply the same lessons to his personal life, right? Not quite:
Harry Harlow did not discover what children need by watching his own. In fact, Harlow was a hard-drinking, possibly alcoholic, workaholic who ignored his two sons so completely that it led his first wife to divorce him. After his boys were grown, he reacquainted himself with them, but his younger son said that although they got along, "we were never father and son." In fact, Harlow's insights about child rearing were not based on studying children at all but came out of his research with monkeys.
Are the people who preach loudest about X the most likely to have shortcomings in their ability to do X? Maybe there are two reasons for preaching loudly about something: 1) You believe you're better at it than everyone else and want to stress its importance to raise your status. 2) People who lack skills in area X try to cover it up by overachieving in other areas, but remain unwilling or unable to improve their skills in area X.

Liked what you read? I am available for hire.

How do you respond to failure?

NB: The target audience was high school basketball players, but the content is relevant for anyone.

How do you respond when you fail? You might be pretty good at your job, but you will eventually reach some point where you are working with people who are better than you.

You will experience this in high school and college as well. You might see grades on your exams and papers that are much, much lower than you’re used to. You all are away from your parents and the friends of your neighborhood for the first time, in a culture that’s wildly different, and more dangerous, than the one you grew up in. You’ll have to deal with uncertainty and rejection in your relationships with your peers.

As a group, your interpretations of these events will differ dramatically. If your coach doesn’t play you, some of you will say, “The coach hates me, what’s the point of trying” or “I’ll never be good enough,” and some of you will say, “I need to work harder.” After getting a D on your first midterm, some of you will say “I didn’t work hard enough” or “The teacher was in a grumpy mood,” and some of you will say “I’ll never be a good student,” or “I’m not as smart as everyone else.” If you ask a cute girl out and she says no, some of you will say “I got tongue tied,” and some of you will say, “She said no because I’m an unlikeable person.” If you get elected for a leadership position, some of you will say, “I was elected because I’m a good leader,” and some of you will say, “I got lucky all of the other candidates were awful.”

The way you respond to events is called your explanatory style. We call the first group of people optimists – people who believe they are responsible for positive events, and that others are responsible for negative events, and the second group – who blame themselves for negative events and don’t take credit for positive events – pessimists (to figure out your own style, you can try this online quiz – if the bottom score is above 6, you’re optimistic, 1 or below is pessimistic, and in between is average). Here’s the surprising part: Relative to high school GPA and SAT scores, optimists outperform the average student, and pessimists underperform1. A pessimistic explanatory style can hurt even more, however. Pessimists are at a much greater risk of sinking into depression. They’re more likely to become sick, and have a lower life expectancy than optimists.

The good news is that you can change your explanatory style. The technique involves noticing your automatic negative thoughts – “I can never think of anything to say” or “I’m not as smart as everyone else,” disputing those thoughts by remembering contrary evidence, providing a different, less permanent, explanation for the event, and finally distracting yourself from the pessimistic thoughts in the first place, giving yourself more control over what you think. This technique has the power to permanently change your explanatory style, and help you realize your full potential. Mastering this skill is more important than learning how to score with your weak hand or learning how to rebound. If you can master optimism, you won’t be vulnerable to a run by the opposing team. You’ll respond to getting beaten by working harder, not complaining. You’ll give yourself full credit when you win and learn to work harder when you lose.

While we all plan for the best, and expect to have fun on the court, it’s not going to be rosy all the time. When things hit the fan, it will be helpful to remember the words of Gabriel Garcia Marquez: “What matters in life is not what happens to you, but what you remember, and how you remember it.”

1. Martin Seligman, Learned Optimism, page 151-152.

Liked what you read? I am available for hire.

Five regrets of the dying, from someone who works in palliative care

1. I wish I'd had the courage to live a life true to myself, not the life others expected of me. 2. I wish I didn't work so hard (almost exclusively from male patients) 3. I wish I'd had the courage to express my feelings. 4. I wish I had stayed in touch with my friends. 5. I wish that I had let myself be happier. More here. To what extent is the "minimize future regret" heuristic a good one for making decisions? That heuristic's the driver behind my "always say yes" rule.

Liked what you read? I am available for hire.

Lectures for Basketball Coaches: Fatigue is Entirely a Mental Phenomenon

The last three summers I've coached at the best basketball camp in the East Bay. One big part of camp are the "defense" and "skills" lectures. I've wanted to do this for a while, but I'm not at camp, and I'm a way better writer than I am a motivator, so I'm posting my lectures here. This is Part I in a series of posts. Close your eyes. I want you to raise your hand if you think pain is a good thing, if it's good that the world has physical pain. Okay, you can open your eyes. Now I want you to describe what a world without pain would be like. Your mom is cooking dinner and tells you to bring a pan from the stove to the table. The pan is burning hot, but you can't feel pain, so you grab it and bring it to the table. When you look at your hand, it's red and covered in blisters. Or you are playing around with a friend and he starts twisting your arm. Usually if it hurts too bad you would say "Uncle," but you can't feel it hurt, and you keep fighting until he twists your arm out of its socket. I could go on - you step on a sharp object in bare feet, etc. If we didn't have pain, we might end up doing a bunch of silly things and have no idea that we were hurting ourselves. So pain is our body's way of telling us that we need to stop what we're doing because if we keep doing it, there could be long term effects. Okay, now think about fatigue. Raise your hand if you think getting tired is a good thing. Okay. Well, let's imagine that you never got tired. You're on the track team and running a marathon. Because you don't get tired, you feel great and practically sprint the whole thing. You're in first place by a mile, all the way until mile 20, when your muscles collapse from lack of energy and you fall in a heap on the track. Even though people compete and exercise all day, it's pretty rare that someone collapses because their muscles fail. Why? Because we get tired and stop long before we get to the point where our muscles fail. So fatigue is our body's way of saying, "you need to keep some energy in the tank," because it was hard to tell when you'd need those spare reserves. Imagine being the most tired you've ever been, two hours into a practice, running sprints, when suddenly a tiger bursts into the gym, and you need to run for your life. Your brain is trying to make sure you have enough energy left to outrun the tiger. Well as it turns out, our brain is actually extremely conservative. That means that your brain starts telling you that you're tired way before you actually get tired. Scientists have done studies of people on treadmills. They'll take measurements of people who are exhausted - unbelievably tired, and what they find is that their muscles are actually fine, that they could keep going in theory. Their muscles aren't holding them back, their brain is holding them back. So what does this mean? When you get tired, your body is still ready to go. You have way more potential energy sitting inside you, ready to be tapped if you can will yourself to do it. The biggest enemy is your brain. It's tough but you can train yourself to overcome your limitations, with practice. You have to push yourself every day a little further, and a little harder, than you did the day before. When you start hurting, tell yourself that you're not tired and go harder. It's not something everyone can do, which is why you have to practice every day and push yourself to your limits.

Liked what you read? I am available for hire.

Play up the difficulty of genius to preserve your own impressiveness

Two podcasts I listened to on BART this morning both addressed the same topic: the differences between successful and 'average' people. On Radiolab, Malcolm Gladwell talked about how we're comfortable saying that there's some innate difference between average people and geniuses, but how it's very uncomfortable to say geniuses are just people that love what they're doing more than everyone else. He cited Gretzky, who watched hockey games when he was 2 and cried when they were over, as someone who was so passionate about the game that that was all he could think about, and that's what made him so good - he always wanted to practice more and try out new things, because hockey was his life. Then on This American Life this guy was discussing how we the people expect startups to have some mythical creation story and to be founded out of adversity. There's a lot of emphasis on building something out of a garage, or building a newer, better tool because getting something done, like uploading a video, was too hard before YouTube. While people should get excited to hear that there aren't vast differences between themselves and so-called geniuses, many people get very uncomfortable, because it makes their own lack of accomplishments even more unimpressive. That's especially grating when you've built a career around doing what you're doing, and you spend the majority of your waking hours working in that area.

Liked what you read? I am available for hire.

Have interesting conversations

Solid advice from Scott Adams, the author of Dilbert, on how to have interesting conversations:
As a general rule, the more dangerous or inappropriate the conversation, the more interesting it is. You'll have to use your judgment to know when you've crossed the line. Also as a general rule, conversations about how people have or will interact are interesting, and conversations about objects are dull. So steer toward topics that involve human perceptions and feelings, and away from objects and things. You also want to avoid any topic that falls into the "you had to be there" category. For example, if someone is describing a vacation, avoid asking about the food. Nothing is more boring than a description of food. Ask instead if the person answered email from the beach. That gets to how a person thinks, and how hard it is to release a habit. And it could provide an escape route to move the conversation to yet another place. Sometimes it takes two or three bounces to get someplace of mutual interest. You've heard of the Kevin Bacon game, where every actor is just a few connections away from Kevin Bacon. Likewise, you almost always have something interesting in common with every other person. The trick is to find it. As with the Kevin Bacon game, you'd be surprised at how few questions it takes to get there.

Liked what you read? I am available for hire.

How to give to homeless people

From someone who has been homeless, a good discussion of the pros and cons of different ways of responding to beggars.
The problem with giving panhandlers money is severalfold. First, you provide economic incentive for panhandling. While I have long since gotten over my hatred of the homeless, I still hate people coming up to me every few minutes, interrupting my conversation to ask for money. It also enables an alcohol or drug habit that keeps that person complacent in their situation. I could go on about how our individual guilt adds up to an unacceptable, unofficial, welfare state, but let’s keep this to you and me. Second, giving money to the homeless is expensive. A dollar here, a dollar there—you’ll be out a hundred bucks by the time the week is over. Maybe you don’t mind the money, but you will mind the frustration, as the same person asks you for money night after night and you realize you’re not accomplishing anything worthwhile. Ignoring the homeless, or begging off, carries its own problems. For one thing, from the perspective of the panhandler, being ignored only confirms their hatred of humanity. Eventually a person who is ignored starts to escalate their behavior, just to get a reaction. Talking to them, learning their names, and explaining why you don’t have money for them just infuriates them more. It also takes a lot of time, worsening the interruption.
He recommends not giving food. The author has a good solution:
Here’s what you do: pick up a pack of the cheapest cigarettes you can find. You should be able to get a pack for less than $5—That’s 20 homeless encounters at less than 25¢ each. Make sure it’s a brand neither you nor anyone you know would smoke. This sets up a separate budget so you can give without worrying about your own needs. When someone asks you for money, say you don’t have any, then offer them a cigarette. In my experience, no homeless person has every not taken a cigarette, nor asked for money in addition to the cigarette. Most of the time they don’t even light it—saving it either to savor later, or as a kind of currency. Instead, they walk away and leave me alone, barely interrupting the conversation at all.
One of the toughest parts of living in India was finding a way to interact with beggars that didn't leave you feeling like shit for the rest of the day. I made donations instead.

Liked what you read? I am available for hire.