tag:edditorial.posthaven.com,2013:/posts Edditorial 2018-08-02T05:12:55Z Eddie Cao tag:edditorial.posthaven.com,2013:Post/1308559 2018-08-02T05:11:12Z 2018-08-02T05:12:55Z Permutations without Recursion

I remember when I was in college, a very tricky quiz was to convert recursive code to a non-recursive one. I have always found it very challenging.

Permutation can easily be solved with recursion. So I tried to solve it without recursion. It was a fun exercise.

alpha = 'xyz'

def main():
    n = list(alpha)
    while n:
        print n
        n = next(n)


def next(str):
    str.pop()
    # loop to find a upgradable tail
    while str:
        tail = str[-1]
        # search for an upgrade to the tail
        new_tail = [i for i in alpha if i > tail and i not in str]
        if not new_tail:
            str.pop()
            continue
        str[-1] = new_tail[0]
        # fill the rest
        return str + [i for i in alpha if i not in str]

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/590619 2013-07-25T18:32:32Z 2013-10-08T17:27:41Z Why ChromeCast is not AppleTV

If you read the Google Cast API, you know exactly why it is called ChromeCast: the receiver device simply runs a boiled-down version of the Chrome browser and listens for commands sent by sender applications. It seems to also be able to run custom applications as the receiver in the device, as long as it is not resource intensive and it's a regular web application. So the important take-away is that there will be two applications at play, most likely maintained in two separate code bases (not to mention the number of programming languages involved).

Saying there is no SDK for AppleTV is misleading: it's true that there is no way to create custom applications to run on AppleTV (yet), but there is an API to use AirPlay/AppleTV as a second screen. The emphasis is on second screen: there is only one app that simply render content to two screens. The app just sees a second UIWindow instance and renders views on to it as usual, and the system takes care of the rest. It's inherently simple, and there is one codebase and most likely one programming language involved. Apps like Real Racing 2 HD and the Redfin app are taking very good advantage of this well-documented feature. With Mavericks, users can set up an AppleTV as a regular external monitor at the system level, so it's even simpler for developers: if your Mac app can deal with dual monitors, you can utilize AppleTV. Compare this to a Google Cast application: to use the receiver device as a second screen, you either create a dedicated receiver application and get the main app to communicate to it by commands, or you have to roll out your own implementation of a virtual screen: have your UI code draw to a virtual screen, encode the screen pixels as video stream and get receiver to play that stream. The former method is too limited and latter is too cumbersome (and likely infeasible without hardware support).

Also, AirPlay != AppleTV. There are plenty of third party stereos that can sit at the receiving side of AirPlay. With iOS in the Car, car makers can make their in-car display as AirPlay-compliant and allow Maps and other apps to display custom UI on it. I believe we would have seen third-party AirPlay-capable TVs by now if Apple did not have plans of building its own TV sets.


]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197743 2012-08-27T20:46:00Z 2013-10-08T16:03:31Z My take on Samsung vs Apple

My reply to the argument that all inventions should be commoditized.

I am all for all inventions must eventually become a commodity. However, if you look at the long term instead of just getting innovation to become cheap commodities available to everybody as soon as possible, some protection should be provided to the inventor so while cool new progressive "stand on the shoulders of giants" changes can keep coming, risky groundbreaking innovations can also emerge once in a while. Without effective patent protection, everybody will resort to do safer small-step improvements instead of spending years and billions to build (and market) something vastly different from what people are familiar with. In other words, with zero patent protection, you will still see cars getting better mileage, but you won't see an electrical car. You will also see more equivalent of pharmaceutical companies becoming more interested in making toothpaste instead of medicine.

If we want to argue for patent reform, we need to focus on the true patent trolls. Apple is not a patent troll and arguing against this will push many people to the other side of patent reform debate.

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197746 2011-09-02T19:22:00Z 2013-10-08T16:03:31Z Draw - Google Correlate
Check out this website I found at google.com


My first thought was how is this useful? After reading the thread on HN, I realized I am the one who has totally no imagination. Draw a down-curve and find flash? Draw an up triangle and see Windows Mobile? Man, this thing is full of insights!

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197752 2011-08-24T16:51:00Z 2013-10-08T16:03:31Z Google to pay $500 million over Canadian pharmacy ads

