Simplified : Client_Server – Socket Programming in Java

Client_Server – Socket Programming in Java

java socket programming



Client -server communication

At a basic level, network-based systems consist of a server , client , and a media for communication. A computer running a program that makes a request for services is called client  machine. A computer running a program that offers requested services from one or more clients is called  server machine.

Client-Server Architcture


What are Sockets?

In Client-Server architecture, you have two processes (running client-Server programs) that want to communicate with each other. For that, they have to establish a communication link between themselves. There is a network available,they just need to connect to this network , for this they use sockets.

Sockets in client server architecture

A socket is one endpoint of a two-way communication link between two programs running on the network.

An endpoint is a combination of an IP address and a port number. Every TCP connection can be uniquely identified by its two endpoints. That way you can have multiple connections between your host and the server.
The java.net package in the Java platform provides a class, Socket, that implements one side of a two-way connection between your Java program and another program on the network. 

How do I Open a Socket ?

If you are programming a client, then you would open a socket like this:
 Socket s;
s
= new Socket("Machine name", PortNumber);
Where Machine name is the machine you are trying to open a connection to, and Port-Number is the port (a number) on which the server you are trying to connect to is running. When selecting a port number, you should note that port numbers between 0 and 1,023 are reserved for privileged users (that is, super user or root). These port numbers are reserved for standard services, such as email, FTP, and HTTP. When selecting a port number for your server, select one that is greater than 1,023!


It is a good practice to handle exceptions. The above can be written as:

    Socket s;
try {
s
= new Socket("Machine name", PortNumber);
}
catch (IOException e) {
System.out.println(e);
}
If you are programming a server, then this is how you open a socket:

    ServerSocket ss;
try {
ss
= new ServerSocket(PortNumber);
}
catch (IOException e) {
System.out.println(e);
}
When implementing a server you also need to create a socket object from the ServerSocket in order to listen for and accept connections from clients.

Socket clientSocket = null;
try {
serviceSocket
= ss.accept();
}
catch (IOException e) {
System.out.println(e);
}

How do I create Buffered Reader?

Java BufferedReader class is used to read the text from a character-based input stream. It can be used to read data line by line by readLine() method. It makes the performance fast. 
    try {
BufferedReader br = new BufferedReader(new InputStreamReader(ss.getInputStream()));

}
catch (IOException e) {
System.out.println(e);
}

How do I create an output stream?

On the client side, you can create an output stream to send information to the server socket using the class  of java.io:
    PrintStream output;
try {
OutputStream ostream = sock.getOutputStream();
DataOutputStream dos = new DataOutputStream(ostream);

}
catch (IOException e) {
System.out.println(e);
}
The class DataOutputStream allows you to write Java primitive data types; many of its methods write a single Java primitive type to the output stream. The method writeBytes is a useful one.

How do I Close a Socket ?

On the client side:

    try {
output
.close();
input
.close();
s
.close();
}
catch (IOException e) {
System.out.println(e);
}

On the server side:

    try {
output
.close();
input
.close();
ss
.close();
}
catch (IOException e) {
System.out.println(e);
}
Let’s see java code for one-way communication using socket programming:

Client Side Code:
import java.net.Socket; 
import java.io.OutputStream;
import java.io.DataOutputStream;

public class SCPTL
{
public static void main(String args[]) throws Exception
{
Socket sock = new Socket("localhost", 5000);
String message1 = "Learn-Intern-Certify from SCPTL";

OutputStream ostream = sock.getOutputStream();
DataOutputStream dos = new DataOutputStream(ostream);
dos.writeBytes(message1);
dos.close();
ostream.close();
sock.close();
}
}
Server Side Code:
import java.net.ServerSocket;            
import java.net.Socket;
import java.io.*;

public class SERVER
{
public static void main(String args[]) throws Exception
{
ServerSocket sersock = new ServerSocket(5000);
System.out.println("server is ready"); // message to know the server is running

Socket sock = sersock.accept();

BufferedReader br = new BufferedReader(new InputStreamReader(sock.getInputStream()));

String message2 = br.readLine();
System.out.println(message2);
sock.close(); sersock.close();
}
}

Output:

Client:

Client side output
Server:

Server side output

Want to learn more about java?

Buying a console for a single game

