Skip to content

Instantly share code, notes, and snippets.

View dileephell's full-sized avatar
🎯
Focusing

Dileep Singh dileephell

🎯
Focusing
View GitHub Profile
@dileephell
dileephell / gist:386c3f51f52891415713
Last active August 29, 2015 14:14
Quiz competition
http://jsfiddle.net/wanwu/mAcaM/light/
https://github.com/debugmodedotnet/womensafety/tree/master/SafeBridge
@dileephell
dileephell / gist:cab06d51ce0e88b4d449
Last active August 29, 2015 14:14
Characters Strike and Drop in the valley --Words with Enemies
Description:
I had a dream a few weeks back that I thought would be a good challenge. I woke up early and quickly typed up a text description so I wouldn't forget (Seriously, it was about 5am and when I explained it to my wife she just laughed at me)
Okay so there is a valley. On each side you got cannons. They are firing words at each other. In the middle of the valley the words would make contact and explode. Similar letters from each word would cancel out. But the left over unique letters from each word would fall to the valley and slowly fill it up.
So your challenge is to come up with the code given two words you eliminate letters in common at a ratio of 1 for 1 and produce a set of letters that are left over from each word after colliding in mid air. Which ever side has the most letters left over "wins". If each side donates an equal amount of letters it is a "tie".
Examples:
hat cat
both have an "a" and a "t". They will explode and cancel each other out so you get an "h" and a "c" left and so the answ
var a,b=0,c=10,qwer ="TFy!QJu ROo TNn(ROo)SLq SLq ULo+UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^NBELPeHBFHT}TnALVlBLOFAkHFOuFETpHCStHAUFAgcEAelclcn^r^r\\tZvYxXyT|S~Pn SPm SOn TNn ULo0ULo#ULo-WHq!WFs XDt!";
while ((a = qwer.charCodeAt(b++)) != 0) {
while (a-- > 64) {
require('sys').print( ++c==90 ? String.fromCharCode(c = c/ 9):String.fromCharCode(33^b&1));
}
}
//Source : http://codepad.org/ngiITeZ4
TypeError: Object has no method 'push'
at Object.createnewrecord (/home/dileep/Documents/erp/erp-schema/modals/mdl_vndr_myproduct.js:72:20)
at exports.newsubmit (/home/dileep/Documents/erp/erp-schema/mongo_access/vndr_fn_product.js:45:14)
at callbacks (/home/dileep/node_modules/express/lib/router/index.js:161:37)
at exports.login_check (/home/dileep/Documents/erp/erp-schema/security/check_authentication.js:10:4)
at callbacks (/home/dileep/node_modules/express/lib/router/index.js:161:37)
at param (/home/dileep/node_modules/express/lib/router/index.js:135:11)
at pass (/home/dileep/node_modules/express/lib/router/index.js:142:5)
at Router._dispatch (/home/dileep/node_modules/express/lib/router/index.js:170:5)
at Object.router (/home/dileep/node_modules/express/lib/router/index.js:33:10)
show collections
pageviews
products
system.indexes
test
users
>
>
> db.users.find()
{ "_id" : ObjectId("519b6c75e4b0a0a2b3e95185"), " _id" : "joe", "joined" : "2012-02-03T00:00:00Z", "likes" : [ "tennis", "golf" ] }
dileep@dileep-VirtualBox:~/Downloads/JMongoBrowser-linux-all_1-1-1$ java -jar JMongoBrowser.jar
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
at com.edgytech.swingfast.ButtonBase.xmlPostLoadComponentCallback(ButtonBase.java:344)
at com.edgytech.swingfast.XmlComponentUnit.xmlPostLoadCallback(XmlComponentUnit.java:423)
at com.edgytech.swingfast.XmlUnit.xmlLoad(XmlUnit.java:903)
at com.edgytech.swingfast.XmlUnit.xmlLoad(XmlUnit.java:804)
at com.edgytech.swingfast.XmlUnit.xmlLoad(XmlUnit.java:779)
at com.edgytech.swingfast.XmlUnit.xmlCreateAndAddChild(XmlUnit.java:668)
at com.edgytech.swingfast.XmlUnit.addAllChildren(XmlUnit.java:1270)
at com.edgytech.swingfast.XmlUnit.structure(XmlUnit.java:1196)
var ExifImage = require('exif').ExifImage;
var easyimg= require('easyimage');
var path = require('path');
var uuid=require('node-uuid');
var tmp_path = req.files.uploadimgs.path,uuid;
console.log(uuid);
fs.exists('/upload/work',function(exists){
fs.mkdir('./upload/work',function() {
var target_path = './upload/work/'+uuid() +'.png';
var ExifImage = require('exif').ExifImage;
var easyimg= require('easyimage');
var path = require('path');
var uuid=require('node-uuid');
var tmp_path = req.files.uploadimgs.path,uuid;
console.log(uuid);
fs.exists('/upload/work',function(exists){
fs.mkdir('./upload/work',function() {
var target_path = './upload/work/'+uuid() +'.png';
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Infinite Carousel</title>
<style type="text/css" media="screen">
<!--
body { font: 1em "Trebuchet MS", verdana, arial, sans-serif; font-size: 100%; }
easyimg.resize({src:'./upload/work/abcd.png', dst:'./upload/work/abcd-small.png', width:50, height:50}, function(err, stdout, stderr) {
if (err) throw err;
console.log('Resized to 50x50');
});
shows error me like