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 ru.tfs.concurrency.task2; | |
| import java.util.concurrent.Exchanger; | |
| import java.util.concurrent.locks.ReentrantLock; | |
| public class AccountThread implements Runnable { | |
| // private static final ReentrantLock lock = new ReentrantLock(true); | |
| private static final Object lock = new Object(); | |
| private final Account accountFrom; | |
| private final Account accountTo; |
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
| /home/eertree/.sdkman/candidates/java/17.0.1-tem/bin/java -javaagent:/snap/intellij-idea-community/345/lib/idea_rt.jar=35749:/snap/intellij-idea-community/345/bin -Dfile.encoding=UTF-8 -classpath /home/eertree/IdeaProjects/tinkoff/homework_2022/concurrency/target/classes ru.tfs.concurrency.task2.AccountMain | |
| Transaction status: true | |
| Cash balance of the first account: 99900 | |
| Cash balance of the second account: 100100 | |
| ----- | |
| Transaction status: true | |
| Cash balance of the first account: 99800 | |
| Cash balance of the second account: 100200 | |
| ----- | |
| Transaction status: true |
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 NBifrost; | |
| message TEvent { | |
| optional string UserId = 1; | |
| optional int64 EventType = 2; | |
| optional int64 ItemType = 3; | |
| optional sfixed64 ItemId = 4; | |
| optional int64 Timestamp = 5; | |
| optional int32 CountryGeoId = 6; | |
| optional int64 VideoPositionSec = 7; |
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
| class ListNode: | |
| def __init__(self, x): | |
| self.val = x | |
| self.next = None | |
| def reverseList(head: ListNode) -> ListNode: | |
| previous = None | |
| current = head | |
| while current: | |
| n = current.next |
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 <iostream> | |
| #include "queue.h" | |
| #include <cstring> | |
| #include <cstdlib> | |
| #include <cmath> | |
| #include <ctime> | |
| #include <locale.h> | |
| using namespace std; | |
| int main() { |
NewerOlder