This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2017-11-01T06:25:48.072Z","extensionVersion":"v2.8.3"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |