Skip to content

Instantly share code, notes, and snippets.

View Rustem's full-sized avatar

xepa4ep Rustem

  • Kazakhstan
View GitHub Profile
@Rustem
Rustem / Solution.java
Created May 4, 2022 02:16
472. Concatenated Words
class Solution {
class TrieNode {
int idx;
TrieNode[] nodes;
public TrieNode() {
this.nodes = new TrieNode[26];
this.idx = -1;
@Rustem
Rustem / gist:27a2daf483da522b3fd99a4a568bf301
Created December 27, 2021 19:11
Super-Queens verify safe board layout
boolean canMove(int row, int col) {
// check we don't have any super0-queen on same row
for(int i = 0; i<col ;i++) {
if(board[row][i] == true) {
return false;
}
}
// check there is no already a queen not already on the left diag to the bottom of the (row, col)
for(int i = row, j = col; i>=0 && j >= 0; i --, j--) {
@Rustem
Rustem / airflow-boot.log
Created November 21, 2021 17:21
airflow-boot.log
This file has been truncated, but you can view the full file.
[2021-11-21 09:18:55,615] {settings.py:210} DEBUG - Setting up DB connection pool (PID 90194)
[2021-11-21 09:18:55,625] {cli_action_loggers.py:40} DEBUG - Adding <function default_action_log at 0x1101a1c10> to pre execution callback
[2021-11-21 09:18:56,128] {providers_manager.py:214} DEBUG - Initializing Providers Manager[hooks]
[2021-11-21 09:18:56,129] {providers_manager.py:214} DEBUG - Initializing Providers Manager[list]
[2021-11-21 09:18:56,139] {providers_manager.py:343} DEBUG - Loading EntryPoint(name='provider_info', value='airflow.providers.imap.get_provider_info:get_provider_info', group='apache_airflow_provider') from package apache-airflow-providers-imap
[2021-11-21 09:18:56,144] {providers_manager.py:343} DEBUG - Loading EntryPoint(name='provider_info', value='airflow.providers.ftp.get_provider_info:get_provider_info', group='apache_airflow_provi
@Rustem
Rustem / pow.py
Last active April 26, 2018 09:28
import hashlib
import binascii
"""
Simplified implementation of HashCash proof-of-work algorithm.
"""
difficulty = 3
def hash_msg(message, hex=False):
"""
1. Store the image and create an instance of ImagefileProcessHistory with status NOT_STARTED
ImageFileProcessHistory
- local_path
- file_name
- status # enum: NOT_STARTED, STARTED, SUCCEEDED, FAILED
- bytes_processed
- bytes_total
"""
@Rustem
Rustem / The Technical Interview Cheat Sheet.md
Created October 22, 2016 09:32 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
{
"meta":{
"limit":20,
"next":null,
"offset":0,
"previous":null,
"total_count":16
},
"objects":[
{
{
"meta" : { "limit" : 20,
"next" : null,
"offset" : 0,
"previous" : null,
"total_count" : 9
},
"objects" : [ { "fuel_consumption" : 0.0,
"id" : 34,
"km" : 0.0,
@Rustem
Rustem / filter.py
Created April 24, 2014 10:02
Ex: filtering in django.
# -*- coding: utf-8 -*-
from synergy.forms import SearchForm
from synergy.models import add_look, SynergyBook
from synergy.synergy_backend import synergy
from synergy.dictionaries import *
from synergy.utils import synergy_data
from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect
from django.views.generic.base import TemplateView
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
;(function($, window, document, undefined) {
utils = {
guid: function() {
var s4 = function() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);