Contact me at : hello[at]gauravjassal[dot]com
Previously i posted a very useful class to categorize multi-dimensional array. I wrote another one that is just an alternative for array_unique function. As you all know array_unique don’t work for multi-dimensional array. Here is the class that will do the job for you.
<?php
/**
* UniqueArray
* @package
* @author Gaurav Jassal
* @copyright http://www.gauravjassal.com
* @version 1.0
* @access public
*/
class UniqueArray
{
public $arrOriginal = array();
public $arrDummy = array();
public $strKey = "";
/**
* UniqueArray::__construct()
*
* @param $arrData Array
* @param $arrKey String
* @return
*/
public function __construct($arrData, $arrKey)
{
$this->arrOriginal = $arrData;
$this->strKey = $arrKey;
$this->arrDummy = array();
}
/**
* UniqueArray::makeTree()
*
* @return Array
*/
public function makeTree()
{
for ($i = 0; $i <= sizeof($this->arrOriginal) - 1; $i++) {
if ($this->searchKey($this->arrOriginal[$i][$this->strKey])==1) {
$this->addNode($this->arrOriginal[$i]);
}
}
return $this->arrDummy;
}
/**
* UniqueArray::searchKey()
*
* @param $strCurrentValue String
* @return
*/
function searchKey($strCurrentValue)
{
for ($i = 0; $i <= sizeof($this->arrDummy) - 1; $i++) {
if ($this->arrDummy[$i][$this->strKey] == $strCurrentValue) {
return -1;
}
}
return 1;
}
/**
* UniqueArray::addNode()
*
* @param $arrNode Array
* @return
*/
function addNode($arrNode)
{
//$this->arrDummy[sizeof($this->arrDummy)][0] = $arrNode;
array_push($this->arrDummy,$arrNode);
}
/* UniqueArray::appendNode()
*
* @param $arrNode Array
* @param $keyPosition Integer
* @return
*/
function appendNode($arrNode, $keyPosition)
{
array_push($this->arrDummy[$keyPosition], $arrNode);
}
}
?>
// Usage
require 'UniqueArray.php';
$objUArray=new UniqueArray($arData,"email");
$arrData=$objUArray->makeTree();
print_r($arrData);
Multi touch is a method of interaction with a computer screen or your smartphones like iPhone or Palm Pre. Its allows the user to interact with your device by placing one or more than one finger on the screen. The multi touch intraction have become very popular these days because of products like Apple iPhone .
Now Adobe Air 2 will also support Multi Touch to explore new techniques for interacting with software and devices with latest capabilities of Flash Platform. In multi touch there are two input mode : Gesture and touch. Gesture mode enables you to use predefined/built in gestures using GestureEvent and TransformGesture event. This includes logic for pinch, zoom, rotate, pan, two finger tap, etc. The gestures enable you to quickly and easily add gestural logic to your applications. Touch mode allows you to get access to low-level touch events using the TouchEvent class. This enables you to create custom gestures or actions for your applications.
I found one presentation by Andrew Trice from Cynergy System talking and demonstrating about Multi touch development with flex at Max 2009. It’s a 58 min presentation so sit back and watch the complete the presentations.
Here is another video of Adobe Air 2 demonstration.
I am not sure when it is going to be official released but I guess its will be early next year same time Adobe release Flash CS5. I can’t wait for it to get release I already have loads for applications in my mind. If you want to be among the first to test the public beta of AIR 2.0, all you have to do is to sign up over here.
Here’s the list of new features I found after reading some blogs online.
Myth well and truly hacked : Now flash can run on iPhone
The biggest announcement of the day at MAX was without a doubt the work they have done for the iPhone. In the not too distant future you will be able to build applications for iPhone with Flash CS5 Professional. Those applications can be distributed through Apple’s App Store. A public beta version of Flash CS5 Professional with this new capability is planned for later this year. Sign up to be notified when the beta starts.
This new capability in Flash CS5 Professional allows developers to use their preferred Flash Platform tools and technologies to develop content for a device that was previously closed to them. Because the source code and assets are reusable for applications that run on Flash Platform runtimes, Adobe AIR and Flash Player, it allows them to more easily target other mobile and desktop environments. For more information go to
http://labs.adobe.com/technologies/flashplayer10/videos/
http://blog.flashgen.com/2009/10/06/build-native-iphone-apps-with-flash-cs5/
I will post more information and post on Flash CS5 capabilities and Abobe Air 2 soon.
Beta version of Flash builder 4 and Flash catalyst is available now. I am very excited to use the new feature of both the software’s. I have seen alot of presentation on flash catalyst now its the time to use the newest tool for RIA development.
|
|
|
Flash builder and Flash catalyst can develop from Adobe lab. Here are the links and
To help you get started, we’ve created a bunch of tutorials and samples to get you going. I’ve just listed a couple of them here. For more tutorials and samples, check out the Adobe Developer Connection. Also there are two video tutorial available on Lee Brimelow’s website Flash Catalyst and Flex 4: Part 1 and Flash Catalyst and Flex 4: Part 2
Recently i was doing reading on using itemRenderer in Flex. I found it interesting and very very useful for application development. All Flex list components are derived from the ListBase class, and include the following controls: DataGrid, HorizontalList, List, Menu, TileList, and Tree.
A list control gets its data from a data provider, which is a collection of objects. For example, a Tree control reads data from a data provider to define the structure of the tree and any associated data that is assigned to each tree node.You can think of the data provider as the model, and the Flex components as the view of the model. By separating the model from the view, you can change one without changing the other. (more…)
Farata Systems, a world leader in the RIA space has open sourced their Clear Toolkit framework for developing enterprise Rich Internet Applications with Adobe Flex and Java. The latest builds and the source code of Clear Toolkit 3.1 are located at http://sourceforge.net/projects/cleartoolkit/ . The current documentation, demos, user forums, and bug trackers are also there. (more…)
When you develop a actionsction 3 component its good to compile the component to .swc file and reuse it in different projects. To create a SWC file, use the compc compiler in the flex_install_dir/bin directory. The compc compiler generates a SWC file from MXML component source files and/or ActionScript component source files.
In this example, you create a SWC file for a custom formatter component that you defined by using the following package and class definition:
package com.gauravjassal.controls.TwitterList
{
//Import base Twitter class.
import mx.controls.Label
public class TwitterList extends UIComponent{
...
}
}
You use the following compc command from the flex_install_dir/bin directory or flex_builder_director/sdks/sdkversion/bin to create the SWC file for this component:
.\compc -source-path c:\flex\wamp\www\Twitter\src\ -include-classes com.gauravjassal.controls.TwitterList -o c:\flex\wamp\www\Twitter\TwitterList.swc
Previously i posted a very useful class to categorize multi-dimensional array. I wrote another one that is just an alternative for array_unique function.
This extension notifies you with latest London underground tube updates. You can click on the browser button and check the status of any tube line.By default the extension updates the status in every 5 mins.
In the second example I am going to use Standard PHP Library (SPL) to notify all attendees about the party location change. SPL has 2 interfaces and a Class for Observer.
© 2008
Gaurav Jassal