Skip to content

Instantly share code, notes, and snippets.

View s4kibs4mi's full-sized avatar
🎯
Focusing

Sakib Sami s4kibs4mi

🎯
Focusing
View GitHub Profile
package com.example.helloworld;
// Implement a function that calculates the max consecutive sum on a subsequence of integers.
// What is the maximum sum one can achieve by summing consecutive numbers on a finite array of positive
// and negative numbers? One can start and end anywhere, but it is not allowed to skip numbers.
//
// For example, consider the array [2, -4, 2, -1, 3, -3, 10, -1, -11, -100, 8, -1].
// The max possible consecutive sum is 11 (starting from the index 2 and ending with the index 6, both zero-based).
// sum = 9
sudo apt update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
import org.apache.kafka.clients.producer.*
import java.util.*
import org.apache.kafka.common.serialization.StringSerializer
import java.lang.Exception
fun main(args: Array<String>) {
val props = Properties()
props[ProducerConfig.BOOTSTRAP_SERVERS_CONFIG] = "localhost:9092"
props[ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG] = StringSerializer::class.java.name
props[ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG] = StringSerializer::class.java.name
package main
import (
"fmt"
"github.com/confluentinc/confluent-kafka-go/kafka"
)
func main() {
c, err := kafka.NewConsumer(&kafka.ConfigMap{
"bootstrap.servers": "localhost",
version: '3.1'
services:
zoo1:
image: zookeeper:3.4.9
hostname: zoo1
ports:
- "2181:2181"
environment:
ZOO_MY_ID: 1
@s4kibs4mi
s4kibs4mi / go-os-arch.md
Created April 11, 2019 06:41 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.8.3 darwin/amd64.

A list of valid GOOS values

(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)

  • android
  • darwin
package main
import (
"bufio"
"fmt"
"github.com/s4kibs4mi/empleo/core"
"github.com/spf13/viper"
"html/template"
"log"
"os"
package main
import (
"fmt"
"github.com/PuerkitoBio/goquery"
"github.com/gocolly/colly"
"github.com/s4kibs4mi/empleo/core"
"strings"
)
==============================
BATCH - 1
==============================
ID : vkdU8teHm, Delivered : 1 times
ID : XkdI5tAHm, Delivered : 1 times
ID : vkKI8aeTy, Delivered : 1 times
ID : XkKU5aATm, Delivered : 2 times
ID : vCdU5teHy, Delivered : 1 times
ID : XkKI8aeTy, Delivered : 1 times
ID : XkdU8teHy, Delivered : 1 times
GOROOT=/usr/local/Cellar/go/1.11/libexec #gosetup
GOPATH=/Users/sakib/go #gosetup
/usr/local/Cellar/go/1.11/libexec/bin/go build -o /private/var/folders/7p/v66nf1vx2d54b5bmsn4q0tx80000gn/T/___go_build_main_go /Users/sakib/go/src/github.com/s4kibs4mi/iot-test/main.go #gosetup
/private/var/folders/7p/v66nf1vx2d54b5bmsn4q0tx80000gn/T/___go_build_main_go #gosetup
Connected
==============================
ID : Msn4VLdTy, Delivered : 0 times
ID : Msc4_LdTy, Delivered : 0 times
ID : psnf_LdHm, Delivered : 0 times
ID : Hsn4_RdHm, Delivered : 0 times