It is common to import CSV files into MySQL database. You can do this with phpMyAdmin with small CSV files but with large ones, you would probably encounter the memory error and had to switch to MySQL command line “LOAD DATA LOCAL INFILE” to do the job.

It looks like something like this:

LOAD DATA LOCAL INFILE 'your.csv'
INTO TABLE `your_table`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
(field1, field2, field3)

And then you encounter another problem that it only imports the first 1 or 2 rows and then it stops. After some researching and trying, I was sure it’s something to do with the “LINES TERMINATED BY” directive. Depending on the platform that the CSV file is created on, the line delimiter may be

  1. \n
  2. \r\n
  3. \r

And you need to be correct on the line delimiter to properly parse the CSV file.

So the solution is to try them all one by one and see which one of them works. Chances are, one of them would make the whole command successfully import ALL rows.

Another simple approach is to deprive the whole command of the “LINES TERMINATED BY” directive and let MySQL do the call. It’ll probably detect things right but in my case, this doesn’t work but specifying ‘\r’.

{ Comments on this entry are closed }

Let’s be honest here. One of the most dreaded dreams for any working professionals perhaps is generating timely and professional invoices. Important as they are for ensuring timely payments, it is a pain to sacrifice time and make an effort to track down all the details. If you are having a tough time preparing invoices and the accompanying reports, a valued solution that lies with you is Invoicera. Invoicera is a completely web hosted application that effortlessly works towards getting the invoice generation job done, in a professional manner.

A sturdy online invoicing and billing application, Invoicera provides you with a self explanatory user interface along with poignant and much sought after set of features and functionalities. Thus it seamlessly simplify and streamline the entire process of generating and sending invoices.

Invoicera control panel

Language Multiplicity and Multicurrency support

This is a major factor, which gives Invoicera an edge over various other online billing systems in the market. Invoicera supports 11 different languages and more than 100 currencies.

Effortlessly Manage Your Clients

In the client section apart from managing and adding your new clients you can also view their account statements and create custom fields and entries which you deem necessary.

To overview the complete details of any particular client there is an automated Report generator, which gives you the ease of analyzing the dealings and business you have had with the customer.

Incredible Time Tracking

With its expert time tracking capabilities, you can be rest assured to track down every minute of your time that you have spent on the projects for your clients. It completely nullifies all the worries surrounding time tracking and you can easily keep a check on how much time you have spent on a particular project.

Template Customization Service

In case you are not technically trained in customizing the look of the invoice / setimate templates, Invoicera provides you with the option of Invoice Template Customization service. This will provide you with the expert services of seasoned technical experts and you can easily customize the look of the invoice that you send, as per the need of your business.

Schedule Your Invoices Easily & Charge Late Fee from Defaulters

A stand out point of Invoicera is that unlike other similar apps, with Invoicera you can easily schedule each of the invoices needed to be delivered. You can simply schedule the date and time on which you need to send out the invoices to the users and the intuitive online invoicing solution that Invoicera is, it will make sure that invoices are delivered right on scheduled time. Besides, with just a click of the mouse, you can add the late fee charges and get reimbursed for the same.

Other Benefits That Invoicera Offers:

  • Login and carry out some invoicing tasks wherever you have access to the Internet either via PC or laptop,
  • Flexible pricing depending on your usage levels,
  • Constant updates and support,
  • No large up front application costs,
  • Data security and backup

In Short

Invoicera is vast enough to confound all the different invoicing requirements of your web site and you assure yourself productive gains by availing its services. Besides, their customer support and related services are impeccable and unmatched. Thus if at any time you stumble, Invoicera provides you with enough options to continue the smooth sailing.

Invoicera - online invoicing

{ Comments on this entry are closed }

The title pretty much says it all. It’s 2 of the most useful AdSense ads tips for bloggers in my opinion. Obtrusive ads have the unnecessary effect of driving away readers after they have found what they needed. Unless you have amazingly great content, the chance of them becoming a loyal reader is rather low when you have ads splashing into their faces – this is not something you want to do to your subscribed readers. On the other hand, you’d want to maximize your AdSense earnings by putting up ads on as many posts as possible.

