Why Your Opinion Matters & Why You Shouldn’t Fear Having One



Think for a second about every history class you’ve ever had. Think about all the change that has happened between the different time periods you learned about. Where would we be if someone hadn’t thought that there was a better way to do something than the current way? Would we still be building houses of clay and using stone tools? Someone had to advocate for this change. Someone had to believe or have the opinion that it was necessary and most people probably disagreed with him at the time.

We all have opinions. Some of us have no inhibitions sharing them with total strangers on the internet or via social media. In some circumstances, two very different opinions collide and all hell breaks loose. And this happens on a daily, sometimes hourly basis.We all have opinions. Some of us have no inhibitions sharing them with total strangers on the internet or via social media. In some circumstances, two very different opinions collide and all hell breaks loose. And this happens on a daily, sometimes hourly basis.

Having opinions is healthy. It indicates a progressive nature – one which signifies that we are improving to be better, better educated, more knowledgeable people. But because everyone has opinions, everyone thinks they are deserving of being heard, applauded, agreed with, admired and liked for their opinions. The keyword here is “deserving”, and they will fight, troll, insult, provoke and lie to turn their opinion into the common truth.Having opinions is healthy. It indicates a progressive nature – one which signifies that we are improving to be better, better educated, more knowledgeable people. But because everyone has opinions, everyone thinks they are deserving of being heard, applauded, agreed with, admired and liked for their opinions. The keyword here is “deserving”, and they will fight, troll, insult, provoke and lie to turn their opinion into the common truth.

Does that mean you have to stop having opinions? Of course not, but there are a few things we should address when it comes to opinions.Does that mean you have to stop having opinions? Of course not, but there are a few things we should address when it comes to opinions.

Facts vs Opinions

A fact is a statement that is true and can be verified objectively, or proven. In other words, a fact is true and correct no matter what. An opinion, however, is a statement that holds an element of belief; it tells how someone feels.

Fact:
  • Dogs have fur.
  • The Beatles were a band.
  • The last day of school is May 22nd.
Opinion
  • Dog fur is pretty.
  • The Beatles sang great songs.
  • May 22nd is the best day of the year.

Opinions Can Change

Why is it so hard to have an opinion on the Internet? My theory is that it is written down: in your timeline, your blog, in your chat history somewhere. The problem with social media is that your past opinions can come back and haunt you.


The thing is, whatever opinions, stances or views you subscribed to when you were 15 may not be the same as when you are 40. People change, so do opinions. And while it is harder to hold verbal opinions against someone, an inked opinion is pretty hard to shake off. And no one is safe from this, not even celebrities.

Opinions Could Be Wrong

Let’s address wrong opinions. Many arguments last longer than necessary because of a dedicated section on how the arguer is entitled to their opinions, how it is a” freedom of speech” thing, and how as long as it makes them happy, they can say whatever they want.

We’re not children. We don’t come to school the next day and play together at the playgrounds again, totally forgetting the previous day’s fights and arguments. We remember hurtful insults and rude comments and ignorant rants, and that label you used to totally strip another person’s identity down to the bare bones.



Being entitled to an opinion does not automatically make the opinion right. It does not reduce the hurt from name-calling or make things okay just because “you didn’t mean it that way”. If you want to fight to the death for your opinion, remember that you have to be accountable for how you deliver that opinion, and that there is still a possibility of you being proven wrong.

Opinions Need Context

Face it, in every argument there is someone who is probably wrong and the other person is therefore, by elimination and definition, right. Why in the world would arguments drag out so long then? Because of context.

That’s right. Opinions need context. Many arguments cannot be resolved because the people involved in the argument are basing their opinions on different contexts.

You can’t generalize with opinions. They all take shape in this bubble of conditions that we call context. When talking about topics like abortions, gay marriage, women CEOs, self-driving cars, artificial intelligence, searching for and contacting alien life, bear in mind that all these topics have potential for controversy and that’s the kind of place where everyone has an opinion.

And depending on their context, everyone’s opinion may be right.

Opinions Label You

There are a lot of cliques, gangs and groups online: Android or Apple, PC or Console, Chrome or Firefox; here are more tech battles you can check out. And like all great battles, there are plenty of passionate people on both sides of the war.

When you have an opinion that aligns yourself to a group or faction, you run the risk of mistaking this sense of acceptance and belonging as who you are. You get reduced down to a label, when in fact you have a personality that is so much more complex and too complicated to be summarized by a single label such as feminist, hipster, fanboy, or housewife.

Beware of parroting opinions that you don’t believe in, in order to be accepted by the crowd. You have your own set of opinions, formed by your life experiences, by the things you read, by the conversations you have, and you deserve to let that surface.

Reject the labels. You can care about more than two things at a time, and just because you are a hipster or a housewife, it doesn’t diminish the opinion you have to share with the rest of the world.

Your Opinion Matters

Opinions can and will evolve; sometimes at the risk of reshaping your reputation and credibility. And as much as you are entitled to them, don’t hold on to them too tightly. Opinions have a way of being infused with our dignity – it makes us think that if we change our opinion, them we’re flimsy or weak, when in fact it is a very natural process, kind of like growing up.

Just make sure that your opinion rocks, and don’t be afraid to share it.

Visit Us

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.

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?

Understanding Synchronous and Asynchronous JavaScript – paRt_2: JavaScript – its DiFFereNt


In the first part of this post, we saw how the concepts of synchronous and asynchronous are perceived in JavaScript. In this second part, Mr K appears again to help us understand how the setTimeout() and AJAX APIs work.


Let’s go back in past to the story of Mr. K and the date you wanted to go on! but what if you leave a task for Mr. K before outing and tell him that he can only begin to work on this task five hours after he got your message. 
He isn’t happy about it! But why does Mr H leave a message in the queue instead of directly contacting Mr K? Because as I mentioned in the first part, the only way to contact Mr K is by leaving a message to him via phone call — no exceptions., remember, he doesn’t take a new message until he is done with the current one, and if he takes yours, he has to wait for five hours to even start on the task. So, to not be wasteful of time, he brings in a helper, Mr H.
Instead of waiting, he asks Mr H to leave a new message for the task in the queue after the given hours had passed, and moves on to the next message.
Five hours past; Mr H updates the queue with a new message. After he’s done processing all the accrued messages prior to Mr H’s, Mr K carries out your requested task. So, this way, you can leave a request to be complied upon at a later time, and not wait until it’s fulfilled.

1:-> The setTimeout() method

Suppose you have a set of code that you want to execute after a certain time. In order to do that, you just wrap it in a function, and add it to a setTimeout() method along with the delay time. The syntax of setTimeout() is as follows:
  • setTimeout(function, delay-time, arg…)
