nemorathwald: (Default)
2009-01-26 08:30 pm
Entry tags:

Java Homework #3

Any advice on a quick tool to preserve code formatting in a blog post?

The assignment. )

My solution. )
nemorathwald: (thoughts)
2009-01-17 05:25 pm

Python Version of My Java Homework

[livejournal.com profile] le_bebna_kamni knows Java really well, which has come in handy for tutoring, I can tell you.

However, she also has a copy of "Beginning Python From Novice To Professional" by Magnus Lie Hetland lying around. Since Python is the language I want to make actual real projects in, I was curious. So I decided to do my homework again, in Python. This time it was six lines long.

However, I decided to take it further. The new version properly uses singular and plural English. In other words, it will say "1 hour" instead of "1 hours."

My Python script. )
So while I was doing this, she also did the exercise in Python, except she didn't want to type the singlular/plural decision into her version three times like I did. She felt it was more elegant to make one set of pluralization instructions and have Python repeat it for hours, minutes, and seconds. She cursed at the computer for a half hour and came up with the version she will post in the comments.

I do not curse at the computer. I expect coding to be painful, and have been pleasantly surprised to be proven wrong.

pain = False

if not pain:
    gain = False
nemorathwald: (Default)
2009-01-14 04:56 pm
Entry tags:

Java notes

Halfway break in Java class. Read more... )
nemorathwald: (Default)
2009-01-12 05:33 pm
Entry tags:

Today's Flashcards

Over the holidays I started reading the textbook and creating flashcards in Supermemo on my handheld. These are the ones that were discussed in the first class. Let me know if you know a better way to put the questions, assuming that's your kind of thing.

Read more... )
nemorathwald: (Default)
2009-01-12 04:00 pm
Entry tags:

Intro To Java

I walked into the first class of Intro To Java and it was totally quiet. I sat down and the guy behind me asked me, "Hey, why do people learn Java?"

"What do you mean?"

"Like, why are you taking it?"

"To learn programming. It was that or take C++. Then I'll teach myself Ruby and Python."

"So, like Javascript? Javascript is a subset of Java?"

"No, they really shouldn't have named them alike."

"But Javascript's embedded in all the browsers."

"Yeah, it's like a monopoly so we have to put up with it."

"But Java ... what do people choose Java for?"

"The answer to that depends on as opposed to what."

"Like, what is Java good for?"

"The corporate world developed it so they trust it. Also it runs on different hardware platforms."

Now it has gone back to complete silence. The teacher hasn't started, so I'm blogging.