Skip to content

Instantly share code, notes, and snippets.

View sanealytics's full-sized avatar

Saurabh Bhatnagar sanealytics

View GitHub Profile
@sanealytics
sanealytics / Rcgmin test
Created March 18, 2015 00:34
testing Rcgmin
data(MovieLense)
scheme <- evaluationScheme(MovieLense, method = "split", train = .9,
k = 1, given = 10, goodRating = 4)
scheme
# register recommender
recommenderRegistry$set_entry(
method="RSVD", dataType = "realRatingMatrix", fun=REAL_RSVD,
import urllib.request
import json
from pymongo import MongoClient
import time
def fetchAndStash(url, client):
try:
response = urllib.request.urlopen(url + '&count=100')
f = response.read()
payload = f.decode('utf-8')
import urllib.request
import json
from pymongo import MongoClient
import time
from multiprocessing import Pool
DEEP_DRESS_WGET = 'http://localhost/wget/?url='
DEEP_DRESS_PREDICT = 'http://localhost/predict/'
def wget_deep_dress(url):
library(mongolite)
# Connections to mongo
instagram <- mongo(collection = "InstagramV4", db = "DeepDress", url = "mongodb://localhost", verbose = FALSE)
matches <- mongo(collection = "MatchesV4", db = "DeepDress", url = "mongodb://localhost", verbose = FALSE)
corrections <- mongo(collection = "CorrectionsV4", db = "DeepDress", url = "mongodb://localhost", verbose = FALSE)
# Get Instagram data we saved earlier
ids.df <- instagram$find(fields = '{"_id" : 1, "payload.created_time" : 1}')
ids.df.simple <- data.frame(id = ids.df$`_id`,
library(shiny)
shinyUI(fluidPage(
# Application title
titlePanel("Verify Auto-tagged dresses from Instagram"),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
shinyServer(function(input, output, session) {
# Session level
idx <- round(runif(1, 1, 2500)) # random place to start
state <- reactive({
if(input$submit > 0) { # Not on first page load
isolate({ # Don't get reactive on me now
answer <- input$yesorno
@sanealytics
sanealytics / PinchAnimated.js
Last active May 18, 2021 19:21
Zoom into image and generate images in the zoomed in area
import React, { Component } from 'react';
import { StyleSheet, View, Image, } from 'react-native';
import {
PanGestureHandler,
State,
PinchGestureHandler,
TapGestureHandler,
} from 'react-native-gesture-handler';
import Animated, { Easing } from 'react-native-reanimated';
@sanealytics
sanealytics / ImageViewer.js
Created September 17, 2018 22:58
ImageViewer pinch generate
import React, { Component } from 'react';
import { StyleSheet, View, Image } from 'react-native';
import {
PanGestureHandler,
State,
PinchGestureHandler,
TapGestureHandler,
} from 'react-native-gesture-handler';
import Animated, { Easing } from 'react-native-reanimated';
@sanealytics
sanealytics / Podfile
Created September 28, 2018 20:53
Podfile
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
# Specify Workspace
workspace 'virevol3'
target 'virevol3' do
pod 'Stripe', '~> 11.2.0'
inherit! :search_paths
pod 'Firebase/Core'
Scanning folders for symlinks in /Users/saurabh/Documents/virevol3/node_modules (17ms)
Found Xcode workspace virevol3.xcworkspace
Launching iPhone 6 (iOS 12.0)...
Building using "xcodebuild -workspace virevol3.xcworkspace -configuration Debug -scheme virevol3 -destination id=80A84958-6B3F-41F1-85B3-01FA8D619375 -derivedDataPath build"
User defaults from command line:
IDEDerivedDataPathOverride = /Users/saurabh/Documents/virevol3/ios/build
note: Using new build system