Write a program in any language of your choice that has a function that sorts the json data by Name in alphabetical order and Age and returns the result.
E.g.
function sortData(arr) {
// ... do stuff to sort the array
return arr;
}
Write a program in any language of your choice that has a function that sorts the json data by Name in alphabetical order and Age and returns the result.
E.g.
function sortData(arr) {
// ... do stuff to sort the array
return arr;
}
var FriendsContainer = React.createClass({ | |
getInitialState: function(){ | |
alert('In getInitialState'); | |
return { | |
name: 'Tyler McGinnis' | |
} | |
}, | |
// Invoked once before first render | |
componentWillMount: function(){ | |
// Calling setState here does not cause a re-render |
From http://www.nigeria-law.org/ConstitutionOfTheFederalRepublicOfNigeria.htm
array.prototype.js
in your consolescraper.js
in your console. It shoulkd return an array which contains the information on the page.<?php | |
function cast($object, $class) { | |
if( !is_object($object) ) | |
throw new InvalidArgumentException('$object must be an object.'); | |
if( !is_string($class) ) | |
throw new InvalidArgumentException('$class must be a string.'); | |
if( !class_exists($class) ) | |
throw new InvalidArgumentException(sprintf('Unknown class: %s.', $class)); | |
$ret = app($class); |
using System; | |
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
using System.Net; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Diagnostics; | |
using Newtonsoft.Json; | |
using System.Text; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
# to be placed in ./bootsrc/sources of https://github.com/simple-lang/simple | |
program_NAME := simple | |
program_C_SRCS := $(wildcard *.c) | |
program_CXX_SRCS := $(wildcard *.cpp) | |
program_C_OBJS := ${program_C_SRCS:.c=.o} | |
program_CXX_OBJS := ${program_CXX_SRCS:.cpp=.o} | |
program_OBJS := $(program_C_OBJS) $(program_CXX_OBJS) | |
program_INCLUDE_DIRS := | |
program_LIBRARY_DIRS := |
const express = require('express') | |
const isPrime = require('./is-prime') | |
const app = express() | |
app.get('/', (req, res) => { | |
const primes = [] | |
const max = Number(req.query.max) || 1000 | |
for (let i = 1; i <= max; i++) { | |
if (isPrime(i)) primes.push(i) | |
} |
const cluster = require('cluster') | |
const os = require('os') | |
const express = require('express') | |
const isPrime = require('./is-prime') | |
if (cluster.isMaster) { | |
const cpuCount = os.cpus().length | |
for (let i = 0; i < cpuCount; i++) { | |
cluster.fork() | |
} |