This file contains 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
--- | |
- hosts: VM | |
remote_user: ankhaa | |
sudo: true | |
tasks: | |
- name: edit archive url in /etc/apt/sources.list | |
replace: | |
dest: /etc/apt/sources.list | |
regexp: 'mn.archive.ubuntu.com' | |
replace: 'mirror.ndc.mn' |
This file contains 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
-- Function: clone_schema(text, text) | |
DROP FUNCTION clone_schema(text, text); | |
CREATE OR REPLACE FUNCTION clone_schema(source_schema text, dest_schema text) | |
RETURNS void AS | |
$BODY$ | |
DECLARE | |
seq RECORD; |
This file contains 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
class DeclarativeFieldsMetaclass(type): | |
""" | |
Metaclass that converts Field attributes to a dictionary called | |
'base_fields', taking into account parent class 'base_fields' as well. | |
""" | |
def __new__(cls, name, bases, attrs): | |
attrs['base_fields'] = get_declared_fields(bases, attrs) | |
new_class = super(DeclarativeFieldsMetaclass, | |
cls).__new__(cls, name, bases, attrs) | |
if 'media' not in attrs: |
This file contains 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
class Form(BaseForm): | |
"A collection of Fields, plus their associated data." | |
# This is a separate class from BaseForm in order to abstract the way | |
# self.fields is specified. This class (Form) is the one that does the | |
# fancy metaclass stuff purely for the semantic sugar -- it allows one | |
# to define a form using declarative syntax. | |
# BaseForm itself has no way of designating self.fields. | |
__metaclass__ = DeclarativeFieldsMetaclass |
This file contains 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
from django import forms | |
class Contact(forms.Form): | |
subject = forms.CharField() | |
email = forms.EmailField() | |
content = forms.CharField(widet = forms.Textarea ) |
This file contains 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
Dictionary<long, string> num = new Dictionary<long, string>() { | |
{0, "" }, { 1, "нэг" }, { 2, "хоёр" }, {3,"гурав"}, {4, "дөрөв"}, {5, "тав"}, {6,"зургаа"}, {7,"долоо"}, {8,"найм"}, {9,"ес"}, | |
{10, "арав"}, {20,"хорь"},{30,"гуч"}, {40,"дөч"}, {50,"тавь"}, {60,"жар"}, {70,"дал"}, {80,"ная"}, {90,"ер"}, | |
{100,"зуу"},{200,"хоёр зуу"},{300,"гурван зуу"},{400,"дөрвөн зуу"},{500,"таван зуу"},{600,"зургаан зуу"},{700,"долоон зуу"},{800,"найман зуу"},{900,"есөн зуу"} | |
}; | |
Dictionary<long, string> sep_num = new Dictionary<long, string>() | |
{ | |
{3,"мянга"}, | |
{6,"сая"}, |
This file contains 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
# -*- coding: utf-8 -*- | |
import unittest | |
from mongoengine import * | |
from django.template import Context, Template | |
from django.conf import settings | |
import datetime | |
settings.configure(DEBUG = True) |
This file contains 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
#coding:utf-8 | |
# By: @ankhaatk | |
import types | |
def find_omnoh_oron(number, numberArray): | |
""" Ойролцоох тоог жагсаалтаас олох | |
""" | |
min_diff = 999999 | |
last_num = 0 | |
for num in numberArray: |