count | word | meaning | rank | cumulative_fraction | |
---|---|---|---|---|---|
12218247 | de | from | 1 | 0.03557 | |
12131641 | que | what | 2 | 0.07088 | |
10444550 | no | do not | 3 | 0.1013 | |
8037570 | a | to | 4 | 0.1247 | |
7711865 | la | the | 5 | 0.1471 | |
6389567 | el | he | 6 | 0.1657 | |
6003821 | y | 7 | 0.1832 | ||
5897102 | es | 8 | 0.2004 | ||
5770082 | en | 9 | 0.2172 |
#!/usr/bin/env bash | |
# memusg -- Measure memory usage of processes | |
# Usage: memusg COMMAND [ARGS]... | |
# | |
# Author: Jaeho Shin <[email protected]> | |
# Created: 2010-08-16 | |
############################################################################ | |
# Copyright 2010 Jaeho Shin. # | |
# # | |
# Licensed under the Apache License, Version 2.0 (the "License"); # |
Save $25 for your Cloud Computing Solution with Digital Ocean.
1.) Use this link to Sign Up and save your first $10.
# source: https://trac.ffmpeg.org/wiki/CentosCompilationGuide | |
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel | |
mkdir ~/ffmpeg_sources | |
cd ~/ffmpeg_sources | |
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz | |
tar xzvf yasm-1.2.0.tar.gz | |
cd yasm-1.2.0 |
Command-line arguments in Python show up in sys.argv
as a list of strings (so you'll need to import the sys
module).
For example, if you want to print all passed command-line arguments:
import sys
print(sys.argv) # Note the first argument is always the script filename.
Command-line options are sometimes passed by position (e.g. myprogram foo bar
) and sometimes by using a "-name value" pair (e.g. myprogram -a foo -b bar
).
Here's a simple way to parse command-line pair arguments. It scans the argv
list looking for -optionname optionvalue
word pairs and places them in a dictionary for easy retrieval. The code is heavily commented to help Python newcomers.
# Create your superuser | |
$ mongo | |
> use admin | |
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]}) | |
> exit | |
# Alias for convenience (optional and at your own risk) | |
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile | |
$ source ~/.bash_profile |
⇐ back to the gist-blog at jrw.fi
Backing stuff up is a bit of a hassle, to set up and to maintain. While full-blown backup suites such as duplicity or CrashPlan will do all kinds of clever things for you (and I'd recommend either for more complex setups), sometimes you just want to put that daily database dump somewhere off-site and be done with it. This is what I've done, with an Amazon S3 bucket and curl
. Hold onto your hats, there's some Bucket Policy acrobatics ahead.
There's also a tl;dr at the very end if you just want the delicious copy-pasta.
System directories
Method | Result |
---|---|
Environment.getDataDirectory() | /data |
Environment.getDownloadCacheDirectory() | /cache |
Environment.getRootDirectory() | /system |
External storage directories
The method i am telling is quite Simple and requires Dynamic Programming and have time complexity O(n). | |
Your Sample Input: | |
n=10 , W = 3 | |
10 3 | |
1 -2 5 6 0 9 8 -1 2 0 | |
Answer = 5 6 6 9 9 9 8 2 | |
Concept: Dynamic Programming |