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
#!/usr/bin/env python | |
import sys | |
# input comes from STDIN (standard input) | |
for line in sys.stdin: | |
# remove leading and trailing whitespace | |
line = line.strip() | |
# split the line into words | |
words = line.split() |
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
#!/usr/bin/env python | |
from operator import itemgetter | |
import sys | |
current_word = None | |
current_count = 0 | |
word = None | |
# input comes from STDIN |
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
#!/bin/sh | |
# | |
# This script will exceute the word-count example using Hadoop + Python Streaming | |
# | |
hadoop jar /usr/local/Cellar/hadoop/1.0.3/libexec/contrib/streaming/hadoop-*streaming*.jar \ | |
-file /path/to/mapper.py \ | |
-mapper /path/to/mapper.py \ | |
-file /path/to/reducer.py \ | |
-reducer /path/to/reducer.py \ |
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_POST | |
@login_required | |
@json.json_view | |
def reject_applicant(request,aid): | |
applicant = MHRBoxApplicant.objects.get(account_id=str(aid)) | |
reject_reason = request.POST.get('reject_reason',None) | |
applicant.info['reject_reason'] = reject_reason |
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_POST | |
@login_required | |
@json.json_view | |
def reject_applicant(request,aid): | |
applicant = MHRBoxApplicant.objects.get(account_id=aid) | |
applicant.info['reject_reason'] = request.POST['reject_reason'] | |
applicant.status = HRBOX_APPLICANT_STATUS_REJECTED | |
applicant.save() |
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
@login_required | |
def employee_create(request, employee_id): | |
applicant = MHRBoxApplicant.objects.get(account_id=employee_id) | |
job = MHRBoxJob.objects.get(id=applicant.job.id) | |
try: | |
employee = MHRBoxEmployee.objects.get(unique_id=employee_id,job=job) | |
except MHRBoxEmployee.DoesNotExist: | |
logging.debug('Created new hrbox employee ~ apps.hrbox.views.employee') | |
info = {} | |
info['general'] = {} |
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
for req in range(0,21): | |
reqname = 'job_required_skill_' + str(req) | |
if reqname in request.POST: | |
required_skills.append(request.POST[reqname]) | |
for pref in range(0,21): | |
prefname = 'job_required_skill_' + str(pref) | |
if prefname in request.POST: | |
preferred_skills.append(request.POST[prefname]) |
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
job.application['required_skills'] = request.POST.getlist('job_skill')[0:20] | |
job.application['preferred_skills'] = request.POST.getlist('job_skill')[0:20] |
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 credit_card(request): | |
params = { | |
'STRIPE_PUBLISHABLE' : settings.STRIPE_PUBLISHABLE, | |
} | |
c = RequestContext(request) | |
q_type = request.GET.get('li') | |
params['q_type'] = q_type | |
if q_type == 'SEARCH' or q_type == 'REGISTER': | |
sub_type = request.GET.get('typ') |
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 credit_card(request): | |
params = {} | |
q_type = request.GET.get('li') | |
params['q_type'] = q_type | |
if q_type == 'SEARCH' or q_type == 'REGISTER': | |
params['s_type'] = request.GET.get('typ') | |
params['STRIPE_PUBLISHABLE'] = settings.STRIPE_PUBLISHABLE | |
return render_to_response('credit_card.html', params, context_instance=RequestContext(request)) |