ได้อย่างมีความสุขมากยิ่งขึ้น
feature
- สามารถเรียกใช้ ri จากใน irb ได้เลย
- output ที่ได้มีสีสรรสวยงาม (colorize)
- persistent command history
Javaเร็วส์, Javascript, Erlang, Python, Ruby, Clojure, Groovy, เลี้ยงลูก, วาดภาพ
+ A
- sub1
- sub2
- sub3
+ A
- sub1
+ B
+ sub2
+ sub3


public class HttpUnitGoogleTest extends TestCase {
public void testGoogleImageSearch() throws Exception {
WebConversation conversation = new WebConversation();
WebResponse page = conversation.getResponse("http://www.google.com/");
assertEquals(page.getTitle(), "Google");
page = page.getLinkWith("Images").click();
WebForm form = page.getForms()[0];
form.setParameter("q", "kizoom");
page = form.submit();
assertTrue(page.getText().contains("<b>Kizoom</b> summer party"));
boolean foundImage = false;
for (WebImage i : page.getImages()) {
if (i.getSource().endsWith("summer04.jpg")) {
foundImage = true;
break;
}
}
assertTrue(foundImage);
}
}
public class GoogleTest extends NavigatingLiftTestCase {
public void testGoogleImageSearch() throws Exception {
goTo("http://www.google.com/");
assertThat(page, has(title("Google")));
clickOn(link("Images"));
enter("kizoom", into(textField()));
clickOn(button("Search Images"));
assertThat(page, has(text("Kizoom summer party")));
assertThat(it, has(image().withUrlThat(endsWith("summer04.jpg"))));
}
}
@DataProvider(name = "test1")
public Object[][] createData1() {
return new Object[][] {
{ "Cedric", new Integer(36) },
{ "Anne", new Integer(37)},
};
}
@Test(dataProvider = "test1")
public void verifyData1(String n1, Integer n2) {
System.out.println(n1 + " " + n2);
}
public void testFormat() {
AST ast = parse(cmd, "(b10)");
assertFormat(ast, "b", null, "10");
ast = parse(cmd, "(c15)");
assertFormat(ast, "c", null, "15");
ast = parse(cmd, "(-c15)");
assertFormat(ast, "c", "-", "15");
...
...(ยาวไปอีก 1 หน้ากระดาษ)
We are in the process of eliminating databases. Why did we use them in
the first place? You just do. If you are an engineer and I say I need
to store a lot of data and your answer is not "A database!", you fail
CS101. No one ever asks, "how do you want to access it, why do you
think you need a database".
public static Indexer buildIndexer(
@InjectService("JobScheduler") JobScheduler scheduler,
@InjectService("FileSystem") FileSystem fileSystem)
{
IndexerImpl indexer = new IndexerImpl(fileSystem);
scheduler.scheduleDailyJob(indexer);
return indexer;
}
If you care about what you do, you care about getting better at it.
The point is that when you try a new technique it'll often make you worse, at least initially. You have to work with something unfamiliar, perhaps also unlearn something else that gets in the way. During that period you performance has dipped. Only with perseverance can you get through this and reach a higher plateau.
>> $KCODE='UTF8'
=> "UTF8"
>> name = 'ภาษาไทย'
=> "ภาษาไทย"
>> name.length
=> 21
>> name.chars.length
=> 7
>> name.reverse
=> "\242\270룠蒹ಸಸ࠸\340"
>> name.chars.reverse
=> #<ActiveSupport::Multibyte::Chars:0x28ad624 @string="ยทไาษาภ">
>> name.chars.reverse.to_s
=> "ยทไาษาภ"
>> name[1..3]
=> "\270\240\340"
>> name[0..3]
=> "ภ\340"
>> name.chars[0..3].to_s
=> "ภาษา"
Cometd is a scalable HTTP-based event routing bus that uses a push technology pattern known as Comet.
dojo.io.cometddef recognize(path, environment={})
write_recognition
recognize path, environment
end
write_recognition