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 <cuda_runtime.h> | |
#include <stdio.h> | |
#include <math.h> | |
__global__ void mult_each(float *A, float *B, float *C, int n) { | |
int idx = blockDim.x * blockIdx.x + threadIdx.x; | |
printf("Thread idx %d\n", idx); | |
if (idx < n * n) { | |
int i = floor(idx/((float)n)); | |
int j = idx % n; |
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 com.fasterxml.jackson.annotation.JsonProperty; | |
import com.fasterxml.jackson.core.JsonParser; | |
import com.fasterxml.jackson.core.JsonProcessingException; | |
import com.fasterxml.jackson.databind.DeserializationContext; | |
import com.fasterxml.jackson.databind.JsonDeserializer; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | |
import java.io.IOException; | |
import java.util.*; |
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 shutil | |
import argparse | |
import numpy as np | |
from scipy.misc import imsave | |
from keras.preprocessing.image import ImageDataGenerator | |
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
# Given an expression, computes its "complexity". | |
use strict; | |
use warnings; | |
use feature 'say'; | |
use Data::Dumper; | |
use Perlito5::Compiler; | |
use Perlito5::Perl5::Emitter; | |
use Perlito5::Perl5::PrettyPrinter; | |
use Data::Dumper; | |
use Perlito5::AST; |
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 __future__ import print_function | |
import time | |
import requests | |
BASE_URL = 'https://api.clever.com' | |
OAUTH_TOK = 'DEMO_TOKEN' |
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
Say your code resides in a dir called project/ locally and you want to push it up to an empty repo on github. Then, if your repo is called, say, foo, get its URL, e.g., https://github.com/sneha/foo.git and do | |
git remote add origin https://github.com/sneha/foo.git | |
from your project/ dir. After that, add files using `git add`. Use the followinng for all files: | |
git add . | |
Then commit changes |
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
Cloud.js | |
Cloud.js aims to be a compute-cloud implementation where users can submit jobs to be executed possibly in parallel on the server. The concept is similar to that of PiCloud. | |
The user first registers and obtains an API key and the client library. | |
From hereon, a request from the client library on behalf of the user or directly from the user will be assumed to be qualified with the mentioned API key, unless noted otherwise. | |
The client first submits a "job" using the HTTP(S) POST method on the RESTful interface exposed by the server. This can be done directly or using the client library. | |
A job consists of: |
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
# For example, to mount my Windows(NTFS) C:\ on /media/C I use this line: | |
/dev/sda1 /media/C ntfs defaults 0 0 | |
# So it is basically | |
#/dev/devicename /path/to/mountpoint <fstype> defaults 0 0 | |
# | |
# There can be as many spaces as you like between the fields - the last 3 fields can be repeated | |
# for most devices. | |
# The mount-point (2nd field) should exist. | |
# To see the changes after changing /etc/fstab w/o rebooting, execute `mount -a' as root. |