Android WiFi: Android – LeaVe my baThRoom at-least !

android wifi


WiFi is a technology for wireless local area networking with devices based on the IEEE 802.11 standards. Devices that can use Wi-Fi technology include personal computers, video-game consoles, smartphones, digital cameras, tablet computers, digital audio players and modern printers. Wi-Fi compatible devices can connect to the Internet via a WLAN and a wireless access point. Such an access point (or hotspot) has a range of about 20 meters (66 feet) indoors and a greater range outdoors. Hotspot coverage can be as small as a single room with walls that block radio waves, or as large as many square kilometers achieved by using multiple overlapping access points.

Android allows applications to access to view the access the state of the wireless connections at very low level. Android provides WiFi API through which applications can communicate with the lower-level wireless stack that provides WiFi network access. Almost all information from the device supplicant is available, including the connected network’s link speed, IP address, negotiation state, and more, plus information about other networks that are available. Some other API features include the ability to scan, add, save, terminate and initiate WiFi connections.

WifiManager is the primary API for managing all aspects of WiFi connectivity. Get an instance of this class by calling Context.getSystemService(Context.WIFI_SERVICE). It’s Syntax is given below:-

WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);


WifiManager class provides different methods to control WiFi activities:-

  • int addNetwork(WifiConfiguration config): Add a new network description to the set of configured networks.
  • WifiManager.MulticastLock createMulticastLock(String tag): Create a new MulticastLock
  • WifiManager.WifiLock createWifiLock(String tag): This method creates a new WifiLock.
  • boolean disconnect(): This method disassociate from the currently active access point.
  • boolean enableNetwork(int netId, boolean disableOthers): This method allow a previously configured network to be associated with.
  • int getWifiState(): This method gets the Wi-Fi enabled state
  • boolean isWifiEnabled(): This method return whether Wi-Fi is enabled or disabled.
  • boolean setWifiEnabled(boolean enabled): This method enable or disable Wi-Fi.
  • int updateNetwork(WifiConfiguration config): This method update the network description of an existing configured network.
  • boolean disableNetwork (int netId): Disable a configured network.

In order to scan a list of wireless networks, you also need to register your BroadcastReceiver. It can be registered using registerReceiver method with argument of your receiver class object. Its syntax is given below −

class WifiScanReceiver extends BroadcastReceiver {

   public void onReceive(Context c, Intent intent) {
   }
}
WifiScanReceiver wifiReciever = new WifiScanReceiver();
registerReceiver(wifiReciever, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));

The wifi scan can be start by calling the startScan method of the WifiManager class. This method returns a list of ScanResult objects. You can access any object by calling the get method of list. Its syntax is given below :-


List wifiScanList = mainWifiObj.getScanResults();

String data = wifiScanList.get(0).toString();

Example

Let’s see the simple example of wifi to enable and disable the wifi service.
To run this example you need actual Android device.
  • You will use Android studio to create an Android application under a package net.suven.android.androidwifi.
  • Modify src/MainActivity.java file to add necessary code.
  • Modify the res/layout/activity_main to add respective XML components.
  • Modify the AndroidManifest.xml to add the necessary permissions
  • Run the application and choose a running android device and install the application on it and verify the results.
Following is the content of src/MainActivity.java

package net.suven.android.androidwifi;

import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;


public class MainActivity extends Activity {
Button enableButton,disableButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

enableButton=(Button)findViewById(R.id.button);
disableButton=(Button)findViewById(R.id.button1);

enableButton.setOnClickListener(new OnClickListener(){
public void onClick(View v){
WifiManager wifi = (WifiManager)getSystemService(Context.WIFI_SERVICE);
wifi.setWifiEnabled(true);
Toast.makeText(getBaseContext(), "WiFI Enabled",
Toast.LENGTH_LONG).show();

}
});

disableButton.setOnClickListener(new OnClickListener(){
public void onClick(View v){
WifiManager wifi = (WifiManager)getSystemService(Context.WIFI_SERVICE);
wifi.setWifiEnabled(false);
Toast.makeText(getBaseContext(), "WiFI Disabled",
Toast.LENGTH_LONG).show();
}
});
}
}
Following is the content of activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"

tools:context=".MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView"
android:textSize="30dp"
android:text="ANDROID WIFI"
android:layout_above="@+id/textView2"
android:layout_centerHorizontal="true"
android:layout_marginBottom="11dp" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SCTPL"
android:id="@+id/textView2"
android:textSize="35dp"
android:textColor="#ff16ff01"
android:layout_above="@+id/imageView"
android:layout_centerHorizontal="true" />

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:src="@drawable/suvenlogo"
android:layout_centerVertical="true"
android:layout_alignEnd="@+id/textView" />

<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enable WiFi"
android:id="@+id/button"
android:layout_alignParentBottom="true"
android:layout_toStartOf="@+id/textView2"
android:layout_marginEnd="14dp"
android:layout_marginBottom="56dp" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="76dp"
android:text="Disable WiFI"
android:layout_alignBaseline="@+id/button"
android:layout_alignBottom="@+id/button"
android:layout_alignParentEnd="true"
android:layout_marginEnd="20dp" />

</RelativeLayout>
Following is the content of AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.suven.android.androidwifi">
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Following is the output of Application

