iPhone 6-water-resistant body

iPhone 6 leak type of weekend - our inbox was buried with all sorts of tips about Apple's upcoming smartphone. After getting compared to the iPhone 5s and the Galaxy S5, the iPhone 6 now sits besides the iPod touch. These alleged comparison shots make the design cues the new smartphone model takes from its music player cousin all the more obvious. Alleged iPhone 6 prototype and iPod touch Additional iPhone 5s / 6 comparison shots made their way out of China along with dimensions - 138 x 67 x 7mm.

 That's considerably larger than the 135.3 x 71.9 x 6.1mm we estimated from the earlier leak. iPhone 6 prototype next to iPhone 5s Keep in mind that this new iPhone is said to have a 4.7" screen, accounting for the larger size. Apple security in China seems to have really broken down as an iPhone 6 dummy was photographed all around a city. Note that this could also be an upcoming knockoff of the iPhone 6 (remember the iploxe?). You can see all photos of the city tour at the Moscoat forum, but these in particular caught our eye. First off, the iPhone 6 gets dunked in water - either because it will be water resistant or because this is a non-working dummy - and then it gets sized up against the iPhone 5s and HTC One M8.

Windows Phone 8.1

Microsoft will begin officially rolling out Windows Phone 8.1 on June 24th. This should coincide with the launch of the Lumia 930, Nokia's upcoming flagship. Just like other iterations of Windows Phone software, 8.1 will feature the typical 3 years of software support and updates.

 Microsoft will make updates available for the Operating System, including security updates, for a minimum of 36 months after the lifecycle start date. These updates will be incremental, with each update built on the update that preceded it. Customers need to install each update in order to remain supported. The distribution of these incremental updates may be controlled by the mobile operator or the phone manufacturer from which you purchased your phone, and installation will require that your phone have any prior updates. Update availability will also vary by country, region, and hardware capabilities. Windows Phone 8.1 brings a host of new features and seems primed to make Microsoft's mobile OS a much more intriguing option for consumers.

Samsung - Tizen handsets - Russia and India

Samsung has been enjoying amazing success with their Galaxy line of handsets rocking Android but they've made it apparent that they plan on launching their own mobile OS: Tizen. Now Tizen isn't exactly well known outside of the more hardcore cell phone fanatic crowd, but the Korean tech giant has already made plans on getting it out there with their newest crop of Galaxy Gear smartwatches. It looks like wearables aren't the only devices that Samsung plans on using Tizen for, however, as there is word that Sammie will try to get Tizen to build traction in markets outside of Europe and the US: namely India and Russia.



 The two regions could see Tizen packing Samsung handsets as early as the next few upcoming weeks. Recently, a Tizen handset was supposed to launch in Japan for the carrier NTT Docomo, however, the deal fell through as NTT deemed that it wasn't the right time for them to do so. Orange in France also got cold feet about releasing Tizen smartphones. Seeing as Tizen isn't exactly getting any love from carriers, it doesn't look like a launch in Europe or the States is going to happen in the near future. However, countries like Russia and India and other emerging markets.

What is an array?

An array is a variablethat stores more than onepiece of related data in a single variable. Think
of an array as a box of chocolateswith slotsinside. The box representsthe arrayitself while
the spacescontaining chocolates representthe valuesstored in the arrays.

Numeric Arrays
Numeric arrays use number as access keys. An access key is a reference to a memory slot in an
array variable. The access key is used whenever we want to read or assign a new value an array
element.
Below is the syntaxfor creating numeric arrays.
$variable_name[n] = value;

<?php
//create an associative array of persons
$persons = array('Mary' => 'Female', 'John' => 'Male', 'Mirriam' => 'Female');
print_r($persons); //print all contents of persons array
echo '<br>'; //create new line
echo 'Mary is a ' . $persons['Mary']; //get mary's gender
?>

Multi-dimensional arrays
These are arraysthat contain other nested arrays. The advantage of multidimensional arrays is
that they allow us to group related datatogether.




Count function
The count functionis used to countthe numberof elementsthat an array contains.
The code
below shows the implementation.

<?php
$lecturers = array('Mr. Jones', 'Mr. Banda', 'Mrs. Smith');
echo count($lecturers); //outputs 3
?>

is_array function
The is_array functionis used to determineif a variableis an arrayor not. Let’s now look at
an example that implements the is_array functions.

<?php
$lecturers = array('Mr. Jones', 'Mr. Banda', 'Mrs. Smith');
echo is_array($lecturers);
?>

