Pages

Monday, June 30, 2008

Facebook Development with Python Saga

The story continues...
There are too many details now so I'm starting to write things down. :) The following are the details on how to set up the development environment and use Facebook APIs in web applications developed with Python. These are Windows specific because that's what I'm using currently.

Python
Install Python. Pretty simple, setup package. No surprises there.

SVN
Install TortoiseSVN or some other SVN client. It is quite handy for accessing various code repositories mentioned here. I'll assume you have it since it makes life so much easier.

There is a PythonPyFacebookTutorial available, which you can take a look at.

Django
I tried installing Django web templates by downloading the latest official release but it did not work. Tired of tweaking around, I downloaded the latest source with SVN and everything went smoothly.
Test by creating a test project and running a test web server.

PyFacebook
Same issue with SVN here. Download the code from the source repository. Run "setup.py install" to install packages.
Run "djangofb.py startapp fbapp" to create the test Facebook application.


Sunday, June 29, 2008

Facebook Development with Python

I'm looking how to develop Facebook apps with Python so that App Engine can be utilized. Need to see what those horse powers under the hood can do. :P
Resources to start with...
Facebook developers wiki page explaining PyFacebook
PyFacebook project
and source code access via http instead of SVN. You might still need an SVN client if you want to update to the latest version. Here is a tutorial on how to use PyFacebook.
To use this lib, you should also use Django web templates (a good idea for Python development generally). Installation instructions for Windows here.

Another, minimalistic, library is gminifb. Examples with minifb, the project prior to gminifb are online. Here is a Hello World project (Hello MiniFB.py) using minifb on Facebook. Includes source code and a tutorial.

WebDev

New era of web development. Actually, new era of software development, since it's all web nowadays.
Yahoo! Pipes, Dapper, Popfly, Appspot...

The list of tools should grow. I need these links as a reference for the tools to use for development.
Not to mention Facebook and other social apps APIs.

Google App Engine Terms of Service

Google App Engine Terms of Service - Google App Engine - Google Code

4.1. Subject to Section 12 of the Terms, the Service is provided
to you without charge for up to 500MB of disk storage, 10GB incoming bandwidth
per day, 10GB outgoing bandwidth per day, 200 million megacycles of CPU per
day and 2,000 emails per day. These quotas will be know as the “Fee Threshold”.
Google reserves the right to change this quota at its discretion.

Wow! I pretty much ignored the limitations of the app engine the first time I was playing with it. But now, looking at what's available it seems that this is practically endless for a single app. And the prices, if the traffic goes past the free limitations, are quite low.
Also, an interesting note is that Google is preparing support for other technologies (Java, PHP, Ruby, ...) to go along the support for Python.
I'm thinking to transfer all my online stuff to appspot...

Design

Financial Matters

Today I've been working on the site design a little bit. This is one of the rare occasions that I dedicated time to that aspect of the web sites. The fact is visible on the site - the design part is totally neglected. I will be changing that over time.
For now, I have added a few graphic elements - small images - to give some life to the pages. There is an animated icon on the front page that turns attention to the updates feed/site. The navigation menu on the Finance site looks decent now.
A little play with CSS and a some graphics and everything looks quite different.

Facebook Development

I added a few apps - games - as Facebook applications yesterday.
http://apps.facebook.com/eurochampion/
http://apps.facebook.com/billiards/
http://apps.facebook.com/alensblackjack/
http://apps.facebook.com/alenssniper/
http://apps.facebook.com/shooting/
http://apps.facebook.com/alensroulette/
http://apps.facebook.com/pokerdaisy/
http://apps.facebook.com/alenspacman/
http://apps.facebook.com/alensmspacman/
http://apps.facebook.com/alensfrogger/
http://apps.facebook.com/alensdarts/

There are more to come. I got tired of adding them to Facebook. Now I need to figure out how to make them available to other people. Here is a site (Facebook Developer) that has some interesting texts about Facebook development.
One of the first tutorials I saw was exactly the thing I'm looking for - Allow Your Users to Invite Their Friends.
I must admit I still haven't figured out how Facebook applications work. I assume the app (my app on my web server) has to be active i.e. use some kind of Facebook library to communicate with Facebook site and do all the work on its own.
The thing that keeps confusing me is the FBML and data access. I had an impression the pages execute on Facebook but that would probably be an overkill for the server. Hmmm... That makes sense. Well, this means I should focus on creating apps either in .Net or Python. Looking forward to play with it next time I have some free time.

