cro's place

Social Network: Fundamentals

Posted in Social Networking by cro. Wednesday November 28, 2007.

When looking at the development of a social networking site, there are a number of fundamentals that I think need to be implemented before you can consider that you have the basic framework for a social network.

Basic Information
The absolute basic building block of such a site is the user account, or user object. The question then becomes, what do we need to store about this user? The actual requirements will vary between types of social network, but for my purposes I’m storing a small subset of common user data:

  • username
  • password
  • nickname
  • gender
  • msisdn
  • birth date
  • address details

I’m recording the MSISDN since this will also be a mobile social network, and if we want to deliver services to the user via their phone, we need to know the number. This is also going to be the route we use for registration (text to a number to register) so we have some form of user verification.

This list is the basic information we need, but we also need some specific information that we’ll use internally, some of which the user will be able to change, some which we’ll use for identification purposes. So to this basic list I’ve added the following as well:

  • registration date
  • last visit
  • is adult
  • registered

We’ll use the two dates for some stuff as we go along (such as presence), and for redundancy (and because reading a field is quicker than calculating a date – here’s some thinking ahead going into the design), we’ll set a flag at registration time related to the user’s age. The last field, registered is a tracking field which is set to ‘true’ once registration is complete, since a user record is created for a new user as soon as they begin the registration process, not when they finish it.

Basics of Personalisation
Everyone likes to personalise their social networking accounts, but not all personalised information is always needed on every displayed page. Since we’re building up a basic user object that we’ll load for the user every time they visit, we only need some small additional information (initially at least), so we’ll add a couple of extra fields to the basic user object:

  • avatar
  • about me

Avatar is, as you would expect, related to a user’s picture. We’ll talk about how we deal with this information later, as there’s much more to a user avatar than just storing a picture. After all, if you have 25,000,000 users, where do you store all the pictures? You certainly don’t want every user to have their avatar stored as a blob field in the database…

The about me field is a little throwaway item I’ve put in as a quick way of letting peopel write a little about themselves, which is automatically displayed on their account. This and the avatar field are user changeable (as is the password, of course!).

The User Object
Now that we’ve determined a basic set of fields with information about a user, we can start setting up the database tables, and the underlying back-end code for loading, updating and using this object to deliver the social network itself. The manipulation of this object will be the subject of a later post.

Writing a Social Network

Posted in Social Networking by cro. Wednesday November 28, 2007.

Social Networking is something of a pehnomenon at the moment, with Facebook, MySpace and Bebo (amogn others) leading the public perception of what social networking is all about, although there are many, many others – including the one I wrote for Pitch and launched a little over a year ago.

It’s now been more than six months since I stopped working on the Pitch Social Network, and in the interim I’ve been working on developing a new social networking application. Speaking to some people I work with, I mentioned that I’d been thinking about writing a series of blog posts about Social Networking development, to discuss some of the ideas I have on how such applications should be architected, not just from a software point of view, but from the whole service architecture, including infrastructure, service design and software design.

Everyone I spoke to told me to go ahead, and now that I’m back from a few weeks away in Australia, it seemed like a good time to start.

So, what am I going to be talking about? I’m going to talk about what I see as the basics of the actual design and implementation of a Social Networking website, covering software design, service design, infrastructure thoughts, technical architecture, database design and the like. Whilst I may at times post code, this won’t be a series where I post the entire codebase for a social network, and it’s quite likely that whilst I’ll talk about certain architecture or design decisions, I may not necessarily use them in the site I’m building.

And alongside all this discussion will be an actual social networking site, which already exists on one of my servers. Or rather, there are two versions, a mobile one and a web one, with the only difference between the two being the way the underlying data is accessed. My intention is to write both versions side by side, ensuring that each version is functionally the same, and provides roughly the same experience regardless of device used to access.

Obviously there will be some fundmental differences between the two sites, at least in the plumbing. For example, mobile devices don’t normally support cookies, so the basic concept of a server-side session needs to be forgotten about, which leads on to discussions on how to deal with persistence of information between pages for a single user. And on the web, this type of discussion is moot as there are session-based services that can be used for persistence.

But I’ll try not to get ahead of myself too much in this introductory post, and leave off with a quick rundown of the tools I’ll be using:
For the site development itself: Object oriented PHP (4.3+)
For the database: MySQL 4
Development Tools: Eclipse IDE, Firefox, Opera.

And yes, an early version of the site is already available and running – links coming in a future post :)

Followup! Opens

