A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
| #!/usr/bin/env groovy | |
| /* | |
| * deas - http://www.contentreich.de/generic-brute-force-sql-search-groovy-style | |
| * | |
| * Created on Mar 15, 2012 | |
| * | |
| * Licensed to the Apache Software Foundation (ASF) under one or more | |
| * contributor license agreements. See the NOTICE file distributed with | |
| * this work for additional information regarding copyright ownership. | |
| * The ASF licenses this file to You under the Apache License, Version 2.0 |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
| import javax.ws.rs.client.Client; | |
| import javax.ws.rs.client.ClientBuilder; | |
| import org.apache.http.HttpHost; | |
| import org.apache.http.conn.routing.HttpRoute; | |
| import org.apache.http.impl.conn.PoolingClientConnectionManager; | |
| import org.glassfish.jersey.apache.connector.ApacheClientProperties; | |
| import org.glassfish.jersey.apache.connector.ApacheConnector; | |
| import org.glassfish.jersey.client.ClientConfig; | |
| import org.glassfish.jersey.client.ClientProperties; |
| A comparison of Collection+JSON, HAL, JSON-LD and SIREN media types. | |
| Discussion at | |
| http://sookocheff.com/posts/2014-03-11-on-choosing-a-hypermedia-format/ |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
| # Requirements: | |
| # - download MarkLogic EA 8 (MarkLogic-8.0-20141124.x86_64.rpm) into | |
| # same directory like this Dockerfile | |
| # | |
| # Build your own image: | |
| # docker build -t centos-marklogic8 . | |
| # | |
| # Start a new container with this image: | |
| # docker run -p 8000:8000 -p 8001:8001 centos-marklogic8 |
| # Steps we will take: | |
| # 1. Change boot2docker image type (this will take long) | |
| # 2. Resize image | |
| # 3. Resize partion (using GParted) | |
| # | |
| # Also see: https://docs.docker.com/articles/b2d_volume_resize/ | |
| # Stop boot2docker | |
| boot2docker stop |
(:identity req) is auth backend independent way to access user data:current-user doesn't imply that authentication is required, route should also have :auth-rules if authentication is required