Saturday, June 28, 2008

Online Games

Online games

I added a page with some interesting online games. These are useful if you have some time to spare. I guess I'll be needing them when I'm at the airport with 10 hours to kill until the next flight.
Enjoy.

Thursday, June 26, 2008

online file storage

Still looking for the best place to keep the scanned ebook online, available to everyone. MyDrive upload, after spending a couple of hours uploading, proved to be worthless as the file was rejected AFTER the upload. The allowed file size is 50MB.
Now I am uploading to myOtherDrive. The file size is enough to store 140MB book and the link is directly to the uploaded file, instead of the page with commercials or other extra stuff that I don't need.
The upload is very slow and it will take another hour or so before I know if everything is alright.

Wednesday, June 25, 2008

Okano's dead, baby. Looking for online storage.

The server that hosted my original web site for years has probably exhaled the last breath of life. The server was down for a few days and, when the host name reappeared, it was not set up the same way. This means I probably lost the files there. The server was still used to host certain files linked from my web sites. Since storage for web sites is limited and just enough for web pages and design images, I had to use some other online source to host some larger files, like the scanned book about Bosnia.
Now, to use some suspicious services that change their Terms and Conditions every month would be a pain. I need a reliable online provider that will not cut my files for no reason and will be there for long enough. Microsoft's SkyDrive seems like a reasonable candidate for this role. I will upload the book and re-link the web site tonight and see how it goes.
This will be an opportunity to finally move all the web pages that were still hosted at Djesi.ba to googlepages site. Will need to spend some time relinking the page and removing the subfolders but hopefully that will be the last I have to do to get the site back in order.

Sunday, June 22, 2008

Albums

Just finished an application that uploads photos to Flickr and creates a link to the photo page with thumbnail. The process of photo upload and album generation should now be extremely simple.
The albums are created from a page template and all that is left is to write the album title and paste the links from the desktop app after photo is uploaded.
Now I need to start bringing the camera with me again when I go through the Melbourne area. There is always something interesting to capture in photographs.
It's a sunny day, I should make a few photos of botanical gardens...

FlickrNet API Library

FlickrNet API Library - Home

Here is a project on CodePlex that contains Flickr APIs.
I need a simple process of uploading photos to Flickr and creating thumbnails for my album pages, together with link to an appropriate photo page on Flickr that contains all the details, comments, etc.

And here are some examples.

Saturday, June 21, 2008

QSH Database Setup

How to create and use a database - MS SQL 2005 Express Edition (User Instances only) - FAQ Freehosting - Quantasoft ASP.NET Webhosting

To successfully use SQL Express database in ASP.Net application, hosted at QSH, keep in mind the following tips:
  • Database name should be unique. Generate the connection string and add it to the web.config.
  • Use <remove name="LocalSqlServer" /> if you use LocalSqlServer as the connection name.
  • If using a custom connection string within the application, it should be named the way the DB name is generated on the admin page (domain_guid).
  • Upload only .mdf file, without log (.ldf)
That's it. The db connection works great.

Facebook Application - Step by Step

Facebook Developers | Resources

Here is a step-by-step tutorial on how to create a FBML Facebook application. First I want to try to create an app hosted at Facebook rather than create an external application. Later I may try that option, too, but right now I just want to create something that works. That would provide some satisfaction and boost my interest in developing something more complex.

Friday, June 20, 2008

WcfTestClient & TrueCrypt

