This file contains hidden or 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
$(function() { | |
function isValidTarget(node) { | |
return /^img|canvas$/i.test(node.nodeName); | |
}; | |
$('div.entry table tbody td span').mouseenter(function(e) { | |
var target = e.target; | |
if (isValidTarget(target)) { | |
var img = new Image(); |
This file contains hidden or 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
<?php | |
$url = 'http://www.code.ge/uncategorized/youtube-edu-და-ბევრი-საინტერესო-მას'; | |
$url = urldecode($url); | |
if (!preg_match('~^https?://~', $url)) { | |
$url = 'http://' . $url; | |
} | |
$parsed = parse_url($url); |
This file contains hidden or 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
function arrayChunk(array, size) { | |
var start = 0, result = [], chunk = []; | |
while((chunk = array.slice(start, start += size)).length) { | |
result.push(chunk); | |
} | |
return result; | |
} |
This file contains hidden or 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
package com.topcoder; | |
public class Bonuses { | |
public int[] getDivision(int[] points) { | |
int bonuses[] = new int[points.length]; | |
int pool = 0, percentsLeft = 100; | |
for (int point : points) { |
This file contains hidden or 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
package ge.code.topcoder; | |
public class PowerOutage { | |
public int estimateTimeOut(int[] fromJunction, int[] toJunction, int[] ductLength) { | |
int[] sum = new int[50]; | |
int total = 0, max = 0; | |
for (int i = 0; i < fromJunction.length; i++) { |
This file contains hidden or 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
package ge.code.topcoder; | |
public class BinaryCode { | |
private static final String NONE = "NONE"; | |
private int toInt(char c) { | |
return Integer.parseInt(Character.toString(c)); | |
} | |
This file contains hidden or 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
package ge.code.topcoder; | |
import java.util.Arrays; | |
import java.util.Comparator; | |
public class Lottery { | |
private static final Comparator<Rule> RULE_COMPARATOR = new Comparator<Rule>() { | |
public int compare(Rule o1, Rule o2) { | |
int result = 1; |
This file contains hidden or 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
/** | |
* code by Ioseb Dzmanashvili http://www.code.ge | |
* MIT License | |
*/ | |
output = java.io.FileWriter(arguments[1]); //obtain FileWriter object | |
output.write( | |
pack( //invoke Dean Edward's packer function | |
readFile( //read input file: http://www.mozilla.org/rhino/shell.html | |
arguments[0] //input file path |
NewerOlder