Logicationz Tech

More Intelligent Solutionz…!

Acer Android Netbook Now Available From Amazon.com

Acer’s first Android netbook is now available for pre-order from Amazon.com.

The Acer Aspire D250 netbook is dual booted with Windows XP and Google Android and features a 10.1″ (1024 x 600) display, An Atom 1.66GHz N280 processor, 1GB RAM (max 2GB) and a 160GB HDD (5,400RPM).

The netbook also includes a multi-touch touchpad and comes with 802.11b/g Wi-Fi, GMA 950 graphics, 1GB RAM and the highest capacity 5800mAh 6-cell battery Acer offers on the Aspire One netbook range.

Pricing for the Acer Android netbook starts at $350.

April 15, 2010 Posted by | Android | , | Leave a comment

Could open source abandon the Google train?

As arguably the world’s largest open-source company, Google has a big stake in maintaining its place at the heart of the open-source ecosystem. Recent events, however, suggest that Google can’t rest on its laurels if it wants to secure the hearts and minds of open-source developers.

Make no mistake: Google needs those developers. Android, Chrome (and Chrome OS), and other Google initiatives depend upon fostering vibrant open-source communities that can help it to surpass Microsoft and Apple.

Does Google need to search for new friends?

Such communities may be ready to cut the Google umbilical cord, however, which should be worrying to Google.

There have been rumblings that Mozilla would look to Google alternatives for the default search engine within Firefox, despite Mozilla pulling in 91 percent of its revenues from its Google partnership. Mozilla employee Asa Dotzler, though not speaking for the foundation, says that he’d welcome a switch from Google given its rising dominance over the Web.

Mozilla executive Mitchell Baker, for her part, has noted that alternatives (Yahoo, Microsoft) would likely pay Mozilla more money and give Firefox shelter from Google, which has been building a rival browser, Chrome.

If Mozilla needs a nudge, Canonical just gave it one, defaulting to Yahoo search for future versions of its popular Ubuntu Linux operating system.

Mozilla and Canonical represent the heart of the open-source community. If they move from Google, it paves the way for other communities to do so, too.

Mozilla and Canonical arguably have their financial self-interest at heart in such deals, but Gartner Research Vice President Brian Prentice points out an even bigger issue that could drive a wedge between Google and the wider open-source community:

Patents.

Google, after all, was recently granted a patent on its MapReduce parallel programming model. This puts the Apache Software Foundation Hadoop project firmly in its sights, even if Google likely has no intention to sue. It’s the uncertainty that may end up hurting the open-source community.

[T]he greatest threat to any open system is, in fact, uncertainty. And what Google has done here is to dump a whole lot of uncertainty onto the market.

–Brian Prentice, Gartner

Prentice queries whether

So, does that mean that it’s only a matter of time before Google’s legal team starts sending out letters seeking license fees? I don’t know. And that’s the point. No one else does either.

I would suggest to you all that the greatest threat to any open system is, in fact, uncertainty. And what Google has done here is to dump a whole lot of uncertainty onto the market.

To those asking Google to submit such patents to a commons to ensure they are only used for defensive purposes, Google’s response, as Prentice goes on, effectively amounts to “trust us – after all we’re not evil.”

Don’t get me wrong: Google is and will likely remain a very strong proponent of open-source software, with projects like Chrome that impress and push the boundaries of innovation.

But in its rush to serve a wide variety of customer needs, it may end up overlooking or stepping on its erstwhile partners (like Mozilla), and could pursue policies (like its MapReduce patent or even its H.264 video codec stance) that threaten the open-source community just as much as Microsoft has.

Google is powerful, but it still needs friends. Open source has been a chief ally of Google to date. Will it remain such? That’s an open question.

February 18, 2010 Posted by | Google | | Leave a comment

Google Checkout gets a new boss

Google might be ready to get its Google Checkout service in line with the hiring of a new executive to oversee the division.

The New York Times reported that Google has hired former eBay executive Stephanie Tilenius as vice president of commerce, with marching orders to look over Google Checkout. Tilenius, who worked on eBay’s PayPal product while at the company, would seem a natural fit for the position.

Google Checkout gave eBay and PayPal executives fits when it was first announced back in 2006. But the service hasn’t done much to halt PayPal’s status as the de facto standard for online transactions by small businesses and Web sites.

Recent problems with Google Checkout have had merchants up in arms, exposing holes in Google’s customer service operation. Google Checkout is a key part of Google’s mobile strategy, however, serving as the payment processing platform for the Android Market and the only way to buy a Nexus One.

