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
{ | |
"addresses": [{ | |
"line1": "123 Fake street", | |
"line2": null, | |
"city": "Oakland", | |
"state": "CA", | |
"zip": "94602" | |
}, { | |
"line1": "517 Montauk Hwy", | |
"line2": null, |
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 React from 'react-native' | |
var { | |
Image, | |
Animated, | |
View | |
} = React | |
module.exports = React.createClass({ | |
getInitialState() { |
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 React from 'react-native' | |
var { | |
Image, | |
Animated, | |
View | |
} = React | |
module.exports = React.createClass({ | |
getInitialState() { |
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
module.exports = React.createClass({ | |
displayName: 'ImageTester', | |
getInitialState() { | |
return { | |
showImage: false | |
}; | |
}, | |
render() { |
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
def getCounts[T](list: Seq[T]): Map[T, Int] = list.foldLeft(Map.empty[T, Int]) { (m: Map[T, Int], x: T) => m + ((x, m.getOrElse(x, 0) + 1)) } |
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 scala.collection.mutable.Map; | |
def getCounts[T](list: Seq[T]): Map[T, Int] = { | |
val map = Map.empty[T, Int]; | |
list.foreach(x => { | |
if (!map.contains(x)) { | |
map.put(x, 0); | |
} | |
map.put(x, map(x) + 1); | |
}); | |
return map; |
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
def getCounts[T](list: Seq[T]): Map[T, Int] = { | |
list.foldLeft(Map.empty[T, Int]) { (m: Map[T, Int], x: T) => m + ((x, m.getOrElse(x, 0) + 1)) } | |
} |
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
public static <T> Map<T, Integer> getCounts(List<T> list) { | |
Map<T, Integer> counts = new HashMap<T, Integer>(); | |
for(T item : list) { | |
if(!counts.containsKey(item)) { | |
counts.put(item, 0); | |
} | |
counts.put(item, counts.get(item) + 1); | |
} | |
return counts; | |
} |
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
<div class="gist">https://gist.github.com/6968489</div> |
NewerOlder