What is Stig Database?

Data Off the Edge

  • It’s a graph. Stig stores data in nodes, and stores the connections between data as edges between nodes. This makes it easy to do Kevin Bacon computations and social networking queries that look for the connections between people.
  • Functional query language. Stig has its own native language that is flexible and powerful, but at the same time, it can emulate SQL and other paradigms.
  • Distributed and scalable. Stig is horizontally sharded, meaning that you can add as many machines to the system as you want. Stig works whether you have one machine, a thousand machines, or a million machines.
  • Points of View. Since isolation often comes at the expense of concurrency, Stig implements a kind of data isolation called a point of view. Private (one person) and shared (some, but not all people) points of view do propagate out to the global (everyone) database over time, but for fast communication, they only change the data for the people who need to see it.
  • Time Travel. Stig keeps a history of data as it changes, so you can easily go back and compare prior versions. You don’t need to include history in your schema, and you can control how much it stores.
  • Durable sessions. Clients can disconnect and reconnect at will, while Stig operations continue running in the background.

Reference : http://stigdb.org/

How to Create QuickAction Dialog in Android

Official Twitter application for Android  has introduced new Android UI features and behavior patternssuch as Dashboard, Search Bar, QuickAction and Action Bar. One of the interesting pattern isQuickActions that displays contextual actions in a list view. This pattern actually already exists inQuickContact dialog/bar in default Contact application (since Android 2.0).

QuickContact QuickContact

The QuickActions dialog is not included in standard Android SDK, so we have to create it manually. At first, i had no idea on how to create it so i decided to download and read the Contact app source code from  Android git. I found that the QuickContact dialog  uses private API call (com.android.internal.policy.PolicyManager) that does not exists in standard SDK. After posting question about it on google groups and stack overflow, i got the solution for it from Qberticus (thanx Qberticus!).

Qberticus’s QuickActions uses simple/plain layout so i have to create a custom layout so it will look like QuickContact in Contact app or QuickActions in Twitter app. Based on QuickContact source code, i made a slight modification on Qberticus’s BetterPopupWindow class and extended it to implement custom layout. I also made it customizeable, so the icon and text in action list can be customized.

Here are the screenshoots of QuickActions demo:

QuickContact / Twitter-like QuickActions

 

Code snippet
Create action items

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//Add action item
ActionItem addAction = new ActionItem();
addAction.setTitle("Add");
addAction.setIcon(getResources().getDrawable(R.drawable.ic_add));
//Accept action item
ActionItem accAction = new ActionItem();
accAction.setTitle("Accept");
accAction.setIcon(getResources().getDrawable(R.drawable.ic_accept));
//Upload action item
ActionItem upAction = new ActionItem();
upAction.setTitle("Upload");
upAction.setIcon(getResources().getDrawable(R.drawable.ic_up));

Line 02: Create new action item
Line 04: Set action title
Line 05: Set action icon

Create quickaction instance and setup listener

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
final QuickAction mQuickAction  = new QuickAction(this);
mQuickAction.addActionItem(addAction);
mQuickAction.addActionItem(accAction);
mQuickAction.addActionItem(upAction);
//setup the action item click listener
mQuickAction.setOnActionItemClickListener(new QuickAction.OnActionItemClickListener() {
    @Override
        public void onItemClick(int pos) {
        if (pos == 0) { //Add item selected
           Toast.makeText(Example1Activity.this, "Add item selected", Toast.LENGTH_SHORT).show();
        } else if (pos == 1) { //Accept item selected
           Toast.makeText(Example1Activity.this, "Accept item selected", Toast.LENGTH_SHORT).show();
        } else if (pos == 2) { //Upload item selected
           Toast.makeText(Example1Activity.this, "Upload items selected", Toast.LENGTH_SHORT).show();
        }
    }
});

Line 1: Create quickaction instance
Line 3-5: Add the action items into quikaction
Line 8: Setup listener for action item clicked, the pos argument on onItemClick method shows which action item is clicked.

Show quickAction dialog

1
2
3
4
5
6
btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
    mQuickAction.show(v);
}
});

