Skip to content

Instantly share code, notes, and snippets.

View ajoydas's full-sized avatar

Ajoy Das ajoydas

View GitHub Profile
@ajoydas
ajoydas / Controller.java
Created December 16, 2016 07:20
Service java fx
package sample;
import javafx.concurrent.Service;
import javafx.concurrent.Task;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.TextArea;
import java.io.BufferedReader;
public void mouseClicked(MouseEvent mouseEvent) {
FilePathTreeItem item = (FilePathTreeItem) treeView.getSelectionModel().getSelectedItem();
System.out.println(item.getAbsolutePath());
showItems(item);
}
public class FilePathTreeItem extends TreeItem<String>{
private final File file;
@Override
@ajoydas
ajoydas / 0_reuse_code.js
Created May 23, 2017 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ajoydas
ajoydas / RawQueryExecutionTime.sql
Last active July 6, 2017 10:31
This Oracle procedure counts the time required to run a single, total & avg. query time.
In {FOR i in 1..30} set how many time you want to iterate & set same value to
{dbms_output.put_line('Avg Time: '||(totaltime/30));} in the last line to find the avg.
Here I have set 30 times to iterate.
You have to call it like-
DECLARE
BEGIN
dbms_output.put_line('Query 1');
performance('Select u.accountId , count(b.badgesId) as cnt From Users u, Badges b where u.userId = b.userId and u.communityId = 1 and b.badgesdate between ''01-jan-2015'' and ''01-jun-2017'' group by u.accountId order by cnt DESC');
dbms_output.put_line('Query 2');
/*
Navicat Oracle Data Transfer
Oracle Client Version : 10.2.0.5.0
Source Server : OracleHr
Source Server Version : 110200
Source Host : :1521
Source Schema : HR
Target Server Type : ORACLE
import pandas as pd
from pandas.io.json import json_normalize
from pymongo import MongoClient
import matplotlib.pyplot as plt
import re
import time
pd.set_option('display.expand_frame_repr', False)
def _connect_mongo(host, port, db):
@ajoydas
ajoydas / Ml_regressor_brigntness.py
Last active November 2, 2017 08:41
Added Feature Scaling to y_test and y_train
import pandas as pd
import csv
import numpy as np
def createDict(labelFile):
csvfile = open(labelFile, "r")
reader = csv.reader(csvfile)
labelDict = {}
import pandas as pd
import csv
import numpy as np
def createDict(labelFile):
csvfile = open(labelFile, "r")
reader = csv.reader(csvfile)
labelDict = {}
@ajoydas
ajoydas / MessageActivity.java
Created November 20, 2017 19:05
SMS dualsim
package com.buet.dualsim.dualsim.activities;
import android.Manifest;
import android.app.Activity;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
@ajoydas
ajoydas / ns2-olsr-ubuntu-xenial.md
Created November 30, 2017 22:26 — forked from slashsbin/ns2-olsr-ubuntu-xenial.md
Install & Setup NS2(w/ UM-OLSR Patch) on Ubuntu 16.04

Upgrade Ubuntu

sudo apt update
sudo apt upgrade -Vy

Download NS2

Download NS2 & OLSR: