This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <thread> | |
#include <memory> | |
#include <mutex> | |
#include <iostream> | |
#include <vector> | |
#define USE_MUTEX 1 | |
class Foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Pe(){}; | |
var len = 1000000; | |
var half = len / 2; | |
var array = []; | |
var last = new Pe(); | |
while(len--) { | |
array.push(new Pe()); | |
} | |
array.push(last); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var win = Ti.UI.createWindow(); | |
var btn = Ti.UI.createButton({ | |
title: 'click me' | |
}); | |
win.add(btn); | |
win.open(); | |
btn.addEventListener('click', function () { | |
Ti.API.info('First "click" event on the button fired!'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)loadView | |
{ | |
self.modalTransitionStyle = UIModalTransitionStyleCoverVertical; | |
UIView *view = [[UIView alloc] init]; | |
view.backgroundColor = [UIColor redColor]; | |
[view setBackgroundColor:[UIColor redColor]]; | |
[self setView:view]; | |
UIButton *dismissButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Ever wondered how to get the nice column of letters in the right side | |
* of the list view? | |
* | |
* Here is an example: | |
* 1. We take a list of names from a json file | |
* 2. We need to sort them by either first name or last name | |
* 3. We need to create a row header once in a while, when the first letter changes | |
* 4. We need to create a table index | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.pec1985.tigolf; | |
import org.appcelerator.titanium.util.TiRHelper; | |
import org.appcelerator.titanium.util.TiRHelper.ResourceNotFoundException; | |
public class RHelper { | |
public static int getString(String str){ | |
try { | |
return TiRHelper.getApplicationResource("string."+str); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var json = {"HasMore":false,"FuelStations":[{"StationId":"POIID-2011Q1_32035298","FuelPrice":[{"FuelType":1,"CapacityPrice":{"Value":4.139,"Units":"GAL","Currency":"USD"},"PriceTimestampLocal":"2013-05-10T12:17:00.000+0000","PriceTimestampGMT":"2013-05-10T19:17:34.000+0000"},{"FuelType":4,"CapacityPrice":{"Value":4.259,"Units":"GAL","Currency":"USD"},"PriceTimestampLocal":"2013-05-13T17:03:00.000+0000","PriceTimestampGMT":"2013-05-14T00:03:30.000+0000"},{"FuelType":3,"CapacityPrice":{"Value":4.159,"Units":"GAL","Currency":"USD"},"PriceTimestampLocal":"2013-05-13T17:03:00.000+0000","PriceTimestampGMT":"2013-05-14T00:03:30.000+0000"},{"FuelType":2,"CapacityPrice":{"Value":4.099,"Units":"GAL","Currency":"USD"},"PriceTimestampLocal":"2013-05-14T14:25:00.000+0000","PriceTimestampGMT":"2013-05-14T21:25:45.000+0000"}],"Brand":"76","LastUpdateTimestamp":"2013-05-16T04:06:26.000+0000","Routing":{"href":"http://fuel.si.public.devbln.europe.nokia.com/1.0/routing/calculateroute?waypoint=37.332332611083984,-122.0312194824 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Slider = require('slider'); | |
var win = Ti.UI.createWindow(); | |
var slider = Slider({ | |
left: 10, | |
right: 10, | |
height: 40 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// TiUIScrollViewProxy+Extended.h | |
// TiGoodies | |
// | |
// Created by Pedro Enrique on 4/8/13. | |
// | |
// | |
#define USE_TI_UISCROLLVIEW | |
#import "TiUIScrollViewProxy.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sample setters | |
var setters = [ | |
'currentPage' | |
, 'disableBounce' | |
, 'overScrollMode' | |
, 'overlayEnabled' | |
, 'pagingControlAlpha' | |
, 'pagingControlColor' | |
, 'pagingControlHeight' |
NewerOlder