Thursday, May 10, 2012

The program can't start because LIBPQ.dll is missing from your computer. Try reinstalling the program to fix this problem.

If you're getting the above error when starting Apache after installing Apache and PHP on your Windows machine, go to your PHP install directory (e.g. c:\Program Files (x86)\PHP) and copy the file libpq.dll into the bin directory under the Apache install directory (e.g. C:\Program Files (x86)\Apache Software Foundation\Apache2.2\bin).

Want to join me as partner in a cool new startup?
Get in touch: pasha at cohai dot co

Bookmark and Share Thursday, May 10, 2012 7:04:05 AM (Jerusalem Daylight Time, UTC+03:00)  #    Comments [5]  
 Tuesday, January 03, 2012

A thought provoking article in the Atlantic about the education superpower Finland:

The small Nordic country of Finland used to be known -- if it was known for anything at all -- as the home of Nokia, the mobile phone giant. But lately Finland has been attracting attention on global surveys of quality of life -- Newsweek ranked it number one last year -- and Finland's national education system has been receiving particular praise, because in recent years Finnish students have been turning in some of the highest test scores in the world.

The thesis is the egalitarian approach is the main reason for the success:

In fact, since academic excellence wasn't a particular priority on the Finnish to-do list, when Finland's students scored so high on the first PISA survey in 2001, many Finns thought the results must be a mistake. But subsequent PISA tests confirmed that Finland -- unlike, say, very similar countries such as Norway -- was producing academic excellence through its particular policy focus on equity.

Not sure if applicable to some other countries, but definitely mind blowing.

Want to join me as partner in a cool new startup?
Get in touch: pasha at cohai dot co

Bookmark and Share Tuesday, January 03, 2012 6:12:04 PM (Jerusalem Standard Time, UTC+02:00)  #    Comments [7]  
 Tuesday, December 27, 2011

I'm a big fan of good naming in code, here's a recent example:

Suppose you have a unique index in a database table and you're trusting that index to enforce no more than one record with the key.

So you're using an insert ignore into...on duplicate key update statement.

So you end up calling something like DataAccess.InsertRecord(data) or DataAccess.AddRecord(data). Looking at such code it's very unclear that what really happens is an insert/update and you're only left with one record.

You can go the way of making your code explicit my moving the logic into your app and doing something like

var record=DataAccess.GetRecord(key);
if(record == null)
  DataAccess.InsertRecord(data);

But then you'll be losing the power of using the database do that for you.

So what I'm suggesting is just making your naming better, for example: DataAccess.ReplaceRecord(data).

Want to join me as partner in a cool new startup?
Get in touch: pasha at cohai dot co

Bookmark and Share Tuesday, December 27, 2011 9:34:39 PM (Jerusalem Standard Time, UTC+02:00)  #    Comments [25]  
 Monday, December 26, 2011

If you have annoying scrollbars around your Facebook app's canvas, here's what you need to do:

First, go to your app's settings, click "Edit App" and then "Advanced" on the right.

Scroll all the way down to "Canvas Settings" and change "Canvas Height" to "Settable".