The arg… parameter stands for any argument the function takes, and delay-time is to be added in milliseconds. Below you can see a simple code example, that outputs “hey” in the console after 3 seconds.
  • setTimeout( function() { console.log(‘hey’) }, 3000 );
Once setTimeout() starts running, instead of blocking the call stack until the indicated delay time is over, a timer is triggered, and the call stack is gradually emptied for the next message (similarly to the correspondence between Mr K and Mr H).
When the timer expires, a new message joins the queue, and the event loop picks it up when the call stack is free after processing all the messages before it — thus the code runs asynchronously.

JavaScript call stack with timer
JavaScript call stack with timer

2:-> AJAX

AJAX (Asynchronous JavaScript and XML) is a concept that uses the XMLHttpRequest (XHR) API to make server requests and handle the responses.
When browsers make server requests without using XMLHttpRequest, the page refreshes and reloads its UI. When the processing of requests and responses are handled by the XHR API, and UI remains unaffected.

XMLHttpRequest we API
XMLHttpRequest we API

XMLHttpRequest Web API

Now, where is the “asynchronous” in this! Just using XHR code doesn’t mean it’s AJAX, because the XHR API can work in both synchronous and asynchronous ways.
XHR by default is set to work asynchronously; when a function makes a request using XHR, it returns without waiting for the response.
If XHR is configured to be synchronous, then the function waits until the response is received and processed before returning.

Code Example 1

This example presents an XMLHttpRequest object creation. The open() method, validates the request URL, and the send() method sends the request.

Asynchronous XHR

var xhr = new XMLHttpRequest();
xhr.open(“GET”, url);
xhr.send();
Any direct access to the response data after send() will be in vain, because send() doesn’t wait until the request is completed. Remember, XMLHTTPRequest is set to work asynchronously by default.

Code Example 2

The hello.txt file in this example is a simple text file containing the text ‘hello’. The response property of XHR is invalid, since it didn’t output the text ‘hello’.

Asynchronous XHR

var xhr = new XMLHttpRequest();
xhr.open(“GET”, “hello.txt”);
xhr.send();
document.write(xhr.response); // empty string
XHR implements a micro-routine that keeps checking for response in every millisecond, and triggers complimentary events for the different states a request goes through. When the response is loaded, a load event is triggered by XHR, which can deliver a valid response.

Asynchronous XHR

var xhr = new XMLHttpRequest();
xhr.open(“GET”, “hello.txt”);
xhr.send();
xhr.onload = function(){ document.write(this.response) } // writes ‘hello’ to the document
The response inside the load event outputs ‘hello’, the correct text.
Going the asynchronous way is preferred, as it doesn’t block other scripts until the request is completed.
If the response has to be processed synchronously, we pass false as the last argument of open, which flags the XHR API saying it has to be synchronous.

Synchronous XHR

var xhr = new XMLHttpRequest();
xhr.open(“GET”, “hello.txt”, false);
xhr.send();
document.write(xhr.response); // writes ‘hello’ to document

Conculsion

If you know how the puzzle fits, you can avoid confusion of stTimeout() and AJAX requests. You know that the delay time in setTimeout() does not indicate the time when the code execution starts, but the time when the timer expires and a new message is queued, which will only be processed when the call stack is free to do so.

Learn WebTechnology with Us!

Galaxy S8’s fourth Android Oreo beta disables use of third-party docks with Samsung DeX

The Galaxy S8 and S8 Plus might be more known for their near bezel-less designs, but one feature that isn’t nearly as talked about is Samsung DeX, which turns the phone into pseudo-desktops. Unfortunately for those who found the feature useful, the fourth Android Oreo beta prevents it from working with third-party docks.

According to XDA Developers, users are reporting that, when they connect their devices to third-party docks, Samsung DeX no longer pops up. Instead, connecting their Samsung smartphones to these docks only mirrors the smartphone display.

This is an interesting change, seeing how using Samsung‘s official DeX dock was not the only way to get the feature up and running. For example, back in September, someone turned a 2008 MacBook Pro into an almost fully-functional DeX laptop. Also, folks found out that they could connect the Galaxy S8 to the HP Elitebook X3, which was made to work with HP’s Elite X3 smartphone, and have Samsung DeX work just fine.

Editor’s Pick

It’s a somewhat depressing move on Samsung’s part, seeing how the company has also prevented folks from remapping the Bixby button. I understand that Samsung wants to sell as many DeX docks as possible, but if you want as many people as possible use the feature, why hinder the ability to do so?

XDA Developers brings up the point that Huawei’s Mate 10 and Mate 10 Pro offer a DeX-like feature of their own, except that the phones do not require the use of a dock to make it work — all you need is a USB 3.1 Type-C cable. Maybe we’ll get to the point where Samsung doesn’t require a dock to have DeX work, but until then, I will continue to frown.

Of course, Samsung can change its mind once the final Android Oreo release rolls around, though we’ll keep an eye out if that’s the case.

Do you use Samsung DeX with your Galaxy S8, S8 Plus, or Note 8? If you do, do you find the feature useful? Let us know in the comments below.

Working with Microsoft SQL Server


MS SQL Server


What is SQL Server Management Studio?

SQL Server Management Studio (SSMS) is the main administration console for SQL Server.


SSMS enables you to create database objects (such as databases, tables, stored procedures, views etc), view the data within your database, configure user accounts, perform backups, replication, transfer data between databases, and more.

Fig 3 : SSMS Console Window


User Login :


When creating a new user login, the administrator can assign that login to any number of roles and schemas. This will depend on what that particular login is entitled to.


Create a New Login

Step 1 :  Using SQL Server Management Studio, expand the Security option (at the
server level, not at the database level) and right click n Logins.

Step 2 :  Click on New Login.

Step 3 :   Complete the login properties in the General tab by providing a name for the login, choosing the Authentication method (providing a password if you choose SQL Server authentication), and selecting the database to use as a default.

Step 4 :   Click the Server Roles tab if you need to apply any server-wide security privileges.


Step 5 :
Click the User Mapping tab to specify which databases this user account is allowed to    access. By default, the login will be assigned to the Public role, which provides the login with basic access.
 If the login needs more access in one or more databases, it can be assigned to  another role with greater privileges. In this case, select Task Tracker database  and  db_owner role for that database.
Step 6 :  Click OK to create the login.


NOTE :
These roles are database roles and are different to the server roles in the previous tab. Server roles are for administering the SQL Server. Database roles are more limited. They are created within each database and specify what the login can do within that particular database.




Fig : Server Roles

Server Roles :


When we created a SQL Server login, we had the option of assigning the login one or more server roles. Server roles (not to be confused with database roles) are available to manage permissions on a server.


