Is This The Future of Touchscreen Tech? New Video Will Blow Your Mind


Gorilla Glass manufacturer Corning has unveiled a follow-up YouTube video to its wildly successful “A Day Made of Glass,” providing another look into what the future could be like with the growth of glass touchscreen interfaces, from innovative chalkboards and activity tables in classrooms to uses for it in hospitals.

Corning released two versions of “A Day Made of Glass 2″ — one with a narrator and another, abbreviated version without commentary — the video follows the life of young Amy and her family as they go through their day using various products made of glass. Amy does classwork on a glass tablet, controls the temperature of the car from the backseat and even attends a field trip at the Redwood Forrest with an interactive signage that brings learning to life. Her teacher also works with students on interactive touchscreen activity tables. Corning expects these activity tables to be rolled out in the near future.

Last year’s video, which followed the same family, brought in over 17 million hits on YouTube and left many in awe of Corning’s interpretation of what’s possible with photovoltaic glass, LCD TV glass, architectural display and surface glass, among others.

However, many left comments on YouTube asking which technology is actually possible with today’s resources and pricing. This time around, though, new technologies and applications are highlighted, such as glass tablets, multitouch-enabled desks, solar panels, augmented reality, electronic medical records and anti-microbial medical equipment.

Corning may be making headlines these days for its Gorilla Glass product — a super-strong, lightweight glass which can withstand drops and mistreatment — but it’s hardly a new company and no stranger to innovation. In fact, the 160-year-old business even worked with Thomas Edison to create inexpensive glass for his lightbulbs.

However, Corning noted at the press screening that there are several challenges the company is facing this year, largely due to lower LCD glass prices, higher corporate tax rates and declining equity earnings, which have combined to lower Corning’s profitability.

Although LCD glass sales are likely to be flat through 2014, the company said it will remain profitable and continue to generate large amounts of cash. Last week, Corning announced that it raked in record 2011 sales of $7.9 billion and plans to grow sales to $10 billion by 2014.

The company also recently announced that it is joining forces with Samsung Mobile to manufacture Lotus Glass for Galaxy-branded smartphones and Super OLED TVs. Corning’s ultra-slim, eco-friendly Lotus Glass is known for strong performance and withstanding higher-processing temperatures.

Although Corning’s first “A Day Made of Glass” video was unveiled a week ago this year, Corning’s vice chairman and CFO James Flaws told Mashable that he couldn’t comment on whether or not the clips will become an annual tradition.

40+ Must-Bookmark PHP Classes & Libraries For Developing Faster


BackPress

A complete library, that grew from WordPress, which offers the most common tasks for creating web applications like user management, HTTP transactions, logging, formatting and more.

PHP User Class

The class aims to ease the handling of user management tasks like registration, login, logout, etc. for PHP-MySQL applications.

 

phpSEO

Do you want to automate the process of generating keywords or meta tags from the content? This is what  phpSEO does.

It can create any desired number of keywords from a given string or URL, generate a description and does all with not using any banned words you define.

PHP Typography

PHP class for improving web typography with features like hyphenation, spacing control, wrapping of long text, character replacement for items like ordinal suffixes, trademark or math symbols and more.

Tag Cloud

The class creates tag clouds from a given array of items where each tag can have its own color, URL and style.

 

Handling Documents


PHPExcel

A set of PHP classes for writing to and reading from different file formats, like Excel, PDF and HTML.

It supports many MS Excel features like adding worksheets to a spreadsheet, inserting data and formulas to cells, calculating formulas and much more.

PHPPowerpoint

Set of classes for reading and writing to Powerpoint documents and supports adding slides, rotating images and more.

TCPDF

A complete PHP PDF class with features like custom page formats or margins, support for images and automatic page header/footer management.

It can also handle document encryption, PDF annotations, bookmarks and table of content.

FPDF

A PDF generator class with flexible page format and margins support. It can automatically arrange page breaks and can insert images into documents.

ZipStream

Compared to many PHP zipping libraries, this class does not require  “writable temp directory” and can generate + start the download after the client timeouts (good for huge files).

 

File Uploads, Images & Colors


EasyUp

A clean and simple PHP file upload class which can also delete the file uploaded and get the size + filename of it

class.upload.php

PHP class for manipulating and uploading image files on-the-fly.

It can convert, resize and work on uploaded images in many ways: add labels, watermarks and reflections.

Image Resizing Made Easy with PHP

A PHP class which can open, resize (smart resizing with no distortion) and save a number of images in multiple formats.

It is explained very well with a detailed tutorial.

WideImage