android wifi enabled

android wifi disabled
Click here to download Source Code and APK

 Learn Android Programming?


‘Whoa, Whoa’: Fox Panel Goes off the Rails After Guest Suggests FBI Plotted to Assassinate Trump

The right-wing media has lost its mind.

Fox News contributor on Tuesday said that it was possible that the FBI had plotted to assassinate President Donald Trump — although he quickly backed off when “Outnumbered” host Harris Faulkner expressed alarm at his baseless speculation.

Appearing on “Outnumbered,” guest Kevin Jackson said that Congressional Republicans need to get to the bottom of what FBI agent Peter Strzok meant when he said that there needed to be an “insurance policy” in the event that Trump got elected.

Even though the Wall Street Journal reported on Monday that Strzok’s “insurance policy” quote referred to his sincere belief in the need to investigate Trump because he was possibly compromised by Russian intelligence services, Jackson immediately went off the deep end and suggested much darker motives.

“What was his intent, right?” Jackson asked. “Because that’s exactly what FBI Director, former FBI Director [James] Comey said when he was letting Hillary Clinton off the hook. And his intent, regardless of whether it was an assassination attempt or whatever, it was definitely something…”

At this point, a surprised Faulkner interjected and said, “Whoa, whoa!” Jackson then responded by toning his rhetoric down a notch.

“Well, I’m just saying, we don’t know what it was,” Jackson said. “When you say, ‘we’ve got to make sure that this guy doesn’t get in at all cost,’ what does that mean? So I’m saying there’s a spectrum of what does it mean, but one thing that we know for sure, is that he was plotting in an election against a candidate, and there’s FBI fingerprints all over this.”

Later in the segment, Jackson admitted that everything he has heard about FBI plots to kill Trump has come from social media accounts that were “nothing credible.”

Watch the video, via Media Matters, below.

 

Related Stories

  • How Fox News Is Waging ‘Psychological Warfare’ on the American People
  • Intelligence Analyst Malcolm Nance Compares Fox News Rhetoric to ‘Psychological Warfare’
  • Fox News’ Jeanine Pirro Delivers Her Most Disturbing Monologue of Trump’s Presidency

Masters and Servants

If you watch a film or TV series like Downton Abbey, you can learn about how the class structure of society worked a century ago. Many of those concepts of hereditary masters and servants are now completely outdated. But while class borders have become a lot more flexible today, classes still do exist. In today’s economy there are still masters, who are the customers paying for a service, and servants, who then get money for providing those services. Of course the guy who is a servant all day, for example an Uber driver, can come home and become the master by ordering a pizza delivered. But the rich are more likely to receive services, and the poor are more likely to provide those services; we aren’t really much more equal than back in the days of Downton Abbey.

This class divide has also reached games. If you can afford to buy $60 games or spend money in Free2Play games, you get services provided to you. If you play those Free2Play games for free, you end up being the content for other players. It is as if you were paid for providing a service as opponent for another player, only that you don’t get paid in cash but in access to the game.

I don’t like being a servant to a game company. Game companies, like most other companies, treat their customers like royalty, and their employees like garbage. So I don’t want to work for the game company, be the content, provide a service as a cheap replacement of an artificial intelligence. In particular I hate games where even if you pay money, you never can escape from that role as servant, because you always are content for other players.

I just can’t play the new Magic Arena, because it only has a PvP mode. Not only don’t I like serving as content for other players. I also don’t like the content that other players provide to me: Playing against random humans means total unpredictability, you can end up against a complete pushover or the guy who spent hundreds of dollars and hours on the game and is a complete pro. On the one side I feel bad if I play against a human and have to quit early because real life intervenes (which makes the game rather unsuitable for mobile platforms), but on the other side I hate it when my opponent quits early. I much prefer playing against an AI, where there is no social contract, and my opponent plays in a more predictable manner. Previous electronic versions of Magic the Gathering have proven that an AI can be created that plays the game reasonably well. So making a version of Magic without AI to me feels like simple exploitation of players as content, and I’m not willing to be exploited like that.

Advanced Excel Charts: Sooo Muuch Data – Analysis Needed !

Data visualization is the presentation of data in a pictorial or graphical format.

Today, we see data visualization being embraced like never before. Organizations that know and understand it, love its very existence. Since Big Data is a popular lingo in the tech world today across industries ranging from finance to communications, the need to drive better business decisions is the need of the hour. As a result, organizations are looking for better data visualization tools, to turn their essential load of data into something that is more comprehensible.
Excel charts are an efficient means to visualize the data to convey the results. In addition to the chart types that are available in Excel, some application charts are popular and widely used.
The importance of advanced charts
  • They provide consolidated information in a single chart that makes it easier to compare more than one data set and make decisions quickly
  • They allow us to customize the look and feel of the charts
Lets see some important Advanced Charts in Excel:

1. Band Chart

A Band chart is a Line chart with added shaded areas to display the upper and lower boundaries of the defined data ranges.
Band charts provide by far more context to your visualization and more insight into your data. Especially if you have to explore unknown data sets.

Why is a band chart more efficient than a line chart? Because it provides more context. Unlike a single line chart displaying only the development of the selected data series over time, a band chart provides a variety of additional information at a glance.

2. Waffle Chart:

