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
function count_instances_of_word_in_string( $word, $string ) { | |
$found = 0; | |
$matches = preg_match( $word, $string ); | |
return count( $matches ); | |
} | |
$paragraph = <<<EOP | |
This is some text and I expect there will be some | |
some words that appear more than once. Especially if |
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
Alt | Bar | Fri | Hun | Patrons | Price | Rain | Res | Type | Est | WillWait | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|
X1 | T | F | F | T | Some | $$$ | F | T | French | 0-10 | T | |
X2 | T | F | F | T | Full | $ | F | F | Thai | 30-60 | F | |
X3 | F | T | F | F | Some | $ | F | F | Burger | 0-10 | T | |
X4 | T | F | T | T | Full | $ | F | F | Thai | 10-30 | T | |
X5 | T | F | T | F | Full | $$$ | F | T | French | >60 | F | |
X6 | F | T | F | T | Some | $$ | F | T | Italian | 0-10 | T | |
X7 | F | T | F | F | None | $ | T | F | Burger | 0-10 | F | |
X8 | F | F | F | T | Some | $$ | T | T | Thai | 0-10 | T | |
X9 | F | T | T | F | Full | $ | T | F | Burger | >60 | F |
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
<?php | |
// depends on: | |
// | |
// benchmarkeducation/matchmaker | |
// xmarcos/dot-container | |
// from composer | |
// for convenient use of same connection to return collections |
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
(function() { | |
var Schema, User, UserSchema, app, db, express, mongoose, util; | |
util = require('util'); | |
express = require('express'); | |
mongoose = require('mongoose'); | |
app = express.createServer(); | |
db = mongoose.connect('XXX'); | |
Schema = mongoose.Schema; | |
UserSchema = new Schema({ | |
firstname: String, |
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
use curl | |
import curl/Curl | |
import io/FileWriter, structs/ArrayList | |
main: func (args: ArrayList<String>) { | |
if(args length() <= 1) { | |
printf("Usage: %s URL\n", args[0]) | |
exit(0) | |
} |
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
// in the C header : | |
struct Skt_str { | |
int skt; /* skt handle */ | |
SKTEVENT port; /* associated port */ | |
int type; /* PM_SERVER, PM_CLIENT, PM_ACCEPT */ | |
char *sktname; /* name of socket */ | |
char *hostname; /* name of host */ | |
}; |
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
import net/ServerSocket | |
main: func { | |
socket := ServerSocket new() | |
socket bind(2800). listen(10) | |
while(true) { | |
conn := socket accept() | |
"Got new client!" println() |
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
import net/ServerSocket | |
main: func { | |
socket := ServerSocket new() | |
socket bind(2800). listen(10) | |
while(true) { | |
conn := socket accept() | |
"Got new client!" println() |