Posted in Articles, General by cro. Wednesday October 31, 2007.

For those following along, on occasion I’ve mentioned a little side project I’ve been working on called Followup!, an anti-social social bookmarking application.

I’ve not done any real work on it recently, but over the past couple of days I had another look at it, and squashed a couple of annoying bugs (the double-login bug for one), as well as laying out some of the plans for future expansion.

With this, and following an earlier small post, I’m throwing Followup! open to everyone to use. Just sign up and get going – that’s it. Oh, and expect the obligatory Google ads to be installed soon too…

xorg.conf for Compaq Presario F500

Posted in Ubuntu by cro. Wednesday October 17, 2007.

I saw on the Ubuntu forums a comment about getting the NVIDIA drivers working with the Compaq Presario F500, so I thought it might be wortwhile posting my entire xorg.conf – since I know it works :) This configuration also supports compiz fusion, albeit slowly but you can, if you want, have the cube, wobbly windows and all the other bits and pieces. Add some extra RAM if you’re going to do this though :)

Section "ServerLayout"
    Identifier     "Default Layout"
    Screen         "Default Screen" 0 0
    InputDevice    "Generic Keyboard"
    InputDevice    "Configured Mouse"
    InputDevice    "stylus" "SendCoreEvents"
    InputDevice    "cursor" "SendCoreEvents"
    InputDevice    "eraser" "SendCoreEvents"
    InputDevice    "Synaptics Touchpad"
EndSection

Section "Files"
    FontPath        "/usr/share/fonts/X11/misc"
    FontPath        "/usr/share/fonts/X11/cyrillic"
    FontPath        "/usr/share/fonts/X11/100dpi/:unscaled"
    FontPath        "/usr/share/fonts/X11/75dpi/:unscaled"
    FontPath        "/usr/share/fonts/X11/Type1"
    FontPath        "/usr/share/fonts/X11/100dpi"
    FontPath        "/usr/share/fonts/X11/75dpi"
    FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
    Load           "i2c"
    Load           "bitmap"
    Load           "ddc"
    Load           "extmod"
    Load           "freetype"
    Load           "glx"
    Load           "int10"
    Load           "vbe"
EndSection

Section "InputDevice"
    Identifier     "Generic Keyboard"
    Driver         "kbd"
    Option         "CoreKeyboard"
    Option         "XkbRules" "xorg"
    Option         "XkbModel" "pc105"
    Option         "XkbLayout" "gb"
EndSection

Section "InputDevice"
    Identifier     "Configured Mouse"
    Driver         "mouse"
    Option         "CorePointer"
    Option         "Device" "/dev/input/mice"
    Option         "Protocol" "ImPS/2"
    Option         "ZAxisMapping" "4 5"
    Option         "Buttons" "7"
    Option         "ButtonMapping" "1 2 3 6 7"
    Option         "Emulate3Buttons" "true"
EndSection

Section "InputDevice"
    Identifier     "Synaptics Touchpad"
    Driver         "synaptics"
    Option         "SendCoreEvents" "true"
    Option         "Device" "/dev/psaux"
    Option         "Protocol" "auto-dev"
    Option         "HorizScrollDelta" "0"
EndSection

Section "InputDevice"
    Identifier     "stylus"
    Driver         "wacom"
    Option         "Device" "/dev/input/wacom"
    Option         "Type" "stylus"
    Option         "ForceDevice" "ISDV4"# Tablet PC ONLY
EndSection

Section "InputDevice"
    Identifier     "eraser"
    Driver         "wacom"
    Option         "Device" "/dev/input/wacom"
    Option         "Type" "eraser"
    Option         "ForceDevice" "ISDV4"# Tablet PC ONLY
EndSection

Section "InputDevice"
    Identifier     "cursor"
    Driver         "wacom"
    Option         "Device" "/dev/input/wacom"
    Option         "Type" "cursor"
    Option         "ForceDevice" "ISDV4"# Tablet PC ONLY
EndSection

Section "Monitor"
    Identifier     "Generic Monitor"
    HorizSync       28.0 - 64.0
    VertRefresh     43.0 - 60.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "nVidia Corporation MCP51 PCI-X GeForce Go 6100"
    Driver         "nvidia"
EndSection