What a stupid thing. I needed to test a WCF service so I fired up a WcfTestClient just to see if it can be reached. But no, the client would not start. It crashed with ArgumentNullException. :S
Then I went on a solving spree. First uninstalled .Net Framework 3.5 Service Pack 1 Beta. If anything, that should bring the workstation in line with other computers. No result.
Then I started removing other service packs, reinstalling them, removing dotnet frameworks (what a mess, shouldn't there be one framework only?). Nothing helped.
Restarted the computer, tried, and... it worked. Then I start all my startup programs and the client crashes again. Trying one by one - it shows that mounting a TrueCrypt volume pisses off the WcfTestClient and it crashes with the above mentioned exception. Too bad. Well, at least I know what's causing it and I can run the client when I need it, unmounting the TrueCrypt volumes first.

Edit: This is an issue of the Service Pack 1 for Visual Studio 2008. I am removing it from the workstation and the WcfTestClient is already acting better. :) At least it's not crashing, but is throwing other kind of errors. It is fun poking it while the setup process is replacing the files on the disk. Will remove both the patches which are parts of the SP1 Beta. I assume everything will be OK once the SP Beta is removed but let's wait and see.

Edit #2: Removing the SP1 Beta and reinstalling the .Net Framework 3.5 solved the first issue. The WcfTestClient has less options in the menu, I just noticed. :)
Now I get the following error:
Could not load type 'System.ServiceModel.FaultImportOptions' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Wednesday, June 18, 2008

ThinApp

Mmm... VMWare acquired Thinstall and the product is now called ThinApp. Microsoft is also working on an application virtualization solution. They have bought some company, too. :)
There are some new features and beta download should be available to anyone, according to Wikipedia. Looking forward to trying it out. I do need to make some applications portable. Or, at least, I'd like to have some sort of restore procedure that does not include classic backup/restore operation nor re-installation of all the software on a clean operating system.

Python

Having fun with the App Engine and Python.
There is a project called IronPython that apparently links Python and .Net frameworks. The development should be possible with Visual Studio. The release can be downloaded from here.

Monday, June 16, 2008

My First App on Google App Engine

Alen Siljak's First Google App Engine Page

Ha! I have just completed my first application deployment on App Engine. Since only three application domains are available, I will use the first application as an assembly of different functions.
What I need right now is a form handler and a contact page. The contact page or form I would like to add to my web sites so that it is easy for visitors to send me comments to my email address without revealing my email address publicly.
For this I need a form and an engine that will handle form values and send an email.
Since this is supported and handled by the App Engine, I will add a page/form/url which will handle the active part of the contact process. Static pages on the web sites will simply link to this url or host a form that should submit to the application url target.

Facebook Developer

Facebook | Developers

The starting point for Facebook application development. Set up new applications, edit the existing ones, communicate with other developers, and read the related news.

FBML Test Console
The place to test the FBML code, if that's what you're using for development.

Sunday, June 15, 2008

Google App Engine

Getting Started - Google App Engine - Google Code

Going back to check the development at Google... The App engine is now available for use. The apps use Python.
Now, for educational purposes, I'd like to create an app on Google and link it to Facebook. Apps on Google have access to data store. Apparently the apps in FMBL do as well but this would be "hitting two flies with one hit". :)

--

Wohoo! This is so cool. I'm sick and sleepy but I can't leave the new toy aside. :) I've installed Python and Google App SDK and created my first web python application! Hello World is alive and well.
If I manage to work out the basics, including data store, I guess I'll be able to create my first external Facebook application soon.

--

The link at the top leads to the tutorial on App Engine. It's simple and straightforward and works out of the box. No messy code and configuration and examples that don't work on your computer. Ah, what a relief!
This is very interesting. Generally, all that is needed is an engine - which is there - and a data store - which is there, too. In theory, you should be able to create any application online. Mm, ideas already flying through my tired mind.
It's been great seeing what the framework(s) can do nowadays. Definitely, the enthusiasm is back and I'll be thinking in terms of what can be done using the App Engine and Facebook APIs.

App Engine documentation seems very well organized and contains just enough information to utilize the engine. Happy developing!

Get Started with Facebook Application Development

Facebook Developers | Get Started

Here is the Developer Application, used to create Facebook applications. People complain about the lack of documentation so I'll keep that in mind while playing with it.

(I love ScribeFire addon for Firefox. It allows me to very easily add to my previous blog posts. That way I can post the initial link and then add to the post as the story goes rather than having several related posts.
I see people come to the blog to read about the problem I was having with Toshiba laptop and Windows Vista hanging but they miss the solution as it was spread across two or three additional posts.)

