Simple implementation Angular's ng-repeat behaviour.
jsfiddle#1 - just elements repeating
jsfiddle#2 - repeating with hardcodded click
jsfiddle#3 - repeating with click
| var __extends = (this && this.__extends) || function (d, b) { | |
| for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | |
| function __() { this.constructor = d; } | |
| d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | |
| }; | |
| // Enumeration to define a Person gender. | |
| var Gender; | |
| (function (Gender) { | |
| Gender[Gender["Male"] = 0] = "Male"; | |
| Gender[Gender["Female"] = 1] = "Female"; |
| const users = [ | |
| {Name: "Peter", Age: 30, Id: 1}, | |
| {Name: "Bob", Age: 20, Id: 2}, | |
| {Name: "Jack", Age: 25, Id: 3} | |
| ]; | |
| class userManager { | |
| constructor() { | |
| this.getById = (id, callback) => { | |
| let result = users.find( (u) => u.Id == id ); |
| /** | |
| * This class provides a functional to find a point inside a specific figure. | |
| * First of all you have to define a figure coordinates. | |
| * Then use an appropriate method "check( point )", which will return a result. | |
| */ | |
| class PointManager { | |
| constructor(setList) { | |
| this.setX = []; | |
| this.setY = []; |
| // ES5 | |
| var list = []; | |
| for (var i =0, len = 500000; i < len; i++) { | |
| list.push(i); | |
| } | |
| console.time("test"); | |
| repeater(20, {callback: test1, value: 499999, list: list} ); | |
| console.timeEnd("test"); |
| using System; | |
| namespace MyApplication | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| // Create a new account instance with initial amount. | |
| Account acc = new Account(500); |
| var users = [ | |
| {"FullName": "User one", "Email": "[email protected]", "Phone": "1234567890", "Id": 1}, | |
| {"FullName": "User two", "Email": "[email protected]", "Phone": "1234567890", "Id": 2}, | |
| {"FullName": "User three", "Email": "[email protected]", "Phone": "1234567890", "Id": 15}, | |
| {"FullName": "User four", "Email": "[email protected]", "Phone": "1234567890", "Id": 14}, | |
| {"FullName": "User five", "Email": "[email protected]", "Phone": "1234567890", "Id": 12}, | |
| {"FullName": "User six", "Email": "[email protected]", "Phone": "1234567890", "Id": 8}, | |
| {"FullName": "User seven", "Email": "[email protected]", "Phone": "1234567890", "Id": 16}, | |
| {"FullName": "User eight", "Email": "[email protected]", "Phone": "1234567890", "Id": 9}, | |
| {"FullName": "User nine", "Email": "[email protected]", "Phone": "1234567890", "Id": 25}, |
Simple implementation Angular's ng-repeat behaviour.
jsfiddle#1 - just elements repeating
jsfiddle#2 - repeating with hardcodded click
jsfiddle#3 - repeating with click
Used languages: JavaScript, C#.
Number: 93.
Message block which provides a basic "sms-message" functionality via HTML.
See jsfiddle
| using System; | |
| using System.Linq; | |
| using System.Collections.Generic; | |
| namespace Program { | |
| public static void Man(string[] args) { | |
| Random rnd = new Random(); | |
| Dictionary<string, long> dic = new Dictionary<string, long>() { }; |