Python Sessions by Dr. Yves J. Hilpisch | The Python Quants GmbH
Online, 27. & 28. January 2018
import asyncio | |
from pyppeteer import launch | |
async def get_article_titles(keywords): | |
# launch browser in headless mode | |
browser = await launch({"headless": False, "args": ["--start-maximized"]}) | |
# create a new page | |
page = await browser.newPage() |
A backup of http://sites.google.com/site/redcodenl/creating-shazam-in-java-1 just in case | |
Why is this necessary? Read http://sites.google.com/site/redcodenl/patent-infringement | |
Please fork, tweet about, etc. | |
---- | |
Creating Shazam in Java | |
A couple of days ago I encountered this article: How Shazam Works | |
This got me interested in how a program like Shazam works… And more importantly, how hard is it to program something similar in Java? |
import requests | |
# I got a free token and secret key from the developer section in sentimentinvestor.com | |
token = "hidden my token" | |
secret_key = "hidden my secret key" | |
RHI_rank = requests.get("https://sentimentinvestor.com/api/v3/sort?limit=100&metric=RHI&token={0}&key={1}".format(token, secret_key)).json() | |
def get_analysis(recommendation): | |
strong_buy = recommendation["strongBuy"] | |
buy = recommendation["buy"] |
package com.megalit; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Random; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.Future; |
public class PerformanceUtil { | |
/* | |
A utility to detect slow running functions | |
*/ | |
public static final int WARN_THRESHOLD_MILLIS =1000; | |
public static <T> T timed(Executable<T> function) { |
You must provide the following configuration variables:
WP_XMLRPC_URL
= https://www.yourdomain.com/xmlrpc.php
(replace with your domain and use http:// if you don't have SSL support)WP_ADMIN_USER
= admin
(use your own admin username)WP_ADMIN_PASSWORD
= somepassword
(use your own admin password)// Credits: Adam's answer in http://stackoverflow.com/a/20786262/69362 | |
// Paste this in browser's console | |
var $rootScope = angular.element(document.querySelectorAll("[ui-view]")[0]).injector().get('$rootScope'); | |
$rootScope.$on('$stateChangeStart',function(event, toState, toParams, fromState, fromParams){ | |
console.log('$stateChangeStart to '+toState.to+'- fired when the transition begins. toState,toParams : \n',toState, toParams); | |
}); | |
$rootScope.$on('$stateChangeError',function(event, toState, toParams, fromState, fromParams){ | |
console.log('$stateChangeError - fired when an error occurs during transition.'); |
package jmh; | |
import org.openjdk.jmh.annotations.*; | |
import org.openjdk.jmh.profile.GCProfiler; | |
import org.openjdk.jmh.profile.StackProfiler; | |
import org.openjdk.jmh.runner.Runner; | |
import org.openjdk.jmh.runner.options.Options; | |
import org.openjdk.jmh.runner.options.OptionsBuilder; | |
import java.util.ArrayList; | |
import java.util.List; |
package jmh; | |
import com.netflix.servo.monitor.Counter; | |
import com.netflix.servo.monitor.MaxGauge; | |
import com.netflix.servo.monitor.MonitorConfig; | |
import com.netflix.servo.monitor.Monitors; | |