Tag: tricks

Searching in an Array in JavaScript

If you want to search an array for a value in JavaScript and retrieve the index of the found array element , you can use the Array’s indexOf method. How to search for an element in an array in JavaScript ? When using the indexOf method , if the value is found, it returns the index representing the array element. If the value is not…

Displaying all the worksheet names in Excel using VBA Code

Do you want to display the names of the worksheets in the excel workbook ?. Here;s how you can do it using the VBA Code. How to display all the worksheet names in Excel using VBA Code ? Open up the Microsoft Visual Basic for Application Window using the keyboard shortcut key “ALT + F11” and enter the following run and free F5 to run…

How to drop a table if it exists in SQL Server 2014 ?

Assume that you want to write a SQL Query in SQL Server which checks if the table exists in database and want to drop it , you can use the OBJECT_ID function to determine the table existence by passing the table name and the ‘U’ as parameters. How to drop a table if it exists in SQL Server 2014 ?

How to rename directory from command line in Windows 10 ?

You can rename a directory from command line in Windows 10 using the Rename command. The syntax for renaming the directory is as shown below. Rename <oldname> <newname> How to rename directory from command line in Windows 10 ? Below is an example demonstrating how to change the name of the directory from command prompt. D:\>Rename abundantcode1 abundantcode2 D:\>cd abundantcode2 D:\abundantcode2> The Rename command only…

How to get the first character of a string in SQL Server ?

Assume a scenario where you have a column in your table in SQL Server database where you want to retreive the first character of the column value. How to get the first character of a string in SQL Server ? You can use the LEFT function and specify the column name as well as the number of characters from left that you want to retreive.

Continue statement in Java

The continue statement in java lets the developers to skip the current iteration within the loop statements like for , while or do-while . As soon as the java compiler figures out the continue keyword in the code , it immediately skips the statements that follow the continue keyword and then proceeds with the next iteration. The break statement jumps out of the loop completely…

How to get the date part from the date time in SQL Server ?

If you are on SQL Server 2008 and higher version and want to get the date part of the datetime data in SQL Server , you can use the CONVERT method as shown in this post. How to get the date part from the date time in SQL Server ? If you want to get the current date leaving out the time from the datetime…

How to Terminate an Windows Phone 8 App using C#?

If you want to programmatically terminate the windows phone 8 application , you can use the Application.Terminate() method . How to Terminate an Windows Phone 8 App using C#? When using the Application.Terminate() , the developers should make sure that all the necessary data is saved because , the Application Closing event handler wont be raised in this case.

What is Suspension Manager in Windows Phone 8.1 App template ?

When you create a new Windows Phone 8.1 project using the Hub App or Pivot App template , you would notice that it contains a class called “SuspensionManager”. What is Suspension Manager in Windows Phone 8.1 App template ? It is a kind of helper class and provides the necessary properties and methods to load and store the state when the windows phone store app…

How to open Documents folder from Run Window in Windows 10 ?

You can open the documents folder from the Run Windows in Windows 10 using the command “Documents”. How to open Documents folder from Run Window in Windows 10 ? Just open the Run window using the shortcut key (Windows + R) and type “Documents” and press the enter key. This should open up the documents folder or directory in Windows 10.

How to Create a Class in Javascript in WinJS ?

You can define a new class using WinJS.class.define when developing Windows Store App using Javascript. How to Create a Class in Javascript in WinJS ? The WinJS.Class.define method can be used to create a new class in WinJS  . It accepts 3 parameters – Constructor – instanceMembers – staticMembers Below is a sample code snippet demonstrating the usage WinJS.Class.define to create a new class in…