Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Active!

Vivek Maskara maskaravivek

💭
Active!
View GitHub Profile
View gist:b5bb7f01382540dd21a6673ee3904f12
const win = new BrowserWindow({
width: 640,
height: 420,
webPreferences: {
nodeIntegration: true,
preload: path.join(__dirname, 'preload.js')
}
})
View gist:473a933f11dc2c366f0fcdda577232b2
const { ipcMain } = require('electron')
ipcMain.on('hotspot-event', (event, arg) => {
event.returnValue = 'Message received!'
require('electron').shell.openExternal(`https://explorer.helium.com/hotspots/${arg}`);
})
View gist:02920f23b7727d934772c865a54e9c44
const electron = require('electron')
const ipc = electron.ipcRenderer
window.addEventListener('DOMContentLoaded', () => {
document.getElementById('web_btn').addEventListener("click", function () {
let active_hotspot_id = localStorage.getItem('active_hotspot_id')
const reply = ipc.sendSync('hotspot-event', active_hotspot_id)
});
})
View cater_all_composite_actions.py
COMPOSITE_ACTIONS = [((('sphere', '_slide'), ('sphere', '_slide')), ('before',)), ((('sphere', '_slide'), ('sphere', '_slide')), ('during',)), ((('sphere', '_slide'), ('sphere', '_pick_place')), ('before',)), ((('sphere', '_slide'), ('sphere', '_pick_place')), ('during',)), ((('sphere', '_slide'), ('sphere', '_pick_place')), ('after',)), ((('sphere', '_slide'), ('spl', '_slide')), ('before',)), ((('sphere', '_slide'), ('spl', '_slide')), ('during',)), ((('sphere', '_slide'), ('spl', '_slide')), ('after',)), ((('sphere', '_slide'), ('spl', '_pick_place')), ('before',)), ((('sphere', '_slide'), ('spl', '_pick_place')), ('during',)), ((('sphere', '_slide'), ('spl', '_pick_place')), ('after',)), ((('sphere', '_slide'), ('spl', '_rotate')), ('before',)), ((('sphere', '_slide'), ('spl', '_rotate')), ('during',)), ((('sphere', '_slide'), ('spl', '_rotate')), ('after',)), ((('sphere', '_slide'), ('cylinder', '_pick_place')), ('before',)), ((('sphere', '_slide'), ('cylinder', '_pick_place')), ('during',)), ((('sphere'
View 05e8b41a-59a2-451e-b0f2-f12fa3223954
import xgboost as xgb
from scipy.stats import uniform, randint
from sklearn.model_selection import RandomizedSearchCV
xgb_model = xgb.XGBRegressor(n_estimators= 300, max_depth=7, learning_rate= 0.18 )
xgb_model.fit(X_train, y_train)
ypred = xgb_model.predict(X_test)
plot_predictions(y_test, ypred)
View 892aa1ce-d446-44b2-92c0-df61cd22490c
from sklearn.ensemble import GradientBoostingRegressor
gb = GradientBoostingRegressor(loss ='huber', n_estimators=300, max_depth=5,)
gb.fit(X_train,y_train)
ypred = gb.predict(X_test)
plot_predictions(y_test, ypred)
View 39657e9c-ca97-4df0-bec5-d00977648000
plt.figure(figsize = (8,4))
pred = rfr.predict(X_test)
plot_predictions(y_test, pred)