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
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); |
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
//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 |
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
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) |
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
/*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 |
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
/* | |
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) { |
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 com.mycompany.tree; | |
public class Node { | |
public int value; | |
public Node left; | |
public Node right; | |
public int level; | |
public Node(int value) { |
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
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(); | |
} |
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
@*Empty div otherwise the deployment is not successful. keep the hack, till u figure out*@ | |
<div></div> | |
@{ | |
ViewBag.Title = "AFE Administration"; | |
} |
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
<!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>--> |
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
<!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> |
NewerOlder