Skip to content

Instantly share code, notes, and snippets.

@laxman1129
laxman1129 / grokking_to_leetcode.md
Created March 12, 2025 18:05 — forked from tykurtz/grokking_to_leetcode.md
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

To switch from Atomikos to Hikari connection pooling in a Spring Boot application, you will need to do the following:
Exclude the Atomikos dependency from your project:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jta-atomikos</artifactId>
<exclusions>
<exclusion>
http://www.codejava.net/java-core/collections/sorting-a-list-by-multiple-attributes-example
Using a chained Comparator
Using a CompareToBuilder
\
package net.codejava.collections;
import java.util.Comparator;
import org.apache.commons.lang3.builder.CompareToBuilder;
var x = sessionStorage.getItem('FilterOptions');//get object in string form
var y=JSON.parse(x)['AcSubTypes']//get a field from the object in string form
Object.keys(y).length //get properties count of the field
key = '310';
y[key] // to get value fby key
$( "input[value*='310']input[name*='cblAcTypes']" ).val( "310" );//selector with && and pattern
$( "input[value*='310'],input[name*='cblAcTypes']" ).val( "310" );//selector with || and pattern
//for looping
@laxman1129
laxman1129 / ActionEditor.java
Last active December 6, 2015 07:23
Jtable with column having multiple renderers and editors for a column
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.AbstractCellEditor;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JTable;
<html>
<head>
<style type="text/css">
body{
overflow: hidden;
}
div.container {
height: 100%;
width: 100%;
@laxman1129
laxman1129 / coordinates
Last active September 14, 2015 19:52
coordinates
http://www.algebra.com/algebra/homework/word/geometry/Geometry_Word_Problems.faq.question.477701.html
http://math.wonderhowto.com/how-to/use-ratio-formula-find-coordinates-point-303044/
@laxman1129
laxman1129 / tooltip
Created August 29, 2015 13:04
d3 tooltop
$(document).ready(function() {
var height = 500;
var width = 500;
var tooltip = d3.selectAll('rect.tooltip');
var canvas = d3.select("body")
.append('svg')
.attr({
height: height,
width: width
@laxman1129
laxman1129 / sample d3js on click
Last active August 29, 2015 14:27
sample click d3js
http://bl.ocks.org/d3noob/5d621a60e2d1d02086bf
http://stackoverflow.com/questions/23728433/d3-js-click-event-show-hide-html-element
@laxman1129
laxman1129 / sample ie to chrome
Last active August 29, 2015 14:27
open chrome window from internet explorer
$(document).ready(function() {
alert("The link will no longer take you to jquery.com");
alert(navigator.appName);
});
----------------
prefix url with cf:
cf:http://wikipedia.org
---------------------