Skip to content

Instantly share code, notes, and snippets.

View devanshdalal's full-sized avatar
🥝

Devansh D. devanshdalal

🥝
View GitHub Profile
@devanshdalal
devanshdalal / mianjing.txt
Last active March 19, 2022 02:04
A good set of programming questions, to make your hands dirty! Please provide more questions in comments. I will add them
Additional Questions from Career-cup
Company selected Google,
Sorted by most comments
1.Partition integer array respect to zero, i.e. negative ... 0 ... positive, keep relative order
E.g. -1 1 3 -2 2 => -1 -2 1 3 2.
2. Search in 2D matrix,
Given each row and column sorted, or given for each (i,j) A[i][j] < A[i][j+1] & A[i][j] < A[i+1][j]
from __future__ import division, print_function, absolute_import
import numpy as np
import tflearn
import tensorflow as tf
from tflearn.data_utils import to_categorical, pad_sequences
from tflearn.datasets import imdb
# IMDB Dataset loading
M=10000
# Steps To follow to download your leetcode:
#1. Login to leetcode account on your default browser
#2. Get your session Id for leetcode.com from Browser ( for chrome: press settings, then content settings, then Go to Cookies and copy value of field 'LEETCODE_SESSION'; you can find similar value for firefox and other browsers).
#3. Create a folder to save your leetcode codes.
#4. Keep the downloaded leetcode.py into that folder
#5. Pass LEETCODE_SESSION as the first command line argument with your session ID (copied in step 2)
#6. run file as 'python leetcode.py LEETCODE_SESSION_ID'
#7. wait for all submssions to download.
# Features:
int countBinarySequences(int n, int k) {
/*
* vector<int> dp (short for dynamic programming)
* is used for storing the interim values.
*/
std::vector<int> dp(k, 0);
dp[0] = 1;
for (int i = 0; i <= n; i++) {
@devanshdalal
devanshdalal / Makefile
Created April 18, 2017 06:02 — forked from h4cc/Makefile
Ubuntu 14.04 LTS Trusty Tahr - Basic packages i usually install
#
# Ubuntu 14.04 LTS (Trusty Tahr)
#
# Basic packages i usually install
#
# Author: Julius Beckmann <github@h4cc.de>
#
# For 16.04 Xenial Xerus: https://gist.github.com/h4cc/fe48ed9d85bfff3008704919062f5c9b
#
https://www.codeproject.com/articles/11835/wordnet-based-semantic-similarity-measurement
/*
Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or
transmitted across a network connection link to be reconstructed later in the same or another computer environment.
Design an algorithm to serialize and deserialize a binary tree. There is no restriction on how your serialization/deserialization
algorithm should work. You just need to ensure that a binary tree can be serialized to a string and this string can be deserialized to the original tree structure.
For example, you may serialize the following tree
1
/ \
2 -3
/
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdlib.h>
#include <iomanip>
using namespace std;
int rand(int i){
return rand()%i;
}
[global_config]
enabled_plugins = LaunchpadCodeURLHandler, APTURLHandler, MavenPluginURLHandler, LaunchpadBugURLHandler
[keybindings]
[profiles]
[[default]]
background_image = None
font = Monospace 14
visible_bell = True
scrollback_infinite = True
foreground_color = "#00ff00"

Stress-tests

System Config

[genstor@genstor8 apache-cassandra-3.11.1]$ lsb_release -a
LSB Version:	:core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID:	CentOS
Description:	CentOS Linux release 7.4.1708 (Core) 
Release:	7.4.1708