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
| import smtplib | |
| from email.mime.text import MIMEText | |
| username = | |
| password = | |
| server = | |
| port = 587 | |
| receiver = | |
| sender = |
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
| #include <iostream> | |
| #include <string> | |
| bool matchWildcard(const std::string &text, const std::string &pattern) { | |
| auto itt = text.begin(); | |
| for (auto itp = pattern.begin(); itp != pattern.end(); ) { | |
| // Skip multiple * characters. | |
| if (*itp == '*' && *std::next(itp) == '*') { | |
| itp++; | |
| continue; |
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
| #include <iostream> | |
| #include <vector> | |
| #include <memory> | |
| #include "boost/shared_ptr.hpp" | |
| #include "boost/python.hpp" | |
| #include "boost/python/stl_iterator.hpp" | |
| using namespace std; |
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
| #include <assert.h> | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <limits.h> | |
| static inline uint32_t swap1(uint32_t x) { | |
| return ((x >> UINT32_C(16)) & 0xFFFF) | ((x & 0xFFFF) << UINT32_C(16)); | |
| } | |
| static inline uint32_t swap2(uint32_t x) { |
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
| module fsm | |
| ( | |
| input logic i_clk, | |
| input logic i_rst, | |
| input logic i_start, | |
| input logic i_finish, | |
| input logic i_wait, | |
| output logic [1:0] o_state, | |
| ); |
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
| module mux2 | |
| #(parameter p_width = 8) | |
| ( | |
| input logic [p_width-1:0] i_op_a, | |
| input logic [p_width-1:0] i_op_b, | |
| input i_sel, | |
| output logic [p_width-1:0] o_res | |
| ); | |
| always_comb begin |
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
| import SimpleHTTPServer | |
| import SocketServer | |
| import sys | |
| PORT = 1548 | |
| class MyHTTPHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
| log_file = open('logfile.txt', 'w') | |
| def log_message(self, format, *args): | |
| self.log_file.write("%s - - [%s] %s\n" % |
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
| #include <cstring> | |
| #include <vector> | |
| #include <inttypes.h> | |
| #include <ctime> | |
| #include <iostream> | |
| #define REPEATS 100000000 | |
| #define LO 2 | |
| #define HI 3 |
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
| \documentclass{article} | |
| \usepackage{mathptmx} | |
| \usepackage{tikz} | |
| \usetikzlibrary{calc,fit,arrows,automata,positioning} | |
| %\usepackage{color} | |
| \usepackage[active,pdftex,tightpage]{preview} | |
| \PreviewEnvironment[]{tikzpicture} | |
| \PreviewEnvironment[]{pgfpicture} | |
| \DeclareSymbolFont{symbolsb}{OMS}{cmsy}{m}{n} | |
| \SetSymbolFont{symbolsb}{bold}{OMS}{cmsy}{b}{n} |
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
| import os | |
| import sys | |
| import mimetypes | |
| for root, directories, filenames in os.walk(sys.argv[1]): | |
| for directory in directories: | |
| print os.path.join(root, directory) | |
| for filename in filenames: | |
| mt = mimetypes.guess_type(filename) | |
| print os.path.join(root,filename) + ", type "+str(mt) |
NewerOlder