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
/** | |
* Example used for "Geographic Data with MongoDB" article at Orlando Data Science. | |
* Url: http://orlandods.com/geo-locational-data-mongodb/ | |
* Author: Pori | |
*/ | |
var db = new Mongo().getDB('geodb'); | |
db.places.drop(); // Remove leftover points from previous examples. |
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
def first_function(): | |
print "Hello all!" | |
fisrt_function() | |
def what_is_my_name(name): | |
print "My name is " + name | |
#what_is_my_name("Alex") |
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 java.io.*; | |
import java.net.*; | |
import java.util.Scanner; | |
class UDPServer | |
{ | |
public static void main(String args[]) throws Exception | |
{ | |
Scanner in = new Scanner(System.in); | |
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 java.util.Hashtable; | |
import java.util.Set; | |
public class HashtableExample { | |
public static void main(String[] args) { | |
Hashtable<String, Integer> ages = new Hashtable<String, Integer>(); | |
ages.put("Pori", 21); | |
ages.put("Octocat", 6); | |
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 java.util.Arrays; | |
public class Quicksort { | |
public static void main(String[] args) { | |
int[] set = { 3, 6, 1, 5, 12, 10 }; | |
System.out.println("Before: " + Arrays.toString(set)); | |
Quicksort.sort(set); | |
System.out.println("After: " + Arrays.toString(set)); |
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 java.util.Arrays; | |
public class Mergesort { | |
public static void main(String[] args) { | |
int[] set = { 3, 6, 1, 5, 12, 10 }; | |
System.out.println("Before: " + Arrays.toString(set)); | |
Mergesort.sort(set); | |
System.out.println("After: " + Arrays.toString(set)); | |
} |
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 java.util.Arrays; | |
public class DepthFirstSearch { | |
public static void main(String[] args) { | |
int[][] graph = { | |
{ 0, 1, 2 }, | |
{ 0, 1, 2 }, | |
{ 0, 1, 2 }, | |
}; | |
boolean[] found = new boolean[ graph[0].length ]; |
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 java.util.Queue; | |
import java.util.List; | |
import java.util.LinkedList; | |
import java.util.ArrayList; | |
public class BreadthFirstSearch { | |
public static void main(String args[]) { | |
int[][] graph = { | |
{ 0, 1, 2 }, | |
{ 0, 1, 2 }, |
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
#include <stdio.h> | |
void swap(int * set, int i, int j); | |
int main() { | |
int set[] = { 1, 2 }; | |
swap(set, 0, 1); | |
printf("{ %d, %d }\n", set[0], set[1]); |
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
{ | |
"name": "some-api", | |
"version": "1.0.0", | |
"description": "Some api description.", | |
"dependencies": { | |
"express": "~4.10", | |
"body-parser": "1.x", | |
"multer": "~0.1.7", | |
"passport": "0.2.1", | |
"passport-http": "0.2.2", |
OlderNewer