Google has agreed to forfeit $500 million generated from Canadian pharmacies targeting US customers through its AdWords program, the US Department of Justice announced today. The money represents revenue received by Google from the pharmacies as well as from unlawful sales made by the pharmacies to customers in the US.

Generally, it is illegal for pharmacies "to ship controlled and non-controlled prescription drugs into the United States from Canada," the DOJ states. Google acknowledged this as early as 2003, and yet allowed Canadian pharmacies to entice US customers to buy prescription drugs from their sites via AdWords advertising.

Transactions like these, with rare exception, violate the Federal Food, Drug, and Cosmetic Act because the shipped drugs are not FDA-approved. The problem is compounded by the fact that Canadian pharmacies shipping drugs to the US aren't even subject to Canadian regulations, so the pharmacies can sell drugs from countries other than Canada that meet neither Canada's regulations, nor the FDA's.

Google even provided customer support to the Canadian pharmacies, advising them on how to effectively place their AdWords ads. The company is now taking responsibility for the prescription drug rabbit hole it dug, and will forfeit a total of $500 million to cover both its own and the pharmacies' offenses.

"Google acknowledged this as early as 2003, and yet allowed Canadian pharmacies to entice US customers to buy prescription drugs from their sites via AdWords advertising." Why does this sound so familiar?

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197757 2011-08-08T17:03:34Z 2013-10-08T16:03:31Z Jonathan's Card

There is a beautiful story named Jonathan’s Card listed on hacker news today. It is about an experiment on sharing a starbucks card – everybody can buy a coffee on this card, and everybody can also chip in if he wants. It has been interesting to see the balance up and down throughout the day.

Then there is an even more beautiful story on good infection.

My girlfriend and I were graduating from pharmacy school and she was applying for residency positions (yes, they have those for pharmacists). Well, she found out she got the one she really wanted and so that night we went out to a nice dinner to celebrate. We did it up like you would expect a happy couple to – nice bottle of wine, share an appetizer and dessert, etc. We were still living on loans at the time and so in my head I was keeping track of about how much the meal was going to run me at the end of the night (for better or worse – keep in mind we were in college at the time). We had easily cleared a hundred bucks (quite the meal for college students who usually eat $7 sandwiches or more likely cook for themselves!), and when it was time for the bill, our waitress told us “The couple that was sitting over there paid for it.”

And some people pay for bridge toll for more than just themselves.

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197759 2011-07-03T18:12:00Z 2013-10-08T16:03:31Z Google's six-front war

Google is fighting a six-front war, and some are saying Google is sitting comfortably in their search advertising castle, and playing guerrilla warfare everywhere else. I don’t think so.

Don’t ever think Google is playing guerrilla warfare just to poke fun at the other guys while sitting on a pile of cash. The reason Google is attacking these companies is simple: they have become clear threats to Google’s core business – not search, but targeted advertising on the web. Apple’s race to dominance to the mobile space with its walled-garden approach was threatening the whole web-based and ads-driven model; Microsoft’s stronghold on browser market with an ancient browser was holding the web hostage and killing the potential of web as a service serving platform; Facebook keeps valuable information that is not accessible to Google bot and may even be able to develop the next big thing to replace search, not to mention that it is sucking the best talent; and it has been very clear that local advertising is where the future growth of targeted advertising will be from.

Google is being offensive and aggressive, and they are not comfortable about it when their core business – not search but serving ads – is being threatened.

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197761 2011-06-22T21:41:00Z 2013-10-08T16:03:31Z On Native Apps

GitHub released its Mac client. It’s very top notch, and has a very modern feeling. rjh29 on HN wonders why GitHub would create one native app for one platform rather than basing on something like Qt to build a native app that works on as many platforms as possible. And I argue,

The definition of native app has changed. It’s no longer a synonym for compiled binary; or using native widget. It is not as simple as coding your UI in a cross-platform toolkit. In these days, a native app means something that feels like the built-in apps: it’s beyond skinning and appearance and is more about how the app as a whole interacts with the user to get the job done. As the platforms diverge, it’s now really hard – if not impossible – to make a cross-platform native app. Among Performance, Cost, Time, Scope, you can only pick three. GitHub sacrifices the scope.

catch23 else pointed out an interesting story on the use of cross platform widget set,

