This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
jar.libs.dir=../gol/jar |
<target name="-pre-compile"> | |
<subant target="jar"> | |
<fileset dir="../gol" includes="build.xml" /> | |
</subant> | |
</target> |
extensible.libs.classpath=../gol/jar |
public void testOnButtonClick_StartSettings() throws Exception { | |
AlarmActivity activity = getActivity(); | |
activity.onAddAlarm(); | |
Intent intent = getStartedActivityIntent(); | |
assertEquals(SettingsActivity.class.getCanonicalName(), | |
intent.getComponent().getClassName()); | |
} |
public void testGiven15Alarms_WhenAddNewAlarm_ThenShowToastWithErrorMessage() throws Exception { | |
populateAlarms(15); | |
mSolo.clickOnButton(0); // try to add new alarm | |
// check Toast message | |
assertTrue(mSolo.searchText(mActivity.getString(R.string.max_alarm_error))); | |
assertEquals(15, mActivity.getAlarmCount()); | |
} |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
type Data struct { | |
data string | |
rq1, rq2, rs1, rs2 chan bool |
package com.jooyunghan.concurrency; | |
import static java.lang.String.format; | |
import java.util.concurrent.ArrayBlockingQueue; | |
import java.util.concurrent.BlockingQueue; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
class Message { |
#include <iostream> | |
using namespace std; | |
const char CLOSED = '#'; | |
const char MINE = '*'; | |
const char EMPTY = '-'; | |
const int row = 2; | |
const int col = 6; | |
char input[row][col] = { |
class trie { | |
int count; | |
unordered_map<char, trie> children; | |
int& get(const char* s) { | |
if (*s == '\0') { | |
return count; | |
} else { | |
return children[*s].get(s+1); | |
} |