Section "Screen"
    Identifier     "Default Screen"
    Device         "nVidia Corporation MCP51 PCI-X GeForce Go 6100"
    Monitor        "Generic Monitor"
    DefaultDepth    24
    Option         "AddARGBVisuals" "True"
    Option         "AddARGBGLXVisuals" "True"
    Option         "NoLogo" "True"
    SubSection     "Display"
        Depth       1
        Modes      "1280x800"
    EndSubSection
    SubSection     "Display"
        Depth       4
        Modes      "1280x800"
    EndSubSection
    SubSection     "Display"
        Depth       8
        Modes      "1280x800"
    EndSubSection
    SubSection     "Display"
        Depth       15
        Modes      "1280x800"
    EndSubSection
    SubSection     "Display"
        Depth       16
        Modes      "1280x800"
    EndSubSection
    SubSection     "Display"
        Depth       24
        Modes      "1280x800"
    EndSubSection
EndSection

Section "Extensions"
Option "Composite" "Enable"
EndSection

A Month 6 Months of Ubuntu

Posted in Articles, General, Ubuntu by cro. Wednesday October 17, 2007.

Time flies when you’re having fun, and I’ve certainly been having fun with Ubuntu recently. Looking back through my (not very frequent) posts, I see it’s been about 6 weeks 6 months! since I posted about installing Ubuntu as a test on my new laptop.

Since then, I can, quite literally, count on the fingers of one hand how many times I’ve booted back into Windows Vista. At the moment the Vista partition (all 20Gb of it!) serves to provide me with printing capabilities (My printer is an old Dell USB one that only barely works under Vista), and to update my iPod with some purchased music (Teeny Shiny and Bambi’s Dilemma by Melt Banana)

I have no reason or need to run Windows Vista on my laptop, and has been proven over the past four months, there is no reason I need to run Windows for work either. It’s turning out that the only reason I actually have a Windows desktop at all is to act as my games machine, since this is the one area that Linux is deficient. Whilst I know that a lot of games can run quite happily under WINE or through Cedega’s service, not all do. So for now, I have one Windows machine running XP (which will never have Vista installed on it), and one laptop running Ubuntu.

Going back to the work comment, for the past 4 months I’ve been working for as Head of Web Development for Hachette Filipacchi, the publisher of Elle Magazine, Red Magazine and Ideal Home amongst others. During that entire period I’ve been running a dual monitor desktop running Ubuntu Feisty Fawn (well, until recently when I did a dist-upgrade to Gutsy Gibbon). The only time I’ve had some trouble is with project management software, which I rarely need anyway. There was nothing I needed that was Windows only. As a quick rundown, here’s the most common software in use in the office, and what I replaced it with.

Microsoft Exchange
Replaced with Evolution (through a webmail connection). Whilst it’s possible to connect to an Exchange server through IMAP, the IT department weren’t comfortable with that.

Microsoft Word, Microsoft Excel, Microsoft Powerpoint, Microsoft Visio
Replaced with Open Office, and no-one noticed. I now use Open Office exclusively.

Tortiose SVN+PSPad
Replaced with Eclipse+Subclipse+PHPEclipse. I’m finding the move to an IDE to have been beneficial, rather than just using a text editor. Combining Eclipse with a local copy of Apache+PHP+MySQL means I can do all my web development on my local machine, and use Subversion to store the code, and later publish to the live webserver in a managed way. Very handy.

MSN Messenger
Replaced with Pidgin, although there was also the option of Meebo, and to deal with some firewall issues I also wrote my own web-based chat app.

Photoshop
Replaced with The Gimp. This is perhaps the most contentious issue for some people, since whilst The Gimp isa good piece of software, it is certainly not in the same league as Photoshop when it comes to image manipulation. That said, since I’m not a designer and only use The Gimp to resize images, and perhaps create some spot graphics, it’s not an issue for me.

Winamp
Replaced with Amarok.

Filezilla
Replaced with… Filezilla. Yep, there’s a native port of Filezilla available for Linux, and recent releases have made it as stable as the Windows version of the software.

The Bat
Replaced with Firebird. I think Firebird still a little ways to go to be as useful as The Bat, but I find it quite suitable as a mail client.

That pretty much covers everythign I need on a day to day basis. Having direct access to a command shell also helps tremendously when developing websites, and I can connect to the webserver very quickly. Running Ubuntu also makes it extremely easy to install and maintain a local web development environment, so I actually do all my development directly on my desktop under Apache 2, PHP5 and MySQL5. Once I’ve done my coding, I can simply commit to my SVN repository and then check out the code directly to the live webserver. Makes developing complex websites very easy!

