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: merge-pdf out.pdf `ls -v *.pdf` | |
merge-pdf() { | |
cumulative=1 | |
for f in "${@:2}" | |
do | |
cnt=$(gs -q -dNODISPLAY -dNOSAFER -c "($f) (r) file runpdfbegin pdfpagecount = quit") | |
echo "[/Page $cumulative /Title ($f) /OUT pdfmark" | |
cumulative=$((cnt+cumulative)) |
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 scipy.stats as stats | |
import numpy as np | |
def pearson_correlation_2tail(x: list[int], y: list[int]) -> (float, float): | |
""" | |
Calculates the Pearson correlation coefficient and the p-value. double the p val for 1 tailed | |
:param x: input array 1 | |
:param y: corresponding input 2 | |
:return: (pearson correlation coeff, p value for testing correlation) |
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
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.webdriver.common.keys import Keys | |
from selenium import webdriver | |
url = "https://meetingsapac33.webex.com/webappng/sites/meetingsapac33/meeting/download/fb2e65ba6d1f8 | |
c7e620174a821a36ac0" | |
names = {"lci2020010 pranav":"[email protected]"} |
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.io.*; | |
import java.net.*; | |
import java.nio.file.Files; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import java.util.HashMap; | |
public class FileServer { | |
public static String BASE_DIR = "/"; | |
public static final int PORT = 8080; | |
static ServerSocket server; |
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.net.DatagramPacket; | |
import java.net.DatagramSocket; | |
public class UDPServer { | |
public static void main(String[] args) throws Exception { | |
DatagramSocket socket = new DatagramSocket(6969); | |
System.out.println("Started server"); | |
while (true) { | |
byte[] req = new byte[128]; | |
DatagramPacket request = new DatagramPacket(req, req.length); |
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 <stdio.h> | |
#include <unistd.h> | |
#include <sys/socket.h> | |
#include <stdlib.h> | |
#include <netinet/in.h> | |
#include <string.h> | |
#include <errno.h> | |
#define PORT 8080 | |
int main(int argc, char const *argv[]) |
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
/* Instructions: generate a keystore using: | |
keytool -genkey -v -keystore keystore -storepass password -keyalg RSA -keysize 2048 | |
If you change the keystore file name or the keystore password, make sure to do the same in code as well. | |
*/ | |
import java.io.*; | |
import java.net.*; | |
import java.nio.file.Files; | |
import javax.net.ssl.KeyManagerFactory; | |
import javax.net.ssl.SSLContext; | |
import javax.net.ssl.SSLServerSocket; |
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 <iostream> | |
std::string names[119] = {"Hydrogen", "Helium", "Lithium", "Beryllium", "Boron", "Carbon", "Nitrogen", "Oxygen", "Fluorine", "Neon", "Sodium", "Magnesium", "Aluminium", "Silicon", "Phosphorus", "Sulfur", "Chlorine", "Argon", "Potassium", "Calcium", "Scandium", "Titanium", "Vanadium", "Chromium", "Manganese", "Iron", "Cobalt", "Nickel", "Copper", "Zinc", "Gallium", "Germanium", "Arsenic", "Selenium", "Bromine", "Krypton", "Rubidium", "Strontium", "Yttrium", "Zirconium", "Niobium", "Molybdenum", "Technetium", "Ruthenium", "Rhodium", "Palladium", "Silver", "Cadmium", "Indium", "Tin", "Antimony", "Tellurium", "Iodine", "Xenon", "Cesium", "Barium", "Lanthanum", "Cerium", "Praseodymium", "Neodymium", "Promethium", "Samarium", "Europium", "Gadolinium", "Terbium", "Dysprosium", "Holmium", "Erbium", "Thulium", "Ytterbium", "Lutetium", "Hafnium", "Tantalum", "Tungsten", "Rhenium", "Osmium", "Iridium", "Platinum", "Gold", "Mercury", "Thallium", "Lead", "Bismuth", "Polonium", "Astatine", "Radon", "Fr |
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
# This script Build GCompris from source for you, including the dependencies, hopefully without any errors. | |
# Installation is hone in the home directory. To change, replace the path below. | |
cd ~ | |
# So that we have to enter the password only once | |
sudo -H su | |
# Install dependencies + Qt | |
apt-get install -y cmake g++ libgl1-mesa-dev qtdeclarative5-dev libqt5svg5-dev qml-module-qtquick-particles2 qttools5-dev-tools libqt5xmlpatterns5-dev qml-module-qtmultimedia qt5-default qml-module-qtgraphicaleffects qt5-qmake qtcreator qtmultimedia5-dev qttools5-dev qttools5-dev-tools libqt5multimedia5-plugins qml-module-qtsensors libqt5quickparticles5 qml-module-qtquick2 qml-module-qtquick-particles2 libqt5sensors5-dev libqt5sensors5 |