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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
var map = {}; | |
var toggle = true; | |
keyEvent = function(e) { | |
map[e.keyCode] = e.type == 'keydown'; | |
if(map[17] && map[65]) { | |
img = document.getElementById("image"); |
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
# coding=UTF-8 | |
from __future__ import division | |
import re | |
# This is a naive text summarization algorithm | |
# Created by Shlomi Babluki | |
# April, 2013 | |
class SummaryTool(object): |
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
Publisher: | |
# Persist message in a queue | |
lpush channel1.queue message | |
# Publish message to any connected subscriber | |
publish channel1 message | |
Subscriber: | |
# Subscribe to channel1 | |
subscribe channel1 |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) | |
func main() { | |
mapD := map[string]interface{}{"deploy_status": "public", "status": "live", "version": 2} | |
mapB, _ := json.Marshal(mapD) |
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
import ( | |
"archive/zip" | |
"io" | |
"os" | |
"path/filepath" | |
"strings" | |
) | |
func zipit(source, target string) error { | |
zipfile, err := os.Create(target) |
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
package main | |
import ( | |
"log" | |
"math" | |
) | |
func Round(val float64, roundOn float64, places int ) (newVal float64) { | |
var round float64 | |
pow := math.Pow(10, float64(places)) |
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
class A | |
attr_accessor :a | |
def initialize | |
@a = 100 | |
end | |
def aa | |
a = 1000 |
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
f=fs.readdirSync(".") | |
for(i=0; i<f.length; i++) {fs.renameSync(f[i], f[i].replace(/ |\'/g, "-"))} |
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
We define to be a permutation of the first natural numbers in the range . Let denote the position of in permutation (please use -based indexing). | |
is considered to be an absolute permutation if holds true for every . | |
Given and , print the lexicographically smallest absolute permutation, ; if no absolute permutation exists, print -1. | |
Input Format | |
The first line of input contains a single integer, , denoting the number of test cases. | |
Each of the subsequent lines contains space-separated integers describing the respective and values for a test case. |
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
Bob has a strange counter. At the first second, , it displays the number . At each subsequent second, the number displayed by the counter decrements by . | |
The counter counts down in cycles. In the second after the counter counts down to , the number becomes the initial number for that countdown cycle and then continues counting down from the new initial number in a new cycle. The diagram below shows the counter values for each time in the first three cycles: | |
https://s3.amazonaws.com/hr-challenge-images/22185/1469447349-bae87a5071-strange1.png | |
Given a time, , find and print the value displayed by the counter at time . | |
Input Format |