$ sudo yum -y update
$ sudo yum -y install golang
$ sudo yum -y install gmp-devel
$ sudo yum -y install git
$ git clone https://github.com/ethereum/go-ethereum
$ cd go-ethereum/
$ make geth
$ ls -al build/bin/geth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from collections import Counter | |
import spacy | |
from graph_show import GraphShow | |
import itertools | |
from collections import defaultdict | |
class NewsMining(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def score_docs(query, total_docs, offsets_compressed): | |
scores= [0]* total_docs | |
word_list = re.split("\\s+", query) | |
query_length = len(word_list) | |
for i in range(query_length): | |
if word_list[i] not in offsets_compressed: | |
del word_list[i] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"fmt" | |
"os" | |
"strings" | |
"github.com/hyperledger/fabric/core/chaincode/shim" | |
"github.com/hyperledger/fabric/protos/peer" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Remove emoji from a text file and print it to stdout. | |
Usage | |
----- | |
python remove-emoji.py input.txt > output.txt | |
""" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import os | |
import uuid | |
from flask import Flask, render_template, redirect, url_for, request | |
from flask_uploads import UploadSet, configure_uploads, IMAGES, patch_request_class | |
from flask_wtf import FlaskForm | |
from flask_wtf.file import FileField, FileRequired, FileAllowed | |
from wtforms import SubmitField |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Creating the companies | |
CREATE CONSTRAINT ON (a:COMPANY) ASSERT a.id IS UNIQUE; | |
USING PERIODIC COMMIT 2000 | |
LOAD CSV WITH HEADERS FROM "file:///companies.csv" AS line | |
FIELDTERMINATOR ',' | |
WITH line | |
MERGE (a:COMPANY {id: line.id}) | |
ON CREATE SET a.description = line.description, | |
a.name = line.name; |
This little project defines a function that can be used to construct a Cypher query which when executed against a Neo4j database server will store the graph to the server.
- A Graph is an abstract mathematical model composed of Nodes connected through Edges that can be used to describe complex systems composed of a set of parts (corresponding to nodes) and their connections (corresponding to edges).
- Examples of graphs are road networks (junctions connected via roads), electronic circuit networks (components and their connections) and others
- Networkx is an excellent Python module for manipulating such Graph objects of any kind.
- Neo4j is a graph database. It uses the Graph as a data model to store such objects to a data store.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def unicodetoascii(text): | |
TEXT = (text. | |
replace('\\xe2\\x80\\x99', "'"). | |
replace('\\xc3\\xa9', 'e'). | |
replace('\\xe2\\x80\\x90', '-'). | |
replace('\\xe2\\x80\\x91', '-'). | |
replace('\\xe2\\x80\\x92', '-'). | |
replace('\\xe2\\x80\\x93', '-'). | |
replace('\\xe2\\x80\\x94', '-'). |
NewerOlder