One perhaps under mentioned aspect of running Ubuntu (or many other Linux distributions for that matter) that I have found remakably useful – and something I actively miss when using a Windows machine – is multiple workspaces. For example, on my laptop I have four workspaces arranged in a 2×2 grid, and I can place windows within a particular workspace to organise them into logical work groups.

On my work machine, whilst I had two monitors, I retained the four workspaces (although I also ran Compiz Fusion, so I had the 3D cube rather than a 2×2 grid), again allowing me to group windows together into logical workspaces. So I would have one workspace for email clients, one for research, one for development (Eclipse, local web browser, editors etc) and so on.

The new version of Ubuntu is due for release tomorrow, and having been using it for the past few weeks, I think this is the next major step forward for Linux – it does just work.

As a last note, a lot of people I have spoken to claim that it’s almost impossible to get support for Linux, which is why they don’t use it. I did some checking, and Canonical, the company behind Ubuntu, provides commercial support for Ubuntu via email and telephone – and you can buy support for an entire YEAR for £150…

Fashion Week Website for Elle UK

Posted in General by cro. Tuesday October 2, 2007.

Just a quick post on some recent work I’ve been doing. Those interested in fashion may have noticed that the past few weeks has seen the various Fashion Weeks being held in New York, London and latterly Milan (and with Paris rounding out the season starting tomorrow).

As part of the coverage, Elle UK launched a special Fashion Week microsite.

I developed the site, along with Jon Ramster and Jason Newington. The underlying data structure contains support for an effectively unlimited number of designers, fashion shows and images (OK, so the directory structure for the image server only supports 8,000,000 images…), and also allows almost any node to be ‘bookmarked’ by a user, all within the application. The site also has a comprehensive CMS behind it all, including FTP-based file upload (fashion shows generate a lot of images), which allows the Elle editors to update the site whenever they want, whilst also pulling in the latest available images from the latest shows.

So check out the Elle UK Fashion Week microsite and let me know what you think!

Update! In January 2008 I went back to Elle for a week to work on updating the site’s code for the new season of fashion shows. New design, new featrues, but the same underlying data structure as the previous incarnation, so all previous content is available in the new design.

New Tokyo Jihen Album on iTunes UK

Posted in Japanese Stuff, Music by cro. Monday October 1, 2007.

It’s probably fairly common knowledge that I’m something of a Tokyo Jihen fan, to the point where I pre-order new singles and albums when they’re announced (which has led me to having two copies of 娯楽 as I mistakenly pre-ordered it twice).

However, the big news is that the album is also available to buy from iTunes UK for the bargain price of £8.99 – something I am considering doing even though I already have a couple of copies, if only to convice the powers that be to release more 東京事変 and 椎名林檎’s back catalogue through iTunes UK.

Sprint’s Customer Service Shows Greater Issues in US Telecoms

Posted in Articles, Mobile by cro. Monday July 16, 2007.

Cross posted from The Mobile Weblog.


I've deliberately avoided posting about this subject the past few days, although I've been following it since it first appeared on The Consumerist website last week. I've also been encouraged to write about the post by a number of other bloggers.

I've vacillated between two schools of thought about this topic, but the one I keep coming back to relates to the underlying principles of capitalism, where Sprint are well within their rights to terminate any customer for pretty much any reason – they are, after all not in the business of providing communication service, but the business of making money for their shareholders. They just happen to be making money by providing communication services.

It can also be argued that the actions Sprint are taking in churning these customers off their books is beneficial to the company's bottom line, as it reduces the number of support calls, and hence the amount of money spent on providing such support. It also has a minor side effect of decreasing the number of accounts with billing problems (which are the primary cited reason for the high number of calls), which should have the impact of increasing revenues again.

Of course, weighed against this is the negative impact that all the exposure has generated across the Internet, and amongst mobile bloggers especially where the response has been almost universally negative. Ars Technica even popped up with their own experience.

Again, I can't help but think there is no real big issue here, there's simply a dispute between customers and the company they are purchasing a service from. Individual instances where customers are being mischarged, overcharged or generally billed for goods or services they didn't use aside, if Sprint choose to terminate a customer's service at no penalty to the customer, then that's their prerogative.

Sprint have however managed to shoot themselves in the foot by instigating another such customer purge, this time adversely affecting a group of US servicemen and women, by penalising them for using Sprint's own roaming service.

A few days after the original story appeared, another appear on The Consumerist with what appeared to be a rebuttal from Sprint, although delivered as if from a Sprint employee reporting anonymously, that claimed that the majority of the people who's accounts were being terminated were actually attempting to defraud Sprint. Consumerist reader ScoobyDoo was one of many who was less than trusting of the veracity of the account:

I call shenanigans.

This guy is probably speaking on behalf of Sprint PR and is trying to slow down the backlash they got from their little stunt.

They probably thought they could fire these 1000 customers without anyone noticing, but forgot about the Internet.

The story he's telling may apply to a couple of customers, but the previous poster proves that not everyone was a scammer, and Sprint should be ashamed of itself for trying to pin the blame on their customers when it is evident that THEY are also to blame in some cases.

Although balanced against this, other posters such as BNET41 say:

If you've ever worked as a CSR you'd know how common this is. There seem to be people out there who have nothing better to do than try to get free stuff.

In all of this, the one party that has yet to make a public announcement is Sprint itself, or at least not anywhere I've seen.

What I do think this situation shows is not that Sprint are necessarily a bad company (although there will always be debate about this), it seems to show there is a fundamental disconnect in the US mobile telecommunications industry, something that is also shown in the recent release of Apple's iPhone as an AT&T exclusive. With each company working hard to generate as much income for their shareholders as possible, the US-wide communications infrastructure is suffering, and consequently customers are having a hard time making use of such services. The original poster on the SprintUsers forum makes the point that whilst serving in Iraq – effectively a warzone – he received a better standard of service and operational coverage, at a lesser price, than he receives from the US telecommunications provider Sprint.

Why on earth I cant get coverage at the United States Military Academy, 40 minutes away from New York City is a mystery to me. I had a cell phone the entire time I was in Iraq with a middle eastern company. I payed LESS to call home and keep in touch from the otherside of the world than I do now with Sprint to call within the country. It also did not matter if I was in a major city or out in the middle of nowhere in the desert, I ALWAYS had full coverage. Never had a dropped call, and the customer reps of that company spoke better English than those with Sprint do.

It is this small section of the post that caught my attention and got me thinking – how can it be that in such a technologically advanced country, obtaining cellphone coverage, roaming and interconnects between existing providers is such a problem?

I remember myself when I used to employ people living in the US I always had to check in advance where in the country they would be to make sure that I could call them. In some cases, depending on location, I couldn't call as their carrier didn't provide international inbound call connectivity in certain regions. In some, especially to me, ludicrous instances I couldn't even send a text message, as there was no text sharing interconnect between carriers for roaming users, a situation that appears to still exist.

More than 30 million viewers tune in to 'America Idol' each week to vote for their favorite contestants by dialing into the toll-free telephone numbers or texting in on their Cingular Wireless phones.

To expand on that small quote – you can only vote for American Idol is you have a Cingular mobile phone. If you're on any other network, you cannot send in a voting text.

The equivalent situation in the UK would have the text voting provider laughed out of business, yet this seems to be the norm in the US.

Apple going with AT&T for the iPhone has also struck many people as odd, for the same reason: AT&T use a proprietary technology to deliver mobile services that is entirely incompatible with every other provider. Sprint phones are also incompatible with other providers, so those who are using Sprint are also locked in to that carrier if they want to continue using the handsets they have bought – and perhaps that is the real reason for the angst, not that the service is bad (which it apparently is), or that the company is doing what it is legally obliged to do (make money for it's shareholders), it's the fact there's no other choice that is driving the anger.

So I really think the larger issue here is not Sprint, but the parlous state of the mobile telecoms industry in the US. Common shortcodes (5 or 6 digit codes that work on all carriers) are a new phenomenon in the US (only being introduced in the past couple of years), and number portability is still a large issue. Coverage varies depending on your provider, and some areas you are limited in which provider you can even choose. Sprint dumping users is just a symptom of a much wider malaise.


Sprint, Mobile, Customer Service, America, AT&T, Cell, Cellphone

Nostalgia for Programming

Posted in General by cro. Monday July 2, 2007.

In conversation today, I was asked what the first computer I ever used was – so I dug up a link:

Ohio Scientific Challenger 4P (Scroll down to the one at the bottom)

Mobile Weblog: One of The Times’ Top 50 Blogs!

Posted in General, Mobile by cro. Sunday June 24, 2007.

Well, this was certainly unexpected! It seems that the Mobile Weblog (which is the blog I write for on occasion) has been named in The Times’ list of 50 Best Business Blogs!

Internet blogs are taking on big corporations and winning. As the bloggerati continue to set the agenda Times Online provides the first full list of the 50 top blogs, corporate and anti-corporate alike.

Guess I’ll have to post some more now!


Copyright 1998-2009 Tom Gordon