So, to continue with the Developer Application log on to Facebook and add the application to your list.

Facebook Apps & Other Popular Content

How to write a FaceBook Application in 10 minutes

Here's a brief overview of how to create a Facebook application. A marked this page because it also contains links to other stuff, like adding Google Maps to a web page.
This is what is keeping my interest right now. Doing (recreationally) some web development. Hopefully will get to explore Google Apps API and other available stuff. Yahoo Pipes and a few other sites are useful for aggregating different online sources and producing content. Looking forward to see how web has changed in the past several years.
All these available tools online remind me of a time when email started to go public, then followed by web space, javascript scripts, libraries of images, icons, etc. Now I have exactly the same feeling with Google Pages as I had with GeoCities back in the day. :) Love the enthusiasm.

Mesh - Kudos

Well, today I was criticizing Mesh.com and now I have some kudos for them. The conflict resolving system works and does not mess things up like FolderShare. You, as a user are in control of what's going on. It serves 10 conflicts at a time. I got a notification that "there are 10 conflicts", which I then resolved only to find the notification still hanging there. Clicking it again brings another 10 conflicts. OK, so its not a bug, at least. :P
Actually, this conflict handling procedure would not be necessary for me had the Mesh not mess up last night and refuse synchronizing my folders.
Sharing each individual web site works as opposed to sharing a folder which contains all the web sites. At least that's taken care of. Now I have some extra folders in the list but there's hope all these perks will be ironed out over time. After all the service is still in tech preview. Which is funny. Does having buggy and incomplete software as a tech preview show what the final product will be? More buggy and incomplete, I mean. :D

Crappy Mesh

Oops!
There are problems with Mesh.com if you want to synchronize your web sites. Everything was fine until I played with Expression Web and started using templates. This feature requires the metadata to be stored for each web site. Turning this on (similar to previous FrontPage behavior) causes the folder containing the web site to disappear from a shared Mesh folder.
Since I have a whole bunch of changes on the web pages and templates now, I need to find a way to store them back online and synchronize with the laptop. Hopefully this can be solved by sharing each of the web site folders separately instead of sharing their root folder, which contains all my web sites.
Well, let's give it a go...

...

This seems to have fixed it. Phew! Now I can keep web sites set up for the usage of templates AND synchronize them. Good, back to work.

Friday, June 13, 2008

Chasers - War on Everything - Americans

MySpaceTV Videos: Chasers War On Everything - Americans by hiphop eX equipo

Since the video on YouTube was removed, here's the link to another one online.
This show is phenomenal. This is something everyone should see. :))

Expression Web Templates

This is great thing! I've been playing with Google Pages in order to extract pieces of information from my main web site and move it to a separate web site. In order to reduce time needed to migrate the pages, I decided not to copy and paste the common code in pages but only to copy the important bits - the content. An issue that popped up and had to be handled manually was the CSS style sheets.
To avoid having poorly styled pages, I used readily available design templates on the pages web site. Unfortunately, I was not too happy with these so I decided to look if something has been improved in the template area in the previous years.
And - yes! Similar to the concept of Master Pages in ASP.Net, Expression Web supports a concept of Dynamic Web Template pages. These have exactly the same role as the design templates in Google Pages. You define the common areas on the template and editable areas that each page will utilize and that's it.
Now, I should start updating my old web sites because the code there is copied and spread around on the pages. It was a pain when I had to update some common elements and it often resulted in only some pages being updated. I had no patience to go through every page and change some details. Lately I wanted to add Google Analytics along with PageCounter to see the stats available there. This was a pain so I added it only to a few pages. Adding AdSense also resulted in only a few pages being updated. Etc.
Dynamic Web Templates (DWT) will enable me to still keep the contents of the pages offline. I prefer that because I use those pages as text documents containing valuable information and I like them to be searchable on my laptop, not only online. The templates will enable me to do that.
This makes me happier than if I went to the pub with Greg. :) I must be such a nerd, I know.

Google Adsense, Web Activity, etc.

Making Money Online Series

