Skip to content

Instantly share code, notes, and snippets.

package utils
import java.util
import org.apache.flink.api.common.typeutils.TypeSerializer
import org.apache.flink.api.table.Row
import org.apache.flink.core.memory.{DataInputView, DataOutputView}
/**
@Shiti
Shiti / BasicTransformation.scala
Created October 18, 2014 13:16
Akka-Stream example using experimental version 0.9
package sample.stream
import akka.actor.ActorSystem
import akka.stream.MaterializerSettings
import akka.stream.scaladsl2._
object BasicTransformation {
def main(args: Array[String]): Unit = {
implicit val system = ActorSystem("Sys")
@Shiti
Shiti / BasicTransformation.scala
Created October 18, 2014 12:27
Akka-Stream example using experimental version 0.7
package sample.stream
import akka.actor.ActorSystem
import akka.stream.MaterializerSettings
import akka.stream.scaladsl2._
object BasicTransformation {
def main(args: Array[String]): Unit = {
implicit val system = ActorSystem("Sys")
@Shiti
Shiti / SampleBuild.scala
Last active August 29, 2015 14:04
A build file to show multi-project build with runtime scoped dependencies
import sbt._
import sbt.Keys._
import sbtassembly.Plugin._
import AssemblyKeys._
object SampleBuild extends Build {
lazy val module1 = Project(
id = "module1",
base = file("module1"),
@Shiti
Shiti / error.log
Created July 16, 2014 11:07
Spark sql compilation error - branch 1.0.
java.lang.AssertionError: assertion failed: List(object package$DebugNode, object package$DebugNode)
at scala.reflect.internal.Symbols$Symbol.suchThat(Symbols.scala:1678)
at scala.reflect.internal.Symbols$ClassSymbol.companionModule0(Symbols.scala:2988)
at scala.reflect.internal.Symbols$ClassSymbol.companionModule(Symbols.scala:2991)
at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder.genClass(GenASM.scala:1371)
at scala.tools.nsc.backend.jvm.GenASM$AsmPhase.run(GenASM.scala:120)
at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1583)
at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1557)
at scala.tools.nsc.Global$Run.compileSources(Global.scala:1553)
at scala.tools.nsc.Global$Run.compile(Global.scala:1662)
@Shiti
Shiti / application.conf
Last active August 29, 2015 14:03
sample configurations to enable logging in a Play application with a third party library that uses Akka
# This is the main configuration file for the application.
# ~~~~~
# Secret key
# ~~~~~
# The secret key is used to secure cryptographics functions.
# If you deploy your application to several instances be sure to use the same key!
application.secret="someHellOfASecret"
# The application languages
1.EXPLAIN SELECT
f.title, a.first_name,a.last_name
FROM
film f
JOIN
film_actor fa USING (film_id)
JOIN
actor a USING (actor_id);
@Shiti
Shiti / lightbox.css
Last active July 26, 2018 07:05
AngularJS Lightbox directive
.modal {
width: 800px;
left: 40%;
}
.lightbox-content {
width: 100%;
}
.lightbox-image {
"use strict";
component.directive('fileupload', function () {
return {
restrict: 'E',
template: '<span>' +
'<label for="displayImg">Upload image</label>' +
'<input type="file" id="displayImg" onchange="angular.element(this).scope().setFile(this)">' +
'<button class="btn btn-primary" ng-click="uploadFile()">Save</button>'
@Shiti
Shiti / fileUploadExample.scala
Last active December 10, 2015 09:29
Example function to handle a form with image and other fields in Play Scala
def addProfile = Action(parse.multipartFormData) {
request =>
val formData = (request.body).asFormUrlEncoded
val email = formData.get("email").get(0)
val name = formData.get("name").get(0)
val userId = User.create(User(email, name))
request.body.file("displayPic").map {
picture =>
val fileName = businessId
val path="/socialize/user/"