devxlogo

We are an award-winning tech entrepreneurship website where trusted experts can provide value globally.

Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.

devxlogo

Trusted for 26 years

Over 30K Articles

1M+ Readers

Expert-reviewed

10K+ Tech Terms

As seen in:

microsoft logo
business_insider_logo
wired_logo
berkley
arstechnica_logo
hackernoon

The Latest

Capturing Textboxes Available in a Google Authentification Page Using Selenium

A list of textboxes available in a Google authentication page can be captured using this snippet of code: driver.get(“https://accounts.google.com/”);List Textbox =driver.findElements(By.xpath(“//script[@type= ‘text/javascript’]”));System.out.println(“Overall textboxes:”+Textbox.size());

Timer in Java

import java.util.*;public class TimerTaskDemo extends TimerTask{ public static void main(String args[]) { //Creating a TimerTask and a Timer that together helps achieving the required result TimerTask timeTaskDemo = new TimerTaskDemo();

Getting Text from any External Window in C#

To get the text of an external window you could use the GetForegroundWindow and the GetWindowTextAPI functions. Here is a small example of its usage: public partial class Form1 :

Selenium WebDriver – Locate Elements by Name

Getting elements using their tag names is often used to collect autosuggestions, checkboxes, ordered lists, and so on. The following line of code is an example of capturing elements trough

Increasing the Size of an Array

public class ArraySize{ public static void main(String args[]) { changeArraySize(); } private static void changeArraySize() { int[] intArray = new int[5]; System.out.println(“Before change: size(): ” + intArray.length); // Increasing the

Building a Custom Designer for Web Controls

The default designer that comes with the Web Controls is great but there are times when you might need to customize it. It’s pretty easy to do. You need to

Understanding Dalvik GC Logs–do not use

Memory utilization on the mobile app has a significant impact on the customer experience. If your app creates a lot of objects, then Garbage Collection (GC) process will be triggered frequently to evict unused objects. Even though Garbage Collection is an automatic process, however, frequent Garbage Collection consumes a lot of CPU + it will also pause the app. Frequent pauses can jank the app (i.e. stuttering, juddering, or halting). Thus, you need to understand how many objects your app is creating, how frequently Garbage collection is triggered, how much time it takes to complete, how much memory is reclaimed after every event. All this information is present in the runtime log messages. Whenever a GC event runs, a log line is printed in the runtime log messages. You can view those log lines through logcat. GC log line format varies based on whether app runs on Dalvik VM or Android Run Time (ART). In the earlier article, we saw how to analyze ART GC log line. In this article, let???s see how to analyze Dalvik GC log line.

Docker Network Commands

Here is a list of the most popular Docker network commands: docker network create – creates a network docker network connect – connect a container to a network docker network

Break the Data Links in an Excel Workbook

Use this function to break the data links in an Excel workbook. It shows a message asking the user to confirm to break. private void BreakDataLinks(Excel._Workbook wb){ if (DialogResult.Yes ==

Copying Pictures Quickly with C#

The?best?way?to?copy?pictures?in?C#?is?most?probably?with?the?use?of?the?BitBlt?API.?Here?is?a?small?example?of?its?implementation: ????public?partial?class?Form1?:?Form ????{ ????????const?int?SRCCOPY?=?0xcc0020; ????????[System.Runtime.InteropServices.DllImportAttribute(“gdi32.dll”)] ????????private?static?extern?int?BitBlt( ??????????IntPtr?hdcDest,?????//?handle?to?destination?DC?(device?context) ??????????int?nXDest,?????????//?x-coord?of?destination?upper-left?corner ??????????int?nYDest,?????????//?y-coord?of?destination?upper-left?corner ??????????int?nWidth,?????????//?width?of?destination?rectangle ??????????int?nHeight,????????//?height?of?destination?rectangle ??????????IntPtr?hdcSrc,??????//?handle?to?source?DC ??????????int?nXSrc,??????????//?x-coordinate?of?source?upper-left?corner ??????????int?nYSrc,??????????//?y-coordinate?of?source?upper-left?corner ??????????System.Int32?dwRop??//?raster?operation?code ??????????); ????????public?Form1() ????????{ ????????????InitializeComponent(); ????????} ????????private?void?Form1_Paint(object?sender,?PaintEventArgs?e) ????????{ ????????????Graphics?g?=?e.Graphics; ????????????g.FillRectangle(Brushes.White,?ClientRectangle); ????????????g.DrawRectangle(Pens.Black,?10,?10,?40,?40); ????????????IntPtr?dc?=?g.GetHdc(); ????????????BitBlt(dc,?70,?0,?60,?60,?dc,?0,?0,?SRCCOPY); ????????????g.ReleaseHdc(dc); ????????} ????}

Making a Java List Thread Safe

The java.util.list is not thread safe by default. There can be situations where you would want to use the list in a multithreaded environment for processing. An effective mechanism is

RESTful Verbs

HTTP RESTful ObservationGET Read safe and idempotentPOST Create neither safe nor idempotentPUT Update not safe, but idempotentDELETE Delete not safe, but can be considered idempotent

Compact the outlook file (.PST) and save disk space

After you have deleted the unwanted emails, at times the pst file does not automatically shrink and lowers its space used on disk. A quick way is to use the ???Compact PST??? feature.   You can right click on the PST file in outlook, and choose Data File properties.   Then click on Advanced and choose the Outlook data file settings. You will be provided with an option to compact the file.

Using Boolean Logic Instead of CASE WHEN

Once you get the hang of the CASE WHEN SQL Statement it can be easy to overuse it. Sometimes you do not need to even use the CASE WHEN Statement

Cron Job Listing in Linux

Cron jobs are also known as scheduled jobs. After adding several of them, you might want to identify what jobs have been added. The following command helps. [root@rivers cron]# crontab

Encrypt a Config Section Using .NET’s Configuration Providers

var configFilePath = @”C:CodeClassifiedConfigurationsapp.config”;var sectionName = “appSettings”;EncryptConfigSection(configFilePath, sectionName);private void EncryptConfigSection(string configFilePath, string sectionName){ var configurationFileMap = new ExeConfigurationFileMap { ExeConfigFilename = configFilePath }; var configuration = ConfigurationManager.OpenMappedExeConfiguration(configurationFileMap, ConfigurationUserLevel.None); var configSection

Entering a Docker Container

An easy way to create a new interactive bash shell in the running container: docker?exec -it bash

Converting JSON Results in Camel Case

Use the CamelCasePropertyNamesContractResolver class of the Newtonsoft.Json assembly to return the JSON serialized string in camel case. var responseObject = employeeProxy.GetAllEmployees();var serializedObjectInCamelCase = JsonConvert.SerializeObject(responseObject, new JsonSerializerSettings { ContractResolver = new

Working with Swagger

RESTful services have been popular for quite some time now. They are widely-used, primarily for improved performance, ease of use and maintenance. Swagger is a popular API for documenting your