View the server roles in SSMS, from the Object Explorer, expand the Security folder







Database :

A database is a collection of information that is organized so that it can be easily accessed, managed and updated.
Creating a database can be done by running a SQL script or by “point and click”. 


System Databases

When you install SQL Server, the following four databases are created.
1.master
This database stores system level information such as user accounts, configuration settings, and info on all other databases.
2.model
This database is used as a template for all other databases that are created.
3.msdb
The msdb database is used by the SQL Server Agent for configuring alerts and scheduled jobs etc
4.tempdb


This one holds all temporary tables, temporary stored procedures, and any other temporary storage requirements generated by SQL Server.  


Create Database :

Fig 4 : Create DB 
The following steps demonstrate how to create a database in SQL Server 2014 using SQL Server Management Studio.

Step 1 : From the Object Explorer, right click on the Databases folder/icon and select New Database

Step 2 : 
Name your database and click OK:


Database with the Given Name will be created.

NOTE :
The new database is based on the Model database (System Database).
It already contains system functions, system views, system stored procedures, and (hidden) system tables. These are system objects which provide information about the database.


Create Table :

Fig 5 : Create Table
Steps to create a table in a database using SQL Server Management Studio (SSMS).

Step 1 :   Ensuring you have the correct database expanded (in our case, the TaskTracker database), right click on the Tables icon and select Table

Step 2 :   A new table will open in Design view. Fill in Column_name, Datatype & if(Null) checkbox for making column .
  ( for more options such as PRIMARY KEY, is Identity, etc. right click on left pane of  required tuple to add property )

Step 3 :   Save the table by selecting File > Save able_1 or by right-clicking on the Table’s  tab and selecting. 
Save Table_1  from the contextual menu:  





Insert Data :
There are many ways of getting data into your database. 



1.Manually: Type data directly into your table rows.


2.Copy/Paste: Similar to the previous option, but this one is where you copy data from another source, then paste it into a table in your database.

3.Import: You can use the Import and Export Wizard to import data from another source.

4.SQL Scripts: You can run a SQL script that contains all data to insert.

5.Application/Website: Users update the database via an application or website.





1. Manually


We can use the Edit Top 200 Rows option to manually type data directly into the table rows. Manually entering data is OK if you only have a little bit of data to enter.


Steps :
1. In the Object Explorer, right click on the table you wish to open, and select Edit Top 200 Rows:
2.You can now start entering the data directly into your table.


2. Copy/Paste


You could use a similar method to the above by copying from another datasource and pasting into your database table. This is OK for a small number of records but not for a lot of records.


Steps :

1. Select all required records from the datasource

2. In the destination database (i.e. the one you want to populate with data), right-click on the destination table and select Edit Top 200 Rows. 

3. Select an empty row by right-clicking in the left-most column (it’s more of a button to the left of your left-most column that allows you to select the whole row) and select Paste from the contextual menu:


3 (a). Import 
You can import data from another datasource. The end result is similar to the copy/paste method (i.e. data is copied across to the destination database), but importing the data is more flexible and could be more suitable on many occasions.

Steps :
To import data, right-click on the database and select Tasks > Import Data… and follow the Wizard from there.

The SQL Server Import and Export Wizard can copy data to and from any data source for which a managed .NET Framework data provider or a native OLE DB provider is available. These include:
•SQL Server
•Flat files
•Microsoft Office Access
•Microsoft Office Excel


Start the SQL Server Import and Export Wizard to import data from an Excel worksheet to a SQL Server database. Click Next to bypass the welcome screen. On the Choose a Data Source page (Figure 8), configure the following:

Fig 6: Import Wizard


Step 1 : (Data Source)
Choose Microsoft Excel from the drop-down menu.

Step 2 : (Excel File Path )
Specify the path of the Excel file from which you are importing data.

Step 3: (Excel Version)
Choose the Excel version where you created the Excel.

Click Next to go to the Choose a Destination page (Figure 9), and configure the following:



Step 4 : (Data Source)
Choose SQL Server Native Client 11.0 from the drop-down menu.

Step 5 : (Server Name )
Fig 7 : Import Wizard Client

Type the name of the destination database’s SQL Server instance.

Step 6 : (Authentication)
Choose the appropriate authentication mode for the data destination connection.

Step 7 : (Database )
Choose which database to copy the data into.








Fig 8 : Finish Import

Step 8 :
Click the Next button to go to the Save and Run Package page. Here, select the Run immediately option and click the Next button. 

This takes you to the Complete the Wizard page where you can view the choices you made.

Click Finish to run the package.




3 (b). Exporting data  (from a SQL Server DB to a Microsoft Excel worksheet) :

To export data, start the SQL Server Import and Export Wizard. Then, click the Next button to bypass the Welcome Screen. On the Choose a Data Source page configure the following:

Step 1 : (Data Source )
Fig 9 : Export Wizard

 Choose SQL Server Native Client 11. from the drop-downmenu.

Step 2 : ( Server Name)
Type the name of the SQL Server instance that contains the source data.

Step 3 : (Authentication)
Choose authentication mode for the data source connection.

Step 4 : (Database)
 Choose the database that contains the source data.
Click Next to go to the Choose a Destination page (Figure 2). On this page, configure the following:





Fig 10 : Export Wizard Target

Step 5 : (Destination)
Choose Microsoft Excel from the drop-down menu.

Step 6: (Excel File Path)
Type in the Microsoft Excel worksheet operating system path.

Step 7 : (Excel Version)
Select the version of the Microsoft Excel worksheet.





Step 8:
Fig 11 : Finish Export 

Click the Next button to go to Review Data Type Mapping page. 

This is where you’ll see how different data types are mapped between the source and the destination and how any conversions issues will be handled.

Follow the wizard ahead.




4. SQL Scripts :
In many cases, you will find it more efficient to run a SQL script that contains the data you need to insert. You can use the SQL INSERT statement to insert just the data you specify in the statement.

Eg :
USE [Database_Name] 
GO
INSERT INTO Table_Name (column_name1,column_name2,column_name3) VALUES (‘val1’, ‘val2’, ‘val3’)
5. Application / Website


Server databases are the backend data storage for a front-end application. Users of the application are responsible for adding data to the database (as well as editing it). 
The Difference between these scripts and above scripts is, these scripts are dynamic. i.e Parameters are passed dynamically to the database.

T-SQL Scripts :

1. Create Database :
Creates a user defined database which can hold n number of user defined tables.

Syntax :
Create database

Query :
CREATE DATABASE SCTPL


2. Create Table :
Creates a user defined table which can hold n number of column with their respective constraints defined by user.

Syntax :
USE [DatabaseName]
GO
CREATE TABLE table_name
(
column_name1 Datatype,
column_name2 Datatype,
column_name3 Datatype
)

Query :
USE [SCTPL]
GO
CREATE TABLE Testdb
(
PrimaryID  int PRIMARY KEY IDENTITY,
Year  varchar(255)
)

3. Drop Table :
The SQL Server DROP TABLE statement is used to remove a table definition and all data, indexes, triggers, constraints, and permission specifications for that table.

Syntax :
USE [Database_Name]
GO
DROP TABLE table_name

Query :
USE [SCTPL]
GO
DROP TABLETEST


4. Insert Into :

The SQL Server INSERT INTO statement is used to add new rows of data to a table in the database.

Syntax :
USE [Database_Name]
GO
INSERT INTO Table_Name (column_name1,column_name2,column_name3) VALUES(‘val1’, ‘val2’, ‘val3’)

Query :
USE [Database_Name]
GO
INSERT INTO Table_Name (Year, Country, Location)
VALUES (‘1996′,’Nigeria’,’Akwa Ibom’)
4. Select :
SQL Server SELECT statement is used to fetch the data from a database table which returns data in the form of result table. These result tables are called result-sets.
Syntax :
/*For selecting all entries*/
USE [Database_Name]
GO
SELECT * FROM TEST
/*For selecting Specific entries*/
USE [Database_Name]
GO

SELECT column_name1, column_name2 FROM Table_name


Query :
/*For selecting all entries*/
USE [Database_Name]
GO
SELECT * FROM TEST
/*For selecting Specific entries*/
USE [SUVEN]
GO
SELECT Year, Country FROM TEST
5. Update :
The SQL Server UPDATE Query is used to modify the existing records in a table.
You can use WHERE clause with UPDATE query to update selected rows otherwise all the rows would be affected.

Syntax :
/* Type 1 */
Use [Database_Name]
GO
UPDATE table_name SET column1 = value1, column2 = value2…., columnN = value WHERE [condition]
/* Type 2 */
USE [Database_Name]
GO
UPDATE TABLE_NAME
SET COLUMN_NAME = ‘val1′, Column_name =val


Query :
/* Type 1 */
USE [SUVEN]
GO
UPDATE TEST
SET Location = ‘RenamedColumn Akwa-Ibom
WHERE Location = ‘Akwa Ibom
/* Type 2 */
UPDATE CUSTOMERS SET ADDRESS = Pune‘, SALARY = 1000.00



6. Delete :
The SQL Server DELETE Query is used to delete the existing records from a table.
You have to use WHERE clause with DELETE query to delete selected rows, otherwise all the records would be deleted.

Syntax :
/*For selecting specific entries*/
USE [Database_Name]
GO
DELETE FROM table_name WHERE [condition]
/*For selecting all entries*/
DELETE FROM column_name

Query :
/*For selecting specific entries*/
USE [SUVEN]
GO
DELETE FROM TEST
WHERE SALARY = 1000
/*For selecting all entries*/
DELETE FROM Location



Clauses

1. WHERE Clause:

The MS SQL Server WHERE clause is used to specify a condition while fetching the
data from single table or joining with multiple tables.

If the given condition is satisfied, only then it returns a specific value from the table. You will have to use WHERE clause to filter the records and fetch only necessary records.
The WHERE clause is not only used in SELECT statement, but it is also used in

UPDATE, DELETE statement, etc.


Syntax :
SELECT column1, column2, columnN FROM table_name WHERE [condition]

Query:
SELECT name FROM Stud WHERE id=1


2. LIKE  Clause:

The MS SQL Server LIKE clause is used to compare a value to similar values using wildcard operators. There are two wildcards used in conjunction with the LIKE operator 
  1. The percent sign (%)
  2. The underscore (_)
The percent sign represents zero, one, or multiple characters. 
The underscore represents a single number or character. The symbols can be used in combinations.

Syntax:


/* Type 1 */
SELECT *column-list FROM table_name WHERE column LIKE ‘%XXXX%’
/* Type 2 */
SELECT *column-list FROM table_name WHERE column LIKE ‘_XXXX_’

Query:

/* Type 1 */
SELECT name from Stud
WHERE sid LIKE ‘200%’
(Finds any values that start with 200)
/* Type 2 */
SELECT name from Stud
WHERE SALARYLIKE ‘_00_’
Finds any values that have 00 in the second and third positions & is of four characters. 


3. ORDER BY


The MS SQL Server ORDER BY clause is used to sort the data in ascending or descending order, based on one or more columns. Some database sort query results in ascending order by default.


Syntax :

Use DatabaseName
Go
SELECT columnlist FROM table_name [WHERE condition] [ORDER BY column1, column2, .. columnN] [ASC | DESC]

Query :

/*TYPE 1*/
Use SUVEN
Go
SELECT * FROM Stud ORDER BY NAME

/*TYPE 2*/

SELECT * FROM Stud ORDER BY NAME DES

4. GROUP BY Clause :

The SQL Server GROUP BY clause is used in collaboration with the SELECT statement to arrange identical data into groups.

The GROUP BY clause follows the WHERE clause in a SELECT statement and precedes the ORDER BY clause.

Syntax :

UseSUVEN
Go

SELECT column1, column2 FROM table_name WHERE [ conditions ] GROUP BY column1, column2 ORDER BY column1, column2

Query: 

UseSUVEN
Go
SELECT NAME, SUM(SALARY) as [sum of salary] FROM Stud GROUP BY NAME

6. DISTINCT

The MS SQL Server DISTINCT keyword is used in conjunction with SELECT statement to eliminate all the duplicate records and fetching only unique records.


There may be a situation when you have multiple duplicate records in a table. While fetching such records, it makes more sense to fetch only unique records instead of fetching duplicate records.


Syntax :

Use Suven
Go

SELECT DISTINCTcolumn1, column2,…..columnN FROM table_nameWHERE [condition]

Query :
Use SUVEN
Go
SELECT DISTINCT SALARY FROM CUSTOMERS ORDER BY SALARY 


Joins :

The MS SQL Server Joins clause is used to combine records from two or more tables in a database. A JOIN is a means for combining fields from two tables by using values common to each.

MS SQL Server Join Types −

There are different types of joins available in MS SQL Server −

INNER JOIN         −  Returns rows when there is a match in both tables.

LEFT JOIN            −  Returns all rows from the left table, even if there are no matches in the  
                                  right table.

RIGHT JOIN         −  Returns all rows from the right table, even if there are no matches in the 
                                  left  table.

FULL JOIN            −  Returns rows when there is a match in one of the tables.

