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 highest_consecutive_sum(intarray): | |
if not intarray: | |
return None | |
current_sum = intarray[0] | |
current_start = 0 | |
current_end = 0 | |
highest_sum = current_sum | |
highest_start = current_start | |
highest_end = current_end |
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
package wlhacknight | |
import scala.io.Source | |
import java.io.File | |
import java.util.Arrays | |
import scala.collection.mutable.ArrayBuffer | |
import scala.collection.immutable.HashMap | |
import scala.util.Random | |
/** |
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 sys | |
import soundex | |
import random | |
import pickle | |
soundalikes = {} | |
def load_dict(): | |
with open('/usr/share/dict/words') as f: | |
for line in 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
package tetris | |
/** | |
* Created by mat on 12/11/2014. | |
*/ | |
abstract class shape { | |
var orientation: Int = 0 | |
val orientations: Array[Array[Point]] | |
def rotate(direction: Int): Array[Point] = { |
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
/** | |
* Created by mat on 08/12/2014. | |
*/ | |
import java.net._ | |
import java.io.{Console => _, _} | |
import scala.collection.mutable | |
import scala.io._ | |
object RDCP extends App { |
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
-module(battleship). | |
-import(sets,[new/0, add_element/2, is_element/2]). | |
-import(lists,[foldl/3]). | |
-export([new_grid/0]). | |
-export([new_grid/2]). | |
-export([fill_cell/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
Dry run of restore_policy_links task on local database. | |
Note: everything is duplicated on the 21st because I applied the changes locally at the time. | |
Dry run | |
Found 219 destructive events | |
17e4ab26-ee1f-4383-a345-d165c0b75fbf PatchLinkSet 2016-03-14 12:04:31 UTC {:organisations=>[], :lead_organisations=>[], :people=>[], :working_groups=>[], :related=>[], :email_alert_signup=>["135ab6fc-cda6-4dc7-852a-0fbddc2472e6"], :policy_areas=>[]} | |
3f1dc53a-732b-41ff-83ae-8d93fffb1a7c PatchLinkSet 2016-03-14 12:02:38 UTC {:organisations=>[], :lead_organisations=>[], :people=>[], :working_groups=>[], :related=>[], :email_alert_signup=>["d59b3b97-a9ed-4e5b-afaf-1edd599dcc43"], :policy_areas=>[]} | |
453affe4-5ebb-4f44-9f0a-44cfd32dc934 PatchLinkSet 2016-03-14 12:04:30 UTC {:organisations=>[], :lead_organisations=>[], :people=>[], :working_groups=>[], :related=>[], :email_alert_signup=>["de631142-8027-458b-bfa9-b77582939294"], :policy_areas=>[]} | |
5c6497db-7631-11e4-a3cb-005056011aef PatchLinkSet 2016-03-14 12:03:36 UTC {:organisat |
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
require 'gds_api/rummager' | |
require 'set' | |
desc "Sanitize access limited data" | |
task sanitize_data: :environment do | |
Tasks::DataSanitizer.delete_access_limited(STDOUT) | |
end | |
task compare_policies_to_rummager: :environment do | |
policy_query = Queries::GetContentCollection.new( |
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 the integration search API to figure out formats for a list of pages | |
Usage: USERNAME=??? PASSWORD=??? python format_finder.py | |
""" | |
import csv | |
import requests | |
from os import environ | |
from requests.auth import HTTPBasicAuth |
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
active_top_level_browse_page | |
children | |
content_owners | |
document_collections | |
documents | |
email_alert_signup | |
lead_organisations | |
linked_items | |
mainstream_browse_pages | |
manual |
OlderNewer