Skip to content

Instantly share code, notes, and snippets.

Avatar
😁

JaDoggx86 JaDogg

😁
View GitHub Profile
@JaDogg
JaDogg / 5digits.cpp
Created Jan 10, 2011
Input 5 digit number and output it space separated
View 5digits.cpp
#include <iostream>
// #define WINDOWS_OS //enable this line if you are using windows
#define INP cout << "Input : ";
using namespace std;
int x10(int x) {
// this func calculate 10 to ther power x
int n,m ;
m = 1;
if (x>0){
View paper1b_1.cpp
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
int m_upper;
double x,B = 0.0,den;
@JaDogg
JaDogg / wxmain.cpp
Created Aug 9, 2013
Wxwidgets hello world in single cpp file
View wxmain.cpp
/*$T indentinput.cpp GC 1.140 08/10/13 01:51:37 */
/*
* wxWidgets "Hello world" Program ;
* For compilers that support precompilation, includes "wx/wx.h".
*/
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
@JaDogg
JaDogg / Thread1000.cs
Created Dec 10, 2013
Run thousand threads !!
View Thread1000.cs
using System;
using System.Threading;
namespace ThousandThreads
{
class Thread1000
{
static void Main(string[] args)
{
for (int i = 1; i <=1000; i++)
@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;
@JaDogg
JaDogg / HTMLEditorCustomizationSample.java
Last active Oct 2, 2020 — forked from jewelsea/HTMLEditorCustomizationSample.java
Insert An Image On Caret Position JavaFX:HTMLEditor
View HTMLEditorCustomizationSample.java
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
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.scene.web.WebEngine;
import javafx.scene.web.WebView;
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.*;