-16 karma · joined July 10, 2012
send(JSONSerialization.with(StringSerializer.class, DateTimeSerializer.class).serialize(JSONObjectFactory.put(PairFactory.of(String.class, String.class).getInstance("author", "system"), PairFactory.of(String.class, String.class).getInstance("message", "Only json is allowed"), PairFactory.of(String.class, DateTime.class).getInstance("time", new Date())).getInstance()))
no, it's just json4s dsl for constructing json. If you wanted, you could've used constructors yourself: send(pretty(render(JObject(List(JField("author", JString("system")), JField("message", JString("Only json allowed")), JField("time", JString(new DateTime().getTime().toString()))))
usually scala libraries come with an easy to read/write DSL version of the API along with a more verbose java-style API shown above. Many libraries don't document with a plenty of examples. But, it really takes 10 minutes to learn DSL version in many cases. And, it gives you wings. There are plenty of benefits of DSL. You can research online about them. curl -v -s -X "GE$(printf '%.s ' {0..100000})" localhost:8888
It doesn't kill node process.. but there could be buffer overflow or similar bug in that parser code.in development:
<script data-main="your-module.js" src="require.js"></script>
in production: <script src="your-module.min.js"></script>
One problem I haven't solved is when html renderer writes inputs to your javascript module. I can either print my module's main body in html: <script>
require(['yourModule'], function(yourModule) {
var config = {% server template vars %};
yourModule.start(config);
});
</script>
Or use global config variable and shim.current behavior is totally fine. it is well defined that somelist.append(x) appends x to somelist inplace.
usually, you pick one 30 minute to 60 minute video, and watch it every day, 6 days a week. make sure you take a break every week. you watch it to the point where you can mimic what they are saying as the video is playing. you don't have to know exact meaning of your utterance. but you already have some sense. then, you transcribe it on paper (you need to learn writing system by this time). maybe use dictionary to learn actual words. rehearse with the video. if have friends, rehearse with them. memorize it. move on to the next video.
start with sitcoms then maybe news broadcast, reality shows (court shows are great), movies...
video is just one example. if you're learning a language where you can't find suitable videos (there might be no production in the language), make friends who speak the language. record their conversations. play repetitively until you can follow along with a loud voice. transcribe.. etc.
findAirline: AirlineCode => Future[Option[Airline]]
getFlightsForToday: Airline => Future[Seq[Flight]]
findAvailable: Seq[Flight] => Constraints => Future[Option[Flight]
compose them so that I get: findFlight: AirlineCode => Constraints => Future[Flight]
I don't want `Future[Option[Flight]]` since Future has own error handling (using Try). No cheating by using scalaz monad transformer.I was robbing a bank and Google alerted me that I should leave "now".
Which was really weird for me, since I had a lot of gold to transport.
Apparently, it read through my emails, seen a glitch from other galaxy, figured out portal has opened, and already calculated how long it would take for the aliens to invade the earth.