26 Dec Animating height in CSS
I recently ran into an issue where I had to transition the height of an element from 0 to auto. Typically this is needed when "pushing" in new content from a feed, or expanding a container with "Show More". On the comment section of this website, I achieved this by first appending the inserted element to location off-screen and then measuring the rendered height. Then I could animate the expanding container using an absolute height.
I wanted to find a more elegant solution to this problem. I encountered the [max-height solution](http://stackoverflow.com/questions/3508605/how-can-i-transition-height-0-to-height-auto-using-css), in which the maximum height is animated instead of the height. This works as long as the content is always less than your max-height. There are a few caveats, most notably the animation getting "stuck" (because the max-height is too high). When animating back to zero, it gets stuck at the beginning for a split second.
continue reading
19 Dec Asus ZenPad S Z580CA
I recently became the owner of Asus's ZenPad S Z580CA. I chose this device as my new tablet because of many factors:
1. Size: it is so thin and light
2. Performance: an Intel x86 CPU matched with 4GB of RAM should have no problems in most situations
continue reading
07 Oct It's the small victories
Around two months ago, I started my first real job. I was fresh out of university, and it was with a pinch of reluctance that I entered the corporate life of 8-7, daily meetings, and sitting 10 hours a day. Within my first week, I made some much-needed changes to my schedule. Instead of the 8-7 workday imposed upon us, I would get to the office at 7AM and leave at 6PM, right in time for dinner at home. Instead of going to the gym 5 days a week, I changed it to Mondays, Wednesdays, Fridays, and one day on the weekend. And finally, instead of waking up at 5:50, I relaxed my schedule and set my alarm to 6.
It turned out my typical day was still a bit too stressful, and in my second week on the job, I got sick and had to take two days off work. I knew I couldn't go on like this - something had to change, and if it wasn't physical, it had to be psychological.
continue reading
27 Sep Sodium Laureth Sulfate
For years, I have been plagued by [canker sores](http://www.mayoclinic.org/diseases-conditions/canker-sore/basics/definition/con-20021262) in my mouth. Sometimes I get two or three at once. Sometimes, right after they heal, I get another one growing right after. It causes a lot of pain, and eating is a nightmare because of it.
I used to think it had something to do with stress or lack of sleep. But recently, I came across [this thread](https://www.reddit.com/r/LifeProTips/comments/20ixfa/lpt_suffer_a_lot_from_canker_sores_avoid/) on Reddit. Basically, it says that toothpaste that contains sodium laureth sulfate (or sodium lauryl sulfate, or sodium dodecyl sulfate) will possibly make it easier for cuts to form in your mouth, and that ingredient will irritate it and make it worse. I looked at the Colgate toothpaste I was using, and it did indeed contain sodium lauryl sulfate. What does sodium lauryl sulfate do anyway? It's a foaming agent (also in shampoos, etc) that makes it seem like whatever you're using is doing its job. So, it's useless.
continue reading
07 Aug Some thoughts on today's operating systems
A few days ago, I decided to take the jump to Windows 10. I upgraded my laptop using the force update method (run `wuauclt.exe /updatenow` inside an elevated command prompt after deleting contents of the `C:\Windows\SoftwareDistribution\Download\` folder), and a few days later, I upgraded my PC using the [Windows Media Creation tool](http://www.microsoft.com/en-us/software-download/windows10). It's been a few days with the new operating system, and I definitely have to say it's very nice.
One of the first things I changed in Windows 10 was the login background. By default, it shows the blue Windows 10 background, which I don't like. To change that background to the accent color, just add a `DWORD` called `DisableLogonBackgroundImage` to `HKLM\SOFTWARE\Policies\Microsoft\Windows\System` in the registry. Change the value to 1.
continue reading
13 Jun The end of school
They say that the graduation tassel is a symbol of success. Moving it from the right side of the cap to the left after graduating represents the crossing over to a new stage of your life. Today is that day in my life. Today, I graduate from Taiwan Tech.
![Graduating from Taiwan Tech](/_static/stuff/2015-06-13-ntust_entrance_graduation.jpg")
continue reading
24 May Data binding in plain JavaScript
For data binding in JavaScript, many would turn to tried and true frameworks such as [knockout.js](http://knockoutjs.com) or [angular.js](http://angularjs.org/). I'm by all means not against the use of these, but I love figuring out how to do things on my own. My logic is that by understanding how things work in their most basic form, using a framework will only make things easier when the need arises. I apply this concept to many things in life, such as baking or cooking without a recipe (how do certain ingredients affect the outcome), or fixing broken electronics (which part is responsible for what action). By understanding how things work, you can gain a deeper understanding than by just blindly following instructions.
Which brings me to my main point: how can we achieve data binding without relying on a framework? The [`Object.observe()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe) method can be used to listen for changes to an object. According to MDN, this method calls your callback every time the object is modified. This may be extremely useful, but browser support is _extremely_ limited for now, with only Chrome 36+ and Opera 23+ having this ability.
continue reading
18 May Laptops and cafes
Many people seem be annoyed at people who bring their laptops to coffee shops such as Starbucks. "What are they really doing there?" some may wonder. "Are they really working, or are they just browsing social media sites?" To some, it may seem weird to bring a laptop to Starbucks. After all, tablets were introduced as the device to have for content consumption. But for me, bringing a laptop to a coffee shop is more than just for browsing the web.
Often, I find myself wanting to find a place where I can just open my laptop and work on a project. Why not work at home? Don't get me wrong: working at home is great. I have dual monitors and a very comfortable mouse and keyboard, so productivity is through the roof. But sometimes there are distractions, such as wanting to play the piano for a bit. For me, working mobile means I need a power source for my laptop and some air conditioning (it's **hot** in Taipei). It's also nice to be able to have a snack of some sort when I want to. Taipei's public libraries would have been a great choice, but unfortunately eating or drinking is prohibited. My favorite choice is the [Mr Brown coffee shop](https://www.google.com/maps/place/Mr.+Brown+Coffee/@25.041716,121.5349513,20z/data=!4m2!3m1!1s0x0000000000000000:0x4bb263acc4f6c677) across from National Taipei University of Technology (Zhongxiao Xinsheng station).
continue reading
25 Feb The last winter break
Students in Taiwan don't get nearly as many holidays as students in the United States do. I remember that there were 3-day weekends at least once a month, and even holidays such as Columbus Day existed! In Taiwan, it is considered lucky to have even one 3-day weekend in an entire semester. If December 31st happened to be on a Tuesday, then back to school for you on Thursday! The only break most people can look forward to is winter break. Typically, this lasts for around 3 weeks (for students) during January and February. Winter break is used to celebrate the Chinese New Year. Most white-collar workers are allowed around 6 continuous days off during this period. As a senior year college student, it is suffice to say that I have enjoyed the last day of the last full winter break of my life today.
School starts tomorrow. This semester won't be the same as any other. I'll have fewer classes. I'll have more free time. I'll have to be looking for a job. When the semester ends, I won't have summer break. I'll be graduating and getting a job. It seems weird, and I still can't quite wrap my head around the fact that soon, it'll be 9-6 every day. I have so many questions. How is there time for hobbies? Leisure? Recreation? Relationships?
continue reading
10 Jan Accessing all your files, from anywhere
It's always cool (and extremely helpful) to be able to access your files from anywhere. There are some partial solutions for this such as cloud storage, and they do the job well with versioning and history. However, they only work if you sync all of your files to their service. And they all have storage caps. Also, what if you wanted to sync your files to a service like Dropbox, but you wanted to preserve your current folder structure? There are ways to accomplish that, such as using [symlinks](http://msdn.microsoft.com/en-us/library/windows/desktop/aa365680%28v=vs.85%29.aspx), but that's not a very good solution. My current method is to use a custom dynamic DNS to run a FTP server from home. Let me explain that one.
DNS is responsible for translating web URLs to IP addresses. For example, [google.com](https://www.google.com) points to [74.125.232.110](http://74.125.232.110). That IP address is static, meaning that it won't change. Therefore, you can be quite certain that typing `google.com` will bring you to the right place.
continue reading