Reminds me of when Intuit was building out Quicken — most of their versions were built using cross platform tools, but inside the code it became a big mess and most recently they decided to scrap the whole thing and re-write the mac client in native objective-c instead of c++

After many years of pushing the concept of platform independence, we finally come to realize that it is not an excuse for end user independence. We should not favor developer convenience over user experience.

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197764 2011-06-13T18:01:00Z 2013-10-08T16:03:31Z C++0x introduces a standardized memory model. But what does it mean?
People have been creating multi-threaded application in C++ for decades. What does a standardized memory model mean?
By coding rigidly to the spec, you can be certain that your code will compile and run without modification on any system with a compliant C++ compiler, whether today or 50 years from now.

Very well said generally about standards.

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197766 2011-06-08T16:59:00Z 2013-10-08T16:03:31Z The Dangerous Mr. Khan
In The Wall Street Journal, Paul Boutin writes, “As we become increasingly dependent on the Internet for our view of the world, and as the Internet becomes more and more fine-tuned to show us only what we like, the would-be information superhighway risks becoming a land of cul-de-sacs, with each of its users living in an individualized bubble created by automated filters—of which the user is barely aware.” 
via nas.org

 

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197767 2011-06-08T16:43:00Z 2013-10-08T16:03:31Z My current theory is that programming is quite literally writing.

A bit off topic, but you triggered something I’ve been thinking about for a couple of years. That “spark” is fluency.

I swtiched jobs from being a computer programmer to being an ESL teacher in Japan. Japan is somewhat famous for churning out students who know a lot about English, but can’t order a drink at Mac Donald’s. We used to have a name for those kinds of people with regard to programming languages: language laywers. They can answer any question you put to them about a programming language, but couldn’t program to save their life. These people often make it past job interviews easily, but then turn out to be huge disappointments when they actually get down to work. I’ve read a lot about this problem, but the more I look at it, the more I realise that these disabled programmers are just like my students. They have a vocabulary of 5000 words, know every grammar rule in the book but just can’t speak.

My current theory is that programming is quite literally writing. The vast majority of programming is not conceptually difficult (contrary to what a lot of people would have you believe). We only make it difficult because we suck at writing. The vast majority of programmers aren’t fluent, and don’t even have a desire to be fluent. They don’t read other people’s code. They don’t recognise or use idioms. They don’t think in the programming language. Most code sucks because we have the fluency equivalent of 3 year olds trying to write a novel. And so our programs are needlessly complex.

Those programmers with a “spark” are programmers who have an innate talent for the language. Or they are people who have read and read and read code. Or both. We teach programming wrong. We teach it the way Japanese teachers have been teaching English. We teach about programming and expect that students will spontaneously learn to write from this collection of facts.

In language acquisition there is a hypothesis called the “Input Hypothesis”. It states that all language acquisition comes from “comprehensible input”. That is, if you hear or read language that you can understand based on what you already know and from context, you will acquire it. Explanation does not help you acquire language. I believe the same is true of programming. We should be immersing students in good code. We should be burying them in idiom after idiom after idiom, allowing them to acquire the ability to program without explanation.

So let’s read more good code.

via slashdot.

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197769 2011-06-07T19:01:00Z 2013-10-08T16:03:31Z iCloud: a different kind

IIRC, Android sort of does what iCloud does, but iCloud is very different and IMHO a much better offering from a developer perspective. According to Apple’s website:

iCloud Storage APIs enable your apps to store documents and key value data in iCloud. iCloud will wirelessly push documents to a user’s device automatically and update the documents when changed on any device — automatically.

iCloud allows an app developer to treat the cloud as a natural extension of the iOS device. In-cloud storage is almost as easy to use as saving data locally, and you get push synchronization for free.

This is similar to Dropbox, but baked right into the system APIs. I don’t think there is anything like this in Android. You of course can hack something using Google Storage API or Amazon S3, but they are very different beasts from iCloud: while iCloud associate the storage with a user, Google and Amazon associate it with an app. That difference has a huge implication. iCloud makes it trivially easy to synchronize data for one app across devices of the same user. To achieve the same thing with Google and Amazon’s offerings, you would have to provide your own code to identify user, isolate data of different users in the cloud, and bring in your own synchronization/push magic. On the other hand, if you want to mine across data of all users – answering questions like the most-bookmarked pages – then you might feel iCloud’s extra layer of abstraction getting into your way.

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197771 2011-02-20T06:23:00Z 2013-10-08T16:03:31Z OAuth

