Skip to content

Instantly share code, notes, and snippets.

View yashwanth2804's full-sized avatar
🎯
Focusing

kambala yashwanth yashwanth2804

🎯
Focusing
View GitHub Profile
@yashwanth2804
yashwanth2804 / gist:96fd16fa7f565398f3ccf29e5c023784
Created September 17, 2016 09:58 — forked from maoueh/gist:8260199
OpenELEC (4.0.1) WIFI connection details using `connman`

Even though there is a nice XBMC add-on to configure your WIFI settings, sometimes, you may still want to setup the WIFI connection for many reasons or just for fur.

OpenELEC use connman for managing connection to the various available network.

Setuping connman to connect to your protected WIFI network is an easy requiring you only to create a config file and enter some commands in a shell.

@yashwanth2804
yashwanth2804 / BTCbank.js
Last active December 1, 2018 06:40
Sample closure function with sum example
var BTCbank = function(BTC_balanace) {
return grandpa = (moneyspent) => {
// grandpa
BTC_balanace -= moneyspent;
return dad = (moneyspent) => {
// dad
BTC_balanace -= moneyspent;
function sum(a) {
return function(b) {
return a + b; // takes "a" from the outer lexical environment
};
}
// method 1
alert( sum(1)(2) ); // 3
(moneyspent) => {
// grandpa
BTC_balanace-= moneyspent;
return dad = (moneyspent) => {
// dad
BTC_balanace-= moneyspent;
return me = (moneyspent) => {
(moneyspent) => {
// dad
BTC_balanace-= moneyspent;
return me = (moneyspent) => {
// me
return BTC_balanace-= moneyspent;
}
}
@yashwanth2804
yashwanth2804 / me
Last active December 1, 2018 08:35
(moneyspent) => {
// me
return BTC_balanace-= moneyspent;
}
@yashwanth2804
yashwanth2804 / MOngodb
Created January 23, 2019 03:15
mongodb import and querys
./mongoimport --db dbname --collection coll --type csv --headerline --file path/restaurantsa9126b3.csv
Aggregate
await Restaurants
.aggregate([
{
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
import static org.apache.spark.sql.functions.*;
import org.apache.spark.sql.expressions.UserDefinedFunction;
StructField [] sf1 = new StructField[] {
DataTypes.createStructField("uid",DataTypes.IntegerType, true),
DataTypes.createStructField("mid",DataTypes.IntegerType,true),
DataTypes.createStructField("rating",DataTypes.IntegerType, true),
DataTypes.createStructField("time",DataTypes.IntegerType, true),
public class Accumulators {
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
Logger.getLogger("org").setLevel(Level.OFF);
SparkConf conf = new SparkConf().setAppName("map").setMaster("local");
JavaSparkContext sc = new JavaSparkContext(conf);