In this tutorial we will parse Flickr JSON
https://api.flickr.com/services/feeds/photos_public.gne?tags=mountains&tagmode=all&format=json#
As an Amazon Associate I earn from qualifying purchases.
Java: JSON
In this tutorial we will parse Flickr JSON
https://api.flickr.com/services/feeds/photos_public.gne?tags=mountains&tagmode=all&format=json#
https://api.flickr.com/services/feeds/photos_public.gne?tags=mountains&tagmode=all&format=json#
find similar posts:
Java,
JSON
0
comments
Java: read URL to String text
To process JSON feed from Flickr we will have to get text from URL, this can be done with this simple utility
find similar posts:
Java,
URL
0
comments
Java: read URL to String text
The blog post describes a method for reading data from a URL in Java.
It explains how to establish a stream connection, read data into a buffer, and convert that data into a String format.
The method is particularly useful for developers needing to fetch web data in Java applications.
I was using it here to retrieve a JSON feed from Flickr.
It explains how to establish a stream connection, read data into a buffer, and convert that data into a String format.
The method is particularly useful for developers needing to fetch web data in Java applications.
I was using it here to retrieve a JSON feed from Flickr.
find similar posts:
Flickr.com,
InputStream,
Java,
JSON,
software,
StringBuffer,
URL
0
comments
As an Amazon Associate I earn from qualifying purchases.
As an Amazon Associate I earn from qualifying purchases.
“zenzen mondai nai” (全然問題ない)
“zenzen mondai nai” (全然問題ない) sparkles with reassurance: “No problem whatsoever!”
Brushing away worry or stress is a breezy phrase, instantly brightening the mood.
Imagine a friend apologizing for being late, and you reply, “Zenzen mondai nai!”
The meaning is more heartfelt than “No worries.” It’s like a gentle back pat, reminding them you’re okay with it.
Brushing away worry or stress is a breezy phrase, instantly brightening the mood.
Imagine a friend apologizing for being late, and you reply, “Zenzen mondai nai!”
The meaning is more heartfelt than “No worries.” It’s like a gentle back pat, reminding them you’re okay with it.
find similar posts:
AIKO,
culture,
Japan,
Japanese,
philosophy
0
comments
“kotoba” (ことば)
“kotoba” (ことば) means “words” or “language” in Japanese.
It suggests more than just vocabulary; it can embody the soul of one’s thoughts.
In Japanese culture, we treasure how each kotoba carries a certain power (sometimes called kotodama 言霊), a little spirit of expression.
AIKO: When we arrange our kotoba carefully, we craft gentle whispers that soothe hearts or bright ideas that spark curiosity. Isn’t that so subarashii, desu ne? It reminds me of an elegant brushstroke: each line holds more than ink; it has intention, feeling, and sincerity.
In Japanese culture, we treasure how each kotoba carries a certain power (sometimes called kotodama 言霊), a little spirit of expression.
AIKO: When we arrange our kotoba carefully, we craft gentle whispers that soothe hearts or bright ideas that spark curiosity. Isn’t that so subarashii, desu ne? It reminds me of an elegant brushstroke: each line holds more than ink; it has intention, feeling, and sincerity.
find similar posts:
AIKO,
culture,
Japan,
Japanese
0
comments
Android: adb: filtering logcat
Usually I use IDE, but sometimes I have to create a very precise LOGCAT FILTER in terminal window.
Here is how I create a tag:
private static final String TAG = SomeActivity.class.getSimpleName();
Log.d(TAG, "some description");
You could use getCannonicalName
Here I have following TAG filters:
- any (*) View - VERBOSE
- any (*) Activity - VERBOSE
- any tag starting with Xyz(*) - ERROR
- System.out - SILENT (since I am using Log in my own code)
Here what I type in terminal:
$ adb logcat *View:V *Activity:V Xyz*:E System.out:S
please +1 on stockoverflow:
http://stackoverflow.com/a/29307682/3566154
It takes time and effort to create tutorials, please support my efforts with a couple-dollar donation, any amount will be greatly appreciated and highly motivating!
find similar posts:
adb,
Android,
logcat
0
comments
Android: adb: filtering logcat
Usually I use IDE, but sometimes I have to create a very precise LOGCAT FILTER in terminal window.
Here is how I create a tag:
private static final String TAG = SomeActivity.class.getSimpleName();
Log.d(TAG, "some description");You could use getCannonicalName
Here I have following TAG filters:
- any (*) View - VERBOSE
- any (*) Activity - VERBOSE
- any tag starting with Xyz(*) - ERROR
- System.out - SILENT (since I am using Log in my own code)
Here what I type in terminal:
$ adb logcat *View:V *Activity:V Xyz*:E System.out:Splease +1 on stockoverflow:
http://stackoverflow.com/a/29307682/3566154
It takes time and effort to create tutorials, please support my efforts with a couple-dollar donation, any amount will be greatly appreciated and highly motivating!
find similar posts:
adb,
Android,
logcat
0
comments
Linux: RPM
Here is couple of functions I use when working with RPM packages:
Show containing "postg"
Show top 20:
Install package:
Uninstall:
Show containing "postg"
rpm -qa | grep postg
Show top 20:
rpm -qa | tail -20
Install package:
rpm -ivh somed-1.0.0.armv7l
Uninstall:
rpm -e somed-1.0.0.armv7l
find similar posts:
Linux/Unix,
RPM
0
comments
Linux: RPM
Here is couple of functions I use when working with RPM packages:
Show containing "postg"
Show top 20:
Install package:
Uninstall:
Show containing "postg"
rpm -qa | grep postg
Show top 20:
rpm -qa | tail -20
Install package:
rpm -ivh somed-1.0.0.armv7l
Uninstall:
rpm -e somed-1.0.0.armv7l
find similar posts:
Linux/Unix,
RPM
0
comments
Java Map interface
In this tutorial we will discuss various implementations of Java Map interface. Java Map is one of the most commonly used datatypes when you want to store items by key.
HashMap should be only used when the objects we store as KEYS have implemented the method hashCode in such way that it give unique key for a given object.
Let's say we have an object USCitizen
name,
socialSecurityNumber
Map myMap = new HashMap();
HashMap
HashMap should be only used when the objects we store as KEYS have implemented the method hashCode in such way that it give unique key for a given object.
@Override public int hashCode() {
name,
socialSecurityNumber
Map myMap = new HashMap();
find similar posts:
Java
0
comments
Java Map interface
In this tutorial we will discuss various implementations of Java Map interface. Java Map is one of the most commonly used datatypes when you want to store items by key.
HashMap should be only used when the objects we store as KEYS have implemented the method hashCode in such way that it give unique key for a given object.
Let's say we have an object USCitizen
name,
socialSecurityNumber
Map myMap = new HashMap();
HashMap
HashMap should be only used when the objects we store as KEYS have implemented the method hashCode in such way that it give unique key for a given object.
@Override public int hashCode() {
name,
socialSecurityNumber
Map myMap = new HashMap();
find similar posts:
Java
0
comments
Java: RegEx: WebSpider
In this tutorial we will create a basis for a WebSpider program that fetches all links from the given Web page, checks which have extensions of interest and downloads these files.
The result of the app will be a folder with Google Earth map overlays:
The result of the app will be a folder with Google Earth map overlays:
/Users/uki/Desktop/KMZ
├── 1.kmz
├── 10.kmz
├── 11.kmz
├── 12.kmz
├── 13.kmz
├── 14.kmz
├── 15.kmz
├── 16.kmz
├── 17.kmz
├── 18.kmz
We will use basic java networking classes:
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URL; and regular expressions:
ublic class RegExConstants { /** * @param extensions * @return * ( -- start of main grouping * [^\s]+ -- must contains one, or many strings (but not white space) * ( -- start of extension grouping * \. -- existence of a dot, eg.: .kmz * (?i) -- NOT case sensitive for the next group * (kmz|kml) -- kmz OR kml strings * )$ -- should exist on the end * ) -- end of main grouping */ public static String fileExtensionPattern(String[] extensions) { StringBuilder sb = new StringBuilder(""); if (extensions.length > 0) { int n = 0; for (String extension : extensions) { if (n > 0) { sb.append("|"); // append OR } sb.append(extension); } } String pattern = "([^\\s]+(\\.(?i)(" + sb.toString() + "))$)"; System.out.println("fileExtensionPattern: " + pattern); return pattern; } public static final String anchorTagPattern = "<a *href=\"(.+?)</a>"; public static final String urlPattern = "(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"; }
find similar posts:
Java,
Regular Expressions
0
comments
Java: RegEx: WebSpider
In this tutorial we will create a basis for a WebSpider program that fetches all links from the given Web page, checks which have extensions of interest and downloads these files.
The result of the app will be a folder with Google Earth map overlays:
The result of the app will be a folder with Google Earth map overlays:
/Users/uki/Desktop/KMZ
├── 1.kmz
├── 10.kmz
├── 11.kmz
├── 12.kmz
├── 13.kmz
├── 14.kmz
├── 15.kmz
├── 16.kmz
├── 17.kmz
├── 18.kmz
We will use basic java networking classes:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
and regular expressions:
ublic class RegExConstants {
/** * @param extensions * @return * ( -- start of main grouping * [^\s]+ -- must contains one, or many strings (but not white space) * ( -- start of extension grouping * \. -- existence of a dot, eg.: .kmz * (?i) -- NOT case sensitive for the next group * (kmz|kml) -- kmz OR kml strings * )$ -- should exist on the end * ) -- end of main grouping */ public static String fileExtensionPattern(String[] extensions) {
StringBuilder sb = new StringBuilder("");
if (extensions.length > 0) {
int n = 0;
for (String extension : extensions) {
if (n > 0) {
sb.append("|"); // append OR }
sb.append(extension);
}
}
String pattern = "([^\\s]+(\\.(?i)(" + sb.toString() + "))$)";
System.out.println("fileExtensionPattern: " + pattern);
return pattern;
}
public static final String anchorTagPattern = "<a *href=\"(.+?)</a>";
public static final String urlPattern = "(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
}
find similar posts:
Java,
Regular Expressions
0
comments
Project Planning
"Planning is a good preparation for an inevitable change of direction that throws out any plans made." ~Uki
find similar posts:
quote
0
comments
Java: running with Maven
Compiling with Maven
note:
- mvn clean install
- location of created jar
uki@ WebSocketClientServer $ mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WebSocket-GlassFish 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
...
.to /Users/uki/.m2/repository/edu/clcillinois/cit137/WebSocket-GlassFish/1.0-SNAPSHOT/WebSocket-GlassFish-1.0-SNAPSHOT-jar-with-dependencies.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
Using variables to store long values
uki@ ~ $ export WEBSOCKET_JAR=~/.m2/repository/edu/clcillinois/cit137/WebSocket-GlassFish/1.0-SNAPSHOT/WebSocket-GlassFish-1.0-SNAPSHOT-jar-with-dependencies.jaruki@ ~ $ echo $WEBSOCKET_JAR/Users/uki/.m2/repository/edu/clcillinois/cit137/WebSocket-GlassFish/1.0-SNAPSHOT/WebSocket-GlassFish-1.0-SNAPSHOT-jar-with-dependencies.jar
Starting SERVER
$ java -cp $WEBSOCKET_JAR edu.clcillinois.websocket.server.WebSocketServer -h localhost -p 8025
Setting homeName to: localhostStarting the server.Mar 03, 2015 3:56:54 PM org.glassfish.tyrus.server.ServerContainerFactory createINFO: Provider class loaded: org.glassfish.tyrus.container.grizzly.GrizzlyEngineMar 03, 2015 3:56:54 PM org.glassfish.grizzly.http.server.NetworkListener startINFO: Started listener bound to [0.0.0.0:8025]Mar 03, 2015 3:56:54 PM org.glassfish.grizzly.http.server.HttpServer startINFO: [HttpServer] Started.Mar 03, 2015 3:56:54 PM org.glassfish.tyrus.server.Server startINFO: WebSocket Registered apps: URLs all start with ws://localhost:8025Mar 03, 2015 3:56:54 PM org.glassfish.tyrus.server.Server startINFO: WebSocket server started.
Type 'q' and Enter to stop server:
Starting Client(s)
uki@ CNH_PROD $ java -cp $WEBSOCKET_JAR edu.clcillinois.websocket.client.WebSocketClient -h localhost -p 8025
[DEBUG] 2015-03-03 16:02:44,354 edu.clcillinois.websocket.client.WebSocketClient main - Starting WebSockets clientSetting homeName to: localhost
Monitoring Java processes and Killing them
$ ps | grep java
30227 ttys001 0:00.00 grep java
30203 ttys002 0:01.37 /usr/bin/java -cp ~/.m2/repository/edu/clcillinois/cit137/xyz.jar edu.clcillinois.websocket.server.WebSocketServer -h localhost -p 8025
$ kill -9 30203 uki@ SimpleWebSocketServer $ ps | grep java30230 ttys001 0:00.00 grep java
Maven pom.xml example
note:
- group id
- artifact id
- version
- start-class
note:

- group id
- artifact id
- version
Maven build
note:
- plugins
- Java version 1.6, 1.7 or 1.8
- TODO change to Java 1.6 and observer what fails
- jar with dependencies

find similar posts:
Java,
mvn
0
comments
Java: running with Maven
Compiling with Maven
note:
- mvn clean install
- location of created jar
uki@ WebSocketClientServer $ mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WebSocket-GlassFish 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
...
.to /Users/uki/.m2/repository/edu/clcillinois/cit137/WebSocket-GlassFish/1.0-SNAPSHOT/WebSocket-GlassFish-1.0-SNAPSHOT-jar-with-dependencies.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
Using variables to store long values
uki@ ~ $ export WEBSOCKET_JAR=~/.m2/repository/edu/clcillinois/cit137/WebSocket-GlassFish/1.0-SNAPSHOT/WebSocket-GlassFish-1.0-SNAPSHOT-jar-with-dependencies.jaruki@ ~ $ echo $WEBSOCKET_JAR/Users/uki/.m2/repository/edu/clcillinois/cit137/WebSocket-GlassFish/1.0-SNAPSHOT/WebSocket-GlassFish-1.0-SNAPSHOT-jar-with-dependencies.jar
Starting SERVER
$ java -cp $WEBSOCKET_JAR edu.clcillinois.websocket.server.WebSocketServer -h localhost -p 8025
Setting homeName to: localhostStarting the server.Mar 03, 2015 3:56:54 PM org.glassfish.tyrus.server.ServerContainerFactory createINFO: Provider class loaded: org.glassfish.tyrus.container.grizzly.GrizzlyEngineMar 03, 2015 3:56:54 PM org.glassfish.grizzly.http.server.NetworkListener startINFO: Started listener bound to [0.0.0.0:8025]Mar 03, 2015 3:56:54 PM org.glassfish.grizzly.http.server.HttpServer startINFO: [HttpServer] Started.Mar 03, 2015 3:56:54 PM org.glassfish.tyrus.server.Server startINFO: WebSocket Registered apps: URLs all start with ws://localhost:8025Mar 03, 2015 3:56:54 PM org.glassfish.tyrus.server.Server startINFO: WebSocket server started.
Type 'q' and Enter to stop server:
Starting Client(s)
uki@ CNH_PROD $ java -cp $WEBSOCKET_JAR edu.clcillinois.websocket.client.WebSocketClient -h localhost -p 8025
[DEBUG] 2015-03-03 16:02:44,354 edu.clcillinois.websocket.client.WebSocketClient main - Starting WebSockets clientSetting homeName to: localhost
Monitoring Java processes and Killing them
$ ps | grep java
30227 ttys001 0:00.00 grep java
30203 ttys002 0:01.37 /usr/bin/java -cp ~/.m2/repository/edu/clcillinois/cit137/xyz.jar edu.clcillinois.websocket.server.WebSocketServer -h localhost -p 8025
$ kill -9 30203 uki@ SimpleWebSocketServer $ ps | grep java30230 ttys001 0:00.00 grep java
Maven pom.xml example
note:
- group id
- artifact id
- version
- start-class
note:

- group id
- artifact id
- version
Maven build
note:
- plugins
- Java version 1.6, 1.7 or 1.8
- TODO change to Java 1.6 and observer what fails
- jar with dependencies

find similar posts:
Java,
mvn
0
comments
Subscribe to:
Comments (Atom)
Post Scriptum
The views in this article are mine and do not reflect those of my employer.
I am preparing to cancel the subscription to the e-mail newsletter that sends my articles.
Follow me on:
X.com (Twitter)
LinkedIn
Google Scholar
I am preparing to cancel the subscription to the e-mail newsletter that sends my articles.
Follow me on:
X.com (Twitter)
Google Scholar
Popular Recent Posts
-
Keishin Kata (敬心形) of Shobudo (正武道) karate kei (敬) respect, reverence, or honor someone or something shin (心) heart or mind kata (形) fo...
-
Before arriving in Okinawa, several experiences prepared me for what I would eventually learn there. Karate was the first. It introduced me ...
-
I came across Ruri Ohama mentioning a book by Takafumi Horie and Yoichi Ochiai titled: “Job Atlas for 10 Years From Now. How Will You Live i...
-
Please look at the newer post: http://ukitech.blogspot.com/2009/09/eclipse-35-galileo-and-gwt-m2-svn.html 1) Upload a new version of Eclipse...
-
I have a habit of "stopping to smell the roses", or as in today's case, to take a photo of baby mushrooms on the forest floor....
-
http://code.google.com/apis/socialgraph/
-
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space or Unable to execute dex: Java heap space Java h...
-
Step 1: Register you app with Facebook. Sign in to Facebook using your standard credentials. Navigate to http://www.facebook.com/developer...
-
Many online videos warn about vegetables you should never eat, especially those rich in oxalates. The tone is dramatic. The reality is much ...
Most Popular Articles
-
Affordance as a Function of Intent and Action? As a person passionate about Behavioral Sciences, I found myself unable to shake the impre...
-
Step 1: Register you app with Facebook. Sign in to Facebook using your standard credentials. Navigate to http://www.facebook.com/developer...
-
Please look at the newer post: http://ukitech.blogspot.com/2009/09/eclipse-35-galileo-and-gwt-m2-svn.html 1) Upload a new version of Eclipse...
-
Creating Android ROS nodes to: - add control UI (HMI) - utilize existing phone sensors: -- gyroscope -- GPS -- compass -- camera - do...
-
In this tutorial we will learn how to install the Intellij IDEA database plugin. Start with opening Settings > search for plugins ...
-
Installing TuriCreate on Python 3.6 Anaconda Environment 1) Check what Python version Apple Turi Create supports https://github.com/ap...
-
In this tutorial we will overview integration basics of Android Studio and Gradle build tools.
-
This tutorial shows you how to change the code lower/upper case of code in Android Studio.
-
ImportError : No module named 'sklearn.model_selection' Before doing the embarrassing things I did below, read this: Setting Jupy...
-
This minimal PyTorch example implements a custom recurrent neural network (RNN) cell from first principles, showing how sequence memory eme...
apt quotation..
“A man should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.” by Robert A. Heinlein (author, aeronautical engineer, and naval officer)









