Skip to content

Instantly share code, notes, and snippets.

View linkin-park's full-sized avatar
🏠
Working from home

linkin-park

🏠
Working from home
View GitHub Profile
@linkin-park
linkin-park / Misc
Created January 26, 2016 03:14
Adder Custom
public static void main(String[] args) {
String n1 = "99";
int n1size = n1.length();
String n2 = "12";
int n2size = n2.length();
if (n2.length() > n1.length()) {
StringBuilder s = new StringBuilder("");
for (int i = 0; i < n2size - n1size; i++) {
s.append("0");
}
@linkin-park
linkin-park / NumberToWords
Last active January 27, 2016 10:14
Converting Number to word format
public class NumberToWords{
/**
* @param args
*/
public static void main(String[] args) {
String noforWords = "15963";
StringBuilder noinWords = new StringBuilder();
//Integer val = Integer.parseInt(noforWords);
int curr = Integer.parseInt(noforWords);
delete from cellulars1 where cid not in (select c.cid from cellulars1 c group by c.number);
package com.concurrency;
import java.util.concurrent.ConcurrentLinkedQueue;
public class ITCExist {
private static ConcurrentLinkedQueue<Integer> clQ = new ConcurrentLinkedQueue<>();
static class Producer implements Runnable {
@Override
@linkin-park
linkin-park / Sheet 1 tested
Created November 3, 2016 13:56
Update 1 - VBA , update the logic
Function generateObject() As RowCell
Set rfirst = Selection.Rows.Item(1) ' initialized to first row
Dim cell As Variant
Dim count As Integer
Dim dict As Variant
Set dict = CreateObject("Scripting.Dictionary") ': dict.CompareMode = vbTextCompare
count = 0
Debug.Print "total Rows in Selection " & Selection.Rows.count
Dim tempRowCell As RowCell, theParentRowCell As RowCell
class Player
@health = 20
def play_turn(warrior)
if warrior.feel.empty? then
if warrior.health<@health then
@health = warrior.health
warrior.walk!
else
@health = warrior.health
warrior.rest!
@linkin-park
linkin-park / Links
Created February 23, 2017 05:59
ed tutorial
@linkin-park
linkin-park / Array
Created July 5, 2017 08:19
JS - ProtoType
//Array . prototype
Array.prototype.every = function(f){
//isevery = false; // intially set to false
for(let i=0;i<this.length;i++)
if(!f(this[i])) return false; // onfailing it returns false
return true;
}
Array.prototype.some = function(f){
-module(pat_assignment).
-export([xOr1/2,xOr2/2,xOr3/2,xOr5/2,maxThree/3,test/0]).
xOr1(true,false)->true;
xOr1(false,true)->true;
xOr1(X,Y)->false.
xOr2(true,false)->true;
46> XOr=fun(true,X)->not(X);
(false,X)->X end.