[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
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
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] |
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
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 |
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
# 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: |
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
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++) { |
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
# | |
# Ubuntu 14.04 LTS (Trusty Tahr) | |
# | |
# Basic packages i usually install | |
# | |
# Author: Julius Beckmann <[email protected]> | |
# | |
# For 16.04 Xenial Xerus: https://gist.github.com/h4cc/fe48ed9d85bfff3008704919062f5c9b | |
# |
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
https://www.codeproject.com/articles/11835/wordnet-based-semantic-similarity-measurement |
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
/* | |
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 | |
/ |
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
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <stdlib.h> | |
#include <iomanip> | |
using namespace std; | |
int rand(int i){ | |
return rand()%i; | |
} |
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
[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" |
OlderNewer