I came across this issue while I was working on a functional test for JAMLive!, a Play! application I'm currently working on obsessing over in my free time. I have a controller with a connect
method that looks like this:
import java.util.Scanner; | |
/** | |
* Class that contains logic to reverse the bits of an integer and spit it | |
* back out. | |
*/ | |
public class ReverseBinary { | |
/** | |
* Reverse the bits of an integer between 1 ≤ n ≤ 1000000000. |
""" | |
I apologize this isn't more well-documented :/ | |
""" | |
#!/usr/bin/env python | |
""" | |
Plays the game of cat vs. dog | |
""" | |
from sys import stdin |
###Comprehensive Technical Interview Question
Consider the following javascript module:
/**
* A module for tracking when a user visits the page.
*/
window.VisitingDateTracker = {
/**
* Initialize the tracker.
On the Refinery29 Mobile Web Team, codenamed "Bicycle", all of our unit tests are written using Jasmine, an awesome BDD library written by Pivotal Labs. We recently switched how we set up data for tests from declaring and assigning to closures, to assigning properties to each test case's this
object, and we've seen some awesome benefits from doing such.
Up until recently, a typical unit test for us looked something like this:
describe('views.Card', function() {
# Installs protobuf 2.6.0 on Ubuntu (currently not a deb package ugh) | |
protodir=protobuf-2.6.0 | |
filename="$(protodir).tar.gz" | |
known_md5=9959d86087e64524d7f91e7a5a6e4fd7 | |
builddir="$(mktemp -d $TMPDIR/protobuild.XXXXXX)" | |
if [ ! -d $builddir ]; then | |
echo "$0: Can't create temp build dir! WTF??!" | |
exit 1 |
After scouring the internet and piece-mealing together the correct way to do this, here is a step-by-step, all-in-one-place guide to making logback STFU when running your unit tests.
Save the following as logback-test.xml
under src/test/resources
:
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%msg%n</pattern>
'use strict'; | |
import _ from 'lodash'; | |
import i18n from 'i18n'; | |
import {version} from '../../package.json'; | |
registerI18n.attributes = { name: 'i18n', version }; | |
export default registerI18n; |
This is an english translation of http://www.guideitech.com/apple/come-rinominare-facilmente-un-gruppo-di-file-su-os-x-yosemite/ While I translated it mostly to practice my Italian, it's a great article and shows a cool feature on Yosemite if you don't want to deal with doing this at the command line :) Also please let me know if you find any mistakes or bad translations!
I’m sure there are hundreds of unorganized files on your macs right this moment. Vacation photos, PDF documents, downloads, TV series, or whatever. The first step in organizing these contents is to give them proper names.
// See: http://www.programcreek.com/2012/12/leetcode-merge-intervals/ | |
console.log(mergeIntervals([[1,3],[2,6],[8,10],[15,18]])); | |
console.log(mergeIntervals([[1,8], [2,10], [3,6]])); | |
console.log(mergeIntervals([[1,8], [2, 8], [3, 6]])); | |
function mergeIntervals(intervals) { | |
if (intervals.length < 2) { | |
return intervals; | |
} |