Skip to content

Instantly share code, notes, and snippets.

Jatin Ganhotra jatinganhotra

Block or report user

Report or block jatinganhotra

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
@jatinganhotra
jatinganhotra / sparklistener-checkpointing.scala
Created Nov 9, 2015
SparkListener - Checkpointing jobs
View sparklistener-checkpointing.scala
import scala.collection.JavaConversions._ // for propertiesAsScalaMap function
sc.addSparkListener(new SparkListener() {
override def onJobStart(jobStart: SparkListenerJobStart) {
println("ADAPT: INSIDE Job Start Listener ");
var props = propertiesAsScalaMap(jobStart.properties)
if (props.contains("spark.rdd.scope"))
{
val propsMap = // Convert props to propsMap
if ( propsMap.contains("name") && propsMap("name") == "checkpoint")
@jatinganhotra
jatinganhotra / The Technical Interview Cheat Sheet.md
Last active Aug 25, 2015 — forked from TSiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
View The Technical Interview Cheat Sheet.md

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@jatinganhotra
jatinganhotra / difffile_file_names.txt
Created Nov 26, 2014
Issue in ruby-git - Inconsistency with Diff contents
View difffile_file_names.txt
deploy/core/LightTable.html
deploy/core/css/codemirror.css
deploy/core/css/skins/dark.css
deploy/core/css/structure.css
deploy/core/css/themes/eclipse.css
deploy/core/css/themes/ibdknox.css
deploy/core/node_modules/codemirror/codemirror.js
deploy/core/node_modules/codemirror/modes/clojure-mode.js
deploy/core/node_modules/codemirror/overlay.js
deploy/core/node_modules/lighttable/background/threadworker.js
@jatinganhotra
jatinganhotra / Octave install error
Created Apr 1, 2014
'brew --config', 'brew doctor' and 'brew install octave' logs
View Octave install error
bash-3.2$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: 7b68e440f1626fc17a33afb2784404139cafd24c
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.9.2-x86_64
Xcode: 5.1
CLT: 5.1.0.0.1.1393561416
@jatinganhotra
jatinganhotra / gist:8509597
Created Jan 19, 2014
brew status info (Trouble installing octave 3.8.0 on OS X Mavericks 10.9.1)
View gist:8509597
-> brew doctor
bash-3.2$ brew doctor
Your system is ready to brew.
-> brew --config
bash-3.2$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: b51461cb280581aa6fb197229912f79a850f9dad
HOMEBREW_PREFIX: /usr/local
@jatinganhotra
jatinganhotra / brew status info
Last active Jan 2, 2016
brew doctor, brew --config and brew install -v foo 2>&1 Information
View brew status info
-> brew doctor
bash-3.2$ brew doctor
Your system is ready to brew.
-> brew --config
bash-3.2$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: 5dea7fc768fb1c1fba875332f9002378157e5286
HOMEBREW_PREFIX: /usr/local
@jatinganhotra
jatinganhotra / integral_type_sizes.cpp
Created Dec 24, 2012
C++ snippet to list MIN, MAX values & other attributes of Integral Types
View integral_type_sizes.cpp
#include <iostream>
#include <limits>
using namespace std;
int main()
{
cout << "Size of size_t = " << sizeof(std::size_t) << endl << endl;
cout << "Minimum value for bool: " << numeric_limits<bool>::min() << endl;
@jatinganhotra
jatinganhotra / Master.h
Created Nov 25, 2012
Use forward declarations in C++ in all the following cases:
View Master.h
class Master {
private:
// Declare a member to be a pointer or a reference to the incomplete type
Forward *ptr1;
Forward &ptr2;
public:
// Declare functions or methods which accepts/return incomplete types:
void ByValue(Forward by_value);
@jatinganhotra
jatinganhotra / Master.h
Created Nov 25, 2012
Can't use forward declarations in C++ in all the following cases:
View Master.h
// Use it as a base class
class Master : Forward {} // compiler error!
// Use it to declare a member:
class Master {
Forward cannot_define_obj_member; // compiler error!
};
// Define functions or methods using the incomplete type
void SomeFunc1(Forward x) {} // compiler error!
@jatinganhotra
jatinganhotra / rspec-syntax-cheat-sheet.rb
Created Jul 7, 2011 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
View rspec-syntax-cheat-sheet.rb
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
You can’t perform that action at this time.