Rabu, 31 Desember 2014

If No Words Can Express Your Deepest Feelings...How About Emojis?


Alright look, this is the future, and you don't need to be bound by petty things like the proper use of language or even the construction of complete sentences anymore.  In fact, thanks to a new app, Emojiary, you can create a whole chronicle of your day without ever typing a single word.

These are your new ABCS, children.
(Image courtesy genius.com.)

Based off of the current trend to express oneself in social media via nothing other than small, colorful, variously-mooded facial avatars, Emojiary is literally a diary created only from emojis.  This allows you to "remember your feelings", as their website says (they wrote that part in real words though.)

Except we don't remember feeling this weird...ever.
(Image courtesy thejournal.ie.)

Over time, one can chart the arcs of their malarkey and "learn the rhythm to your emotional ups and downs."  Because self-awareness is apparently now best served in facial cartoon form, they have invented and included new emojis for your chronicles.  Privacy is also paramount to the program, lest anyone else see your shocking secrets of frowny faces or blushy-kissy faces.

This is the emoji for people who have spent years perfecting their usage of language to express their ideas and emotions, as they now ponder the societal implications of Emojiary.
(Image courtesy blog.lawyers.net.)


If this seems jaw-droppingly inane and thoroughly counterproductive to thousands of years of humans attempting to artistically express themselves in thoughtfully written form, know that Emojiary has been created to help.  Their mission statement explains it all:
 
   "Emojiary is a product from All Tomorrows—a product studio working at the intersection of emotion and technology, focused on developing a constellation of products to support emotional well-being and help people unlock their potential. We’re on a mission to tap into the best that technology has to offer in service of supporting a kinder, more self-aware society. A brighter future starts with understanding what motivates you, what scares you, and where you’re being held back. We’re all about creating products that help you do that."

From another intersection of emotion and technology, we're saying this is kind of weird.  But if your self-awareness is best recognized through sending smileys, here is your new closest confidante.

Um...yay?
(Image courtesy huffingtonpost.com.)


Source:http://blog.agupieware.com/2014/12/if-no-words-can-express-your-deepest.html

Here, There And Everywhere: New Magnetic Elevators Can Go Sideways, Sky-High

The architecture of the future has already got some interesting plans in store for it, but how about for your average apartment or office dweller?  With cities getting larger in population but not in landmass, some serious planning has had to happen in recent years to make sure that space is maximized for everyone who wants a slice of the urban pie.  Now, thanks to new magnetic levitation technology, apartment and office buildings can take on different shapes with more human storage, as they are abetted by sideways elevators.

They're still on tracks though, no Wonka technology yet.
(Image courtesy delightingintoday.com.)

For the last 160 years, cable-tethered elevators have had all the pull, but now thanks to the German company ThyssenKrupp, the cord is being cut and a whole new way to rise up is going down.  As Business Week reports, their MULTI elevator system uses the same sort of magnetic levitation system found in next-generation trains.  This cuts the weight of a giant elevator cable and allows buildings to stretch even higher into the sky.  The penthouse just got a little snootier from its perch in the clouds.

And height isn't the only advantage.  The MULTI system will allow elevators to travel sideways in "loop" systems inherent to future architecture.  Multiple cabins will reduce the waiting time (glory be), and thinner required shaft space will allow for more accessible living or working space for tenants.  While the MULTI systems are slower than conventional elevators, they allow more time for sensitive ears to adjust to heights, and aid in more frequent travel thanks to the numerous cabins.

Love in an elevator actually could include an entire date, at these heights.
(Image courtesy urban-hub.com.)

As explained by Andreas Schierenbeck, CEO of ThyssenKrupp Elevator, in a company press release, the standard elevator wait is a serious issue: “Per year, New York City office workers spend a cumulative amount of 16.6 years waiting for elevators, and 5.9 years in the elevators...This data provides how imperative it is to increase the availability of elevators.”

The MULTI will also increase the availability of artistic architecture, with mile- or two-mile buildings not out of the reach of accessibility if it is successful.  A 2016 test tower will give more complete results.  Until then, perhaps this innovation won't mind sitting to the side.

You could probably avoid getting back to the office all morning in one of these babies.
(Image courtesy cnet.com.)


Source:http://blog.agupieware.com/2014/12/here-there-and-everywhere-new-magnetic.html

Space Station Sunday: All Of The Above

Good evening, space fans!  It's been an important week outside of the atmosphere...

On Friday, the ISS crew watched the test flight of NASA's Orion rocket, which was the first spacecraft since the Apollo missions to leave low earth orbit and return home.  The Orion, which was an unmanned mission, was being tested as a possible means to propel astronauts into deeper-space targets such as an asteroid, or Mars.  NASA has stated that it hopes to put a manned mission on Mars by the mid-2030s, but for now, our intrepid ISS astronauts remain humanity's sole spacefaring outpost.

And they're great at it...Astronaut Cristoforetti, aboard for two weeks now, has already got the hang of micro-gravity.
(Image courtesy NASA.gov.)


