Skip to content

Instantly share code, notes, and snippets.

View alfredfrancis's full-sized avatar
🎯
Focusing

Alfred Francis alfredfrancis

🎯
Focusing
View GitHub Profile
Imports iTextSharp.text.pdf
Imports iTextSharp.text
Imports System.IO
Imports iTextSharp.text.io
Imports System.Drawing
Imports System.Drawing.Imaging
Imports System
Imports System.Collections.Generic
Imports System.Windows.Forms
@alfredfrancis
alfredfrancis / people.txt
Last active April 14, 2017 08:52
Spark sql example
Michael, 29
Andy, 30
Justin, 19
Arun, 20
Alfred, 22
import pymongo
import sys
connection = pymongo.Connection("mongodb://localhost", safe=True)
db=connection.nooora
coll = db.nooracollection
import logging
import logging.handlers
import time
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(levelname)-8s %(message)s')
logging.getLogger().addHandler(logging.handlers.DatagramHandler('localhost', 8045))
while True:
@alfredfrancis
alfredfrancis / react-firebase-auth.js
Created January 30, 2017 17:00 — forked from nateinaction/react-firebase-auth.js
This is a version of Facebook's React Conditional Rendering example modified to support firebase authentication.
/*
* This is a version of Facebook's React Conditional Rendering
* example modified to support firebase authentication.
* https://facebook.github.io/react/docs/conditional-rendering.html
*/
import React, { Component, PropTypes } from 'react';
import * as firebase from 'firebase';
function UserAvatar(props) {
var colors = {
1:"#ff1123",
2:"#000000",
3:"#010101"
}
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
[
{
"text": "How would you describe yourself?",
"intentName": "personal-bio"
},
{
"text": "When is your birthday?",
"intentName": "personal-birthday"
},
{
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.naive_bayes import MultinomialNB
from sklearn.pipeline import Pipeline
from NLTKPreprocessor import NLTKPreprocessor
import os
import json
PATH = "new.model"
model = Pipeline([
import os
import pickle
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.naive_bayes import MultinomialNB
from sklearn.pipeline import Pipeline
def train(X, y,outpath=None, verbose=True):
def build(X, y=None):
"""
[
{
"cronPattern": "* * * * *",
"serviceProviderID": "LULUXKW#####",
"bankName": "The City Bank",
"transferMode": "WWW",
"ftpUrl": "null",
"maximumAttemptsNo": 4,
"passwordExpFreq": 30,
"testkey": false,