Mm, tapping (finally) into the world of online marketing. Got an email from Google Adsense this morning so I went to their site again, after a few years. I was amazed to find $0.45 on the account there. From what I remember, I had set up AdSense only once, long time ago. Then I place ads on my blog and web page to see how it works. It may have been online for a day or two. Then I got pissed off and annoyed by the ads because I hate looking at them on other people's pages and I removed them.
Now I don't know when was the money generated but apparently there were only 2 or 3 clicks. On average it was $0.20 per click. It is not much, of course, but taken into a different context it could be just enough. I used to see people saying how they use their AdSense revenue to pay for their web hosting. With hosting prices being affordable nowadays, even this small revenue from advertising could be just enough to support site hosting.
Well, anyway, I'm going to try it and see what happens in the next few days/weeks. An amazing thing happened the other day. I was working with WebHTTPBinding for Windows Communication Foundation service and was looking for some answers online as I couldn't figure out if some things were possible and whether they worked the way I expected. As I found something useful, I'd post it here on the blog to keep a reference as I usually do. After short time, searching the same topic on Google, I would get my blog page within the first 10 results on Google. Wow, it was funny as the first thing that came to my mind was to call myself and ask these questions I had. :D
I see a lot of people visiting my pages coming from everywhere. Wondering if there are CPM ads that might proove to be an incentive to be a bit more proactive on the web, refreshing the content of the site and post to the blogs more often. The site has not been updated for a long time as the blog technologies seem much easier to use, post, search, etc.
Finally I also added the new custom search for the site and the site is back to googlepages. I used to host it in my Dropbox folder but I changed my minds after Dropbox was offline for a few times. So, instead of being lazy, I will now trade page uploads for a more reliable hosting service.
The ads I added to pages are unobtrusive for me. They are at the bottom of the pages so probably noone will ever click them. :) But that's what I want to see.

The point of the post was to add to the introduction and me being amazed that there is a lot of marketing hype around AdSense. People find high-paying words, there are ads of generating dozens of thousands of dollars in online advertising, etc. I'd just repeat the old saying - "if it sounds too good to be true, it probably is."

Microsoft Event

Hm, now that I keep two blogs I run into a situation where sometimes posts fall into both contexts. For example, I attended the event at Microsoft Australia yesterday. This is interesting from software development perspective as it's one of the rare times I had an opportunity to actually see presentations from people working for Microsoft and ask questions.
On the other hand, it's related to Australia as I did not attend many of these when I was overseas. So, in order not to repeat the text, here are the links to Australian blog posts. :)

See here - MS Event, Microsoft Event

Tuesday, June 10, 2008

Entity Framework

Getting started with ADO.NET Entity Framework. Part I: Mapping entities

A nice and easy way to start with Entity Framework. Once you have it installed, that is. I've spent a couple of hours downloading and installing all the Service Packs (beta) for Visual Studio 2008, dotNet Framework 3.5, TFS & co.

Sunday, June 08, 2008

webHttp

WebHttpBinding Class (System.ServiceModel)

A binding used to configure endpoints for Windows Communication
Foundation (WCF) Web services that are exposed through HTTP requests
instead of SOAP messages.

This is why clients can't connect to a webHttp endpoint.

WCF: webHttpBinding & authentication

WCF, WebHttp Binding, and Authentication « Infovark Underground

I spent the day coming to the same conclusion. Couldn't figure out how to make webHttpBinding work with some sort of authentication.

Saturday, June 07, 2008

Dvorak shortcuts for Cut/Copy/Paste

Alternate Shortcuts to cut-copy-paste at ibn Mas’ud

Hm... there are alternative shortcuts for Cut/Copy/Paste which may prove useful to standard Ctrl+C, V, X on a Dvorak keyboard. They are a bit confusing and not that easy to reach on my laptop.
Unless I find some software to remap shortcuts on the keyboard I may try to use these.

ActionShortcutAlternate Shortcut
CutCtrl+XShift+Del
CopyCtrl+CCtrl+Insert
PasteCtrl+VShift+Insert

Cut & Paste are handy, while Copy is highly disruptive. Hope I get used to them. :S

Thursday, June 05, 2008

WCF Service and Error Handling

Implementing Error Handling in Window Communication Foundation - SQL Server Expert

Apart from error handling, there are instructions on how to quickly set up a WCF service hosted in IIS.