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
public class Speed { | |
private final File FOLDER = new File("Files"); | |
String name = "movie.mp4"; | |
int port = 46789; | |
public static void main(String[] args) { | |
try { | |
ServerSocket serverSocket = new ServerSocket(port); | |
serverSocket.setReuseAddress(true); | |
Socket socket = serverSocket.accept(); | |
byte[] buffer = new byte[1024*1024]; |
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
import android.app.Dialog; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.provider.ContactsContract; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.support.v4.content.ContextCompat; | |
import android.util.Log; | |
import android.view.ActionMode; | |
import android.view.LayoutInflater; |
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
public class Converter{ | |
static long kilo = 1024; | |
static long mega = kilo * kilo; | |
static long giga = mega * kilo; | |
static long tera = giga * kilo; | |
public static void main(String[] args) { | |
for (String arg: args) { | |
try { | |
System.out.println(getSize(Long.parseLong(arg))); |
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
import javafx.animation.KeyFrame; | |
import javafx.animation.Timeline; | |
import javafx.application.Application; | |
import javafx.event.ActionEvent; | |
import javafx.event.EventHandler; | |
import javafx.geometry.Pos; | |
import javafx.scene.Scene; | |
import javafx.scene.control.Button; | |
import javafx.scene.layout.HBox; | |
import javafx.scene.layout.VBox; |
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
import java.io.*; | |
import java.net.*; | |
import java.util.Scanner; | |
public class Server { | |
private ServerSocket serverSocket = null; | |
private Socket socket = null; | |
private ServerThread serverThread; | |
Server(int port) { |
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
import java.net.*; | |
import java.util.*; | |
public class Ip { | |
public static void main(String[] args) { | |
getIPAddress(); | |
} | |
String getSubnetAddress(String ip) { |
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 sample; | |
import java.awt.*; | |
import java.io.*; | |
import java.net.ServerSocket; | |
import java.net.Socket; | |
public class Connection extends Thread { | |
final int PORT = 12345; | |
private boolean isRunning = true; |
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
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import java.util.List; | |
public class ListFile { | |
String fileName = "address_book.txt"; | |
List<String> list; | |
ListFile() { |
This file has been truncated, but you can view the full file.
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
000000 XEROX CORPORATION | |
000001 XEROX CORPORATION | |
000002 XEROX CORPORATION | |
000003 XEROX CORPORATION | |
000004 XEROX CORPORATION | |
000005 XEROX CORPORATION | |
000006 XEROX CORPORATION | |
000007 XEROX CORPORATION | |
000008 XEROX CORPORATION | |
000009 XEROX CORPORATION |
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
public class ExecutionTimer { | |
private static long startTime; | |
static { | |
startTime = -1; | |
} | |
public static void startTimer() { | |
startTime = System.currentTimeMillis(); | |
} |
OlderNewer