Thursday, May 21, 2015

Making a round lable

//width and height are twice of  layer.cornerRadius

label.frame = CGRectMake(0, 0, 100, 100);
label.center = CGPointMake(160, 240);
label.alpha = 0.0;
   
  label.layer.cornerRadius = 50;
  label.clipsToBounds = YES;

Tuesday, April 7, 2015

Composite pattern

A design pattern that solves this kind of structural problem is
called the Composite patternWith the Composite pattern,  we can compose our strokes and dots into a tree structure
so that we can treat each of the nodes uniformly.

Friday, April 3, 2015

Observation Pattern in Objective-C

There are three steps to using key-value observation:

Send the addObserver:forKeyPath:options:context: message
to each object that is being observed.

Override the method observeValueForKeyPath:ofObject:chan
ge:content: in the class definition of the object that is doing the
observing.

Override the dealloc method and remove the observer reference

in the class definition of the object that is observing.

Thursday, February 12, 2015

The following are some high-level, conceptual questions to develop of Axure

• How is information organized and accessed on each screen in the case of Information Architecture?
• Where and how are key task flows initiated and ended?
• What are the main navigation systems?
• What common elements are shared across screens?
• How are common elements affected by a device size?

Tuesday, November 4, 2014

Xampp version on Windows



Add this line to xampp\phpmyadmin\config.inc.php

$cfg['ExecTimeLimit'] = 6000;

And Change xampp\php\php.ini to

post_max_size = 750M

upload_max_filesize = 750M

max_execution_time = 5000

max_input_time = 5000

memory_limit = 1000M

And change xampp\mysql\bin\my.ini

max_allowed_packet = 200M

Tuesday, September 2, 2014

Choosing a data format for Javascript

HTML snippets require very little work to implement. The external data can be loaded
and inserted into the page with one simple method that does not even require a
callback function. No traversal of the data is necessary for the straightforward task
of adding the new HTML into the existing page. On the other hand, the data is not
necessarily structured in a way that makes it reusable for other applications. The
external file is tightly coupled with its intended container.

JSON files are structured for simple reuse. They are compact and easy to read. The
data structure must be traversed to pull out the information and present it on the
page, but this can be done with standard JavaScript techniques. Since modern
browsers parse the files natively with a single call to JSON.parse(), reading in a
JSON file is extremely fast. Errors in the JSON file can cause silent failure or even
side effects on the page, so the data must be crafted carefully by a trusted party.

JavaScript files offer the ultimate in flexibility, but are not really a data storage
mechanism. Since the files are language-specific, they cannot be used to provide
the same information to disparate systems. Instead, the ability to load a JavaScript
file means that behaviors that are rarely needed can be factored out into external
files, reducing code size unless and until it is needed.

While XML has fallen out of favor in the JavaScript community, with most developers
preferring JSON, it is still so common that providing data in this format makes it very
likely that the data can be reused elsewhere. Indeed, many web services, such as Yahoo
Weather (http://developer.yahoo.com/weather/), export XML representations
of their data, which has allowed many interesting mashups of their data to arise. The
XML format is somewhat bulky, and can be a bit slower to parse and manipulate than
other options.

Tuesday, August 26, 2014

fadeIn() VS slideDown

The fading animations are very useful for items that are outside the flow of the
document. For example, these are typical effects to apply to "lightbox" elements
that are overlaid on the page. However, when an element is part of the document
flow, calling .fadeIn() on it causes the document to jump to provide the real estate
needed for the new element, which is not always aesthetically pleasing.