This file contains hidden or 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
| struct PersonalInformation { | |
| var name: String | |
| var address: String | |
| var dateOfBirth: NSDate | |
| var age: Int { | |
| get { | |
| var today = NSDate() | |
| var aTimeInterval = | |
| today.timeIntervalSinceDate(dateOfBirth) |
This file contains hidden or 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
| class Employee: Equatable, Hashable { | |
| var ID: Int | |
| var personalInformation: PersonalInformation | |
| var wage: Double | |
| init(ID: Int, personalInformation: PersonalInformation, wage: Double) { | |
| self.ID = ID | |
| self.personalInformation = personalInformation | |
| self.wage = wage | |
| } |
This file contains hidden or 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 osName = string.Empty; | |
| if (Device.OS == TargetPlatform.iOS) | |
| osName = "Hola iOS!"; | |
| if (Device.OS == TargetPlatform.Android) | |
| osName = "Hola Droid!"; | |
| if (Device.OS == TargetPlatform.WinPhone) | |
| osName = "Hola WinPhone!"; |
This file contains hidden or 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 loginPage = new ContentPage { | |
| Title = "Profile", | |
| Icon = "Profile.png", | |
| Content = new StackLayout { | |
| Spacing = 20, Padding = 50, VerticalOptions = LayoutOptions.Center, | |
| Children = { | |
| new Entry { Placeholder = "Username" }, | |
| new Entry { Placeholder = "Password", IsPassword = true }, | |
| new Button { | |
| Text = "Login", |
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using MonoTouch.Foundation; | |
| using MonoTouch.UIKit; | |
| using Xamarin.Forms; | |
| namespace SG.iOS { | |
| [Register("AppDelegate")] | |
| public partial class AppDelegate : UIApplicationDelegate { |
This file contains hidden or 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
| using System; | |
| using Android.App; | |
| using Android.Content.PM; | |
| using Android.Runtime; | |
| using Android.Views; | |
| using Android.Widget; | |
| using Android.OS; | |
| using Xamarin.Forms.Platform.Android; | |
| namespace SG.Droid { |
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using Xamarin.Forms; | |
| namespace SG { | |
| public class App { | |
| public static Page GetMainPage() { | |
| return new ContentPage { |
This file contains hidden or 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
| nodoptr = ^nodo; //el apuntador del nodo apunta a un nodo | |
| nodo = record //esta es la definición del nodo | |
| algúndato: string; //palabra a guardar | |
| izquierda, derecha: nodoptr; | |
| end; |
This file contains hidden or 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
| // El evento se notifica cuando Entero cambia | |
| void event IntEvento { | |
| // variables de contexto | |
| int x,y; | |
| // Contrato translúcido. Iniciamos con precondición. | |
| requires x < 25 && y < 120 | |
| assumes { | |
| next.invoke(); | |
| establishes next.x() == old(next.x()); | |
| } |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Space Canvas</title> | |
| </head> | |
| <body> | |
| <h1>Juego de nave espacial con Canvas</h1> | |
| <canvas id="spaceCanvas" width="300" height="300"> | |
| </canvas> | |
| </body> |