Ad Injection (WP plugin)

This tiny little plugin, Ad Injection, gets it all. Very useful plugin for you to insert AdSense ads in your blog posts AND set a specific age threshold for the posts to display ads, so freshly published articles won’t have ads to drive your subscribers away. See detailed introduction here: Ad Injection for WordPress.

Just install it from the inventory (upload or install from within your WP administrator panel) and activate it. Go to Settings > Ad Injection > “Random ad (inserted randomly between paragraphs)” and insert your AdSense code there. Depending on how aggressive you are, you can use a variety of ad formats from Google. I used a 468×15 links banner on Health Not. Check out the screenshot below:

insert ads in wordpress posts

By default, Ad Injection inserts a maximum of 2 instances of the Random ad per post. This way, the ads are well blended in the content. What works a few years back with the 336 square ad format on top of the content is gradually dying out in CTR thus click revenues. You should try something new such as this.

Another useful option of the plugin is to set “Only show normal ads on pages older than xx (days) – only for single posts and pages”. This would prove very useful if you want a good balance between ad performance / earnings and user experiences. Only displaying ads on older posts are a pretty good idea for creating a good first impression to those who stumble upon your site.

{ Comments on this entry are closed }

Sometimes you would want to check if a string is an acronym or an abbreviation by testing if it only contains capitalized letters from A to Z and nothing else. There are 2 ways to accomplish this simple task in PHP.

ctype_upper()

Use the native ctype_upper() function and you will know if the provided string contains only uppercase letters:

if (ctype_upper($string)) {
	echo $string.' is all uppercase letters.';
} else {
	echo $string.' is not all uppercase letters.';
}

The Ctype functions would turn out to be very handy when you want to test a string against different character types – digits, alphabetic, alpha-numeric, lowercase letters, uppercase letter, and even punctuations, etc. See the full list here: http://www.php.net/manual/en/ref.ctype.php

strtoupper()

Use the strtoupper() function to transform the string into all uppercase characters that’s capitalized letters, and then compare the transformed string against the original one to see if they are identical. If they are, then you are pretty sure the original string was also a string consisting of ONLY capital letters.

if (strtoupper($string) == $string) {
	echo $string.' is all uppercase letters.';
}

Check if A String Consists of Only Lowercase Letters

The same goes true if you want to do the test other way around. Just use ctype_lower() and strtolower() instead.

{ Comments on this entry are closed }

Customize WordPress Post Editor CSS Styles

by Yang Yang on January 19, 2012

Do you know you can actually change the CSS styles of the entire editing area / editor where you create the post content in WordPress? It doesn’t have to be the default styles and since version 3.0, people can freely style the TinyMCE rich text editor shipped with WordPress however they want to by a few simple changes to the theme files.

Step 1

Open the functions.php file in your theme folder (create it if it doesn’t exist) and add this line anywhere in the PHP tags <?php … ?>:

add_editor_style();

Step 2

Create a css file named editor-style.css and put it in the theme root, namely the same folder where functions.php is in. To start with, you may want to copy the CSS styles from that of the Twenty Eleven theme into yours.

Now you can freely change those styles (such as rich text font, size or color, etc.) to have your own customized WordPress editor styles. The default editor styles coming with Twenty Eleven are very nice that make me long to write. So I’m now using them for my editor in the current theme, Thesis. You should too, if you find it more inspiring than the default styles.

{ Comments on this entry are closed }

Add Wildcard DNS Subdomain *.example.com in cPanel

by Yang Yang on January 16, 2012

Lots of people ask this question and most of them probably made the matter complicated by editing the DNS Zone from WHM in the DNS Functions. But they actually should just do it in cPanel which is A LOT easier.

Just log in your cPanel which manages the domain that you want to add support for wildcard (*) subdomains. Go to:

Domains > Subdomains

And enter asterisk * in the Subdomain and choose the domain you need it added to.

Click “Create”.

adding subdomain wildcard in cpanel

That’s it. Now you can access your domain from any random subdomain and it will automatically use the A record of the main domain as their own.

