Archive for November, 2006

How UCs count words

var initial_whitespace_rExp = /^[^A-Za-z0-9'-]+/gi;
var lastpos_whitespace_rExp = /[^A-Za-z0-9'-]+$/gi;
var non_alphanumerics_rExp = /[^A-Za-z0-9'-]+/gi; 

// countField - field stores count
function wordCounter(field, countField)
{
	var fieldValue = field.value;
	if (fieldValue.length == 0)
	{
		countField.value = 0;
		return;
	}
	var fieldSplitLength = fieldValue.split(non_alphanumerics_rExp).length; 

	var browserTestLength = ".x.".split(non_alphanumerics_rExp).length;
	if (browserTestLength > 1)
	{
		// space before and after
		if (fieldValue.search(initial_whitespace_rExp) > -1) fieldSplitLength--;
		if (fieldValue.search(lastpos_whitespace_rExp) > -1) fieldSplitLength--;
	}
	countField.value = fieldSplitLength;
}

This thing was annoying to understand. Now that I decided to look at the source, it makes more sense.

Basically here’s what it means: it (1) splits the input by strings of one or more non-alphanumeric characters (UCs consider alphanumerics to be 0-9, a-z, A-Z, hyphen/half-dash (-) and apostrophe (’)) then (2) counts the number of elements. What that means is, if you want to save words use two hyphens (–) instead of dashes, and single quotes (apostrophes ‘) instead of double quotes, unless it becomes absolutely necessary for you to do otherwise.

Comments (3)

Sheehans

“Hey, I’m a Sheehan, therefore I must make a good peace activist!”

Too bad you’re 76, pal. But try this with someone and see if (s)he gets it: “Hey, wanna help me promote world peace on the 22nd of December?” Let’s just hope we don’t get a mini-baby-boom every mid-September <_<

Comments (2)

Less than 1/200th of the World has Computers

According to Ms Bergantz, if the world were shrunk down to 100 people with all ratios kept, not even one person will own a computer. Since 0.5 would be rounded up to 1 we can safely assume that less than 0.5% of the world’s population owns a computer (or multiple computers). You know, 0.5% of 6 billion (world population) is 30 million. There definitely are more than 30 million computer users in the world. I bet America alone has 6x as many computer users as that.

Perhaps she’s just really old and is trying to recite facts from 10 years ago (when this may have been true) as modern, up-to-the-date fact. But either way, I don’t like having to digest wrong things.

Oh by the way, 72 dollars a year is so not more than 6 dollars a day…. (the former is the supposed per-capita annual income of a typical person in Honduras while the latter is the daily wage of a typical Haiti worker… although I “learned” in Government class today that Haiti is this hemisphere’s poorest nation?)

Comments

Shame, Mr Rodriguez!

Witness with your very eyes the reactions of our orchestra conductor!

    Me: http://www.antara.co.id/en/seenws/?id=23282
    Me: When will celebrities ever learn?
    MrR: ooo
    MrR: I hope its gets out
    Me: ROD
    MrR: why do celebrities get married so quickly
    MrR: thats why they get divorced so quickly
    Me: cuz they’re always around hot people who’ll pop off their pants in a second. duh
    MrR: I would pop off my pants for britney spears in a second
    MrR: and so would you…don’t lie

Gasp. Although, on retrospect, if hollywood celebrities can “get” another one in an instant why do they need to marry? Tom… some thing… didn’t marry his fiance and had a kid, I think.

Comments (7)

Potential Majors I’m Considering

in order of degree of likelihood:

  1. Engineering

      Computer-Science
      Aerospace
      Biomechanical
      Molecular Biology
      Nuclear
      Electrical
      Mechanical
  2. Pure mathematics or physics or chemistry
  3. Business (general)
  4. Economics
  5. Maybe even political science/foreign relations

So as you can see, Engineering is the largest, but there are other things I like too. What are you guys considering?

Comments (3)

California Voters Lack Insight

Looking at the dismal results of the California General Election of Tuesday, November 7 2006 greatly irritates me. On almost all of the propositions, I disagreed with the results (Results for 85 and 90 are the only ones I agreed with). Some of the more notable ones I will discuss.

Proposition 1A: Restricting transportation funds
Restricting funds is never a good idea, especially when a single emergency will render the budget helpless — in such cases, transportation funds should be siphoned temporarily to solve the emergency and later returned with interest.

Propositions 1B-E: Bonds
These are just bad because of the amount of borrowing we have to do (the amount of money the current generation is taxing us). They borrow 37.25 billion dollars total, but with them comes a heavy interest of nearly 100%! In addition to the 37.25 billion dollars in principal funds WE (the next generation) must repay, there’s also a heavy interest of 36.1 billion that goes to nowhere but the thick pockets of investors.

Proposition 83: punishment, residence restrictions and monitoring for sexual predators
Really, this is just too much. (1) First of all, the current law is strict enough — they (sexual predators) can’t go near parks or schools. (2) Secondly, this will cost us billions a year — money we can spend elsewhere. Those billions can provide health care for 2 million impoverished kids. As gruesome as this may sound, giving 2 million kids a healthy life is more utilitarian than protecting two girls from a random rapist. (I don’t mean to sound uncaring or lacking compassion, but this is just not a positive on the cost-benefit analysis chart) Or better yet, educating the kids better how to take control of their lives (and not become rapists and criminals when they grow up) would serve us even better. (3) And thirdly, it is a violation of their rights as humans. I don’t think it is fair that they will be tracked by GPS for the rest of their lives, for example.

Proposition 84: Water quality, natural resource protection, BONDS
The main reason why I am against this is the use of bonds, which will borrow 5.4 billion dollars (with 5.1 billion dollars in interest alone). And from the website ( http://www.voterguide.ss.ca.gov/props/prop84/prop84.html ), there will be “reduction in local property tax revenues of several million dollars annually” and “unknown costs, potentially tens of millions of dollars per year, to state and local governments to operate or maintain properties or projects acquired or developed with these bond funds.” So as you can see my main objection is fiscal. There are ways of doing this without putting us in heavy debt.

Proposition 86: Cigarette Tax
I actually think the 13 cents increase in tax per pack is abysmally low, but even that didn’t pass. This was one of the propositions I feel most strongly about. (1) Firstly, it will bring 2.1 billion dollars annually in additional revenue. (2) Secondly, it will reduce smokers in California. And (3) Thirdly, because of the reduced number of smokers, experts predict a significant drop in health care costs for the state, so the savings + increased revenue can become very significant. This large sum of additional revenue can be used to educate the people (educated people make smarter decisions in general), cover more people in Medicaid, and advance top-level research on disease curing drugs (or something like that).

Proposition 87: Alternative Energy Funds and Tax
This is another one of the propositions I feel very strongly about. It sets the goal to reduce petroleum consumption by 25%, increase research in alternative energy and energy efficient technology, and fund education. It will gather the 4 billion dollars it needs for this project through a 1.5%-6% tax on oil pumped in California (depending on price per barrel), and prohibits the tax from being passed on to the consumer. So yes, the 70 million dollar campaign ads paid for by the oil companies lied to you: this will not lead directly to increased prices at the pump for the consumer. And even so, 1.5%-6% is very insignificant. It will help curb petroleum use, definitely, and make California the world leader in clean technology. That thing has lots of exporting capacity, if you think about it, so this is a + for the economy.

The other ones I don’t care as much about.

Comments (14)

Standardized Testing

I guess I’m done with it. My SAT score is relatively low compared to everyone else’s, and I don’t think the writing score represents how well I write and how good my grammar is (I got a 640 on writing, and I think my grammar and writing skills are better than the 640 indicates). But I’m not going to be an author, journalist, political scientist, or historian; I’m going to be some kind of mathematician, physicist, chemist, biologist or engineer: I know I have the necessary communication kills in technical subject areas so I am sure I’m prepared. Too bad the admission officers won’t know that… but I really don’t want to take the SAT again.

But I’m done with SAT2s (I’ve never taken and will never take ACTs, although I’d do better on it because of the extra science section). Two 800s on the subject areas (Math II and Chem) that I will use most is pretty indicative of my preparedness. Unfortunately, SAT2s questions on math and science are too general (Come on, the SAT2 history was hard. I got a … 740…) and so doesn’t accurately gauge how much science or math the tester knows.

Comments (6)

Subscriptions

A couple weeks ago, I coded in the subscription system (to mimic Xanga subscriptions, and to fulfill the promise I made several months ago that I would), which basically emails subscribers with the updates I make here. However, some people have contacted me to be removed from the subscriptions list. If you are currently a member here and do not want to be subscribed, just say so here.

Comments (5)

Another hard SAT math question

This is a “hard” SAT math problem:

The length of rectangle S is 20 percent longer than the length of rectangle R, and the width of rectangle S is 20 percent shorter than the width of rectangle R. The area of rectangle S is

A. 20% greater than the area of rectangle R
B. 4% greater than the area of rectangle R
C. equal to the area of rectangle R
D. 4% less than the area of rectangle R
E. 20% less than the area of rectangle R

Comments (4)