This file contains hidden or 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
fun def1(par: String) = | |
//Вызов которые нельзя менять | |
GlobalScope.async { | |
println(par + "-1: " + System.currentTimeMillis()) | |
Thread.sleep(1000) | |
if (par == "3") throw RuntimeException("error '3'") | |
par + "_map1" | |
} | |
fun def2(list: List<String>) = |
This file contains hidden or 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
#include "Nokia_5110.h" | |
#include "DHT.h" | |
#include "MQ135.h" | |
#define LCD_RST 7 | |
#define LCD_CE 6 | |
#define LCD_DC 5 | |
#define LCD_DIN 4 | |
#define LCD_CLK 3 |
This file contains hidden or 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 cun; | |
import java.util.concurrent.atomic.AtomicInteger; | |
public class TestCounter { | |
public static void main(String[] args) { | |
ExecutorService executors = Executors.newCachedThreadPool(); | |
Counter counter = new Counter(); |
This file contains hidden or 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.*; | |
public class TestNotify { | |
public static void main(String[] args) { | |
Stock stock = new Stock(); | |
Thread consumer = new Thread(new Consumer(stock)); | |
Thread producer = new Thread(new Producer(stock)); | |
consumer.start(); | |
producer.start(); |
This file contains hidden or 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 com.sun.net.httpserver.HttpExchange; | |
import com.sun.net.httpserver.HttpHandler; | |
import com.sun.net.httpserver.HttpServer; | |
import sun.net.httpserver.HttpServerImpl; | |
import java.io.IOException; | |
import java.io.OutputStream; | |
import java.net.InetSocketAddress; | |
import java.util.HashMap; | |
import java.util.Map; |
This file contains hidden or 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 Singlton | |
{ | |
private static class SingltonHolder | |
{ | |
private static final Singlton INSTANCE = new Singlton(); | |
} | |
public static Singlton getInstance() | |
{ | |
return SingltonHolder.INSTANCE; |