Skip to content

Instantly share code, notes, and snippets.

View erthalion's full-sized avatar

Dmitrii Dolgov erthalion

View GitHub Profile
calling function netrw#Nread..netrw#NetRead..<SNR>24_FileReadable('/tmp/vyGV7nq/0.txt')
line 1: " call Dfunc("s:FileReadable(fname<".a:fname.">)")
line 2:
line 3: if g:netrw_cygwin
line 4: let ret= filereadable(substitute(a:fname,g:netrw_cygdrive.'/\(.\)','\1:/',''))
line 5: else
line 6: let ret= filereadable(a:fname)
line 7: endif
line 8:
@erthalion
erthalion / neovim.hs
Created September 21, 2014 15:55
Get current line from neovim
module Main where
import Network.Socket hiding (recv)
import Network.Socket.ByteString.Lazy (recv, sendAll)
import qualified Data.ByteString.Lazy.Char8 as BLC
import Data.MessagePack as MP
main :: IO ()
main = withSocketsDo $ do
addrinfos <- getAddrInfo Nothing (Just "127.0.0.1") (Just "1234")
long double visValue = 1/fRe;
//Recalculation (Begin)
for (int i=0;i<N+1;i++)
{
for (int j=0;j<L+1;j++)
{
for (int k=0;k<M+1;k++)
{
vis[i][j][k] = (1-cnc[i][j][k])*(1/fRe) + (cnc[i][j][k])*visValue;
@erthalion
erthalion / Masonry---layout.markdown
Created July 23, 2014 04:00
A Pen by Captain Anonymous.
--- /src/frontend/output.cc 2013-11-23 14:41:34.000000000 +0700
+++ /src/frontend/output.cc 2014-05-24 22:12:46.327181649 +0700
@@ -330,14 +330,41 @@
void ShowClassicalBoard(const char *boardmap)
{
unsigned i = 0;
+ unsigned row = 8;
+ const char column[8] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'};
+ int b_white = 1;
+ char tmp_piece[PIECE_SIZE];

Hstore => Json(b)

Hstore = Json(b)

The functions that were implemented for the Hstore and Json(b) types

  • Comparison operators

|name| |--------|----| |equal operator (=)|

Operators

  • Jsonb elements
Operator Returns Description Example Result
jsonb - text jsonb delete key from left operand '{"a":1, "b":2, "c": 3}'::jsonb - {"a":1, "c": 3}
# pattern
$ find . \( -name "*.py" -o -name "*.c" -o -name "*.h" -o -name "*.sh" \) | xargs -n 1 cat | grep '[# ]KEYWORD' | wc -l
#git 355284 lines
TODO: 52
BUG : 7
FIXME: 15
HACK: 2
#include <blitz/array.h>
#include <blitz/array/stencil-et.h>
#include <blitz/array/stencilops.h>
#include <blitz/array/stencil-et-macros.h>
BZ_USING_NAMESPACE(blitz)
BZ_DECLARE_STENCIL2(test,A,B)
B = Laplacian3D(A);
BZ_END_STENCIL
CREATE OR REPLACE FUNCTION next_sharded_id(varchar, int, OUT result bigint) AS $$
DECLARE
sequence_name ALIAS FOR $1;
shard_id ALIAS FOR $2;
seq_id bigint;
now_millis bigint;
BEGIN
SELECT nextval(sequence_name::regclass) % 1024 INTO seq_id;