- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
- They are the people who get things done. Effective Engineers produce results.
| use std::io; | |
| use std::str; | |
| use std::error::Error; | |
| use std::io::{Read, Write}; | |
| use std::net::TcpStream; | |
| #[allow(unused_variables)] | |
| pub trait Events { | |
| fn on_connect(&self, host: &str, port: i32) {} | |
| fn on_error(&self, err: &str) {} |
| #EXTM3U | |
| #EXTINF:-1,Digitally Imported - Ambient | |
| http://pub1.diforfree.org:8000/di_ambient_hi | |
| #EXTINF:-1,Digitally Imported - Big Room House | |
| http://pub1.diforfree.org:8000/di_bigroomhouse_hi | |
| #EXTINF:-1,Digitally Imported - Breaks | |
| http://pub1.diforfree.org:8000/di_breaks_hi |
| #!/usr/bin/env python | |
| # coding=utf-8 | |
| # | |
| # Python Script | |
| # | |
| # Copyleft © Manoel Vilela | |
| # | |
| # | |
| # stdlib |
| def levenshtein(a,b): | |
| "Calculates the Levenshtein distance between a and b." | |
| n, m = len(a), len(b) | |
| if n > m: | |
| # Make sure n <= m, to use O(min(n,m)) space | |
| a,b = b,a | |
| n,m = m,n | |
| current = range(n+1) | |
| for i in range(1,m+1): |
| def gen_log_files(): | |
| """Generate log files names""" | |
| for root, _, files in os.walk(DEFAULT_LOG_DIR): | |
| for name in files: | |
| if is_pref_file(name): | |
| yield os.path.join(root, name) | |
| def gen_contents(fnames): | |
| """Generate file contents | |
| """ |
| DESCRIPTION = """logfind is a simple commandline tool that allows log files | |
| scanning without having to explicitly declare every file on the command line.""" | |
| EPILOG = 'Created by insert-your-name' | |
| def cli_parser(): | |
| """Command Line Arguments parser | |
| """ | |
| parser = argparse.ArgumentParser(description=DESCRIPTION, epilog=EPILOG) | |
| parser.add_argument('term', nargs='+', metavar='SEARCH_TERM', help='search term(s)') |
| // These two need to be declared outside the try/catch | |
| // so that they can be closed in the finally block. | |
| HttpURLConnection urlConnection = null; | |
| BufferedReader reader = null; | |
| // Will contain the raw JSON response as a string. | |
| String forecastJsonStr = null; | |
| try { | |
| // Construct the URL for the OpenWeatherMap query |