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
def dfs(adj_list, start, target, path, visited=set()): | |
path.append(start) | |
visited.add(start) | |
if start == target: | |
return path | |
for neighbour in adj_list[start]: | |
if neighbour not in visited: | |
result = dfs(adj_list, neighbour, target, path, visited) | |
if result is not None: |
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
#ref https://gnomezgrave.com/2020/01/26/get-notified-on-aws-glue-job-failures/ | |
Resources: | |
MyGlueJobFailEvent: | |
Type: AWS::Events::Rule | |
Properties: | |
Description: This rule is to detect if the Glue Jobs fails | |
EventPattern: | |
source: |
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
import awswrangler as wr | |
import pandas as pd | |
df = pd.DataFrame({"id": [1, 2], "value": ["foo1", "boo1"]}) | |
print(df) | |
bucketPath = 's3://press0-test/awswrangler/' | |
database="awswrangler" | |
table="awswrangler_table1" | |
# Storing data on Data Lake |
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
class SettingsTests(TestCase): | |
@mock.patch.dict(os.environ, {"FROBNICATION_COLOUR": "ROUGE"}) | |
def test_frobnication_colour(self): | |
colour = os.environ["FROBNICATION_COLOUR"] | |
self.assertEqual(colour, "ROUGE") |
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
git log --oneline --decorate --all --graph |
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
<!DOCTYPE NETSCAPE-Bookmark-file-1> | |
<!-- This is an automatically generated file. | |
It will be read and overwritten. | |
DO NOT EDIT! --> | |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> | |
<TITLE>Bookmarks</TITLE> | |
<H1>Bookmarks Menu</H1> | |
<DL><p> | |
<DL><p> |
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
import static org.junit.jupiter.api.Assertions.assertEquals; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.junit.jupiter.api.Test; | |
public class ConvertMoneyToEnglish { | |
public static String convertMoneyToEnglish(int i) { |
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 trp2.redonejunit5; | |
import static org.junit.Assert.assertTrue; | |
import static org.junit.jupiter.api.Assertions.assertThrows; | |
import org.junit.jupiter.api.Test; | |
class TradeExecutorJUnit5Test { |
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 trp2.redonejunit4; | |
import static org.junit.Assert.assertTrue; | |
import static org.junit.Assert.fail; | |
import org.junit.Test; | |
public class TradeExecutorJUnit4Test { |
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
import static java.util.stream.Collectors.counting; | |
import static org.junit.Assert.assertArrayEquals; | |
import java.util.Arrays; | |
import java.util.Map; | |
import java.util.function.Function; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; |
NewerOlder