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 Jaba(option: Option[_]) { def whenEmpty(f: => Unit) { if (!option.isDefined) f } } | |
implicit def option2Jaba(o: Option[_]) = new Jaba(o) | |
val x: Option[Unit] = None | |
x whenEmpty { println("yeah") } |
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
E/AndroidRuntime(19512): FATAL EXCEPTION: main | |
E/AndroidRuntime(19512): java.lang.NoSuchMethodError: android.widget.TextView.setBackground | |
E/AndroidRuntime(19512): at fi.allacca.WeekViewRenderer.fi$allacca$WeekViewRenderer$$initDayView(weeks.scala:250) | |
E/AndroidRuntime(19512): at fi.allacca.WeekViewRenderer$$anonfun$updateView$1.apply$mcVI$sp(weeks.scala:137) | |
E/AndroidRuntime(19512): at fi.allacca.WeekViewRenderer$$anonfun$updateView$1.apply(weeks.scala:134) | |
E/AndroidRuntime(19512): at fi.allacca.WeekViewRenderer$$anonfun$updateView$1.apply(weeks.scala:134) | |
E/AndroidRuntime(19512): at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245) | |
E/AndroidRuntime(19512): at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245) | |
E/AndroidRuntime(19512): at scala.collection.immutable.Range.foreach(Range.scala:137) | |
E/AndroidRuntime(19512): at scala.collection.TraversableLike$class.map(TraversableLike.scala:245) |
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
private def getMonthLetterForWeek(yearAndWeek: YearAndWeek): String = { | |
val day = yearAndWeek.firstDay | |
val currentDayCalendar = day.toCalendar(Locale.getDefault()) | |
val weekOfMonth = currentDayCalendar.get(Calendar.WEEK_OF_MONTH) | |
if (weekOfMonth < 5) { | |
val shortMonths = new DateFormatSymbols(Locale.ENGLISH).getShortMonths | |
val weekOfMonthIndex = weekOfMonth - 2 | |
if (weekOfMonthIndex < 0) "" else (shortMonths(day.getMonthOfYear - 1)(weekOfMonthIndex) + "").toUpperCase | |
} else { "" } | |
} |
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
W/View (13351): requestLayout() improperly called by android.widget.TextView{425e2c60 V.ED.... ......ID 0,0-120,120 #1} during layout: running second layout pass | |
W/ResourceType(13351): No package identifier when getting name for resource number 0x00000001 | |
W/View (13351): requestLayout() improperly called by android.widget.TextView{425e2c60 V.ED.... ......ID 0,0-120,120 #1} during layout: running second layout pass | |
W/ResourceType(13351): No package identifier when getting name for resource number 0x00000001 | |
W/View (13351): requestLayout() improperly called by android.widget.TextView{425e2c60 V.ED.... ......ID 0,0-120,120 #1} during layout: running second layout pass | |
W/ResourceType(13351): No package identifier when getting name for resource number 0x00000001 | |
W/View (13351): requestLayout() improperly called by android.widget.TextView{425e2c60 V.ED.... ......ID 0,0-120,120 #1} during layout: running second layout pass | |
W/ResourceType(13351): No package identifier when getting name for resource number |
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
D/ALLACCA (26924): elapsed time readEvents: 3716771 ns (3.716771 ms) | |
D/ALLACCA (26924): elapsed time groupBy: 7391823 ns (7.391823 ms) | |
D/ALLACCA (26924): elapsed time getDays: 4553697 ns (4.553697 ms) | |
D/ALLACCA (26924): elapsed time create daysWithEventsMap: 4560521 ns (4.560521 ms) | |
D/ALLACCA (26924): elapsed time filter which contents are new: 461042 ns (0.461042 ms) | |
D/ALLACCA (26924): elapsed time concatenating: 211146 ns (0.211146 ms) | |
D/ALLACCA (26924): elapsed time Id array creation: 2030520 ns (2.03052 ms) | |
D/ALLACCA (26924): elapsed time Fast(?) sort: 190313 ns (0.190313 ms) | |
D/ALLACCA (26924): elapsed time Construct new contents: 2500313 ns (2.500313 ms) | |
D/ALLACCA (26924): elapsed time Update model: 7531979 ns (7.531979 ms) |
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
fi/allacca/WeeksAdapter; | |
I/System.out(20532): getView call with pos 0 count 1 | |
I/System.out(20532): getView call with pos 1 count 2 | |
I/System.out(20532): getView call with pos 2 count 3 | |
I/System.out(20532): getView call with pos 3 count 4 | |
I/System.out(20532): getView call with pos 4 count 5 | |
I/System.out(20532): getView call with pos 5 count 6 | |
I/System.out(20532): getView call with pos 6 count 7 | |
I/System.out(20532): getView call with pos 7 count 8 | |
I/System.out(20532): getView call with pos 8 count 9 |
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 WeeksAdapter(activity: Activity, dimensions: ScreenParameters) extends BaseAdapter { | |
val nowIndex = Integer.MAX_VALUE/2 | |
val nowDateTime = new DateTime().withTimeAtStartOfDay | |
val nowWeek = nowDateTime.getWeekyear | |
def positionOfNow: Int = nowIndex | |
override def getCount: Int = Integer.MAX_VALUE |
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
#!/bin/bash | |
set -e | |
command="$1" | |
eka() { | |
local use_x_flag=false | |
while getopts ":x:" o; do | |
case "${o}" in |
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
For the lack of a nail, | |
throw new HorseshoeNailNotFoundException("no nails!"); | |
For the lack of a horseshoe, | |
EquestrianDoctor.getLocalInstance().getHorseDispatcher().shoot(); | |
For the lack of a horse, | |
RidersGuild.getRiderNotificationSubscriberList().getBroadcaster().run( | |
new BroadcastMessage(StableFactory.getNullHorseInstance())); |
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
function textFieldValue(parentElement, inputFieldSelector) { | |
return parentElement.asEventStream("keyup input").filter(isNotEnter). | |
merge(parentElement.asEventStream("cut paste").delay(1)). | |
merge(autofillPoller()). | |
map(getValue).toProperty(getValue()).skipDuplicates(); | |
function getValue() { | |
var inputField = parentElement.find(inputFieldSelector) | |
return _.isEmpty(inputField) ? "" : inputField.val(); | |
} |