Skip to content

Instantly share code, notes, and snippets.

import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.web.servlet.MockMvc;
{"loan": {
"leaseId": null,
"userId": "101",
"status": "",
"property": {
"appraisal": {
"softMarketInd": true
},
"propertyType": null,
"purchasePrice": 0,
String callScheduleDate = "07-06-2018";
String callScheduleTime = "04:04";
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM-dd-yyyy HH:mm");
try
{
Date date = simpleDateFormat.parse(callScheduleDate+" "+ callScheduleTime);
System.out.println("date : "+ date);
}
catch (ParseException ex)
{
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
@pradeepwebonise
pradeepwebonise / .json
Created October 9, 2017 12:50
videoFeed
[{"id":5600348978001,"name":"Breeders' Cup Focus - Distaff - October 6th, 2017","shortDescription":"On this week's Breeders' Cup Focus, Dan Illman and Mike Beer discuss the Distaff.","publishedDate":1507323326197,"thumbnailURL":"http://brightcove.vo.llnwd.net/v1/unsecured/media/719509166001/201710/1146/719509166001_5600377523001_5600348978001-th.jpg?pubId=719509166001","linkURL":null,"url":"http://video.drf.com/#category/videos/stakes-preview","playListName":"Stakes Previews","playListId":777161619001},{"id":5596879102001,"name":"DRF Breeding Report - Breeders' Cup - Juvenile Fillies Contenders","shortDescription":"Dan Illman and Nicole Russo analyze contenders for the Juvenile Fillies division of the Breeders' Cup","publishedDate":1507053839048,"thumbnailURL":"http://brightcove.vo.llnwd.net/v1/unsecured/media/719509166001/201710/602/719509166001_5596891349001_5596879102001-th.jpg?pubId=719509166001","linkURL":null,"url":"http://video.drf.com/#category/videos/learn-how-to-play","playListName":"Learning To Pla
INFO 12:41:46,722 [tournamentCancelJobScheduler-1] TournamentAutocancel - No minimum entries present for tournament id 3576, tournament name TSG ULTIMATE BETTING CHALLENGE FEEDER ($25 - TOP 10%) , MONDAY, FEBRUARY 27- ALL IN FORMAT
INFO 12:41:46,765 [tournamentCancelJobScheduler-1] TournamentAutocancel - No minimum entries present for tournament id 3572, tournament name BOYD GAMING $1,000,000 HORSEPLAYER WORLD SERIES FEEDER ($10 - TOP 10%), MONDAY, FEBRUARY 27 - ALL IN
INFO 12:41:46,833 [tournamentCancelJobScheduler-1] TournamentAutocancel - No minimum entries present for tournament id 3573, tournament name KEENELAND GRADE 1 GAMBLE ONE DAY QUALIFIER ($162), MONDAY, FEB 27 - LIVE FORMAT
INFO 12:41:46,915 [tournamentCancelJobScheduler-1] TournamentAutocancel - Refunding User 1589701 Entry Fees 1 for Entry 204161 of Tournament 3576
INFO 12:41:46,915 [tournamentCancelJobScheduler-1] ApiClient - Shop Store URL: http://shopdev.drf.com/api/v1/drf-credits/refund/1589701/1.0?tournamentDescription=TSG ULTIMATE
@pradeepwebonise
pradeepwebonise / gist:7fc8360242af764f2608
Created July 29, 2015 11:49
All tournaments with tournament ids to which user had made entries [ with indexing ]
-- getting all tournaments with tournament ids to which user had made entries-------------
EXPLAIN PLAN FOR
SELECT * FROM (
SELECT rownum as rn, a.* FROM (
SELECT * FROM Tournament t WHERE t.published = 1 AND t.closed = 0 AND t.cancelled = 0 AND t.submission_deadline >= '20-05-15 06:45:00.000000000 AM' AND ( t.is_private = 0 OR (t.tournament_id IN (132, 131) OR t.allowed_user_emails LIKE '%bkhanna@drf.com') ) ORDER BY submission_deadline ASC
) a
) WHERE rownum <= 10 AND rn > (1 - 1) * 10
============ Output ========================
@pradeepwebonise
pradeepwebonise / gist:d232f8ed189d6f6e9389
Created July 29, 2015 11:47
All tournaments with tournament ids to which user had made entries [ with indexing ]
-- getting all tournaments with tournament ids to which user had made entries-------------
EXPLAIN PLAN FOR
SELECT * FROM (
SELECT rownum as rn, a.* FROM (
SELECT * FROM Tournament t WHERE t.published = 1 AND t.closed = 0 AND t.cancelled = 0 AND t.submission_deadline >= '20-05-15 06:45:00.000000000 AM' AND ( t.is_private = 0 OR (t.tournament_id IN (132, 131) OR t.allowed_user_emails LIKE '%bkhanna@drf.com') ) ORDER BY submission_deadline ASC
) a
) WHERE rownum <= 10 AND rn > (1 - 1) * 10
============ Output ========================
@pradeepwebonise
pradeepwebonise / gist:c0498d7e334bdd527d77
Created July 29, 2015 11:44
Leaderboard Data query with indexing
/* Leaderboard Data query */
EXPLAIN PLAN FOR
SELECT userId, firstName, lastName, userName, email, entryId, totalPayouts FROM (
SELECT rownum as rn, a.* FROM (
SELECT u.user_id userId, u.first_name firstName, u.last_name lastName,
u.user_name userName, tep.entry_id entryId,
NVL( SUM(p.payouts), 0 ) totalPayouts ,u.email email
FROM USERS u, TOURNAMENT_USERS_ENTRY tue, TOURNAMENT_ENTRY_PICK tep
LEFT JOIN PICK_PAYOUT p ON tep.pick_id = p.pick_id