Counting in Chinese

You learn the basics of counting numbers in Chinese. Also, there was a lot of wind. And my camera battery threatened to die on me, hence the hurried nature. I also counted from 1 to 10 in Cantonese, Hokkien and Japanese.

To those participating in VEDA, you made it! VEDA stands for “Vlog Every Day (in) April”. It appears to be a thing that happens on YouTube. There’s also VlogMAFIA, which stands for “Vlogs May Appear Frequently In April”. YouTube people are fun…

FTP clients for Mac

I use an FTP client to transfer my web files to my web server. And I hardly have to do even that. That said, the in-built interface of web hosting companies can leave a lot to be desired…

So I use an FTP client. I didn’t search very hard, and found something that works well for me. It’s SmartFTP and you can check it out.

But I’m a Windows user. What if you’re a Mac user? (I understand a certain percentage of people read my blog on Mac machines. Ok, I’m basing it on users on Safari and iPad/iPhone, but still, it’s a relatively good assumption…).

So here are 5 Mac FTP clients. Disclaimer: this is an article from Rackspace. I’m not paid.

FTP For Free: Top 5 Mac FTP Clients You Won’t Pay For

Every organization seems to have its head in the cloud. The off-site, third-party solution for hosting, sharing files and archiving data is fast becoming the de facto tool method for individuals and organizations seeking to collaborate and share files.

But the truth is “the cloud” is simply a newer, more sophisticated version of a seasoned technology that’s been in place for years. Individuals and organizations have been using off-site and third-party resources and technology like File Transfer Protocol (FTP) servers and clients to store and share data for decades. The Cloud and cloud storage continue to make headlines, but FTP is still widely used behind the scenes as an easy way to transfer, share and synchronize large files.

One of the reasons FTP use has declined is its inherent lack of security. According to technology blogger Milton Keynes, Buckinghamshire, United Kingdom, FTP is an anachronistic protocol and should be abandoned in favor of more secure technologies.

But for quickly and easily transferring large files like data sets and high-resolution photos and video, FTP can’t be beat. Additionally, many FTP solutions are available for free; here are five of our favorite FTP clients for Mac.

FileZilla

By far the most popular free FTP client, and not just for Mac users. FileZilla is an open-source FTP client that supports Mac, Microsoft Windows and GNU/Linux, according to the FileZilla Project. One drawback: while the FileZilla client is platform-independent, the FTP Server is Microsoft Windows-specific.

Ed: I’m a .NET programmer. This isn’t that bad a drawback… But I’m not a Microsoft fan either. Be fanatic about what you can do with the platform, not the platform itself.

Support is plentiful for FileZilla, and available through the FileZilla website as well as an associated wiki, user and developer forums, bug fix requests and tracker reports.

Fetch Softworks

This is the original FTP client for the Mac, dating back to 1989. Fetch supports both FTP and SFTP, as well as FTP with TLS/SSL (FTPS), according to the Fetch website. One of Fetch’s greatest strengths is its ease of use; as with most things Macintosh, synchronizing and transferring files is as easy as drag-and-drop, and Fetch includes intuitive features like automatically resuming downloads of stalled or failed transfers. Fetch is compatible with nearly all FTP servers.

The Fetch website includes links to support resources, user forums, FAQs and message boards for users. The catch? Fetch is only free for a fifteen-day trial period, after which you must purchase the software.

Ed: I kinda like this one. What’s my reason? There’s a dog. Ok fine, the software looks competent. Most (if not all) purchases are based on emotions. On first impressions, I feel Fetch is better than the other 4 simply because I can imagine feeling comfortable using it. Understand that “free” is also a price. (I have nothing against free open-source projects)

Cyberduck

CNET.com editors call Cyberduck a “lean, mean, file managing machine,” and with good reason. The free, open-source software can interface with standard FTP servers as well as cloud-based solutions like Google Docs and Rackspace Cloud Files. Cyberduck, while an entry level (read: easy-to-use with limited functionality) client, nonetheless handles basic transfers, synchronization and interoperability quickly and easily.

If you’re looking for an agnostic, simple FTP client without a lot of unnecessary bells and whistles, give Cyberduck a try.

RBrowser

RBrowser is a UNIX-based, free, full-featured FTP and SFTP client designed with a simple graphic interface. RBrowser is more advanced than other SFTP clients; it combines all the secure tools available on both users’ local and remote systems, as well as maintaining a continuous secure connection to create links, according to the RBrowser website. With RBrowser, users are empowered to move and edit files quickly, and can make changes to files using direct remote-to-remote operations.

For more skilled users and UNIX-savvy administrators, RBrowser is the way to go.

Built-in Mac OS X FTP

While it’s not as full-featured as stand-alone FTP clients, Apple’s built-in FTP client works great if you’re looking for a simple way to transfer files quickly. It can be accessed directly from your Mac OS X desktop. The OS X Daily website offers step-by-step instructions with detailed screenshots. Once connected, you can browse files as though you’re looking at any local folder on your desktop, and transferring files is drag-and-drop.

Rackspace® Hosting is the service leader in cloud computing and founder of OpenStack™, an open source cloud platform. The San Antonio-based company provides Fanatical Support® to its customers, across a portfolio of IT services, including Managed Hosting and Cloud Computing. For more information, visit www.rackspace.com.

Cookie Banks and Microloans

Kakbank was founded by Peter Kelly. It’s meant as a fun way to have a gathering and also do some good. The idea is to eat cookies and cakes while deciding who to help with the group’s pool of donations.

For my group, one of the criteria is that the loans should be made out to people running businesses. We also assess the viability (as much as we can anyway) to determine if the business has a high chance of being sustainable. You could say we’re like VCs, but without all the stock options and exit strategies and board meetings and… ok, maybe we’re not like VCs…

Links

Sometimes, new problems appear after solutions are made

So I had a discussion at Hackerspace (I’ve a video for you soon), and Preetam mentioned something about iPads. He said that schools are using iPads for education, and there’s an interesting problem.

Teachers using the iPads as teaching aids want to move around the classroom. With the iPad, the teacher can project information on her iPad to the screen. But the moving around was a problem, because the iPad needed some connecting wire thingy to the projector.

Well you might say that Apple should have considered making wireless projection of the iPad screen seemless.

But I want you to consider this. If tablets weren’t available, and thus teachers could carry tablets around, would the problem of using the tablet to project information wirelessly even exist?

In the pre-Industrial age, practically everyone was working on the land. If you don’t grow food, you don’t get to eat.

The thing about working on farms is that there’s always something to do. (Just ask any Farmville player…) There are cows to be milked, chickens to feed, eggs to collect, grains to harvest.

In the Industrial age, factories made everything systematic and efficient, and our lives became better. You need to be at the factory at this time. You will go for your lunch break at this time. And most important for our discussion here, you can go home at this time.

This created a problem humans never faced before. Suddenly, we had free time.

What are we going to do with it?

Cost of an MBA

Here’s an infographic on the cost of an MBA.

And steep tuition is continuing to climb further while salaries stay stagnant.

That applies even if it’s just a normal degree.

Less people are hiring MBAs

Really? It might have something to do with being overqualified.

Of all US Presidents, only 1 has an MBA: George W. Bush

That’s interesting. Maybe a political career takes too much out of a candidate for him/her to take up studies.

What’s an MBA?

MBA stands for Master of Business Administration. I don’t have one, so I’m going to make a general assumption. You study how to administer a business, right? Accounting, finance and whatnot.

I don’t know the actual course curriculum. Does it focus mostly on administering a medium to large sized company? Does that appeal to you? Will what you learn benefit you as a startup founder?

I would even go so far as to say you’d be learning to administer other people’s money. You’d have bar charts and pie charts and business matrices to support your argument to your superiors that they should go about their business this way, or handle their finances that way, or streamline their product lines in such-and-such way.

But it’s not your money. It’s not your money on the line. You’re not worried. If your proposition fails? The worst that can happen is you get a pay cut. Possibly even get fired.

I’m all for getting a degree (but start a business on the side too). But an MBA seems like an overkill.

After over 2 years of running my own business, I’d say nothing gets you up to speed on how to administer your finances than having your own money on the line. And it cost me less than my degree, let alone an MBA.

Get an MBA if you feel it’s worth your time and money. Just don’t get one because everyone’s getting one (or telling you to get one). Make your own decisions.

Thanks to Tony Shin for telling me about this.

Changing Perspectives

You can change the whole world or you can change your own perspective. In a computer, changing a virtual world is just as easy as changing the camera view point.

With computer graphics, with the right set of values, you can move and rotate the virtual world in such a way that it looks as though you’re moving the virtual camera. When you get down to it, it’s just pushing matrices into the pipeline in OpenGL or DirectX or whatever 3D graphics engine you’re using.

Do you look at reports more than code?

It was my first job fresh out of university. I was excited and ready to rock and roll. They gave my a bunch of specification documents to read and a bunch of monthly reports. My primary task then was to make sure the monthly reports come out “normal”.

The definition of “normal” was to make sure the numbers in those reports don’t vary too much from last month’s reports. We’re talking 5 to 7 digits of debt value here.

As I continued working in the corporate environment, I found the production of reports to be extremely important. Inputs go in at one end, such as telephone call lengths, number of text messages, ringtones bought, Internet connection length via satellite, number of emails sent. In the middle, we process them according the price plans the company had set. At the end, we calculate how much we need to bill the customers, or how much profit we share with partners, or how much the customers of our customers had used.

The end users don’t want SQL statements. They want a report, usually a PDF or Excel spreadsheet.

At the start of my corporate programming career, I was proficient in generating PDF reports using Crystal Reports. That’s just a weird turn of events. My team manager had enough front-end programmers for web development work. He also had enough back-end programmers for the number crunching price/settlement plan calculations. But he needed someone who can turn the results of those calculations into beautiful reports. That’s where I come in.

Then I left the company for a startup. It was something to do with searching patent information. No reports there, but we still needed to present the results to the customer.

Then I left the startup (cough) for a small development firm. I was assigned to a team doing enterprise software for a company. I had to go through a fingerprint scanner every time I needed to go to the loo (I’m not kidding). Lots of reports too (no, not about toilet visiting frequencies).

Then I went back to the first company I worked for. I went to another team. This time, the users of that team wanted their reports in Excel spreadsheets instead of PDFs. Why? Because they can work with the numbers inside.

They can work with the numbers to generate their own charts if they want to. They can sort if they want to (you can’t sort data in PDFs). They can swap columns if they want to. They can highlight values if they want to.

And then I understood something. Data trapped in a database is useless, unless it can be meaningfully presented to someone who cares about it.

Does your brand new startup website/service/product allow your customers to get their information easily (and in a meaningful manner)?

A Twitter feed in RSS/XML format is not useful if your customers don’t know how (or want) to format it into something readable. A straightforward database dump might not be useful if there are multiple relationships between tables. Those high score values won’t be meaningful if they were hidden among heaps of columns of irrelevant data to your gamer customers.

Also, it’s currently tax season and the start of the financial year for some companies. Lots of reports needed. I’m currently running a promotion for a software library (that I wrote) that generates Excel reports. Check it out here if you want. Until 16 April only.

In the age of the Internet, information is aplenty. Making all that information meaningful is harder. Writing code to present data is just as important as writing code to receive and crunch and manipulate data.

Why I say NO by default

I have a very sensitive uh, BS detector, bordering on paranoia. It didn’t used to be that way.

There were a couple of times where a stranger walked up to me and asked me for $10. He lost his wallet and his bicycle, and he needed to get home. By taxi (or cab for you Americans). Really? There’s no one you know that you can call for help? The transport system in Singapore is fairly connected. You don’t need $10. $5 is already plenty, and you can always walk a little. Hey you’re down on your luck. You can walk.

There were also a couple of times where a child walked up to me and asked me for money. One boy of about 10 years old in school uniform asked for money so he could buy a hamburger (I was at McDonald’s then). Another boy, also in school uniform, asked for money because he didn’t have money in his EZ-Link card (a transportation card like the Octopus Card in Hong Kong, or Oyster card in England). He asked for $10 (that’s the minimum top-up amount). Wait, you couldn’t call your mom? Hmm… Haven’t I heard that one before…

But the point came that I started to distrust by default when I almost got hoodwinked into handing over my money every month for no good reason. It was many years ago (but still haunts me…) while I had a job. I had dreams of travelling the world and visiting places.

Then one day, I got a call saying I could get some free goodies if I attended some event. I don’t know how they got my phone number (we’ll talk about this later on). Ok, I’ll go.

The event was to get people buying time share properties. Basically, you pay some money every month to “own” a property that you can stay at when you travel. Or something. You’re sharing time on that property, because other people do the same thing. So all of you are paying for the privilege of possibly staying at that place in the future.

I just finished paying off my student loans. I dreamt of visiting and staying at new places. “I could stay at a castle!” And I mean, the sales person could write upside-down! She seemed very friendly and knowledgeable and have I mentioned I could stay at a castle?

It was after I signed on the dotted line that something didn’t feel right. The next day, I told my colleagues about it. One of them said he always go for such events, but never sign up. He went to get the free goodies only.

I want to cancel the whole thing. Apparently, it’s not that easy. I can live with losing the deposit I placed, but it seemed that I was still “under contract” to continue giving the company money for something I no longer want. I would have lost over $10000 that way before I could terminate the contract.

So I turned to the commerce mediating organisation in Singapore. They’re like the FTC in America, but with (much much) less power. But it’s better than nothing.

Long story short, eventually I could terminate the contract. I even got my deposit back.

Since then, I never buy anything or jump into any monetary contract without fully understanding what it means. And I’m a fairly minimalist person, which means practically everything.

I even got paranoid about my phone number. How had the time share company gotten hold of my phone number? Only through people who knew me, because I gave up helping people with surveys that also required my contact information (eventually, I stopped asking if the survey needed my contact info. I just said no).

Right now, if some company calls me up, I am very negative about it. Because the only people who has my number are close friends and family. And maybe remnants of people who can be loosely called acquaintances. And my bank. Hmm.

So I almost had a heart attack when I saw a letter from said time share company yesterday. I had to open it immediately, otherwise I wouldn’t be able to sleep. Are they going to ask me for money? Did I leave out something in the contract in fine print? You can tell I thoroughly distrust this company already.

It was a letter telling their customers (I no longer consider myself their customer) that there’s been some company changes. Corporate buyouts, change of address, that sort of thing. The funny thing was it’s dated 1 April, so I don’t even know if I should take it seriously.

Interestingly, there was some stress on NOT contacting certain staff for certain matters. No reason was given. This just reinforced my (already low) opinion of the company and its staff. Are the staff working in a cut-throat environment? I have received a letter saying I was to pay the amount “owed” to the company retroactively once. I believe that letter was sent by someone who got hold of my information (from within the company), and blackmailed me. That person probably left the company, and thought they could squeeze some money out of the company (and by extension, me). I ignored the letter. And I can totally imagine this kind of person working in the company.

So this is why I say no by default to people asking me for time, money and help. It’s not that I’m a selfish jerk. It’s because I’ve had too many bad experiences before.

That said, I’m open minded enough to at least consider the request. Generally, I don’t even consider the nature of the request first. I look at the person. Do I trust that person? Is that person trustworthy, or needy enough, that I want to help?

And then, and only then, do I consider what it is I’m to help with.

Man in long-sleeved shirt or woman in business attire asking me to help fill in a survey? Nope. Teenager holding out a tin can with stickers asking for donations? Probably. Child asking for money to buy food or go home? Depends. Singapore is a fairly prosperous country. Our poor aren’t even really that poor. You can buy a good meal with just $2 (about USD 1.63 with the current low exchange rate. America, what’s up with that?). What are you buying to eat, latte and cheesecake?

I understand there are legitimate trustworthy business people out there. So I make sure to read the fine print. I read their work and determine if I trust them. Because I’ve been burnt too many times.

Have I told you about the time when I bought a product that promised that I’ll make USD 1000 in 30 days? I felt totally scummy.

Does the point lie on the Bezier curve?

Someone recently asked me how to tell if a point lies on a Bezier curve.

For the purposes of discussion, it’s a quadratic Bezier curve and all 3 control points are known (or the start and end points and the 1 control point if you prefer). You can read more about the reverse process of finding the control points here, which is the reference point of that person’s question.

The answer is actually straightforward. Substitute everything into the Bezier curve equation and solve for t. Here’s the quadratic Bezier equation:
B(t) = (1-t)^2 * p0 + 2(1-t)t * p1 + t^2 * p2

Let’s say p0 is [1,1] and p1 is [1.5,4.5] and p2 is [2,3]. We’ll keep the points in 2 dimensions to keep the maths working less cumbersome. And let’s say the point you want to check is [1.8,3.4]. We substitute all the points into the equation, and we get this:

[1.8,3.4] = (1-t)^2 * [1,1] + 2(1-t)t * [1.5,4.5] + t^2 * [2,3]

I know, it doesn’t look pretty. But hey, we’re doing this by hand. If you’re writing code to generalise the solution, the code will probably look just a little uglier, but the solution will come out faster. Like probably instantly given the current modern processors.

Because we’re dealing with 2 dimensional points, that equation splits into 2 separate equations (with scalars instead of vectors as coefficients), like so:
1.8 = (1-t)^2 * 1 + 2(1-t)t * 1.5 + t^2 * 2
3.4 = (1-t)^2 * 1 + 2(1-t)t * 4.5 + t^2 * 3

If you have 3 dimensional points, you’d have 3 equations. Note that even then, the degree of your equations remains as 2. The degree of the Bezier curve is independent of the number of dimensions you’re working with.

If you simplify
1.8 = (1-t)^2 * 1 + 2(1-t)t * 1.5 + t^2 * 2

You get t = 0.8. It so happens that in this case, there’s only one solution.

If you simplify
3.4 = (1-t)^2 * 1 + 2(1-t)t * 4.5 + t^2 * 3

You get
5*t^2 – 7*t + 2.4 = 0

and after solving for that, you get t = 0.6 or t = 0.8 (you’re a smart person, you know how to solve a quadratic equation, right?)

Now, the solution t=0.8 appears in the solution sets of both equations. Therefore, the point [1.8,3.4] lies on the Bezier curve. In fact, t=0.8 is the t value.

Multiple solutions

What if you get multiple t values appearing in multiple solution sets of equations?

Consider the case where p0 is [1,1], p1 is [2,3], and p2 is [1,1]. Notice that the start and end points are the same point. Let’s say you want to know if the point [1,1] lies on the curve (yes I know it’s the same point). Substituting all the points, we get:

[1,1] = (1-t)^2 * [1,1] + 2(1-t)t * [2,3] + t^2 * [1,1]

This gives us the 2 equations:
1 = 1 – 2*t + t^2 + 4*t – 4*t^2 + t^2
1 = 1 – 2*t + t^2 + 6*t – 6*t^2 + t^2

They simplify to:
2*t^2 – 2*t = 0
4*t^2 – 4*t = 0

Hey presto! The solution set is t=0 or t=1 for both equations. Therefore, the point [1,1] lies on the curve. In fact, it lies on the curve where t=0 or t=1. And t=0 and t=1 happens to coincide with the start and end points respectively.

The whole point (haha!) is that, as long as you have at least one value of t that appears in the solution sets of all the equations, then said point you’re checking lies on the curve.

Higher degree Bezier curves

This is a toughie. If you have a cubic Bezier curve, then you’re solving a degree 3 polynomial (of t). If you have a Bezier curve of degree N, then you’re solving a degree N polynomial.

There are algorithms to solve generic degree polynomials, but they are out of scope here. Assuming the highest degree of Bezier curves you’ll ever work with is 3 (cubic), then this Wikipedia article on cubic functions will help. Remember, cubic Bezier curve equations are still cubic equations.

Higher dimensionality

The number of dimensions you’re working with determines the number of equations you need to solve. If you’re working with 5 dimensional points, then you need to solve for 5 equations.

For example, if you’re working with cubic Bezier curves and using 5 dimensional points, then you need to solve 5 cubic functions. You will have possibly 3 (unique) t values for each equation. Let’s say your solution sets are as follows:
t = -1, 3, 5
t = 0, 1, 3
t = -2, 2, 3
t = 3, 3, 4 (yay repeated values!)
t = 3, 6, 8

The value t=3 appears in all 5 sets of solutions, therefore your point lies on the curve.

Keep it real

In the process of solving your equations, there’s a possibility that you might get imaginary solutions. You know, those involving the square root of -1. Dismiss them.

Your Bezier curve is in the real world. The point you’re checking must therefore also lie in the real world.

Unless you’re working with some abstract imaginary Bezier curves on an advanced maths paper. Then good luck to you! The logic above for solving still applies.

Actual applications

When applying the above, you don’t usually get nice numbers like [1.8,3.4] lying on the curve with t=0.8. You get numbers with lots of numbers behind the decimal point that seems to continue forever. You don’t get exact values.

What if you get a t=0.798 for one equation, and t=0.802 for another equation?

Use your common sense. Set an error margin for what is acceptable.

My suggestion is to NOT use the values of t to check for the margin. Substitute the values of t into the equation, and then check the points if they’re within the error margin.

This means you don’t check the difference between t=0.798 and t=0.802, which is 0.04. Is 0.04 within your error margin? Maybe. But you’re not checking for this.

You substitute t=0.798 and t=0.802 into the equation, and you get 2 points: [1.798,3.40198] and [1.802,3.39798]

Then you say, “Are these points close enough that I consider them to be the same point?” Use whatever you think is appropriate. I think the Euclidean distance norm works fine. Then check if that “close enough” criteria is within your error margin.

If you’re checking for [1.8,3.4], then ask yourself, “Is [1.8,3.4] close enough to [1.798,3.40198]? And is [1.8,3.4] close enough to [1.802,3.39798]?”

Obviously, doing this by hand sucks big time. Good thing you’re a programmer.