SELF JOIN             − This is used to join a table to itself as if the table were two tables, 
                                 temporarily renaming at least one table in the MS SQL Server statement.

CARTESIAN JOIN − Returns the Cartesian product of the sets of records from the two or 
                                  more joined tables.

NOTE :

The join is performed in the WHERE clause. Several operators can be used to join tables, such as =, <, >, <>, <=, >=, !=, BETWEEN, LIKE, and NOT; they can all be used to join tables. However, the most common operator is the equal symbol.


Query Designer :

The query designer is a graphical user interface that assists in building queries for your SQL Server database. This can be particularly useful when building complex queries that involves many tables, views etc.

The Query Designer can also be beneficial for those who are learning how to write SQL. By using the Query Designer to generate the SQL, you can study the SQL and learn the syntax as you go.

Step 1 :  Open a new query by clicking New Query on the toolbar


Step 2 :  Open the Query Designer by selecting Query > Design Query in Editor. from the top menu:

Step 3 : Select the tables you want to run the query against (in this case, we will add both tables), click Add, and close the box by clicking Close:


Step 4 :  
Select the column/s you want to display in your query by checking the checkbox next to the column name. In the middle pane, you can deselect an Output checkbox to hide that field from being displayed when the query is run (but the field will still be involved in the query).

 Add a value under Filter to narrow the results down to only those you’re interested in (in this example, it is creating a WHERE clause to select only those records with a StatusId of “1” – which is “To Do”):

Step 5 :
Click OK once you’re happy with your query. Query will be automatically  Generated by query designer. Execute it using f5 key.


Views :

In SQL Server, a view is a pre-written query that is stored on the database. A view consists of a SELECT statement, and when you run the view, you see the results of it like you would when opening a table. 

Some people like to think of a view as a virtual table. This is because a view can pull together data from multiple tables, as well as aggregate data, and present it as though it is a single table.
Syntax :

CREATE VIEW ViewName AS
SELECT …

Query :

CREATE VIEW ToDoList AS
SELECT  Tasks.TaskName, Tasks.Description
FROM  Status INNER JOIN
Tasks ON
Status.StatusId = Tasks.StatusId
WHERE  (Status.StatusId = 1)
NOTE : Tasks & Status are two different Tables in a single database.


To execute a View  : 

Syntax : select * from View_name


NOTE :
The view will return upto date data. If the data in the table changes, the results of the view will change too. So if you were to add a new task with a status of “To Do”, next time you run the view, it will include the new record in the result set.


Stored Procedures :

A stored procedure will typically contain some business logic. For example, a stored procedure can accept parameters that are passed to it and test against those parameters using IF statements. Eg, if the parameter is one value, do this, if it’s another value, do that.

Benefits of Stored Procedures :

1. Modular programming
You can write a stored procedure once, then call it again and again, from different parts of an application (and even from multiple applications).

2. Performance
Stored procedures provide faster code execution and reduce network traffic.

3. Security
Users can execute a stored procedure without needing to execute any of the statements directly. Therefore, a stored procedure can provide advanced database functionality for users who wouldn’t normally have access to these tasks, but this functionality is made available in a tightly controlled way.

Create a Stored Procedure :

To create a stored procedure, you need to use the CREATE PROCEDURE statement, followed by the code that makes up the stored procedure. If your stored procedure is going to accept parameters, they need to be included after the name.

Syntax :

CREATE PROCEDURE myStoredProcedure AS
OR
CREATE PROCEDURE myStoredProcedure @{Parameter Name} {data type} AS

Query :

CREATE PROCEDURE
LatestTasks @Count int
AS
SET ROWCOUNT @Count
SELECT TaskName AS LatestTasks, DateCreated
FROM Tasks

ORDER BY DateCreated DESC


Execute a Stored Procedure

1. T-Sql Script :

Now that you’ve created your stored procedure, any time you want to execute it, you need to call it using either EXECUTE or EXEC. If the stored procedure requires parameters you provide those after the procedure name. 


Syntax :
EXECUTE LatestTasks
EXEC LatestTasks
OR
EXEC LatestTasks @Count = 5





2. Using The GUI

Step 1 : Using the Object Explorer, navigate to the stored procedure.

Step 2 : Right click on the stored procedure and select Execute Stored Procedure.

Step 3 : A dialog will appear. Enter your parameter values.

Step 4 : Click OK. SQL Server will generate the SQL code and execute the stored 




System Stored Procedures :

SQL Server includes a large number of system stored procedures to assist in database administration tasks. Many of the tasks you can perform via the GUI can be done via a system stored procedure. For example, some of the things you can do with system stored procedures include:
  • Configure security accounts
  • Set up linked servers
  • Create a database maintenance plan
  • Create full text search catalogs
  • Add remote login
  • Configure replication
  • Set up scheduled jobs
  • and much more…
NOTE :
System Stored Procedure has a prefix sp_ as naming convention.
It is a good idea to develop a consistent naming convention for your stored procedures, like usp_,  select_ , etc.

AIrrowy takes your mind off signals while keeping roads safe

Don’t you hate it when people don’t use their turn signals? I have to say most of my close calls have been due to drivers failing to use these handy lights. And it seems my experience is backed by a study from the Society of Automotive Engineers, which claims about 2 million accidents a year are caused by drivers not signaling a change of lane or turn. 

Other featured campaigns:

  • Elf Smart Plug makes your home intelligent for cheap
  • PLY is a motorcycle smart helmet that won’t break the bank
  • NOCABLE battery pack charges your smartphone wirelessly

Why is it such a hassle to simply move a lever. Not to defend those who don’t follow the rules, but driving is an attention hog. You have to look for cars, motorcycles, bicycles, lanes, signs, people, animals, debris, speed limits and more. There are plenty of distractions that could endanger your life, so maybe drivers just forget to reach for that lever in the middle of chaos. We are all human, after all, so a little help couldn’t hurt. 

We have come across a very neat tool being featured on Kickstarter. It goes by the name of AIrrowy and automates turn signal actions. The process is simple. Once installed on your vehicle (cars, motorcycles, etc.), it connects to your smartphone via Bluetooth and uses an app to predict your driving route. In essence, it is a simplified navigator that knows when and where you are turning. Signals will be activated accordingly.

Interested? The Kickstarter campaign only has a bit over 2 days to go, so you best make your move soon. You can get an AIrrowy for as low as €68. Shipments are estimated to start on April 2018, though, so you will have to wait a few months to stop worrying so much about signals. 

What do you guys think of these automated driving technologies? Will they spoil drivers? Should users still keep an eye on signals to make sure everything is functioning properly? After all, even big names like Tesla have had failures. 

Check out AIrowwy

Player agency

