Day 5: Resolutions - 100 Days of Hacking 2015 5 months ago

Today was the first day of my second quarter at UC San Diego; I wasn't able to write any code since I was busy settling back into my apartment away from home and preparing for the rest of my busy, busy week of classes.

That said, I did get a chance to at least think about some code, but more importantly, some goals! One of the classes I'm taking this quarter covers basic data structures (and object-oriented design), and one of its lectures happens to be on Monday. This class is taught in three languages: Java, C, and C++.

I have experience with Java from my last quarter here, and I learned a lot; not just about Java, but about programming in general. But, despite years of trying to push myself to take a look, I have no experience in C or C++.

I'm in luck, since the syntax is not much different from Java, but some of the behaviors I'm used to from Java (and also some of the things I'm incredibly used to from my 8 years doing web development) are simply not present or vastly different in these other languages. Continue reading→

Day 4: Unicode and binary - 100 Days of Hacking 2015 5 months ago

I start my second quarter at university tomorrow, so today I find myself preparing to head back to San Diego. Since I'd like to get back to working on NiceBook, my Chrome extension for filtering content on Facebook, this will be the last time I write about binary for porbably the next few weeks.

For the past few days, I've been tinkering here and there with some binary -> decimal conversions, and particularly the other way around. You can see the result of that, a function in Javascript to convert from decimal to binary, in yesterday's post.

Having used text to binary converters before, I set out to make it myself and was surprised by how simple it was. I have a small demo up on github pages which you can find here.

If you've been following along with my earlier posts then there isn't much to explain. The only addition I've made is a function to take the user's input and pass the character codes it extracts into numToBinary(). Continue reading→

Day 3: Numerical bases and power representation - 100 Days of Hacking 2015 5 months ago

Today, I took on a simple hack. I was eager to explore more binary and bases, and having learned yesterday one way to convert from binary to decimal, I was interested in how to do it the other way around.

A quick aside: it was brought up that I was using the term "bit" incorrectly in yesterday's post. This was true—"bit" is short for "binary digit," so calling one of the values in a number in a different base than 2 a "bit" is actually incorrect. I'll call them place values, since that is what they are.

To extend on a concept I established in the previous post, the idea of performing the operation on two place values and then using that result as the first place value for the next operation, I'll refer to a pretty fundamental mathematical concept. A number in base 10, say 145, can be represented as the sum of products of powers of ten. Each power of ten represents a place value, like 10^0 representing the ones and 10^3 representing the thousands and so on. Continue reading→

Day 2: Understanding binary and hexadecimal - 100 Days of Hacking 2015 5 months ago

Today, I decided not to work on NiceBook. Instead, I sat down and got to work understanding binary and numerical bases. The only prior knowledge I have with this is the following:

  • Binary is 1s and 0s.
  • Hexadecimal is 0-9 and A-F, where the latter represents the numbers 10-15.
    • I also know that the hexadecimal color code #FFFFFF maps to the RGB rgb(255, 255, 255). Very helpful!
  • This numberphile video explaining the base-12 counting system.

So I gave myself a challenge of understanding how to convert between decimal, hexadecimal, and binary. I allowed myself to Google things like "16 in binary" to see the result of the conversion, but understanding how it happened was up to my imagination.

The second bullet in the list above was something I learned in my first CS class at UCSD this past quarter—Intro to Java & OOP. Continue reading→

Day 1: 100 Days of Hacking 2015 5 months ago

First of all, happy new year to any readers. Wishing everyone happiness and health!

Today, I'm starting a great project called "100 Days of Hacking." Every day, for 100 days, I'll spend a little time hacking something—tinkering, programming, producing something—and write a blog post about it.

I think this is a great exercise to improve and grow as a programmer, so I encourage all of you to take on the challenge. If you decide to do it, leave a comment with a link to your blog—you'll be featured on a participants page on Robert Rouhani's 100 Days of Hacking blog.

So without further ado, here are my results from Day 1!

Day 1: Data upon data

I'm working on a Chrome extension that will filter negative content from Facebook news feeds. I've made considerable progress in the last few days and just need to implement the actual algorithms to calculate a sentiment score for each word. Continue reading→

A Case for College 5 months ago

Every high school senior in America is standing knee-deep in the quicksand of their imminent future. Not far behind them are a handful of their junior peers, an eager bunch of their freshmen and sophomore classmates, and fewer yet of their sixth, seventh, and eighth grade acquaintances either smothered by their parents' gerrymandering or convinced they need a head start to be successful. For some, the decision is between colleges they've been accepted to; for others, it is between where they will spend their gap year; for many more, it is between jobs to sustain their poverty-stricken families.

Whether or not college is in their future, young people are struggling to make the decisions that will lead them through the coming years. But increasingly, young people like ourselves are bombarded with rants, reports, and editorials denouncing college; we are told that it is useless, that it has failed our generation, and that it is a bad investment. We continue to be shamed as a population, humiliated even, by the growing opposition to college and institutionalized education. Continue reading→