Skip to content

Instantly share code, notes, and snippets.

View pavan538's full-sized avatar

Pavan Kumar pavan538

View GitHub Profile

sample docker compose

version: '3'
services:
  blob-consumer:
    container_name: article-blob-consumer-container-compose
    image: blob-consumer-image:1.0
    build:
 context: .
@pavan538
pavan538 / unicode_in_python.md
Last active September 17, 2018 12:05
Unicode
  • codepoint The Unicode standard describes how characters are represented by code points. A code point is an integer value, usually denoted in base 16. In the standard, a code point is written using the notation U+12CA to mean the character with value 0x12ca (4,810 decimal). The Unicode standard contains a lot of tables listing characters and their corresponding code points:

    U+12CA is a codepoint, which represents some particular character;

  • A Unicode string is a sequence of code points, which are numbers from 0 through 0x10FFFF (1,114,111 decimal). This sequence needs to be represented as a set of bytes (meaning, values from 0 through 255) in memory. The rules for translating a Unicode string into a sequence of bytes are called an encoding.

  • A character is represented on a screen or on paper by a set of graphical elements that’s called a glyph. The glyph for an uppercase A, for example, is two diagonal strokes and a horizontal stroke, though the exact details will depend on the font being used.

class YoutubExtension {
def featureName
}
class YoutubePlugin implements Plugin<Project>{
@Override
void apply(Project target) {
apply from: 'plugins.gradle'
ext {
dependencies_version = [
dropwizard: [
core: '1.3.1'
]
]
}
// imports a couple of java tasks
apply plugin: "java"
// List available tasks in the shell
> gradle tasks
// A Closure that configures the sourceSets Task
// Sets the main folder as Source folder (where the compiler is looking up the .java files)
sourceSets {
main.java.srcDir "src/main"
@pavan538
pavan538 / xpath3.1_examples.md
Created June 13, 2018 08:49
xpath 3.1 examples

xpath 3.1 example

[
        for $result in //supplierAssortment
        return
        map {

           'articleCode': let $article_code := $result//articleCode/string()
                          return xs:integer($article_code),

Contents

.. toctree::
   :caption: Table of Contents
   :name: mastertoc
   :maxdepth: 2


Components

@pavan538
pavan538 / jupyter_nginx_supervisor.md
Created August 7, 2018 10:36
jupyter notebook browser with nginx and supervisor

create a jupyter.conf supervisor setting file

[program:jupyter]
command = /home/ubuntu/virtual_envs/kaggle/bin/jupyter notebook --no-browser --config=/home/ubuntu/.jupyter/jupyter_notebook_config.py
environment=PATH="/home/ubuntu/virtual_envs/kaggle/bin:%(ENV_PATH)s"
directory = /home/ubuntu/ml
user = ubuntu
autostart = true
autorestart = true
@pavan538
pavan538 / mysql_python_lib.py
Created September 6, 2018 07:14
MYSQL python utitlity
__author__ = 'pavan.tummalapalli'
import mysql.connector.pooling
import logging
class MySQLPool:
"""
create a pool, when connect to mysql, which will decrease the time spent in
@pavan538
pavan538 / benchmark-commands.txt
Created September 6, 2018 09:44 — forked from jkreps/benchmark-commands.txt
Kafka Benchmark Commands
Producer
Setup
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3
Single thread, no replication
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196