makeuseof.com have recently posted about 11 cool iPhone keypad codes – these are special codes (known as USSD codes) that send messages via the signalling channel direct to the core of a mobile operators network. These codes are nothing new, they have been around for years and years. They are also not generally universal (there are some standard, but they provide relatively boring functionality). Different networks can enable different functionality on different codes.
The codes can do boring things like retrieve your divert status from the network, return your IMEI or perhaps ICCID, but they can also interact with specialised applications driven via USSD Gateways to return useful information and execute transactions. These are applications that are sent specific codes by an operators core network, perform some processing on the data received, and return a response. Things that are non-standard that are enabled by USSD Gateways are services such as USSD-based prepay balance retrieval, USSD-topup, or interactions with NGIN features to alter a network based service.
I looked into USSD codes on the iPhone a while back, not to be used by users typing them in, but more to be used by applications querying information from the network via them. The reason why I wanted to programatically access them? To look at what’s possible for network operators or enterprises to release as iPhone based network service management applications.
Sadly, Apple have disable the use of USSD codes from within the (legitimate) iPhone sandbox available to developers (via the open URL methods, passing in a tel://xxxxxx URL). This means that there won’t be any applications from your operators that will make it easy to retrieve and change network settings that can be released thru the app store – at least not until Apple change their mind about interactions with USSD codes. Which is a pity – there are lots of useful services that would be useful to expose simple interfaces for usage for to the operators end users. USSD is an efficient, fast way to configure the network, using capabilities that most operators already have.
The recent deal announced between Microsoft and Yahoo strikes me as odd.
I understand that they are looking to create a competitor to Google in both search and advertising, but the “price paid” seems very high – at least on the part of Yahoo.
Major terms of the deal:
Microsoft will be powering Yahoo search
Microsoft have licensed Yahoo’s search technology for 10(!) years
Microsoft will run paid search via their search engine
Yahoo will be providing the advertising sales force for their combined “paid search” capability
Each company will still maintain separate advertising sales forces for other advertising
They enter a revenue sharing agreement, but Microsoft guarantee Yahoo will get at least existing revenues for the next 18 months
Microsoft pay most of its traffic acquisition costs
So, boiling it down, it appears Yahoo are giving up their search engine technologies (for at least 10 years) in conjunction for (at least current) revenues to be paid by Microsoft for algorithmic search advertising.
Microsoft have to maintain a sales force to sell other advertising, so they aren’t saving costs there. They are still having to maintain search so they aren’t saving costs there. They are paying Yahoo for traffic acquisition, and revenue for algorithmic search advertising, so they are losing money there. Their benefit seems to be
Acquisition of a license for Yahoo’s search technology – given they’ve just released their own shiny new engine, is this an asset or liability?
Traffic – this is what Microsoft are in the deal for for. Traffic from Yahoo.
10 years is a long time. Search changes a lot in 10 years. Google was only just starting out 10 years ago. Altavista (at least where I was using the web) was top dog back then. I’d be interested to see if Yahoo are going to maintain their search technology, or just let it die off. Is this a sign that they no longer want to compete in search, but be a destination that pulls together other properties (harking back to their very early days I guess). I guess time will tell if Yahoo’s apparent specialisation strategy was a sensible or dumb move. Microsoft are banking on Bing becoming a google killer, or at least a serious competitor, in the long term. They also apparently believe that paid search results are the way of the future – that’s why they want the traffic.
Apple have added an extra attribute to applications on iTunes store – keywords.
You can configure your keywords with the “Edit Information” link against the application. SendIt4.me (iTMS) has already been updated
Be careful though. It appears you can only update your keywords ONCE per application update – so make sure you choose the right ones the first time around – otherwise you’ll have to go through the painful approvals process to get it corrected.
The keywords should help with searching for your application within the store. Fingers crossed.
— EDIT —
You can also only have up to 100 characters for the keywords. Don’t get caught out! If you submit with more than 100, it tells you too late – you’ll have to resubmit your app to fix it.
Send real postcards to your family and friends with SendIt4.me, now available as an iPhone client. The application is 100% free and each postcard you send will cost $2USD. The postcards can be sent anywhere in the world, and postage time is dependent on your international and local mail services (they are posted from the US, so if you live there you should get it quicker).
Sidenote: I submitted this application initially to Apple on the 18th Jan 2009. It was finally approved tonight. There was only 1 “Please wait” mail, and one “We need some help testing it” mail – too long in my opinion.
Feedzirra is an RSS feed fetching and parsing library that I quite like. For a project I’m working on with a mate we need to be able to parse and receive updates from (potentially) a large number of RSS feeds. Feedzirra seemed the ticket, but didn’t have support for itunes style RSS feeds – so I added it.
This was basically my first (well, second, but that wasn’t public) go with github, and first contribution to an open source project. Paul Dix accepted my code, and I’m oddly excited about it all.
AND to make things even better, someone has already started to enhance my contribution. Woo hoo!
Posted in travel, web on March 2nd, 2009 by Hamish Rickerby – Comments
I went to look at the ESTA website today as my girlfriend needs to apply for one of these authorisations to be allowed to travel to the US.
The website was very intimidating, and confusing.
The URL – if you’re providing an online site that every traveller to the US has to visit to get an authorisation to travel my advice would be choose a URL that is easier to remember than https://esta.cbp.dhs.gov/
The warning message – one sure fire way to scare users is to show them a message that looks like this when they connect to the site
Note: There is no expectation of privacy when you use this computer system
Make it doubly confusing by completely contradicting the previous message on a “Help” page within the site. Note: Is this Web site secure and private? Yes.
Posted in ruby on February 26th, 2009 by Hamish Rickerby – Comments
I’m having a bit of a play with SemanticHacker at the moment, seeing what their service thinks of some text I’m poking at it. To make this a bit simpler I created a small ruby lib that wraps their API to make my life a little easier. And hopefully it’ll make someone elses life easier – enjoy.
(It requires hpricot for XML parsing – make sure it’s installed)
require 'rubygems'
require 'hpricot'
require 'cgi'
require 'open-uri'
class SemanticHacker
URL = "http://api.semantichacker.com"
attr_accessor :token, :doc, :content
def initialize(token)
@token = token
end
def get_signature(content)
@content = ::CGI::escape(content)
url = "#{URL}/#{@token}/signature?content=#{@content}"
@doc = Hpricot.XML(open(url))
end
def get_concepts(content)
@content = ::CGI::escape(content)
url = "#{URL}/#{@token}/concept?content=#{@content}"
@doc = Hpricot.XML(open(url))
end
def get_categories(content)
@content = ::CGI::escape(content)
url = "#{URL}/#{@token}/category?content=#{@content}"
@doc = Hpricot.XML(open(url))
end
def type
(doc/:response/:about/:systemType).inner_html
end
def config_id
(doc/:response/:about/:configId).inner_html
end
def categories
response = []
(doc/:response/:categorizer/:categorizerResponse/:categories/:category).each do |item|
response << {:id => item.attributes['id'], :weight => item.attributes['weight']}
end
response
end
def concepts
response = []
(doc/:response/:conceptExtractor/:conceptExtractorResponse/:concepts/:concept).each do |item|
response << {:label => item.attributes['label'], :weight => item.attributes['weight']}
end
response
end
def signatures
response = []
(doc/:response/:siggen/:siggenResponse/:signature/:dimension).each do |item|
response << {:index => item.attributes['index'], :weight => item.attributes['weight']}
end
response
end
end
And to make things happen
sh = SemanticHacker.new("mysecrettoken")
sh.get_signature("Wow! Some semantic analysis on my text")
puts sh.signatures.inspect
#returns an array of hashes with the weights and indexes of the categories
I have recently had to install f2c on my mac to convert Fortran to C code – for the gory details about this library check http://www.netlib.org/f2c/f2c.pdf
Also, don’t ask why I’m installing this – lets just say there is some maths that needs doing, and fortran has the libraries to help with it.
The installation process on the mac isn’t really catered for with the package, and it’s not available via macports. I found an install script at http://hpc.sourceforge.net/buildf2c but I found it doesn’t work as advertised.
Below is a fixed version of this script – hope this helps someone. This will download the source as well as build and install it.
#!/bin/sh
############################################################
# This UNIX script builds the f2c FORTRAN --> C translator #
# under Mac OS X. #
# Make this script executable with "chmod +x buildf2c" #
############################################################
echo "==================================="
echo "Build f2c FORTRAN --> C translator."
echo "==================================="
echo "USAGE: ./buildf2c"
######################################
# Set trap to allow abort on signal: #
######################################
trap 'echo "Interrupted by signal" >&amp;2; exit' 1 2 3 15
########################################################
# 1. Download f2c source from Bell Labs. #
# (Tar file is not visible - it's created on the fly.) #
########################################################
echo "--------------------------------------------"
echo "1. Downloading f2c source from Bell Labs ..."
echo "--------------------------------------------"
# wget --passive-ftp ftp://netlib.bell-labs.com/netlib/f2c.tar
curl http://netlib.sandia.gov/cgi-bin/netlib/netlibfiles.tar?filename=netlib/f2c -o "f2c.tar"
echo "... done."
#####################################
# 2. Uncompress f2c tarred archive: #
#####################################
echo "-------------------------------"
echo "2. Uncompressing f2c source ..."
echo "-------------------------------"
tar -xvf f2c.tar
gunzip -rf f2c/*
cd f2c
mkdir libf2c
mv libf2c.zip libf2c
cd libf2c
unzip libf2c.zip
cd ../..
echo "... done."
###############################################################
# 3. Prepare the unix makefiles for building the f2c library. #
# Note: CC compiler switched from 'cc' to '/usr/bin/cc' #
###############################################################
echo "-------------------------------------------"
echo "3. Preparing makefiles for building f2c ..."
echo "-------------------------------------------"
sed 's/CC = cc/CC = \/usr\/bin\/cc/' f2c/libf2c/makefile.u > f2c/libf2c/makefile
sed 's/CC = cc/CC = \/usr\/bin\/cc/' f2c/src/makefile.u > f2c/src/makefile
echo "... done."
##########################################
# 4. Create and install f2c header file. #
# If you use a C++ compiler: make hadd #
# Otherwise: make f2c.h #
##########################################
echo "----------------------------------------------------"
echo "4. Creating and installing f2c header file f2c.h ..."
echo "----------------------------------------------------"
cd f2c/libf2c
make f2c.h
if test ! -d /usr/local/include; then
mkdir -p /usr/local/include
fi
cp f2c.h /usr/local/include/
echo "... done."
################################################
# 5. Create and install f2c library "libf2c.a" #
################################################
echo "-----------------------------------------------------"
echo "5. Creating and installing f2c library "libf2c.a" ..."
echo "-----------------------------------------------------"
make
if test ! -d /usr/local/lib; then
mkdir -p /usr/local/lib
fi
cp libf2c.a /usr/local/lib/
ranlib /usr/local/lib/libf2c.a
echo "... done."
######################################
# 6. Make executable f2c translator: #
######################################
echo "---------------------------------------------"
echo "6. Creating and installing f2c translator ..."
echo "---------------------------------------------"
cd ../src
make
if test ! -d /usr/local/bin; then
mkdir -p /usr/local/bin
fi
cp f2c /usr/local/bin/
ln -s /usr/local/bin/f2c /bin/f2c
echo "... done."
################################################################
# 7. Install fc script: #
# #
# 1. Remove "-Olimit 2000" in the -O processing options within #
# the 'fc' script. #
# 2. Eliminate all references to the math library (-lm) in #
# the script 'fc' since it is included the System framework #
# and is linked by default under Mac OS X. #
# 3. Eliminate '-u MAIN__' at the bottom of the 'fc' script. #
# You will have to explitly load FORTRAN MAIN programs #
# (explicitly mention the relevant .f or .o file). #
################################################################
echo "---------------------------"
echo "7. Installing fc script ..."
echo "---------------------------"
cd ..
mv fc fc.orig
sed 's/ -Olimit 2000//g; s/ -lm//g; s/ -u MAIN__//g' fc.orig > fc
chmod +x fc
cp fc /usr/local/bin/
ln -s /usr/local/bin/fc /bin/fc
ln -s /usr/local/bin/fc /bin/f77
echo "... done."
#########################
# 8. Install man pages: #
#########################
echo "---------------------------"
echo "8. Installing man pages ..."
echo "---------------------------"
cp f2c.1t /usr/share/man/man1/f2c.1
echo "... done."
################
# 9. Clean up: #
################
echo "------------------"
echo "9. Cleaning up ..."
echo "------------------"
cd src
make clean
cd ../libf2c
make clean
cd ../..
echo "... All done!"
#############################################
# 10. Test f2c on your FORTRAN source code: #
#############################################
echo "======================================================"
echo "======================================================"
echo "======================================================"
echo " === To test f2c on your FORTRAN source code: ==="
echo " === cd ~/wherever/your/code/is ==="
echo " === 1. f2c myprog.f ==="
echo " === cc -O -o myprog.exe myprog.c -lf2c ==="
echo " === myprog.exe ==="
echo " === 2. fc -O -w -o myprog.exe myprog.f ==="
echo " === myprog.exe ==="
echo "======================================================"
echo "======================================================"
echo "======================================================"
exit
The game development is going well so far. From yesterday when I knew NOTHING about game development I’ve managed to figure out how to use sprites, labels, timed actions, sequenced actions, scenes and layers with cocos2d-iphone.
I did hit a strange error though. On the simulator the touch events were working correctly – screens transitioning, sprite/label touches generating events and triggering animation and so on. On the actual device the story was quite different. My menu items were triggering correctly, but no subsequent touch events were doing anything on the phone. When the application exited (home button) all the touch events were then passed through as I could see them all fly up the screen in the console.
I don’t know what causes the actual issue, but the fix is to alter the Director.m’s main method – adding the following code fixed the issue right up.
while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, YES) == kCFRunLoopRunHandledSource) {};
The odd thing is (and let me know if I’m wrong here) that that code doesn’t actually do anything. It performs a test, but changes nothing. I don’t get why this fix works.
I am having a bit of a play with the cocos2d game engine for iPhone and encountered a very strange error in the console – I don’t believe it’s at all related to the game engine itself, so it’s just coincidence that I was trying something new out.
error while killing target (killing anyway): warning: error on line 1987 of “/SourceCache/gdb/gdb-962/src/gdb/macosx/macosx-nat-inferior.c” in function “macosx_kill_inferior_safe”: (os/kern) failure (0×5x)
I figured out that it had to do with definition of a selector… Naughty code below.