Second, add a call to FB.Canvas.setSize() (http://developers.facebook.com/docs/reference/javascript/FB.Canvas.setSize/). Make this call inside window.fbAsyncInit, after calling FB.init.

That's it! Gorgeous app, no scrollbars!

Want to join me as partner in a cool new startup?
Get in touch: pasha at cohai dot co

Bookmark and Share Tuesday, December 27, 2011 4:50:42 AM (Jerusalem Standard Time, UTC+02:00)  #    Comments [6]  
 Sunday, December 18, 2011

If you're using the PayPal Adaptive Payments API in sandbox mode, redirecting the user to https://www.sandbox.paypal.com/cgi-bin/webscr and getting the following error:

This transaction has already been approved

The problem may be that you're using an incorrect sandbox user as the "sender" in the transaction.

You need to go to the sandbox (https://developer.paypal.com/) and then to "test accounts" on the left.

You need to create a test account. Click "preconfigured" next to "new test account" and then make sure you select "buyer" under "account type".

Now use the email of this account that you've just created as the "senderEmail" in the call to the "Pay" API operation.

Want to join me as partner in a cool new startup?
Get in touch: pasha at cohai dot co

Bookmark and Share Sunday, December 18, 2011 8:09:59 PM (Jerusalem Standard Time, UTC+02:00)  #    Comments [5]  
 Saturday, December 17, 2011
“When we would become friendly with an office,” he explained, “and they were important to us, and the chief of staff was a competent person, I would say or my staff would say to him or her at some point, ‘You know, when you’re done working on the Hill, we’d very much like you to consider coming to work for us.’ Now the moment I said that to them or any of our staff said that to ‘em, that was it. We owned them.”

Amazing stuff on the Jack Abramoff story.

Want to join me as partner in a cool new startup?
Get in touch: pasha at cohai dot co

Bookmark and Share Saturday, December 17, 2011 11:34:34 PM (Jerusalem Standard Time, UTC+02:00)  #    Comments [4]  

First you need to go to Server Manager, expand "Roles", right-click "web server" and choose "add role services".

Then under "security" choose "basic authentication".

Now go to IIS Manager, click "Authentication" and enable "basic authentication".

Last, set up a local user: go to Server Manager, expand "configuration"->"local users and groups". Right-click "users" and click "new user...". Set up a user/password.

Voila, now user the user/password you've set up when browsing to your website.

Want to join me as partner in a cool new startup?
Get in touch: pasha at cohai dot co

Bookmark and Share Saturday, December 17, 2011 11:12:13 PM (Jerusalem Standard Time, UTC+02:00)  #    Comments [5]  
 Monday, September 26, 2011

The Fjordruta is a great multi-day hike in the west of Norway. It has a little bit of everything: fjords, forests, mountains. The whole trail can take about two weeks but you can do as little as a couple of days.

The best time is summer. I did 3 days in late September: the conditions weren’t perfect but not too bad either. I had two overcast days with some rain and one sunny day. The ground is very wet so waterproof hiking boots will really be worthwhile.

The trail is well marked and there are unmanned, fully stocked cabins along the way. What the cabins have: food, gas, cooking gear, fireplace, beds with pillows and blankets, shower, toilet, water. This means that you don’t need to carry anything with you.

You need a special key to open the cabins. You can buy this key from the Norwegian Trekking Association (DNT) and from some tourist information offices. I don’t know how much it costs because I got mine from a friend. The price of the key is just a deposit so you can return it and get your money back.

You pay for the stay in the cabin and for the food you consumed by filling out a form and leaving it in a box in the cabin. They charge your credit card. A night costs 290NOK for non-members of DNT and 190NOK for members. It may be worthwhile signing up for DNT if you plan on spending more than a few nights, I didn’t check.

Getting there

From Oslo, you need to get to Kristiansund. You can either take a bus via Molde or a flight to Molde, then a bus to Kristiansund. Norwegian has some cheap flights and often a morning flight to Molde will be cheaper than the bus. The bus costs 690NOK from Oslo to Molde and when I went there I found a morning flight for 500NOK from Oslo to Molde. The flight is about 40 minutes, the bus is about 8 hours. The Oslo-Molde bus goes twice a day, in the morning and in the evening.

The bus from Molde to Kristiansund costs 140NOK and takes about an hour and a half. It also stops at the Molde airport and leaves every hour. After getting to Kristiansund you need to get to Tommervag to start the trail. You do this by taking a bus from the Kristiansund bus station (Traffikterminal) to Tommervag. This bus uses a fairy to get to Tommerweg and also leaves about once an hour. It takes about 1 hour to get to Tommervag.

The trail

I used a trail map for the Fjordruta that you can get at the DNT offices. It’s from 2004 and it doesn’t have some newly built cabins which I will describe here. The whole trail is pretty strenuous in my view so take this into consideration.

The first cabin is Trollstua. It takes about 2 hours to reach from Tommervag. I didn’t stay there and continued directly to the next cabin, Gullsteinvollen. This took about 5 hours of very fast and hard hiking from Trollstua, so take this into consideration. Both Trollstua and Gullsteinvolen were built in 2006 and do not appear on the 2004 map.

On the second day I continued from Gullsteinvolen to Imarbu. This also took about 5 hours of fast and strenuous walking. Imarbu is right on the fjord and it’s really pretty. This was my favorite cabin.

On the third way I hiked from Imarbu to Nersetra. This also took about 5 hours. Nersetra is not as nice but it has hot water for shower because it’s next to some administrative building of the KNT (Kristiansund trekking association) that has electricity.

From Nersetra you can hike to Aure in about 2 hours and then take the bus back to Kristiansund. I didn’t do this because I was lucky to get a ride from Nersetra back to Kristiansund with a KNT employee that happened to also spend the night at Nersetra.

Don’t worry about getting back at any point between Tommervag and Aure because there are bus stops in many places where the hiking trail crosses a road. I don’t know about the rest of the trail, from Aure and on, but I assume it’s similar.

Want to join me as partner in a cool new startup?
Get in touch: pasha at cohai dot co

Bookmark and Share Monday, September 26, 2011 8:46:23 PM (Jerusalem Standard Time, UTC+02:00)  #    Comments [10]  
 Tuesday, July 26, 2011

A little less than three months ago I started working on my new project, Cohaico, and today I'm launching the public beta of the website. From the announcement post on the Cohaico blog:

Let us fix that for you.

Guess what - your friends are already sharing everything they know about stuff. They do it on social networks like Twitter.

But if you get on Twitter - you'll just see what was said in the last few hours or so. It's hard to see what all your friends said about a particular thing.

This is what Cohaico does.

Exciting times!

Want to join me as partner in a cool new startup?
Get in touch: pasha at cohai dot co

Bookmark and Share Wednesday, July 27, 2011 1:46:19 AM (Jerusalem Daylight Time, UTC+03:00)  #    Comments [16]