Ursula is a photographer, and she loves the photo house called Sophia’s. The place is nice and clean, the service is superb, and the price is reasonable. Since Ursula’s free-lance business is doing pretty well, she uses Sophia’s quite often and enjoys 20% discount as part of their VIP program.

It’s Christmas time, and Ursula receives lots of orders to take family portrait in customer’s houses. Running around like crazy to fulfill all the orders, she could no longer visit Sophia’s to pick up the finished prints.

There is this super nice and considerable customer named Claire who offers to pick up the prints on her own from Sophia’s. Ursula loves this idea. However, there is one problem. Sophia’s treats privacy vey seriously. They would not allow anyone to pick up Ursula’s prints without Ursula’s driver license. Ursula obviously cannot give Claire her driver license because, well, there is simply not enough trust in here and asking Claire to later return the driver license is also too much.

Ursula checks with Sophia about this situation, and is happy to find out there is another way to delegate access to her prints. She just needs to follow these procedures.

  1. Make sure Claire is registered at Sophia’s. This is to make sure if Claire does something bad, Sophia’s can track her down. This is one-time process.

  2. If Claire is indeed on file at Sophia’s, when she is ready to come in and pick up the pictures, she needs to have something called the Access Token. The Access Token basically says the token holder is authorized to access which resource during which time period. In this case, it should say the holder is authorized to pick up Ursula’s prints on her behalf.

  3. To get the Access Token, Claire needs a Request Token endorsed by Ursula for exchange. She first calls Sophia’s to get a general Request Token. Based on instructions on the Request Token, Claire asks Ursula to call Sophia’s directly to validate this Request Token. When the validation is successful, Sophia’s asks Ursula to call Claire and tell her the Request Token is now endorsed.

  4. With the endorsed Request Token, Claire then calls Sophia’s to exchange it for a long term Access Token.

  5. With the Access Token, Claire can visit Sophia’s at any time before the token expires to get the prints as authorized by Ursula.

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197772 2011-01-18T17:22:00Z 2013-10-08T16:03:31Z On facebook's potential

Many assumes that Facebook has to rely on Google-style in-the-margin ads as its major revenue source. I believe Facebook has the potential to bring a new form of online ads, for example, a new interactive game-like campaign that virally spread across the friend network with those participants given incentives like Facebook credits.

It’s rather limiting to think Facebook as an advertiser like Google. The real potential of Facebook is way beyond this. Facebook is not just connecting people to their friends. It is a middleman – a platform that connects customers to vendors, fans to artists, and gamers to game developers, and there could be much more than these. Think iOS as a platform that connects mobile users and app developers and how it has worked out – and would have worked out even it was a standalone company. Maybe someone will develop an Amway-style direct selling platform on Facebook. Maybe someone could develop a CRM and compete with salesforce.com for SMB. Or maybe a Priceline clone with social features would emerge. And good thing is Facebook does not need to do all these. It just need to inspire a developer community around it and evolve its platform to support new possibilities.

It’s gold rush again, and like last time – it wasn’t the gold miners that get rich; it was the people who sold the miners and other gold rush followers the tools and supplies they needed.

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197774 2011-01-13T17:56:00Z 2013-10-08T16:03:32Z Ars Thinks Google Takes a Step Backwards For Openness - Slashdot

 

That's all fine and well for Google and their endless buckets of cash, but what about other companies, or importantly startups who want to get into the game.

H.264 is a standard; not a de-facto, or "industry" standard, but one adopted by an international standards body with wide representation. It publishes specs. If you build a part to do something with H.264 video, as long as it conforms to spec, it will work with others' products. You know, like the way any unlocked GSM phone works on any GSM network that operates on the same frequency band. It's ideal for startups, because you only need expertise in your own narrow product field, not in the entire much broader space. To build say an innovative silicon decoder you don't need to know how to build an encoder, because the elementary stream conforms to the standard. You don't need to know whether it came off a disc or ethernet. And while you occasionally run into interop issues this is positively nothing compared to the alternative of having inhouse expertise for *everything*. Not to mention the cost of dealing with some hacker who thinks they're doing something smart in the encoder, blowing up your taped-out decoder you've sent off to fab!

