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
current_tower = 0 | |
target_axis = 2 | |
axises = [ | |
[6, 5, 4, 3, 2, 1], | |
[], | |
[] | |
] | |
def _select_axis(tower_index, axis): | |
axises_indexes = [0, 1, 2] |
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
def restore_disks(size, action_index, action_count, from_axis, to_axis): | |
pivot = action_count // 2 | |
free_axis = _select_axis(from_axis, to_axis) | |
part_count = action_count - pivot - 1 | |
if action_index == pivot: | |
axises[from_axis].append(size) | |
for i in range(size-1, 0, -1): | |
axises[free_axis].append(i) |
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
import glob, os | |
from shutil import copyfile | |
suffixes = [ | |
"xxxhdpi", | |
"xxhdpi", | |
"xhdpi", | |
"hdpi", | |
"mdpi", | |
] |
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
# A two-line colored Bash prompt (PS1) with Git branch and a line decoration | |
# which adjusts automatically to the width of the terminal. | |
# Recognizes and shows Git, SVN and Fossil branch/revision. | |
# Screenshot: http://img194.imageshack.us/img194/2154/twolineprompt.png | |
# Michal Kottman, 2012 | |
RESET="\[\033[0m\]" | |
RED="\[\033[0;31m\]" | |
GREEN="\[\033[01;32m\]" | |
BLUE="\[\033[01;34m\]" |
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 MyView : View { | |
@ViewWidget Button okButton; | |
@ViewWidget Panel testPanel; | |
@ViewWidget("cancelButton") Button myButton; | |
@GroupViewWidgets Button[3] buttons; | |
int a = 0; | |
this(Manager manager, in string laytoutFileName, in string shortcutsFileName) { | |
super(manager, laytoutFileName, shortcutsFileName); |
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
public String getPlaceholderText(@NotNull final ASTNode node) { | |
... | |
if (psi instanceof DLanguageBlockStatement) { | |
final DLanguageBlockStatement block = (DLanguageBlockStatement) psi; | |
final PsiElement inner = getInnerStatementBlockForDisplayInPlaceholder(block); | |
if (inner != null) { | |
return "{ " + inner.getText().trim() + " }"; | |
} else { |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
struct Node { | |
int data; | |
struct Node* next; | |
struct Node* prev; | |
} typedef Node; |
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
#!/usr/bin/env python | |
import argparse | |
import requests | |
import sys | |
parser = argparse.ArgumentParser(description='Github statuses api helper.') | |
parser.add_argument('--owner', type=str, help="a repository owner", required=True) | |
parser.add_argument('--repo', type=str, help="repository name", required=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
; ------------------------------------------------------------------- | |
; Sna86. | |
; An 8086 simulator snake! | |
; ------------------------------------------------------------------- | |
; | |
; Assembly program intended to run in an 8086 simulator with functionaliy equal* to one made for homeworks | |
; up to Part 1 Episode 10 of the Peformance-Aware Programming Series (https://www.computerenhance.com/) | |
; by Casey Muratori. Demo - https://youtu.be/s_S4-QHeFMc. | |
; | |
; * mov, add, sub, cmp, je and jne was the target instructions. However I also added loop for convenience, |
OlderNewer