thank you, everyone
June 19, 2008
Thanks to everyone who gave me birthday greetings. I know these words may seem to be just that, words, but believe me when I say that each of you took the time to Facebook, text, leave a message, e-mail, or call me (and to those that just forgot) have a played a special part, small and large, in shaping me to be the person that I am now. I value each of you individually and would like to embrace you with my thanks. I will try my hardest (that’s what she said) to get back to you all individually.
Paolo
Rebecca
Ji
Justin S.
Pat
Nate
Chehk-a-leng-leng
Mumta
Charmaine
Mike N.
A.C.
Daryl
Amy
Laura
Mark
Michelle
Karin
Azzano
Catherine
Donnel
Shawna
Sundeep
Joyce
Dom
Lindsay
Wayne
Arby
Gagan (Hurrcut)
K. Doy
Geoff
Jonas
Nick
Josh
Jupac
Leila
Pat
Andrew T.
Angela
Bryan
Rob
Eric
Maureen
Ate Sharon
Caitlin
Katrina
Jojo
Seth
Jinky
Jackie
Justin Yoo
Lisa
T. Janette
Chris
Hannah
Seece
Chadleey
Ryan
Ate Lally
Andrew S.
Cheryl
Deeds
Dale
Clay
Jeffrey
I just spent near a half hour trying to make a sorter to sort all these names in alphabetical order. I need to do these things to keep sharp. Unfortunately, it’s not working at the moment so they are there in random-ish order. Here’s my code, try to see if you can debug it. Don’t ask me why I went from array lists to arrays. This is to Java 6 of course.
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.util.ArrayList;public class Sorter {
FileInputStream fis;
InputStreamReader isr;
BufferedReader br;
ArrayList<String> arr;
String[] str;public void main() {
isr = new InputStreamReader(fis);
br = new BufferedReader(isr);
arr = new ArrayList<String>();this.toArray(br, arr);
this.sort(arr);for (int i = 0; i < arr.size(); i++) {
System.out.println(arr.get(i));
}str = this.sort(arr);
for (int i = 0; i < str.length; i++) {
System.out.println(str[i]);
}}
private void toArray(BufferedReader br, ArrayList<String> arr) {
String temp;
try {
while ((temp = br.readLine()) != null) {
arr.add(temp);
}
} catch (IOException e) {
System.err.println(”IOException: “);
e.printStackTrace();
}
}/**
* Code adapted from Code Codex
* http://www.codecodex.com/wiki/index.php?title=Bubble_sort#Java
*
* @param arr
*/
private String[] sort(ArrayList<String> arr) {
String[] strArr = (String[]) arr.toArray();for (int k = 0; k < arr.size() - 1; k++) {
boolean isSorted = true;for (int i = 1; i < strArr.length - k; i++) {
if (strArr[i].compareTo(strArr[i - 1]) < 0) {
String temp = strArr[i];
strArr[i] = strArr[i - 1];
strArr[i - 1] = temp;isSorted = false;
}
}if (isSorted)
return strArr;
}return strArr; // bugfix
}public Sorter() {
}
public Sorter(String filename) {
try {
fis = new FileInputStream(filename);
} catch (FileNotFoundException e) {
System.err.println(”File not found: “);
e.printStackTrace();
}
}
}
on: today (redux) and yesterday
March 26, 2008
I’ll take a brief break from studying.
I was thinking about what I was supposed to write today, but I can’t remember (note to self, when you have something to write about, write away right away).
Anyways, I’d like to comment on my previous entry like a bone.
I lied.
like a bone
March 24, 2008
…dry, that is.
I haven’t had much to say because I simply didn’t have much to say. And readership has been dwindling as a result.
on: today
March 19, 2008
I’m going to be starting a new series of called the “on:”. Here I’ll be focusing on whatever is in the latter portion of the “on:”. Among simplicity are intuitive, minimalistic in my list of favourites.
Today is a day unlike any other. It differs from yesterday. Sure, you may have done the same things today that you did the one before, but every instance of today is far different from yesterday.
You’re a different person from how you were yesterday. It’s a matter of fact. Every time your DNA replicates, it fails to make a complete copy of itself and truncates a little amount of yourself. You are who your DNA is.
Aside: how much does environment play a part in development and how much is predisposed?
The day is different. The clouds above you are from a place different than those that were above you yesterday. I’ll take a stab in the dark and say that these clouds are those that floated above the great plains of Africa.
In short, today is a new day and yesterday is something that can never be achieved.
But, then, why does yesterday hold so much weight, or does it?
everything has been figured out…
February 18, 2008
…except how to live life.
– Jean-Paul Sartre
20 Things I Wish I Had Known When Starting Out Life
Number 12:
The people you make friends with are so much more important than your job or the things you buy. I’ve had a few jobs, I’ve bought a lot of things, and I’ve made a few friends over these last 15 years. Of those, the only thing that still matter to me are the friends. And I wish I could have spent more time with friends (and family) than on the other things.
Source: zenhabits.net
The author’s compiled a list of some of the things he wished he knew earlier in life. It’s definitely worth a read or two if you have the time.
Have a stellar Monday–
tim