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
# For stackoverflow issue http://stackoverflow.com/questions/34544049/process-a-file-using-hash | |
hash_array = [] | |
# Parse the lines and store it in hash array | |
File.open("b.txt", "r") do |f| | |
f.each_line do |line| | |
# Splits are done around , and = preceded or followed | |
# by any number of white spaces | |
splits = line.chomp.split(/\s*,\s*/).map{|p| p.split(/\s*=\s*/)} |
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 org.trpr.platform.integration.messaging.test; | |
import java.util.List; | |
import org.trpr.platform.integration.impl.messaging.RabbitMQConfiguration; | |
import org.trpr.platform.integration.impl.messaging.RabbitMQMessageConsumerImpl; | |
import org.trpr.platform.integration.impl.messaging.RabbitMQMessagePublisherImpl; | |
import org.trpr.platform.integration.spi.messaging.MessagingException; | |
/** |
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
# In your local clone of your forked repository, you can add the original GitHub repository as a "remote". | |
# ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) | |
# Then you can fetch all the branches from that upstream repository, and rebase your work to continue | |
# working on the upstream version. In terms of commands that might look like: | |
# Add the remote, call it "upstream": | |
git remote add upstream git://github.com/whoever/whatever.git | |
# Fetch all the branches of that remote into remote-tracking branches, |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Security.Cryptography; | |
using System.Security.Cryptography.X509Certificates; | |
using System.Security.Cryptography.Xml; | |
using System.Xml; |
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
{} is ** _Balanced_ ** (Time taken: 0.032) | |
{}{ is ~~ Unbalanced ~~ (Time taken: 0.0) | |
{{}} is ** _Balanced_ ** (Time taken: 0.0) | |
}{}{ is ~~ Unbalanced ~~ (Time taken: 0.0) | |
{{{{{ - balanced - }}}}} is ** _Balanced_ ** (Time taken: 0.015) | |
{{{}{{{}}}{}}} is ** _Balanced_ ** (Time taken: 0.0) |
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
2011-08-20 17:20:08,088 [gridgain-#6%authGrid%] DEBUG [impl.steps.DataReader] - Looking up 928082348209 in database | |
2011-08-20 17:20:09,092 [gridgain-#6%authGrid%] DEBUG [hbase.client.HConnectionManager$HConnectionImplementation] - Lookedup root region location, connection=org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation@2cc25ae3; hsa=DC1AuthDFSC1D3.cidr.gov.in:6020 | |
2011-08-20 17:20:09,092 [gridgain-#6%authGrid%] DEBUG [hbase.client.HConnectionManager$HConnectionImplementation] - locateRegionInMeta parentTable=-ROOT-, metaLocation=address: DC1AuthDFSC1D3.cidr.gov.in:6020, regioninfo: -ROOT-,,0.70236052, attempt=0 of 10 failed; retrying after sleep of 1000 because: null | |
2011-08-20 17:20:09,093 [gridgain-#6%authGrid%] DEBUG [hbase.client.HConnectionManager$HConnectionImplementation] - Lookedup root region location, connection=org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation@2cc25ae3; hsa=DC1AuthDFSC1D3.cidr.gov.in:6020 | |
2011-08-20 17:20:10,095 [gridgain- |
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
Sample grid-config.xml shows how to configure GridGain Logging | |
using log4j.properties. This is needed when you are integrating GridGain | |
in an legacy app that use log4j.propreties for log4j configuration, | |
whereas GridGain uses log4j.xml. | |
In the above example, we are setting gridLogger property by using an | |
instance of GridLogger which is constructed using a regular log4j Logger object. | |
Then we have log4jInitialization bean that initialzes log4j using | |
log4j.properties with the help of org.springframework.util.Log4jConfigurer. |
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
To use this program, do the following: | |
1. Download the "row_existence.rb" to the server where you have HBase installed. | |
2. Fire up the HBase shell | |
> $HBASE_HOME/bin/hbase shell | |
3. Load the "row_existence.rb" into the shell | |
hbase(main):001:0> "directory_where_you_downloaded_the_file/row_existence.rb" |
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
Tweeter Application: | |
This application can be used to create tweet programmatically. | |
Pre-requisites: | |
============== | |
1. In order to use it, you need to have "twitter_oauth" gem installed. | |
gem install twitter_auth | |
2. Register an application on http://dev.twitter.com/. Select the "Application Type" as "client", as this program does is not a web-based application and hence, cannot have call back URL as needed for browser apps. |
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 java.security.Security; | |
import java.util.Properties; | |
import javax.mail.Message; | |
import javax.mail.PasswordAuthentication; | |
import javax.mail.Session; | |
import javax.mail.Transport; | |
import javax.mail.internet.InternetAddress; | |
import javax.mail.internet.MimeMessage; |