A Waffle chart is a square divided by 10×10 cells. The value is displayed as percentage, so you can clearly see the difference down to 1%.
Pie charts are often criticized because while at the outset they do seem to convey the information, people still have a hard time comparing the angles and sizes of each element.
Making pie healthier resulted in the Waffle chart! A Waffle chart is essentially a squarified pie. Since it does not involve angles, it’s easier for the reader to compare accurately as well as evoke emotional comparisons.
You can use it with just one measure…
or with a category.


3.Heat Map

A Heat Map is a visual representation of data in a Table to highlight the data points of significance.
For example, in the dataset below, I can easily spot which are the months when the sales were low (highlighted in red) as compared with other months.
In the above dataset, the colors are assigned based on the value in the cell. The color scale is Green to Yellow to Red with high values getting the green color and low values getting the red color.

4.Waterfall Chart:

A Waterfall chart is a form of data visualization that helps in understanding the cumulative effect of sequentially introduced positive or negative values.
The columns are color coded so you can quickly tell positive from negative numbers. The initial and the final value columns often start on the horizontal axis, while the intermediate values are floating columns. Because of this “look”, waterfall charts are also called bridge charts.

5.Pareto Chart:

Pareto chart is widely used in Statistical Analysis for decision-making.It represents the Pareto principle, also called 80/20 Rule, which states that 80% of the results are due to 20% of the causes.
A Pareto or sorted histogram chart contains both columns sorted in descending order and a line representing the cumulative total percentage. Pareto charts highlight the biggest factors in a data set, and are considered one of the seven basic tools of quality control as it’s easy to see the most common problems or issues.

Want to learn Data Analytics?

8 Legitimate Grounds for Congress to Initiate Impeachment Proceedings Against Trump

Widespread corruption, abuse of power and a threat to our republic.

As we demonstrate in a new paper, The Legal Case for a Congressional Investigation on Whether to Impeach President Donald J. Trump, based on publicly reported information, as of today there are at least eight grounds for the House of Representatives to authorize the Judiciary Committee to begin hearings on whether to impeach President Donald J. Trump.

This paper presents a legal analysis based on the text, structure and history of the Constitution and federal law, and legal and political precedent, that we have developed in consultation with a wide range of experts over the past ten months. Some of the grounds for investigation are based on violations of specific enumerated constitutional or statutory provisions, but in keeping with the intent of the Founders and the 200-year history of impeachments, other grounds are based on abuses of power that do not fall easily within a specific proscription.

Here are the grounds for investigation.

1. Obstructing justice.

Beginning soon after the inauguration, the president engaged in a course of conduct that sought to obstruct justice in the Federal Bureau of Investigation’s investigations of Lieutenant General Michael Flynn and of his own campaign’s potential involvement with Russian activity in the 2016 election.

2. Violating the Foreign Emoluments Clause and Domestic Emoluments Clause of the U.S. Constitution.

Through his businesses in the United States and abroad, the president receives payments, regulatory approval, and other forms of direct and indirect financial benefits from foreign governments. These violate the Constitution’s Foreign Emoluments Clause, which prohibits federal officials, including the president, from receiving a “present” or “emolument” from any foreign government or official. The president’s businesses also act as a conduit for enrichment from federal and state government coffers. These violate the Domestic Emoluments Clause, which prohibits the president from receiving, beyond his official salary, any emolument from the United States or any state.

3. Conspiring with others to commit crimes against the United States involving the solicitation and intended receipt by his presidential campaign of things of value from a foreign government and other foreign nationals, and to conceal those violations.

In the 2016 election, the senior officials of Trump’s presidential campaign (including his campaign chairman, his son and his son-in-law) met with Russian nationals after an invitation to receive compromising information about his campaign opponent, Hillary Clinton, that they were told would be of great value to the campaign. Federal campaign finance law prohibits a candidate or campaign from soliciting a foreign national (including a foreign government) for a thing of value. In 2017, after this meeting was revealed, President Trump personally dictated a misleading public statement on behalf of his son about the intended purpose of the meeting.

4. Advocating illegal violence, giving aid and comfort to white supremacists and neo-Nazis, and undermining constitutional protections of equal protection under the law.

Over the course of 2017, the president has made a series of public statements that together, constitute a pattern of conduct violating his constitutional obligation to “take care that the laws be faithfully executed,” protect the citizenry against “domestic violence,” and ensure “the equal protection of the laws.”

5. Abusing the pardon power.

The president’s pardon of former Arizona sheriff Joseph Arpaio, who had been convicted of criminal contempt of court for willfully violating a court order to stop violating the constitutional rights of Latino drivers, abused the pardon power by sending the dangerous message that similarly inclined unscrupulous law enforcement officials could not only violate individual rights, but could violate court orders requiring them to stop violating those rights with impunity because the president would support them.

6. Threatening nuclear war against foreign nations, undermining and subverting the essential diplomatic functions and authority of federal agencies, including the Department of State, and engaging in other conduct that grossly and wantonly endangers the peace and security of the United States, its people and people of other nations, by heightening the risk of hostilities involving weapons of mass destruction, with reckless disregard for the risk of death and grievous bodily harm.