A Google representative did not immediately respond to a request for comment on Tilenius’ role at Google

February 18, 2010 Posted by | Google | | Leave a comment

CodeIgniter Subversion Server Change

Our Subversion repositories have moved.  Please update your repositories or check out new ones from the new location: http://svn.ellislab.com/CodeIgniter/trunk

As always, information about our Subversion repositories can be found on the download page and installation instructions.

February 18, 2010 Posted by | CodeIgniter | | Leave a comment

Google Buzz turns Gmail into a social networking site, Facebook and MySpace beware

An XKCD comic shows the following morning routine – 1) wake up, 2) catch up on the lives of friends around the world, 3) get out from under the covers. It sounds weird when you put it like that but it’s nonetheless true and it’s social networking that made it possible.

big Google Buzz turns Gmail into a social networking site, Facebook and MySpace beware

Now Google is launching Google Buzz – a social networking tool that integrates into Gmail and taps into a lot of other sites you might be using, like Twitter, Picasa, Flickr and Google Reader.

Facebook is apparently working on an email service, which will likely jump to a spot in the top three email services the moment it starts – Facebook has 400 million users or thereabouts. Google Buzz is doing the opposite – turning the (current) number one in email into a social networking site.

With Google Buzz, the search giant is playing to their strengths. When someone comments on an update you’ve posted, the comment goes straight into a dynamic entry in the Gmail Inbox.

Positioning is an important part of Google Buzz – but it’s not just your current coordinates, it’s the place you’re in. This uses Google Places – you can post a comment about the place, check out information about it and other places near it, look through comments of others about the same place and so on.

Google Buzz makes sharing photos and videos a child’s play – there’s a quick and easy to use photo browser and video player and posting images and videos is as simple as it gets. It imports content from Flickr and Picasa and it will even pull the images from a link you posted, so you just click on them and they are embedded into the post.

Buzz also shows the Twitter streams of your contacts and will recommend posts by your friends’ friends. By selecting which ones you like, Google Buzz will get even better at recommending comments that are interesting to you. For now however, it can only display Twitter feeds. Buzz also integrates the news feeds from Google Reader to push you to the brink of information overload.

Google Buzz will be heavily used as a mobile app – Apple iPhone and the Android are the first to get it, because they have HTML5 support for location-based services. Gizmodo has posted a hands-on for the mobile version, check it out.

Well, well – being a big company has its advantages, doesn’t it? Facebook email will get a huge user base even if only a quarter of their users sign up for the service, and because Google Buzz is integrated into Gmail and automatically imports you email contacts, it will get you through the hardest part of creating a new social networking account in an instant.

February 11, 2010 Posted by | Uncategorized | | Leave a comment

Automatic configbase url

Don’t you just hate it, when you move from development server to production server that you have to change the $config[’base_url’] setting?

Well I do. Because I do it a lot, specially when I’m demoing a web application, that’s why I added this code to the config.php


$config['base_url'] = "http://".$_SERVER['HTTP_HOST'];
$config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);


Once thats added, Codeigniter base_url will adapt to whatever the url you’re using.

Here a version that works for both: http and https:


$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http");
$config['base_url'] .= "://".$_SERVER['HTTP_HOST'];
$config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);


Or you can just put use this (pretty much the same as above):


$config['base_url'] = 'http' . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 's' : '')
                      .
'://'.$_SERVER['HTTP_HOST'].str_replace('//','/',dirname($_SERVER['SCRIPT_NAME']).'/');


January 29, 2010 Posted by | CodeIgniter, Helpful Tips and Tricks | , , | Leave a comment

jLinq

jLinq is a fully extensible Javascript library that allows you to perform LINQ style queries on arrays of object.

Try jlinq online

January 19, 2010 Posted by | jLINQ | | Leave a comment

Why CodeIgniter HTML helper functions rock

A complaint I often hear about CodeIgniter is one about HTML helper functions like form_open(), doctype() and img().

The complaint boils down to these points:

  • heading(‘Hello’, 1) is ugly compared to <h1>Hello</h1>!
  • Putting HTML in PHP functions is “bad MVC”.
  • My favourite “I know how to write HTML, I don’t need a helper”.

These points of view come from people who do not understanding the potential benefits of using HTML helpers – whichis fair enough as I used to think they were useless too.

Two small things to mention first, then on to the “meat” of the article.