I bought a Nintendo Switch mostly because I wanted to play Zelda: Breath of the Wild. I don’t regret that decision: I already had 165 hours of fun with Zelda, and there is still some DLC content I haven’t done; I can even imagine playing it again with a different approach. And I have already a small library of games for the Switch that I might enjoy as well. However, as a general approach, buying a console because you want to play one specific game on it has its limitations. And this week I’m pondering these limitations due to the release of Monster Hunter: World.

Monster Hunter: World looks like a game I would like to play. In many aspects it is quite similar to Zelda, being an action-adventure open world game. However this week it comes out only on the Playstation 4 and the XBox One, neither of which I own. A release on the PC is only foreseen in “late 2018”, with not even a date fixed.
The most likely scenario is that I will just wait. And if I wait until late 2018, I might also wait until 2019+ for some Steam sale. There are a bunch of reasons why I don’t really consider buying a PS4 or XBox One to play Monster Hunter: World or any game: First of all I simply don’t have the room for several consoles in my den / man cave; I have an enclosed TV cabinet, which already holds the TV, the Switch, a BlueRay player, the cable box, and a Chromecast. All of which pretty much fills the enclosed space *and* the available HDMI connections on the TV. Second I already think that console games are rather expensive on their own, so adding the price tag of a console to one or few games makes them feel excessively expensive, even if I could afford that excess. And third both the PS4 and the XBox One are closer to the end of their cycle than to the beginning. Next year or so the PS5 and “XBox Two” or whatever it will be called will come out. If I haven’t felt the need to buy one of the current consoles in the last 5 years, now might be a bit too late. Especially when I know that Monster Hunter: World will be eventually released on the PC (and will look better there). Anyway, I already got far too many games and far too little time to play them all.

So, yeah, buying *one* console for a single game I am okay with. But I balk at repeating that for a second or third console, because that feels like a slippery slope into a bottomless money hole for me.

Irk a Politician This Holiday Season by Giving to These Progressive Causes

Republican leaders won’t thank you, but others in need will.

For some progressives looking for holiday gifts, there are guides to ethical and feminist products. Others prefer to donate to an organization or cause. This holiday season, let your gift-giving be inspired by celebrities and their charitable donations. Celebrities like Mila Kunis have been donating to Planned Parenthood in Vice President Mike Pence’s name—and others have followed suit.

Instead of donating to a charitable organization in the name of a loved one or friend, try gifting in the name of a politician who stoked the dumpster-fire of 2017 politics. Support the work of these important organizations and give a reminder that the resistance is stronger than ever.

1. If the Alabama special election had you on the edge of your seat and the thought of child-molester Roy Moore (who has still not accepted the election results) makes you want to punch a wall while throwing up…

Photo Credit: Emily C. Bell / YouTube

…then donate to organizations and campaigns working to support voting rights and black candidates. When pollsters examined the special election voter demographics, Doug Jones was victorious because of black voters, specifically black women (96 and 98 percent voted for Jones, respectively). In response, The Cut released a list of organizations and campaigns working toward voting access and political empowerment of black women. Check out Woke Vote and Higher Heights, and give Roy Moore a reminder of the power of local organizing.

2. If you despite head of the EPA Scott Pruitt for refusing to recognize human contributions to climate change and for subsequently leading the government in throwing the planet under the bus in 2017, and you’re appalled by the plethora of climate change deniers, not just in the White House but also in Congress…

Photo Credit: Gage Skidmore/WikiCommons

…then support those who are standing up to them, like the youth activists who protested at the UN climate summit. You can also donate to organizations educating and raising awareness about climate change, including Earthjustice and 350.org.

3. If you oppose politicians like Representative Steve King for his support of the DACA repeal and for saying Dreamers can “live in the shadows”… 

Photo Credit: WikiCommons

…donate to organizations like United We Dream, which is calling for a clean #DreamActNow and organized a national call day on Thursday.

You can also support organizations like Movimiento Cosecha and the Immigrant Defense Project that are fighting back on Trump-administration policies, protesting the actions of ICE and advocating for the rights of immigrants.

4. If you’re outraged over Donald Trump ignoring the crisis in Puerto Rico…

Photo Credit: Shealah Craighead/ WikiCommons

…and his childish behavior when he visited:

…donate to organizations that are providing services on the ground in Puerto Rico and working on rebuilding efforts due to the destruction of Hurricane Maria. A list of reputable organizations includes Friends of Puerto Rico and Light and Hope for Puerto Rico: A Citizen Campaign, which is raising money to purchase and deliver specific supplies: solar lights, phone chargers and washing machines that don’t require electricity.