Line 04: Show quickaction dialog, the v argument used as the anchor where the quickaction displayed.

Gallery3D-like QuickActions

 

Implementation on My Application

BlitzDroid

 

Minapolitan (Prototype)

 

Buy me a coffee

If you found this stuff useful to your work, please consider a donation.
By doing this you will be helping me to keep improving this stuff and to continue to help anyone who needs, and maybe keep on helping you in the future.

Reference : http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/

Unix Font rendering

Unix Font Rendering FAQ

(c) 2002 David Turner

Table Of Contents

  • what is a font ?

    what is a bitmap font ?

    what is a “char cell” font ?

    what is a scalable font ?

    what is font hinting ?

    what is TrueType hinting ?

    what is Postscript hinting ?

    what is Auto-hinting ?

    what font formats are supported by X11 ?

    how does X11 render text ?

    does X11 support anti-aliased text ?

    how does anti-aliased text work then ?

    why do my fonts look crap ?

    why some anti-aliased TrueType fonts do not look good ?

Introduction

Basic Font Rendering FAQs

X11 Font Rendering FAQs

Introduction

This FAQ covers many common questions regarding the rendering of text on a typical Unix desktop (i.e. Linux, BSD and legacy systems like Solaris, etc…). Note that it doesn’t deal with various other topics likefont installationprinting and international text layout. These may be the subject of other documents in the near future, but don’t hold your breath 🙂

Continue reading

Install Burg in Ubuntu

Introduction

BURG stands for Brand-new Universal loadeR from GRUB. It’s based on GRUB, and add features like new object format and configurable menu system. This page shows its usage.

Install using binary package

  • For Ubuntu 10.04 and 10.10 users, add the following PPA :
sudo add-apt-repository ppa:bean123ch/burg
  • For Ubuntu 11.04 users, add the following PPA :
sudo add-apt-repository ppa:n-muench/burg
  • Then use the following command to download and install the loader, themes and emulator:
sudo apt-get update && sudo apt-get install burg
  • During the installation, it should ask you to write the new boot loader to MBR. If you skip that step, you can later use the following command to update MBR of hd0:
sudo burg-install "(hd0)"

or ( FIXME ??? burg-pc package does not exist ! )

sudo dpkg-reconfigure burg-pc

Reference : https://help.ubuntu.com/community/Burg

How to install Aptana Studio 3 on Ubuntu 11.10 (Oneiric)

These instructions are for installing the standalone version of Aptana Studio 3.

1. Install Sun Java – Aptana Studio doesn’t currently work with OpenJDK:

sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jdk sun-java6-plugin

2. Download & install xulrunner – Ubuntu 11.10 doesn’t include xulrunner so it must be downloaded.

If you are using Ubuntu 64 bit use:

wget -O xulrunner.deb http://launchpadlibrarian.net/70321329/xulrunner-1.9.2_1.9.2.17%2Bbuild3%2Bnobinonly-0ubuntu1_amd64.deb
sudo dpkg -i xulrunner.deb

If you are using Ubuntu 32 bit use:

wget -O xulrunner.deb http://launchpadlibrarian.net/70321863/xulrunner-1.9.2_1.9.2.17%2Bbuild3%2Bnobinonly-0ubuntu1_i386.deb
sudo dpkg -i xulrunner.deb

3. Download the Standalone version of Aptana Studio 3 from the Aptana Studio website.

4. Unzip it to /opt/aptana-studio-3:

sudo unzip [name of Aptana Studio ZIP file here].zip -d /opt
sudo mv /opt/Aptana\ Studio\ 3 /opt/aptana-studio-3

5. Install the menu item:

wget http://www.samclarke.com/wp-content/uploads/2011/11/AptanaStudio.desktop
sudo mv AptanaStudio.desktop /usr/share/applications/AptanaStudio.desktop

That’s it, Aptana Studio 3 should now be installed and ready to use. You may need to log out and back in it to show in the menu.

Reference : http://www.samclarke.com/2011/11/how-to-install-aptana-studio-3-on-ubuntu-11-10-oneiric/