Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View moonwatcher's full-sized avatar

Lior Galanti moonwatcher

View GitHub Profile
/home/lg1883/bcl2fastq/src/cxx/lib/io/Xml.cpp: In function ‘std::ostream& bcl2fastq::io::serializeAsXml(std::ostream&, const ptree&)’:
/home/lg1883/bcl2fastq/src/cxx/lib/io/Xml.cpp:172:123: error: no matching function for call to ‘xml_writer_make_settings(char, int)’
boost::property_tree::write_xml(os, treeWithIndexAttributes, boost::property_tree::xml_writer_make_settings(' ', 2));
^
In file included from /usr/include/boost/property_tree/detail/xml_parser_utils.hpp:15:0,
from /usr/include/boost/property_tree/detail/xml_parser_write.hpp:15,
from /usr/include/boost/property_tree/xml_parser.hpp:15,
from /home/lg1883/bcl2fastq/src/cxx/lib/io/Xml.cpp:26:
/usr/include/boost/property_tree/detail/xml_parser_writer_settings.hpp:55:30: note: candidate: template<class Str> boost::property_tree::xml_parser::xml_writer_settings<Str> boost::p
/*
Operating Systems Fall 2013, Lab 3. 10 November 2013
Lior Galanti lior.galanti@nyu.edu N14314920
*/
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
class Solution(object):
def longestPalindrome(self, s):
"""
:type s: str
:rtype: str
"""
def check_palindrom(start, end):
while start > 0 and end < n-1 and s[start-1] == s[end+1]:
start-=1
end+=1
# https://leetcode.com/problems/word-break-ii/submissions/
class Solution(object):
def wordBreak(self, s, wordDict):
"""
:type s: str
:type wordDict: List[str]
:rtype: List[str]
"""
n = len(s)
#!/usr/bin/env python3
import math
import os
import random
import re
import sys
#
# abcMdefggfedcba
export PATH=/root/.bin:/usr/local/bin:/usr/local/sbin:$PATH
export PS1="\e[1m\h\e[m:\w \u% "
alias ls="ls --color=none"
export HTOPRC=/tmp/.htoprc
@moonwatcher
moonwatcher / bcl2fastq2_2_20_0_xml_writer_make_settings.patch
Created January 5, 2018 19:21
patch for compiling bcl2fastq on linux with boost 1.58
--- src/cxx/lib/io/Xml.cpp 2018-01-05 14:12:25.000000000 -0500
+++ src/cxx/lib/io/Xml.cpp 2018-01-05 14:12:35.000000000 -0500
@@ -168,19 +168,11 @@
if (!tree.empty())
{
unindex(*tree.begin(), treeWithIndexAttributes);
-#ifndef WIN32
- boost::property_tree::write_xml(os, treeWithIndexAttributes, boost::property_tree::xml_writer_make_settings(' ', 2));
-#else
boost::property_tree::write_xml(os, treeWithIndexAttributes, boost::property_tree::xml_writer_make_settings<std::string>(' ', 2));
@moonwatcher
moonwatcher / build_bcl2fastq2_2_20_0.sh
Last active March 22, 2019 12:20
script for building bcl2fastq2 2.20.0 on POSIX systems
#!/usr/bin/env zsh
# script to build Illumina bcl2fastq2
# Copyright (C) 2017 Lior Galanti
# NYU Center for Genetics and System Biology
# Author: Lior Galanti <lior.galanti@nyu.edu>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@moonwatcher
moonwatcher / fastq2cram.py
Last active October 5, 2018 20:30
Example of generating configuration files for pheniqs 2.0 for packing fastq to CRAM
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import io
import os
import re
import sys
import json
import logging
from datetime import date
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# indexing calculator for an alfine internal gear hub
# The SRAM 3x10 00.7018.068.004 10 speed shifter has a drum diammeter of 21.8mm, or a circumference of 68.4867mm
# The SRAM 11 and 12 gears speed shifter seem to have a 25.6mm drum diammeter, or a circumference of 80.42477mm
# Accounting for the 1.1mm of cable width by adding half the cable width to the radius or 1.1mm to the diameter.
#
# OD 22.9mm / C = 71.942 / 0.5C = 35.97 for the 10 Exact Actuation
# OD 26.7mm / C = 83.88 / 0.5C = 41.94 for the 11 and 12 X-Actuation
#