Skip to content

Instantly share code, notes, and snippets.

class Question:
def __init__(self, q, a):
self.question = q
self.answer = a
# 34 Quetsions
questions = [
Question("Zapatisa Army of National Liberation", "Group who declared war against the Mexican state in 1994. They are mostly supported by native South Americans, there view point is anti-gloablizm"),
Question("PRI", "Main political party that was in power for most of the 20th century after its creation in 1929 formed by Calles. Its ideas are historically nationalism, and social democracy"),
Question("Plan de Ayala", "Created by the revolutionary leader Emiliano Zapata. Denounced Madero for betraying the revolutionary ideals. Reform, Freedom, Justice and Law!"),
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
import os
from optparse import OptionParser
#from scipy.stats import ks_2samp
parser = OptionParser ()
parser.set_defaults(verbose=False)
parser.set_defaults(infile=True)
parser.set_defaults(outfile=True)
<?php $dir = ".";
function contents($dir, $path = null) {
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
$odd = false;
while (($file = readdir($dh)) !== false) {
if ($file != "." && $file != ".." && $file != "index.php") {
// Do something with this file
}
using System;
using System.Data;
using System.Configuration;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
<?php
$dir = "pics";
if (is_dir($dir) && $scan_dir = scandir($dir)) echo count($scan_dir);
?>
function config(target:*, args:Object):* {
for (var a:* in args) target[a] = args[a];
return target;
}
// pass in object where key is child you want to bind an event to and value is the function being bound
public function bind(args:Object):void {
for(var i:String in args) if (this[i]) this[i].addEventListener(MouseEvent.CLICK, args[i]);
}
public function arrayContains(target:*, a:Array):Boolean {
var doesNotContain:Boolean = false;
return a.some(function(e:*, i:int, ar:Array):Boolean {
var contains:Boolean = false;
if (target is Array) {
for(var ii:String in target) if (!arrayContains(target[ii], a)) doesNotContain = true;
contains = doesNotContain? false:true;
} else contains = (e == target);
return contains;
});