Through a series of public statements (including on Twitter), and beginning particularly in the late summer of 2017, the president has made increasingly reckless public threats against North Korea. It is not clear whether President Trump understands the ramifications of his actions. While the president is the commander-in-chief of the armed forces, reckless or wanton conduct with the potential for millions of deaths constitutes an abuse of power.

7. Directing or endeavoring to direct law enforcement, including the Department of Justice and the Federal Bureau of Investigation, to investigate and prosecute political adversaries and others, for improper purposes not justified by any lawful function of his office, thereby eroding the rule of law, undermining the independence of law enforcement from politics, and compromising the constitutional right to due process of law.

The president has repeatedly pressured federal law enforcement to investigate and prosecute political adversaries, including former campaign opponent Hillary Clinton and the Democratic Party. The president’s attempts to employ the criminal investigative powers of the federal government against political opponents for purposes unrelated to national security, the enforcement of laws, or any other lawful function of his office are grounds for impeachment.

8. Undermining the freedom of the press.

The president has repeatedly attacked major U.S. news organizations as “fake news” and the “enemy of the American people.” The president is certainly free to criticize particular news stories he believes are inaccurate, and no one tweet in isolation constitutes an impeachable offense. But his consistent pattern of attacks undermines a critical foundation of a free society.

Purpose of Impeachment

Some of the impeachable offenses discussed in the paper overlap with the criminal investigation of special counsel Robert Mueller; some overlap with other pending federal litigation; others do not overlap with any parallel proceeding. However, as our paper explains, an impeachment investigation is entirely separate from a criminal or other judicial proceeding. The purpose of impeachment is not to punish for past crimes, but to remove from office a dangerous official who threatens the rule of law and the republic itself.

Congress must not use the Mueller investigation or other litigation as an excuse to shirk its duty to conduct its own independent impeachment hearings. The abuse of power, the corruption and the threat to our republic are here now.

 

Related Stories

  • Alabama Stunner: Democrat Doug Jones Defeats Right-Wing Extremist Roy Moore in Photo Finish U.S. Senate Race
  • Alabama Supreme Court Blocks Digital Ballot Preservation in Eleventh Hour
  • Alabama Supreme Court Blocks Digital Ballot Preservation Requirement to Verify the Vote in Tuesday’s Senate Election

5 Holiday Tips on How Not to Get Arrested in New York City

This is just common sense stuff, but let’s review it anyway, shall we?

 

 

5 Holiday Tips On How Not To Get Arrested In NYC

Many people come to New York City for the holidays. … it, smoking marijuana in public is not legal. Personal possession has been decriminalized, but that doesn’t mean you can smoke it in public. Never smoke a joint on the streets of NYC. You risk being arrested …

 

Related Stories

  • How Safe Is It To Smoke Marijuana Every Day?
  • These Are the Best Pot Products in 2017
  • Treasure Hunt: 9 Ways Scientists Are Targeting the Endocannabinoid System With Synthetic Drugs and Isolates

Rage of Demons: Session 1

I am member of a local role-playing game club. As part of our club activities in December I organized a session of “5th edition Dungeons & Dragons for Beginners”. That way I met a group of young (adult, but half my age) people who were very much interested to play more D&D. So I started a full regular campaign with them.

I asked them what genre of fantasy they would prefer, from the generic heroic fantasy, to less heroic dark fantasy, the gothic horror fantasy of Ravenloft, or even the steam punk fantasy of Zeitgeist. They opted for dark fantasy, which left me with not much choice based on what little material I had for that in 5E: The Rage of Demons campaign, which consists of only the Out of the Abyss campaign book. As there was already another Out of the Abyss campaign in the club (and another one based on that book in which I had participated as player before it went dormant), I preferred to use the Rage of Demons title to avoid confusion.

As I posted a few weeks ago, I had to turn a not-so-great experience as a player of Out of the Abyss into a a much better appreciation of that book by better understanding how it was supposed to be played. Once I got the basic recipe down (follow the chapters in strict linear order, but improvise as much as you can within each chapter), the campaign appeared doable. So I started preparing, and this week we played our first session.

Out of the Abyss has the least subtle start imaginable for an adventure, the much overused “you start the game near naked and in prison”. As the players had played the start of Lost Mines of Phandelver with me and wanted to keep their characters, I needed to get them into that prison. (The DM I had played with had avoided that start, and that turned out to be very detrimental to the story.) As we had ended in the middle of a dungeon, the Red Brand hideout, I simply told them that in the next room they had encountered not just the boss of that hideout, the mage Glasstaff, but also a drow priestess with six elite drow bodyguards. The drow had then quickly incapacitated everybody with their poisoned hand crossbows, and carried them off as slaves. Well, they had said they wanted dark, so they got dark. 🙂

The reason you need to start in the prison is so that you can encounter all the wonderful NPCs there, ten fellow prisoners. There is everything from a deep gnome with a betting habit, to a Yoda-like kuo-toa pacifist hermit and a hairy monster claiming to be an elf prince. I explained to the players the basic principle of interactive story-telling in D&D: As the DM I was setting the scene, which includes some obvious story goals like in this case escaping the prison. But it was up to them to come up with a plan on how to escape, who to take with them, and what means to use. I must say that ended surprisingly well, with them showing a lot more initiative than my regular group of old timers.

I used the NPCs to give the group an overview of the locations of the Underdark. The closest town from the drow outpost is the kuo-toa village of Sloobludop. Buppido the derro told them that from there they could cross the Darklake and get to his home town of Gracklstugh, where he claimed that in a tunnel system called the Whorlstone Tunnels there was a way to the surface. That gave them a general idea on how to proceed after the escape.

Due to there being several female players, I played up the matriarchy of the drow, so the male slaves were doing laundry and kitchen duty, while the women were doing heavy manual labor. That led to one NPC, an orc named Ront, getting killed by the drow for tearing the priestess’ underwear, and the warrior of the group being forced to feed Ront’s remains to the giant spiders. I think I got the message across that the drow are cruel bastards.

The group’s cleric had written for himself a background story where his temple had done a forbidden ritual that got most of them killed, and him with a scarred face, wearing a mask. I turned that ritual into a summoning of Juiblex, and his injury into an acid burn. And io and behold, while doing kitchen duty the cleric saw one of the elite drow with similar acid burns. Based on that connection he could persuade that drow to help, and ultimately got the key to their cell from that (although the drow clearly cared more about hurting his boss than helping them). Meanwhile the ranger managed to pickpocket the smaller key to their chains from another drow. That precipitated their attempt escape, when they heard from other drow that there would be an inspection the next day, where the missing key would be noticed.

The keys got them out of their chains and cell, but the outpost was built high up the wall of the cave with only a well-guarded elevator to connect to the floor. And they had absolutely no equipment. So they decided that part one of the plan was to attack the guard tower in front of their cells, where only one elite drow and two regular drows stood guard. They had the good idea (I might have nudged them a bit in the right direction) to use the fact that the other way to the guard tower was a hanging bridge, to try to cut the ropes of that bridge. The first rope cut made quite some noise, so the combat began with the drow looking out the far door of the guard tower to see what was happening, and one regular drow getting pushed of the ledge by the warrior rushing in through the other door.

The fight was rather tough, a group of level 2 characters against a drow elite warrior of challenge rating 5 having two attacks each round and poisoned weapons. The warrior went down early, but got healed back up; fortunately the group has three people with healing spells, a cleric, a druid, and a ranger. The drow then outright killed one of the NPCs, the dwarven scout Eldelth, who had wisely asked the group before that in the event of her death they would carry word to her family in Gauntlgrym. During the fight the sorceress and drow NPC managed to cut the rope bridge, preventing drow reinforcements. The druid meanwhile had gone up to the store room and dropped weapons for them from there. So ultimately the group prevailed, got decently equipped (although not finding their initial equipment back), found ropes, and used those to escape from the drow outpost. We decided to stop there and play the rest of the escape and pursuit the next session.

How to get into great shape with a fitness tracker in just 7 minutes… a day

For many, the reality of owning a fitness tracker doesn’t quite live up to the hype. Maybe it just quietly counts your steps without actually having impact on your fitness. Maybe you stopped wearing it after the first couple of weeks. They say “that which is measured, improves,” but in my experience you also have to actually do something in order to see results.

The problem is not lack of will or a poor metabolism. It comes down to time. You’re busy. We all are!

Fortunately, I’m the Android guy who believes he can get anything done in just 7 minutes. And I can. Just ask my wife.

Here’s how to get in shape by using your fitness tracker for just 7 minutes (per day).

The theory

Fitness trackers are much more than just step counters. They can carefully monitor athletic performance, health and fitness, and feed you the raw data you need to transform your physique. This kind of technology was once the reserved for professional athletes, so it’s almost criminal not to use it to its fullest.

This kind of technology was once the reserve of professional athletes

First, it’s important to define our goals. My promise here was that you would be able to “get into great shape.” By that, I mean fitter and healthier, leaner, and more athletic. Lofty aims for 7 minutes, but I’m sure we can achieve it.

Next we need to create an athletic profile based on your current stats, so we know what to aim for. This is where the use of technology will first come in very handy.

Editor’s Pick

We are going to work on your ‘lactate inflection point’ or ‘lactate threshold’ (essentially, your anaerobic threshold). This is the point at which your body switches to an anaerobic state, where you tax your body so much that your aerobic system can’t deliver energy fast enough. In other words, burning fat and bringing it to the muscle is taking too long and so your body has no option other than to burn sugar from elsewhere. During anaerobic exercise we switch to the lactic acid system, which uses blood sugar and glycolysis to provide us with usable energy (ATP).

This is the central concept behind High Intensity Interval Training (HIIT). HIIT uses short bursts of intense activity, followed by short periods of relative recovery. That could mean sprinting for a minute, then jogging slowly for a minute, then sprinting for a minute again. This forces the body to switch between its aerobic and its anaerobic systems, so that one moment you are burning fat and the next moment you are burning glucose from your blood.

Fitbit Ionic review

Switching to an anaerobic state is highly beneficial for weight loss and performance because it removes the stored glucose in your muscles and blood, forcing your body to subsequently burn more fat. This is sometimes referred to as the ‘afterburn effect’ and studies show it results in greater fat loss over time.

The lactate inflection point is also the point at which your body starts to increase in acidity (due to an increase in hydrogen ions), resulting in the ‘burn’. This is what keeps you from remaining in an anaerobic state and forces you back to the ‘cleaner’ aerobic state.

“Anaerobic threshold training” will help you to increase your threshold and your body’s ability to use lactate as a fuel source, so you can run faster and longer. It can even improve your tolerance in this state, allowing you to go all out for longer. A highly trained athlete may be able to sustain activity at 90 percent of their maximum heart rate.

See also: Best GPS running watches | Garmin vívosport review

HIIT also has a host of other benefits. It increases your VO2 Max, the volume of oxygen you can use during a workout, which in turn can be used to predict athletic performance; mitochondrial density, the number of energy producing units in your cells; and brain power. Some recent studies even suggest it can help to turn back the clock and rejuvenate damaged cells.

Some recent studies even suggest that HIIT workouts can help to turn back the clock and rejuvenate damaged cells.

A lot of people use HIIT but don’t actually enter an anaerobic state, so they aren’t getting the most out of it. It’s kind of the whole point of HIIT. By using your fitness tracker to calculate and then monitor your state this way though, it’s possible to maximize the results from a much shorter workout.

A 7 minute workout, in fact.

You’ll get all those benefits, including increased weight loss, better athletic performance, and anti-aging, in just that short amount of time.

The 30 minute test

Related

Grab your Fitbit, Garmin, or whatever else, and get ready for the 30 minute test. Ideally, you want the most accurate heart rate tracking possible, so I recommend using an external heart rate monitor from a brand like Polar. If you haven’t got one, a wrist worn tracker will do for now.

The 30 minute test involves running, cycling or anything else aerobic as fast as possible for a full, uninterrupted 30 minutes. Yes, it’s pretty brutal. Make sure to set the lap button on your tracking device to 10 minutes and then stop after 30 minutes.

The average heart rate for the last 20 minutes is going to be your LTHR, or your Lactate Threshold Heart Rate. This is your heart rate at the lactate inflection point. It’s the most you can sustain for a prolonged period. Therefore, this is the heart rate you are aiming for during your training.

It’s not a perfect test, but many trainers use it to decent effect. You’ll need to make sure that you re-measure about once every 6 weeks as your threshold improves.

Keep in mind this is a tough workout and it’s only advisable for those that already have a base level of fitness. If you have any concerns about your health, consult a doctor first. If you just don’t want to go through the test, you can roughly estimate your lactate threshold at around 70 or 80 percent of your MHR, depending on your fitness level.

The 7 minute workout

With this in mind, we can now begin our 7 minute workout. The aim is to spend as much time as possible above our lactate threshold.

I recommend choosing a form of ‘resistance cardio’ to use for your exercise. Running can be counterproductive for this, as it takes 7 minutes just to put on your shoes and leave the house. What’s more, choosing resistance cardio (a form of cardio where you’re pushing or pulling against resistance) will tone and firm up muscle while burning fat. This will lead to greater fat burning in the long term, seeing as muscle is more metabolically active than fat. Toning is as important as fat burning – if not more – when it comes to body recomposition.

Not only that, but using resistance allows you to reach your anaerobic threshold quicker, because it takes more energy to complete the movements. Finally, it will protect your muscles against being cannibalized for fuel (BCAAs can help with that too).

More: How to use your fitness tracker to get fit – a comprehensive guide

A great option is to use battle ropes. These are heavy ropes which you can beat against the ground in order to tone muscle in the shoulders and arms while burning fat. Kettlebell swings are also fantastic and will help to build your posterior chain for explosive power. Switching between the two could give more of a full-body workout, and make the heart work harder too.

This is the routine you will follow to begin with:

  • 30 second warm up
  • 1 minute fast
  • 30 seconds recovery
  • 30 seconds fast
  • 1 minute recovery
  • 30 seconds fast
  • 1 minute recovery
  • 30 seconds fast
  • 1 minute recovery
  • 30 second cool down

Constantly check your fitness tracker to make sure you’re really hitting that zone and going above it (most people can sustain effort above their LTHR for about 20-40 seconds). You can watch your wrist to ensure you’re actually reaching that point and set heart rate zones on many devices in order to be alerted when entering and exiting that state.

This workout will change over time, and you’ll spend more and more time in your LTHR. As you get more confident, you can also reduce your recovery periods. It’s worth retesting your LTHR about once every 6 weeks.

Don’t worry if you don’t like my workout, there are plenty of HIIT workouts out there – in fact there are plenty of 7 minute HIIT workouts right on the Play Store.

For those with more than 7 minutes to train, this form of exercise works excellently at the end of your regular routine. You can use it at the end of a workout in order to add cardio benefit and lean up without damaging muscle gains.

If you don’t like my workout, there are plenty of other HIIT workouts out there – in fact there are plenty of 7 minute HIIT workouts right on the Play Store. It’s down to you to ensure you’re working hard enough.

Losing weight

This routine is all well and good, but doesn’t guarantee weight loss. Calories in and out are a huge factor in this. If you consume more calories than you burn (called a calorie ‘surplus’), you gain weight. If you burn more than you consume (called a ‘deficit’), you lose weight.

If you use this 7 minute HIIT workout daily but you also increase the amount you eat threefold, then it’s not going to help you lose weight. If you make sure that you are eating less than you burn during the day—taking the HIIT into account—you’ll lose weight.

