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
/// usr/bin/env jbang "$0" "$@" ; exit $? | |
// A exécuter avec JBang : jbang heroes-frequencies-map-multi.java | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.time.Duration; | |
import java.util.Map; | |
import java.util.concurrent.ConcurrentHashMap; | |
import java.util.List; |
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
/// usr/bin/env jbang "$0" "$@" ; exit $? | |
// A exécuter avec JBang : jbang frequencies-map-in-concurrent-context.java | |
import java.time.Duration; | |
import java.util.concurrent.atomic.LongAdder; | |
import java.util.concurrent.ConcurrentHashMap; | |
import java.util.Map; | |
import java.util.List; | |
class FrequenciesMapUpdater implements Runnable { |
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
/// usr/bin/env jbang "$0" "$@" ; exit $? | |
// A exécuter avec JBang : jbang long-adder-counter.java | |
import java.time.Duration; | |
import java.util.concurrent.atomic.LongAdder; | |
interface LongCounter { | |
String name(); | |
void increment(); | |
long value(); |
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
/// usr/bin/env jbang "$0" "$@" ; exit $? | |
// A exécuter avec JBang : jbang atomic-long-counter.java | |
import java.time.Duration; | |
import java.util.concurrent.atomic.AtomicLong; | |
interface LongCounter { | |
String name(); | |
void increment(); | |
long value(); |
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
/// usr/bin/env jbang "$0" "$@" ; exit $? | |
// A exécuter avec JBang : jbang synchronized-counter.java | |
import java.time.Duration; | |
interface LongCounter { | |
String name(); | |
void increment(); | |
long value(); | |
} |
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
/// usr/bin/env jbang "$0" "$@" ; exit $? | |
// A exécuter avec JBang : jbang naive-counter-in-concurrent-context.java | |
import java.time.Duration; | |
class NotSynchronizedLongCounter { | |
private long counter; | |
private final String name; | |
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
/// usr/bin/env jbang "$0" "$@" ; exit $? | |
// A exécuter avec JBang : jbang naive-counter-with-one-thread.java | |
import java.time.Duration; | |
class NotSynchronizedLongCounter { | |
private long counter; | |
private final String name; | |
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
bonjour = "Hello World" | |
print(bonjour) | |
for c in reversed(bonjour): | |
print(c, end="") | |
print() | |
print([c for c in reversed(bonjour)]) |
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
tuple = (1, 2, 3, 4) | |
for i in reversed(tuple): | |
print(str(i) + " ", end="") |
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
print('Compte à rebours :') | |
for i in reversed(range(10)): | |
print(i) |
NewerOlder