Skip to content

Instantly share code, notes, and snippets.

Avatar
😁

JaDoggx86 JaDogg

😁
View GitHub Profile
@JaDogg
JaDogg / HTMLEditorCustomizationSample.java
Last active Aug 29, 2015 — forked from jewelsea/HTMLEditorCustomizationSample.java
Sample Showing how to add an image to HTMLEditor
View HTMLEditorCustomizationSample.java
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ToolBar;
import javafx.scene.web.HTMLEditor;
import javafx.stage.Stage;
View JavaFXImageConversion.java
import javafx.scene.image.Image;
import javax.imageio.ImageIO;
import java.awt.image.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
public Image getJavaFXImage(byte[] rawPixels, int width, int height) {
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
ImageIO.write((RenderedImage) createBufferedImage(rawPixels, width, height), "png", out);
@JaDogg
JaDogg / rsctobyte.java
Created Jul 11, 2014
Resource to byte Array
View rsctobyte.java
try {
InputStream is = this.getClass().getResourceAsStream(
"/classpath/dummy.png");
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
int nRead;
byte[] data = new byte[16384];
while ((nRead = is.read(data, 0, data.length)) != -1) {
@JaDogg
JaDogg / Coordinate.java
Last active Aug 29, 2015
Kryo & Apache Commons Codec. Object to base64 string serialization (+ JavaFX SimpleStringProperty).
View Coordinate.java
package jadogg.test;
import java.util.List;
import java.util.Optional;
import javafx.beans.property.SimpleStringProperty;
/**
* Coordinate Class
* @author jadogg
*/
View WebViewConfirm.java
import javafx.application.Application;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.event.*;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.effect.BoxBlur;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.*;
View FXMLTime.fxml
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane id="AnchorPane" prefHeight="111.0" prefWidth="266.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="FXMLTimeController">
<children>
View Euler2.c
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
int sum_even_fibonacci(int limit, int *steps_taken) {
int a = 1, b = 0;
int sum = 0;
int even_fibonacci = 0;
for (int steps = 1; even_fibonacci < limit; steps++) {
assert(a % 2); // Fibonacci just before even Fibonacci
@JaDogg
JaDogg / Question1.md
Last active Aug 29, 2015
Questions to see if within scope
View Question1.md

Once I called a favor from a friend and I got called for an interview.

I went there expecting an interview for an internship, however as it turned out it was for a bigger position. I realized this just before the interview and I thought it might be impossible.

During the interview I was asked lot of questions, And whenever I receive a question I do not know the answer, I simply said I don't know (This happened a lot). There was also a question where I had to write some code, I did answer it but the interviewer said It was inefficient, I understood the scenario and tried again, But I could not come up with another solution so I gave up. The interview (which was face to face) was about 1hr 30min long. at around 50 min time I was overwhelmed.

I was not hired, but I learned that the interviewer said to my friend that I was arrogant and I did not take the interview seriously.

I have another interview soon, how do I say I don't know (or give up) without sounding arrogant ? Is there some big point I'm f

@JaDogg
JaDogg / q.md
Last active Aug 29, 2015
Q & A for internship interview
View q.md

##Can you tell us about your self ?

Hi, I'm Bhathiya. I love code, and I love code review. I don't know everything, but I am comfortable with Java-stuff. I understand you guys use C++-whatnot, which I am excited to dive in to and learn.

##What are the projects you have done ?

###Research Project

  1. for the third year research project we built a card game. me and another member was the only people to receive A passes from the whole batch (other projects were not bad we were just exceptional).
  2. We were able to achieve it by
  • Good teamwork. (we eventually got the members who were bad in programming to contribute)
View JSONSplit.java
package jsonsplit;
import java.util.ArrayList;
import java.util.List;
/**
* JSON Split
* @author Bhathiya
*/
public class JSONSplit {