Skip to content

Instantly share code, notes, and snippets.

View SohanChy's full-sized avatar

Sohan Chowdhury SohanChy

View GitHub Profile
@SohanChy
SohanChy / FXMLDocument.fxml
Created April 1, 2017 16:35
background image example in css
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="463.0" prefWidth="681.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1">
<children>
<BorderPane layoutX="21.0" layoutY="132.0" prefHeight="200.0" prefWidth="369.0" AnchorPane.bottomAnchor="1.0" AnchorPane.leftAnchor="1.0" AnchorPane.rightAnchor="1.0" AnchorPane.topAnchor="1.0">
@SohanChy
SohanChy / EditCell.java
Created January 21, 2017 16:00 — forked from james-d/EditCell.java
(Fairly) reusable edit cell that commits on loss of focus on the text field. Overriding the commitEdit(...) method is difficult to do without relying on knowing the default implementation, which I had to do here. The test code includes a key handler on the table that initiates editing on a key press.
import javafx.event.Event;
import javafx.scene.control.ContentDisplay;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableColumn.CellEditEvent;
import javafx.scene.control.TablePosition;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
@SohanChy
SohanChy / risk bfs.cpp
Created December 6, 2016 17:20
risk problem
#include <iostream>
#include <queue>
#include <sstream>
#include <cstdio>
using namespace std;
static const int NODE_NUM = 20;
@SohanChy
SohanChy / .env
Created September 25, 2016 16:41
krishi-laravel-env
APP_ENV=local
APP_DEBUG=true
APP_KEY=nISUDoFeU6xo9HzlBF3UJShbKGF7mHNf
DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
CACHE_DRIVER=file
@SohanChy
SohanChy / java-mysql-using-datasource.java
Last active February 24, 2017 17:20
java-mysql-using-datasource, "com.mysql.jdbc_5.1.5.jar" jar needs to be imported. Java mysql Datasource examples are scarce online.
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package dbplay;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
@SohanChy
SohanChy / CalculatorAwt.java
Created August 4, 2016 16:47
A basic calculator in AWT Java using OOP Principles
import java.awt.*;
import java.awt.event.*;
import java.lang.*;
public class CalculatorAwt extends Frame{
private Frame calcFrame;
private Panel calcPanel;
private TextField firstBox, secondBox;
private Label result;
@SohanChy
SohanChy / rifats-linked-list-fixed.cpp
Created July 23, 2016 17:24
Rifat er link list fixed
#include <iostream>
using namespace std;
struct node
{
int data;
node* next;
};
node* Head=NULL;
@SohanChy
SohanChy / Ipc.java
Last active July 28, 2016 14:44
Run a CLI from inside JAVA
import java.io.*;
public class Ipc{
public static void main(String[] args) throws IOException{
String programFileName = "pandoc";
String ExecLoc = System.getProperty("user.dir") + "/" + programFileName;
File f = new File(ExecLoc);
#include <iostream>
#define bigUInt unsigned long long int
using namespace std;
int main()
{
bigUInt n,m;
@SohanChy
SohanChy / palindromeCheck.c
Created June 9, 2016 16:22
Check palindrome
#include <stdio.h>
#include <stdlib.h>
int main()
{
int x = 0;
printf("Enter your number: ");
scanf("%d",&x);