What Is the Difference Between a Hydrogen
Bomb and an Atomic Bomb?
North Korea tested a
powerful hydrogen bomb in the Pacific Ocean, after saying the country had
already successfully detonated one.
A hydrogen bomb has
never been used in battle by any country, but experts say it has the power to
wipe out entire cities and kill significantly more people than the already
powerful atomic bomb, which the U.S. dropped in Japan during World War II,
killing tens of thousands of people.
As global tensions
continue to rise over North Korea’s nuclear weapons program, here’s what to
know about atomic and hydrogen bombs:
Why is a hydrogen
bomb stronger than an atomic bomb?
More than 200,000
people died in Japan after the U.S. dropped the world’s first atomic bomb on
Hiroshima and then another one three days later in Nagasaki during World War II
in 1945, according to the Associated Press. The bombings in the two cities were
so devastating, they forced Japan to surrender.
But a hydrogen bomb
has the potential to be 1,000 times more powerful than an atomic bomb,
according to several nuclear experts. The U.S. witnessed the magnitude of a
hydrogen bomb when it tested one within the country in 1954, the New York Timesreported.
Hydrogen bombs cause a
bigger explosion, which means the shock waves, blast, heat and radiation all
have larger reach than an atomic bomb, according to Edward Morse, a professor
of nuclear engineering at University of California, Berkeley.
An calculation of Nuclear weapon stock.
Although no other
country has used such a weapon of mass destruction since World War II, experts
say it would be even more catastrophic if a hydrogen bomb were to be dropped
instead of an atomic one.
“With the [atomic]
bomb we dropped in Nagasaki, it killed everybody within a mile radius,” Morse
told TIME on Friday, adding that a hydrogen bomb's reach would be closer to 5
or 10 miles. “In other words, you kill more people,” he said.
First ever atom bomb blast.
Hall, director of the
University of Tennessee’s Institute for Nuclear Security, called the hydrogen
bomb a “city killer” that would probably annihilate between 100 and 1,000 times
more people than an atomic bomb.
“It will basically
wipe out any of modern cities,” Hall said. “A regular atomic bomb would still
be devastating, but it would not do nearly as much damage as an H-bomb.”
Hiroshima in ruins following the atomic bomb
blast.
What’s the
difference between hydrogen bombs and atomic bombs?
Simply speaking,
experts say a hydrogen bomb is the more advanced version of an atomic bomb.
“You have to master the A-bomb first,” Hall said.
An atomic bomb uses
either uranium or plutonium and relies on fission, a nuclear reaction in which
a nucleus or an atom breaks apart into two pieces. To make a hydrogen bomb, one
would still need uranium or plutonium as well as two other isotopes of
hydrogen, called deuterium and tritium. The hydrogen bomb relies on fusion, the
process of taking two separate atoms and putting them together to form a third
atom.
Structure of a Nuclear
bomb.
“The way the hydrogen
bomb works — it’s really a combination of fission and fusion together,” said
Eric Norman, who also teaches nuclear engineering at UC Berkeley.
In both cases, a
significant amount of energy is released, which drives the explosion, experts
say. However, more energy is released during the fusion process, which causes a
bigger blast. “The extra yield is going to give you more bang,” Morse said.
Morse said the atomic
bombs dropped on Japan were each equivalent to just about 10,000 kilotons of
TNT. “Those were the little guys,” Morse said. “Those were small bombs, and
they were bad enough.” Hydrogen bombs, he said, would result in a yield of
about 100,000 kilotons of TNT, up to several million kilotons of TNT, which
would mean more deaths.
Firing a nuclear weapon enabled missile.
Hydrogen bombs are
also harder to produce but lighter in weight, meaning they could travel farther
on top of a missile, according to experts.
What are the
similarities between hydrogen bombs and atomic bombs?
Both bombs are
extremely lethal and have the power to kill people within seconds, as well as
hours later due to radiation. Blasts from both bombs would also instantly burn
wood structures to the ground, topple big buildings and render roads unusable.
LIFE magazine described
such devastation in an article published on March 11, 1946, on the aftermath of
the atomic bombs dropped on Japan. The piece read: "In the following waves
[after the initial blast] people's bodies were terribly squeezed, then their
internal organs ruptured. Then the blast blew the broken bodies at 500 to 1,000
miles per hour through the flaming, rubble-filled air. Practically everybody
within a radius of 6,500 feet was killed or seriously injured and all buildings
crushed or disemboweled."
Danger
Monday, August 28, 2017
What Is a Regular Expression, Regexp, or Regex?
A regular expression is a special text string for describing a search pattern. You can think of regular expressions as wildcards on steroids. You are probably familiar with wildcard notations such as *.txt to find all text files in a file manager. The regex equivalent is .*\.txt.
But you can do much more with regular expressions. In a text editor like EditPad Pro or a specialized text processing tool like PowerGREP, you could use the regular expression \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}\b to search for an email address. Anyemail address, to be exact. A very similar regular expression can be used by a programmer to check if the user entered a properly formatted email address. In just one line of code, whether that code is written in Perl, PHP, Java, a .NET language or a multitude of other languages.
Since "regular expressions" is a mouthful, you will usually find the term abbreviated as "regex" or "regexp". We prefer "regex", since it can be easily pluralized as "regexes".
What is a regular expression in programming?
Short for regular expression, a regex is a string of text that allows you to create patterns that help match, locate, and manage text. Perl is a great example of a programming language that utilizes regular expressions.
Save Time and Effort with Regex's
Basically, a regular expression is a pattern describing a certain amount of text. That makes them ideally suited for searching, text processing and data validation.
Searching with regular expressions enables you to get results
with just one search instead of many searches. Searching for the word
"separate" and all of its common misspellings is easy with the
regex s[ae]p[ae]r[ae]te.
If you forgot the phone number of your friend who moved to Anguilla, search
your past correspondence for \b1?[-(
]*264[-) ]*\d{3}[- ]*\d{4}\b and get a handy list of all
phone numbers in area code 264, regardless of the notation style used.
Regex is the gift that keeps giving. Once you
learn it, you discover it comes in handy in many places where you hadn't
planned to use it. On this page, we'll first look at a number of contexts and
programs where you may find regex. Then we'll have a quick look at some regex
flavors you may run into. Finally, we'll study some examples of regex patterns
in contexts such as:
The tables below are a reference to basic
regex. While reading the rest of the site, when in doubt, you can always come
back and look here. (It you want a bookmark, here's a direct link to the regex reference tables). I encourage you to print the tables so you have a cheat
sheet on your desk for quick reference.
The tables are not exhaustive, for two
reasons. First, every regex flavor is different, and I didn't want to crowd the
page with overly exotic syntax. For a full reference to the particular regex
flavors you'll be using, it's always best to go straight to the source. In
fact, for some regex engines (such as Perl, PCRE, Java and .NET) you may want
to check once a year, as their creators often introduces new features. Download and use regex cheat sheet and start learning regular expressionRegular Expression Cheat Sheet (Download PDF).
Microsoft
develops their auto pilot system (Auto gliders) by using Artificial Intelligence.
While other competitors developing self-driven cars, Microsoft recently conducted
a successful test flight of their auto pilot system (Auto gliders) which can
take decision during the flight.
Indian-origin
researcher Ashish Kapoor, head researcher of Microsoft leading his team in Microsoft’s
autonomous sky glider project and the team already designed two self-navigated
gliders and tested them. (New York Times)
The
report also said that “"Guided by computer algorithms that learned from
onboard sensors, predicted air patterns and planned a route forward, these
gliders could seek out thermals - columns of rising hot air - and use them to
stay aloft.”"
Actually
Microsoft has planned to develop auto-gliders that are able to fly on the air
for hours or even days with the minimal use of power. Microsoft also plan to
use the gliders in scientific research to help the scientists to monitor
weather patterns, crops, delivering products and even delivering internet into
certain areas where it is not available.
According
to Mykel Kochenderfer, Stanford University professor of aeronautics and
astronautics, Microsoft's project is a step towards self-driving vehicles
"that are nimble enough to handle all the unexpected behavior that human
drivers, bicyclists and pedestrians bring to public roads".
"With
a glider, you can test these algorithms with minimal risk to people and
property," Kochenderfer was quoted as saying.
In
the Nevada desert, the team led by Kapoor launched two gliders with help from a
hand-held remote control.
Once
airborne, the gliders were left to their own devices. They were forced to fly
with help from the wind and other air patterns.
With
the help of algorithms, the gliders analysed the activities surrounding them
and then changed directions as need be. They learned from their environment and
made educated guesses.
Microsoft
wanted to set record with the flight but after two days of trial, due to
problems with radios and other equipment, it did not happen.Using similar
methods, google has built high-altitude Internet balloons that can stay
aloft for months on end. Several companies, including tesla, Google, uber
and apple are designing cars that can not only drive on their own but also
keep people in the surrounding safe.
US, Russia, China and other supers powers are in a silent competition of building various robotic weapons. Specially automatic weapons like satellites, submarines, drones etc. These weapons are extremely dangerous for the world. Worlds need to be aware of the automatic robotic weapons.
More than 100 robotics and artificial intelligence leaders
including US businessman Elon Musk are urging
the United Nations to take action against the dangers of autonomous weapons,
known as "killer robots."
"Lethal autonomous weapons threaten to become the third
revolution in warfare," warned the letter signed by 116 tech luminaries,
including Musk, the chief of Tesla, and Mustafa Suleiman,
cofounder of Google's DeepMind.
"Once developed, they will permit armed conflict to be
fought at a scale greater than ever, and at times scales faster than humans can
comprehend," the letter read.
"These can be weapons of terror, weapons that despots and
terrorists use against innocent populations, and weapons hacked to behave in
undesirable ways."
They added: "We do not have long to act. Once this
Pandora's box is opened, it will be hard to close."
A UN group focused on these types of weapons was set to meet
Monday, but it was canceled and postponed until November, according to the
international body's website.
In 2015, thousands of researchers and personalities launched an
appeal to ban "autonomous weapons."
Both Musk and well-known British astrophysicist Stephen Hawking regularly warn of the "dangers"
of artificial intelligence, citing in particular "robot killers."
Oracle Corporation is going to release Java SE 9 around end of March 2017. In this post, I’m going to discuss about “Java 9 Features” briefly with some examples.
1.Java 9 REPL (JShell)
Oracle Corp has introduced a new tool called “jshell”. It stands for Java Shell and also known as REPL (Read Evaluate Print Loop). It is used to execute and test any Java Constructs like class, interface, enum, object, statements etc. very easily.
We can download JDK 9 EA (Early Access) software from https://jdk9.java.net/download/
2.Factory Methods for Immutable List, Set, Map and Map.Entry
Oracle Corp has introduced some convenient factory methods to create Immutable List, Set, Map and Map.Entry objects. These utility methods are used to create empty or non-empty Collection objects.
In Java SE 8 and earlier versions, We can use Collections class utility methods like unmodifiableXXX to create Immutable Collection objects. For instance, if we want to create an Immutable List, then we can use Collections.unmodifiableList method.
However these Collections.unmodifiableXXX methods are very tedious and verbose approach. To overcome those shortcomings, Oracle corp has added couple of utility methods to List, Set and Map interfaces.
List and Set interfaces have “of()” methods to create an empty or no-empty Immutable List or Set objects as shown below:
Empty List Example
List immutableList =List.of();
Non-Empty List Example
List immutableList =List.of("one","two","three");
Map has two set of methods: of() methods and ofEntries() methods to create an Immutable Map object and an Immutable Map.Entry object respectively.
In Java 8, we can provide method implementation in Interfaces using Default and Static methods. However we cannot create private methods in Interfaces.
To avoid redundant code and more re-usability, Oracle Corp is going to introduce private methods in Java SE 9 Interfaces. From Java SE 9 on-wards, we can write private and private static methods too in an interface using ‘private’ keyword.
These private methods are like other class private methods only, there is no difference between them.
One of the big changes or java 9 feature is the Module System. Oracle Corp is going to introduce the following features as part of Jigsaw Project.
·Modular JDK
·Modular Java Source Code
·Modular Run-time Images
·Encapsulate Java Internal APIs
·Java Platform Module System
Before Java SE 9 versions, we are using Monolithic Jars to develop Java-Based applications. This architecture has lot of limitations and drawbacks. To avoid all these shortcomings, Java SE 9 is coming with Module System.
JDK 9 is coming with 92 modules (may change in final release). We can use JDK Modules and also we can create our own modules as shown below:
Simple Module Example
module com.foo.bar {}
Here We are using ‘module’ to create a simple module. Each module has a name, related code and other resources.
To read more details about this new architecture and hands-on experience, please go through my original tutorials here:
·Java 9 Module System Basics
·Java 9 Module System Examples
5.Process API Improvements
Java SE 9 is coming with some improvements in Process API. They have added couple new classes and methods to ease the controlling and managing of OS processes.
System.out.println("Current Process Id: = "+ currentProcess.getPid());
If you want to read more about this new API, please go through my original tutorial at: Java SE 9: Process API Improvements.
6.Try With Resources Improvement
We know, Java SE 7 has introduced a new exception handling construct: Try-With-Resources to manage resources automatically. The main goal of this new statement is “Automatic Better Resource Management”.
Java SE 9 is going to provide some improvements to this statement to avoid some more verbosity and improve some Readability.
In Java SE 9, Oracle Corp is going to improve CompletableFuture API to solve some problems raised in Java SE 8. They are going add to support some delays and timeouts, some utility methods and better sub-classing.
Here delayedExecutor() is static utility method used to return a new Executor that submits a task to the default executor after the given delay.
To read more about this feature, please go through my original tutorial at: Java SE 9: CompletableFuture API Improvements
8.Reactive Streams
Now-a-days, Reactive Programming has become very popular in developing applications to get some beautiful benefits. Scala, Play, Akka etc. Frameworks has already integrated Reactive Streams and getting many benefits. Oracle Corps is also introducing new Reactive Streams API in Java SE 9.
Java SE 9 Reactive Streams API is a Publish/Subscribe Framework to implement Asynchronous, Scalable and Parallel applications very easily using Java language.
Java SE 9 has introduced the following API to develop Reactive Streams in Java-based applications.
·java.util.concurrent.Flow
·java.util.concurrent.Flow.Publisher
·java.util.concurrent.Flow.Subscriber
·java.util.concurrent.Flow.Processor
If you want to read more about this new API, please go through my original tutorials at: Introduction to Reactive Programming and Java SE 9: Reactive Streams.
9.Diamond Operator for Anonymous Inner Class
We know, Java SE 7 has introduced one new feature: Diamond Operator to avoid redundant code and verbosity, to improve readability. However in Java SE 8, Oracle Corp (Java Library Developer) has found that some limitation in the use of Diamond operator with Anonymous Inner Class. They have fixed that issues and going to release as part of Java 9.
publicList getEmployee(String empid){
// Code to get Employee details from Data Store
returnnewList(emp){};
}
Here we are using just “List” without specifying the type parameter. To read more details about this improvement, please go through my original tutorial at: Java SE 9: Diamond Operator improvements for Anonymous Inner Class
10.Optional Class Improvements
In Java SE 9, Oracle Corp has added some useful new methods to java.util.Optional class. Here I’m going to discuss about one of those methods with some simple example: stream method
If a value present in the given Optional object, this stream() method returns a sequential Stream with that value. Otherwise, it returns an Empty Stream.
They have added “stream()” method to work on Optional objects lazily as shown below:
Stream<Optional> emp = getEmployee(id)
Stream empStream = emp.flatMap(Optional::stream)
Here Optional.stream() method is used convert a Stream of Optional of Employee object into a Stream of Employee so that we can work on this result lazily in the result code.
To understand more about this feature with more examples and to read more new methods added to Optional class, please go through my original tutorial at: Java SE 9: Optional Class Improvements
11.Stream API Improvements
In Java SE 9, Oracle Corp has added four useful new methods to java.util.Stream interface. As Stream is an interface, all those new implemented methods are default methods. Two of them are very important: dropWhile and takeWhile methods
If you are familiar with Scala Language or any Functions programming language, you will definitely know about these methods. These are very useful methods in writing some functional style code. Let us discuss about takeWhile utility method here.
This takeWhile() takes a predicate as an argument and returns a Stream of subset of the given Stream values until that Predicate returns false for first time. If first value does NOT satisfy that Predicate, it just returns an empty Stream.
jshell>Stream.of(1,2,3,4,5,6,7,8,9,10).takeWhile(i -> i <5)
.forEach(System.out::println);
1
2
3
4
To read more about takeWhile and dropWhile methods and other new methods, please go through my original tutorial at: Java SE 9: Stream API Improvements
12.Enhanced @Deprecated annotation
In Java SE 8 and earlier versions, @Deprecated annotation is just a Marker interface without any methods. It is used to mark a Java API that is a class, field, method, interface, constructor, enum etc.
In Java SE 9, Oracle Corp has enhanced @Deprecated annotation to provide more information about deprecated API and also provide a Tool to analyse an application’s static usage of deprecated APIs. They have add two methods to this Deprecated interface: forRemoval and since to serve this information.
Read my original tutorial at: Java SE 9: Enhanced @Deprecated annotation to see some useful examples.
13.HTTP 2 Client
In Java SE 9, Oracle Corp is going to release New HTTP 2 Client API to support HTTP/2 protocol and WebSocket features. As existing or Legacy HTTP Client API has numerous issues (like supports HTTP/1.1 protocol and does not support HTTP/2 protocol and WebSocket, works only in Blocking mode and lot of performance issues.), they are replacing this HttpURLConnection API with new HTTP client.
They are going to introduce new HTTP 2 Client API under “java.net.http” package. It supports both HTTP/1.1 and HTTP/2 protocols. It supports both Synchronous (Blocking Mode) and Asynchronous Modes. It supports Asynchronous Mode using WebSocket API.
We can see this new API at: http://download.java.net/java/jdk9/docs/api/java/net/http/package-summary.html
HTTP 2 Client Example
jshell>import java.net.http.*
jshell>importstatic java.net.http.HttpRequest.*
jshell>importstatic java.net.http.HttpResponse.*
jshell> URI uri =new URI("http://rams4java.blogspot.co.uk/2016/05/java-news.html")
uri ==> http://rams4java.blogspot.co.uk/2016/05/java-news.html
jshell>System.out.println("Response was "+ response.body(asString()))
Please go through my original tutorial at: Java SE 9: HTTP 2 Client to understand HTTP/2 protocol & WebSocket, Benefits of new API and Drawbacks of OLD API with some useful examples.
14.Мulti-Resolution Image API
In Java SE 9, Oracle Corp is going to introduce a new Мulti-Resolution Image API. Important interface in this API is MultiResolutionImage . It is available in java.awt.image package.
MultiResolutionImage encapsulates a set of images with different Height and Widths (that is different resolutions) and allows us to query them with our requirements.
Please go through my original tutorial at: Java SE 9: Мulti-Resolution Image API to understand this new API more with some examples.
15.Miscellaneous Java 9 Features
In this section, I will just list out some miscellaneous Java SE 9 New Features. I’m NOT saying these are less important features. They are also important and useful to understand them very well with some useful examples.