Compared to other costs, licensing fees are fairly trivial. $100k doesn't even buy a competent engineer for a year.

H.264 is a standard and that means a lot! Google is sounding childish in its own wonderland of a world of openness without understanding what an international standard entails.

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197775 2011-01-12T02:31:00Z 2013-10-08T16:03:32Z Google To Drop Support For H.264 In Chrome

Does Chrome really have the market share required for this move to have any effect on the decisions of web designers?

Yes. Chrome is rapidly eating market share: in just about 2 years since launch, it's at 13.5%. This is twice the share of Opera and Safari combined. But the decision to drop H.264 doesn't put Chrome "versus the world", as they already had Firefox and Opera in their camp (which also lack H.264). Opera + Safari + Chrome make over 50% of the browsers used today, in market share.

This is substantially different than the previous situation, where Google, Microsoft and Apple all had a H.264 browser, and Firefox looked like the odd one out, while Opera was quietly awaiting the market to decide (they'd have no choice but support H.264, if Firefox did it).

However, the battle is still not over for H.264. The common wisdom is that Google is pushing their WebM standard and that's why they drop H.264. If they really think it's that simple, they have not done their math right.

The growth is with mobile devices. The leaders among them is Apple with iOS, and Google with Android, both of which come with hardware support for H.264, and no WebM hardware support (future support in... theory, but I can say, count Apple out). So what are web content owners left to do? Maybe encode all content twice: WebM and then H.264. Imagine the hassle of, ironically Google's very own, YouTube, having YET another version of every single video they have in their library: FLV, H.264 and now WebM.

No, actually web authors will opt for the simplest choice, that's least amount of work: the same H.264 video everywhere, making use of hardware support for H.264 in mobiles, exposed via HTML5, and ... Flash on the desktop, which also support exactly the same H.264 videos.

So, in attempt to push WebM, Google may end up accidentally (or not..?) cementing Flash's position on the desktop as the video player for the foreseeable future.

I used to think Flash will considerably fade away once IE9 becomes mainstream (which comes with GPU accelerated renderer and H264 support), but now things are suddenly interesting again for Adobe.

A very insightful look at the issue. Thanks to the big mobile device market, this move would not harm H.264, but will help flash.

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197778 2010-12-30T19:32:00Z 2013-10-08T16:03:32Z Cassandra vs MongoDB vs CouchDB vs Redis vs Riak comparison

Cassandra vs MongoDB vs CouchDB vs Redis vs Riak comparison

While SQL databases are insanely useful tools, their tyranny of ~15 years is coming to an end. And it was just time: I can't even count the things that were forced into relational databases, but never really fitted them.

But the differences between "NoSQL" databases are much bigger than it ever was between one SQL database and another. This means that it is a bigger responsibility on software architects to choose the appropriate one for a project right at the beginning.

In this light, here is a comparison of Cassandra, Mongodb, CouchDB, Redis and Riak:

CouchDB

  • Written in: Erlang
  • Main point: DB consistency, ease of use
  • License: Apache
  • Protocol: HTTP/REST
  • Bi-directional (!) replication,
  • continuous or ad-hoc,
  • with conflict detection,
  • thus, master-master replication. (!)
  • MVCC - write operations do not block reads
  • Previous versions of documents are available
  • Crash-only (reliable) design
  • Needs compacting from time to time
  • Views: embedded map/reduce
  • Formatting views: lists & shows
  • Server-side document validation possible
  • Authentication possible
  • Real-time updates via _changes (!)
  • Attachment handling
  • thus, CouchApps (standalone js apps)
  • jQuery library included

Best used: For accumulating, occasionally changing data, on which pre-defined queries are to be run. Places where versioning is important.

For example: CRM, CMS systems. Master-master replication is an especially interesting feature, allowing easy multi-site deployments.

Redis

  • Written in: C/C++
  • Main point: Blazing fast
  • License: BSD
  • Protocol: Telnet-like
  • Disk-backed in-memory database,
  • but since 2.0, it can swap to disk.
  • Master-slave replication
  • Simple keys and values,
  • but complex operations like ZREVRANGEBYSCORE
  • INCR & co (good for rate limiting or statistics)
  • Has sets (also union/diff/inter)
  • Has lists (also a queue; blocking pop)
  • Has hashes (objects of multiple fields)
  • Of all these databases, only Redis does transactions (!)
  • Values can be set to expire (as in a cache)
  • Sorted sets (high score table, good for range queries)
  • Pub/Sub and WATCH on data changes (!)

Best used: For rapidly changing data with a foreseeable database size (should fit mostly in memory).

For example: Stock prices. Analytics. Real-time data collection. Real-time communication.

MongoDB

  • Written in: C++
  • Main point: Retains some friendly properties of SQL. (Query, index)
  • License: AGPL (Drivers: Apache)
  • Protocol: Custom, binary (BSON)
  • Master/slave replication
  • Queries are javascript expressions
  • Run arbitrary javascript functions server-side
  • Better update-in-place than CouchDB
  • Sharding built-in
  • Uses memory mapped files for data storage
  • Performance over features
  • After crash, it needs to repair tables

Best used: If you need dynamic queries. If you prefer to define indexes, not map/reduce functions. If you need good performance on a big DB. If you wanted CouchDB, but your data changes too much, filling up disks.

For example: For all things that you would do with MySQL or PostgreSQL, but having predefined columns really holds you back.

Cassandra

  • Written in: Java
  • Main point: Best of BigTable and Dynamo
  • License: Apache
  • Protocol: Custom, binary (Thrift)
  • Tunable trade-offs for distribution and replication (N, R, W)
  • Querying by column, range of keys
  • BigTable-like features: columns, column families
  • Writes are much faster than reads (!)
  • Map/reduce possible with Apache Hadoop
  • I admit being a bit biased against it, because of the bloat and complexity it has partly because of Java (configuration, seeing exceptions, etc)

Best used: If you're in love with BigTable. :) When you write more than you read (logging). If every component of the system must be in Java. ("No one gets fired for choosing Apache's stuff.")

For example: Banking, financial industry

Riak

  • Written in: Erlang & C, some Javascript
  • Main point: Fault tolerance
  • License: Apache
  • Protocol: HTTP/REST
  • Tunable trade-offs for distribution and replication (N, R, W)
  • Pre- and post-commit hooks,
  • for validation and security.
  • Comes in "open source" and "enterprise" editions

Best used: If you want something Cassandra-like (Dynamo-like), but no way you're gonna deal with the bloat and complexity. If you need very good single-site scalability, availability and fault-tolerance, but you're ready to pay for multi-site replication.

For example: Point-of-sales data collection. Factory control systems. Places where even seconds of downtime hurt.

Of course, all systems have much more features than what's listed here. I only wanted to list the key points that I base my decisions on. Also, development of all are very fast, so things are bound to change. I'll do my best to keep this list updated.

-- Kristof Shameless plug: I'm a freelance software architect and consultant; have a look at my services! -->

What can I do to help you?

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197779 2010-12-28T23:36:00Z 2013-10-08T16:03:32Z a great wallpaper

I'd like to get one. Waiting for budget.

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197781 2010-12-27T23:18:00Z 2013-10-08T16:03:32Z Spaghetti code; Ravioli COde; Lasana Code; Bon Appetit for the holiday!

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197783 2010-11-12T22:18:00Z 2013-10-08T16:03:32Z Explain REST
Martin Fowler gives a deep explanation of what is RESTful. The use of REST could be as raw as SOAP which only uses HTTP as a transportation layer between the client and one server endpoint, to mapping each resource to a dedicated URI, to mapping HTTP verbs and errors to HTTP methods and status code, and to finally using some HTML element to help discover service.

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197785 2010-11-12T00:14:00Z 2013-10-08T16:03:32Z The 3 Programming Languages you need to Know
  • A happiness language that you think in,
  • A GTD language that you get your stuff done quickly,
  • a bread and butter language that you know just in case you need to hustle yourself to provide for yourself and your family.

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197787 2010-11-02T21:14:00Z 2013-10-08T16:03:32Z Paul Buchheit: Serendipity finds you
Check out this website I found at paulbuchheit.blogspot.com

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197742 2010-10-23T21:09:47Z 2013-10-08T16:03:31Z So Apple will stop creating its own JVM. So what?

It seems to have become trendy again to hate Apple no matter what, but this is getting ridiculous. Why is it that Apple is expected to be the only platform vendor that has to maintain their own version of the JVM for free? Jobs is quite correct in saying that Java under OS X has long lagged behind the latest official Sun release. I wish it was more common for Apple to leave more components to third parties now that they’ve got more market share. Another example would be graphics drivers, which lag tremendously in both performance and features. I don’t understand why on Earth any Java dev would want to be stuck indefinitely with Apple’s outdated implementation that by definition would never be a major priority rather then get a version from the main organization behind it. For that matter I blame Sun’s longstanding ambivalence toasted FOSS. If we had a fully open GPL edition of the JVM that was best of class like we should have gotten years ago, this never would have been an issue in the first place. It’s yet another tech Sun’s BS has screwed us on, with their insistance to out ZFS under the CDDL rather then Apache/BSD/LGPL being another major example. Anyone still have that old sun strategy wheel, from before ‘acquisition’ became their final exit?

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197744 2010-10-18T06:07:00Z 2013-10-08T16:03:31Z GNU Parallel
Found this GNU utility to easily running jobs in parallel on local and remote machines.

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197751 2010-10-14T15:57:00Z 2013-10-08T16:03:31Z Alen's Notes: Focus-Follows-Mouse in Windows
A method to turn on focus-follow-mouse behavior on window. However, it is very buggy, and I just turned it off after Outlook keeps on raising itself.
]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197753 2010-10-05T17:05:00Z 2013-10-08T16:03:31Z Socket.IO: the cross-browser WebSocket for realtime apps.
Socket.IO