A feature-rich PHP library for image manipulations by providing a simple way to loading and saving images from/to files, strings, database, uploads and URL addresses.

You can apply filters, get channels, merge, resize, crop or rotate images using the library.

Asido

A powerful PHP image processor with features like resize, rotate, watermak, frame, convert, rotate, crop and much more.

xColor

An impressive class to make various calculations on colors like converting between formats (HEX,RGB,HSL/HSV), getting the end color when a color is added to or removed from a pallette and more.

Google Analytics PHP Example


<?php

// include the GAPI class from http://code.google.com/p/gapi-google-analytics-php-interface/
require_once 'gapi.class.php';

// login details for the account that has access to analytics reports.
define('ga_web_email', 'you@email.com');
define('ga_web_pass', 'password');

// use our caching function above to get some results in a nice array
// change 123456789 to your google analytics id.
$data = get_analytics_data('123456789',array('date'),array('newVisits','visits'));
// output the image:
output_image($data);

function get_analytics_data(
		$profile_id,
		$dimensions=array('browser'),
		$metrics=array('pageviews','visits','UniquePageviews'),
		$sort=null,
		$start_date=null,
		$end_date=null
	){
	$cache_id = md5(serialize(func_get_args()));
	$return = false;
	// check if the cache item exists.
	$temp_folder = '/tmp/ga/';
	if(!is_dir($temp_folder))mkdir($temp_folder);
	$filename = $temp_folder.$cache_id;
	if(is_file($filename)){ // if cache entry exists
		if(filemtime($filename) > (time() - 172800)){ // check if it's older than 2 days
			$return = unserialize(file_get_contents($filename)); // grab the cached content.
		}
	}
	if(!$return){
		// no cache item found, so we grab it via gapi class.
		$ga = new gapi(ga_web_email,ga_web_pass);
		if(!$sort)$sort = current($dimensions);
		ini_set('display_errors',true);
		$ga->requestReportData($profile_id,$dimensions,$metrics,$sort,null,$start_date,$end_date,null,100);
		$return = array();
		$return['data'] = array();
		foreach($ga->getResults() as $result){
			$data = array();
			foreach($dimensions as $d){
				$data[$d] = (string)$result;
				foreach($metrics as $m){
					$data[$m] = $result->{'get'.$m}();
				}
			}
			$return['data'][] = $data;
		}
		$return['total'] = $ga->getTotalResults();
		foreach($metrics as $m){
			$return[$m] = $ga->{'get'.$m}();
		}
		$return['timestamp'] =  $ga->getUpdated();
	}
	// save cache item.
	file_put_contents($filename,serialize($return));
	return $return;
}

function output_image($data){
	$max_y = 500;
	$width = 640;
	$height = 200;
	$attr=array();
	$days = count($data['data'])-1;
	// work out the width of 1 day
	$day_width_percent = round((100 / $days)/100,4); // 15% will be 0.15  1% will be 0.01
	$half_day_width = round($day_width_percent/2,4);
	$attr['chxl'] = '1:'; // the data point label text.
	$attr['chxp'] = '1'; // the data point label positions.
	$attr['chxr'] = '0,0,'.$max_y.'|1,0,'.$days; // the min/max data range to graph over the space of the image.
	$attr['chxt'] = 'y,x'; // ?
	$attr['chs'] = $width.'x'.$height; // width x height of the image.
	$attr['cht'] = 'lc'; // type of graph
	$attr['chco'] = '3D7930,FF9900'; // colors of the graph lines.
	$attr['chds'] = '0,'.$max_y.',0,'.$max_y.''; // data range of each data set (0 to 500 each)
	$attr['chdl'] = 'Visits|New Visits'; // labels for each data set
	$attr['chg'] =  (100/$days) . ',' . ((100/$max_y)*100) . ',4,1,-'.($half_day_width*100).',0'; // (vert,horiz) how many step lines.
	$attr['chls'] = '2,4,0|1'; // ?something about size of lines maybe?
	$attr['chtt'] = 'Visits vs New Visits over past '.$data['total'].' days.'; // graph label at the top.
	// graph stripes. every saturday and sunday ?
	// work out what day the graph starts on.
	$first = current($data['data']);
	$start_day = date('N',strtotime($first['date']));
	// how big is the first bar?
	// highlight white from first bar to first Saturday (6)
	$attr['chf'] = 'c,ls,0';
	$number_of_days = 6 - $start_day;
	if($number_of_days>0){
		// we start with a white bar, because we're starting graph during the week.
		$color='FFFFFF';
		$attr['chf'] .= ','.$color.','.(round($number_of_days*$day_width_percent,5)-$half_day_width);
	}else{
		// we're starting graph on a saturday or sunday.
		$color='EFEFEF';
		$attr['chf'] .= ','.$color.','.(round((8-6)*$day_width_percent,5)-$half_day_width);
		// then we do 5 days white.
		$attr['chf'] .= ',FFFFFF,'.round(5*$day_width_percent,5);
	}
	// loop over for the remaining days, every 7 days different colour.
	for($x=0;$x<=$days;$x+=7){
		// we're doing 2 days dark for weekend.
		$attr['chf'] .= ',EFEFEF,'.round(2*$day_width_percent,5);
		// we're doing 5 days white.
		$attr['chf'] .= ',FFFFFF,'.round(5*$day_width_percent,5);
	}

	$p = $start_day;

	$x=0;
	$points1 = $points2 = '';
	foreach($data['data'] as $d){
		if($p%7==1){
			// every monday put a date.
			$attr['chxl'] .= '|Mon' . date('jM',strtotime($d['date']));
			$attr['chxp'] .= ',' . $x;
		}
		$points1 .= $d['visits'].',';
		$points2 .= $d['newVisits'].',';
		$x++;
		$p++;
	}

	$attr['chd'] = 't:' . rtrim($points1,',') . '|' . rtrim($points2,',');
	?>
	<img src="http://chart.apis.google.com/chart?<?php foreach($attr as $k=>$v) echo $k .'='.urlencode($v).'&
	';?>" width="<?php echo $width;?>"
		 height="<?php echo $height;?>" alt="<?php echo $attr['chtt'];?>" />
<?php
}
?>

