devxlogo

The Latest

Can’t use the “Between” Keyword in a LINQ Query

You can’t use the “Between” keyword in a LINQ query. The sample snippet below shows how you translate between two date fields. DateTime fromDate = DateTime.Now.AddMonths(-3); DateTime endDate = DateTime.Now;

Flyway with Multiple Databases

Let’s suppose that we have Flyway installed in D:/Flyway folder: copy the conf/flyway.conf file to a file called conf/prod.conf open it and update the username, password and url properties: flyway.url=jdbc:mysql://localhost:3306/db

Comparison of Arrays

public class CompareArrays{ public static void main(String args[]) { compareArrays(); } private static void compareArrays() { int[] intArray1 = new int[5]; int[] intArray2 = new int[5]; //Changing the value so

Shortcut to create a new page/move content to a new page in Microsoft Word

If you want to move some content to a new page or create a new page, just place the cursor at the desired location and press CTRL and ENTER keys simultaneously. The cursor is also automatically placed in the new page. Related Posts Microsoft Updates, Expands Visual Studio ToolsTips for Unit Testing with MocksGetting the Last ID in MySQLEMC Buys Cloud Management Vendor VirtustreamBackblaze Runs a Fire Sale on Cloud

Change case of the text in word with ease

Microsoft word gives us various options to change the case of the text. Changing to upper/lower is just a click away. Access the ???change case??? button in the Paragraph ribbon menu, and you will see options like Lower case, Upper case, sentence case. Applying it is very easy as well.  Just click on the text on which you want to change the case, and then select an option from the ???change case??? options.  Related Posts Customer Journey Mapping: Top Tools to Track and Optimize User Experience Support for Lazarus 1.8.4 and a Bunch of New Helpful Features in Updated DAC ProductsWhat Are

Quick way to copy a format in Microsoft Office applications

Is there a format/style of the text that you want to quickly copy in Office applications like word, excel, powerpoint etc? Just click on the text from which you want to copy the format, and then click on the ???Format Painter??? button in the clipboard ribbon menu and then click on the text where you want to apply. The format is copied over. Related Posts Easily Create Responsive Websites Using BootstrapVolkswagen ID.3 Battery Capacity Concerns RaisedSalesforce Launches Einstein AI ProgramElon Musk threatens Apple over OpenAI integrationHow to Enable Java 9 GC

Working with an SQL Output Parameter in C#

When working with an SQL Output parameters, you need to specify the parameter’s Direction property once you have created it. Here is a nice little example method: private float checkValue()

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()); Related Posts How To Find Hidden Apps

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. Related Posts Virginia receives $1.5 billion for broadbandMay’s geomagnetic storm sparks unique atmospheric changesEsa scientists 3D print space bricksIntegration Salesforce with SFTPInfinite Heap in Java

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 Related Posts Benefits of Pair