Skip to content

Instantly share code, notes, and snippets.

@amygdala
amygdala / Model.php
Last active December 31, 2015 04:59
<?php
/**
* Model.php - Basic base class for Cloud DataStore Objects.
*/
require_once 'DatastoreService.php';
abstract class Model {
// See https://developers.google.com/datastore/docs/concepts/#Datastore_Kinds_keys_and_identifiers
@amygdala
amygdala / DatastoreService.php
Last active December 31, 2015 04:59
Supports using the Google Cloud Datastore from PHP App Engine apps. This is a wrapper around the Google_DatastoreService class from https://github.com/google/google-api-php-client
<?php
/**
* Wrapper around the Google_DatastoreService class.
*/
// Assumes v1 of client libs: https://github.com/google/google-api-php-client
// 1.0-alpha paths
require_once 'Google/Client.php';
require_once 'Google/Auth/AssertionCredentials.php';
require_once 'Google/Service/Datastore.php';
package com.inferdata.examples.simplethread;
public class MainObj implements Runnable {
private int finished_actions;
public void run() {
System.out.println("starting secondary threads...");
new Thread(new SecondaryThread(this, "action 1")).start();
new Thread(new SecondaryThread(this, "action 2")).start();
package com.inferdata.hadoop;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.conf.*;
import org.apache.hadoop.io.*;
//import org.apache.hadoop.mapred.lib.IdentityReducer;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
package com.inferdata.hadoop;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.conf.*;
import org.apache.hadoop.io.*;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;