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
#include <SoftwareSerial.h> | |
// Arduino Nano 0 - RX 1 - TX | |
SoftwareSerial mySerial(0, 1); | |
void setup() { | |
Serial.begin(115200); | |
while (!Serial); |
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 appstart.mymodappdemo; | |
import java.util.concurrent.locks.ReentrantLock; | |
import java.util.concurrent.locks.Condition; | |
public class ReentrantLockApp { | |
public static void main(String[] args) { | |
Store store = new Store(); |
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 appstart.mymodappdemo; | |
import java.util.concurrent.Semaphore; | |
public class JavaSemaphoreApp { | |
public static void main(String[] args) { | |
Semaphore sem = new Semaphore(1); // how many times we can 'acquire' permission | |
CommonResource res = new CommonResource(); |
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 appstart.mymodappdemo; | |
public class WaitNotifyForThreads { | |
public static void main(String[] args) { | |
Store store = new Store(); | |
Producer producer = new Producer(store); | |
Consumer consumer = new Consumer(store); | |
new Thread(producer).start(); |
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 com.example.demo; | |
import java.util.Arrays; | |
public class FillRegionsMapInterviewTask { | |
// The Four-Color Theorem | |
// | |
// In mathematics, the four color theorem, or the four color map theorem, | |
// states that no more than four colors are required to color the regions | |
// of any map so that no two adjacent regions have the same color. |
OlderNewer