The above code outputs
1

Sort – 
this function is used to sort arrays by the values. If the values are alphanumeric, it sorts
them in alphabetical order. If the values are numeric, it sorts them in ascending order. It removes
the existing access keys and add new numeric keys. The output of this function is a numeric
array.

<?php
$persons = array('Mary' => 'Female', 'John' => 'Male', 'Mirriam' => 'Female');
sort($persons);
print_r($persons);
?>

Arrays are special variableswith the capacityto store multi values.

Arrays are flexibilityand can be easily stretchedto accommodate more values.
Numeric arraysuse numbers for the array keys
Associative arraysuse descriptive namesfor array keys
The is_arrayfunction is used to determinewhether a variableis a valid array or not.

Find Links to Any Web Site

When you browse to a web site you've never seen before, you don't have very much advance knowledge about the site. You might know that you've followed a link from a particular site that you read frequently, or you might have found the site in some search results for a certain search term. Of course, the site itself can tell you quite a bit, but that still doesn't give you any clues about where the site fits into the larger Web. With some searching at Yahoo!, you can get extra info about a site by using the special link: syntax.
If you want to find what sites are linking to any other particular site, you can browse to http://search.yahoo.com and  enter this query: link:insert URL.

 Instead of standard search results, Yahoo! will display a list of the sites that link to the URL you've specified in the query. For example, if you'd like to find out where the O'Reilly Hacks site fits into the Web, you could search for link:http://hacks.oreilly.com.
In the results, you immediately get a sense of how many pages link to the site and what kinds of sites are linking there. If you're browsing the Web, leaving a site to do a quick Yahoo! link: search can be annoying if you'd just like to get this sense about the current site you're visiting. To find the sites, you need to copy the current URL from your browser address bar, open a new window or tab, browse to Yahoo!, and then assemble the proper query. It's a quick process, but you can speed it up considerably with a bit of classic ASP and a JavaScript bookmarklet.

This hack uses JavaScript to get the URL of the current page you're viewing in your browser. From there, it passes the URL to a server-side script that assembles the proper Yahoo! query and fetches the top 10 results with Yahoo! Search Web Services. A new pop-up window will give a quick look at which sites are linking to the current page, without leaving your place.

Spider the Yahoo Catalog

Writing a spider to spider an existing spider's site may seem convoluted, but it can prove useful when you're looking for location-based services. This hack walks through creating a framework for full-site spidering, including additional filters to lessen your load.
In this hack, you'll learn how to write a spider that crawls the Yahoo! group of portals. The choice of Yahoo! was obvious; because it is one of the largest Internet portals in existence, it can serve as an ideal example of how one goes about writing a portal spider.
But before we get to the gory details of code, let's define what exactly a portal spider is. While many may argue with such a classification, I maintain that a portal spider is a script that automatically downloads all documents from a preselected range of URLs found on the portal's site or a group of sites, as is the case with Yahoo!. A portal spider's main job is to walk from one document to another, extract URLs from downloaded HTML, process said URLs, and go to another document, repeating the cycle until it runs out of URLs to visit. Once you create code that describes such basic behavior, you can add additional functionality, turning your general portal spider into a specialized one.
Although writing a script that walks from one Yahoo! page to another sounds simple, it isn't, because there is no general pattern followed by all Yahoo! sites or sections within those sites. Furthermore, Yahoo! is not a single site with a nice link layout that can be described using a simple algorithm and a classic data structure. Instead, it is a collection of well over 30 thematic sites, each with its own document layout, naming conventions, and peculiarities in page design and URL patterns. For example, if you check links to the same directory section on different Yahoo! sites, you will find that some of them begin with http://www.yahoo.com/r, some begin with http://uk.yahoo.com/r/hp/dr, and others begin with http://kr.yahoo.com.

If you try to look for patterns, you will soon find yourself writing long if/ elsif/else sections that are hard to maintain and need to be rewritten every time Yahoo! makes a small change to one of its sites. If you follow that route, you will soon discover that you need to write hundreds of lines of code to describe every kind of behavior you want to build into your spider.

This is particularly frustrating to programmers who expect to write code that uses elegant algorithms and nicely structured data. The hard truth about portals is that you cannot expect elegance and ease of spidering. Instead, prepare yourself for a lot of detective work and writing (and throwing away) chunks of code in a hit-and-miss fashion. Portal spiders are written in an organic, unstructured way, and the only rule you should follow is to keep things simple and add specific functionality only once you have the general behavior working.

Okaywith taxonomy and general advice behind us, we can get to the gist of the matter. The spider in this hack is a relatively simple tool for crawling Yahoo! sites. It makes no assumptions about the layout of the sites; in fact, it makes almost no assumptions whatsoever and can easily be adapted to other portals or even groups of portals. You can use it as a framework for writing specialized spiders.

Save the following code to a file called yspider.pl:


iPhone 5c 8GB - Llaunch

Apple is bringing its 8GB iPhone 5c to India. The 8GB variant was originally released back in March as the lowest cost current-generation iPhone option available.


The 16GB 5c currently retails in the region for 41,900 Rs., and the 8GB version in Europe is presently priced at 50 cheaper than the 16GB, which is the equivalent of 4,100 Rs. This means that the 8GB iPhone 5c could cost less than 35,000 Rs., which would be a huge selling point for Apple in India. Because of Apple's strong worldwide brand name, it is easy for them to sell their previous generation phones in regions like India and still turn a healthy profit.


 CEO Tim Cook even discussed the growth Apple has enjoyed in the Indian market: "iPhone sales grew by strong double-digits year-over-year, and in India and Vietnam sales more than doubled.

 The 8GB iPhone 5c should drop in India in the next few weeks, and expect the low-cost device to start popping up

Detecting JavaScript and Cookie Compatibility

You may be expecting a huge dump of code to see if JavaScript and cookies are enabled. There ’ s no way
that you ’ d want to go through with something like that at this point in the project, so the following
minimalist code is offered as a decent check for JavaScript compatibility:
< noscript >
You will not be able to view this site if JavaScript is not enabled.
Please turn on JavaScript to use this site.
< /noscript >

 all you need to put in your template view, and you ’ re 100 percent covered. If they don ’ t
have JavaScript turned on, they get this message. There really is no way to test to see if JavaScript is
turned on (after all, if it is off, you can ’ t run a test to see if it is on.
if (true){
//do something here, we must be on
}else{
//well shucks, JavaScript turned off, there’s no way to send an error message!
}

The  < noscript > option is very straightforward and displays just the error message. You might want to
add some branding to it, like the Claudia ’ s Kids logo, maybe a phone number or other information, but
that ’ s about as good as it gets. You could also contemplate removing the AJAX handlers from the
shopping carts, but that seems a bit much.

The same thing goes when checking for cookie support. You ’ ll need just a small bit of code that will try
to set a test cookie with a value say, the integer 1. If the site can write the cookie and retrieve it OK, then
cookies are supported. If not, display an error message.

< script >
var tcookie = new Date();
check_cookie = (tcookie.getTime() + ‘’);
document.cookie = “check_cookie=” + check_cookie + “; path=/”;
if (document.cookie.indexOf(check_cookie,0) < 0) {
alert(“You will not be able to view this site if cookies are not enabled.
Please enable them now.”);
}

< /script >

CodeIgniter system Folder

The system/ folder is where all the action happens. This folder contains all the CodeIgniter code of
consequence, organized into various folders:

application —  The   application foldercontains the application you ’ re building. Basically, this
folder contains your models, views, controllers, and other code (like helpers and class
extensions). In other words, this folder is where you ’ ll do 99 percent of your work.

cache —  The   cache foldercontains all cached pages for your application. In Chapter 9 , you learn
more about caching and how to turn your super - speedy development application into a
blazingly fast live application.

codeigniter —  The   codeigniter folderis where CodeIgniter ’ s core classes live. You have almost no
reason to go in here. All of your work will occur in the application folder. Even if your intent is
to extend the CodeIgniter core, you would do it with hooks, and hooks live in the application
folder.

database —  The   database foldercontains core database drivers and other database utilities. Again,
there ’ s no good reason for you to be in this folder.
fonts —  The   fonts foldercontains font - related information and utilities. Again, there ’ s no reason
to spend any time here.

helpers —  The   helpers foldercontains standard CodeIgniter helpers (such as date, cookie, and
URL helpers). You ’ ll make frequent use of helpers in your CodeIgniter career and can even
extend helpers thanks to improvements introduced in CodeIgniter version 1.6.

language —  The   language foldercontains language files. You can ignore it for now.

libraries —  The   libraries foldercontains standard CodeIgniter libraries (to help you with e - mail,
calendars, file uploads, and more). You can create your own libraries or extend (and even
replace) standard ones, but those will be saved in the application/libraries directory to keep
them separate from the standard CodeIgniter libraries saved in this particular folder.

logs —  The   logs folderis the folder CodeIgniter uses to write error and other logs to.


plugins —  The   plugins foldercontains plugins. Plugins and helpers are very similar, in that they
both allow developers to quickly address an issue or create content like forms, links, etc..

However, the main difference between them is that plugins usually consist of one function,
while helpers often have many functions bundled inside them.

CodeIgniter config.php

The  config.php filecontains a series of configuration options all of them stored in a PHP array called,
appropriately enough, $config) that CodeIgniter uses to keep track of your application ’ s  information
and settings.

