Saturday, November 24, 2007

I'm proud to announce the newest addition to the bitz family of quality web products - khjgf.

Frequently Asked Questions
Q: Is this a result of a "weekend-experiment"?
A: Somewhat.
Q: Is this a result of mind-altering substances?
A: Likely.
Q: Is this a part of some secret-society-taking-over-the-world kind of thing?
A: Maybe.
Q: Are you mad, mate?
A: I'm affraid so.


More on Madness at pashabitz.com:
Scrum Lovers

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

Bookmark and Share Sunday, November 25, 2007 1:14:40 AM (Jerusalem Standard Time, UTC+02:00)  #    Comments [1]  
 Monday, October 29, 2007

The MySQL query optimizer has trouble with queries that contain a join to a union.
Lets take a look at the following example:

select u.f1, u.f2 from
(select t1.f1, t2.f2 from t1 join t2 on t1.f3 = t2.f3
union
select t3.f1, t2.f2, from t3 join t2 on t3.f3 = t2.f3) u
where u.f2 = ?val


Now, suppose we have an index on column f2 in t2. If you look at the explain plan, you will see that MySQL does not use it.
So, the solution is to move the where constraint into the parts of the union itself:
select u.f1, u.f2 from
(select t1.f1, t2.f2 from t1 join t2 on t1.f3 = t2.f3
where t2.f2 = ?val
union
select t3.f1, t2.f2, from t3 join t2 on t3.f3 = t2.f3
where t2.f2 = ?val) u


This time, the index on f2 will be used and the query should perform much better.

More on MySQL at pashabitz.com:
MySQL .Net Connector Bug

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

Bookmark and Share Tuesday, October 30, 2007 4:10:38 AM (Jerusalem Standard Time, UTC+02:00)  #    Comments [8]  
 Saturday, October 27, 2007

1. Work on something really big. I mean so big, it's a hubris to even think about it.
2. Our product is related to social networks, so if your boss catches you staring at good-looking girls (or boys) in Facebook, you can say "It's for work" and he will beleive it.
3. Pool table at work. (May be taken away from us any day now, so hurry up!!)
4. Work with really smart people. But not annoying, self important, square-type smart. Smart and fun-to-get-drunk-with type.
5. Our offices are ideally situated on the 10th floor in the Hertzlya-Pituach hi-tech district.
Perfect for BASE jumping, if you can squeeze out. The windows don't open that much.
View of the sea (if CEO).
6. Solve really complicated problems on a daily basis, such as: How to effectively store and access a graph that is many terabytes in size? How to extract meaning from unstructured text? Where to go for lunch??
7. Cutting edge technology and methods: .Net, Java, WCF, JLO, search engines, MySQL, TFS, Scrum, just to mention a few.
You know JLO is a fake one, right?
8. Free Bitzwear t-shirt as signing bonus.

Semingo is hiring:
Expert in search engines
Expert in text retrieval
Top notch .NET developer
QA expert

Drop me a line at "pasha at semingo dot com" if interested.

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

Bookmark and Share Sunday, October 28, 2007 4:06:18 AM (Jerusalem Standard Time, UTC+02:00)  #    Comments [8]  

With ASP.NET Forms Authentication it's easy to setup a login page.
What if you want to make the login functionality more seamless? That's quiet easy too.
Remember that Forms Authentication uses a cookie to distinguish an authentication user from an unauthenticated user.
Here's a recipe for setting up an AJAX-style login:
1. Collect the user/password and send them to the server using AJAX.
2. On the server-side handler, verify that the user/password combination is correct and add the authentication cookie using the FormsAuthentication.SetAuthCookie method.

Now, the authentication cookie will be appended to subsequent requests to urls within your application.

More on Forms Authentication at pashabitz.com:
Security Issue with FormsAuthentication.RedirectFromLoginPage

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

Bookmark and Share Sunday, October 28, 2007 2:27:13 AM (Jerusalem Standard Time, UTC+02:00)  #    Comments [0]  
 Tuesday, October 23, 2007

Problem: I get an "access denied" error message when trying to save some change done to a web application in the IIS manager on Vista.

Possible solution:
Windows Vista comes with a new version of IIS. One of the new things in IIS 7 is that it saves it's configuration in the .net web.config files (previous versions used the "IIS metabase", which is a bunch of files internal to the IIS configuration tool). This is an improvement because it simplifies deployment and versioning - all you need to do is edit an xml file, whereas the IIS metabase is configurable only using a special API.

