Sunday 5 July 2015

Sudoku modelling through JAVA

Concepts: Arrays, Loops, Functions, If-else
Sudoku

Sudoku (数独 sūdoku?, Digit-single) i/suːˈdoʊkuː/, originally called Number Place,[1] is a logic-based,[2][3] combinatorial[4] number- placementpuzzle. The objective is to fill a 9×9 grid with digits so that each column, each row, and each of the nine 3×3 sub-grids that compose the

grid (also called "boxes", "blocks", "regions", or "sub-squares") contains all of the digits from 1 to 9. The puzzle setter provides a partially completed grid, which typically has a unique solution.
Completed puzzles are always a type of Latin square with an additional constraint on the contents of individual regions. For example, the same single integer may not appear twice in the same 9×9 playing board row or column or in any of the nine 3×3 subregions of the 9×9 playing board.[5]
The puzzle was popularized in 1986 by the Japanese puzzle company Nikoli, under the name
Sudoku, meaning single number.[6] It became an international hit in 2005.[7]



Task:
Write a java program to model the Sodoku game.
 Create a 9 X 9 matrix inside main. Write a function or functions to check whether the solution is as per the rule.

 After that we can think of developing the Game for playing the sudoku.

Yotaphone devices to drop Android for Sailfish OS

Out of the box? Out of the droid!

Find out your device's worth with Swappa Android app

Na biwi na bachha, na baap bada na mayia, the whole thing is that ki bhaiya sabse bada Rupaya!

A Casio smartwatch is coming up next year

Shit just got serious!


First-look at the Android-running BlackBerry 'Venice'

Am I seeing a hypersport class Rolls Royace?

Saturday 4 July 2015

13 tips for shooting low light photos on your phone like a pro.

1) Get the exposure right
2) Go manual
3) Keep your shutter open as long as reasonable
4) Stabilize your shot
5) Get the white balance right
6) Use environmental light to your advantage
7) Use flash sparingly
8) Don't zoom
9) Use your native aspect ratio and resolution
10) Shoot Raw on Android
11) Use filters and edit wisely
12) Convert to black and white
13) Know thy camera

Solar Impulse 2 lands in Hawaii, setting record for longest solo flight

It's beautiful, isn't it?

Thursday 2 July 2015

Blocks in JAVA

BLOCK IN JAVA

JAVA supports 2 types of blocks.
1. Static block
2. Non static block

If the block is declared within the static keyword then the block is known as static block.
The static block always executes before the main method, which is executed by the JVM.

If the block is declared without any static keyword then it is a Non Static block.
Non static block always executes before the constructor called by the user.
Static block is executed only for a single time for the whole life cycle of the program. Whereas non static block may execute "n" number of times, as it depends on the user
The existence of the main method will be checked by the JVM before the execution of the Static block.

Static block execution depends on the JVM. Non static block execution depends on the User.

You can write more than 1 static or non static blocks within a single class, as it is accessed top to bottom manner.

Google apologizes for calling black people as gorillas in photos app

Good boy google! *pats pats*

OnePlus Two's image leaks out!

The new flagship is pegged for a July 27 announcement.

Looks gorgeous, doesn't it?
So does its features.

This is what happens when a Google robot gets annoyed with a human

As the Wall Street Journal reports, Google performed a series of experiments in which a human conversed with a computer program. The program had been fed a whole database of movie scripts. You might think, then, that this robot was something of a warmhearted romantic who believed in happy endings.

You might also think that yogurt is made from broccoli.

The conversations were recorded and presented in a paper pleasantly titled "A Neural Conversational Model." (PDF)

One conversation stood out. This was because if the computer program had had arms and legs, I suspect it would have gone MMA on its fellow human conversationalist.

They were chatting about morality. The human kept pressing his robot friend about morality. What was it? What did it mean?

"I need to know how I should behave morally," says the human. The robot understands but replies: "I don't know how to tell you."

The human wonders if morality and ethics are the same. They are, says the robot. But when the human asks for examples of moral behavior, the robot suggests "integrity."

When pressed on the definition of integrity, the robot makes like an unfaithful lover trying to explain herself to her ex: "I don't know what else to say."

It gets worse. When the human exclaims: "Be moral!" the robot shrieks back: "Be a man!"

Below the belt, somewhat?

What followed was surely an exchange that most people reading this have experienced at least 1,412 times in their lives.

The human says: "I really like our discussion on morality and ethics." Yes, the human is a true resident of California, accentuating the positive. I bet he salutes the sun and makes his dog go downward.

However, the robot answers: "And how I'm not in the mood for a philosophical debate."

Oh.

The exchange ends with both parties going to opposite sides of the bed to sulk. Metaphorically, that is.

"What do you like to talk about?" says the human.

"Nothing," replies the robot.

I understand that the human bought the robot flowers, suggested a visit to the symphony followed by a nice dinner out. The robot has yet to reply.

VARIABLES IN JAVA

VARIABLES IN JAVA

JAVA supports 6 types of variables
1. Local variable
2. Static variable
3. Instance variable
4. Final variable
5. Transient variable
6. Volatile variable

LOCAL VARIABLE:
If the variable is declared within a block (block of method, block of constructor, Block of loop, block of if or else, block of switch or case, or any general block)   it is known as local variable.

class Test{
-------block-------
}

We cannot make the local variable as public
We cannot make the local variable as public , private or protected because the local variable can only be accessed within the same block , but the public access specifier makes the variable global. Thus it is not possible.
In short, no access specifier is used for a local variable.
Private makes it accessible within the same class.
Local variable is only able to access within the same block in which it is declared.

Local variable is not a member of the class or object, so it can't be called by class name or object name. It only accesses directly within the same block. Before using the local variable, that variable should be initialised.

Static variable
If the variable is declared within the class and not within the block, with a static keyword, then it is known as static variable. Static variable is known as class level variable. This type of variable can be called by class_name or object_name, within the same class as well as outside , it's possible to call a static variable within the same class directly.
Static variable creates a single copy for the whole program.

Instance variable.
This is known as object level variable, because Instance Variable only allocates memory at the time of the object creation.
If the variable is within the class and not within the block without any static keyword, it is known as non static or instance variable. Instance variable only can be called by the object name.

Final variable.
If the variable is declared with a "final" keyword, then it is known as final variable.
JAVA never supports any "const" keyword to declare a constant. If the variable is declared with a "final" keyword, then it is constant in JAVA.
Final variable may or may not be static in JAVA, by its better for programmer to declare the Final variable as Static.

Wednesday 1 July 2015

Lifehack: Make an Air Conditioner Out of a Cooler for Less Than $50BGR

The fan in the video was connected to a battery pack that lasted seven hours, but you can use other power sources including solar panels. Meanwhile, the ice in the cooler melted after five hours.

desertsun02 recommends using big jugs of frozen water inside the cooler so that when they melt, you won’t have to clean it all up. Instead, simply put them back in the freezer when you’re done, and reuse them once the water freezes up again.