The first configuration option you need to set inside config.php is the base URL of your application. You
do that by setting the absolute URL (including the http:// part) for $config[ ‘ base_url ’ ], like so:
$config[‘base_url’] = “http://www.example.com/test/”;

Once  you ’ ve set this configuration option, you can recall it whenever you want using the CodeIgniter
base_url()function, which can be a very handy thing to know. This one feature keeps you from
having to rewrite hard - coded URLs in your application, when you migrate from development to test or
from test to production.

The second thing you need to do is set a value for your home page by editing the $config[ ‘ index_
page ’ ]configuration option. CodeIgniter ships with a value of “ index.php ”  for  this  option,  which
means that index.php will appear in all of your URLs. Many CodeIgniter developers prefer to keep this
value blank, like so:
$config[‘index_page’] = ‘’;
To make this work, you need to include an .htaccess file to the CodeIgniter root directory, After  you ’ ve set this option value, there ’ s very little to do.
 For now, leave all the other values at their
default settings:
$config[‘uri_protocol’] = “AUTO”;
$config[‘url_suffix’] = “”;
$config[‘language’] = “english”;
$config[‘charset’] = “UTF-8”;
$config[‘enable_hooks’] = FALSE;
$config[‘subclass_prefix’] = ‘MY_’;
$config[‘permitted_uri_chars’] = ‘a-z 0-9~%.:_-’;
$config[‘enable_query_strings’] = FALSE;
$config[‘controller_trigger’] = ‘c’;
$config[‘function_trigger’] = ‘m’;
$config[‘log_threshold’] = 0;
$config[‘log_path’] = ‘’;
$config[‘log_date_format’] = ‘Y-m-d H:i:s’;


$config[‘cache_path’] = ‘’;
$config[‘encryption_key’] = “enter_a_32_character_string_here”;
$config[‘sess_cookie_name’] = ‘ci_session’;
$config[‘sess_expiration’] = 7200;
$config[‘sess_encrypt_cookie’] = TRUE;
$config[‘sess_use_database’] = FALSE;
$config[‘sess_table_name’] = ‘ci_sessions’;
$config[‘sess_match_ip’] = FALSE;
$config[‘sess_match_useragent’] = TRUE;
$config[‘cookie_prefix’] = “”;
$config[‘cookie_domain’] = “”;
$config[‘cookie_path’] = “/”;
$config[‘global_xss_filtering’] = TRUE;
$config[‘compress_output’] = FALSE;
$config[‘time_reference’] = ‘local’;
$config[‘rewrite_short_tags’] = FALSE

For more details on each of these configuration options, simply read the comments embedded in /
system/application/config/config.php. You will also get more detail on certain settings as you work
through the sections of the book and tweak the configuration as needed. For example, at some point, you
will want to use encryption for security purposes or set your logging threshold for debugging, and they
both require making changes to this file.

CodeIgniter ’ s Global XSS Filtering option is set to FALSE by default. The online User Guide suggests
that setting this to TRUE adds a lot of performance overhead to the system. However, at this point, it is
better to have some global protection put in place. That way you can be assured of some security
precautions while you ’ re in development. Chapter 9 discusses security issues in more depth, but for
now, it ’ s good to have something in place while you ’ re  developing.

In the same security vein, notice that sess_encrypt_cookie has been set to TRUE, and that you are to
enter a 32 - character encryption salt in encryption_key. Doing these two things will encrypt any
sessions and provide a salt for any hashing methods you use. Be sure to use a random string of upper -
and lowercase letters and numbers.

One final note before moving on: Make sure that you write down your encryption key and keep it safe
somewhere, or, at least, maintain good backups. You ’ ll need the key to retrieve other information, so if
your site is compromised or erased or if you lose your key any other way, you ’ ll be glad you have a
record  of  it.