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
" [ CORE ] ------------------------------------------------------------------ | |
" Very much needed settings to provide a solid base for source code editting | |
" DEPENDENCIES: | |
" - vim-plug: For managing plugins | |
" - ag: The silver searcher | |
" - editorconfig: For projects where common configuration is important | |
" - SourceCodePro: Pretty font for coding | |
" --------------------------------------------------------------------------- | |
" don't make vim compatible with vi |
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 redis | |
import logging | |
class RedisLogHandler: | |
"""Log handler for logging logs in some redis list | |
""" | |
def __init__(self, host = None, port = None, db = 0, log_key = 'log_key'): | |
self._formatter = logging.Formatter() | |
self._redis = redis.Redis(host = host or 'localhost', port = port or 6379, db = db) | |
self._redis_list_key = log_key |
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 dict_to_redis_hset(r, hkey, dict_to_store): | |
""" | |
Saves `dict_to_store` dict into Redis hash, where `hkey` is key of hash. | |
>>> import redis | |
>>> r = redis.StrictRedis(host='localhost') | |
>>> d = {'a':1, 'b':7, 'foo':'bar'} | |
>>> dict_to_redis_hset(r, 'test', d) | |
True | |
>>> r.hgetall('test') |
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
# List unique values in a DataFrame column | |
pd.unique(df.column_name.ravel()) | |
# Convert Series datatype to numeric, getting rid of any non-numeric values | |
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True) | |
# Grab DataFrame rows where column has certain values | |
valuelist = ['value1', 'value2', 'value3'] | |
df = df[df.column.isin(valuelist)] |
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
# Create a new file in your home directory called .gtkrc-eclipse | |
# call eclipse with this command: | |
# Gtk2 forced: | |
# export SWT_GTK3=0 | |
# env GTK2_RC_FILES=/usr/share/themes/<YourTheme>/gtk-2.0/gtkrc:/home/<YourUser>/.gtkrc-eclipse '/path_to_eclipse/eclipse' | |
# In your Eclipse directory find the file 'e4_default_gtk.css' | |
# In this file there's a CSS class: |
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
template<typename T> | |
class Option{ | |
private: | |
T* some; | |
bool is_null; | |
public: | |
Option(T* obj_) : some(obj_), is_null(obj_ == nullptr) { } | |
bool isEmpty(){ return is_null;} | |
bool isDefined(){ return !isEmpty;} |
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
Index: postgresql-9.1-9.1.14/src/include/pg_config_manual.h | |
=================================================================== | |
--- postgresql-9.1-9.1.14.orig/src/include/pg_config_manual.h 2014-10-14 16:55:38.000000000 -0400 | |
+++ postgresql-9.1-9.1.14/src/include/pg_config_manual.h 2014-10-14 16:56:01.598940653 -0400 | |
@@ -17,7 +17,7 @@ | |
* | |
* Changing this requires an initdb. | |
*/ | |
-#define NAMEDATALEN 64 | |
+#define NAMEDATALEN 256 |
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
library(data.table) | |
dt1 = data.table(a = 1:4, b = 4:1) | |
dt2 = data.table(c = letters[1:4]) | |
dt2[, dt1[], by = c] |
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
2014-09-14 00:01:19 --> ThisFrickinSite| (~kvirc@207.144.203.163) has joined #tagpro | |
2014-09-14 00:01:27 --> MrJoehobo (4c100b56@gateway/web/freenode/ip.76.16.11.86) has joined #tagpro | |
2014-09-14 00:03:04 <-- Aniball (450669c1@gateway/web/freenode/ip.69.6.105.193) has quit (Quit: Page closed) | |
2014-09-14 00:03:29 --> Exquisite (180ea501@gateway/web/freenode/ip.24.14.165.1) has joined #tagpro | |
2014-09-14 00:03:31 Exquisite !test chaos ball | |
2014-09-14 00:03:32 some_bot Sorry, I cannot find "chaos ball" in my brain! Did you mean one of these: Chaos Arena, BaseBALL ? | |
2014-09-14 00:03:40 Exquisite !test chaos arena | |
2014-09-14 00:03:42 some_bot http://tagpro-maptest.koalabeast.com:8002/ (chaos arena) | |
2014-09-14 00:03:47 +pooppants chaos ball was fun | |
2014-09-14 00:04:04 <-- ThisFrickinSite (~kvirc@207.144.203.163) has quit (Ping timeout: 256 seconds) |
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
Books (Basics): | |
Керниган Б., Ритчи Д. - Программирование на C (2nd ed.) (2009) | |
Stroustrup B. - The C++ Programming Language (2013) | |
Страуструп Б. - Программирование. Принципы и практика использования C++ (2011) | |
Мэйерс С. - Эффективное использование C++ (3rd ed.) (2006) | |
Meyers S. - Effective Modern C++ (2014) | |
Андрей Александреску - Современное проектирование на C++ (2002) | |
Zed A. Shaw - Learn C the Hard Way - http://c.learncodethehardway.org/book/ | |
Books (Algorithms): |
NewerOlder