Correct WordPress AlignCenter CSS Code

Well, this time, I had to post this in my blog so I do not have to waste time scouring through blog posts and forums just to get this one right.

My blog recently got hacked so I had to install everything. That means default CSS templates as well and there is the issue of aligning images at the center.

Just make sure you add this CSS code and your aligncenter attribute value should be okay.

img.alignleft { float: left; }
 
img.alignright { float: right; }
 
img.aligncenter { display: block; margin: 0px auto 0px auto; }

Five Online Startups That Can Help Your Business Save Money

The world is vast and so is the Internet. In a world filled with possibilities, here are a few smaller niche websites that can help businesses save up on costs.

Interested? Read on.


1. Bitrix24.com

Effective communication among employees is substantial for the success of a business. With Bitrix24, a business with 12 employees or less can have the basic package for free. This package includes a fully functional CRM, activity streaming where every team member gets updates as events unfold, calendar, activity planner, sales funnel plus other features at exactly no cost to one’s business.

If you have more than 12 employees, not to worry. For only $99 a month, you can use all of Bitrix24 services.


2. Logaster.com

Logaster for one is a great tool for making unique and beautiful logos without any hassle. You can create a logo yourself or choose from a hundred other pre-defined templates that you can use right away. For  a subscription fee of $4.99, you can also get designs for business cards, letterheads, envelopes your business needs.


3. PickyDomains.com

Thinking what domain name to use for your brand or company is critical. Some people do the nasty habit of domain hoarding that when the time comes you need to pick a domain, they are owned by somebody else. Hence you try to think of the next possible domain name that fit your brand.

Save yourself the trouble of doing this and let others do it for you. For only a small fee, all you need to do is register, pay a deposit ($50 for a domain, brand or name and $75 for a slogan), specify  parameters then choose among the suggested domains.


4. JetRadar.com

JetRadar helps users find cheap flights, compare airfares from hundreds of airlines and hundreds of travel sites and pick the cheapest plane tickets available. Now, this is what travel should be all about.


5. iSpionage.com

iSpionage is a good service to try out to know what your competitors are up to. It is always in the best interest of a company to be on the alert what competitors are doing so you can counter their activities with your own and stay at the top.

Are they spending money on Google and Bing ads? which keywords they bid on, which keywords generate most of free traffic for them, and ton of other valuable data. One can do a free search 3x a day or $59 a month for unlimited searches.

Get Age Of Contact In Android

There is no shortcut in getting a contact’s age in Android. What I did instead was to get the birthday of the contact (if any is provided) and subtracted that from the current year.

The output of a contact’s birthday is a string formatted date with dashes (-) so I had to make a helper method to parse it; get the month, date and year; convert it to a Date object, then do calculation to get the age of the contact.

Check out the helper method below.

public static int calculateAge(int year, int month, int day) {
    Date now = new Date();
    int nowMonth = now.getMonth()+1;
    int nowYear = now.getYear()+1900;
    int result = nowYear - year;
 
    if (month > nowMonth) {
        result--;
    }
    else if (month == nowMonth) {
        int nowDay = now.getDate();
 
        if (day > nowDay) {
            result--;
        }
    }
    return result;
}

And this is how I retrieved the birthday of the contact from the contact list. Once retrieved, I parsed the output and passed it to the calculateAge() method.

public static int getAge(Context ctx, String contactId) {
    int age = 0;
    ContentResolver cr = ctx.getContentResolver();
 
    String columns[] = {
        ContactsContract.CommonDataKinds.Event.START_DATE,
        ContactsContract.CommonDataKinds.Event.TYPE,
        ContactsContract.CommonDataKinds.Event.MIMETYPE,
    };
 
    String where = Event.TYPE + "=" + Event.TYPE_BIRTHDAY + 
            " and " + Event.MIMETYPE + " = '" + Event.CONTENT_ITEM_TYPE + "' and " + 
            ContactsContract.Data.CONTACT_ID + " = " + contactId;
 
    String[] selectionArgs = null;
    String sortOrder = ContactsContract.Contacts.DISPLAY_NAME;
 
    Cursor cur = cr.query(ContactsContract.Data.CONTENT_URI, columns, where, selectionArgs, sortOrder); 
 
    if (cur.getCount() > 0) {
        while (cur.moveToNext()) {
            String[] sage = cur.getString(cur.getColumnIndex(ContactsContract.CommonDataKinds.Event.START_DATE)).split("-");
            age = calculateAge(sage[0], sage[1], sage[2]);
        }
    }
    cur.close();
    return age;
}
Related Posts Plugin for WordPress, Blogger...