Had a great first week at Meredith

I started this week as a frontend developer for the parents.com team at Meredith. It’s been a very fun week.

  • The people are super nice and I got my local workspace & server set up in 2 days to which the local considered a new record.
  • I got my computer & keyboard elevated so I can now stand and type but of course if I want to sit, I have a high chair to sit on.
  • My cube is a lot bigger than my old one so I will need some time to fully decorate it. It’s big enough for me to lay down a yoga mat so I will be doing that LOL.
  • With my high chair, I can see the windows along the hallway so it’s like having a window view.
  • Here’s what I’d see from my window minus the nasty weather!!
  • Tried out the cafeteria and it’s convenient.
  • Already went to the yoga class at their fitness center and love the instructor. I will definitely be going to the yoga classes frequently.
  • Played with swipejs and codrops slide menu to design a small project prototype the mobile first way. Here’s what I got so far.

Overall, a great start! I’m happy ^__^

ISL像一场重感冒

我知道我这样说最终会让别人误会。我现在的感受好似徐怀钰的那首《爱像一场重感冒》。不但像,要走时我还真生了一场重感冒 。如果说ISL是一场三个月的恋爱真不算夸张。我现在像刚和男友说了分手般心酸。人一生的感情真是微妙。事业和爱情原来可以相提并论。事业上的爱恨情仇也是可以刻骨铭心的。

分了或走了,甜蜜回忆却上心头。英语因该说是bittersweet。我知道雨过天晴后留下会是美好。一番人生体验。学习到了新的技术。交了好些新朋友。

哦,ISL,虽然我们未能一起走到最后。我会常常想念你。像想念我的初恋男友一样。

在这我留给读者在我脑中的歌词。

徐怀钰 《爱像一场重感冒》
词:姚若龙
曲:Eric Lee

写了封信给你 好像依依不舍
刚寄出去马上又后悔了
多希望邮差能把地址看错 或是弄丢了
因为你是真的 和别人不一样
不然我不会那么感伤
但是我已爱到不能爱 让到不能让
还能怎样 不如倔强
倒数三秒 我会开始努力把你忘掉
有时候爱情就像是一场重感冒 等烧退了就好
找一天将心情当房子好好地打扫
我喜欢每次丢掉多馀的东西 那种轻松美好

How to STYLE a table using CSS (JSF examples)

Tables are very important parts of the web interface. They are (hopefully) used for tabular data. It is one of the oldest and most basic HTML presentation tag but in order for it to smoothly fit into the new CSS age, we need to look at the most practical way in correctly setting up the markup and the CSS.

Nowadays, we no longer wish to make separate instances of a similar application for different clients. We want to thrive on making a single application that will fit the needs of as many clients as possible. This task is very challenging. In my opinion the ideal situation is to have the clients and developers both understand the benefits of the end goal and compromise to reach it. As developers we can always dream to have a single application reach the level of customization we can accomplish with many separate applications and yet don’t confuse the heck out of the end users. While I am unsure if that’s ever a possibility, I know ways that might help get us closer.

One of the biggest challenges is to give each client who uses the same application their own unique UI presentation. This is no small task and I only plan to address a small issue you might encounter in accomplishing this task. That’s how to mark up a table with the most amount of UI flexibility.

A traditional table might look something like this:

<table>
<tr>
	<th>
		Name
	</th>
	<th>
		Phone number
	</th>
	<th>
		Date of birth
	</th>
</tr>
<tr>
	<td>
		Mike White
	</td>
	<td>
		123-456-789
	</td>
	<td>
		10/11/1976
	</td>
</tr>
<tr>
	<td>
		Nancy Green
	</td>
	<td>
		987-644-311
	</td>
	<td>
		02/24/1950
	</td>
</tr>
</table>

With no CSS classes specified in any elements, it will be hard to style this table with much customization. You can add styling to the table, tr, th and td tags but they will have to be uniformly defined. You will have a lot more flexibility if add more classes to each element like below:

<table class="people" cellpadding="0" cellspacing="0" border="0">
<tr>
	<th class="first">
		Name
	</th>
	<th>
		Phone number
	</th>
	<th class="last">
		Date of birth
	</th>
</tr>
<tr class="odd">
	<td class="name">
		Mike White
	</td>
	<td class="phoneNumber">
		123-456-789
	</td>
	<td class="dateOfBirth">
		10/11/1976
	</td>
</tr>
<tr class="even">
	<td class="name">
		Nancy Green
	</td>
	<td class="phoneNumber">
		987-644-311
	</td>
	<td class="dateOfBirth">
		02/24/1950
	</td>
</tr>
</table>

Notice I applied classes to the table, each of the alternating rows and each of the columns. And also notice I added

cellpadding="0" cellspacing="0" border="0"

to the table tag. This is very important since CSS does not have direct cellpadding and cellspacing controls, you cannot take away the natural cellpadding & cellspacing each browser applies to all tables. It’s the best to set them to 0 and control everything via CSS.
Since I’ve been working with JSF, I will give an example in JSF. The t:dataTable tag can very easily generate the table markup above.

<t:dataTable value="#{myList}" var="list"
	styleClass="people"
	cellspacing="0" 
	cellpadding="0" 
	border="0"
	rowClasses="odd,even"
	columnClasses="name,phoneNumber,dateOfBirth">
	<t:column headerstyleClass="first">
		<f:facet name="header">Name</f:facet>
		<t:outputText value="#{list.name}" />
	</t:column>
	<t:column>
		<f:facet name="header">Phone number</f:facet>
		<t:outputText value="#{list.phoneNumber}" />
	</t:column>
	<t:column headerstyleClass="last">
		<f:facet name="header">Date of birth</f:facet>
		<t:outputText value="#{list.dateOfBirth}" />
	</t:column>
</t:dataTable>

Now we have the markup, let’s go thru a simple table styling.

The first things I’d start with are these:

table.people {
	width: 100%;
	border-collapse: collapse; /* so we can control cellspacing in a practical way */
}

table.people th,
table.people td {
	padding: 5px;
	text-align: left;
	font-family: Arial, Verdana, sans-serif;
}

Let’s see how it looks:

I usually apply border-collapse: collapse on the table so you can control the border width with td tags and without seeing double borders between cells. The padding on td & th tags really work just like cellpadding inside of the table tag. Except you have more flexibility now as if you really want, you can have different paddings for every cell.

Now let’s add some border.

Change the previous th,td styling definition to below:

table.people th,
table.people td {
	padding: 5px;
	text-align: left;
	font-family: Arial, Verdana, sans-serif;
	border: 1px solid #000; /* let's apply borders */
}

Let’s see how it looks:

Now this is the look you usu. want. If you take away the border-collapse: collapse; and then your table will look like this:

TIP: do not apply border on the tr tag since it does not understand it. To get borders on tables, always add border defintion on td and th tags.

Now let’s give the table header a different background color, add the alternating colors and border colors.

table.people {
	width: 100%;
	border-collapse: collapse; /* so we can control cellspacing in a practical way */
	border-bottom: 1px solid #000;
}

table.people th,
table.people td {
	padding: 5px;
	text-align: left;
	font-family: Arial, Verdana, sans-serif;
	border: 1px solid #000; /* let's apply borders */
	border-bottom:0;
}


table.people th {
	background-color: #ddd;
	color: #BB0000;
	border-bottom: 2px solid #000;
}

table.people tr.odd {
	background-color: #DDFFFF;
}

table.people tr.odd td {
	border-top: 1px solid #ccc;
}

table.people tr.even {
	background-color: #FBFBFB;
}

table.people tr.even td {
	border-top: 1px solid #BBEEEE;
}

Let’s see how it looks:

TIP: table bottom border does not override td bottom border (I’m not sure if it’s a bug) therefore it’s important to NOT define a td bottom border and define a table bottom border if you want them in DIFFERENT colors and/or styles.

Let’s talk about cellspacing. Personally I’ve never found a real need for cellspacing in styling tables. It is something CSS cannot truly accomplish with limited support of border-spacing in browsers (mainly it’s not supported by IE 6). However, you may be able to *fake the look* by using a border color that’s the same as the solid background color. Please take a look at the example below.

body {
	background-color: #000;
}

table.people {
	width: 100%;
	border-collapse: collapse; /* so we can control cellspacing in a practical way */
	border-bottom:0; /* you may not want the bottom of your table have spacing */
}

table.people th,
table.people td {
	padding: 5px;
	text-align: left;
	font-family: Arial, Verdana, sans-serif;
	border: 4px solid #000; /* this can be seen as cellspacing... */
	border-bottom:0;
}

/* you may not want the top of your table have spacing */
table.people th {
	border-top: 0;
}

/* you may not want the left most and right most side of your table have spacing */
table.people th.first,
table.people td.name {
	border-left: 0;
}

table.people th.last,
table.people td.dateOfBirth {
	border-right: 0;
}

table.people th {
	background-color: #ddd;
	color: #BB0000;
}

table.people tr.odd {
	background-color: #DDFFFF;
}

table.people tr.even {
	background-color: #FBFBFB;
}

View the example

why did i come to work?

i don’t know why i came to work today.

the weather is hell. this morning freezing rain fell. then snow pellets, thunder & lightning. tonight we are supposed to get 5 inches of snow. misty was a scared little puppy. she always has been a chicken.

i was woke up by the loud thunder at 6am and was debating if i should go to work ever since. for a while i thought for sure i was NOT going. it all changed around 8 o’clock. i thought maybe the road won’t be as bad.

WRONG! trying to stop for a red light, i did a 180 at an intersection. FORTUNATELY there was no car behind or next to me. otherwise i’d wipe out all three lanes. that really scared the **** out of me. i knew i should have turned around but i kept going. after i got on interstate 80, i found out the right lane was not ploughed at all. the left lane seemed clean. patiently i waited for all the cars on the left lane to pass me and then got on the left lane and drove about 45mph all the way close to the exit. then i was terrified when i had to change back to the right lane to go on the off ramp. i know from my past experience how much control i would be in getting on top of a pile of snow. i just told myself, go slow slow slow. it was still probably pretty risky because by the time i got to the right lane, the car behind me was almost about to hit my rear end. i slowed down to 25mph when i reached the off ramp.

thank god now i’m safely sitting in my cube. of course i will be surprised if even 10% of the IT employees came. all the meetings i have on my schedule have been cancelled.

maybe it’s time to really get some work done? LMAO

my cubicle

i think my cubicle is pretty cool. the first time i saw it i was actually surprised about how big it was. i mean for an entry level position, i was expecting a stall sized cubicle. haha.. not to say it’s really big or anything. you can’t fit another person in there easily but still for myself, it’s good enough.

a picture of my cubicle for your viewing pleasure. btw, the bubo graphic you see. it’s a print out of this haha

i also made a new layout for my tabulas. it’s not done tho. and hrm now i kind of realize the pain of making customized layouts for centralize blog service.. you don’t have all the control over the code.. like when someone on your friends list post bad code, it will affect your layout and messes it up XP. darn.

1st phone call at work

i just got my own phone at work. and guess what? about 20 minutes after my phone was set up, i got a phone call. the conversation went like this:

lady: hi, i need to vertify past employment
me (totally confused): hrm i was last employed by the Unversity of Iowa as a student employee?
lady: oh no, not you but someone who used to work there.
me: who is this someone?
lady: ____ fill in a random name ____
me: i do not know this person.
lady: well that’s the number she put down.
me: well, i must have gotten her old number.
lady: her employer was ____ fill in another random name _____, does that person still work there?
me: no. let me find you another number to call.
me (looking for the secretary and found that she was not there. then flipping through the ACT phone book and only found the extension for the Human Resources Department. Guessing it begins with 337 and told her) here the HR number is 337-1277.
lady: thank you very much.
me: bye

quite an unexpected first phone call at work. i realize i could have transferred the call but hey that’s the very first time i’ve used the phone. don’t expect me to be so familiar with the whole system.

feel a bit swamped

i guess it’s a natural feeling. i went through an intensive orientation for my teaching assistant job that would start on monday. there are lots of stuff i need to prepare for and learn. as a graduate student whose first language is not English, i’m required by the department to take a TA certification test. i took it yesterday and i got the highest rank which allows me to “take full responsibility for a lecture/discussion class”. this means i am allowed to teach alone. for the class i will be TAing, i will not teach alone. there’s a professor who does the lecture. i will just have to lead the discussion sections. i will be teaching 4 sections everyday from T-F 8:30 – 9:30a.

i’m excited to stand up in front of a class to be the person in control. i don’t think i will be too nervous when i know people look up to me. the thing i’m concerned is how well i will teach. a professor gave a presentation on the principles of teaching today. he got me thinking about various things i didn’t think before. will i be able to convince the students what they are learning is meaningful to them? can i provide a pleasant learning atmosphere? will the students truly LEARN something from my classes?

how well i will connect with my students is a mystery. i always feel i’m not very sociable in real life. that concerns me a little but i’m full of confidence. i know i will run into problems and have lots to learn before i can teach them. i’ve heard quite a bit about the class “computer analysis” as a lab monitor so it’s not too new but i know how frustrating that class may get for the students if they are behind.

herky on parade

 
our school started this herky on parade event to celebrate the 75th anniversary of the historic Kinnick Stadium, home of the University of Iowa’s varsity football program. they placed 75 differently designed Hawkeye mascots Herky on iowa city streets. unfortunately some immature college students are busy vandalizing the newest additions to iowa city streets. what a shame. i personally don’t think they are the best art in the world but at least i appreciate the artists who put them together.

take home exam

10 abstract algebra proofs = our third take home midterm in the abstract algebra class. on the test it stated you are allowed to use your notes, the course textbook, and old homework. you are also allowed to talk to the instructor. you are not allowed to use other books, or to talk to anyone else about the exam (including the TA).

there’s one problem on the test, i originally thought i did it correctly but since the teacher talked specifically about the definition of the problem today in class, i know i got it wrong. just to make sure, i asked him to look at my proof. he confirmed my proof is not correct. the notation i used for the commutator subgroup seemed familiar to him. he asked me where i got that. i seriously had came up with that myself. it’s nothing too fancy. they defined the set that generated the commutator subgroup to be
{xyx^-1y^-1 : x,y in G}
and usu. conjugate is written by ghg^-1 for g in G. in this case, i will have to write something like gxyx^-1y^-1g^-1 which is very messy so i wrote as g[x,y]g^-1 where [x,y] stands for xyx^-1y^-1. the teacher said he guessed i’ve seen a proof in our course textbook considering the commutator subgroup. i seriously did NOT. but since he mentioned it to me, i checked the textbook out. now i found a proof in our textbook proving the EXACT PROBLEM on the take home test. it blowed my mind. apparently if i have seen this proof beforehand, why would i bother asking him if i got the problem right or wrong. but OMG, how there can be an answer in the textbook to the problem on the test when we are allowed to use the textbook?!

i felt so weird that i emailed the teacher:
On Apr 14, 2004, at 1:10 PM, Ying Zhang wrote:
> since it’s stated on the test
> that we are allowed to use the course textbook, this shouldn’t be
> considered cheating, should it?

No. It’s not cheating. When I assigned the problem I didn’t realize the proof was in the book, however.

But you are allowed to use anything in the book that you want.