Systems architect, developer and entrepreneur.
Tags: #PHP #C/C++ #Ajax #iPhone #Debian #Cloud
Search
Dead Apple Aluminum Wireless Keyboard?
My Apple aluminum wireless keyboard suddenly stopped working.
It flashed the green light continously for about 10 seconds, then died totally and didn't work after that. Of course I tried changing batteries and everything else I could think of... Including Googling the problem ;-)
Finally I got geeky and started checking solderings... nothing... no problems... Since that, the keyboard has just been lying around...
Until! I read this facebook note: http://www.facebook.com/note.php?note_id=59651387321
With disbelief, I found a piece of tinfoil, rolled it lightly and dropped it into the keyboard, then the batteries... I pushed the on/off button and.... GREEN LIGHT FLASHING!!!
The keyboard is now working! I don't know a lot about circuits, but this is just stupid!
But hey! It's works! I'm happy :-) Hope this ends up helping others too! :-)
Facebook application development
After finishing the development of my 2nd Facebook application, I though it was to time to share some knowledge...
Both applications I have developed, is coded using FBML, therefore some of the following may only apply to FBML-based applications. First of: I have discovered a hidden Facebook philosophy...I have not heard any Facebook person speak this out loud, but while you develop an application, you will slowly discover the pracital truthness of it's existence, throughout every little aspect of the Facebook system... The philosophy:
Everything WILL fail at one point. Some things will fail totally, some partly and yet some will never be fixed... I have never come across such a perfect integration of Murphy's law Let me just give you a coule of examples: 1) Facebook caches any image, that you use inside the application.
This is generally a good thing, that takes some load off your servers.
The problem arises, the moment you want to update some of the images.
Facebook's API has a function, for requesting an image cache flush.
While this generally works fine, it can fail - and when it fails... It will not let of the cache... AT ALL!
This leads to the following decision situation:
- rename the image and update all of your code
- or hope for the best... 2) Facebook translations seems like the perfect solution for translations.
You create some tags and the texts pops up in the translations interface.... niiiice!
Unfortunately, Facebook reads, cleans and rewrites your (x)HTML/(x)FBML, which often result in errornous texts - which of course pops up in the translations interface!
This of course also means, a not-translated text sometimes shows up in your application...
As if this is not enough, when you request the deletion of the transaltions, the texts may not pop back up in the interface.
A perfect example of this, is the translation for the Applications name and description... 3) I thought I would just give a final example, that shows how far these problems strecthes...
If you want to advertise your application on Facebook, you will discover it basically works like Google AdWords...
But... yet again... WYSINWYG - It's impossible to determine when you get 1.000 impressions or 1.000.000 impressions!
I have an ad, that one day got 141.000 impressions and another day <4.000 impressions... Even though I made sure to change max bid according to their suggestions! A couple of areas I could have written about too:
Posting on the application users wall, when they are offline...
Using FQL (Facebook's SQL-like interface to their data) - I had to design a retrying FQL requester!!!
Asking for permissions from the user - NO! you can not ask for something you are already allowed to do, though Facebook explicitly says so...
And so on and so on and so on... Well... My point with this?... I don't know... "BE WARNED" maybe?
Solving the SPAM issues - once and for all!
I can't be the only one, that is fed up with SPAM?!?!
I have an e-mail address dating back to 1999! look it up, if you don't believe me :-)
This causes me to get >99% SPAM or so!
Why don't I just get a new e-mail address? I have used the address for all kinds of sites, contact information, company info, etc... I wouldn't know where to begin, if I were to let everybody know that my e-mail changed.
I have started the process by handing out a new address, but the e-mails actually gets sent to the former mailbox.
Why? Well... some websites don't even let you provide a new address...... :-S
Anyways... To the solution:
It's actually not that hard, and some has already tried it half-assed (i.e. Microsoft).
The real power lies in simplicity!
Basically there are 2 kinds of mail-servers: senders and receivers...
These mail-servers talks to DNS (Domain Name Service) servers, to know where mail for any given domain goes.
This is the problem: I can write a seriously simple script, to send e-mails to almost any receiving mail-server, postulating I am sending the e-mail from whomever I like it to believe (I could be steve@apple.com).
Most receiving mail servers today has a SPAM filter - so what? If I am a bit careful, it will still get through - even worse: who cares if 2 out of 10 doesn't? 1 billion SPAM e-mails, will still get you a very nice profit (I have heard), even if "only" 827 million mails gets through...
This is due to the fact, that there are MANY people out there, with not enough knowledge to seperate SPAM from the rest and actually buys the €#%"#@.
The simple solution: Stop accepting mails from servers (and computers, botnets, mobilephones, etc), that hasn't been pre-approved as a sender for a given domain!
We have DNS servers, lets put in another line: server a.b.c.d and v.x.y.z is allowed to send mails from techba.se
Now we can start changing the mail flow over 2 steps:
- Stop accepting mails from computers that aren't pre-approved in the DNS - if the domain has pre-approved computers
- Stop accepting mails from computers that arent' pre-approved in the DNS
Most forget, that we today spend hours and hours setting up SPAM filters and systems, that almost never works anyways.
I have set up my own SPAM filter - it works pretty well, which means: it catches ~98% of the SPAM.
But... Sometimes it thinks a perfectly fine e-mail is SPAM - this is the biggest of my problems! I have to look through ALL (~1500/day) of my SPAM, if I want to be sure I don't loose any mails...
That is not a good enough solution!.. Actually that is not even making it much less of a problem!..
Come on people! Let's change the world of e-mail, once and for all! :-)
Cost of Clouds vs Dedicated Servers
- Which hard drives, how many and how much capcity
- Backed up or not
- How many CPU cores
- Connection to the internet - but: clouds generally has massive connection, while dedicated are more diverse
- General hardware: server-grade or not? I.e. consumer CPUs or server-grade? etc.
CO2 neutralitet eller elendig matematik? (danish)
Hver gang jeg hører udtrykket "CO2 neutralitet", er der noget i mig, der får lyst til at råbe og skrige: "VRANGLÆRE!!!"...
Lad mig lige gøre det klart med det samme: jeg bekymrer mig om vores planet og dens klima!
Men når jeg ser initiativer som denne: CO2 neutralt website, der lokker med sætninger som: "Hjemmesider med god samvittighed" - ja, så er der noget, jeg ikke helt kan få til at stemme...
Dette er betydningen af neutral, i følge ordbogen.com:
som hverken skader eller gavner
Så... Påstanden er altså, at man kan købe sig til, at CO2 udledningen for dit website, fuldstændigt ophører med at eksistere...
Dette er naturligvist IKKE sandt!
Udleder du 1 ton CO2, er der udledt 1 ton CO2.
Hvis du samtidigt forhindrer andre i at udlede 1 ton CO2 - ja, så er der stadig udledt 1 ton CO2.
Jeg var personligt involveret, den gang vi naivt troede, det gjorde en forskel, at opkøbe og annullere CO2 kvoter...
I dag er jeg ret overbevist om, at man nok skal finde de CO2 kvoter man har behov for... Afrika skulle være et godt marked - de bruger dem ikke alligevel...
Hvilket bare gør påstanden om neutralitet værre - resultatet vil være 1 ton udledt CO2 + 1 ton udledt CO2 - dine penge!
Uanset ovenstående, er påstanden "CO2 neutralitet" et falsum!
Den eneste måde at nedbringe CO2 udledningen er: skær ned på din udledning!
Hvis du virkelig bekymrer dig om CO2 udledning, i forbindelse med dit website, skulle du snakke med din foretrukne nørd om Cloud computing!
Fordelene ved Cloud computing er bl.a. deling af resourcer, dermed et lavere samlet forbrug, dermed lavere CO2 udledning.
Hvis du er interesseret i at lære mere, er her et par links (på engelsk):
Cloud Computing's Green Benefits <- nogle virkeligt interessante udregninger af normal server brug i forhold til cloud computing
Hvis der er interesse for det, vil jeg gerne skrive en mere dybdegående artikel, om hvad der gør den store CO2 forskel ved Cloud Computing.
Google at it again! Go! Google Go...
An article about my initial experince with Google's new programming language "Go"!
This is probably a subject for the more nerdy of us ;-) Google has finally had it, with centuries old programming languages and their cumbersome ways! Anybody working with the technically side of the online industry, will know the names of at least the 10+ programming, scripting or markup languages.Some of the more common are:
HTML, xHTML, CSS, PHP, ASP, JSP, Python, Ruby, Java, JavaScript, ActionScript, ECMAScript, C, C++, C#, Visual Basic, Bash, etc...
While some of the less common or less known are:
Lisp, Erlang, LUA, SmallTalk, Java (oops! dreaming...), Tcl, etc... Then there is technologies, protocols and standard/typical ways of doing things, which then gets a name... Like AJAX... Well... It looks like Google wants to clean up a bit...
So why not create a new programming language?!?! :-P It's actually one of their "Innovation Time Off" a.k.a. "20% projects", but it's being evaluated along other technologies, for use in new systems and setups. So... What is it?
It's kind of a new programming language, but not really, but then again... :-P
It's a compiled language. The compiler is written in C, some C code can be linked with Go programs, making the language a little hard to define.
I think you can say, that Go is a new C++. But why?..
WE NEED IT!
As they state on their site (http://golang.org/), we are using centuries old programming language, not designed to do what we need today. Most languages has been "updated", hacked, expanded, call it what you like, to do what we need...
But doing what we need, is not the same as doing it good or easy. I have created a higly scalable multiserver program in C/C++, where the servers know about each other - the core of the code, is very complicated, is held in many files and probably has a bug or two I haven't discovered yet.
With Googles Go language, I could have written it all in 1 (ONE!) file!!!
It would almost be hard to introduce a bug! But how is that possible?
Well... When working with multiple threads or forks, a lot of network connections, a bunch of files and a memory cache layer... You are in for a ride...
There is SO many things that can go run - so many things, that needs to be handled correctly, so many things that needs locks! What Google has done with Go, is to encapsulate a lot! of these tasks.
More specifically, they have sncapsulated the parts that are hardest and yet most used. When you need to have inter-process communication, you establish a channel and communicate!
In C/C++ this is done through either socket communication with all it's glory and weirdness - or through shared memory queues or variables, needing locks and unlocks on everything...
The last time, I wrote code for message queue, inter-process communication, I ended up with 500+ lines of code (if I remember correctly).
The basics of this, would in Go be a couple of lines of code, and with good error handling etc., it would probably be in the 10s!!! But... Even better yet, is the threading handling... In Go a parallel process is called... a go process :-)
Whenever yo need to run a parallel process, you just write that!
What is interesting, is what happens in the background! Go handles thread creation for you, but even better: it handles running you code in these threads!
Every system has a thread limit (and a fork limit), which limits you to a set amount of truly parallel processes.
But parallel processing acts as everything else on a computer - it waits... it waits A LOT! Mostly on resources being free'd and accessible. I'll try to describe this, by giving a quick overview of an example webserver:
If you run a thread pr. connection AND lowers the default allocated memory pr. thread, you would normally get about 6-7000 threads on a typical webserver.
This means you can handle 6-7000 connections every second, as long as you can deliver the content within a second... That a lot... If you have small commercial site, that tells a little about your company etc...
But let's say, you had a video delivery system...
If YouTube were running on a single server, with this kind of setup, only 6-7000 people would be served over a minut or so.
6-7000 clients would connect, the same amount of threads would start - but then... the threads would spend most of it's time, just waiting for all kinds of things, like response from the client, when it has received a packet of data, etc. So... When you create this kind of you server, you would look into letting one thread handle more than 1 client. Go does this for you!
It even selects the thread to execute the code, based on whether it is in a blocking mode or not! To make things even more beautiful, it encapsulates the network communication in the same way! I mean it very seriously, when I claim, I would be able to melt down the core of my current C/C++ project to less than a 1/10th of the current, just by rewriting it in Go!!! So... Why don't I?
There is 2 simple reason:
1) Google discourage live use, just yet...
2) Go doesn't have a MySQL connector To sum up, why I believe Go will be my preferred language in a year or two:
* Unlike Java, Erlang and the likes, it is a compiled language! (no buggy VMs!!!!)
* It encapsultes most of the absolutely most difficult stuff like threads, inter-process communication and network communication
* It's a new language for new problems, aiming at doing high load, online server stuff the right way, easily!
* It rides on the back of C, removing the needs for a completely rewritten compiler, etc.
* It's kinda C/C++, but less difficult - i.e. it has garbage collection, nicer pointers handling, etc.* Because it's the only compiled language, aiming at the online server market I just want to make 1 thing extremely clear:
Go is a compiled language!
Like C/C++ you need a compiler on a (one) machine...
When you are done coding, compiling, testing - you just copy the final program to other machines!
You can cross-compile for other systems! A lot of people, loves the "write once, run everywhere" of Java... I hate it!
It's a big fat lie!
There's like a million Java VMs (Virtual Machines) out there!
If you want to run your code on any machine, you need a VM for that OS and CPU.
When you have installed that - you need to test your code on that machine!!!
"But shouldn't it just run?" - Yeah... but it don't!
There is a different set of capabilities and incapabilities pr. OS+CPU and a different set of bugs.
If you have Java VM xxx.xx.01 on one machine and Java V; xxx.xx.02 on another... You need to test! Trust me! I'd rather spend some extra time, coding and compiling for a couple of platforms, than testing and getting hit by weird bugs in live systems! I hope this will entice others to give Go a go!..
I think it will be worth your time, to at least get into what this is all about...
Microsoft granted a patent on 30 year old UNIX technology!..?!.. :-?
Microsoft was granted a patent, that basically describes the UNIX program sudo!
It's like patenting the grinding of coffee beans, before pouring hot water over them!
For those who don't know much about UNIX/Linux:
root: UNIX/Linux administrator
sudo: a small program, which purpose is to let "normal" users act as root, by "becomming" root or execute commands as root - of course root must grant you access to use the program!..
So... It seems Microsoft was granted a patent, that describes something that *NIX users has known and used for 29 years!!!!
Am I the only one, who just wants to denounce the authority of the US patents system? I mean... If somebody says to you: "you are violating our patent", I really just want to respond with: "what's that... pad-end? What is it? AND WHAT THE #@!&% ARE YOU ACTUALLY ACCUSING ME OF!?!?! VIOLATING??!?!"... And so on... you get my drift :-P
Read more:
The new 112 sticker on the police cars...
Have you seen this yet:
Well... It's one of two new stickers, that some police cars have in denmark...
From a distance it looks a bit different...It makes me wonder, when somebody will do this:
:-D
Would you please shut up Jenny Boriss!!!
Is it just me, or is the IT world becoming a kindergarten?!?!?!
Mozilla really don't want their Firefox browser, to be number 4 out of 5 on Microsoft's list of available browsers, during the Windows Installation procedure...
Patents revisited...
O.k... Here we go again...
Just had to add this link.
Facebook is being sued for patent infringements...
They have created a social network!!!
Oh! Aaaand... You can decide who can view your profile!!! Those bastards!..
That's it!.. I'm filing for a patent called: "a structured way of bothering, annoying and pestering people"...
Then... I'm gonna sue any patent office I can find! :-D