Commerce for jewelry makers.


Over the past 3 years, I have been developing applications for the jewelry industry for the likes of Tacori and ArtCarved. I have learned alot about how the industry works and understanding the issues the jewelry industry as a whole faces. Interestingly, its the same issues that many corporations are also struggling with.

The same questions seem to popup wether I am in a boardroom or the corner jeweler… Should I use HTML5 or native?, I have alot of images, how do I deliver them?, on-line or off-line viewing?.

Too keep my skills up-to-date, I pick a project at the beginning of each year to try and solve in a rising industry. Last year, I worked on a video project that landed me a contract working on the Xfinity iPad application. This year, I am working on a native mobile shopping solutions for the jewelry industry.

Stay tuned for more details…

NULL or nil?


In Cocoa both of them are typedef to zero. nil is an object pointer, whereas NULL is a c pointer.  If you want to set char * to 0 then you would set it to NULL and if you want to set a view controller to 0 then you would set it to nil. Cocoa also gives us another typedef  called “Nil” (notice the case) which is class pointer. Now you know when to use the correct null pointer.

Dietville Launches!


A Diet You’ll Want to Stick With
DietVille is a world that takes you away from the daily grind and submerses you into a place where weight loss is fun. Receive a personalized meal plan. Log food and exercise in the extensive databases. Make Buddies to keep you motivated. And accomplish goals to earn DietVille Coins to go shopping at the DietVille Mall to decorate your Avatar and DietVille Home.Lean More… Longer Description.Wish the games you played had real world benefits? Tried dieting in the past and dreaded it? Well, here’s your solution: DietVille is a free social weight loss game where you can virtually watch the pounds slip away all while having fun. Yes, that’s right. We’ve made dieting into an addictive game.

We’ve taken what works in weight loss and brought it to you in a nontraditional, virtual and, most importantly, effective formant. By logging your food and exercises in our extensive databases, keeping in touch with your DietVille Buddies, accepting weight loss challenges and losing some pounds, you’ll receive virtual Coins and Dollars to decorate your DietVille Home and advance to different levels in the game. And that’s just the beginning.

It’s effective, addictive and fun. Stay entertained. Stay connected. Stay on track. And change the way you look…at everything.

Key Features:

AVATAR: When you lose weight, your Avatar will too, so create a virtual, mini you.

NUTRITION PLAN: We do the hard work for you with a personalized nutritional plan.

DIARY: With over 100,000 foods and over 250 different exercises to search, it will be easy to track your foods and weight loss progress.

TRAINER: Choose from six different virtual DietVille Trainers to help keep you motivated.

DIETVILLE MALL: When you start losing weight, use coins and dollars you’ve earned through the game to shop in the DietVille Mall and other stores to dress your Avatar when its old clothes are too loose.

CHALLENGES: Gladiators meets The Biggest Loser. Challenge a DietVille Buddy or be challenged to a friendly competition to keep you motivated and earn DietVille Coins.

