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
public override void ViewDidLoad () | |
{ | |
base.ViewDidLoad (); | |
var list = new List<CategoryModel>(); | |
var table = new UITableView (new RectangleF (0, 0, View.Bounds.Width, View.Bounds.Height)); | |
View.Add (table); | |
try{ | |
var request = WebRequest.Create("http://api.bbcnews.appengine.co.uk/topics"); | |
var response = request.GetResponse (); | |
using(var stream = new StreamReader(response.GetResponseStream())){ |
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
public class CategoryTableSource: UITableViewSource | |
{ | |
CategoryModel[] _category; | |
UINavigationController _controller; | |
public CategoryTableSource (CategoryModel[] category, UINavigationController controller) | |
{ | |
_category = category; | |
_controller = controller; | |
} |
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 rootController = new UINavigationController (); | |
rootController.PushViewController (new CategoryController (), false); | |
window.RootViewController = rootController; |
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
{ | |
"Tables":[ | |
{ | |
"Name": "users", | |
"Fields": [ | |
{"Name": "ID", "Type": "integer", "NotNull": true, "PrimaryKey":true, "Identity":true}, | |
{"Name": "UserEmail", "Type": "nvarchar(256)", "Unique":true}, | |
{"Name": "Password", "Type": "nvarchar(64)"}, | |
{"Name": "Token", "Type": "uniqueidentifier"} | |
] |
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
public bool Auth | |
{ | |
get | |
{ | |
if ( HttpContext .Current.Request.Cookies["auth" ] == null ) return false ; | |
DatabaseManager manager; | |
if ( ConfigurationManager .AppSettings["Provider" ] == "MSSQL" ) | |
{ | |
var builder = new SqlConnectionStringBuilder (ConfigurationManager .ConnectionStrings[ "DBConnection"].ConnectionString); |
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 parameters = new Array(); | |
parameters.push({ Name: 'login', Value: login }); | |
parameters.push({ Name: 'password' , Value: hex_md5(password) }); | |
DBManager.runQuery( 'spLogin', parameters, function(result){ | |
if (result.length > 0) { | |
userId = result[0].Token; | |
$.cookie( 'auth', userId); | |
$.cookie( 'userId', result[0].ID); | |
window.location.hash = '/tasks'; | |
} |
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
DBManager.runQuery( 'spListTasks', [{ Name: "userId" , Value: id}], callback); |
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 parameters = new Array(); | |
parameters.push({ Name: 'task', Value: task }); | |
parameters.push({ Name: 'dueDate', Value: null }); | |
parameters.push({ Name: 'userId', Value: userId }); | |
parameters.push({ Name: 'done', Value: false }); | |
DBManager.runQuery( 'spAddTask' , parameters, callback); |
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 width = window.innerWidth, height = window.innerHeight; | |
var view_angle=45, aspect = width/height, near = 0.1, far=1000; | |
var container = $('#container'); | |
var renderer = new THREE.WebGLRenderer(); | |
var camera = new THREE.PerspectiveCamera(view_angle, aspect, near, far); | |
var scene = new THREE.Scene(); | |
scene.add(camera); | |
camera.position.z = 200; |
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 cubeGeometry = new THREE.CubeGeometry(50,50,50); | |
var cubeMaterial = new THREE.MeshBasicMaterial({color: 0xff0000}); | |
var cube = new THREE.Mesh(cubeGeometry, cubeMaterial); | |
scene.add(cube); |
OlderNewer