Skip to content

Instantly share code, notes, and snippets.

View rickyngk's full-sized avatar

Ricky.ngk rickyngk

  • Vietnamworks
  • Vietnam
View GitHub Profile
@rickyngk
rickyngk / AndroidManifest.xml
Created December 29, 2015 04:16
Use No Action Bar theme
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Fullscreen">
<activity android:name=".activities.LauncherActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
@rickyngk
rickyngk / styles.xml
Created December 29, 2015 04:15
No Action Bar theme
<resources>
<style name="Fullscreen" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
@rickyngk
rickyngk / pal-sync-error.log
Created December 14, 2015 06:02
PAL - Firebase Android Sync Error Log
12-14 12:50:50.810 17379-17379/? I/art: Not late-enabling -Xcheck:jni (already on)
12-14 12:50:50.990 17379-17401/vietnamworks.com.pal I/GMPM: App measurement is starting up
12-14 12:50:51.020 17379-17402/vietnamworks.com.pal V/com.parse.ParseHttpClient: Using net.java.URLConnection library for networking communication.
12-14 12:50:51.020 17379-17401/vietnamworks.com.pal W/GooglePlayServicesUtil: Google Play services out of date. Requires 8298000 but found 8185480
12-14 12:50:51.030 17379-17403/vietnamworks.com.pal I/ParseCommandCache: Parse command cache has started processing queued commands.
12-14 12:50:51.030 17379-17379/vietnamworks.com.pal V/com.parse.ManifestInfo: Using gcm for push.
12-14 12:50:51.030 17379-17379/vietnamworks.com.pal V/com.parse.ManifestInfo: Using GCM for Parse Push, but the app manifest is missing some optional declarations that should be added for maximum reliability. Please make sure that these permissions are declared as children of the root <manifest> element:
12-14 12:50:51.04
@rickyngk
rickyngk / post.bolt
Last active December 14, 2015 03:45
PAL bolt for Post
path / {
read() = true;
write() = isSignedIn();
}
//=======================================================
//user profile
//=======================================================
path /profiles/$userid is PrivateProfle {
write() = isAdmin();
@rickyngk
rickyngk / SimpleApp.scala
Created November 22, 2015 07:44
SimpleApp.scala - Basic MLLib Type
/* SimpleApp.scala */
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.SparkConf
import org.apache.spark.mllib.linalg.{Vector, Vectors, SparseVector, Matrix, Matrices}
import org.apache.spark.mllib.regression.LabeledPoint
import org.apache.spark.mllib.linalg.distributed.{RowMatrix, IndexedRow, IndexedRowMatrix, CoordinateMatrix, MatrixEntry, BlockMatrix}
import org.apache.spark.rdd.RDD
@rickyngk
rickyngk / SimpleApp.scala
Last active November 21, 2015 08:30
SimpleApp.scala for first Spark Mllib demo
/* SimpleApp.scala */
import org.apache.spark.mllib.linalg.{Vector, Vectors}
object SimpleApp {
def main(args: Array[String]) {
// Create a dense vector (1.0, 0.0, 3.0).
val dv: Vector = Vectors.dense(1.0, 0.0, 3.0)
// Create a sparse vector (1.0, 0.0, 3.0) by specifying its indices and values corresponding to nonzero entries.
val sv1: Vector = Vectors.sparse(3, Array(0, 2), Array(1.0, 3.0))
// Create a sparse vector (1.0, 0.0, 3.0) by specifying its nonzero entries.
@rickyngk
rickyngk / simple.sbt
Created November 21, 2015 08:23
simple.sbt with mllib
name := "Simple Project"
version := "1.0"
scalaVersion := "2.11.7"
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % "1.5.2",
"org.apache.hadoop" % "hadoop-client" % "2.6.0",
"org.apache.spark" % "spark-mllib_2.11" % "1.5.2"
)
@rickyngk
rickyngk / simple.sbt
Created November 21, 2015 08:17
Day 04 simple.sbt
name := "Simple Project"
version := "1.0"
scalaVersion := "2.11.7"
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % "1.5.2",
"org.apache.hadoop" % "hadoop-client" % "2.6.0"
)
@rickyngk
rickyngk / SimpleApp.scala
Last active November 29, 2016 06:35
SimpleApp.scala with hadoop
/* SimpleApp.scala */
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.SparkConf
import org.apache.spark.rdd.RDD
object SimpleApp {
val hadoop_uri = "hdfs://172.18.2.108:9000"
def textSearch(textData: RDD[String]) {
@rickyngk
rickyngk / hdfs-site.xml
Created November 19, 2015 17:55
Hadoop hdfs-site.xml sample
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software