Download iPhone app : DietVille
Facebook: Facebook

change text color in table view using # iphone


- (UIColor *) getColor: (NSString *) hexColor//method for converting hexadecimal into colors.
    {
        unsigned int red, green, blue;//declaring colors of unsigned int type.

        NSRange range;//range

        range.length = 2;//length of range.

        range.location = 0; //location of range.

        [[NSScanner scannerWithString:[hexColor substringWithRange:range]] scanHexInt:&red];//scannig red color.

        range.location = 2;//location of red.

        [[NSScanner scannerWithString:[hexColor substringWithRange:range]] scanHexInt:&green];//scanning green color.

        range.location = 4;//location of green.

        [[NSScanner scannerWithString:[hexColor substringWithRange:range]] scanHexInt:&blue];//scanning blue color. 

        return [UIColor colorWithRed:(float)(red/255.0f) green:(float)(green/255.0f) blue:(float)(blue/255.0f) alpha:1.0f];//returning customized colors.
    }

Calling methods between view controllers using Storyboard


MapViewController *mapView = [self.storyboard instantiateViewControllerWithIdentifier:@"MapView"];

(“MapView” is the identifier i set for that scene/view in storyboard)

and i just tested the old way and it works for me:

mapViewController *mapView = [[mapViewController alloc] initWithNibName:@"mapViewController" bundle:[NSBundle mainBundle]];

i can call methods in MapViewController directly, aka

[mapView testMethod];

how to create tweetbots popup in UITableViewCell


The best way to do this is to add a dummy cell below the cell that was tapped.

First you need to keep track of what cell is been tapped and act accordingly.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

    //if user tapped the same row twice let's start getting rid of the control cell
    if([indexPath isEqual:self.tappedIndexPath]){
        [tableView deselectRowAtIndexPath:indexPath animated:NO];
    }

    //update the indexpath if needed... I explain this below 
    indexPath = [self modelIndexPathforIndexPath:indexPath];

    //pointer to delete the control cell
    NSIndexPath *indexPathToDelete = self.controlRowIndexPath;

    //if in fact I tapped the same row twice lets clear our tapping trackers 
    if([indexPath isEqual:self.tappedIndexPath]){
        self.tappedIndexPath = nil;
        self.controlRowIndexPath = nil;
    }
    //otherwise let's update them appropriately 
    else{
        self.tappedIndexPath = indexPath; //the row the user just tapped. 
        //Now I set the location of where I need to add the dummy cell 
        self.controlRowIndexPath = [NSIndexPath indexPathForRow:indexPath.row + 1   inSection:indexPath.section];
    }

    //all logic is done, lets start updating the table
    [tableView beginUpdates];

    //lets delete the control cell, either the user tapped the same row twice or tapped another row
    if(indexPathToDelete){
        [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPathToDelete] 
                          withRowAnimation:UITableViewRowAnimationNone];
    }
    //lets add the new control cell in the right place 
    if(self.controlRowIndexPath){
        [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:self.controlRowIndexPath] 
                          withRowAnimation:UITableViewRowAnimationNone];
    }

    //and we are done... 
    [tableView endUpdates];  
} 

Whenever you have that dummy cell present you have to make sure to send the correct count.

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if(self.controlRowIndexPath){
        return modelArray.count + 1;
    }
    return self.modelArray.count;
}

Also, return the appropriate height for your ControlCell.

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath   *)indexPath 
{
    if([indexPath isEqual:self.controlRowIndexPath]){
        return 45; //height for control cell
    }
    return 70; //height for every other cell 
}

Lastly, remember the control cell is a dummy. Is not part of the model, thus you have to account for that. If the user taps a row that is above the last tapped row is ok but when the new tapped row is below that control cell you have to make sure you access the right row in your model. In other words, account for that fake cell in the middle of your view.

- (NSIndexPath *)modelIndexPathforIndexPath:(NSIndexPath *)indexPath
{
    int whereIsTheControlRow = self.controlRowIndexPath.row;
    if(self.controlRowIndexPath != nil && indexPath.row > whereIsTheControlRow)
        return [NSIndexPath indexPathForRow:indexPath.row - 1 inSection:0]; 
    return indexPath;
}

You can turn off ARC with some files.


For anyone still curious about how to turn off ARC on individual files, here’s what I did:

  1. Go to your project settings, under Build Phases > Compile Sources
  2. Select the files you want ARC disabled and add -fno-objc-arc compiler flags. You can set flags for multiple files in one shot by selecting the files then hitting “Enter” key.
Follow

Get every new post delivered to your Inbox.

Join 515 other followers