There are other strategies to this, like fasting to ramp up your metabolism, but the easiest and most practical strategy is just to lower your food intake.

Fortunately, the device on your wrist can keep track of precisely how many calories you are burning and the one in your pocket for can keep track of how many you are taking in. That way you can ensure all the hard work pays off in the abs department.

You have a device on your wrist that you can use in order to know precisely how many calories you are burning and one in your pocket for how many you are taking in

My Fitness Pal will allow you to log all the calories you consume simply by scanning bar codes or entering the values manually (found on the back of the packaging). Regular items will be available from a handy list so you don’t need to keep scanning them. Once you’ve used it for a few days, it gets much quicker. Quick tip: dieting is a lot easier when you maintain somewhat consistent eating habits. This way, there are fewer confounding variables.

Syncing My Fitness Pal with Garmin Connect, S Health, or other apps will help you see a log of all the calories going in and coming out. If your 7 minute workout was intense enough, you might find that you manage to maintain that deficit without making any drastic lifestyle changes. Otherwise, walk a little extra, eat a little less, and use your devices to keep tabs on it all.

Wrapping up

A fitness tracker can be much more than just a fancy pedometer. Let me know in the comments down below how you’ve been using yours to stay in shape.

Test Your SQL Basics – Part_1

The SQL SELECT Statement Questions

1. Determine the output of the below query
SELECT ‘6+9’  FROM dual;
A) 15
B) 6+9
C) 6
D) 9


2. At least how many clauses must be present in a SELECT statement?
A) 0 (Zero)
B) 1
C) 2
D) 5


3. Which of the following statement is correct?
A) EVERY table expression is a part of SELECT statement
B) Each SELECT statement does not consist of a table expression
C) Every SELECT statement is built from a table expression
D) All of the above


4. Which of the following are the optional clauses?
A) SELECT and WHERE
B) WHERE, GROUP BY and ORDER BY
C) SELECT, WHERE and ORDER BY
D) SELECT, WHERE, ORDER BY and GROUP BY


5. Which of the following is the last clause that is executed in a query?
A) SELECT
B) FROM
C) WHERE
D) GROUP BY


6. Which of the following is the correct basic syntax of SELECT clause?
A) SELECT column1, column2,….columnx WHERE table_name;
B) SELECT column1, column2,….columnx
C) SELECT column1, column2,…columnx ORDER BY table_name;
D) SELECT column1, column2,…columnx FROM table_name;


7. Determine the output of the below query
SELECT 36/2-5*10 FROM dual;
A) 130
B) -32
C) -120
D) 175


8. Determine the output of the below query
SELECT sal + NULL FROM emp WHERE empno = 7369;
A) sal + NULL
B) NULL
C) 0
D) 1250


9. Which command is used to display the structure of a table?
A) LIST
B) SHOW
C) DESCRIBE
D) STRUCTURE


10. Predict the output of the below query
SELECT 50 || 0001 FROM dual
A) 500001
B) 51
C) 501
D) 5001


Answer
1-B,   2-B,   3-C,   4-B,  5-D,   6-D,   7-B,   8-B,   9-C,  10-C

function myFunction() { var x = document.getElementById(‘myDIV’); if (x.style.display === ‘block’) { x.style.display = ‘none’; } else { x.style.display = ‘block’; } }


Restricting and Sorting Data Questions

1. What are the elements NOT contained in the WHERE clause predicate of the SELECT query?
A) Comparison operator
B) Comparison condition
C) Column Name
D) Table Name

2. Which of the following values can NOT be returned after evaluation of WHERE clause condition?
A) UNKNOWN
B) TRUE
C) FALSE
D) NULL

3. Which of the following statements are correct about the WHERE clause?
A) Column Alias can be used in WHERE clause to refer a column
B) Comparison operator is an optional element in WHERE clause condition
C) Functions can be used as operands in the WHERE clause
D) There can be multiple WHERE clause in a SELECT query

4. From the below operators, which one of them holds the highest precedence level?
A) Division (/)
B) Multiplication (*)
C) Brackets ( () )
D) Subtraction

5. What does the selection of columns in a SELECT statement known as?
A) Retrieval
B) Selection
C) Projection
D) Limiting

6. Which of the following WHERE clauses will NOT fit in the below SELECT query?
SELECT ename, deptno, sal  FROM emp;
A) WHERE HIREDATE IN (’02-JUN-2004′);
B) WHERE SAL IN (‘1000′,’4000′,’2000’);
C) WHERE JOB IN (SALES,CLERK);
D) WHERE COMM BETWEEN 0.1 AND 0.5;

7. Choose the WHERE clause that extracts the DNAME values containing the character literal “er” from the DEPT table.
A) WHERE DNAME IN (‘%e%r’);
B) WHERE DNAME LIKE ‘%er%’;
C) WHERE DNAME BETWEEN ‘e’ AND ‘r’;
D) WHERE DNAME CONTAINS ‘e%r’;

8. Which of the following is used to end a SQL query?
A) :
B) ;
C) .
D) /

9. What is the default date format in Oracle?
A) DD-MON-YY
B) DD-MON-YYYY
C) DD-MM-RR
D) DD-MON-RR

10. Which of the following clause defines a Membership condition?
A) BETWEEN
B) LIKE
C) IS NULL
D) IN (NOT IN)


