Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

.format was introduced in Python2.6 It is more powerful than %.

The most common use:

>>> '{}, {}, {}'.format('a', 'b', 'c')
'a, b, c'

>>> '{2}, {1}, {0}, {1}'.format('a', 'b', 'c')
'c, b, a, b'
#!/usr/bin/env python2
# wordDB.py
# Word Frequency Database Generator
# Author: Ryan McCarl
# License: GPL 3
import sqlite3
import nltk as n
from nltk.corpus import brown
from nltk.stem import WordNetLemmatizer as wordnet

The git questions

  1. Can you explain git rebase, git checkout, and git merge, and give examples of when I should use them?
  2. How does git diff work and how can I resolve merge/rebase conflicts from the command line?
  3. What do remote, origin, and HEAD mean?

The git asnwers

Remotes, origin, HEAD

Git has the concept of "remotes", which are simply URLs to other copies of your repository. A remote repository is just a remote's local repository, almost like the one of yours, and which you can access by, for example, ssh.

# This is just a little draft with two rather obvious classes you might need to have at the beginning.
#
#
# At first glance I see three ways of implementing TodoEntry class,
# speaking about how field are stored in it
# It seams this class would not have much functionality,
# mostly just storing fields, marking entry completed autoinsresting 'completedData',
# something more, and not much data integrity checking,
# so I prefer the last variant, it's faster and seams more attractive (for me) to implement
КАК ЗАИНТЕРЕСОВАТЬ
или Очередной случай из педагогической практики А.Гина
Я размышлял, как проведу урок на тему "Электростатическая индукция". Живо представлял себе класс. Вот сидят 30 подростков разного пола. Петя думает о Маше. Маша думает о Саше. Сергей наверняка хочет только одного - чтобы его не спросили. А кто из них думает об электростатической индукции? Никто! А кто меня о ней спрашивал? Никто! Вот войду я в класс и напишу тему на доске. Кого она вдохновит? Никого...
И стало мне грустно, и стал я думать, есть ли выход из этого положения. Как зажечь ребят? И что я сам знаю интересного про эту самую индукцию? И кое-что придумал...
- Ребята! Я расскажу вам историю из жизни. Этот случай был описан в газете и произошел недалеко от нашего города. Представьте себе довольно высокий холм, на котором пасется корова. Погода дождливая, над холмом тучи, молнии, гром. И вдруг после очередного удара молнии корова упала замертво. Попробуйте найти причину смерти коровы - что случилось?
Посовещавшись, дети генерирую
A Posting about Anxiety, Depression and PTSD from a Learner in Learning How to Learn
I know these are topics that many might not want to talk about. My family and friends certainly do not want to talk about these topics with me.
I am dealing with trauma and suffer from severe depression, anxiety and PTSD. Until recently I was working full time (currently I am on sick leave) and by many I was considered to be completely healthy and high functioning and in a sense, from certain perspectives, I was. In social contexts, peer and manager reviews at work and family gatherings I did everything that everyone expected of me and what I understood as being ‘successful’ in the eyes of the corporate and academic world. I excelled in university, a top performer at my job and also my friends would ALL describe me as fun and outgoing and smart and a hard worker. But I have suffered from these major afflictions for much of my adult life and have just never really been able to make strong headway despite all the investigatio
@arwer13
arwer13 / gist:30a399e95ec2eb0016a2474cbc388ea8
Created April 3, 2016 08:32
БЫЛ РЕБЕНОК, И ОН РОС С КАЖДЫМ ДНЕМ
БЫЛ РЕБЕНОК, И ОН РОС С КАЖДЫМ ДНЕМ
      Был ребенок, и он рос с каждым днем и каждый день видел
      новое,
      И на что бы он ни взглянул - он всем становился,
      И все становилось частью его на этот день, на этот час
      Или на многие, многие годы.
      Ранняя сирень стала частью его,
      И трава, и белый или розовый вьюнок, белый и красный