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 modin.pandas as pd | |
# import pandas as pd | |
import pandas_market_calendars as mcal | |
import ray | |
ENTITIES = ['037833100', '594918104', '023135106', '30231G102', '478160104', '30303M102', '369604103', '00206R102', | |
'46625H100', '742718109', '02079K305', '949746101', '931142103', '92343V104', '717081103', '084670702', | |
'166764100', '191216100', '458140100', '58933Y105', '68389X105', '060505104', '20030N101', '437076102', | |
'92826C839', '17275R102', '718172109', '713448108', '254687106', '459200101', '172967424', '91324P102', | |
'031162100', '02209S103', '57636Q104', '88579Y101', '500754106', '806857108', '375558103', '00287Y109', |
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
def change(amount): | |
assert(24 <= amount <= 1000) | |
if amount == 24: | |
return [5, 5, 7, 7] | |
if amount == 25: | |
return [5, 5, 5, 5, 5] | |
if amount == 26: | |
return [5, 7, 7, 7] | |
if amount == 27: |
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 urllib.parse import quote_plus | |
url_base = 'https://rxnav.nlm.nih.gov/REST' | |
def lookup_bn(rxcui): | |
brand_names = {} | |
url = f'{url_base}/rxcui/{rxcui}/related.json?tty=BN' |
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 PartitionCounter { | |
public static void main(String[] args) { | |
// System.out.print("["); | |
// for (int k = 0; k < 201; k++) { | |
// System.out.print(count(k) + (k != 200 ? ", " : "")); | |
// } | |
// System.out.print("]"); | |
System.out.println("11: " + count(11)); | |
} |
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
Dec 18 10:19:46 b436016615eb epf-vault-prd-cmd info Caused by: org.springframework.messaging.MessageHandlingException: nested exception is java.lang.ClassCastException: java.lang.String cannot be cast to com.epf.vault.domain.ArchiverSummary | |
Dec 18 10:19:46 b436016615eb epf-vault-prd-cmd info at org.springframework.integration.dsl.LambdaMessageProcessor.processMessage(LambdaMessageProcessor.java:130) | |
Dec 18 10:19:46 b436016615eb epf-vault-prd-cmd info at org.springframework.integration.handler.ServiceActivatingHandler.handleRequestMessage(ServiceActivatingHandler.java:89) | |
Dec 18 10:19:46 b436016615eb epf-vault-prd-cmd info at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:109) | |
Dec 18 10:19:46 b436016615eb epf-vault-prd-cmd info at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127) | |
Dec 18 10:19:46 b436016615eb epf-vault-prd-cmd info at org.springframework. |
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
2017-12-18T16:58:12.466Z [epf-vault-prd-cmd da6a59732735]: [org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer#4-2] WARN o.s.a.r.l.ConditionalRejectingErrorHandler - Execution of Rabbit message listener failed. | |
2017-12-18T16:58:12.466Z [epf-vault-prd-cmd da6a59732735]: org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener threw exception | |
2017-12-18T16:58:12.466Z [epf-vault-prd-cmd da6a59732735]: at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.wrapToListenerExecutionFailedExceptionIfNeeded(AbstractMessageListenerContainer.java:941) | |
2017-12-18T16:58:12.466Z [epf-vault-prd-cmd da6a59732735]: at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:851) | |
2017-12-18T16:58:12.466Z [epf-vault-prd-cmd da6a59732735]: at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:771) | |
201 |
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
<?xml version="1.0"?> | |
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd"> | |
<Configure id="Server" class="org.eclipse.jetty.server.Server"> | |
<Ref refid="httpConfig"> | |
<Call name="addCustomizer"> | |
<Arg> | |
<New class="org.eclipse.jetty.server.ForwardedRequestCustomizer"/> | |
</Arg> | |
</Call> | |
</Ref> |
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
Code from slides 41 - 44 of [Laziness, trampolines, monoids and other functional amenities: this is not your father's Java] | |
(http://www.slideshare.net/mariofusco/lazine). | |
"A trampoline is an iteration applying a list of functions. Each function returns the next function for the loop to run." |
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
(define (safe-string-head s start) ; gives 'up to' 6 or remaining | |
(let ((sl (string-length s))) | |
(if (>= sl start) | |
(string-head s start) | |
(string-head s sl)))) | |
(define (safe-string-tail s end) ; gives 'up to' 6 and remaining | |
(let ((sl (string-length s))) | |
(if (>= sl end) | |
(string-tail s 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |