- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
- They are the people who get things done. Effective Engineers produce results.
@SessionScoped | |
public class ConversationLocks implements Serializable { | |
private final ConcurrentHashMap<String, Lock> conversationLocks = new ConcurrentHashMap<>(); | |
public Lock get(String cid) { | |
ReentrantLock newLock = new ReentrantLock(); | |
Lock alreadyAvailableLock = conversationLocks.putIfAbsent(cid, newLock); | |
return alreadyAvailableLock == null ? newLock : alreadyAvailableLock; | |
} |
#include <time.h> // Robert Nystrom | |
#include <stdio.h> // @munificentbob | |
#include <stdlib.h> // for Ginny | |
#define r return // 2008-2019 | |
#define l(a, b, c, d) for (i y=a;y\ | |
<b; y++) for (int x = c; x < d; x++) | |
typedef int i;const i H=40;const i W | |
=80;i m[40][80];i g(i x){r rand()%x; | |
}void cave(i s){i w=g(10)+5;i h=g(6) | |
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u |
<?xml version="1.0"?> | |
<!DOCTYPE module PUBLIC | |
"-//Puppy Crawl//DTD Check Configuration 1.2//EN" | |
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> | |
<module name="Checker"> | |
<property name='localeCountry' value='' /> | |
<property name='localeLanguage' value='' /> |