5. If you hate that Health and Human Services Secretary Tom Price and GOP lawmakers are reducing access to birth control, something Price clearly has no knowledge of…

…and the GOP tax bill, which is an overall travesty for poor people, because of health care provisions that will remove the individual mandate and hurt access to birth control…

Donate to organizations concerned with access to birth control and reproductive healthcare, like the Center for Reproductive Rights and Planned Parenthood, and feel inspired by their recent activism to stand up to the Trump administration for the birth control rollback:

 

 

 

 

Related Stories

  • In Alabama, Black Women Saved America From Itself—as They’ve Always Tried to Do
  • The Alt-Right Is Melting Down in the Wake of Roy Moore’s Stunning Defeat
  • Whitefish Energy Fleeced Puerto Rico During Recovery Efforts: Report

The T-Mobile HTC U11 Life is getting Android 8.0 Oreo (updated)

Update (12/18/17): Just about three weeks ago, the unlocked HTC U11 Life was upgraded to Android 8.0 Oreo. Now, the T-Mobile variant is receiving the update as well. T-Mobile is the only carrier in the United States to carry the HTC U11 Life so between it and the unlocked versions, pretty much everyone should be updated to Oreo at this point.

HTC warns that this is a pretty large download so you’ll need to connect to Wi-Fi before you start. As a reminder, Oreo brings background limits on apps that help to save power, smart text selection, grouped notifications, and picture-in-picture mode, among other features. To read more about Oreo, check out our review here.

Original article (11/30/17): The HTC U11 Life was introduced earlier this month, arriving on the Android One program in global markets (with almost stock Android), while those in the US received a variant with HTC’s Sense UI. The device launched with Android Oreo outside of the US, meaning those residing in the States were left waiting for the latest Google software, but HTC assured that it wouldn’t be far off.

Today, I bring good news as the US unlocked U11 Life is now said to be receiving Oreo. HTC Vice President of Product Manager Mo Versi delivered the news via a Tweet published a couple of hours ago. Versi said that the update would be available “starting today,” but we don’t know how long it could take to hit individual devices.

HTC has been on a roll with its rollouts this week, having upgraded the regular HTC U11 flagship to Oreo just a couple of days ago. Here’s hoping the speedy updates continue for the rest of its smartphone lineup.

Check out our full HTC U11 Life review at the link and visit our dedicated Android 8.0 Oreo update page to find out more about HTC’s schedule.

Web scrapping tools,Sooo Muuch Data – Analysis Needed !

Web Scraping Tools

What is Web Scrapping?


Web Scraping (also termed Screen Scraping, Web Data Extraction, Web Harvesting etc.) is a technique employed to extract large amounts of data from websites. Web scraping software may access the World Wide Web directly using the Hypertext Transfer Protocol, or through a web browser.
While web scraping can be done manually by a software user, the term typically refers to automated processes implemented using a bot or web crawler. It is a form of copying, in which specific data is gathered and copied from the web, typically into a central local database or spreadsheet, for later retrieval or analysis.
These tools are useful for anyone trying to collect some form of data from the Internet. Web Scraping is the new data entry technique that don’t require repetitive typing or copy-pasting.
These software look for new data manually or automatically, fetching the new or updated data and storing them for your easy access. For example, one may collect info about products and their prices from Flipkart using a scraping tool.
Lets see some Web scrapping tools:

1. import.io

import.io offers a builder to form your own datasets by simply importing the data from a particular web page and exporting the data to CSV. You can easily scrape thousands of web pages in minutes without writing a single line of code and build 1000+ APIs based on your requirements.
Import.io uses cutting-edge technology to fetch millions of data every day, which businesses can avail for small fees. Along with the web tool, it also offers a free apps for Windows, Mac OS X and Linux to build data extractors and crawlers, download data and sync with the online account.

2. Webhose.io

Webhose.io provides direct access to real-time and structured data from crawling thousands of online sources. The web scraper supports extracting web data in more than 240 languages and saving the output data in various formats including XML, JSON and RSS.


Webhose.io is a browser-based web app that uses an exclusive data crawling technology to crawl huge amounts of data from multiple channels in a single API. It offers a free plan for making 1000 requests/ month, and a 5K/mth premium plan for 5000 requests/month.


3Scrapinghub:

Scrapinghub is a cloud-based data extraction tool that helps thousands of developers to fetch valuable data. Scrapinghub uses Crawlera, a smart proxy rotator that supports bypassing bot counter-measures to crawl huge or bot-protected sites easily.
Scrapinghub converts the entire web page into organized content. Its team of experts are available for help in case its crawl builder can’t work your requirements. Its basic free plan gives you access to 1 concurrent crawl and its premium plan for $25 per month provides access to up to 4 parallel crawls.

4. 80legs:

80legs is a powerful yet flexible web crawling tool that can be configured to your needs. It supports fetching huge amounts of data along with the option to download the extracted data instantly. The web scraper claims to crawl 600,000+ domains and is used by big players like MailChimp and PayPal.
Its ‘Datafiniti‘ lets you search the entire data quickly. 80legs provides high-performance web crawling that works rapidly and fetches required data in mere seconds. It offers a free plan for 10K URLs per crawl and can be upgraded to an intro plan for $29 per month for 100K URLs per crawl.

5. ParseHub:

ParseHub is built to crawl single and multiple websites with support for JavaScript, AJAX, sessions, cookies and redirects. The application uses machine learning technology to recognize the most complicated documents on the web and generates the output file based on the required data format.
ParseHub, apart from the web app, is also available as a free desktop application for Windows, Mac OS X and Linux that offers a basic free plan that covers 5 crawl projects. This service offers a premium plan for $89 per month with support for 20 projects and 10,000 webpages per crawl.

Want to learn Database Programming?

XCOM 2: War of the Chosen

Steam sales are so frequent that I rarely buy games that aren’t at least 50% off. Usually I just ignore the hype that surrounds new games, and just wait for the inevitable price decrease. More often than not the game a year later is not only half price, but also better than at release due to patches. Having said that, there are a few exceptions where I want to have a game on release day, at full price. The most recent example of that being XCOM 2: War of the Chosen for €39.99.

Now there are two main things to say about War of the Chosen. The first is that it is a very good expansion of the original XCOM 2 game, providing a lot of fresh fun with new maps, new aliens to fight, and new game mechanics. The second is that it is after all only an expansion, and to many people will not be worth 40 bucks. The expansion really improves the basic game with a wide range of options, but at two thirds of the price of a triple A game the thing appears rather expensive. Waiting for example for the Steam Christmas sale and hoping War of the Chosen will be cheaper then would be a completely rational decision.

One thing I liked about War of the Chosen was the advanced options menu, which now gives a wider range of choices than the original basic options menu. You can for example decide that you don’t like to be rushed through the game, and double the timer of the avatar project and/or of individual missions. Of course that does make the game easier, but not everybody appreciates the sort of difficulty which arises only from being forced to rush through content.

From the new monsters I probably like the zombies the most. They appear in large groups, but have a special feature where you get an additional action if you kill one. That allows for very satisfying chain kills, but carries the risk of you missing your shot and being overrun by a horde of zombies. I am less a fan of the new “chosen” aliens, which can be even more annoying than the previously patched in “rulers”.

The new factions which give you access to new soldier classes with a different system of talent tree are interesting. You probably appreciate them more if you always only used the 4 original classes. However I already used mods to have a wider choice of classes, and so that was less a drawback of the original game for me.

I started a new campaign because of War of the Chosen. However I can’t say I’m very much hooked. I have a range of other projects in my life currently, and playing XCOM 2 isn’t always on top of the list of my priorities. That is especially true on weekdays after work, as I find that the game requires some concentration. If I’m too tired I prefer more casual games, or even passive entertainment via Netflix. So I probably overpaid for the expansion, even if I don’t really regret it.

Elemental Evil: Session 8

In the previous session the group had located the tower of the elemental cult of air and gained new allies in the form of a group of Aarakocra. They had decided to approach the tower through the Sighing Valley and try to sneak in from below with their allies helping them up the pillar the tower stands on. But first they needed to get there.

The Aarakocra informed them that basically they could go either left or right of the river dividing the valley. To the left was gnoll territory; not the most fearsome of adversaries, but many of them. To the right was the lair of a manticore, which was a much more dangerous beast, but alone. They went for the manticore. Now 6 adventurers hitting a single monster can make for short and boring fights. To avoid that I had placed the manticore out in the open, in plain view, so the fight started with the monster and the group 200 feet apart. Which just happened to be the maximum range of the manticore’s spike-slinging tail attack. 🙂 This ended up being a rather interesting fight, with the group using ranged attacks while closing in, and being under fire themselves. They won, but two group members went down during the fight and had to be saved by their team mates. In most rounds I decided to let the manticore fire its spikes on the closest enemy. However at one point the closest enemy was the druid who just had changed into bear form. So at that point I let the manticore make an intelligence check, which it failed, leading it to believe that this was an actual bear who had somehow wandered in and would be scared off easily by a threatening roar. At least the druid liked that idea; the halfling monk who got shot instead maybe not so much.

That fight got the group to level 4, so they took a long rest and leveled up. Then they continued up the valley, to the point where the stream was easy to cross. There the stream came out of a cave, and the Aarakocra had told them that air cultists had been seen hanging around that area. So they explored the cave and found three air cultist spellcasters praying in front of a great door. As the cave was only as broad as the stream, the air cultists did get good use out of otherwise rather useless gust of wind spells (I ruled that a gust of wind gives disadvantage to non-magical missiles like arrows, because I was so surprised that in rules as written the spell doesn’t even do that). But they weren’t very strong and the party easily beat them.

The portal was showing a symbol they knew from the book on fighting elemental evil: It was the runes of the 4 elemental cults posed around the elder elemental eye. The door was clearly magical, and it appeared as if one needed the 4 runes of the 4 elemental cults to open the door. As they didn’t have any yet, they went on towards Feathergale Spire. They found some corpses at the base which suggested that sometimes people were thrown off the spire. At this point we ended the session.

[DM’s note: The magical portal isn’t in the Princes of the Apocalypse book. In the book as written you can go right down into the underground elemental dungeons. Only that of course the first dungeon downstairs is level 7, and would be quite deadly for a group of level 3 or 4 characters. And there would be no reason to visit the above-ground 4 elemental keeps, thus skipping a lot of the content of the adventure. A magical door on every entrance, with the 4 keys being held in the 4 keeps, seemed the logical solution for this design flaw to me.]

Is FCC Chairman Ajit Pai a Closeted Alt-Right Sympathizer?

The evidence is inconclusive, but no one in this administration has earned the benefit of the doubt.

On Thursday, the Federal Communications Commission voted 3-2 along party lines to repeal an Obama-era regulation to preserve net neutrality, defying Silicon Valley executives and consumer advocacy groups, not to mention the will of the people. A recent University of Maryland survey finds that more than 80 percent of registered voters oppose the FCC’s plans.

The move will fundamentally transform the internet as we know it, allowing corporate behemoths like Verizon and Comcast to manipulate loading speeds and charge customers a premium for access to individual websites and apps. Adding insult to democratic injury, circumstantial evidence suggests the man who cast the deciding vote, Ajit Pai, sympathizes with the so-called alt-right.

Back in November, the FCC chairman and Trump appointee unveiled his plans to junk the net neutrality rules established in 2015, arguing that websites and social media platforms, rather than internet service providers (ISPs), posed the greatest threat to an open internet. At the time, Pai singled out Twitter for blame.

“The company has a viewpoint and uses that viewpoint to discriminate,” he told the R Street Institute, a libertarian-minded think tank. “And to say the least, the company appears to have a double standard when it comes to suspending or deverifying conservative users’ accounts as opposed to those of liberal users. This conduct is many things, but it isn’t fighting for an open internet.”

It’s difficult to know exactly who Pai had in mind, but Slate’s April Glaser notes that Twitter recently deverified the accounts of several prominent white supremacists, including Laura Loomer and Jason Kessler. The former is a YouTube sensation on the alt-right who was recently banned from Uber and Lyft for her Islamophobic tweets, while the latter was one of the organizers of the Unite the Right rally in Charlottesville. In October, Kessler was indicted on a felony perjury charge after falsely accusing a man he’d assaulted of attacking him first. 

“What’s weird about Pai’s comments is that while these are all figures on the right, conservatives don’t typically count them among their ranks,” Glaser writes. “And while conservatives do sometimes cast themselves as ideological victims of Silicon Valley’s overreach, there have been no recent deverifications of prominent right-wing figures, ‘conservative’ or otherwise, not known for promoting hate. In other words, according to Pai, the demotion of racists on a social network is a bigger deal than an action that could radically change the architecture of—and who succeeds on—the internet.”