Correction(following Eyal's comment): actually the IIS metabase is an xml file that can be directly edited.

So, why the "access denied"? If you're making an application-level (as opposed to machine-level) configuration, many times it's because your application's web.config file is not checked-out for edit in VS, and so it is read-only on disk. IIS manager cannot write to it and shows you the error.

More on IIS 7 at pashabitz.com:
How to setup a custom HttpHandler in IIS 7
Developing ASP.NET apps under II7 on Vista.

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

Bookmark and Share Tuesday, October 23, 2007 11:58:50 PM (Jerusalem Standard Time, UTC+02:00)  #    Comments [5]  
 Monday, October 22, 2007

This is so cool. I just bought the new Radiohead album, "In Rainbows".
What's so special? The album is available only by direct download from a website set up by the band (http://www.inrainbows.com/).
Everybody wins:
1. The buyer - finally, I can legally download music from the internet (iTunes and the like do not allow downloads with a credit card that is issued in Israel).
2. The seller - Radiohead bypass the record label, and probably profit more for each album sold.

But that's not all. Coolness factor number 2 - you get to set the price you pay for the album. That's right. This is a brilliant idea already emplyed in the past (read here). When you trust your customers, they return the favor. Turns out, people end up paying more on average when given the chance to set the price themselves.
This is a very interesting pricing model that I think can work out very well for various products (perhaps web applications too). This method probably suits best products where the "normal" price is lower than a certain limit (say 100$). Above that I'm not sure it will work.

As to bypassing record labels and selling music direct over the web - I think in 2 years 90% of the artists will go this way.

p.s.
I payed 6 GBP, which is about 12 USD or 50 NIS.

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

Bookmark and Share Monday, October 22, 2007 11:27:54 PM (Jerusalem Standard Time, UTC+02:00)  #    Comments [2]  
 Saturday, October 20, 2007

I've stumbled upon (what appears to be) a bug in MySQL .Net Connector (version 5.1.3).
I opened the bug in the MySQL bugs database, you can read the details here - bug #31617.

Basically, when calling MySqlCommand.ExecuteReader with an sql statement that times out - you get back a closed MySqlDataReader and the underlying MySqlConnection becomes corrupted, meaning you cannot use it for new operations and you cannot close it either.

The workaround you can implement in the meanwhile is:

1. Always check that the reader you got is open before iterating on it:

using(MySqlDataReader reader = command.ExecuteReader())
{
  if(!reader.IsClosed())
  //use reader
}


2. "Fix" the connection by forcefully setting the problematic field using reflection:
  //if we got a closed reader from MySqlCommand.ExecuteReader, need to set the Reader property of connection to null
  PropertyInfo p = connection.GetType().GetProperty("Reader", BindingFlags.NonPublic | BindingFlags.Instance);
  p.SetValue(connection, null, null);



More on MySQL at pashabitz.com:
MySQL dates quiz
MySQL dates answer

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

Bookmark and Share Saturday, October 20, 2007 10:55:38 PM (Jerusalem Standard Time, UTC+02:00)  #    Comments [4]  
 Wednesday, October 10, 2007

There is a strange, underground, free-mason, rappers-delight, a-tribe-called-quest, thank-you-chuck-norris, scrum-lover-association-kind-of-thing taking shape as we speak.
For some reason, Moti and Oren simultaneously posted some seriously weird posts with some scrum mambo jambo in them. Moti even added some scary Egyptian-writing-stlye codewords in the end.

And then, of all things, they tagged me to be a "scrum clan member".
Well well. And I thought this blog doesn't take itself seriously.
If this is some sort of scheme to make me write something I don't stand behind, well, you got another thing coming, boys. My opinions on the Agile Methodologies are well defined and will be expressed in written form sooner rather than later.
And I'm supposed to tag someone.

Goodie goodie, it's a game.

For my serious pick, I tag Shani, who is doing really cool agile stuff as a team lead.
For my less serious, I-can-post-weirder-than-you-can pick, I tag Tomer as "scrum lover undercover".

p.s.
Does "tagging" mean I'm supposed to actually post something on scrum? Is that it?

p.p.s.
Google experiment #29:
1. Teenage mutant ninja turtles.
2. Scuba diving makes you hairy.
3. "Less code, more features" said the joker to the thief.

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

Bookmark and Share Wednesday, October 10, 2007 8:16:33 AM (Jerusalem Standard Time, UTC+02:00)  #    Comments [7]  

All web applications can be seperated by the way they charge users into three groups:
1. Free forever - using the application is free, for all the parts of the application, forever. Example: Google search engine.
2. Free to try - using the application for some time is free (usually first couple of weeks/months), then you have to pay to continue using the application. Example: Clarizen Project Management (my previous employer).
3. "Freemium" - there is a free version of the application that you can use forever, and there is one or more payed versions. The versions are distinguished by the features they provide.

The third model is maybe the most common and definitely the easiest to do wrong. That's because the devil is in the details.
The details are how the free version is different from the paying version. Your goal as a developer is to give something valuable to the user for free and make it so valuable that they want even more.
The goal is not to annoy your free users so much that they will pay just to make you stop annoying them. It won't happen.

And most importantly: don't design your differentiation in a way that in the free version it's possible to do everything that the payed version does but in a more annoying way.

The problem is that differentiation in the freemium model is very hard to do right in a service that is narrow and well defined, which is often the case. When your application does just one thing - how can you have different types of users?

Case in point:
Cafe Press, an otherwise great idea, has the freemium thing all screwed up:
They provide a service for people to design their own stuff (t-shirts, mugs...) and sell it in a web store hosted on Cafe Press. They take care of actually manufacturing the products and handling the ordering and shipping against the customer. You just design your stuff and take a percentage of the sales.
It's free to setup a "basic" store and it costs money to setup a "premium" store. The difference is that the "basic" store can only have one design for each product type. So you can sell just one white t-shirt, one colored t-shirt, one hand bag and so on.
But
Any free user can setup as many basic stores.
So, you can sell as many items as you want, just like a paying user, you just have to work harder (basically more clicks) and get more annoyed. The premium store can also have custom designs and better display of items, but that's not as important in terms of features to the user.

The people at cafe press have a great business. They make money from selling t-shirts and they don't have to pay for the designs. In my opinion, they should abandon the paying version alltogether. That will just drive more people to upload designs and increase sales.

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

Bookmark and Share Wednesday, October 10, 2007 7:07:45 AM (Jerusalem Standard Time, UTC+02:00)  #    Comments [0]  
 Monday, October 08, 2007

On this happy day, I am most pleased to announce the launch of my own clothing line - "bitzwear".
It's about time I joined the ranks of many sports celebrities and hip hop artists and designed my own, signature wear.
So, if you're young, cool, hip, smart and beautiful - get yours now! And get something for your friends too.
Available only from the official bitzwear store on the web.

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

Bookmark and Share Tuesday, October 09, 2007 6:53:40 AM (Jerusalem Standard Time, UTC+02:00)  #    Comments [4]