Using WordPress.com stats API

gimp_logoLong ago I posted about the WordPress.com stats API. WordPress.com Stats API. WordPress.com stores your blog’s raw visit stats which is available via your API key and the blog URL. Basically these stats are used to show the stats you see in your dashboard.

wordpress_default_dashboard_stats

The older wordpress.com dashboard did not have much visualisations of the stats, but the new dashboard has introduced some more ways to see how your blog is doing. When I posted WordPress.com Stats API, there was absolutely no trace or documentation about the wordpress.com API. It seemed that even the guys in wordpress.com was not well aware about if such an API existed :D . (Check the post to know why).

At the previous post I just provided some guides on how to fetch the data. Recently I planned to write a quick implementation to fetch the stats from wordpress.com and therefore I am going to share the script. This is a quick and dirty implementation to demonstrate the stuff. I have also made a few processing on the incoming data and made a few plots. Most of which might not (will not) make much sense (especially the box plots), but it’s just for the baseline. Let’s proceed with the code. Continue reading “Using WordPress.com stats API”

A wide character trie implementation

It’s been a long time since I posted here. Therefore I decided to dig out some quick and straightforward stuffs from my disk which I previously decided should’t be in this blog.

I have posted multiple trie and dictionary search based programs in C, C++ and Perl before Jumble Work Solver and Jumble Work Solver Again. This time (again!) it’s about a trie. Although this time there was a specific requirement from a group who needed to implement a trie based word distance counting for bangla language, therefore Unicode support. This was supposed to be modified more and plugged into a spelling correction for scanned OCR text in the Bengali language.

Initially I suggested that a ternary tree would be more appropriate as the memory cost for standard trie (not compressed) would be huge. Although, finally the decision was to go with plain and simple trie. I know it is mad, but this is what it is :D.

Also, before going into the implementation, I should note that there is an efficient implementation of Radix Tree present in libcprops library. Though which we won’t be using for this one. I would recommend you people to have a look into this library if you already haven’t seen it yet.

Let’s say, we have a word “hello” and a node with an array of pointers of length 26 representing each character of the English language, each of which indicates that if the ith character follows the character represented by this node. Therefore for this example “hello”, the head node’s array of pointers will have the location 7 pointing to another node, which will have the 4th location of the pointer pointing to another node, whose pointer array’s 11 th location will point to another node and so on. Note here the indexing starts from zero. When the word ends, then the next pointer can be pointed to a special terminal marker node, which can be common to all, and the node is marked as a terminal node. This is essential as a valid word can be a substring of another valid word, in which case the shorter would need to be decided. When another new word like “help” comes in, we will follow the same path upto “hel” created by the word “hello”, and as we find there are no pointer for “p” pointing to any node, a new node will be created as explained before. Continue reading “A wide character trie implementation”

WordPress.com Stats API

gimp_logoWordPress.com has a very nice stat plugin showing the overall post views data and also post by post, but it would be always great if there was more. A lot of people talk about introducing Google Analytics. A lot of people save the data offline by copying the summary tables into files to save the site data. I had an idea to process the data of my site a bit differently and find trends in the data. I thought except copy-pasting the site summary data, there should be a cleaner manner to store the data. First I made a brief Google search, then made a wordpress.com forums thread. Then i had a short chat with Mark in wordpress.com freenode IRC and was redirected to wp.com email support. The first result came from email support telling that there is no data export feature. But another email followed to correct the previous one which told about the wordpress.com stats API with which you can get your wordpress.com site’s stats data in CSV or XML format.
Continue reading “WordPress.com Stats API”

What are ID3 Tags all about?


id3_logo

When you play a music file in your favourite music player, or in your portable media player the track name, album, artist, lyrics gets displayed. You can search the songs with artists, album names. Even some of the tracks come with album art too, but there is no image file anywhere. The question generally arises, where does these information come from? The answer is straight forward; this metadata about the audio track is stored inside the audio file itself. The different audio files need different codecs. Different audio format files also have different such metadata systems. For example The Vorbis comments, APE tag, ID3 tags etc.

The most common and popular audio media (although not the best) is the mp3 . Mp3 audio format stores this metadata inside the music file, either at the beginning or at the end or at both locations. The music metadata system used with mp3 is called an ID3 Tag.
We will rip off the ID3 tag and check out what’s inside it in this article. We will discuss about ID3v1.x and ID3v2.x tags.

Continue reading “What are ID3 Tags all about?”

An ID3v1 Tag Parsing Library

id3_logo

ID3 tag is an mp3 audio media file tagging system. The ID3 tags are stored in a pre-defined location in the mp3 media file, either in the start or at the end (or both). There are two major versions of the ID3 tags. ID3v1 and ID3v2. The tag store data about the song, like track name, album name, artist name, genre, track no, year, composer, licensing information, lyrics, even multiple images inside the tag. To get more information about ID3 tag please check the official website of ID3 tag: http://www.id3.org/, also check this article What are ID3 Tags all about?

Continue reading to get the library

Allegro 4.2.2

Introduction

Allegro Logo
Designing and programming games is anything but easy. One needs to understand the game logic (algorithm) and the graphics manipulation techniques, the core of the game, and good planning and synchronization between these, to design a game. And I don’t think anyone would debate the fact the graphics alone makes a huge impact on games. That means the core logic needs priority and concentration than the eye candy graphics.

To begin programming the games and their graphics we need to have the basic concepts of game programming clear, as well as a good graphics and I/O tool which does not drag a beginner into the complex world of syntaxes, datastructres, procedures, complex internals, etc. Thus, I’m sure everyone agrees that starting with OpenGL or DirectX programming becomes quite a job for beginners. So game making needs very good management and planning at first, then it needs coding knowledge, and a good programming tool or API is needed to complete the task smoothly. Selecting an API is very important, it should be simple and is usable and also powerful at the same time which will let you spend more time on the planning the game and code the techniques. Now all the properties are difficult to find.

In this article we will introduce you with a 2D and 3D game and graphics library called Allegro, primarily to be used with C Programming Language, which brings you a great platform to start game programming. Though you still will need to know the basic techniques and algorithms to design the core, but Allegro is a great API which takes a good care of the graphics, sound, I/O and all the other components. So you can do the core design with more concentration, and then create the multimedia components, and the I/O using Allegro with great simplicity. Allegro does this by hiding the complex internals with its simple abstract datastructres and similarly simple routines. And all this is not only for beginners, but this library also has the power inside for advanced and professional-level programming. Read the whole article to know about Allegro in details and jump start into allegro programming

Continue reading “Allegro 4.2.2”