Skip to content

Instantly share code, notes, and snippets.

View tranvanthuc's full-sized avatar

Tran Van Thuc tranvanthuc

View GitHub Profile
package src;
import java.awt.EventQueue;
import javax.swing.JFrame;
import java.awt.GridBagLayout;
import java.awt.FlowLayout;
import javax.swing.JTextField;
import javax.swing.ScrollPaneConstants;
package src;
import java.util.Arrays;
public class MainClass {
private static double[] arr;
private static double[] tempArr;
public static String toStringArray(){
String result = "\nArray default: "+SortingAlgorithms.toStringArray(arr);
package src;
public class SortingAlgorithms {
public static double[] bubbleSort(double[] myArray) {
double[] arr = new double[myArray.length];
System.arraycopy(myArray, 0, arr, 0, myArray.length);
for (int i = 0; i < arr.length - 1; i++) {
for (int j = 0; j < arr.length - i - 1; j++) {
if (arr[j] > arr[j + 1]) {
@tranvanthuc
tranvanthuc / cloudSettings
Created November 1, 2017 06:26
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-11-01T06:25:48.072Z","extensionVersion":"v2.8.3"}
@tranvanthuc
tranvanthuc / socket-cheatsheet.js
Created December 23, 2019 15:51 — forked from alexpchin/socket-cheatsheet.js
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender