Skip to content

Instantly share code, notes, and snippets.

View syedsaqibali's full-sized avatar

Saqib Ali syedsaqibali

  • Washington DC, USA
View GitHub Profile
class Solution:
def firstMissingPositive(self, nums: List[int]) -> int:
len_nums = len(nums)
missing_ints = list(range(1, len_nums+2))
for i in nums:
if i <= len_nums and i > 0:
missing_ints[i-1] = None
for i in missing_ints:
if i != None:
return i
class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
max_run_length = 0
start_run_index = -1
while start_run_index <= len(s) - max_run_length:
start_run_index += 1
run_letters = set([]) if start_run_index == 0 else set(list(s[start_run_index:start_run_index+max_run_length]))
if len(run_letters) < max_run_length:
continue
for k in s[start_run_index+max_run_length:]:
{
"compilerOptions": {
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"module": "commonjs", /* Specify what module code is generated. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
"strict": true, /* Enable all strict type-checking options. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
}
}
$ pip uninstall pycurl
Uninstalling pycurl-7.19.5.1:
MyVirtualEnv/lib/python2.6/site-packages/curl/__init__.py
MyVirtualEnv/lib/python2.6/site-packages/curl/__init__.pyc
MyVirtualEnv/lib/python2.6/site-packages/pycurl-7.19.5.1.dist-info/DESCRIPTION.rst
MyVirtualEnv/lib/python2.6/site-packages/pycurl-7.19.5.1.dist-info/METADATA
MyVirtualEnv/lib/python2.6/site-packages/pycurl-7.19.5.1.dist-info/RECORD
MyVirtualEnv/lib/python2.6/site-packages/pycurl-7.19.5.1.dist-info/WHEEL
MyVirtualEnv/lib/python2.6/site-packages/pycurl-7.19.5.1.dist-info/metadata.json
MyVirtualEnv/lib/python2.6/site-packages/pycurl-7.19.5.1.dist-info/top_level.txt
$ telnet ec2-54-148-16-122.us-west-2.compute.amazonaws.com 22
Trying 54.148.16.122...
telnet: connect to address 54.148.16.122: Operation timed out
telnet: Unable to connect to remote host
$ ssh nethack@alt.org
The authenticity of host 'alt.org (204.236.130.210)' can't be established.
RSA key fingerprint is XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'alt.org,204.236.130.210' (RSA) to the list of known hosts.
;
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
$ cat /etc/postfix/main.cf
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
$ cat /etc/postfix/main.cf
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
irb(main):002:0> require 'bigdecimal'
=> true
irb(main):003:0> v = BigDecimal("7.1762")
=> #<BigDecimal:7f8905213dc0,'0.71762E1',18(18)>
irb(main):004:0> v.truncate(2).to_s('F')
=> "7.17"
irb(main):005:0> w = BigDecimal("4.2")
=> #<BigDecimal:7f890522c5f0,'0.42E1',18(18)>
irb(main):006:0> w.truncate(2).to_s('F')
=> "4.2"