{ Comments on this entry are closed }

ffmpeg delphi vclThis post is dedicated to one of my friends, Coolie (not his real name but he preferred to be called that way among friends), a father and self-entrepreneur who created the outstanding Delphi VCL component for FFmpeg that makes it extremely easy to develop audio and video applications for Windows.

For those who are not Windows desktop developers, FFmpeg is the ONE video and audio applications library across all major platforms that is able to encode, decode, edit, convert and stream audio and video. It is widely adopted as the standard library for multi-media applications development. Chances are, what you currently have for media player in your operating system uses FFmpeg to do all the underlying work.

The problem with FFmpeg is that it’s only got a command line interface. You would definitely find it fascinating if you are a Linux guru, but not GUI users. Developers must create another layer of interface to accommodate end users, another layer of abstraction for FFmpeg, and that’s exactly where Coolie’s talent comes in, who heroically produced the Delphi VCL for FFmpeg and the ActiveX OCX Controls for FFmpeg. Problem solved for people who want to make video and audio applications in Windows but daunted by the command-line FFmpeg.

Simply ground-breaking work he has made, Coolie graduated from Tsinghua university, the China counterpart of MIT or Princeton – approximately 100,000 high school students each year compete for just 1 admission to Tsinghua. Think about that.

Feel free to bug him if you are interested in developing a multi-media application yourself – it’s not so hard as it may seem because many contemporary languages and platforms are made to be used by absolute programming beginners, such as VB.NET.

{ Comments on this entry are closed }

google feedburner - free email subscription serviceI’ve been with Aweber for nearly 2 years and they are good. But I eventually decided that newsletter is not my type of thing – there are people who are making big bucks by building and maintaining a high profile email list, but I’m just not one of them. So I left Aweber and switched all my subscription forms to Feedburner email subscription.

It’s actually pretty good. On top of everything, it’s free and A LOT easier to set up. It’s got anti-spam captcha which Aweber lacks – I contacted Aweber support approximately 1 year ago about this feature and up until now, they still haven’t deployed it. The problem with a popular blog is that there are many spam bots waiting to fill every form on the pages. As a result, my list was filled with fake non-human emails which bloated my number of subscribers, thus monthly fees.

It sucks, though Aweber excels in many other regards such as demographic statistics and CTR, etc. If you’ve got a blog and just want to deliver your fresh posts to the inbox of your readers, namely blog subscription, Feedburner is perfect for you. If you want a little more as what an autoresponder does, Feedburner can somewhat help you in this as well, albeit limited in functionality.

Use Feedburner for Email Subscription

Just sign in your Google account and navigate to http://feedburner.google.com and you can start creating your feed right away. In addition to adding a Feedburner custom feed address to your blog, you can also get a email subscription form by “Type your blog or feed address here” and then click “Next”.

It’s all guided and easy to finish. After you have done, go to “Publicize” –> “Email Subscriptions” and click “Activate”, you would then be presented by a HTML code block which is the your blog subscription form that you should put at a prominent place on your blog. Readers can then enter their email addresses to sign up with your newsletter (not newsletter actually, but blog posts notifications). Recommended places to install the email subscription form include: 1) end of the post, 2) top of sidebar, etc.

Use Feedburner as Autoresponder

After you have created your feed at Feedburner, click the feed, and go to “Publicize” –> “Email Subscriptions” –> “Communication Preferences” and there’s a “Confirmation Email Body” that you are free to edit to include any messages or links you would like to show to the subscriber (yet-to-be), such as a thank-you line and the download URL of a ebook you’ve created. After you have made the changes, click “Save” to save them.

Now if anyone subscribes through the Feedburner email subscription form on your blog or website, he or she’d first receive a confirmation message from Feedburner containing things you added just now. It’s exactly like an autoresponder, and it’s free.

{ Comments on this entry are closed }

Review of uCertify Zend PHP-5 Exam PrepKit

by Yang Yang on January 12, 2012

