Skip to content

Instantly share code, notes, and snippets.

@aronasorman
aronasorman / randompairings.py
Last active December 20, 2015 05:49
Random pairings
from itertools import cycle
import random
def pairup(core, interns=None):
'''
Assigns a name to another name. Assumes that the names are unique.
'''
# assign the core group
random.shuffle(core)
@aronasorman
aronasorman / initial_data.json
Created January 3, 2014 21:14
initial_data.json for KA Lite containing a default admin user. FOR DEVELOPMENT PURPOSES ONLY.
[
{
"pk": 16,
"model": "auth.permission",
"fields": {
"codename": "add_logentry",
"name": "Can add log entry",
"content_type": 6
}
},
def test_add_language_pack(self):
''' Test to check whether a language pack is added successfully or not'''
#Login as admin
self.browser_login_admin()
#Add the language pack
if self.is_language_installed("de"):
# what we want to test is if adding a language pack works.
# So we uninstall "de" to be able to test it
self.delete_language_pack("de")
sudo sed -i 's/managed=false/managed=true/' /etc/NetworkManager/NetworkManager.conf && sudo reboot
Line # Mem usage Increment Line Contents
================================================
391 28.4 MiB 0.0 MiB @profile
392 def start(debug=False, daemonize=True, args=[], skip_job_scheduler=False, port=None):
393 """
394 Start the kalite server as a daemon
395
396 :param args: List of options to parse to the django management command
397 :param port: Non-default port to bind to. You cannot run kalite on
398 multiple ports at the same time.
Partition of a set of 392998 objects. Total size = 64348264 bytes.
Index Count % Size % Cumulative % Kind (class / dict of class)
0 274344 70 23091456 36 23091456 36 str
1 24662 6 22809712 35 45901168 71 dict (no owner)
2 33974 9 3459328 5 49360496 77 tuple
3 9802 2 2176232 3 51536728 80 unicode
4 12987 3 2069000 3 53605728 83 list
5 9847 3 1339192 2 54944920 85 function
6 556 0 1042400 2 55987320 87 dict of module
#!/usr/bin/env python
#
# iwlistparse.py
# Hugo Chargois - 17 jan. 2010 - v.0.1
# Parses the output of iwlist scan into a table
import sys
import subprocess
interface = "wlan0"
Line # Mem usage Increment Line Contents
================================================
92 @profile
93 def initialize_content_caches(force=False):
94 """
95 Catch all function to regenerate any content caches in memory that need annotation
96 with file availability
97 52.445 MB 0.000 MB """
98 138.328 MB 85.883 MB for lang in i18n.get_installed_language_packs(force=True).keys():
99 52.457 MB -85.871 MB logging.info("Preloading exercise data for language {lang}.".format(lang=lang))
@aronasorman
aronasorman / grading-candidates.md
Last active March 1, 2016 16:19
How to rank our candidates based on criteria

How to rank criteria:

Technology depth:

1 - Uses a language without any knowledge of its idioms and conventions. As an example, writes Python code that looks like C or Java.

2 - Is aware of basic idioms taught in a tutorial. For Python, these would be using for ... in list rather than for i in range(len(list)), and other similar basic python constructs.

3 - Knowledge of community idioms and the standard library. with statements, using os.path for handling file paths are indications of this level.

4 - Adept of use of a language and its ecosystem found only after writing a lot of code with it.

Testing out KA Lite and pt-BR on Linux

  1. Add the bleeding edge PPA:
sudo apt-get install sudo add-apt-repository ppa:learningequality/ka-lite-proposed
  1. Install KA Lite: