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 requests | |
| from bs4 import BeautifulSoup | |
| BASE_URL = "http://en.wiktionary.org/wiki/{}#Danish" | |
| WORDS = ['foo', 'bar', 'baz'] | |
| def main(): | |
| ans = [] | |
| for word in WORDS: | |
| soup = BeautifulSoup(requests.get(BASE_URL.format(word)).text) |
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 requests | |
| from bs4 import BeautifulSoup | |
| BASE_URL = "http://ordnet.dk/ddo/ordbog?query={}" | |
| def main(path_to_file): | |
| ans = [] | |
| words = [line.split(" ")[0] for line in open(path_to_file)] | |
| for word in words: |
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 requests | |
| from bs4 import BeautifulSoup | |
| from concurrent import futures | |
| BASE_URL = "http://ordnet.dk/ddo/ordbog?query={}" | |
| def get_ipa(word): | |
| soup = BeautifulSoup(requests.get(BASE_URL.format(word)).text) | |
| try: | |
| return soup.select(".lydskrift")[0].contents[1] |
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
| (* In util.pml: *) | |
| structure PArrayPair = struct | |
| type ('a, 'b) t = ('a * 'b) parray | |
| fun fromPairPArray (xs : ('a * 'b) parray) : ('a, 'b) t = | |
| xs | |
| ... | |
| end |
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
| datatype ('a, 'b) t2 | |
| = E2 | |
| | Nd2 of 'a * ('a, 'b) t3 * ('a, 'b) t3 | |
| and ('a, 'b) t3 | |
| = E3 | |
| | Nd3 of 'b * ('a, 'b) t2 * ('a, 'b) t2 * ('a, 'b) t2 | |
| (* Collect all the items from a t2/t3 tree into a |
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 java.util.Scanner; | |
| import java.util.ArrayList; | |
| class StarMatrix { | |
| ArrayList<ArrayList<Boolean>> stars; | |
| public StarMatrix (Scanner inputScanner) { | |
| stars = new ArrayList<ArrayList<Boolean>>(); | |
| String currentLine; |
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
| while (inputScanner.hasNext()) { | |
| Scanner currentLine = Scanner(inputScanner.nextLine()); | |
| while(currentLine.hasNextInt()){ | |
| Integer current = currentLine.nextInt(); | |
| } | |
| } |
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
| signature WRAPPABLE = sig | |
| datatype node' = A | |
| end | |
| structure CReturnTyToWrap = struct | |
| datatype node' = A | |
| end | |
| functor WrapStruct(S : WRAPPABLE) = struct |
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 HDF5CompoundDSBridgeFactory { | |
| private HDF5CompoundType type; | |
| private IHDF5CompoundWriter writer; | |
| private long startSize; | |
| private int chunkSize; | |
| public HDF5CompoundType getType() { | |
| return type; | |
| } |
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
| @Before | |
| public void setUp() throws Exception { | |
| File file = new File(TEST_PATH); | |
| IHDF5Writer writer = HDF5Writer.getDefaultWriter(file); | |
| HDF5CompoundDSBridgeFactory intBuilder = new HDF5CompoundDSBridgeFactory(writer); | |
| intBuilder.setChunkSize(5); | |
| intBuilder.setStartSize(10); | |
| intBuilder.setTypeFromInferred(Integer.class); | |
| intBridge = intBuilder.build(TEST_DS); |
OlderNewer