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 <stdbool.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <limits.h> | |
#include <ctype.h> | |
#ifdef TEST | |
#define INPUT "input_test" | |
#define GRID_SIZE 13 |
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
""" | |
@author: marrakchino | |
## Notes | |
* I used both tweepy and twitter because none of the two libraries is extensive enough to suit my needs: | |
1. Search for a specific tweet using its `id`, tweepy does this perfectly | |
2. Use a raw query (as in the web app), in particular to find quote tweets of a tweet, twitter does this perfecetly | |
* To my great disapointment, I learned that `The Search API is not complete index of all Tweets, but instead an index of recent Tweets. | |
The index includes between 6-9 days of Tweets.` This means this script would only work when applied on a 'recent' tweet. |
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
#!/bin/python3 | |
# Fork of https://gist.github.com/davej/113241 | |
# Requirements: | |
# - twitter API credentials (replace the correponding variables) | |
# - tweet.js file you get by extracting your twitter archive zip file (located in data/) | |
# License : Unlicense http://unlicense.org/ | |
import tweepy | |
import |
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
/* | |
* This C program calculates LoRaWAN's network session key (NwkSKey) using | |
* mbed TLS. | |
* To use it, you should provide the following parameters in this order when | |
* executing the program: | |
* AppKey: An AES-128 key | |
* AppNonce: A random 3 byte value | |
* NetID: A network identifier | |
* DevNonce: A 2 byte nonce | |
* Example: |
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 "mbed.h" | |
static void get_thread_id(){ | |
osThreadId thread_id = osThreadGetId(); | |
printf("main thread Id: %p\r\n", thread_id); | |
} | |
int main(){ | |
get_thread_id(); | |
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/env python | |
# author: marrakchino ([email protected]) | |
""" | |
MIT License | |
Copyright (c) 2017 marrakchino | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal |
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
# -*- coding: utf-8 -*- | |
""" | |
Created on Tue Apr 25 09:11:46 2017 | |
@author: marrakchino | |
based on the original idea (and implementation) of Cory Engdahl (https://www.quora.com/As-a-programmer-what-tasks-have-you-automated-to-make-your-everyday-life-easier/answer/Cory-Engdahl?srid=utoTd) | |
""" | |
import os | |
import time |
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 numpy as np | |
import matplotlib.pyplot as plt | |
import timeit | |
plt.ion() | |
n=10000 | |
block=[i+1 for i in range(1000)] | |
time=[] | |
tab=[[0 for i in range(n)] for j in range(n)] |
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 MatrixTranspose { | |
public static void matrixTranspose(){ | |
long startTime, elapsedTime; | |
int n = 10000; | |
int a[][] = new int[n][n]; | |
int b[][] = new int[n][n]; | |
// ####################################### | |
for (int i = 0; i < n; i++){ | |
for (int j = 0; j < n; j++){ |
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 <stdlib.h> | |
#define N 2000 | |
#define M 1000 | |
int t[M][M] = {{0}}; | |
int main(){ | |
for (int i = 0; i < N; i++) |