Articles Tagged 'Snippe'


Very short snippet: a series of images stored in NSUserDefaults

ai dati dell'immagine. To store an image in NSUserDefaults is sufficient to be able to get a pointer NSData image data. In this way we could rebuild our image at any time thereafter.

In the example shown below is used an array that contains a maximum of 4 images. Each new image is put on the head and the excess removed.

Continued ...

Very short snippet: detect iPad on the device and on the Web

Not only browsers portatitli desktop or browsing the sites developed by us, now the era of mobile - the mobile browser - is widespread, thanks to devices like the Apple iPhone, Android, etc ... Furthermore, even for developers for the Apple iPhone has become mandatory to understand to which device the application is running.

On the Web, the situation is similar to that displayed in the Browser or Mobile Browser? , with the variant:

Continued ...

Very short snippet: NSURL, and various possible

Returns the name of a file from the object NSURLRequest , allowing you to decide whether or not its extension:

Continued ...

Very short snippet: get the number of posts, Page and Attachment

How many of you know, the table wp_posts is used to store the WordPress post, pages and attachments. The type of the item stored is determined by the field post_type . . With select proposed below, you can "count" individually the various types of elements in memrizzate wp_posts .

Continued ...

Very short snippet: recording an image in the Photo Album

Easy way to save an image in the photo album of the device inside of our application (or loaded from remote):

Continued ...

Very short snippet: Objective-C NSString from Selector

Objective-C is a wonderful language that allows you to do amazing things. One of the most interesting aspects is its dynamic invocation of methods (messages). You can, in fact, get the address of a message from a string.

Continued ...

Very short snippet: UIWebView, and display PDF files inside

The object UIWebView can be used to display several files. For example you can use it to display - as well as QuickTime movies or YouTube - PDF or HTML file included in our code.

Continued ...

Very short snippet: how to identify the Ajax calls in PHP

When building an Ajax Gateway, ie a file that is invoked by the object XmlHTTPRequest JavaScript, you can inadvertently create a tunnel to unwanted intrusion. Being in fact a file like the others, located on our server is reachable from the address bar of your browser.

Continued ...

Very short snippet: get the output of a URL in Objective-C

Perhaps I should write "Very very very, short snippets", however, is an excellent and convenient "trick" to show what I am. Running the "two" lines of code shown below, you can get the output of any URL and manipulate it.

Continued ...

How to select a group of tags that do not have children of a certain type

jQuery is up to version 1.4! In addition to several new features and the "usual" rewrite of the code, all documentation has been revised in a very readable than before. impostato a _blank ! But we see the issue of this post; problem: add, using jQuery, a class of all tags a possessing the attribute target set to _blank !

Continued ...