Weirder still is the video Pai released Wednesday in conjunction with the Daily Caller assuring millennials that they can still “gram their food” and “post photos of cute animals” if net neutrality is scrapped. (In May, he made a separate appeal to America’s youth by reading aloud the meanest tweets about his proposals, a nod to the popular segment on “Jimmy Kimmel Live!”) When he’s not wielding a fidget spinner and assuring viewers they can still binge-watch “Game of Thrones,” he can be seen doing the Harlem Shake next to a woman named Martina Markota, a far-right conspiracy theorist who has speculated that Hillary Clinton’s former campaign chair ran a child sex ring out of the basement of a Washington pizzeria.

Before joining the Daily Caller, Markota appeared in a video for the Proud Boys, a self-described “Western Chauvinist” men’s club with ties to the alt-right, where she claimed that the (thoroughly debunked) Pizzagate was real. “This is not something I’m making up because I’m trying to…put in my fantasy version of what’s going on and interject it into these email scandals,” she says at one point. “This is independent of the campaign. I know what cheese pizza is.”

Pai, the son of Indian immigrants, has been a subject of racist attacks himself in recent months, some of them bearing the hallmarks of the alt-right. “We all have the power to murder Ajit Pai and his family,” an FCC commenter wrote in May. “Jk jk.” No one stands to lose more from the repeal of net neutrality rules than the patrons of websites like 4chan and Reddit, which internet service providers will soon be able to slow to a crawl, so it’s difficult to imagine white nationalists embracing Pai as an ally, and vice versa.

And yet. After the FCC chairman pleaded his case that social media networks were suppressing free speech, he earned the effusive praise of far-right radio host Matt Forney and Andrew Torba of Gab, a platform where users “are generally free to be as racist or anti-Semitic as they’d like without fear of being reprimanded or censored,” according to Slate.

It’s possible, even probable, that Pai was unaware of Martina Markota’s history before he recorded his latest video for the Daily Caller. But the fact remains that Jason Kessler got his start as a contributor for the right-wing publication, and Pai had no reservations about lending it his imprimatur. With a White House that has excused and enabled white nationalists at every turn, no one in the Trump administration has earned the benefit of the doubt.

 

Related Stories

  • It’s Ayn Rand’s America Now, Thanks to the GOP
  • There’s an Insidious Strategy Behind Donald Trump’s Retweets
  • The Uncanny, Frightening Ways That Trump’s America Mirrors Hitler’s Germany

An old problem

I played Magic the Gathering both in physical form and in various digital forms. Anybody who does thinks not much differently of his digital cards than of his physical cards. After all the cards in both forms serve the exactly same purpose, and being able to use the physical card as a doorstop isn’t really relevant enough to value the physical card more than the digital one. However legally I only ever owned the physical cards. Virtual property still has no legal standing in Europe or the USA, so my digital cards are not considered my property. That is a very old problem, and up to now nobody really cared enough about it to consider it worth changing.

But this month comes along EA’s Star Wars Battlefront II with its loot box controversy. And some politicians woke up and realized that such a system is very similar to gambling: You pay real money for a random chance to win something which is of value to you. It is easy to imagine a child being seduced by that and spending hundreds or thousands of daddy’s credit card, because daddy is an idiot regarding his kid and his credit card. Even if research suggests that the real whales are more likely to be lonely bankers with too much money, a politician would rather be seen protecting the children than protecting the bankers. So an attack on loot boxes makes political sense with that child protection story.

However suddenly our old problem is back. Virtual property still doesn’t exist, legally. So the content of a loot box, legally speaking, has no value. So buying loot boxes can’t be gambling, because, legally speaking, you can’t win anything of value. Having ignored the problem of virtual property in the past is now biting the legal system in the ass.

I, being a scientist by education, once had a very interesting conversation with somebody with a legal background about the nature of truth. As a scientist I believe that there is an absolute truth, which I can examine and measure, and then describe with words. If the words don’t fit with reality, the words are wrong. The legal guy thought that writing down words in a law or contract created truth. If the words didn’t fit with reality, reality was wrong. This is one of those cases. It is pretty much obvious to any sane person that loot boxes are a form of gambling (regardless of whether we think gambling is good or bad). You pay money in the hope of winning a prize, and whether you get that prize depends on random chance. Whether you buy a raffle ticket to win a stuffed animal at the carnival or whether you buy a loot box to win a hero character in Battlefront 2 is exactly the same in the mind of the buyer. Only the legal words describing the two situations differ substantially.

