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
#include <stdlib.h> | |
#include "base64.h" | |
static char values[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; | |
static int indexOf(char * array, char value){ | |
int i; | |
for(i = 0; *array; ++i, ++array) | |
if(*array == value) | |
return i; |
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
package base64; | |
public class Base64 { | |
private static String CODES = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
+ "abcdefghijklmnopqrstuvwxyz" | |
+ "0123456789+/="; | |
public static String encode(byte[] input){ | |
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
public static String Reverse(String sentence){ | |
String normal = "abcdefghijklmnopqrstuvwxyz_,;.?!/\\'"; | |
String split = "ɐqɔpǝɟbɥıظʞןɯuodbɹsʇnʌʍxʎz‾'؛˙¿¡/\\,"; | |
normal += "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
split += "∀qϽᗡƎℲƃHIſʞ˥WNOԀὉᴚS⊥∩ΛMXʎZ"; | |
normal += "0123456789"; | |
split += "0ƖᄅƐㄣϛ9ㄥ86"; |
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; | |
public class Delete { | |
public static void main(String[] args) { | |
if(args.length != 1){ | |
System.out.println("ERROR: A path must be specified."); | |
System.exit(0); | |
}else{ |
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
package backup; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.nio.channels.FileChannel; | |
public class Backup { | |
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
public int count(File root){ | |
if(root == null || !root.exists()){ | |
System.out.println("ERROR: The source drive/directory does not exist."); | |
return -1; | |
} | |
Queue<File> files = new Queue<>(); | |
files.push(root); |
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
/** | |
* Created by Alex on 20/10/2014. | |
*/ | |
describe("Service: Cache", function () { | |
var $interval, | |
cacheService, | |
scope, | |
lo; |
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 sqlite3 | |
import calendar | |
import time | |
class Database: | |
_conn = None | |
def __init__(self): | |
self._conn = sqlite3.connect("url.db") | |
cur = self._conn.cursor() |
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
/** | |
* @name pushToTemplate | |
* @param template | |
* @param object | |
* @returns {object} | |
* @description will push the object onto the template | |
*/ | |
var pushToTemplate = function pushToTemplate(template, object){ | |
var result = angular.copy(template); |
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
#include <stdio.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
int main(void) | |
{ | |
int fd = open("/dev/sdd", O_WRONLY); | |
if (fd < 0) { |
NewerOlder