Category: Programming

0

Analyzing top gainer loser data

Housekeeping with mysql Downloading data from wsj using python script here Concatenating daily files # Below command concatenates files and skips the first row of each file $ tail -q -n +2 *.tsv > /tmp/stock_aggr.tsv Creating table in mysql drop...

0

WSJ Top Loser Gainer pull

Below code will pull losers and gainers from wsj.com for a given date range, #!/usr/bin/env python from lxml import html import requests import sys import os import humanize import pandas # from datetime import date, timedelta import datetime import re...

0

Parsing sqoop logs for stats analysis

Below python code will help you extract statistics from a set of Sqoop log files for transfer analysis,   #!/usr/bin/env python import fnmatch import os import datetime def find_files(directory, pattern): for root, dirs, files in os.walk(directory): for basename in files: if...

0

python web scraping (finviz pull)

Python code below, #!/usr/bin/env python from lxml import html import requests import csv import sys import os import humanize # Helper URL # http://python-docs.readthedocs.io/en/latest/scenarios/scrape.html curr_arg = 1 for arg in sys.argv: print “Argument ” + str(curr_arg) + “: ” +...

0

IntelliJ IDEA tips & tricks

Setting JAVA version Coming soon…   1. Setting JAVA version Method 1 press:CTRL + SHIFT + A (For Mac command + shift + A) type: java compiler press: ENTER In the setting window set the Target bytecode to 1.8 Method...

0

Git .gitignore file sample

Source: https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore Use the following .gitignore from Jetbrains. # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 # User-specific stuff: .idea/workspace.xml .idea/tasks.xml # Sensitive or high-churn files: .idea/dataSources/ .idea/dataSources.ids .idea/dataSources.xml .idea/dataSources.local.xml .idea/sqlDataSources.xml .idea/dynamic.xml .idea/uiDesigner.xml...

0

git scm references

References https://www.garron.me/en/articles/git-linux-mac-private-server.html https://coderwall.com/p/9lzkww/setting-up-a-git-daemon-on-mac-os-x Simple Git server – https://itunes.apple.com/us/app/simple-git-server/id1040403936?mt=12 https://github.com/bard/sameplace/wiki/Getting-started-with-git   Related posts: A nice .vimrc A Secure HDFS Client Example Hadoop Hive UDTF Tutorial – Extending Apache Hive with Table Functions Parsing XML using JAXB in Java

0

Parsing XML using JAXB in Java

Process Objective is to create Java class files that represent schema from the XML data. Create XSD from XML Generators: http://www.freeformatter.com/xsd-generator.html, http://xmlgrid.net/xml2xsd.html, https://devutilsonline.com/xsd-xml/generate-xsd-from-xml Use xjc on XSD to create JAXB Java classes $xjc sample.xsd Creates a generated/ folder in the same...

0

SAX v/s DOM. How to choose between DOM and SAX?

Source: http://geekexplains.blogspot.com/2009/04/sax-vs-dom-differences-between-dom-and.html Differences between DOM and SAX. When to use what? Before going through the differences, if you need a refresh of what SAX and DOM are, please refer to this article – SAX, DOM, JAXP, & JDOM >>. While comparing...