Skip to content

Instantly share code, notes, and snippets.

View melvincabatuan's full-sized avatar
💭
deep learning

Melvin Cabatuan melvincabatuan

💭
deep learning
View GitHub Profile
package ph.edu.dlsu.lbycpei;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// METHOD 1: Hardcoded ASCII Art
import java.util.Scanner;
/*
*
* This program does not work as intended. It contains both
* compile-time errors (errors that prevent the compiler from even
* running the program) and run-time errors (errors where the
* program does not function as intended). Your job is to fix
* this program so that it works correctly. Note that it is *not*
nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Jan_28_19:41:49_Pacific_Standard_Time_2021
Cuda compilation tools, release 11.2, V11.2.142
Build cuda_11.2.r11.2/compiler.29558016_0
deviceQuery.exe Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
// prim_demo.cpp by Bo Qian
#include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm> // min_element
using namespace std;
struct Edge {
// kruskal_demo.cpp by Bo Qian
#include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm> // sort
struct Edge {
char node1;
char node2;
#include <iostream>
#include <string>
int main ()
{
std::string str1 ("The");
std::string str2 ("the");
std::string str3 ("fox");
if (str1.compare(str2) != 0)
@melvincabatuan
melvincabatuan / jaccard.py
Created July 27, 2020 11:26 — forked from ramhiser/jaccard.py
Jaccard cluster similarity in Python
import itertools
def jaccard(labels1, labels2):
"""
Computes the Jaccard similarity between two sets of clustering labels.
The value returned is between 0 and 1, inclusively. A value of 1 indicates
perfect agreement between two clustering algorithms, whereas a value of 0
indicates no agreement. For details on the Jaccard index, see:
http://en.wikipedia.org/wiki/Jaccard_index
(1, 3)
[[0 0 0]]
(6, 3)
(6, 3)
[[ 0 0 0]
[ 0 0 255]
[180 175 0]
[216 0 4]
[255 0 0]
[255 255 255]]
gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
try:
tf.config.experimental.set_virtual_device_configuration(gpus[0], [tf.config.experimental.VirtualDeviceConfiguration(memory_limit=1024)])
except RuntimeError as e:
print(e)
or
sudo rm -rf ~/.nv/
#Much code taken from https://github.com/roxas75/rxTools/blob/012a9c2fe99f2d421e68ae91f738b4028995ad67/tools/scripts/ncchinfo_gen.py
#Uses some bits and pieces from https://github.com/Mtgxyz2/3ds-FUSE
#Comments are for people that care about being able to read their code tommorrow :P
from __future__ import print_function
import os, sys, glob, struct
from Crypto.Cipher import AES
from Crypto.Util import Counter
from hashlib import sha256
from ctypes import *
from binascii import hexlify, unhexlify