I labeled this post Dungeons & Dragons, but actually the issue of player agency is as true for computer games as it is for pen & paper role-playing games. Every game in which a player controls a character and a DM or a computer controls the world around that character has the same problem: How do we make the player believe that he is playing the hero who is driving the story forward, while the world around him reacts to his actions? How do we prevent the player from thinking that the game is scripted, on rails, and that it is the DM or computer who acts by throwing obstacles in the way of the character, and the character who is limited to reacting to those events?

The problem is most often presented as a difference between a linear story game and a sandbox game. However that is a false dichotomy. There are a lot of sandbox games in which player choice is an illusion, or where the player has the choice between irrelevant options like where to go, while the actually relevant events are scripted. On the other side a game that tells a story can actually have branches in the story and provide quite a lot of meaningful choices and decisions.

I recently had a problem with lack of player agency in a D&D game in which I am a player. The adventure is a WotC published one, Out of the Abyss. And because sandbox gaming is so popular, many of the WotC published adventures are presented in sandbox format. You have chapters after chapters describing locations and NPCs, but there is no written storyline. The idea is for the DM and the players to create the story together, but it is clear how that is somewhat illusory: One way or another the players end up going through the various locations presented. From one group to another the details and order of the encounters might change, but at the end of the day different groups playing through the same sandbox adventure will have similar experiences. In this particular case the DM didn’t have a lot of time to prepare, and thus ended up trying to present the encounters on the fly as we played. And somewhere in the process the story got lost, and we were just stumbling through the Underdark, getting hit by one unpleasant encounter after the other, while not knowing what actually our goal was or how to achieve it. So we really were in the situation of the world acting upon us, and us simply reacting. And with things not always going well, and the DM being fond of a gruesome narrative style of dark fantasy, at the end I felt more like a victim than like a hero.

Now the challenge for me is to run the D&D campaigns in which I am the DM in a way that this doesn’t happen. I do want the players to be the agents of the story, it should be them who drive the story forward and make the choices. However although both campaigns are presented as sandboxes, a lot of events that will happen are rather predictable. There are a lot of dungeons with rooms that contain monsters which aren’t likely to be open to negotiation. Open door, kill monster, loot treasure is the most likely sequence of events. It is hard to imagine Dungeons & Dragons without the dungeons that make up half of the name, but dungeons by their very nature aren’t all that much “sandbox”. They might not be linear, but the walls generally limit where adventurers can go. So dungeons are easily perceived as being “on rails”.

On the positive side players tend to enjoy a good dungeon romp more than they enjoy being in the middle of a sandbox without a goal. Too much guidance by a DM can be a problem, but not enough guidance can be a far more serious problem. Even in an old school hex crawl it is better if the players know towards what destination they are heading, and why.

Is Kratom Safe Enough for the Fight Against Opioids?

A new study says “yes,” and finds it relieves anxiety and reduces negative moods, too.

A review of 57 years of international scientific evidence may help change the perception of kratom and restore its potential as a public health tool that deserves more research.

As the nation grapples for solutions to the opioid epidemic—now claiming more than 33,000 American lives each year—the potential of the psychoactive plant kratom to become a useful tool in the battle has been the subject of hot debate.

While some in the medical field and many in the general public attest to kratom’s ability to help curb opioid addiction and relieve pain, governmental agencies continue to warn against its dangers to mental health, citing links to psychosis and addiction. In 2016, the DEA briefly recommended criminalizing kratom possession and distribution, before withdrawing the proposal.

The study not only points to the potential benefits of kratom as a safer substitute for opioids, but also suggests the plant’s potential to reduce negative mood and relieve anxiety. Published online this week in the journal Drug and Alcohol Dependence, it represents the largest systematic review of the scientific literature on kratom use and mental health.

“There is a lot of confusing information about kratom in the media that makes it difficult for clinicians and the public to make informed choices,” says lead author Marc T. Swogger, associate professor in the University of Rochester Medical Center’s psychiatry department. “This study clarifies that there is no good scientific basis for claims that kratom causes psychosis, suicide, or violence, and the available data do not indicate that kratom is a significant public health problem.”

Coauthor Zach Walsh, associate professor of psychology at the University of British Columbia notes that current approaches to addressing the opioid epidemic are leaving large numbers of high-need individuals without effective treatment.

“We need to explore all options, and our findings suggest it’s time to carefully examine the potential of this ancient plant,” says Walsh.

3 harmful myths about the opioid epidemic

Swogger and Walsh reviewed the combined results of 13 studies conducted between January 1960 and July 2017, using data from 28,745 individuals.

“There is a clear need for more rigorous, well-controlled, prospective studies to support a sophisticated, nuanced understanding of the plant,” says Swogger. “But data across cultures indicated that kratom has a legitimate role to play in mitigating harms associated with opioid dependence. The bulk of the available research supports kratom’s benefits as a milder, less addictive, and less-dangerous substance than opioids, and one that appears far less likely to cause fatal overdose.”

Kratom (Mitragyna speciosa; also known as krathom or ketum) is part of the coffee family and has been used medicinally for centuries in Southeast Asia to relieve symptoms of opioid withdrawal, to relieve pain, diarrhea, and cough, and increase stamina and energy. People chew raw leaves of the kratom plant, boil them to serve as tea, smoke, or vaporize them.

How 30 opioid pills for surgery turn into a habit

In recent years, kratom’s use has expanded beyond Asia, and its leaves, powders, gums, capsules, and extracts are widely accessed through retail outlets and the internet in North America and Europe.

“We need more and better research to be able to outline the risks and benefits of kratom in greater detail,” Swogger says. “Only through well-controlled studies can we elucidate kratom’s potential for good and harm, and give the public, policy makers, and health care professionals the information needed to make informed decisions.”

Source: University of Rochester

Original Study DOI: 10.1016/j.drugalcdep.2017.10.012

 

 

 

Related Stories

  • So… What Is Trump Doing About the Opioid Crisis?
  • As Kratom Use Surges, Some States Enact Bans
  • What To Do About Kratom?

The best tech gifts for men

Yes, the holidays are almost here again, and so if you haven’t finished shopping yet, it’s time to start thinking about what to get those special people in your lives. Or the people you want to suck up to – could go either way. So this year, we have a roundup of some of the best gifts you can give that will apply to most guys… though many of them will honestly make sense for anyone regardless of age or gender. Or you can go regift that fondue set from last year. We won’t judge. Should you decide not to go that route, here are some things you can think about.

Looking for even more options? Check out the following guides:

  • 10 cheap tech gifts that only look expensive
  • Best tech gifts under $25
  • Best tech gifts under $50
  • 11 cheap secret Santa gifts
  • These gifts look like they come straight out of Star Trek
  • 6 geeky gift ideas that aren’t just for nerds anymore

Exercise tracker

Exercise trackers are a thing these days. They allow you to track your steps, heart rate, and a number of other vital statistics to keep you healthy and happy. The Fitbit Blaze is Fitbit’s first foray into smartwatch territory. The Fitbit Blaze uses Fitbit’s custom software to track your body’s stats, and deliver some smartwatch notifications as well. The design is a little on the chunky side, but it can average around four days of battery life.

See more

If Fitbit isn’t his style, maybe give the Garmin Vivosmart a look.

Get Fitbit Blaze at Amazon
Get Garmin Vivosmart at Amazon
 

Home Assistant

Home assistants are one of those items that, once you have them, you can’t live without them. From checking on weather, appointments, or traffic to controlling your smarthome, a home assistant is one of the more futuristic technologies available today. But they can be a little pricey and it seems like something one wouldn’t buy for oneself, which is what makes it a perfect gift!

Google Home is a great product, and it even allows you to make phone calls and play movies and YouTube videos on your Chromecast-connected TVs. Google Home is a jack-of-all-trades kind of product, while other home assistants are a little more focused in one area or another. So, The home is definitely our recommendation in this gift guide. Check it out in the links below.

If your recipient is more Amazon-focused, then the second-generation Echo is also a great buy. Don’t forget both Google Home and the Amazon Echo have “mini” counterparts – you know, if you don’t love them THAT much.

See more
Get Google Home at Google
Get Amazon Echo at Amazon

VR Headset

In the world of VR, Oculus is by far the best known brand out there. While devices like the HTC Vive offer an outstanding experience the Oculus Rift headset is one of the go-to models in the world of VR. It offers a great array of games, plus support from a multi-billion dollar company which is always helpful. The Oculus Rift requires a pretty hefty computer to hook up to, much like the Vive, but the price is a bit lower – around $100 dollars lower.

Truth be told, the HTC Vive is a great experience too – you won’t really go wrong with either one. But Oculus has the name recognition and has a much stronger source of cash, tipping the scales in its favor.

Of course, if your recipient has a Playstation, the Sony Playstation VR is a great headset as well.

Get Oculus Rift at Amazon
Get HTC Vive at Amazon
Get PlayStation VR at Amazon

Headphones

In case you haven’t noticed, wired headphones are a dying breed. At least, those with a 3.5mm jack are. It remains to be seen what will happen with USB Type-C connectors or lightning connectors (hashtag #courage). For now, it’s best to adapt or die, so let’s talk about some bluetooth headphones.

The Jaybird X3 bluetooth in-ear headphones are sleek and stylish with great connectivity. These headphones come with a nice carrying case as well, making them a nice little package. That being said, these are in-ear monitors, which isn’t for everyone. The sound coming from them tends to be good, but not great, so if sound quality is of the utmost importance, or you’re not a fan of in-ear headphones, you may want to look at the Grado SR60e instead.

Get Jaybird X3 at Amazon
Get Grado SR60E at Amazon

Media Streaming

More and more of our content is coming from the internet these days. With the somewhat recent introductions of cable replacement services, like YouTube TV, Sling TV, and others, cord-cutting is becoming a real possibility for many folks out there. Of the wide variety of set top boxes that are out there, Roku stands above the rest. First and foremost, Roku has been doing this for a long time – long before the cord cutting phenomenon began. The Roku Express is an inexpensive, but not underpowered little box that can load up all of your cord-cutting apps without breaking a sweat, and without breaking the bank.

Roku’s UI is also very nice and very streamlined. Oddly enough, Amazon’s Instant video app works much better on the Roku than it does on the Fire Stick. Go figure. Speaking of the Fire Stick, that’s not a bad alternative to a Roku, if you happen to like Amazon’s interface and ecosystem.

See more
Get Roku Express at Amazon
Get Amazon Fire TV Stick at Amazon

Tablet

The future of tablets doesn’t really look all that bright if we’re going to be totally honest. But, there are still some solid use-cases for tablets today. The aforementioned cord-cutting/media streaming is a big one. Gaming is a solid number two. Whatever the case, tablets are still here, and they’re still fun to play with. And in the tablet space, the industry leader is far and away the iPad. From its inception the iPad has handled the transition from small phone screen to large tablet screen the best. Apps are designed exclusively for the iPad, and not just scaled up.

Sure, the iOS interface is about as exciting as watching paint dry in a cornfield in Iowa after 8 hours of fishing having caught no fish. I may be overstating, but the point is, even though the interface is not exciting, the apps make the ecosystem, and iPad app development is not going anywhere any time soon. However, if you’re a fan of thumbing your nose at industry trends, the runner up in the tablet market – the Amazon Fire also sports a solid lineup of devices to choose from with its own app ecosystem – assuming you can live without Google services.

Editor’s Pick
Get iPad Pro at Amazon
Get Fire tablets at Amazon

Phones

Of course if you really want to blow away a man during the holidays, who doesn’t love a new phone to play with. And recently, the Google Pixel 2 XL is one of the most solid phones you can buy today. It’s true, there may or may not be some screen issues, and until those can be addressed it’s hard to throw a lot of weight behind this recommendation. But, by the time you procrastinators out there are looking to shop for the holidays, perhaps we might have more clarity.

That being said, the Samsung Galaxy Note 8 is also a great phone to pick up for the holidays. Samsung has been absolutely killing it in the hardware department, and the Note 8 takes real advantage of that stylus. For a powerful phone that will last and last, the Note 8 might just be your phone of choice this holiday season – especially when it comes to snapping photos and sending them to friends and family.

See more
Get Google Pixel 2 XL at Verizon
Get Samsung Galaxy Note 8 at Amazon

Laptop

But since we’re talking about computing power, why settling for a phone or tablet when a full-blown laptop might be just what the doctor ordered. And in that area, the Dell XPS 13 is a beautiful line of laptops that absolutely kills it in the hardware department. The Dell XP 13 laptop can be just as powerful as you need it to be – it’s a very versatile line of laptops and comes in a number of configurations. But all of them come in the same gorgeous package.

If you’re not a Windows fan, give a long hard look at the ASUS Chromebook Flip. With a full touchscreen, tablet mode, USB-C ports and more, this is a solid contender in the Chromebook space.

Get Dell XPS 13 at Amazon
Get Asus Chromebook Flip at Amazon

Robot vacuum

When you think of robot vacuums, you think of Roomba. Sometimes you think of a puppy on a Roomba, but that’s a different conversation. Having a robot vacuum wandering around the house, doing what you hate to do is one of those wonderful things that you don’t think you need, until you have it. Giving this as a gift to someone is another one of those “you won’t buy it for yourself, so here” gift ideas. The Roomba 690 is one of the midrange options which gets you a lot of bang for your buck. It has WiFi connectivity and can be controlled using an app, plus there’s a host of other bonuses and add-ons that are pretty huge.

If the Roomba doesn’t float your boat, you can also take a look at the iLife A4. We also have a breakdown of a number of different robot vacuums over on DGiT.

Get Roomba at Amazon
Get iLife A4 at Amazon

Smart Coffee Pot

Coffee is arguably one of the most important parts of waking up in the morning. Millions of customers standing in line at Starbucks, Dunkin’ Donuts, and more every day can’t be wrong. But this is the future, and the future of coffee is in the smart Coffee Pot. Not to mention, we all like to drink coffee while we watch radar; everyone knows that. Enter the Mr. Coffee Smart WeMo Coffee Maker. This app-controlled coffee pot lets you automate much of the coffee making process – check the status of the coffee pot, set daily schedules for brewing, etc.

Alternatively, you could also take a look at the Behmor Connected Coffee Pot. We also wrote up a comprehensive look at smart coffee pots over a DGiT. Take a look!

Get WeMo Coffee Maker at Mr. Coffee
Get Belmor Coffee Maker at Amazon

TV

Vizio.com

Nothing says love during the holidays like a new TV, but getting the best new TV, without busting your budget can be a pretty big ask. The Vizio M Series 55-inch TV offers a lot of bang for your buck, and comes with an Android tablet to boot. The downside is, you use this android tablet as a remote which can be less than ideal. But to wrap up a TV and a tablet for the holidays, is a pretty big win in our opinion, so this would be a good way to go.

If you’re looking for a TV for gamers, the TCL P607 is a solid buy as well. Both TV’s are full array backlit instead of edge lit resulting in better black levels.

Get Visio TV at Amazon
Get TCL TV at Amazon

Drone

What man doesn’t want a drone? For the money, the DJI Spark is one of the best out there. Remarkably slim and stable, you can even fly the DJI spark using gestures, rather than a remote. Sure, it’s mostly a parlor trick at the moment, but it’s still pretty awesome tech and fun to brag about at parties. The DJI Spark is a great, “Grab and go” type of drone which will get you some great shots, and has a fair bit of range as well.

But it you want to really blow their doors off, take a look at the Phantom 4, also by DJI. The Phantom 4 is the Cadillac of drone flying with a range of two miles and more. Learn even more about your drone options over at DroneRush.

Get DJI Spark at Amazon
Get DJI Phantom 4 at Amazon

Home Game Console

At the beginning of the year, Nintendo came out with its new gaming console, the Nintendo Switch. At first, the console was tough to get hands on. Now the system can be had at most retail outlets without much hassle. The Nintendo Switch is one of the most versatile gaming systems out there. The tablet-like console has controllers on either side that slide off, the tablet itself has a kickstand, plus there’s an included dock to hook the console up to a TV. It is very close to an optimal gaming solution.

It’s not without its drawbacks – it’s a little underpowered compared to most modern gaming consoles. But the versatility of gaming scenarios, from family game nights, to road trips is pretty much unparalleled by any other system. If you know a gamer who doesn’t have a Nintendo Switch, this would put a smile on their face. Of course you could also get an Xbox or PS4, but odds are the person in your life already has one if they are into games at all. 

Get Nintendo Switch at Amazon

Smartwatch

Smartwatches are one of those fun accessories to a smartphone that you need to use, in order to understand. Unlike many accessories of this nature, there’s a pretty high barrier of entry to get in on this trend. So, what better way to bring joy to a man’s heart than with the gift of a smartwatch. The Samsung Gear S3 Frontier smartwatch is a stylish smartwatch that works great with his Android smartphone. The Tizen-based watch even add Samsung Pay ability through the watch, making contactless or magnetic stripe payments fun and easy. The days of cash are numbered and contactless payment opportunities are becoming more and more widespread. Best get on that wagon now.

Of course, if you need a watch for an iPhone user, look no further than the Apple Watch Series 3. No seriously, look no further, because that’s basically the only smartwatch that will work. The Apple Watch Series 3 adds LTE connectivity to the fold, which can be a great addition to the smartwatch family.

Looking for more options? Be sure to check out our guide to the best smartwatches.

Get Samsung Gear S3 Frontier at Amazon
Get Apple Watch at Amazon

Power bank

You can’t anticipate what’s going to happen on a daily basis, especially when it comes to your smartphone battery. So many smartphones today boast “all day battery life” which frankly leaves little room for error if your day is going to be longer than planned. Sometimes, you’ve just had a heavy gaming day. Whatever the reason, it’s always a good idea to have some extra juice on you when you need to tether on the train ride home, or entertain the kid while in line at the DMV. Does that seem to specific? Because believe me, it happens.

In cases like those, the Anker Powercore+ 20,000 mAh power bank might be a little on the beefy side, but it is very slick looking and slips easily into a bag. Plus it gives you PowerIQ technology and even a USB Type-C port for charging. This will top you off at the end of a long day, or keep you going during an overnight camping trip.

If you need something a little more compact, take a look at the Eighty Plus 10,000 mAh power bank. It’s a lot more sleek and also more attractive. We have a full rundown of a number of other power banks here on Android Authority. If neither of these two are exciting – well, that’s because they’re power banks, but we also have a longer list to look at.

Get Eighty Plus 10,000 at Amazon
Get Anker External Battery at Amazon

Tracking Beacon

People lose stuff. Like always. Which is why there has been a recent surge in tracking tags that attach to your stuff, so you can locate it when you lose it. Use cases for these things extend from wallets and purses, to bikes, to keys – you name it. Many of these tracking tag systems rely on the crowd to throw a blanket of coverage over an entire area. Connectivity range is limited, so in order to track items beyond 30 feet away from your phone, Tile users can report items they come across to their owners. It’s an elegant solution that requires a ton of user adoption in order to saturate an area.

Tile, and similar competitor Trackr have both gotten the type of widespread adoption required to make this somewhat of a reality. There are still gaps, to be sure, but GPS enabled trackers have miserable battery life and cost a lot of money. If you know someone who tends to misplace items, Tile or Trackr might just be a good stocking stuffer this holiday season.

Get Tile at Amazon
Get Tracker at Amazon

So that’ll do it for our holiday gift guide for the men in your life. ‘Are any of these items on your shopping list? Think we left something out? Hit us up in the comments below and let us know what you’ll be camping out on Black Friday for.

Disclosure: E-Commerce Content is independent of editorial content and we may receive compensation in connection with your purchase of products via links on this page. This post may contain affiliate links. See our disclosure policy for more details.