Recently uCertify approached me and asked me to do blogging on about Zend PHP-5 exam PrepKit. Since this is an interesting topic to me and as I would get a free simulator, I agreed. uCertify produces the preparation kits for many different IT Certifications including Microsoft, Oracle, Cisco, CompTIA, Adobe, etc. The uCertify PrepEngine looks like this:

Zend PHP5 Exam PrepKit

Features of the PrepKit:

  • A nice looking user interface with good usability, especially regarding the minor details. For example, it is possible to click the answer itself and not only the checkbox next to it.
  • It has an optional study mode for every kind of test. When enabled it displays the wrong answers immediately rather than evaluating the answers only after the test is over. This provides a harmonic way of learning and measuring one’s progress.
  • It automatically shuffles the order of the answer options thereby preventing me from remembering the position of the correct answer among various options.
  • The explanation to the answers is of good quality and includes chart, diagrams, tables, snippets wherever required.
  • Huge amount of study material are included in the kit! It is not only a simulator but a full preparation kit.

In general it is a nice product that can be helpful for one to prepare for an exam (they have various prepkit available at uCertify). However I do not want anybody to get an impression that I think this is the only resource that one could use to prepare and pass an exam. This product and all other products available out there (books, prep kits, study guides) are just another resource for learning and practicing that one might consider to use when preparing for an exam.

It’s a very nice kit for diversified learners who want to learn things in all different ways. It’s also a breeze to create your own tests and quizzes. Give it a try and you are gonna like it!

{ Comments on this entry are closed }

Premium Magento Theme – Avalanche (Review)

by Yang Yang on December 30, 2011

Avalanche 15% Off Promo: Click here to get 15% discount off, then enter code KAVOIR in the box to claim the 15% discount off the Avalanche theme.

avalanche - premium magento themeAfter digging into Magento for a few months and trying to start my own tangible business (I only deal with digital goods as of now), I failed in finding the perfect theme for my store. What I had in mind was a Magento theme much like Thesis for WordPress, the sort of theme that’s simplistic yet powerful, finely crafted and omnipotent (not just for a specific niche). Seemed most of the themes I could find were a bit too frivolous for me, until I found Jake and his Avalanche, premium Magento theme.

Jake was one of a few Magento experts who are true masters of the eCommerce platform. I first discovered Avalanche with awe and thought, that was it – that was exactly what I wanted. With a few improvements it’d be the perfect theme for my store. I contacted Jake immediately with some of my ideas and he got back to me and greatly appreciated my feedback. He adopted and implemented my suggestions the next day. Those were some great ideas such as a mega / exploded menu option for the top navigation. It used to be 3 options, now there are 4 – it’s all yours to choose from in the Avalanche configuration panel.

I bought the Developer License for $399 that night. It was a remarkable experience. We exchanged quite some emails about how to make the theme better. Not every vendor takes customer suggestions so seriously, let alone a customer-yet-to-be; and it’s not every day you find a developer who so vigorously and wholeheartedly keeps refining his product.

The installation was a breeze. Had some minor problems as I was not quite experienced with Magento yet and emailed Jake for help and he got back to me within 1 hour. Every time. That’s the kind of support lacking in the official Magento Go team.

The Avalanche theme has lots of backend options that you can tweak to customize the look and general texts of your store. Cloud Zoom in place. Breadcrumbs are enhanced. Colors, typography, banners, featured products, AJAX quick views, cutting edge CSS3 features and many more.

As of now, I’m very much impressed in all regards, though I’d say it’s more of a theme for digital niches such as technology and electric products. The black and white theme may not suit every customer base (may not yield the best conversion rates in some niches). You need to tweak them a bit, unless Jake can come up with an overall color themes switcher in future updates. For now, we are stuck with color switchers just for borders, links, and action buttons – they are actually pretty nice with gradients, you should try it!

There could be more improvements and I’m sure Jake’s already started working on the next version. By far, I think he’s making the best premium Magento themes.

My 4.9/5 for Avalanche Magento theme.

Avalanche 15% Off Promo: Click here to get 15% discount off, then enter code KAVOIR in the box to claim the 15% discount off the Avalanche theme.

{ Comments on this entry are closed }