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
function getSpreadsheetData(sheetName) { | |
// Return an list of objects (one for each row) containing the sheets data. | |
var arrayOfArrays = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName || 'Sheet1').getDataRange().getValues(); | |
var headers = arrayOfArrays.shift(); | |
return arrayOfArrays.map(function (row) { | |
return row.reduce(function (memo, value, index) { | |
if (value) { | |
memo[headers[index]] = value; | |
} |
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 json | |
import datetime | |
from flask import Response | |
# inport datastore client library | |
from google.cloud import datastore | |
# create new connection to datastore (will default connect to the one in the same project) | |
client = datastore.Client() |
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
for f in $(gsutil ls gs://YOUR_BUCKET/YOUR_IMAGES_FOLDER/); | |
do echo UNASSIGNED,$f,,,,,,,,,; | |
done >> labels.csv; |
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
arr[0]="TRAIN" | |
arr[1]="TRAIN" | |
arr[2]="TRAIN" | |
arr[3]="TRAIN" | |
arr[4]="TRAIN" | |
arr[5]="TRAIN" | |
arr[6]="TRAIN" | |
arr[7]="VALIDATION" | |
arr[8]="TEST" |
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
const drive_url_col = 2 | |
const ouput_text_col = 3 | |
function myFunction(e) { | |
var row_added = e.range.getRow() | |
Logger.log(row_added) | |
var drive_url = SpreadsheetApp.getActiveSheet().getRange(row_added, drive_url_col).getValue(); |
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
function onOpen() { | |
var ui = SpreadsheetApp.getUi(); | |
ui.createMenu("🔮 Predictions for cell") | |
.addItem('😃/😡 Sentiment', 'predict_on_row') | |
.addToUi(); | |
} | |
const output_column_number = 2 |
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
private Rect Get_object_bounding_box(GameObject game_object, Camera cam) | |
{ | |
// This is a relativly intense way as it is looking at each mesh point to calculate the bounding box. | |
// but it produces perfect bounding boxes so yolo. | |
// get the mesh points | |
Vector3[] vertices = game_object.GetComponent<MeshFilter>().mesh.vertices; | |
// apply the world transforms (position, rotation, scale) to the mesh points and then get their 2D position | |
// relative to the camera |
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
void Save_camera_image(Camera cam, string path){ | |
// set render target to target texture | |
var currentRT = RenderTexture.active; | |
RenderTexture.active = cam.targetTexture; | |
// Make a new texture and read the active Render Texture into it. | |
Texture2D image = new Texture2D(cam.targetTexture.width, cam.targetTexture.height); | |
image.ReadPixels(new Rect(0, 0, cam.targetTexture.width, cam.targetTexture.height), 0, 0); | |
image.Apply(); |
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
/* | |
Mathify prototype code | |
Author - Zack Akil, 24 Nov 2015 | |
*/ | |
function generateAddition(num){ | |
ran = Math.floor((Math.random() * (num-1)) + 1); | |
ran2 = num - ran; | |
return [ran,ran2]; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer