-
Update the schema name in DatabaseConnection.java
-
Remove all duplicate code for creating connection in all DAOs first.
-
Just use the
getConnection
method from DatabaseConnection.java At any instance, do not duplicate the connection strings or copy paste connection methods to stay away from trouble. -
Remove duplicate package tags in
pom.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
const chalk = require('chalk'); | |
const semver = require('semver'); | |
function chalkLog(color, message) { | |
console.log(chalk[color](message)); | |
} | |
function loadNodeVersionFromPackageJson() { | |
chalkLog('green', 'Loading... loadNodeVersionFromPackageJson from ~/.zshrc'); | |
const packageJsonPath = `${process.cwd()}/package.json`; |
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
// original code | |
async query(options) { | |
var query = await this.buildQueryParameters(options); | |
if (query.targets.length <= 0) { | |
return this.q.when({ data: [] }); | |
} | |
return this.doRequest(query).then(result => { | |
var res = [] | |
_.forEach(result.data.results, r => { |
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
[[{"y":1,"x":"03:25","label":1589340372559},{"y":0,"x":"03:30","label":1589340372559},{"y":0,"x":"03:35","label":1589340372559},{"y":0,"x":"03:40","label":1589340372559},{"y":0,"x":"03:45","label":1589340372559},{"y":0,"x":"03:50","label":1589340372559},{"y":0,"x":"03:55","label":1589340372559},{"y":0,"x":"04:00","label":1589340372559},{"y":0,"x":"04:05","label":1589340372559},{"y":0,"x":"04:10","label":1589340372559},{"y":0,"x":"04:15","label":1589340372559},{"y":0,"x":"04:20","label":1589340372559},{"y":0,"x":"04:25","label":1589340372559}],[{"y":1,"x":"03:25","label":1589340372632},{"y":0,"x":"03:30","label":1589340372632},{"y":0,"x":"03:35","label":1589340372632},{"y":0,"x":"03:40","label":1589340372632},{"y":0,"x":"03:45","label":1589340372632},{"y":0,"x":"03:50","label":1589340372632},{"y":0,"x":"03:55","label":1589340372632},{"y":0,"x":"04:00","label":1589340372632},{"y":0,"x":"04:05","label":1589340372632},{"y":0,"x":"04:10","label":1589340372632},{"y":0,"x":"04:15","label":1589340372632},{"y":0,"x":" |
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
def merge_arr(a, b): | |
result = [] | |
i = 0 | |
j = 0 | |
while i < len(a) or j < len(b): | |
if i < len(a) and ((j < len(b) and a[i] < b[j]) or j >= len(b)): | |
result.append(a[i]) | |
i += 1 |
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
Practise: | |
1. Create a js based html with button | |
2. Click button to call flask api | |
3. Flask api sends response as stream | |
4. Request gets closed | |
-- Flask : |
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
{ | |
"Amazon": [ | |
[ | |
"1", | |
"Two Sum", | |
"44.3%", | |
"Easy" | |
], | |
[ | |
"2", |
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
class Solution: | |
def nextPermutation(self, nums: List[int]) -> None: | |
n = len(nums) | |
prev = -float("inf") | |
ind = n -1 | |
for i in range(n): | |
ind = n - i -1 | |
if nums[ind] < prev: | |
j = n -1 | |
while(nums[j] <= nums[ind] and j > ind) : |
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
class Solution: | |
def maxSubArray(self, nums: List[int]) -> int: | |
local_sum = 0 | |
global_sum = -float("inf") | |
for i in nums: | |
local_sum = local_sum + i | |
if i >= local_sum: | |
local_sum = i | |
if local_sum > global_sum: |
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 heapq | |
def k_largest(arr,k): | |
h= [] | |
heapq.heapify(h) | |
for i in arr: | |
heapq.heappush(h,i) | |
if len(h) > k : | |
heapq.heappop(h) | |
result = [] | |
while h: |
NewerOlder