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
PM> Scaffold-DbContext "Server=.;database=H_Plus_Sports;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models | |
Startup project 'src\HPlusSportsAPI' is an ASP.NET Core or .NET Core project for Visual Studio 2015. This version of the Entity Framework Core Package Manager Console Tools doesn't support these types of projects. |
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.FileWriter; | |
public class Calculator implements Runnable | |
{ | |
@Override | |
public void run() | |
{ | |
long current = 1L; | |
long max = 20000L; | |
long numPrimes = 0L; |
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
// Interrupting a thread | |
import java.util.concurrent.TimeUnit; | |
public class Main { | |
public static void main(String[] args) { | |
// Launch the prime numbers generator | |
Thread task = new PrimeGenerator(); |
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 Example03; | |
import java.io.File; | |
public class FileSearch implements Runnable { | |
private String initPath; | |
private String fileName; | |
public FileSearch(String initPath, String fileName) { |
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.util.Date; | |
import java.util.concurrent.TimeUnit; | |
public class ConsoleClock implements Runnable { | |
@Override | |
public void run() { | |
for (int i = 0; i < 10; i++) { | |
System.out.printf("%s\n", new Date()); | |
try { |
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.util.Date; | |
import java.util.concurrent.TimeUnit; | |
public class DataSourcesLoader implements Runnable { | |
@Override | |
public void run() { | |
// Writes a messsage | |
System.out.printf("Begining data sources loading: %s\n",new Date()); |
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.util.Date; | |
import java.util.Deque; | |
public class CleanerTask extends Thread { | |
private Deque<Event> deque; | |
public CleanerTask(Deque<Event> deque) { | |
this.deque = deque; | |
// Establish that this is a Daemon Thread |
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.util.Arrays; | |
public class BinarySearch | |
{ | |
private BinarySearch() { } | |
public static int indexOf( int[] a, int key ) | |
{ | |
int lo = 0; | |
int hi = a.length - 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
public class RandomSeq | |
{ | |
private RandomSeq() { } | |
public static void main( String[] args ) | |
{ | |
int n = Integer.parseInt( args[0] ); | |
if ( args.length == 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
public class Average | |
{ | |
private Average() { } | |
public static void main( String[] args ) | |
{ | |
int count = 0; | |
double sum = 0.0; | |
while ( !StdIn.isEmpty() ) |
OlderNewer