Showing posts with label Example Code. Show all posts
Showing posts with label Example Code. Show all posts

Building a Real-time Chatter Feed Dashboard with Rails 4

Real-time Chatter Feed Dashboard with Rails 4
Chatter is an enterprise social network and collaboration environment. Force.com exposes various useful information from Chatter such as users, organizations, groups, feed-items through APIs. Using this information, we can build a proof-of-concept dashboard which will show a user’s or organization’s feed in real-time. Real-time dashboard can provide an accurate understanding of what is happening in an organization.

This tutorial expects that you are an intermediate-level web application developer and have a few weeks of experience with Rails and related ecology. This means you should be familiar with building blocks of a Rails app and terms like OAuth, REST, Callback, bundler, gem etc.

Continue Reading

25+ Handy Cypher Query Snippets for Neo4j Developers: Cheatsheet

Neo4j is one of the distinguished open source NOSQL graph database. There are plenty of open source graph databases available, however Neo4j is one of the most popular options available currently. Online backup and high availability are some of the preeminent features of Neo4j.

The graph traversal in Neo4j is supported by number of different ways. This article is focused on the the Neo4j proprietary graph traversal language, its called Cypher.

Cypher is really powerful and very intuitive language to traverse a complex graph. Some of the basic operations can be very efficiently done in Cypher. We have recently evaluated Neo4j database for a large project and heavily used Cypher queries.
Cypher can be really handy for a Neo4j developer to traverse and debug from admin web console. This article is trying to document some of the most common queries we found useful.

Below are some commonly used query snippets for you to use as a cheat sheet.

Continue Reading

15+ Useful Selenium Web driver Code Snippets For Web App Testing Automation

Selenium Web driver Code Snippets For Web App Testing Automation
WebDriver is a open source free test automation library for doing web application testing. The main reason for extreme popularity and success of WebDriver is its ability to easily simulate the action of a real website user.

This library can control the browser and supports wide variety of browsers including all popular ones like Firefox, Chrome, Safari and IE.

The programming for web driver scripts can be done in Java, Python, Ruby and .NET. This article focuses on only Java code snippets, however the equivalent code can be easily written in any other supported language.

Some of the very common use cases like taking a error snapshot, or uploading a file are very easily accomplished using Web Driver api.

Below are some of the code snippets that I frequently use when I am creating java test cases using selenium webdriver. I hope this will help you save some time in your test case code creation.

Continue Reading

25+ Handy Gremlin Examples and Code Snippets for Graph Database Traversal and Manipulation

Gremlin Examples and Code Snippets
Gremlin is a powerful domain specific traversal language for graph databases. This language is supported by all popular graph databases.

In recent past, I was doing some case studies on graph databases and realized that gremlin is the graph language that I must learn. Learning this language can ensure you to be able to work on multiple graph databases.

Gremlin works smoothly on all graph databases that support Blueprints property graph data model. Gremlin can be easily used with JVM languages like Groovy, Clojure, Scala and more.

A lot of graph databases support their custom languages (e.g. Cipher in Neo4j). These languages are really useful, however they become useless on other databases.

Learning Gremlin for graph databases is equivalent to learning SQL for relational databases. Once you know SQL, you can easily work on MySQL or Postgres or Oracle without worrying about details of vendors. Same way knowing Gremlin can ensure you can work on Neo4j or Titan Graph DB, or OrientDB and other dozens of graph databases.

In this simple code snippets collection, I am trying to list down all commonly used snippets that you can use as a cheatsheet while doing graph query, analysis and manipulation.

Continue Reading

How-To Send Auto Reply Email on Google Form Submission

google form automatic email
Google forms is one of the most popular contact form on the web and a lot of people are not aware that you can also send automatic reply to the submitter of form messages using some Google API code.

Google form auto reply email is not a in built feature, however we can achieve it by simple script. There is a simple way to Send the contact form in the form of email to your inbox described here. However, if you want a automated reply email sent to your customers it needs to be done using some JavaScript function which can be easily configured to be called inside Google forms.

Google form automatic email can be easily triggered on the form submission.

Below are the steps to configure a automated response email for your Google form.
Continue Reading

Recipe: Storing Articles in a Content Repository - Spring in Practice


Spring in Practice
By By Willie Wheeler, John Wheeler, and Joshua White
Among the tasks a content management system (CMS) must support are the authoring, editing and deployment of content by non-technical users. Examples include articles (news, reviews), announcements, press releases, product descriptions and course materials. In this article, based on chapter 12 of Spring in Practice, the authors build an article repository using Jackrabbit, JCR and Spring Modules JCR.

Continue Reading

10 Simple String Utility Methods for Java Developer

string functions in java
String operations are common to all kind of programming. Java has many in built operations supported by String class. String functions in java include substring, split, trim and more. However there are few more things we do on a regular basis and can be reused. There are few functions which I observed commonly used and may be helpful to keep handy as StringUtil class with static methods. Continue Reading