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
%%% _________________________________________________________________________ | |
%%% | |
%%% | |
%%% xxxx supervisor for xxxx | |
%%% | |
%%% _________________________________________________________________________ | |
-module(xxxx). | |
-behaviour(supervisor). |
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
#!/bin/bash | |
# The idea and the most of the script is not mine, I saw it on reddit | |
slack_token="" | |
workwifi="Port56" | |
homewifi="TP-LINK_3E7FDB" | |
homewifi2="" | |
ssid=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}'` | |
if [ "$ssid" == "$workwifi" ]; then | |
/usr/bin/curl https://slack.com/api/users.profile.set --data 'token='$slack_token'&profile=%7B%22status_text%22%3A%22%40the%20office%22%2C%22status_emoji%22%3A%22%22%7D' > /dev/null | |
elif [ "$ssid" == "$homewifi" ] || [ "$ssid" == "$homewifi2" ]; then |
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(pbkdf2). | |
-export([generate/3]). | |
exor(Binary1, Binary2) -> | |
exor(binary_to_list(Binary1), binary_to_list(Binary2), []). | |
exor([], [], Result) -> list_to_binary(lists:reverse(Result)); | |
exor([H1|Binary1], [H2|Binary2], Result) -> | |
exor(Binary1, Binary2, [H1 bxor H2 | Result]). | |
generate(Password, Salt, IterationCount) -> |
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
% Spell 1: Read a list of integers from a line of input the cool way. | |
% Example pattern, includes the space character and the new line character as delimiter. | |
CP = binary:compile_pattern([<<" ">>, <<$\n>>]), | |
% Set the IO device to send binary data. | |
ok = io:setopts([binary]), | |
% Function to read a line, split on given delimiter and return a list of integers. | |
read_int_line(CP) -> | |
{ok, Line} = file:read_line(standard_io), | |
[binary_to_integer(X) || X <- binary:split(Line, CP, [global, trim_all])]. |
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 python | |
# -*- coding: utf-8 -*- | |
import sys | |
import urllib2 | |
from bs4 import BeautifulSoup | |
base_url = "https://stars.bilkent.edu.tr/syllabus/view/CS/" | |
base_url2 = "/20161?section=1" | |
courses = [101, 102, 201, 202, 223, 224, 315, 319, 342, 353, 425, 426, 473, 476, 481, 484, 464, 421, 101, 102, 132, 225, 230] |
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/python | |
import sys | |
if len(sys.argv) != 6: | |
print '<usage> ./ml-peer-grade.py [YOUR_ID] [YOUR_LAST_NAME] [LAST_NAME_1] [LAST_NAME_2] [LAST_NAME_3]' | |
else: | |
args = sys.argv[1:] | |
f = open('{}.txt'.format(args[0]), 'w') | |
s = "{0[0]} {0[1]}\n{0[2]} 5\n{0[3]} 5\n{0[4]} 5\n".format(args) | |
f.write(s) | |
f.close() |
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
\begin{table}[h!] | |
\begin{center} | |
\begin{tabular}{||c | c | c | c||} | |
\hline | |
Number of Clusters & Class Entropy & Cluster Entropy & Overall Entropy \\ [0.5ex] | |
\hline | |
2 & 0.194755 & 3.05406 & 1.624407 \\ | |
\hline | |
3 & 0.725162 & 3.038609 & 1.881886 \\ |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
int main(void) { | |
unsigned long long m = 1; | |
int i; | |
for (i = 0; i < 64; i++) { | |
m = m << 1; | |
m = m | 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
#include <stdlib.h> | |
#include <string.h> | |
void failure(char* pattern, int* f); | |
int kmp(char* t, char* p); | |
int* init_array(int size) { | |
int* arr = (int*)malloc(size * sizeof(int)); | |
int i; | |
for(i = 0; i < size; i++) { |
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
#!/bin/bash | |
# <usage>: bash ba.sh [your_text] | |
echo $1 | tr 'aieou' 'i' |
NewerOlder