Socket.IO aims to make realtime apps possible in every browser and mobile device, blurring the differences between the different transport mechanisms. The client side API looks like this:

var socket = new io.Socket(); socket.on('connect', function(){   socket.send('hi!'); }) socket.on('message', function(data){   alert(data); }) socket.on('disconnect', function(){})

Under the hoods, Socket.IO will use feature detection to decide if the connection will be established with WebSocket, AJAX long polling, etc (see supported transports), making creating realtime apps that work everywhere a snap.

Real-time streaming over HTTP made easier.

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197756 2010-09-30T21:39:00Z 2013-10-08T16:03:31Z Celery

Celery is an open source asynchronous task queue/job queue based on distributed message passing. It is focused on real-time operation, but supports scheduling as well.

The execution units, called tasks, are executed concurrently on a single or more worker servers. Tasks can execute asynchronously (in the background) or synchronously (wait until ready).

Celery is already used in production to process millions of tasks a day.

Celery is written in Python, but the protocol can be implemented in any language. It can also operate with other languages using webhooks.

That should help implement master/worker style parallel computing.

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197758 2010-09-24T21:04:00Z 2013-10-08T16:03:31Z How to Raise Boys That Read (As Much as Girls Do): Not With Gross-Out Books and Video Game Bribes
A commenting list from HN
How I raised two boys who read:
1. Start reading to them pretty much as soon as they're born.
2. Read a lot - both frequently and as long as their attention holds. Their attention for stories will get longer as they get older if you keep reading to them.
3. Get comfy and make reading time a time to cuddle.
4. Read really well-written books - engaging plots, smart dialogue, solid exposition. Even young children are sophisticated and discerning enough to know when an author is condescending to them.
5. Perform when you're reading. Don't just read in a monotone: recite the book, with intonation and voices and accents and everything.
6. When they interrupt you to ask questions, take the time to answer them. By doing this, you help children to engage the story and build their own listening comprehension.
7. When they start to show an interest in reading, start teaching them how to do it. Get into the habit of taking turns reading to each other.
Edit - one more thing:
8. Be seen reading a lot yourself.
Original article via online.wsj.com

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197760 2010-09-21T17:56:00Z 2013-10-08T16:03:31Z hyde - static site generator backed by Django template

Hyde is a static website generator with the power of Django templates behind it. You can read more about its conception, history and features here and here.

]]>
Eddie Cao
tag:edditorial.posthaven.com,2013:Post/197762 2010-09-20T21:45:00Z 2013-10-08T16:03:31Z How to enable font anti-aliasing for Windows remote desktop connections

Microsoft quietly added the capability for font anti-aliasing (font smoothing) in Windows XP Service Pack 3.  This applies to Terminal Services (Remote Desktop / Remote Assistance) connections. This is very easy to do.  Just open up regedit (Start->cmd -> regedit) and make the following change:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations]

New DWORD Key: AllowFontAntiAlias

Value: 00000001

That’s it :)



« »

]]>
Eddie Cao