Skip to content

Instantly share code, notes, and snippets.

Avatar
🎉
Focusing

Tushar Kapila tgkprog

🎉
Focusing
View GitHub Profile
@tgkprog
tgkprog / IcyHot.php
Created Mar 25, 2021
Php sample function with unit test cases
View IcyHot.php
<?php
$count= 0;
$errs = 0;
/**
* Target function, this function is the main function to implement. The signature should be same as
in your question.
View qaug24.txt
On camera need to take 2-3 screen shots of face and then can switch off
Share your screen
Do not seach the internet for specifcally searching for this question, but can use if required for JS arrays/ loops. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration ; https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for ; https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
Extra marks if you can make input - one text box and button (simple validation is number >0 and <20) and output in a div it appear on a HTML page like in https://sel2in.com/pages/prog/html/js2/Zawgyi.html
Use Vanilla Javascrpt no frameworks.
Given n>=0, create an array length n*n with the following pattern, shown here for n=3 : {0, 0, 1, 0, 2, 1, 3, 2, 1} (spaces added to show the 3 groups).
View keybase.md

Keybase proof

I hereby claim:

  • I am tgkprog on github.
  • I am tgkprog (https://keybase.io/tgkprog) on keybase.
  • I have a public key whose fingerprint is E61F 4669 3B6A 5B4F 965C 83BB D7A3 AA51 BE1C 1C1A

To claim this, I am signing this object:

@tgkprog
tgkprog / build.gradle
Last active Aug 24, 2017
Gradle build with with code to put the git revision and other information using org.ajoberstar.grgit
View build.gradle
plugins {
id "org.ajoberstar.grgit" version "1.5.1-rc.3"
}
apply plugin: 'java'
repositories {
///....
}
@tgkprog
tgkprog / Zeppelin-notebook-sample.txt
Last active Jan 5, 2017
Download and run Apache Zeppelin
View Zeppelin-notebook-sample.txt
// * Can copy paste this in to a new zeppelin notebook on http://localhost:8080/ presuming you got zeppelin to install and run
// * Your example should take 6 parameters so that can test 4 transformations including date. this example does not have date parsing.
// * parse a date using DateFormat and use that date to compare to a column (is equal) from file
val start = System.currentTimeMillis()
import scala.util.matching.Regex
import org.apache.spark.sql.functions.udf
import org.apache.spark.sql.catalog.Column
@tgkprog
tgkprog / zep1
Last active Dec 28, 2016
zeppelin load file, input parameters and transform text
View zep1
//** Should be a maven or gradle project and use 0.62 https://zeppelin.apache.org/download.html and scala 2.11, spark spark-2.0.1-bin-hadoop2.7
//** Your example should take 6 parameters so that can test 4 transformations including date. this example does not have date parsing.
//** parse a date using DateFormat and use that date to compare to a column (is equal) from file
import scala.util.matching.Regex
import org.apache.spark.sql.functions.udf
import org.apache.spark.sql.catalog.Column
def doRegReplace(orig: String, reg: Regex, rplc: String): String =
View git-maintenance
# Verifies the connectivity and validity of the objects in the database
git fsck
#—unreachable
# Manage reflog information
#git reflog expire —expire=0 —all
# Pack unpacked objects in a repository
git repack -a -d -l
@tgkprog
tgkprog / maintenance.sh
Last active May 23, 2016 — forked from Zoramite/maintenance.sh
Git Maintenance Commands
View maintenance.sh
# Verifies the connectivity and validity of the objects in the database
git fsck —unreachable
# Manage reflog information
git reflog expire —expire=0 —all
# Pack unpacked objects in a repository
git repack -a -d -l
# Prune all unreachable objects from the object database
@tgkprog
tgkprog / memory1
Created Mar 9, 2015
Memory - function lcoals - get cleaned up?
View memory1
package test;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
/**
Run with param 1 and 2 or change type to "2" and "1"
Available memory changes, used jconsole to change force garbage collection.
See video https://www.youtube.com/watch?v=MadBdryX8uk