Non-stop Work

2 #

This week has been pretty exhausting already. For this term, it looks like Wednesday nights are my only “free time”. So far, I’ve been working almost non-stop from Monday to 6PM today on various assignments and this really tough Ch 21c set that took about two whole days to complete. Well, at least I can rest just a little bit until tomorrow.

Tags: | | |

Studying for Finals

0 #

Wasn’t much going on these past days. I’ve just been studying for finals. I did go to Daikokuya Ramen in LA with a bunch of people in my house’s alley which is supposedly one of the best Ramen places around LA (according to two people in my alley). But I didn’t think it was all *that* great.

Tags: | | |

After much research, I’ve discovered that…

0 #

After much research at Caltech, I’ve recently made two important discoveries:

  1. In order to keep shirts from coming out of the dryer from being wrinkly (and thus causing people to think that you sleep in your clothes all the time), I realized that one must: (1) Use less detergent. (2) Use less fabric softener. (3) Put a smaller load into the dryer (so that the clothes come out fully dry). (4) When you load the dryer, try to pack it by clothes density type. This means putting the jeans, rougher stuff, and wrinkle-okay items (like socks, boxers, etc.) towards the back while putting the shirts closer to the dryer door. The result is less folding and distortion of the shirts. (5) When you unload the dryer, put the jeans, rougher stuff, and wrinkle-okay items in the hamper first. Then put the shirts on top (sometimes, it’s good to even to a semi-quick folding of the shirt). This minimizes compression on the shirts.

    Now I am finally able to get wrinkle free shirts.

  2. Dust wipes commonly sold under names like Swiffers or pledge wipes are just made to be disposable microfiber cloths. Well, the companies seem to want you to throw out the cloths after using them so that you can continue buying from them. However, there’s no reason to suggest that they cannot be reused. And thus, I’m here to report that they can be reused!

    The trick, I think, is to use hot water and soap/detergent to wash the cloths. The heat is necessary for the microfibers to expand (hereby releasing the dust and other stuff trapped in there).

    I tested this idea on a very small piece of dust cloth (like 2 in. by 3 in. area), and I reused it 4 times before I decided to just throw it away (mainly because the fibers in the cloth were becoming scratched up). The dust trapping ability doesn’t seem to decrease much at all in between washes. I daresay that one can reuse such cloths for >10 times if one is careful with it.

Junior Year at Caltech Begins

5 #

Well, junior year at Caltech begins on October 1st, but I’m leaving for Pasadena tomorrow. This school year is going to be pretty tough, but somehow, I feel optimistic about it. While Caltech sucks (in the usual sense and in the sense that it sucks all the free time and life out of you) and while this image resonates true:
Caltech, where your best just isn't good enough
I feel optimistic about my junior year. Part of the reason could be that I’m off the core courses so now I’m fully taking courses that I choose (so I’m especially interested in them). Part of the reason could be that after two years of schooling, I think I finally have the hang of things. So I think I’ll be able to manage my time better. Speaking of time management, I’m going to make an even bigger effort this year to reduce my procrastination time. I keep telling myself: “The key…is time management. If you can manage your time correctly, then you won’t die a drawn out, painful, and untimely death…” (or something like that)

Thoughts on Programming Languages for Scientific Computing

7 #

I have a friend who works in chemistry / protein folding and thus does a lot of computational stuff within that field. Coming from an application/web programming background, I was utterly shocked when she mentioned that FORTRAN is widely used in computational simulations. The great programmer Nietzsche once declared that “FORTRAN is dead”, and I held that belief too, thinking that FORTRAN was only used in the days when C and C++ weren’t developed and programmers didn’t have anything else. I didn’t know a single person who uses FORTRAN.

But I was wrong. It turns out that FORTRAN is still actively used in scientific computing. In addition, it is not an “outdated language”. FORTRAN actually has quite a few versions which have evolved and added on modern programming languages features over the years.

The biggest draw of FORTRAN is speed. It’s one of the lowest level out of all the high level programming languages (like C, C++, Pascal, Java, etc.). The language, intended for scientific computing, was designed to be fast. In comparison, languages like C and C++ were designed as general purpose languages that could be used for a variety of purposes.

But I wasn’t totally sold on FORTRAN. I don’t like the syntax and rather code in C++ any day. I didn’t believe that C++ was all that much slower than FORTRAN so I decided to do some research into this matter. The following comes from an email I wrote:

  1. FORTRAN is widely cited to be “20% to a factor of ten” faster than C++. I didn’t find anything for C, but I think the speed of C is about the same as C++.
  2. However, the data in #1 was published in 1997. In the modern day, C and C++ compilers have been heavily optimized to produce speeds comparable to FORTRAN. Some modern benchmark results are here:

    (These two benchmarks show FORTRAN to be about the same as C/C++
    depending on how the code is written and compiled)
    http://dan.corlan.net/bench.html (maybe around the year 2000)
    http://dan.corlan.net/amd64_dual_core_benchmarks.html (newer version)

    (This benchmark shows FORTRAN to be much slower than C/C++. Java is
    even faster!)
    http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all

    (This benchmark shows C++ being slightly faster than FORTRAN)
    http://pauloherrera.blogspot.com/2006/12/introduction-ive-read-lot-of-things.html

  3. In addition, there is a library for C++, called Blitz++, which allows C++ programs using the library to approach the speed of FORTRAN. Benchmarks are here:
    http://www.oonumerics.org/blitz/benchmarks/
    (Note the percentages, ie. 95.7%, is the speed relative to the
    comparable FORTRAN program. So 100% is the same speed.)

    Also note that the benchmarks for Blitz++ were completed in like the year 2000. I expect if the same benchmarks were run today with modern compilers, the results would be even better.

  4. Therefore, I conclude that C/C++ is comparable to the speed of FORTRAN and depending on what you are doing and how you write the code can be faster than FORTRAN. So it depends on your preference of the programming language. I would probably always pick C++ over FORTRAN since I am more familiar with C++ and I think C++ code is easier to write and read.
  5. Surprisingly, python *can* be really fast. See:
    http://scipy.org/PerformancePython
    Of course, it will never approach the speed of C++ or FORTRAN, but Python code can be very easy to write and for medium sized projects, you can write the code much faster.
  6. Surprisingly, Java *can* be faster than C/C++. This is largely attributed to compiler optimizations that Java can do that C/C++ can’t do. See:

    http://www.idiom.com/~zilla/Computer/javaCbenchmark.html

    http://www.kano.net/javabench/ (see links at bottom of the page for more java vs c++ benchmarks)
    http://www.kano.net/javabench/data (good graphs)

    In my opinion, Java code is easier to write than C++ code. You might also get advantages of portability since Java code can pretty much run on any computer unmodified.

  7. Unsurprisingly, Matlab is slow. Even when Matlab code is optimized, it is at least 2 times as slow as comparable C/C++ code. Unoptimized, it can be 30 times or more slower! Of course, the good thing about Matlab is that you can easily write programs that perform math — much faster than with C/C++, Java, Python, or FORTRAN. So Matlab might be good to test an idea or implement something on a small scale.

