Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 pysftp | |
| def newest(path): | |
| files = os.listdir(os.getcwd()) | |
| files = list(filter(lambda x: '.py' not in x, files)) | |
| paths = [os.path.join(path, basename) for basename in files] | |
| return max(paths, key=os.path.getctime) |
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
| iterations = 100 | |
| accuracy = 0.0001 | |
| def f(x): | |
| return 600*(x**4) - 550*(x**3) + 200*(x**2) - 20*x - 1 | |
| n = 1 | |
| a = 0.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
| public class CountingFileRequestBody extends RequestBody { | |
| private static final int SEGMENT_SIZE = 2048; // okio.Segment.SIZE | |
| private final File file; | |
| private final ProgressListener listener; | |
| private final String contentType; | |
| public CountingFileRequestBody(File file, String contentType, ProgressListener listener) { | |
| this.file = file; |
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 java.math.BigInteger; | |
| import java.util.Random; | |
| /** | |
| * Created by Frank on 09-May-17. | |
| */ | |
| public class Main { | |
| public static void main(String[] args) { |
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
| alphabet = 'abcdefghiklmnopqrstuvwxyz' # alphabet i/j exchangeable | |
| def make_matrix(key): | |
| letters = '' | |
| for l in key: | |
| if l not in letters: letters += l | |
| for l in alphabet: | |
| if l not in letters: letters += l | |
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
| package com.mj.tesbitmaploader; | |
| import android.graphics.Bitmap; | |
| import android.graphics.BitmapFactory; | |
| import android.os.Environment; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.os.Bundle; | |
| import android.util.Log; | |
| import android.widget.ImageView; |
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
| public class M { | |
| private String generateRandomString(int length) { | |
| Random rn = new Random(); | |
| char small = 'a'; | |
| char capital = 'A'; | |
| StringBuilder sb = new StringBuilder(length); | |
| for (int i=0; i<length; i++){ | |
| if(rn.nextBoolean()) | |
| sb.append((char)(small + rn.nextInt(26))); | |
| else |
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
| [ | |
| { | |
| "districts": [ | |
| "Arumeru", | |
| "Arusha", | |
| "Karatu", | |
| "Monduli", | |
| "Ngorongoro" | |
| ], | |
| "name": "Arusha" |
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
| Region | HASC | |
|---|---|---|
| Arusha | TZ.AS | |
| Dar es Salaam | TZ.DS | |
| Dodoma | TZ.DO | |
| Geita | TZ.GE | |
| Iringa | TZ.IG | |
| Kagera | TZ.KG | |
| Katavi | TZ.KA | |
| Kigoma | TZ.KM | |
| Kilimanjaro | TZ.KL |
NewerOlder