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
use Bizlunch\HelperBundle\Exception\ValidationException; | |
use Symfony\Component\Validator\Constraint; | |
use Symfony\Component\Validator\Exception\ValidatorException; | |
class SupplyDataChain | |
{ | |
private $value; |
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
SELECT * FROM ( | |
SELECT *, RANK() OVER (PARTITION BY day, month ORDER BY hits DESC) AS row_number FROM ( | |
SELECT country AS value, COUNT(*) AS hits, day, month | |
FROM hits_table | |
WHERE year = 2017 | |
GROUP BY country, month, day | |
HAVING COUNT(*) > 1000 | |
ORDER BY month, day, COUNT(*) DESC | |
) | |
) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.company.project</groupId> | |
<artifactId>TestSparkES</artifactId> | |
<version>1.0</version> |
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 org.apache.spark.ml.feature._ | |
import org.apache.spark.ml.Pipeline | |
import org.apache.spark.ml.linalg.Vector | |
import org.apache.spark.ml.classification._ | |
import org.apache.spark.rdd.RDD | |
import org.apache.spark.sql.expressions._ | |
import org.apache.spark.sql.functions._ | |
val categoryIndexer = new StringIndexer() | |
.setInputCol("category") |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.datahub.suggest.api</groupId> | |
<artifactId>DatahubSuggestAPI</artifactId> | |
<version>1.0</version> |
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 json, requests, os | |
from requests.auth import HTTPBasicAuth | |
cluster = os.environ["CLUSTER"] | |
url = "%s/api/v1/clusters/%s/services" % (os.environ["AMBARI_SERVER"], cluster) | |
respServices = requests.get(url, auth=HTTPBasicAuth(os.environ["AMBARI_LOGIN"], os.environ["AMBARI_PASSWORD"])).json() |
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
<?php | |
$m = new \Memcached(); | |
$m->addServer(getenv("MEMCACHED_HOST"), 11212); | |
var_dump($m->set('toto', ["toto" => "hello world!"], 3600)); | |
var_dump($m->get('toto')); |
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
#!/usr/bin/env bash | |
# Usage: kibana_register_indices.sh http://localhost:9200 http://localhost:5601 | |
ES=$1 | |
KIBANA=$2 | |
if [ -z "$ES" ]; | |
then | |
ES=http://elasticsearch:9200 |
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
SELECT wp_icl_translations.trid, | |
group_concat(case when wp_icl_translations.language_code = "sp" then wp_terms.name end) as title, | |
group_concat(case when wp_icl_translations.language_code = "sp" then wp_term_taxonomy.term_taxonomy_id end) as sp, | |
group_concat(case when wp_icl_translations.language_code = "en" then wp_term_taxonomy.term_taxonomy_id end) as en | |
FROM wp_terms | |
INNER JOIN wp_term_taxonomy ON wp_term_taxonomy.term_id = wp_terms.term_id | |
INNER JOIN wp_icl_translations ON wp_icl_translations.element_id = wp_term_taxonomy.term_taxonomy_id AND wp_icl_translations.element_type = "tax_event-categories" | |
WHERE wp_term_taxonomy.taxonomy = "event-categories" AND wp_term_taxonomy.parent = 0 | |
GROUP BY wp_icl_translations.trid |
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
<?php | |
namespace App\Core\Command; | |
use Symfony\Component\Console\Command\Command; | |
use Symfony\Component\Console\Style\SymfonyStyle; | |
use Symfony\Component\Finder\Finder; | |
use Symfony\Component\HttpKernel\KernelInterface; | |
use Symfony\Component\Translation\Catalogue\TargetOperation; | |
use Symfony\Component\Translation\Catalogue\MergeOperation; |