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
case class NameAndScreenName(val name: String, val screenName: String) extends Ordered[NameAndScreenName] { | |
override def toString = name + " (" + screenName + ")" | |
def compare(other: NameAndScreenName) = screenName compareToIgnoreCase other.screenName | |
def matches(search: String) = { | |
val slc = search.toLowerCase | |
search.length == 0 || name.toLowerCase.contains(slc) || screenName.toLowerCase.contains(slc) | |
} | |
} | |
title = "Send Message" |
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
val isMentions = tweetsProvider.isInstanceOf[MentionsProvider] // TODO do without this test | |
val model = if (isMentions) | |
new StatusTableModel(sto, tweetsProvider, usersTableModel, fs, service, user.user, tagUsers) with Mentions | |
else | |
new StatusTableModel(sto, tweetsProvider, usersTableModel, fs, service, user.user, tagUsers) |
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 javax.swing.SwingWorker | |
class A { | |
def loadAll(f:(Int) => List[String]): List[String] = List("a") | |
def getFriendsIds(page: Int): List[String] = List("a") | |
def getFollowersIds(page: Int): List[String] = List("a") | |
} | |
class B { | |
def setFollowers(followers: List[String]) {} |
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
case class Word(val word: String, val count: Long) { | |
override def toString = word + ": " + count | |
} | |
private def showWordCloud { | |
val counts = LinkedHashMap[String,Long]() | |
statusTableModel.filteredStatuses.map(status => { | |
List.fromArray(status.text.split("\\s")).foreach(word => { | |
counts.put(word, counts.getOrElse(word, 0L) + 1L) | |
}) |
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
http://twitter.com/statuses/followers.xml?page=4 (for dcbriccetti) | |
<status> | |
<created_at>Sun Sep 13 00:35:57 +0000 2009</created_at> | |
<id>3944822863</id> | |
<text>@milessabin as long as workinggroups and incubation happen, I'm fine. Your idea seems like less setup work initially for projects</text> | |
<source><a href="http://echofon.com/" rel="nofollow">Echofon</a></source> | |
<truncated>false</truncated> | |
<in_reply_to_status_id>#<StatusInternal:0x242d90c8></in_reply_to_status_id> | |
<in_reply_to_user_id>29444566</in_reply_to_user_id> |
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
GETing data from http://twitter.com/statuses/friends/dcbriccetti.xml?page=4 | |
11:40:24,221 [pool-16-thread-1] ERROR twitter - java.lang.IllegalArgumentException: Invalid format: "2009-09-18T17:11:23+00:00" <retweeted_at type="datetime">2009-09-18T17:11:23+00:00</retweeted_at> | |
<retweet_details> | |
<retweeting_user> | |
<id>20</id> | |
<name>Evan Williams</name> | |
<screen_name>ev</screen_name> | |
<location>San Francisco, CA, US</location> | |
<description>CEO of Twitter</description> | |
<profile_image_url>http://a1.twimg.com/profile_images/66154838/ev-sky_bigger_normal.jpg</profile_image_url> |
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
# Does the Python community enjoy this type of thing as much as the Scala community? | |
[[gridPanel.add(self.checkBoxes[r][c]) for r in range(R)] for c in range(C)] | |
# Or should I split it into the more conventional: | |
for r in range(R): | |
for c in range(C): | |
gridPanel.add(self.checkBoxes[r][c]) |
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
# Conway's Game of Life, for the Young Programmers Podcast | |
from javax.swing import JFrame, JPanel, JButton, JToggleButton, Timer | |
from java.awt import FlowLayout, GridLayout | |
from java.awt.BorderLayout import SOUTH | |
from GridMutator import GridMutator | |
class LifeGame(object): | |
def __init__(self, numRows, numCols): | |
self.numRows = numRows |
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 GridMutator(object): | |
def generateNext(self, grid): | |
(ROWS, COLS) = (len(grid), len(grid[0])) | |
nextGrid = [[False for r in range(ROWS)] for c in range(COLS)] | |
for row in range(ROWS): | |
for col in range(COLS): | |
neighbors = self._countNeighbors(grid, row, col) | |
nextGrid[row][col] = neighbors == 3 if not grid[row][col] \ | |
else neighbors in (2,3) | |
return nextGrid |
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
<status> | |
<created_at>Thu Sep 24 00:52:00 +0000 2009</created_at> | |
<id>4329889268</id> | |
<text>:@michaelg Hmm, I wonder what it was that broke it earlier.</text> | |
<source><a href="http://www.atebits.com/" rel="nofollow">Tweetie</a></source> | |
<truncated>false</truncated> | |
<in_reply_to_status_id>4329766281</in_reply_to_status_id> | |
<in_reply_to_user_id>1378181</in_reply_to_user_id> | |
<favorited>false</favorited> | |
<in_reply_to_screen_name>michaelg</in_reply_to_screen_name> |
OlderNewer