Tutorial by Examples: app

# example data DT = data.table(iris) DT[, Bin := cut(Sepal.Length, c(4,6,8))] To apply the same summarizing function to every column by group, we can use lapply and .SD DT[, lapply(.SD, median), by=.(Species, Bin)] # Species Bin Sepal.Length Sepal.Width Petal.Length Petal.Width # 1...
We are just creating an empty Alloy app using CLI and Atom. Open a new terminal and add the following: ti create --id com.test -d . -n APPNAME -p all -t app -u http://migaweb.de cd APPNAME/ alloy new This will create a basic app (name: APPNAME, bundle identifier: com.test, type: app, platform...
There are several ways to compile your app. You can use the simulator/emulator, deploy it to your device or create store apk's/ipa's. There is also a live test tool (TiShadow) which saves you a lot of time waiting for the compiler. cli way # android to device ti build -p android -T device # a...
let configuration = WKWebViewConfiguration() if let path = NSBundle.mainBundle().pathForResource("customUserScript", ofType: "js"), source = try? NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding) as String { let userScript = WKUserScript(source...
A lot of Vim users find the Esc too hard to reach, and end up finding another mapping that's easy to reach from the home row. Note that Ctrl-[ may be equivalent to Esc on an English keyboard, and is much easier to reach. jk inoremap jk <ESC> This one is really easy to trigger; just smash...
If we have this dictionary: set alpha {alice {items {}} bob {items {}} claudia {items {}} derek {items {}}} And want to add "fork" and "peanut" to Alice's items, this code won't work: dict lappend alpha alice items fork peanut dict get $alpha alice # => items {} items f...
As of GHC 7.10, Applicative is a superclass of Monad (i.e., every type which is a Monad must also be an Applicative). All the methods of Applicative (pure, <*>) can be implemented in terms of methods of Monad (return, >>=). It is obvious that pure and return serve equivalent purposes, ...
Suppose the make fails: $ make Launch it instead with make VERBOSE=1 to see the commands executed. Then directly run the linker or compiler command that you'll see. Try to make it work by adding necessary flags or libraries. Then figure out what to change, so CMake itself can pass correct argum...
GWT ships with a command line utility called webAppCreator that automatically generates all the files you’ll need in order to start a GWT project. It also generates Eclipse project files and launch config files for easy debugging in GWT’s development mode. You can create a new demo application in a...
You can add a "Browse Our Other Apps" button in your app, listing all your(publisher) applications in the Google Play Store app. String urlApp = "market://search?q=pub:Google+Inc."; String urlWeb = "http://play.google.com/store/search?q=pub:Google+Inc."; try { I...
The internet is packed with tips for performance improvement of Java programs. Perhaps the number one tip is awareness. That means: Identify possible performance problems and bottlenecks. Use analyzing and testing tools. Know good practices and bad practices. The first point should be done d...
@Provider public class IllegalArgumentExceptionMapper implements ExceptionMapper<IllegalArgumentException> { @Override public Response toResponse(IllegalArgumentException exception) { return Response.serverError().entity("Invalid input: " + exception.getMessage(...
1. Add a platform target iOS: $ ionic platform add ios Android: $ ionic platform add android Windows: $ ionic platform add windows 2. Build your app iOS: $ ionic build ios Android: $ ionic build android Windows: $ ionic build windows Live Reload App During Development...
When you have a Stream you need to map but want to preserve the initial values as well, you can map the Stream to a Map.Entry<K,V> using a utility method like the following: public static <K, V> Function<K, Map.Entry<K, V>> entryMapper(Function<K, V> mapper){ retu...
The METEOR_SETTINGS environment variable can accept JSON objects, and will expose that object in the Meteor.settings object. First, add a settings.json to your app root with some configuration info. { "public":{ "ga":{ "account":"UA-XXXXXXX-1" ...
The wrap panel acts in a similar way to stack panel. Except when it recognizes the items will exceed it's size, it would then wrap them to a new row/column, depending on it's orientation. Horizontal orientation <WrapPanel Width="100"> <Button Content="Button"/&g...
Set default layout for entire application. i.e, created layout file in /src/Template/Layout/admin.ctp class AppsController extends Controller { public function beforeFilter(Event $event) { parent::beforeFilter($event); $this->viewBuilder()->layout('admin'); // For Ver...
Swift let isPushEnabled = UIApplication.sharedApplication().isRegisteredForRemoteNotifications()
Time and date come in a number of different types in Java: The now historic Date and Calendar, and the more recent LocalDate and LocalDateTime. And Timestamp, Instant, ZonedLocalDateTime and the Joda-time types. On the database side, we have time, date and timestamp (both time and date), possibly wi...
var numbers = [1,2,3,4,5]; var squares = numbers.map(function(x) { return x*x; }); // squares is [1,4,9,16,25]

Page 11 of 33