It looks ugly

If you are reading this you are quite likely a programmer who stares at PHP for large amounts of time. Who cares if it does not look as clean as plain HTML in your view files? As far as readability goes, if a designer was to look at heading() im sure it would make perfect sense to them as much as a <h1>.

MVC pattern

Due to CodeIgniter being a MVC framework, people try to apply those three letters to everything. The people who see HTML helpers as “bad MVC” say so mainly because they have HTML outside of the view, which to them “goes against the rules” but I don’t think it should be as cut-and-dry as “ALL HTML ALWAYS GOES IN VIEWS”.

The way I see it is simple, views should contain your custom chunks of HTML (i.e. displaying content, forms, RSS feeds, etc) and helpers/plugins should contain whatever they need to do their helpful job and if that happens to be a small amount of HTML, who gives a damn? It doesn’t “break MVC” in the slightest.

Wrapping your data

The main interest to me comes in the extra abstraction layer these HTML helpers provide you with. The “whats the point?” comments can be answered in the same way as “What’s the point in using jQuery?” or “Why use CodeIgniter over PHP?”. The extra layer of abstraction, combined with helper extending/overriding makes it very easy to change simple bits of logic throughout your application output with minimal fuss.

To explain what the f**k I am talking about, I’ll use an example.

<form action="<?php echo site_url('controller/method'); ?>" method="post">
vrs
<?php echo form_open('controller/method');

First you will see the standard HTML way to do it, with the site_url() function used to create the link to the form action. Second you will see the form_open() tag – and in this example its shorter too, wahey!

I wanted a way to set accept-charset=”UTF-8″ in all my forms to help keep my data all <a href=”/news/2009/08/UTF-8-support-for-CodeIgniter”>UTF-8 in CodeIgniter</a>. If I was using just HTML then I would have to go through <strong>all</strong> my forms and add that in myself, which would be wasting time I could have spent at the pub.

Instead, as CodeIgniter allows you to extend helpers, I just made my own slightly modified form_open() inapplication/helpers/MY_form_helper.php which contained this logic. Because I was using PHP to wrap my useful data, I could make one simple change and update all of my <form> tags.

The main problem is people are looking at these HTML helper functions and seeing them purely as different syntax.

Think big

My example shows one useful application of this beyond shorter syntax, but there are plenty more applications for

HTML helper functions.

  • Store your DOCTYPE in a config variable and update your entire site from XHTML 1.1 to HTML 5 easily
  • Developing your app with <h1>Something</h1> then relizing your headers in 500 different view files need <h1><span>Something</span></h1>
  • Fetching metadata from a database and outputting with meta()
  • Adding Google event tracking to images loaded with img()
  • Set your page titles (display headers, not title tag) to use a config variable 1 to 6 in case your CMS needs to change what level the links are.
  • XSS protection for forms using form_open() and form_close(). Derek Allard hinted at this some time ago and I still hope to see it happen.

There are all sorts of crazy things you can do with HTML helpers and while it might be hard to see their value before you have the “aha!” moment, it is a pain to realise you need to use them when it is too late.

January 19, 2010 Posted by | CodeIgniter | , | Leave a comment

Country Name and ISO 3166 Code MySQL Import File

Download iso_country_list.sql (18662 bytes, Last updated Sat Dec 01 23:19:11 2007)
Download usps_states_list.sql (4202 bytes, Last updated Sat Dec 01 23:19:11 2007)

Background:
I recently had a project at work which required a web-based user registration sort of feature. Because the project
had an international flavor, I had to let people from every country register. And since we were going to need to
generate reports broken down by country and eventually make mailing labels from the data stored in our MySQL database,
I wanted the data to be pretty clean. Thus, I didn’t want people to either have to or be able to type in their
country of origin by hand. I wanted a select list they could choose from.

What I wound up doing was making a table which listed the names and
ISO 3166 codes
of all the countries of the world. I then referenced this table in my main user registration table as a foreign key.
This would allow us to look at all the people that had registered from Europe, let’s say, and then make graphs with the
two-letter ISO codes on them for clarity. It should work out pretty well.

To make a long story short, I realized that this was the fourth time I had made such a table, and the fourth time
I had done it from scratch (and it was the third time I had done it by writing
a perl script which screen-scraped
a list off the
web
). This is silly and a waste of time. So I decided to put my SQL file up here where I can get it later if
I needed it. Since sharing is good, I made it public here so other people can get it if they find it useful (I
didn’t find much when I went googling for such a list…).

Updates:

11/14/06:
It’s been brought to my attention that the SQL file shows Taiwan as a “Province of China”, and that some people (the Taiwanese in particular) have some sensitivity towards the issue of Taiwan’s sovereignty.

After some consideration, I’ve decided that it’s not my place to second-guess a standards body and a world governing organization by editing information coming from the U.N. and ISO. Because the SQL file is generated automatically from those sources, and because both bodies hold Taiwan to be a province of China, I’m leaving the SQL as is with respect to Taiwan.

If you have a certain insight into the topic, or deal with those who may be sensitive to the issue, you might want to edit the SQL file such that Taiwan is listed simply as “Taiwan”.

3/16/04:
If you’re looking for U.S. and Canada telephone area codes, try a site called areacodedownload.com.

10/8/03:

More mail, more changes. I got a couple requests for non-upper case country names (like you’d use in text
or something. It’s not really an easy thing to do in SQL, so I added it to the perl script that makes the SQL
insert file. There’s now another column called ‘printable_name’ and it has the country names with their
proper capitalization. This seems kind of redundant to me, but it’s not a very big file, and not a very big
database table. Besides, the extra storage space needed by the ‘redundant’ column is probably preferrable
to the CPU overhead caused by making printable names in code or SQL at the time of the select.

5/20/03:
I’ve been getting a lot of email recently and ask if I have the 3-letter and 3-digit codes for each country (this
is what is contained in ISO 3166-2).
ISO charges for 3166-2, and up until now I’ve just been grabbing the free 3166-1 list off their web site.
I did some
looking into it, and I found a place that has the extra codes, for free.

It turns out that ISO gets their country names from the
United Nations’ country list. Well, it’s really
pretty easy for me to get that info and correlate it. In fact, there’s a Perl module that helps make this happen.
The Geography::Countries module aims to give you the county names, the 2-letter codes, the 3-letter codes,
and the 3-digit numeric codes. The country names were slightly different than what ISO hands out,
but the two-letter
codes were the same. (I suspect that the module is slightly out of date, another reason why I want to keep
getting the data off the web.)
Because of this, and in the interests of backward compatibility, I decided to keep the ISO names.

As an aside, there are 12 countries (as of 5/20/03) that don’t have the ISO 3166-2 data.
Since the data are free,
the price is right for what I did manage to get.
Anyway, run SELECT name FROM
country WHERE iso3 IS NULL;
if you want to see which ones don’t have the 3-letter/digit codes.

I’ve updated the perl script to create a SQL file which includes the new 3166-2 info where available.

1/1/03:
I’ve had a few people email me and ask if I had a similar SQL import file for
U.S. Postal Service state names and their
abbreviations
. I didn’t have an actual downloadable file, but it was made easily enough with mysqldump.
It’s linked up there at the top of the page. You use
it exactly like the country import file, and a select list can be made with only a little bit of jiggering to the
example code I’ve given below.

I did a little googling for such a file and couldn’t find much. Oddly enough, the ones that I did find were
incomplete since they didn’t have the Armed Forces “states” or territories/protectorates like Samoa and Virgin
Islands. Granted, probably not many people do business with those in Puerto Rico or the Republic of Palau, but
if you want to have a drop-down of U.S. states and you don’t provide the lesser-known ones you make it hard for
those people to use your site. This SQL file has the names and two-letter abbreviations for all the states that
the USPS considers “domestic”.

Uses:

To import this into a MySQL database, just do like so:

mysql -u username -ppassword database_name < iso_country_list.sql

If you have create permissions on ‘database_name’, you’ll then have a table called ‘country’ which has all your country info.
You’d use this table in another table like so:

CREATE TABLE register (
  name VARCHAR(255) NOT NULL,
  address1 VARCHAR(255) NOT NULL,
  address2 VARCHAR(255),
  address3 VARCHAR(255),
  city VARCHAR(150) NOT NULL,
  state VARCHAR(100),
  zip VARCHAR(20),
  country_iso CHAR(2) REFERENCES country (iso)
);

Then you can do selects and such against all the tables. The table above is purely hypothetical, by the way. I made it
just now off the top of my head, so you’ll probably want to use something which is better tailored to your specific needs
(phone number, two-character states, indexes for faster selects with ‘where’ clauses, etc).

Some code also might come in handy. Here’s a snippet of PHP which will make an HTML select list from all the countries
listed in your database:

@ $db = mysql_pconnect($hostname, $dbusername, $dbpasswd);
if (!$db) {
    print "Failed to connect to the database.  Please try again later.\n";
    exit;
}
mysql_select_db($dbname);
$sql = "select id,name from country order by iso";
if (!(@ $result = mysql_query($sql))) {
    print "There was an error running your query:<p>\n". $sql . "<p>\n";
}
print '<select name="country"><br>\n';
print '<option value="">  Choose One   ';
while ($row = mysql_fetch_row($result)) {
    $country_iso   = $row[0];
    $country_name  = $row[1];

    print "<option value=\"$country_iso\"";
    if ($_REQUEST["country"] == $country_iso) { print " selected"; }
    print "> $country_name <br>\n";
}
print '</select>\n';

Obviously, you’ll have to supply all the connection variables and such. This code is useful for PHP scripts which
call themselves, by the way. It checks the incoming $_REQUEST array for value for the ‘country’ element and if it
finds one which matches the value stored in the database, then it makes that choice selected. This is handy if you
do error checking on your scripts. I usually check for required fields and if one is not found, I just call the
PHP bits which made my form initially. By “keeping” the original values, the form elements will be set to what they
were when the form was first filled out. It’s a nice feature and good code re-use. Oh yeah, your script can also
check to see if the country has been left blank, since the “Choose One” option has an explicitly empty value. Without it,
the choice would literally be “Choose One”.

One more side effect of this snippet is that the value of the options in the select list will be the id number of
the country. This is (mostly) good, because when you go to insert the form contents into the database, you simply insert
this numerical value in your main table (the ‘country_id’ field in my pretend table above). This avoids having to
look up the numerical code of a two-letter code or a country name and insert that. It’s one less trip to the
database, and so quick and handy. (Although it presents a race condition which may make the choice of convenience
one you don’t want to make: if something updates the table between the time the user loads the
initial form and when they submit the form, they might be submitting the wrong id number.)
When you do selects on the ‘register’ table, you just do a plain natural join on the country table,
like so:

select applicant.name,city,country.name
from applicant,country
where country_id=country.id and country.iso='my';

select applicant.name,city,country.name
from applicant,country
where country_id=country.id and country.name='Malaysia';

Those queries will do the same thing: find the name, city and country name for all the registrants from Malaysia. The
first one uses the country code (good if looping through like from an array of ISO codes or something) and the second
is by canonical country name (good if you’re doing something like giving someone a web-based form with a select list
of country names — although you could use the code snippet above to access the id numbers directly).

If you wanted to do this with Perl or Python, the concepts are identical, BTW.

January 8, 2010 Posted by | Helpful Tips and Tricks, MySql | , , | 1 Comment

Facts of Google’s Go Programming Language

Its Google time!! Google has introduced a new open source programming language named as Go. The initial design of Go was started in September 2007 by Robert Griesemer, Rob Pike and Ken Thompson and was officially announced in November 2009 which is compatible in Linux and Mac Operating system. Go is a expressive, concurrent, garbage-collected systems programming language. Google’s Words : Go is experimental to combines the performance , security benefits associated with C or C++ programming language and the speed of a dynamic language like python that means its Python Meets C++. Compilation of the code runs closer to C , even large binaries compile in just a few seconds.

Features not included in Go: 1. Exception handling 2. Type inheritance 3. Generic programming 4. Assertions 5. Method Overloading.

Learning of every language starts with a Program “Hello World“:

package main import fmt “fmt” // Package implementing formatted I/O. func main() { fmt.Printf(“Hello worldn”); }

The syntax of Go is very similar to C Programming language except the declarations type, other syntactical differences are , Go are missing parentheses around if and for expressions. Go is concurrent programming language but unlike to occam or Limbo (concurrent programming languages) , Go does not provide any in-built notion of safe or verifiable concurrency. Go has some feature of Pi calculus like channel passing.

In Summary , Go Programming Language is a..

  • simple
  • fast
  • safe
  • concurrent
  • fun
  • open source

Final words of Google : We are hoping Go turns out to be a great language for systems programming with support for multi-processing and a fresh and lightweight take on object-oriented design, with some cool features like true closures and reflection.

 

To know more about programming , php info , php editor , programming php ,Open-source , php help and php script , subscribe to our feed by entering email address below. You will get updates via email about every tutorial posted on this site . It will not take more than a sec.

January 3, 2010 Posted by | Google | , | 2 Comments