Collect following variables from the main LTSP server's /etc/ltsp/dhcpd.conf
.
client_ip_range
dns_server
broadcast_address
routers
subnet_mask
import csv | |
import sys | |
import json | |
from collections import defaultdict | |
IN_FILENAME = sys.argv[1] | |
in_csv_file = csv.DictReader(open(IN_FILENAME, 'r')) | |
featuresByGroup = defaultdict(list) |
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
import datetime | |
import logging | |
import six | |
from .compat import python_2_unicode_compatible | |
from .accessor import Accessor | |
from .util import generate_message_control_id | |
logger = logging.getLogger(__file__) |
from celery import Task | |
from celery.task import task | |
from my_app.models import FailedTask | |
from django.db import models | |
@task(base=LogErrorsTask) | |
def some task(): | |
return result | |
class LogErrorsTask(Task): |
""" | |
Delete datavalue and complete registration from DHIS2 database based on | |
given Nepali period | |
Requirements: | |
- SqlAlchemy | |
- psycopg2-binary | |
""" | |
from sqlalchemy.ext.automap import automap_base |
import time | |
import csv | |
import googlemaps | |
types = ['airport', 'amusement_park', 'bank', 'bus_station', | |
'shopping_mall', 'gas_station', 'hospital', 'department_store'] | |
useful_fields = ( | |
'id', 'formatted_address', 'place_id', 'types', 'name', 'rating') | |
extra_fields = ('latitude', 'longitude', 'poi_type') |
from prettytable import PrettyTable | |
epsila = '@' | |
''' | |
S -> ABC | |
A -> abA | ab | |
B -> bD | |
D -> CD | @ | |
C -> c | cC |
from collections import deque | |
import pydot | |
class State(object): | |
""" Initialize state with missionaries and cannibals at | |
left hand side. Boat=1 means boat is on the left hand side | |
and Boat=0 means boat is on the right hand side | |
""" | |
def __init__(self, missionaries, cannibals, boat, by_move): | |
self.missionaries = missionaries |
#include <stdio.h> | |
#include <stdlib.h> // For qsort | |
#define QUEUESIZE 10 // Number of items the Queue can hold | |
typedef enum { false, true } bool; // Use #include <stdbool.h> if available | |
typedef struct { | |
char name[10]; | |
int priority; | |
} Item; |
#include <stdio.h> | |
#include <stdlib.h> | |
void isort(int a[], int len) { | |
int key, i,j; | |
for(i=1; i < len; ++i) { | |
key = a[i]; | |
for(j=i-1; j>=0 && key < a[j]; --j) { | |
a[j+1] = a[j]; | |
} |