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 org.junit.jupiter.api.Test; | |
| import static org.junit.jupiter.api.Assertions.*; | |
| class AccountTest { | |
| @Test | |
| public void testTransactions() throws Account.InsufficientFundsException { | |
| final Account account = new Account(); | |
| account.deposit(100); |
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 Account { | |
| public static class InsufficientFundsException extends Exception { | |
| } | |
| private int balance; | |
| public synchronized void transferTo(final int amount, final Account destination) throws InsufficientFundsException { | |
| synchronized (destination) { | |
| withdraw(amount); |
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 org.junit.Test; | |
| import static org.junit.Assert.assertEquals; | |
| import static org.junit.Assert.assertTrue; | |
| public class Account { | |
| public static class InsufficientFundsException extends Exception { | |
| } |
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 Account { | |
| public static class InsufficientFundsException extends Exception { | |
| } | |
| private int balance; | |
| public synchronized void transferTo(final int amount, final Account destination) throws InsufficientFundsException { | |
| synchronized (destination) { | |
| withdraw(amount); |
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
| #!/bin/sh | |
| # A simple wrapper around executing a Maven build to avoid starting up a JVM | |
| # and doing unnecessary work. | |
| if [ -n "$(find src -newer target)" ] | |
| then | |
| mvn package | |
| fi |
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
| SELECT perpetrator_group_name, SUM(nkill) AS total_killed FROM gtd WHERE country_txt = 'United States' AND nkill > 0 GROUP BY perpetrator_group_name ORDER BY total_killed DESC; | |
| perpetrator_group_name | total_killed | |
| --------------------------------------------------------------------------+-------------- | |
| Al-Qaida | 3001 | |
| Anti-Government extremists | 244 | |
| Jihadi-inspired extremists | 106 | |
| Unknown | 77 | |
| White extremists | 51 | |
| Black Nationalists | 24 |
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
| SELECT perpetrator_group_name, SUM(nkillus) AS total_killed FROM gtd WHERE country_txt = 'United States' AND nkillus > 0 GROUP BY perpetrator_group_name ORDER BY total_killed DESC; | |
| perpetrator_group_name | total_killed | |
| ---------------------------------------------------+-------------- | |
| Al-Qaida | 2907 | |
| Anti-Government extremists | 185 | |
| Jihadi-inspired extremists | 91 | |
| Unknown | 54 | |
| White extremists | 49 | |
| Black Nationalists | 23 |
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
| SELECT perpetrator_group_name, COUNT(perpetrator_group_name) AS incident_count FROM gtd WHERE country_txt = 'United States' GROUP BY perpetrator_group_name ORDER BY incident_count DESC; | |
| perpetrator_group_name | incident_count | |
| --------------------------------------------------------------------------+---------------- | |
| Unknown | 573 | |
| Anti-Abortion extremists | 196 | |
| Left-Wing Militants | 169 | |
| Fuerzas Armadas de Liberacion Nacional (FALN) | 120 | |
| White extremists | 87 | |
| New World Liberation Front (NWLF) | 86 |
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
| #!/bin/sh | |
| if [ $# -eq 0 ] | |
| then | |
| cat << EOF | |
| Usage: $0 <wordlist> > contacts.vcf | |
| Converts a list of words, one per line, in <wordList> into an address book in | |
| vCard/VCF format. This is useful for working around autocorrect problems on iOS. | |
| EOF | |
| exit 0 | |
| fi |
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
| Verifying that +genemcculley is my Bitcoin username. You can send me #bitcoin here: https://onename.io/genemcculley |