Skip to content

Instantly share code, notes, and snippets.

ssinganamalla

Block or report user

Report or block ssinganamalla

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ssinganamalla
ssinganamalla / LoadProperties.java
Created Jan 12, 2016
Load config properties file located in resources directory
View LoadProperties.java
public static ApplicationProperties loadProperties() {
Properties prop = new Properties();
InputStream input = null;
try {
ClassLoader classloader = Thread.currentThread().getContextClassLoader();
input = classloader.getResourceAsStream("config.properties");
// load a properties file
prop.load(input);
@ssinganamalla
ssinganamalla / renamedb.sql
Created Aug 27, 2015
rename database name in postgres
View renamedb.sql
//delete the user sessions
SELECT pg_terminate_backend( pid )
FROM pg_stat_activity
WHERE pid <> pg_backend_pid( )
AND datname = 'oldname';
ALTER DATABASE oldname RENAME TO newname
View ProgramSingle.java
public class Program
{
/**
yes thats me
yes thats me
you will have to use Double Dispatch in order for u to print 2 statements
**/
public static void main(String[] args)
@ssinganamalla
ssinganamalla / LinkedListIntersection.java
Last active Oct 9, 2015
Intersection of two linkedlists
View LinkedListIntersection.java
/*Write a program to find the node at which the intersection of two singly linked lists begins.
For example, the following two linked lists:
A: a1 → a2
c1 → c2 → c3
B: b1 → b2 → b3
View MaxNumber.java
/*
Given a list of non negative integers, arrange them such that they form the largest number.
For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330.
Note: The result may be very large, so you need to return a string instead of an integer.
*/
public class MaxNumber {
String getLargestNumber(List<Integer> numbers) {
View Node.java
package com.mycompany.tree;
public class Node {
public int value;
public Node left;
public Node right;
public int level;
public Node(int value) {
View JpaUserRepositoryImpl.java
public User findByEmail(String email) {
Query query = this.em.createQuery("SELECT user FROM User u where u.email= :theemail");
query.setParameter("theemail", email);
return (User) query.getSingleResult();
}
View Maincs.html
@*Empty div otherwise the deployment is not successful. keep the hack, till u figure out*@
<div></div>
@{
ViewBag.Title = "AFE Administration";
}
View layoutcs.html
<!DOCTYPE html>
<html>
<head>
<title>@ViewBag.Title</title>
<link href="@Url.Content("../../Scripts/resources/AfeAdmin-all.css")" rel="stylesheet" type="text/css" />
<!-- TO GO IN DEV MODE: comment the line -->
<!-- <script src="@Url.Content("../../Scripts/all-classes.js")" type="text/javascript"></script>-->
View extjsindex.html
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>AfeAdmin</title>
<!-- <x-compile> -->
<!-- <x-bootstrap> -->
<link rel="stylesheet" href="bootstrap.css">
<script src="ext/ext-dev.js"></script>
<script src="bootstrap.js"></script>
You can’t perform that action at this time.