Overall conclusion: C++ speed is about the same or only a little bit slower than FORTRAN. As C++ compilers become more optimized, the difference decreases. Java seems pretty fast, so I would probably do more research on it. If it *really* comparable to C/C++ speeds, I would probably use Java. For medium scale applications, I would use Python. For small scale applications, I would use Python or Matlab.

Star with tail

1 #

NASA/Caltech recently found a star with a tail. Well, the cool part is that the principal investigator is Chris Martin, a Caltech professor who lectured for Ph 1b and 1c: E&M and Special Relativity. He’s a nice professor although he used a lot of “um’s, and ahs’s” in his lectures. One student counted a record of over a 100 um’s and ah’s in a single hour lecture!

Tags:

All done…

6 #

leaving for Philadelphia :).

Tags:

Obligatory ‘It’s so close..’ Post

2 #

Every time I’m about to take a bunch of finals, my brain somehow wants to write a blog post instead of actually studying for them. I usually write something like: “I leave for home in a week, but I have to get through all of these finals first. The end is so close, yet so far!”

Well, yeah, I just wrote it. This week: 4 finals (1 in class) + wrapping up research. Luckily, I spent last weekend writing an essay due this week so I don’t have that extra assignment hanging over my head.

Every week has been so busy that I never even mentioned that I was doing research in the Goddard Group which has a focus on computational chemistry and material science. The project that I am working on (and currently wrapping up) is simulating Ruthenium based polypyridine dyes on a Titanium Dioxide surface using the ReaxFF force field (which was developed by one of my mentors here at Caltech). I really enjoy the computational side of it since that means I don’t have to be in lab running experiments. I can also see atoms and molecules and how they interact :). Also, the project directly relates to creating better solar cells, an area that I am very interested in.

I decided to eschew a potential SURF (summer research) this summer for the ability to focus 100% on creating an internet startup. Although I wanted to do both chemistry research and work on my startup, I knew that splitting my focus will lead to neither project being very successful. My startup idea is to develop a new type of wiki while providing services around it. I’m really excited about working on this project so it is kind of difficult to concentrate on my finals when I have this idea lurking in the back of my mind all the time. Summer is going to be awesome :).

Tags:

Created Wikipedia Article: N-Version Programming

1 #

I’ve been trying to contribute to Wikipedia more often these days, particularly in the sciences since I’m supposed to be knowledgeable in that field. Today, when I was writing a paper on electronic voting systems for a humanities class (PS 12), I stumbled upon a paper about a e-voting system that used N-Version Programming (NVP). Now, what is NVP? You ask. That’s a good question. I went over to Wikipedia to learn about it, but Wikipedia didn’t have an article on N-Version Programming! No way!

Well, I found out more about NVP through reading a few papers and decided to contribute back to Wikipedia by creating the article: N-Version Programming. That’s right, everything on that page right now should be my work (check the history to see if other people have modified it). It took me over about an hour to write the article and to reference the heck out of it. But overall, I’m glad I finally created an article in Wikipedia.

Most of the time, however, I’m making small edits here and there. You can view my list of contributions here.

Edit: Maybe in my paper, I should cite the wikipedia article and see if the grader thinks I’m plagiarizing off of the article :).

Tags: |

Caltech Ditch Day…Yesterday

5 #

Shoot, I should probably post something…right?

Uh, clocking in at only one day late, is my announcement that Caltech’s Ditch Day was yesterday!

Quoting my explanation of ditch day to a friend:

According to wikipedia: “On Ditch Day the seniors ditch school, leaving behind elaborately designed tasks and traps at the doors of their rooms to prevent underclassmen from
entering. Over the years this has evolved to the point where many seniors spend months designing mechanical, electrical, and software obstacles to confound the underclassmen. Each group of seniors designs a “stack” to be solved by a handful of underclassmen. The faculty have been drawn into the event as well, and cancel all classes on Ditch Day so the underclassmen can participate in what has become a highlight of the academic year. This year, Ditch Day falls on May 16, 2007.”

So I didn’t have any classes today! That was great! Unfortunately, the ’stack’ that I participated to solve wasn’t well designed, and it ended up mostly being “walk around campus to find things stack”. Some of the other stacks were much better designed with more interesting and cool puzzles to solve. Years ago at Caltech, the stacks were even more elaborate with people having to open locks, break down walls, use science knowledge to solve things…

Yeah, I’ve been busy…

Tags: