CAT | Uncategorized
13
Restoring a remote git repository from local repo
0 Comments | Posted by Lu Wang in Uncategorized
The beauty of git is that there is no such thing as a central repository, so there is no real concern when any one node goes down. Unfortunately, a common set up for git usage is to use a “central” origin as a remote bare repository from which many developers push/pull.
But even in this case the central bare repo can be competely restored from a local repo. I ran into such a case when the central repo was complete wiped out due to a hard-disk failure. When the system was brought back up, there was obviously no data intact:
$ git push fatal: '~/git/repo.git' does not appear to be a git repository
Doh. But, no worries, we can just recreate the remote repo:
$ ssh remote.com $ mkdir git/repo.git && cd git/repo.git $ git --bare init Initialized empty Git repository in git/repo.git $ exit
At this point, it would be nice if git autodetected that the origin was slightly wonky and auto-recover, but it doesn’t seem to:
$ git push No refs in common and none specified; doing nothing. Perhaps you should specify a branch such as 'master'. fatal: The remote end hung up unexpectedly error: failed to push some refs to 'ssh://remote.com:~/git/repo.git'
However, forcing a copy of all local refs to the remote bare repo does the trick:
$ git push --all
It might take a while, but now your bare remote repo is up and running. In fact, other developers can now push new changes or pull old changes as if nothing had happened!
20
The inadequacies of existing e-commerce solutions
0 Comments | Posted by Lu Wang in Uncategorized
If you’ve ever thought that starting a company online and charging people money for your great software is easy, you’re seriously underestimating the pains of the current e-commerce state.
Consider this: You’ve got a great web-based software app. You think you’re going to be the next 37signals. You build out your application to perfection, skipping all that trivial stuff about charging for the software for the latter stages of the development cycle. You think you can push out all that payment processing mumbo-jumbo until the end.
Well, you are in serious trouble.
The problem isn’t even bottlenecked at a grandiose level – like lacking a great business idea to reel in the money. The pain is all in the details like setting up an online payment processing system.
I understand that trying to process credit cards should be a heavier process than setting up a lemonade stand, but the current state of the art is absolutely ridiculous. This is because the current players in the market are either 1) pigeon-holing all e-commerce transactions into simple, but totally uninteresting processes, or 2) completely ill-equipped to handle online commerce.
In corner number one, you’ve got players like PayPal, with whom you can easily set up a check-out form with PayPal express. Given that this is just about as brain-dead as e-commerce can get, you’d think that it’s as easy as filling in your name, getting a URL, and link your form to that URL. No. You’ve got to wade through a million pages of marketing rhetoric to get to any real documentation. And the end result is often so simple, that it doesn’t break the mold. If you’re doing anything remotely interesting, like a web-based software app, you’re not going to get much mileage here. Move along.
In the other corner, you’ve got big bank institutions offering online merchant solutions. Big trouble. Don’t even bother. From personal experience, I walked in and talked to no fewer than 3 representatives from your big names like Bank of America and Wells Fargo and got nothing but empty stares. “You want to do what?” “Wait, are you shipping anything?” “Do you need a terminal?” “You want a merchant account? We’ve got a nice merchant services package…” If you want to actually do credit card processing, you’re on your own when you talk to these big boys. They’re still living in a world where people walk into shops, swipe their credit cards in a terminal, and physically transact. Trust me, they’ve got good reasons to keep their focus (and employee training) in the physical space.
However, that leaves us web guys stuck out of luck. If you do your research correctly, you probably know that online payment processing comes in 3 pieces. First, at the layer closest to your application or system is the payment processing logic to initiate transactions and authorizations. There are plenty of great ways to roll this logic, my favorite being ActiveMerchant, a great gem for Ruby on Rails. This is the area closest to developers and I promise you will spend more time shopping for a solution than implementing it. You’re mostly in the care of savvy professionals here.
The next level, and one step removed from your application, is the Payment Gateway. See Authorize.net or TrustCommerce or Braintree. These guys provide an API for your application logic to talk to banks and do the actual transaction. Payment gateways are generally good people – they understand web commerce, since that’s their bread and butter. They can hold your hands a bit and even offer sandboxes and other developer friendly options to make sure your app is behaving properly. ActiveMerchant will generally abstract away gateway differences for you, so this step is solid, though it could use some improvements.
Another step removed, and the final step is your merchant account. Your merchant account is the part of all of this that actually touches the banks. This is where the Visa or Mastercard magic happens. This is also where you’ll pull your hair out trying to figure out why the support folks are speaking in alien languages.
For the most part, people who provide merchant accounts and the people who work for them do not understand what you are doing. They don’t understand web applications, they don’t understand why you’re doing what you’re doing and why you chose to do things a certain way. They don’t understand APIs, IP addresses, servers, Ruby on Rails, HTTP, SSL, or anything like that. They understand forms, paperwork, support tickets, legal documents, and all that bureaucratic burden.
I’m not kidding when I say that it took me over a *month* to finally get a merchant account properly integrated with my payment gateway. I won’t say who the two parties were, but let me say that no fewer than 10 bulky and sometimes unnecessary forms where sent back-and-forth in a span of 3 weeks with the rest of the time wasted in some weird support limbo.
For developers like me, who prefer to focus on the elegance, simplicity, and unerring logic of clean code, the frustration and archaic nature of filling out PDFs and DOCs just seemed like a step back in the wrong direction.
The problem arises from the many layers that it takes to build an e-commerce solution. There are too many middle-men and too many ways to lose empathy along the way. There is no way a support person at a bank can understand how web applications tick – they’re not trained for that.
So my question is – can there be a hero to arise from all this mess and deliver to us a better way?
5
Setting up subversion server on a Windows machine.
0 Comments | Posted by Lu Wang in Uncategorized
I’ve been telling myself that it’s time to run my own subversion server for personal uses for a while now. So I decided to finally get started with the extra Windows box I had laying around. My plan was to host the files on the Windows box (a desktop) and have the files I needed to checkout available on my Mac (a laptop).
I don’t think it’s worth while documenting the entire experience. Instead, I think it would be useful to list the webpages I referenced.
First and foremost, I downloaded subversion from tigris. In my case, since I’m running this on windows, I grabbed the Windows binaries built against Apache 2.2.x.
Next, the best reference for starting a project with Windows is here. This entry talks about setting up the right environment variables and creating a repository. Note that the SVNService wrapper being referred to is no longer necessary. Instead, check this out. Here, the author denotes steps to setup an NT service with no downloads necessary with subversion 1.4.x.
Lastly, I looked for a tutorial on some of the most basic svn commands and found this article, which goes over some of basic concepts of subversion as well.
The above articles should be all that is necessary for setting up a Windows subversion server in minutes.
I’m an unabashed Safari hater. Correction, I *was* an unabashed Safari hater. I think the transition first happened when I picked up an iPhone and realized that Safari makes mobile browsing seem like second-nature. (I know, I’m such an Apple fanboy. I’ll go wallow in shame now.) Still, I was unconvinced that there need be yet-another-browser-to-support.
It’s no secret that I love working on web apps. A necessary part of writing good web apps necessitates delving into the front-end technologies that the end-user interacts with while using said web apps. Thus, I’ve always been a fan of Firefox (for it’s developer friendly tools and plug-ins, it’s strict upholding of standards) and IE (out of necessity, due to widespread adoption, and the fact that they really did a good job on IE7). I’ve come to live with the fact that these two browsers simply must be supported, but Opera and Safari were always troublesome.
Then comes along Safari 3.0. I would have never known had I not installed Leopard over Thanksgiving weekend. Not only is it blazing fast, standards compliant, elegant, and full of new-hotness – dynamic widget creator anyone? – it comes with it’s own Inspector tool. Included are handy tools like a DOM-inspector, a CSS box model metrics tool, and a network transfer analyzer. The latter even comes with helpful hints about how to speed up transfer times, reminiscent of YSlow. The only thing missing is a firebug-esque debugger where one could set breakpoints. Oh well, nothing is perfect.
In fact, I’m sure Safari 3.0 is still missing a few bells and whistles. Even as I write this entry, I notice the lack of support of rich WYSIWIG editting in Safari that I usually have with IE or Firefox. Like I said, nothing is perfect. At least I won’t loathe debugging Safari specific issues as much as I have in the past. Maybe it’s also time for me to give Opera another chance…
23
Apache – Upgrading OS X 10.4 (Tiger) to OS X 10.5 (Leopard)
0 Comments | Posted by Lu Wang in Uncategorized
A while ago, I posted a blog entry about upgrading to apache 2.x on OS X 10.4. I just got around to installing the brand-spanking new version of Apple’s OS (Leopard, OS X 10.5) and realized that it comes with apache 2.2.6!
Unfortunately, it also comes with a rather bloated httpd.conf, which was unappealing to me. Not only that, but the conf file didn’t seem to be picking up personal conf files (default in /private/etc/httpd/users/). Fortunately, all I had to do to get back in the game was to back up httpd, apxs, and apachectl and then symlink them to my custom installation of apache, with my own custom httpd.conf.
I’m actually convinced that this is better in the long run than using the out-of-box apache installation, since this affords me flexibility going forward. I like to be in control of the software running on my box (which may or may not be in conflict with Apple’s easy-to-use stance).
Luke Wang was born on July 4th, 2007 at 1:44pm, a warm, cheery summer day. Despite the fact that it was Independence Day, it was quite a non-descript summer day, full of sun and a slight breeze. Of course, having been confined to the labor & delivery department of Kaiser, neither mom nor I were able to take advantage of that fact. I was anxious, nervous, and all-in-all quite queasy, and the dimly-lit room didn’t help. While mom was going through contractions, I felt myself fighting through my own nervousness. The birth itself went smoothly, Lulu having only been in real labor for no longer than 11 hours or so, and the delivery taking no longer than 30 minutes. Luke came out kicking and screaming, seemingly ready to take on the world and all its caveats.
I think it’s impossible to describe what it is like to suddenly come to full realization of becoming a father. Purposely, I’ve let all the emotions simmer down before making an entry here, as I knew only words of retrospect could do justice to the jumble of feelings that were suddenly thrust upon me. On that note, I’ve realized that there had been one overriding contemplation that I’ve had over the last week or so.
To bring life into this world is both a joy and an overwhelming responsibility, but it was also the onset of an epiphany. A baby is born into this world with no baggage, no past, no enemies, and no debt. When you think of all the new things to learn and experience for a newborn, it dulls the trivial things in our life we take as important – our everyday grind, our everyday matters, our everyday worries. It puts into perspective the everyday things in our life that we’ve become consumed in wrongfully, and frees us from the chains of mediocrity we’ve come to bind ourselves. At once, it is a new beginning for both the baby and the father.
What can we provide for our newborns? Of course, I mean more than just food, clothes, and shelter – I mean our knowledge, our sense of compassion, our sense of morality. Spare them our burdens, our hardships, and our immaturity. Spare them our love of bickering, our sense of greed, and our penchant for prejudice. Give them love, hope, and peace. Give them a better world in which to live, a better environment in which to grow. Give them truth. Give them honesty.
The one thing I can take away from this, as I step back and reflect on this little miracle of my own is that this is an opportunity for me to become a better person, and then to take that energy and posit it in a way that has lasting effects in this world. My contribution to humankind will be my willingness to give the next generation a better future, as should be the contribution of every father.
In the end, our society is built on the strength of our ability to not just create, but to share creation. That includes raising, and loving, our children.
It’s the end of the Winter 07 quarter at Stanford, but it’s also a bigger milestone for myself. This was my last day of school. Forever. (Well, there may be a change of plans in the future, but for now, it is.)
The title probably sounds corny, like I’m some middle schooler looking forward to the first day of summer vacation, but in truth, it couldn’t be any farther from what I’m feeling right now. It’s a sort of relief that now I am finally done with school after 17+ years worth of education (1-12 grade school, 13-16 college, and 16-17 masters), but it is also a jarring change – I’m now, officially, a full-time contributing member of society. Fortunately, this is what those 17+ years have been design to accomplish.
Of course, the more depressing point of view that I keep revisiting is that now I’m not the one absorbing knowledge – I’m going to have to watch it drain away as time goes by, regardless of how much I try to retain it and learn more.
My B-Day is coming up woohoo! Already got NBA2K7 for XBox 360 and a new Dell Desktop. What else is in store for me?
This is a website built with a strict discipline of adhering to web standards and guidelines. That means everything you see here is XHTML Strict styled in CSS. Currently only screen media is supported.
If you take a look around you, you will probably find all means of technological devices that were not available 20 years ago. For example, the cell phone in your pocket, the laptop sitting somewhere near you, or that sleek LCD screen you’ve got sitting on your desk. Even more mundane, what about 1000 songs in your pocket? Was that possible 20 years ago? What about the plasma TV you’ve either got sitting in your living room right now or sitting somewhere at Best Buy’s just waiting for you to buy it?
Technology moves fast. We are finding more and better ways of staying digital, staying connected. But is that really innovation? How do you define “innovation”, and do you find it to be inherantly different from “technology”? In my opinion, innovation is something that is decoupled from technology and, relatively speaking, innovation moves slower than its more tangible counterpart.
Better. Thinner. Faster. Prettier. These are characteristics of technology. Technology makes available all sorts of possibilities to our world. As a result, we have so many more ways of doing the same thing. We’re able to make our computers run faster, make our monitors sleeker, make our batteries last longer, and make our world spin just a bit more hectically. We can now carry gigabytes in small capsules rather than megabytes. We’ve got GPUs outdoing one another almost monthly. When it comes to technology, there is no such thing as pace. Humankind is on a tear and we cannot stop ourselves from outdoing our current status with bigger numbers, smaller delays, and better devices.
But that does not mean we are innovating. All the characteristics of technology are orthogonal to the characteristic of innovation: Difference. Surprisingly though, as the pace of technology picks up, the pace of innovation is more or less unaffected. I like to attribute this to simple reasons, the most obvious of which is that cultures simply cannot adjust to a fast rate of innovation turnover. Instead, we as humans are more comfortable with incremental changes that, in the overall picture of things, lead to an annuity of innovative income. Fortunately, we are usually open to innovation as we are generally happy to embrace change when it is beneficial. However, the way I see it, innovation is not at a premium in our society. Sometimes we’re just stuck in a rut trying to make it faster, thinner, or smaller that we forget to make it different.
It’s hard to qualify in words exactly what we look for when we search for innovation – all we know is that when we see it, we say, “Wow, that will change the way I live.” If not to that extreme, innovation will general open some channels in your mind when you encounter it. With the pace of technology setting such a open canvas, here’s to hoping we’ll begin to see the artists of innovation pick up a brush.
