Skip to content

Instantly share code, notes, and snippets.

View yuikns's full-sized avatar
🎯
Focusing

Yu yuikns

🎯
Focusing
View GitHub Profile
import React from 'react';
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import globalConfig from '../../config'
import ajax from '../../utils/ajax'
import Logger from '../../utils/Logger'
import { Button, message } from 'antd'
import './index.less'
import { loginSuccessCreator } from '../../redux/Login.js'
import { SetAuth } from '../../utils/ajax'
import { combineReducers, createStore, applyMiddleware } from 'redux'
import React, { PropTypes } from "react"
import { Provider, connect } from "react-redux"
import { render } from "react-dom"
// var reducer = function (state, action) {
// return Object.assign({}, state, action)
// }
  1. python script to split the pig files

e.g.

my-result.pig =>

1.1. my-result-1.pig (part1 ) 1.2 my-result-2.pig (part1 + 2) ...

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Licensed to the Apache Software Foundation (ASF) under one or more -->
<!-- contributor license agreements. See the NOTICE file distributed with -->
<!-- this work for additional information regarding copyright ownership. -->
<!-- The ASF licenses this file to You 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 -->
<!-- -->
@yuikns
yuikns / Vagrantfile
Last active September 26, 2017 04:32
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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
#
INFO [2017-09-20 00:39:32,023] ({main} Server.java[doStart]:327) - jetty-9.2.15.v20160210
INFO [2017-09-20 00:42:17,357] ({main} StandardDescriptorProcessor.java[visitServlet]:297) - NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
WARN [2017-09-20 00:42:17,831] ({main} Helium.java[loadConf]:101) - /bootcamp/data/zeppelin-0.7.2-bin-all/conf/helium.json does not exists
WARN [2017-09-20 00:42:20,744] ({main} Interpreter.java[register]:406) - Static initialization is deprecated for interpreter sql, You should change it to use interpreter-setting.json in your jar or interpreter/{interpreter}/interpreter-setting.json
INFO [2017-09-20 00:42:20,746] ({main} InterpreterSettingManager.java[init]:305) - Interpreter psql.sql found. class=org.apache.zeppelin.postgresql.PostgreSqlInterpreter
INFO [2017-09-20 00:42:27,404] ({main} InterpreterSettingManager.java[init]:337) - InterpreterSettingRef name livy
INFO [2017-09-20 00:42:27,409] ({main} InterpreterSettingManager.java[init]:337) - Inter
cat DEMO17Q1.txt | tr "$" "\t" | mongoimport --type tsv --headerline -c "demo" -d "test"
dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
dnf -y install ffmpeg ffmpeg-libs ffmpeg-devel gstreamer-ffmpeg
from numpy import exp, array, random, dot
training_set_inputs = array([[0, 0, 1], [1, 1, 1], [1, 0, 1], [0, 1, 1]])
training_set_outputs = array([[0, 1, 1, 0]]).T
random.seed(1)
synaptic_weights = 2 * random.random((3, 1)) - 1
for iteration in range(100):
output = 1 / (1 + exp(-(dot(training_set_inputs, synaptic_weights))))
synaptic_weights += dot(training_set_inputs.T, (training_set_outputs - output) * output * (1 - output))
print (1 / (1 + exp(-(dot(array([1, 0, 0]), synaptic_weights)))))