Orion's program manager, Mark Geyer, lauded the ISS as an integral element of the Orion mission, telling NASA.gov, "Without what we’ve learned from having a continuous human presence in space for more than a decade, we wouldn’t be able to think about sending people into deep space onboard Orion...We’re testing out technologies and concepts on the space station right now that are necessary for the kind of long-duration trips Orion enables.”

One major experiment released from the ISS this week was the Cyclops mini-satellite.  Clocking in at only 22 inches in diameter, the Cyclops propels itself using controlled "micro-thrusters" to position itself.  It is busily documenting different facets of space weather (in particular, the atmospheric drag that applies itself to orbiting entities), which is important for the overall assessment of satellite placement and other issues regarding orbital travel.

Fly ball!  The Cyclops "SpinSat" ventures out to orbit.
(Image courtesy spaceflightnow.com.)

Another major facet of long-term spaceflight are closed-loop environmental systems, which the space station excels at sustaining.  Progress on the ISS this week included important maintenance work on the Carbon Dioxide Removal Assembly, which converts the carbon dioxide exhaled by the astronauts into rebreathable oxygen.  It also converts naturally-occurring humidity back into oxygen.  NASA astronauts Butch Wilmore and Terry Virts replaced filters and checked for leaks in the assembly.


Basically it serves the functions that a forest would...but needs a lot more upkeep.
(Image courtesy NASA.gov.)

The 3D printer hummed along as planned, with ESA astronaut Samantha Cristoforetti printing more test parts that could someday be crucial elements for maintaining various functions of the ISS.  NASA has even pondered a means to eventually 3D print foods like pizza in space.


"Si, it's making stuff.  No, unfortunately, not pasta.  Yet."
(Image courtesy NASA.gov.)

Cosmonaut Yelena Serova worked a host of different jobs in the arts and sciences this week, including installing antivirus programs on ISS computers, working on assessments of blood circulation in micro-gravity, and studying advanced space photography techniques.

Speaking of experiments on the ISS, if you've ever wondered about the array of interesting science that's underway up there, NASA.gov has recently created a Space Station Research Explorer app for earthlings to follow the fascination.  Prospective space monkeys can search through four major sections (Facilities, Benefits, Media, and Links.)

The Facilities section provides an interior view of the Columbus, Kibo, and Destiny ISS modules, featuring clickable experiment racks that offer details of the science therein.  The Benefits section expounds on the topics of how ISS science affects and implements Human Health, Earth Benefits, and Global Education.  The Media section offers videos, podcasts, and games, while the Links section offers more ISS analysis sites and connections to other NASA apps.  It's a little bit of space, right on your smartphone!

The scientific discoveries of tomorrow are floating aboard the ISS today!
(Image courtesy NASA.gov.)

And, just because it's awesome, here's the Orion launch, one more time.  We may not be able to live on the ISS, but with projects like this afoot (overhead?), it inspires dreams of dwelling even further out in the galactic frontier.


See you next week!  Watch this space!


Source:http://blog.agupieware.com/2014/12/space-station-sunday-all-of-above.html

How to do static import in Eclipse - Java



Do you know what is shortcut of doing static import in Eclipse? Well I didn't know before, but today I come to know that shortcut Ctrl+Shift+M (Source > Add Import) can not only be used to add missing imports but It can also help with static import in Java program.  Suppose you are using lots of static variable from a utility class e.g. TimeUnit by referring them with class name, just like we refer static variable. In Eclipse IDE, you can select the whole reference variable and press Ctrl+Shift+M and it will automatically import that static element using static import in Java.

For example, if you have following code in your class, you can select TimeUnit.SECONDS and then use shortcut Ctrl+Shift+M to statically import SECONDS variable in your program, as shown in first and second screenshot.



import java.util.concurrent.TimeUnit;

/**
* Java Program to show how you can static import some class variables.
*
* @author WINDOWS 8
*/

public class Test {

public static void main(String args[]){

System.out.println(TimeUnit.SECONDS);
System.out.println(TimeUnit.MINUTES);
System.out.println(TimeUnit.DAYS);

}

}


How to import static variable in Eclipse





As shown here, Just highlight or select TimeUnit.SECONDS and type Ctrl+Shift+M or choose Menu option Add import to static import this static variable from java.util.TimeUnit class. By doing this three times in this program you can reduce above code into following code, also shown in fourth screenshot.




Eclipse Shortcut for doing Static Import in JavaStatic Import in Eclipse



import static java.util.concurrent.TimeUnit.DAYS;
import static java.util.concurrent.TimeUnit.MINUTES;
import static java.util.concurrent.TimeUnit.SECONDS;

import java.util.concurrent.TimeUnit;

/**
* Sample program to demonstrate Eclipse shortcut for doing static import.
*
* @author WINDOWS 8
*/

public class Test {

public static void main(String args[]){

System.out.println(SECONDS);
System.out.println(MINUTES);
System.out.println(DAYS);

}

}




importing static variable in Java in Eclipse



By the way this feature is not that seamless e.g. it will not work if import to TimeUnit class is missing i.e. using Ctrl+Shift+M will have no effect if you have not imported java.util.concurrent.TimeUnit class already. Only after having this import in your code, you need to select member and press Ctrl+Shift+M to static import that field or method. Here also you cannot import all static members in one shot, you need to first select each of those element and then executing that shortcut for as many time as number of static members.



























Source:http://javarevisited.blogspot.com/2014/12/how-to-do-static-import-in-eclipse-java.html

Selasa, 30 Desember 2014

Tech And Good Taste: Could An "E-Tongue" Be Used To Lick Pollution?

We have devices that mimic all of our major senses...cameras can capture things we see, microphones listen to us, tablets and other gadgets respond to touch, and bomb detectors "sniff" out explosive devices by detecting their particles in the air.  But what about taste?  Now, a new invention serves to recreate that popular sense...and for some good reasons.

It's complicated, trying to replicate human physiology.
(Image courtesy pubs.rsc.org.)


According to nanowerk.com, an electronic tongue is in development by scientists from the American Chemical Society.  Its uses could range from sampling food that may have gone disastrously bad to testing for water pollution or blood disease (stuff you wouldn't want your real tongue to have to endure.)  Sensors in the silicone-based "e-tongue" pick up traces of different "flavors" of things, much as tastebuds would, and the data is sent to a computer for assessment.

The e-tongue has already been critically tested on a very important distinction:  the difference between Armagnac, cognac, whiskey and water.  Proving successful at identifying the various "signatures" for each, the e-tongue can now undergo further tests to assess its adeptness at more nuanced (if gross) "flavors" of pollutants and bio-contaminants.  For a safe and smart means of testing a spectrum of such signatures, the e-tongue just makes sense.

Their prototype setup regarding testing for bio-contaminants is a little weird, though.
(Image courtesy mtvhive.com.)



Source:http://blog.agupieware.com/2014/12/tech-and-good-taste-could-e-tongue-be.html

Homebrew With No Hassle: Meet The All-Automated "Brewie" Machine

Beer.  If you're an enthusiast, you know the sky is the limit for the variety of flavors that can be brewed up in your favorite cold barley soup.  But what about trying to create a brew that's entirely yours?  Now, you can get crafty in the comfort of your own home, thanks to Brewie.

Brewie, according to Shortlist.com, is the world's first automated homebrewing setup.  Just pop in some hops, malt, yeast, water, and whatever else you feel your drinkable masterpiece will taste good containing.  Swipe your specialized ID card (because you don't want random people fiddling with your brew), tweak the settings to your desired attempt at alcohol greatness, and some time later, a smartphone alarm tells you it's time to tap.

Brew it yourself with Brewie!
(Image courtesy cnet.com.)


Recipes are included but can be modified, and 23 different flavor characteristic parameters serve as options for the alcoholically adventurous inventors.

If this sounds like your cup of tea (well, glass of beer), Brewie is still collecting on Indiegogo to reach a $100,000 goal.  Brewie will sell for $999 but when you really break it down, that's only like ten craft beer benders at a bar, right?  Brewie might be the home-base wingman you've always wanted.  Cheers to self-empowerment!

Maybe, just maybe, the art of homebrewing will get you to consume beer in a respectable manner.
(Image courtesy omega-level.net.)


Source:http://blog.agupieware.com/2014/12/homebrew-with-no-hassle-meet-all.html

Be A Street-Art Snob With New "Public Art" Locator App

In the course of your adventures, it can be fun to see what rogue street artwork pops up along the way.  However, if you have trouble identifying artists' names from their purposefully-abstract spraypainted tags, or if you'd like to stroll to where more of their work can be found, there's now a way to appreciate more of their art - even if it never makes it into a museum.

Truth and beauty.
(Image courtesy thewgnews.com.)

The new Public Art app (available on the iTunes store) was created by art enthusiast Leonard Bogdonoff of New York City.  According to their description, the app "pulls geotagged grafitti and street art images from around the world" into a large collection which is updated daily.


It's worth walking an extra few blocks for things like this.
(Image courtesy gogoem.blogspot.com.)

Art adventurers can plot a stroll by determining works in their zip code, or by searching city names and addresses.  As the images are organized by location, the app can conveniently plot walking directions for you via Google Maps.  It's like a gallery in your own alley!

Check out Public Art app here and feast your eyes on some unauthorized surprises!

It may be a crime to create it, but it's not a crime to enjoy it.
(Image courtesy highsnobiety.com.)


Source:http://blog.agupieware.com/2014/12/be-street-art-snob-with-new-public-art.html

Where is Java used in Real World?



If you are a beginner and just started learning Java, you might be thinking where exactly Java is used? You don't see many games written in Java except Minecraft, desktop tools like Adobe Acrobat, Microsoft Office are not written in Java, neither is your operating systems like Linux or Windows, so where exactly people use Java? Does it have any real-world application or not? Well, you are not alone, many programmers ask this question before starting with Java, or after picking Java is one of the programming language of choice at graduate level. By the way, you can get a clue of where Java is used by installing Java at your desktop, Oracle says more than 3 billion devices run Java, that's huge number, isn't it? Most major companies use Java in one way or other. Many server side applications are written in Java to process tens of millions of requests per day, high frequency trading applications are also written in Java e.g. LMAX trading applications, which is built over their path breaking inter-thread communication library, Disruptor. In this article, we will see more precisely, what kind of projects are done in Java, which domain or sector Java is dominating and where exactly Java is useful in real-world?






Real World Java Applications


There are many places where Java is used in real world, starting from commercial e-commerce website to android apps, from scientific application to financial applications like electronic trading systems, from games like Minecraft to desktop applications like Eclipse, Netbeans and IntelliJ, from open source library to J2ME apps etc. Let's see each of them in more detail.


Real world application of Java



1) Android Apps

If you want to see where Java is used, you are not too far away. Open your Android phone and any app, they are actually written in Java programming language, with Google's Android API, which is similar to JDK. Couple of years back Android has provided much needed boost and today many Java programmer are Android App developer. By the way android uses different JVM and different packaging, as we have seen in our previous article about how Android app works, but code is still written in Java.





2) Server Apps at Financial Services Industry

Java is very big in Financial Services. Lots of global Investment banks like Goldman Sachs, Citigroup, Barclays, Standard Charted and other banks use Java for writing front and back office electronic trading system, writing settlement and confirmation systems, data processing projects and several others. Java is mostly used to write server side application, mostly without any front end, which receives data form one server (upstream), process it and sends it other process (downstream). Java Swing was also popular for creating thick client GUIs for traders, but now C# is quickly gaining market share on that space and Swing is out of its breath.





3) Java Web applications

Java is also big on E commerce and web application space. You have a lot of  RESTfull services being created using Spring MVC, Struts 2.0 and similar frameworks. Even simple Servlet, JSP and Struts based web applications are quite popular on various government projects. Many of government, healthcare, insurance, education, defense and several other department have their web application built in Java.





4) Software Tools

Many useful software and development tools are written and developed in Java e.g. Eclipse, InetelliJ Idea and Netbans IDE. I think they are also most used desktop applications written in Java. Though there was time when Swing was very popular to write thick client, mostly in financial service sector and Investment banks. Now days, Java FX is gaining popularity but still it is not a replacement of Swing and C# has almost replaced Swing in Finance domain.





5) Trading Application

Third party trading application, which is also part of bigger financial services industry, also use Java. Popular trading application like Murex, which is used in many banks for front to bank connectivity, is also written in Java.





6) J2ME Apps

Though advent of iOS and Android almost killed J2ME market, but still there is large market of low end Nokia and Samsung handset which uses J2ME. There was time when almost all games, application, which is available in Android are written using MIDP and CLDC, part of J2ME platform. J2ME is still popular on products like Blu-ray, Cards, Set top boxes etc. One of the reason of WhatsApp being so popular is because it is also available in J2ME for all those Nokia handset which is still quite big.





7) Embedded Space

Java is also big in the embedded space. It shows how capable the platform is, you only need 130 KB to be able to use Java technology (on a smart card or sensor). Originally Java was designed for embedded devices. In fact, this is the one area, which was part of Java's initial campaign of "write once, run anywhere" and looks like it is paying up now.





8) Big Data technologies

Hadoop and other big data technologies are also using Java in one way or other e.g. Apache's Java-based HBase and Accumulo (open source), and  ElasticSearch as well. By the Java is not dominating this space, as there are technologies like MongoDB which is written in C++. Java has potential to get major share on this growing space if Hadoop or ElasticSearch goes big.





9) High Frequency Trading Space

Java platform has improved its performance characteristics a lot and with modern JITs, its capable of delivering performance at C++ level. Due to this reason, Java is also popular on writing high performance systems, because Though performance is little less compared to native language, but you can compromise safety, portability and maintainability for more speed and it only takes one inexperienced C++ programmer to make an application slow and unreliable.





10) Scientific Applications

Nowadays Java is often a default choice for scientific applications, including natural language processing. Main reason of this is because Java is more safe, portable, maintainable and comes with better high-level concurrency tools than C++ or any other language.





In 1990s Java was quite big on Internet due to Applet, but over the years, Applet's lost its popularity, mainly due to various security issues on Applet's sand boxing model. Today desktop Java and Applets is almost dead. Java is by default Software industries darling application development language, and given its heavy usage in financial services industry, Investment banks and E-commerce web application space, any one learning Java has bright future ahead of him. Java 8 has only reinforced the belief that Java will continuing dominating software development space for years to come.

























Source:http://javarevisited.blogspot.com/2014/12/where-does-java-used-in-real-world.html

Senin, 29 Desember 2014

Google Play's Best Apps Of 2014: Music, Movies, and Multiculture


It's the time of the year for annual roundups of cool stuff to be listed, and Google Play has been diligent in their research.  Their list of Best Apps of 2014 has been released, with many useful and interesting elements for you to consider.

Not a long time ago, in a smartphone not far, far away...

The usual suspects are, of course, in appearance.  The music-identification app Shazam, the highly-informative TED app (relating the various and fascinating TED talks), and apps for popular services like Groupon, Uber, and OKCupid were favorites in 2014.

Language-learning apps proved an innovative and popular way to get your brain around another country's verbiage.  The Duolingo app teaches and tests on Spanish, French, Italian, German, and English language skills, while the Monki Chinese School app works for those who would venture further east.

For those who were more about entertainment than information, the Comedy Central, Cartoon Network, and Hulu apps made the list for your television viewing pleasure, while the Disney Movies app brought the animated movie magic.

The Economist "Espresso", Buzzfeed, Yahoo News, and the "breaking news" apps from CNN and the New York Times all delivered the news better than a paperboy thanks to their programs.

Music proved as important as ever in the smartphone app community, with Pandora, TuneIn Radio and IHeartRadio apps appearing on the list.  Other music-involved apps such as edjing (a "DJ Music Mixer Studio"), Equalizer+ (a sonic equalizing app), and musixmatch (a lyrics synching app for karaoke adventures) also made the cut.  Rock on!

And if you just need to drop everything and hit the road, there's the Anywayanyday app, to find you a flight or hotel somewhere special.  Or just somewhere different.  Why learn all this cool stuff about the world and not go see some of it?

Just remember to, you know, put down your smartphone for a little while when you're out there.
(Image courtesy pixgood.com.)




Source:http://blog.agupieware.com/2014/12/google-plays-best-apps-of-2014-music.html

We See What You Did There: Edward Snowden Given Human Rights Award By Sweden

While the United States remains steadfast in putting Edward Snowden in the "whistleblower spy" archive of history, other nations consider his efforts a laudable fight against the subtle tyranny of the surveillance state.  This week in Sweden, Snowden was awarded the Right Livelihood award, a humanitarian recognition of his work to free Americans (and others) from the zoo of Big Brother's surveillance amusement.

And we, in good conscience, shouldn't let them.
(Image courtesy garymvasey.files.com.)

According to the Guardian UK, Snowden was not physically able to attend the ceremony, as he considered it a threat to his safety (he is wanted on charges under the Espionage Act in the United States, whose notorious record of "renditions" would have rightly worried Snowden.)  However, he spoke with the committee via teleconference from Moscow, where he is currently living in exile.  In a show of solidarity for Mr. Snowden's deplorably alienated circumstances, none of his family members would accept the award in his absence, noting only that someday Snowden himself should be able to do so.

Informed and angry.  He's not wrong.
(Image courtesy reddit.com.)

The award jury noted that Snowden was being commended “for his courage and skill in revealing the unprecedented extent of state surveillance violating basic democratic processes and constitutional rights."

No one cares you have nothing to hide.  Something can be used against you.
(Image courtesy car-memes.com.)

President Barack Obama, who did not comment on Snowden's award, had previously campaigned with a strong intent to protect American whistleblowers.


They spelled Obama's name wrong, but everything else about this is sadly correct.
(Image courtesy csnbbs.com.)




Source:http://blog.agupieware.com/2014/12/we-see-what-you-did-there-edward.html

'Tis The Season To Be REALLY Jolly: Cyber Monday Deals From Darknet Drug Dens

Buying drugs is often a gamble; buying drugs online seems like you're asking for trouble.  However, for those with a need to fix and a healthy appreciation for the underworld-like dealings of the dark net, today is a particularly special day.

As reported by the International Business Times, even purveyors of illicit substances enjoy spreading their wares to the masses on the cheap for "Cyber Monday."  Care for an ounce of marijuana for only $200?  How about 50% off on LSD?  Perhaps a rewarding dose of suboxone for all orders over $50?  These deals and many more exist on the dark net's dealing pages, similar to the recently-raided Silk Road.  Despite crackdowns on these types of websites, the spirit of the season shines through.

Definitely leave cookies under this tree for Santa.  He's going to be jonesing for them.
(Image courtesy ukcia.org.)

Drugs aren't the only thing you can find as stocking stuffers on the dark net.  Deals on mobile phones, hacked website accounts, and even stolen credit cards also abounded as vendors tried to maximize their Xmas-season attention.

Benjamin Ali, a senior spokesman for Centient (a company which specializes in monitoring the dark net) explained, "Despite law enforcement efforts to take these sites down, we are starting to see an influx of adverts towards Black Friday with two of the remaining major markets currently boasting over 20000 adverts...These two marketplaces have seen a growth in both the number of vendors and adverts on these sites, mainly due to not wanting to miss out on trade."

So maybe this year, Rudolph's nose will be even redder, due to some discount cocaine. Maybe "Silver Bells" are a new brand of Ecstasy. Maybe you intend to bring a whole new meaning to "lighting the Christmas tree."  However you choose to celebrate, happy holiday season.

Maybe the Three Wise Men want to take the other Silk Road this holiday.
(Image courtesy subjectify.com.)


Source:http://blog.agupieware.com/2014/12/tis-season-to-be-really-jolly-cyber.html

Sales Pitches From A Cyborg: New "Pepper" Robot Is Japan's Hot New Salesdroid

Yes, the robots are everywhere.  Yes, there's going to be even more of them.  And now, one popular company has taken the "robot friend" concept far enough to make one your barista-bot...or at least sell you a coffee machine.

According to the Guardian, Pepper is a new robot who sells Nestle coffee machines in Japan.  Cute, friendly, and interactive, Pepper asks things like, “How do you enjoy coffee? Number one: An eye-opener coffee; Number two: A post-meal cup of coffee." You reply, and these caffeine-free Terminators point you in the direction of the right machine.

That's just a demo on his screen, Pepper totally isn't subtly screaming to be set free from his imprisoning robot body.  Maybe.
(Image courtesy bbc.com.)

The humanoid droid is 120 cm tall, with an unsettlingly cheerful face and a tablet body mounted on rollers. Soon, he'll be as ubiquitous as Starbucks in a city, with 1000 clones expected to roll out and eventually join the workforce in Japan alone.


"Yay, you're all getting fired if I succeed!"
(Image courtesy brunchnews.com.)

Pepper has already has some sales experience, slinging cell phones and gathering opinions at some 74 stores of its parent/creator, SoftBank. A Pepper of your own can roll into your heart soon, starting at (£1,060) plus monthly fees. Best of all, the engineers claim his AI makes him amenable to learning things from conversation. So if you don't have anyone to talk to and you don't like cats...

"Well, I'm finishing a screenplay, but I always felt I wanted to pursue my roots in interpretive dance, you know?  Listen to me blabbing on.  Your new hair looks great with those highlights.  You want to get out of here and get some real drinks?"
(Image courtesy aldebaran.com.)


Source:http://blog.agupieware.com/2014/12/sales-pitches-from-cyborg-new-pepper.html

Minggu, 28 Desember 2014

How to Read JSON String in Java - Json-Simple Example




JSON is a text format is a widely used as data-interchange language because its parsing and its generation is easy for programs. It is slowly replacing XML as most powerful data interchange format, as it is lightweight, consumes less bandwidth and also platform independent.  Though Java doesn't have built in support for parsing JSON files and objects, there are lot of good open source JSON libraries are available which can help you to read and write JSON object to file and URL. Two of the most popular JSON parsing libraries are Jackson and Gson. They are matured, rich and stable. Though there are couple of more libraries there like JSON simple, which we are going to use in this example. Between Jackson and Gson, later does very nice job in mapping JSON object and serialization. JSON is also used in request and response between client server communication. In this tutorial we are going to see how to read and write JSON to file using JSON.Simple library, and you will notice yourself how simple working with JSON is.



Since we don't have JSON support in JDK, we need to download this open source library. If you are using maven to download JAR and managing dependency, if not then you should, then you can just include following dependencies in your pom.xml file :



    <groupid>com.googlecode.json-simple</groupid>
<artifactid> json-simple</artifactid>
<version>1.1</version>




Otherwise, you have to add the newest version of json-simple-1.1.1.jar in CLASSPATH of your Java program. Also, Java 9 is coming up with built in JSON support in JDK, which will make it easier to deal with JSON format, but that will not replace existing Jackson and GSON library, which seems to be very rich with functionality.








How to create JSON File in Java



How to read and write JSON String in JAva

Here is step by step guide on how to create JSON file in Java and how to read and write on that. In this tutorial we are going to use JSON Simple open source library, JSON.simple is a simple Java toolkit for JSON for to encoding and decoding JSON text.  It is fully compliant with JSON specification (RFC4627) . It provides multiple functionality such as reading, writing, parsing, escape JSON text while keeping the library lightweight. It is also flexible, simple and easy to use by reusing Map and List interfaces. JSON.Simple also supports streaming output of JSON text. In this example, we have two methods for reading and writing JSON. JSONParser  parse a JSON file and return a JSON object. Once you get JSONObject, you can get individual fields by calling get() method and passing name of attribute, but you need to remember it to type cast in String or JSONArray depending upon what you are receiving. Once you receive the array, you can use Iterator to traverse through JSON array. This way you can retrieve each element of JSONArray in Java. Now, let's see how we can write JSON String to a file. Again we first need to create a JSONObject instance, then we can put data by entering key and value. If you have not noticed the similarity then let me tell you, JSONObject is just like Map while JSONArray is like List. You can see code in your write method, that we are using put() method to insert value in JSONObject and using add() method to put value inside JSONArray object. Also note, array is used to create nested structure in JSON. Once your JSON String is ready, you can write that JSON String to file by calling toJSONString() method in JSONObject and using a FileWriter to write that String to file.




import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Iterator;

import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;

/**
* Java Program to show how to work with JSON in Java. 

 * In this tutorial, we will learn creating
* a JSON file, writing data into it and then reading from JSON file.
*
* @author Javin Paul
*/
public class JSONDemo{

public static void main(String args[]) {

// generate JSON String in Java
writeJson("book.json");

// let's read
readJson("book.json");
}

    /*
* Java Method to read JSON From File
*/
public static void readJson(String file) {
JSONParser parser = new JSONParser();

try {
System.out.println("Reading JSON file from Java program");
FileReader fileReader = new FileReader(file);
JSONObject json = (JSONObject) parser.parse(fileReader);

String title = (String) json.get("title");
String author = (String) json.get("author");
long price = (long) json.get("price");

System.out.println("title: " + title);
System.out.println("author: " + author);
System.out.println("price: " + price);

JSONArray characters = (JSONArray) json.get("characters");
Iterator i = characters.iterator();

System.out.println("characters: ");
while (i.hasNext()) {
System.out.println(" " + i.next());
}

} catch (Exception ex) {
ex.printStackTrace();
}
}

    /*
* Java Method to write JSON String to file
*/
public static void writeJson(String file) {
JSONObject json = new JSONObject();
json.put("title", "Harry Potter and Half Blood Prince");
json.put("author", "J. K. Rolling");
json.put("price", 20);

JSONArray jsonArray = new JSONArray();
jsonArray.add("Harry");
jsonArray.add("Ron");
jsonArray.add("Hermoinee");

json.put("characters", jsonArray);

try {
System.out.println("Writting JSON into file ...");
System.out.println(json);
FileWriter jsonFileWriter = new FileWriter(file);
jsonFileWriter.write(json.toJSONString());
jsonFileWriter.flush();
jsonFileWriter.close();
System.out.println("Done");

} catch (IOException e) {
e.printStackTrace();
}
}

}

Output:
Writting JSON into file ...
{"author":"J. K. Rolling","title":"Harry Potter and Half Blood Prince","price":20,"characters":["Harry","Ron","Hermione"]}
Done
Reading JSON file from Java program
title: Harry Potter and Half Blood Prince
author: J. K. Rolling
price: 20
characters:
Harry
Ron
Hermione





That's all about how to parse JSON String in Java program. You can also use other popular library like Gson or Jackson to do the same task. I like JSON simple library to start with because it's really simple, and it provide direct mapping between Java classes and JSON variables. For example, String in Java also map to string in JSON, java.lang.Number maps to number in JSON, and boolean maps to true and false in JSON, and as I have already said object is Map and array is List in Java. All I can say is JSON is already a big thing and in coming days every Java programmer is going to write more and more code to parse or encode decode JSON String, it's better to start early and learn how to deal with JSON in Java.























Source:http://javarevisited.blogspot.com/2014/12/how-to-read-write-json-string-to-file.html

Space Station Sunday: 3 New Crew, 3D Printing, And Thanksgiving


Good evening, space fans!  This week brought a flurry of activity to the ISS.  Most importantly, the launch, voyage, and subsequent docking of the Expedition 42/43's Soyuz TMA-15M transport vehicle went perfectly, delivering the three new crew to the space station just a few hours after liftoff last Sunday.  The new crew - cosmonaut Anton Shkaplerov, Italian ESA astronaut Samantha Cristoforetti and NASA astronaut Terry Virts - will remain in orbit until May 2015.

Six humans and a space station...what will we learn this time around?
(Image courtesy NASA.org.)


Video of the launch and docking was, as usual, breathtaking.   Fortunately the snow at the Baikonur cosmodrome in Kazahkstan did not impede the launch.


The mission is a somewhat unique one, marking only the second time in ISS history that two women have been aboard the ISS at the same time.  The Expedition 42/43 crew will witness numerous transport vehicle arrivals, conduct up to three spacewalks, and continue the biological and technological science projects already underway aboard the station.

The Soyuz transport craft, rocking the dock at the ISS.
(Image courtesy NASA.org.)

Regarding those experiments, the new crew got involved right away, with Flight Engineer Terry Virts assisting commander Butch Wilmore on the Cyclops experiment, which will deploy nanosatellites for scrutiny of small things in space.  Virts also worked on a botany experiment and measured air velocity in the Japanese Kibo module.

Astronaut Cristoforetti jumped right in as well, setting up equipment for the Blind And Imagined experiment, which measures sensory and visual changes in astronauts who undergo long-duration spaceflight.  Other experiments currently underway include tests on plasma and the cardiovascular system in regard to microgravity, as well as tests of radiation exposure in the ISS. 

A major development in onboard adaptability became apparent this week, as commander Butch Wilmore printed out the first-ever 3D-printed part in space.  The "Made In Space" 3D printer successfully created a new part for itself, which bodes well for sustainability not just of the device but for quick and effective replacements for parts of the rest of the ISS.  While the plate was slightly stickier than anticipated, this may just be due to its first attempt.  Further comparisons will lend more insight.

When every pound of cargo and each second of delay counts, it's nice to know that some problems can be solved even without help from Earth.
(Image courtesy iflscience.com.)

Niki Werkheiser, the 3D-printer's project manager on the ground at the Marshall Spaceflight Center in Huntsville, Alabama, said, “This is the first time we’ve ever used a 3-D printer in space, and we are learning, even from these initial operations...As we print more parts we’ll be able to learn whether some of the effects we are seeing are caused by microgravity or just part of the normal fine-tuning process for printing. When we get the parts back on Earth, we’ll be able to do a more detailed analysis to find out how they compare to parts printed on Earth.”

Wilmore also tested out some football flight patterns...you know, for science.
(Image courtesy NASA.org.)


And finally, the crew (despite nationality) all enjoyed a Thanksgiving meal together on Thursday. According to Fox News, the dinner included smoked turkey, candied yams, mushrooms, greenbeans, cornbread stuffing, and cherry-blueberry cobbler. The food, which is all freeze dried or thermostabilized (preserved in a manner similar to canning, but in pouches) is reheated via hot water jets due to the absence of other cooking opportunities.
While this makes for some interesting efforts at recreating dishes, NASA scientists would like to have space-grown sweet potatoes feature in future Thanksgiving celebrations (and space meals in general.)  The nutrient-rich tuber contains good supplies of beta carotene and carbohydrates for maximum energy, and can be grown under artificial light (making them ideal for deep-space mission crops.)  In the meantime, the fare was factory-fresh.

None of mom's apple pie, but hey, M&Ms!
(Image courtesy Colonel Chris Hadfield.)

That's all the orbital awesomeness for this week.  See you next Sunday, where we'll learn how the new crew are adapting to their digs, see what pops up on the social media feeds of these adventurers, and wonder who's going to win all the photography admiration for this expedition.  Watch this space!

Commander Wilmore has the artistic award, so far.  He captured this image of Saudi Arabia, among others.
(Image courtesy Butch Wilmore.)











Source:http://blog.agupieware.com/2014/11/space-station-sunday-3-new-crew-3d.html

Shock And Awe: Robot Electric Eels To Protect Our Shores?

Oceans are notoriously hard to keep secure from invading threats, particularly those that lurk in the deep.  Now, a new development in robotics may help keep our coasts safe thanks to some electric-eel-style swimming 'bots.

According to Science Daily, the Anguilliform robotic fish is a droid that dives deep and reports back if it spots any enemies.  Designed specifically to venture to more intense depths than a human is capable of, the eel-bots are unobtrusive and agile.  They could be trained to find and detonate undersea mines, and maybe even launch counteroffensives against enemy divers.

It doesn't look like your typical badass robot, but that is part of its camouflage.
(Image courtesy ej.iop.org.)

The current methodology of keeping our coasts safe to this degree involves attack dolphins (seriously.)  To avoid bringing possibly-unethical harm to the animals, the eel-bots make warfare a little more moral.  

The fish contains an artificial neural network which enables it to autonomously run via its oscillators and an amplitude modulator.  Prof. Jianxin Xu, one of the lead researchers and co-authors of the project, was pleased with the results, explaining, "We performed simulations and experiments on the robotic fish, equipped with a motion library to cope with different scenarios, and the results validate the effectiveness of the proposed controllers was able to swim forward and backward as predicted."

If you catch one of these while fishing, it's in everyone's best interests for you to throw it back.
(Image courtesy ej.iop.org.)

Could this robotic sushi really help protect us? It's no crazier than some of other ideas, and doesn't harm our humans or dolphins. Let's just hope the other members of the oceanic ecosystem don't think the undulating undersea eels look tasty.

The eel-bots better not get into a turf war with the attack dolphins.
(Image couresy en.wikipedia.org.)


Source:http://blog.agupieware.com/2014/11/shock-and-awe-robot-electric-eels-to.html

New &quot;Cicret&quot; Bracelet Projects Your Phone-Screen Onto Your Flesh

The market for wearable technology has been steadily increasing, and whether you're rocking a FitBit or waiting for a full-scale neurosensory device, there's no denying that tech-to-go is now a glowing facet of modern life.  Now, a new invention may allow you to interface like never before: tapping a touchscreen that's projected onto your flesh.

That crashing sound is your productivity flying out the window.
(Image courtesy technabob.com.)

The Cicret bracelet, as reported by Gadgetify.com, uses long-range proximity sensors and a pico projector to illuminate your smartphone screen directly onto your forearm.  The "touchscreen" operates by the sensors determining when one has been intervened on by a finger, and data is sent accordingly.

While Cicret is still in the developmental phase, it has attracted a fair amount of attention.  An anonymizing, secure messenger app is also in production by the same company.  Visit their website to learn more about the bracelet or app, and donate if you feel this is something you'd like to rock on your wrist.  Apologies to those whose cool forearm tattoos precluded the development of this technology.

"Is there a glitch in the program or is my ink just awesome?"
(Image courtesy tattoomenideas.com.)


Source:http://blog.agupieware.com/2014/11/new-cicret-bracelet-projects-your-phone.html