Category: Programming

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...

0

Hadoop Hive UDTF Tutorial – Extending Apache Hive with Table Functions

Source: http://beekeeperdata.com/posts/hadoop/2015/07/26/Hive-UDTF-Tutorial.html Author: Matthew Rathbone Co-author: Elena Akhmatova   Article Hadoop Hive UDTF Tutorial – Extending Apache Hive with Table Functions While working with both Primitive types and Embedded Data Structures was discussed in part one, the UDF interfaces are limited to...

0

How to create a Hive UDF in Scala

Source: https://community.hortonworks.com/articles/42695/how-to-create-a-hive-udf-in-scala.html   This article will focus on creating a custom HIVE UDF in the Scala programming language. Intellij IDEA 2016 was used to create the project and artifacts. Creation and testing of the UDF was performed on the Hortonworks...

0

Uninstalling npm from macOS

Source: http://stackoverflow.com/questions/11177954/how-do-i-completely-uninstall-node-js-and-reinstall-from-beginning-mac-os-x Removing npm from mac sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*} which is the equivalent of (same as above)… sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* /usr/local/lib/dtrace/node.d ~/.npm ~/.node-gyp /opt/local/bin/node opt/local/include/node /opt/local/lib/node_modules   or (same as above) broken down… To completely uninstall node +...

0

WordPress – allow password protected content in search results

Source: https://wordpress.org/support/topic/how-to-allow-password-protected-content-in-search-results SOLUTION: Add this code to your functions.php file and you will get it to work. add_filter( ‘posts_search’, ‘include_password_posts_in_search’ ); function include_password_posts_in_search( $search ) { global $wpdb; $pattern = ” AND ({$wpdb->prefix}posts.post_password = ”)”; $search = str_replace( $pattern, ”,...

0

Setup local Hadoop dev environment on macOS

It is always so convenient to have a local environment for learning and quick testing of a scenario. If you are working in macOS environment looking to learn or setup Hadoop locally then you are in the right place. I...

0

A nice .vimrc

Using the settings below will add colors to vi editor, change the tabstops to 4 and adds more niceness. This is how my .vimrc looks like. filetype plugin indent on ” show existing tab with 4 spaces width set number...

0

Ondemand local webserver

Ever wanted a local directory to host contents over http? Here is how you do it, $ python -mSimpleHTTPServer Above command will host the contents of the current directory over http port 8000. If you want to use a custom...

0

A Secure HDFS Client Example

Source: http://henning.kropponline.de/2016/02/14/a-secure-hdfs-client-example/ It takes about 3 lines of Java code to write a simple HDFS client that can further be used to upload, read or list files. Here is an example: Configuration conf = new Configuration(); conf.set(“fs.defaultFS”,”hdfs://one.hdp:8020″); FileSystem fs = FileSystem.get(conf);...

0

Creating JAR with dependencies using maven (eclipse, others)

Source: http://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven   Inside pom.xml use the following XML code <?xml version=”1.0″ encoding=”utf-8″?> <build> <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <archive> <manifest> <mainClass>fully.qualified.MainClass</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> </plugins> </build>     To build the JAR use the following command...