While I am in favor of systems that prevent children having access to loot box systems in games, for me that is actually only the start. In order to get to that point we need to legally recognize loot boxes as gambling. And for that we need to legally recognize that virtual property exists and has value. That is a much larger and more important issue than just loot boxes.

Quantum computing is now a commercial reality !

Quantum Computing

Quantum computing is the area of study focused on developing computer technology based on the principles of quantum theory, which explains the nature and behavior of energy and matter on the quantum (atomic and subatomic) level. The quantum computer, following the laws of quantum physics, would gain enormous processing power through the ability to be in multiple states, and to perform tasks using all possible permutations simultaneously. Current centers of research in quantum computing include MIT, IBM, Oxford University, and the Los Alamos National Laboratory. D-Wave Systems is the world’s first quantum-computing company.

quantum computing

Classical computing relies, at its ultimate level, on principles expressed by Boolean algebra, operating with a (usually) 7-mode logic gate principle, though it is possible to exist with only three modes (which are AND, NOT, and COPY). Data must be processed in an exclusive binary state at any point in time – that is, either 0 (off / false) or 1 (on / true). These values are binary digits, or bits. The millions of transistors and capacitors at the heart of computers can only be in one state at any point.
The Quantum computer, by contrast, can work with a two-mode logic gate: XOR and a mode we’ll call QO1 (the ability to change 0 into a superposition of 0 and 1, a logic gate which cannot exist in classical computing). In a quantum computer, a number of elemental particles such as electrons or photons can be used (in practice, success has also been achieved with ions), with either their charge or polarization acting as a representation of 0 and/or 1. Each of these particles is known as a quantum bit, or qubit, the nature and behavior of these particles form the basis of quantum computing. The two most relevant aspects of quantum physics are the principles of superposition and entanglement.

What Commercial Applications are Being Adopted?

It appears that while this is going to expand rapidly that current commercial applications are fairly narrow.

Lockheed Martin

In 2010 Lockheed became D-Wave’s first commercial customer after testing whether (now 7 year old) Quantum computers could spot errors in complex code.  Even that far back D-Waves earliest machine found the errors in six weeks compared to the many man-months Lockheed Martin’s best engineers had required.
Today, after having upgraded twice to D-Waves newest largest machines Lockheed has several applications, but chief among them is instantly debugging millions of lines of code.

Temporal Defense Systems (TDS)

TDS is using the latest D-Wave 2000Q to build its advanced cyber security system, the Quantum Security Model.  According to James Burrell, TDS Chief Technology Officer and former FBI Deputy Assistant Director this new system will be a wholly new level with real-time security level rating, device-to-device authentication, identification of long-term persistent threats, and detection and prevention of insider threats before network compromise and data theft occurs.

Westpac, Commonwealth, and Telstra

While the Australians are committed to getting out ahead their approach has been a little different.  Commonwealth recently announced a large investment in a Quantum simulator, while Westpac and Telstra have made sizable ownership investments in Quantum computing companies focused on cyber security.

QuantumX

There is now even an incubator focusing solely on Quantum computing applications called QuantumX with offices in Cambridge and San Francisco.
As for operational business uses these applications are not overwhelmingly diverse but this harkens back to about 2005 when Google was using the first NoSQL DB to improve its internal search algorithms. Only two years later the world had Hadoop.

Quantum Computing and Deep Learning

Here’s where it gets interesting.  All these anomaly detecting cybersecurity, IV&V, and Monte Carlo simulations are indeed part of data science, but what about deep learning?  Can Quantum computing be repurposed to dramatically speed up Convolutional and Recurrent Neural Nets, and Adversarial and Reinforcement Learning with their multitude of hidden layers that just slows everything down?  As it turns out, yes it can.  And the results are quite amazing.

Quantum computers are made up of parts called qubits, also known as quantum bits. You may have read that IBM Q’s Quantum machine available in the cloud via API is 17 Qubits while D-Wave’s is now 2,000 Qubits.  Does this mean IBM’s is tiny by comparison?  Actually no.  IBM and D-Wave use two completely different architectures in their machines so that their compute capability is roughly equal. D-Wave’s system is based on the concept of quantum annealing and uses a magnetic field to perform qubit operations.

IBM’s system if based on a ‘gate model’ which is considered both more advanced and more complicated.  So when IBM moves from 16 qubits to 17 qubits its computational ability doubles.

Do you want to Learn Python Programming?