This file contains 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 java.io.File; | |
class Untitled { | |
public static void main(String[] args) { | |
String absolutePath = "/Hello/AnotherFolder/The File Name.PDF"; | |
File file = new File(absolutePath); | |
String fname = file.getName(); | |
int pos = fname.lastIndexOf("."); |
This file contains 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 string | |
import paramiko | |
from itertools import combinations | |
import sys | |
server_ip = "" #put ip of the user here | |
ssh = paramiko.SSHClient() | |
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
charset = string.printable[:36] |
This file contains 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
# Using this method: | |
# http://www.linuxproblem.org/art_9.html | |
import os | |
import save_as_alias | |
user = raw_input("User(root etc.): ") | |
host = raw_input("Host(x.x.x.x): ") | |
path = os.getcwd() |
This file contains 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
// Taha Dogan Gunes | |
// tdgunes@gmail.com | |
// Edited the example 'TFTDisplayText' | |
// So you can use the same diagram to connect the wires to screen | |
#include <TFT.h> | |
#include <SPI.h> | |
This file contains 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
#... | |
class MongoProgressBarElement(FilterPipeElement): | |
def __init__(self, db_name, collection_name, sample): | |
self.total = pymongo.MongoClient()[db_name][collection_name].find().count() | |
self.count = 0 | |
self.sample_count = 0 | |
self.start = 0 | |
self.operation_time = 0 | |
self.total_operation = 0 |
This file contains 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 pyplyn as p | |
first_pipe = p.Pipe(name="first") | |
first_pipe.add(p.LambdaFilter(lambda x: "hello" in x)) | |
first_pipe.add(p.LambdaExtension(lambda x: x.title())) | |
first_pipe.add(p.Writer("./test/output-1.txt")) | |
second_pipe = p.Pipe(name="second") | |
second_pipe.add(p.LambdaFilter(lambda x: "world" in x)) |
This file contains 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 | |
# -*- coding: utf-8 -*- | |
""" | |
geo_test_gen.py | |
~~~~~~~~~~ | |
Author: Taha Dogan Gunes | |
""" | |
import json |
This file contains 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
{"lat": -34.47999900541754, "type": "city/town", "lon": -57.84000247340134, "name": "Colonia del Sacramento", "country": "Uruguay"} | |
{"lat": -33.5439989373607, "type": "city/town", "lon": -56.90099656015872, "name": "Trinidad", "country": "Uruguay"} | |
{"lat": -33.1389990288435, "type": "city/town", "lon": -58.3039974719095, "name": "Fray Bentos", "country": "Uruguay"} | |
{"lat": -34.538004006675465, "type": "city/town", "lon": -56.28400149324307, "name": "Canelones", "country": "Uruguay"} | |
{"lat": -34.09900200521719, "type": "city/town", "lon": -56.21499844799416, "name": "Florida", "country": "Uruguay"} | |
{"lat": 9.26100006831723, "type": "city/town", "lon": 0.7890035737781318, "name": "Bassar", "country": "Togo"} | |
{"lat": 8.557002133057097, "type": "city/town", "lon": 0.9849964623313099, "name": "Sotouboua", "country": "Togo"} | |
{"lat": 33.399999002467325, "type": "city/town", "lon": 10.4166995575967, "name": "Medenine", "country": "Tunisia"} | |
{"lat": 33.689997034920566, "type": "city/town", "lon": 8.9710025379012, "nam |
This file contains 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 UIKit | |
import Security | |
let serviceIdentifier = "com.company" | |
let accessGroup = "com.company.app" | |
let kSecClassValue = kSecClass as NSString | |
let kSecAttrAccountValue = kSecAttrAccount as NSString | |
let kSecValueDataValue = kSecValueData as NSString | |
let kSecClassGenericPasswordValue = kSecClassGenericPassword as NSString |
This file contains 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 math | |
def cal_entropy(lst): | |
t = sum(lst) | |
result = 0 | |
for i in lst: | |
division = float(i)/float(t) |
OlderNewer