Search

Search results

A Java JFileChooser example, with ActionEvent, ActionListener, Insets, actionPerformed, showOpenDialog

... applications quite a bit, and I want it to be easier to find on my website.) /** * Copyright (c) 2006 Sun Microsystems, Inc. All ... + "." + newline); } else { log.append("Open command cancelled by user." + newline); } ... } else { System.err.println("Couldn't find file: " + path); return null; } } /** * Create the GUI ...

Source_Code - alvin - Nov 24 2014 - 11:59pm - 0 comments

Converting PDF content to plain text with Scala (or Java)

... its limitations. In my Github project you’ll find a shell script to compile the application into a native Mac OS X ... include Jar files in a Scala shell script, (b) how to read command line arguments in a Scala shell script, or (c) how to precompile a ...

Blog - alvin - Nov 17 2014 - 3:26pm - 0 comments

Generating a list of URLs from Apache access log files, sorted by hit count, using Apache Spark (and Scala)

... the REPL. I start the Spark interpreter (REPL) with this command at my *nix command line: $ MASTER=local[4] ... 'bytes' field I used this next expression to find the lines that my Apache access log file parser project wasn’t ... servers. But alas, that will have to wait until I can find some more free time. Until then, if you were looking for an example of how ...

Blog - alvin - Nov 7 2014 - 5:07pm - 0 comments

Analyzing Apache access logs with Spark and Scala

... you build Spark on your system with SBT by using this command in your Spark installation directory: $ sbt/sbt assembly ... little methods to work with the data. For instance, to find out how many 404 records are in the access log, I first create this ...

Blog - alvin - Nov 7 2014 - 5:25pm - 0 comments

Using functional programming concepts to make a Scala method better

... extends Logging { /** * Executes the AppleScript command you supply as a String. * Returns `true` on success, `false` ... it will also make methods that have side effects easier to find. As a pitfall, it does require the developer to mark his/her methods ...

Blog - alvin - Nov 6 2014 - 3:46pm - 0 comments

A Mac Java Applescript example - how to execute Applescript from Java

... program (a Java program that runs an Applescript command). In this case I'm running the Applescript say command, which ... search here for "applescript", and you'll find quite a few, including this Applescript tutorial about an alarm clock ...

Blog - alvin - Nov 5 2014 - 3:50pm - 0 comments

iTunes AppleScript examples (command examples)

... set currentVolume to sound volume end tell This command can be used to decrease the Mac system volume (not the iTunes volume, ... radio script - Play a radio station I couldn't find a great way to play radio stations out of the Radio Stations playlist that ...

Blog - alvin - Nov 3 2014 - 2:58pm - 2 comments

Lightsaber

... said, you can quit it in the usual ways, i.e., pressing [Command][Q] when it’s the foreground application, using the menu to quit ... and uses Akka actors (well, one actor). You can find the source code here on Github: github.com/alvinj/Lightsaber ...

Blog - alvin - Nov 3 2014 - 2:13am - 0 comments

Linux yum command reference (examples)

Summary: A CentOS Linux yum command cheat sheet (reference page). I've been working with the CentOS ... yum update bash Linux system updates To find out which packages on your system have updates available, use this ... Information about an installed yum package To find information about an installed package, use the yum info command. This ...

Blog - alvin - Oct 28 2014 - 5:16pm - 2 comments

Using the Client JVM and controlling RAM when building a Scala/Java/Mac application

... If you dig through that Oracle URL you’ll find why I’m using these properties, but in short, as the comment shows, ... will also help with your general understanding of the JVM command line arguments, and which JVM to use for client applications. (app, ...

Blog - alvin - Nov 1 2014 - 10:19pm - 0 comments