This file contains hidden or 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 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 |
This file contains hidden or 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
# 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) |
This file contains hidden or 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 python3 | |
import math | |
import os | |
import random | |
import re | |
import sys | |
# | |
# abcMdefggfedcba |
This file contains hidden or 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
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 |
This file contains hidden or 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 python3 | |
# -*- coding: utf-8 -*- | |
import io | |
import os | |
import re | |
import sys | |
import json | |
import logging | |
from datetime import date |
This file contains hidden or 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 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 | |
# |
This file contains hidden or 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
#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)); | |
#endif | |
} | |
else | |
{ | |
#ifndef WIN32 | |
boost::property_tree::write_xml(os, tree, boost::property_tree::xml_writer_make_settings(' ', 2)); |
This file contains hidden or 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
/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 |
This file contains hidden or 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 zsh | |
# script to build Illumina bcl2fastq2 | |
# Copyright (C) 2017 Lior Galanti | |
# NYU Center for Genetics and System Biology | |
# Author: Lior Galanti <[email protected]> | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Affero General Public License as |
This file contains hidden or 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
--- 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)); |
NewerOlder