Answer
1-D,   2-A,   3-C,   4-C,  5-C,   6-C,   7-B,   8-(B,D),   9-D,  10-D

function unris() { var x = document.getElementById(‘myDIV2’); if (x.style.display === ‘block’) { x.style.display = ‘none’; } else { x.style.display = ‘block’; } }


Using Single-Row Functions Questions

1. What will be the outcome of the following query?
SELECT ROUND(144.23,-1) FROM dual;
A) 140
B) 144
C) 150
D) 100


2. Which of the following statements is true regarding the COUNT function?
A) COUNT (*) counts duplicate values and NULL values in columns of any data type.
B) COUNT function cannot work with DATE datatypes.
C) COUNT (DISTINCT job_id) returns the number of rows excluding rows containing duplicates and NULL values in the job_id column.
D) A SELECT statement using the COUNT function with a DISTINCT keyword cannot have a WHERE clause.


3. Which of the following commands is used to count the number of rows and non-NULL values in Oracle database?
A) NOT NULL
B) INSTR
C) SUBSTR
D) COUNT


4. What will be the outcome of the query given below?
SELECT 100+NULL+999 FROM dual;
A) 100
B) 999
C) NULL
D) 1099


5. Determine the output of the below query.
SELECT RPAD(ROUND(‘78945.45′),10,’*’) FROM dual;
A) 78945*****
B) **78945.45
C) The function RPAD cannot be nested with other functions
D) 78945.45****


6. Which of the following commands allows you to substitute a value whenever a NULL or non-NULL value is encountered in an SQL query?
A) NVL
B) NVLIF
C) NVL2
D) LNNVL


7. What is true about the NULLIF function in Oracle DB?
A) NULLIF(expr1,expr2) will return expr2 if the two expressions are NOT NULL.
B) NULLIF(expr1,expr2) will return 0 if the two expressions are NULL.
C) NULLIF(expr1,expr2) will return NULL if the two expressions are equal.
D) Expr1 can be NULL in NULLIF(expr1, expr2)


8. Which of the following is not a property of functions?
A) Perform calculations on data
B) Convert column data types
C) Modify individual data items
D) None of the above


9. Which of the following are also called Group functions?
A) Single row functions
B) Multi group functions
C) Multiple row functions
D) Single group functions


10. What is true about Number functions?
A) They return both Character as well as Number values
B) They can’t accept expressions as input
C) Number functions can’t be nested.
D) They accept Number arguments and return Number values only.

Answer
1-A,   2-A,   3-D,   4-C,  5-A,   6-C,   7-C,   8-D,   9-C,  10-D

function resti() { var x = document.getElementById(‘myDIV3’); if (x.style.display === ‘block’) { x.style.display = ‘none’; } else { x.style.display = ‘block’; } }


Conditional Expressions Questions

1. What is true about data types in Oracle DB?
A) They are given to columns for sorting purposes.
B) They are given to columns for a structured representation in a table.
C) They are given to columns to constrain the nature of the data it can store.
D) They are not mandatory.


2. Which of the following functions simplify working with columns that potentially contain null values?
A) Nested functions
B) General functions
C) Conditional functions
D) None of the above


3. How many input parameters are mandatory in NVL function?
A) 0
B) 1
C) 2
D) 3


4. What will be the output of the following query?
SELECT NVL(1234) FROM dual;
A) 1234
B) 1000
C) NULL
D) ORA-00909:invalid number of arguments error


5. What happens during an implicit conversion in Oracle DB?
A) Oracle DB implicitly converts one data type to the expected data type
B) The user has to convert the data type to the expected data type
C) Oracle DB doesn’t convert any data type
D) Implicit conversion can be controlled by the user


6. Which of the following expressions can be used explicitly for a conversion of a NUMBER to a CHAR?
A) TO_CHAR
B) Use TO_DATE and then convert the date to a NUMBER
C) TO_NUMBER
D) Such conversion is not possible


7. Which of the following are the functions for explicit conversion provided by Oracle to convert one data type to the other?
A) TO_CHAR
B) TO_DATE
C) TO_NUMBER
D) All of the above


8. Which of the following is true about the following statement in Oracle DB?
TO_CHAR(date, ‘frmt’)
A) The fmt can be written in double quotes as well as single quotes.
B) Case of the fmt doesn’t matter in this function
C) Fmt can include any character or NUMBER
D) The fmt has to be enclosed in single quotes and has to be a valid date format.


9. How many maximum places for display will Oracle DB allocate to the Month element in the following statement?
SELECT TO_CHAR (sysdate, ‘fmMonth’) FROM dual;
A) 5
B) 6
C) 7
D) 9


10. What is true about the COALESCE function in Oracle DB?
A) It can take only 2 arguments
B) All the arguments in the COALESCE function can be of different data types
C) All the arguments in the COALESCE function should be of the same data type
D) None of the above


Answer
1-C,   2-B,   3-C,   4-D,  5-A,   6-A,   7-D,   8-D,   9-D,  10-C

function condi() { var x = document.getElementById(‘myDIV4’); if (x.style.display === ‘block’) { x.style.display = ‘none’; } else { x.style.display = ‘block’; } }


Learn Database Programming?