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

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

Enumerating all SQL Servers

It is quite easy to enumerate (list) all the possible SQL servers to which you want to connect. Here is a small example: using System;using System.Data;using System.Text;using System.Windows.Forms;namespace SqlServerEnumeratorCS{ public

Spring Admin Expiring all Session of a Certain User

http .formLogin().loginPage(“/login”).successForwardUrl(“/”).defaultSuccessUrl(“/”) … .sessionManagement().maximumSessions(1).maxSessionsPreventsLogin(false) .sessionRegistry(sessionRegistry()) …@BeanSessionRegistry sessionRegistry() { return new SessionRegistryImpl();}@Autowiredprivate SessionRegistry sessionRegistry;sessionRegistry.getAllPrincipals().stream().filter((principal) – (principal instanceof User)).map((principal) – (UserDetails) principal).filter((userdetails) – userDetails.getUsername().equals(email))).forEachOrdered((userDetails) – { sessionRegistry.getAllSessions(userDetails, true).forEach((information) -{ information.expireNow(); }); });

New Versions of DACs for RAD Studio 10.2 Tokyo with Support for Linux Released

Devart released the new versions of Delphi Data Access Components for RAD Studio 10.2 Tokyo with support for Linux. Devart, a recognized vendor of database connectivity solutions for Microsoft .NET and Embarcadero Delphi development platforms as well as database development and management software, has released new versions of Delphi Data Access Components for RAD Studio 10.2 Tokyo with support for Linux. The latest versions of Lazarus 1.6.4 and Free Pascal 3.0.2 are also supported. An update includes the following new features: * The new UniDAC version includes a new MongoDB provider which allows working with a cross-platform document-oriented database MongoDB. Its main features are high performance, easy deployment and comprehensive support for the latest versions of the MongoDB server.*Support for the Direct mode in DBF provider is added. Using DBF data provider, it???s possible to work with a variety of database formats: dBaseIII-dBase10, dBase for Windows, HiPer-Six, FoxPro 2, Visual FoxPro.*More appealing work with Oracle in the Direct mode. Support for Oracle 12c authentication, Oracle Cloud (DbaaS), Oracle Encryption, Oracle Data Integrity, and for the ANYDATA type is added.*A new option to manage batch operations using a transaction and to obtain an active transaction number using DBMonitor for Interbase and Firebird is added*Support for using ConnectionString and the TFmtBCD fields in NexusDB data provider is added. Read more about new Data Access Components for Delphi by Devart at the product pages: UniDAC 7.0 – http://www.devart.com/unidac/ODAC 10.0 – http://www.devart.com/odac/SDAC 8.0 –  http://www.devart.com/sdac/MyDAC 9.0 – http://www.devart.com/mydac/IBDAC 6.0 – http://www.devart.com/ibdac/PgDAC 5.0 – https://www.devart.com/pgdac/LiteDAC 3.0 – https://www.devart.com/litedac/VirtualDAC 10.1 – https://www.devart.com/virtualdac/ About Devart Devart is one of the leading developers of database tools and administration software, ALM solutions, data providers for various database servers, data integration and backup solutions. The company also implements Web and Mobile development projects. For additional information about Devart, visit http://www.devart.com/

Best Practices for Developing Cloud Applications

This article presents a discussion on the best strategies and practices that should be adopted when developing and deploying applications for the cloud???to make your application more stable, scalable, and

Using the SET NOCOUNT SQL Method

Whenever an SQL query has been executed it usually returns the number of rows as well as a short message. Sometimes when working with multiple Stored Procedures, each having multiple

Using Cin.ignore() and Cin.get() Functions

Because cin can leave a terminating character in the stream, not using the cin.ignore() and cin.get() functions could cause small problems with your code. The user gets to see what

Working with Aspose.Pdf for .NET

Aspose.Pdf for .NET is a popular tool that can be used to create PDF documents. It helps you to create and manipulate PDF documents in .NET with ease. Most importantly,

Using — and ++ Operators

Try to use only unary operators for incrementing and decrementing variables, because they produce fewer instructions and run faster, as you can see in the following example of code: #include

Quick Way to Escape Special Characters in an XML Document

We can use the SecurityElement’s Escape method of the System.Security namespace to escape all the special characters in an XML file. Code snippet below: string escapedstring = System.Security.SecurityElement.Escape(inputXMLString); …inputXMLString ?contains

Add Months to a Date in Oracle SQL

If you ever want to add a number of months to a date in Oracle SQL, you can use the ADD_MONTHS function. It’s a simple function and takes two parameters???a

Best Practices for Multithreading in Java

A thread is a path of execution within a process. Multithreading is the ability to improve the overall throughput of an application by providing a way to execute many threads

Create Quick Documentation for your Code in Visual Studio

In order to create quick documentation for your code in Visual Studio, install GhostDoc–a Visual Studio extension that allows you to quickly create XML documentation for Classes, Methods, Properties, Parameters,

Grouping Assertions in JUnit 5

Starting with JUnit 5, we can easily group assertions, as in the following example: @Testvoid allAssertions() {assertAll(“cart”, ()-assertEquals(“Shirt”,cart.getItemName()), ()-assertEquals(“White”,cart.getItemColor()));} In a grouped assertion, all assertions are executed together and if

Strip HTML Content from a String

To?string?HTML?tags,?use?HttpUtility???s?HTMLDecode?method?with?a?RegEx?expression.?HTMLDecode?is?available?in?System.Web?assembly. string?htmlText?=?@”Decision?Making?Techniques:?Why?should?you?be?prepared”; string?plainText?=?string.Empty; if?(!string.IsNullOrWhiteSpace(htmlText)) { ?????plainText?=?Regex.Replace(HttpUtility.HtmlDecode(htmlText),?@””,?string.Empty).Trim(); }

Remove a Constraint from a Table in Oracle SQL

In Oracle, constraints can be set up to enforce business rules on a database. Sometimes you might want to remove constraints. To do this, use the ALTER TABLE command. ALTER

Assertion

The assert macro will terminate the program, often with a message about the assert statement, if its argument are false. #include #include int main(){int x = 10;int y = 2;assert(x==y);}

Built-in JSON Functions in SQL

Did you know that SQL has built-in JSON functions? These can come in very handy! Instead of creating a very complicated query that exports XML and then translate it to

Show the Page Download Status in a WebBrowser Control

The Webbrowser control provides us with the “ProgressChanged” event. We can use the “CurrentProgress” and “MaximumProgress” Properties of the WEbBrowserProgressChangedEventArgs in this method to determine the percentage of the page

Creating a Spring Read Only and Native Query

To allow your query methods to be transactional, you should use @Transactional at the repository interface that you define. For reading operations, the transaction configuration readOnly flag should be set

Accessing and Managing Third-Party Libraries

The Cloud, micro-services and distributed systems are all the rage these days. But, in the end, each service and software component is implemented in some programming language. In the olden

TROUBLESHOOTING TIMEOUT IN AWS ELASTIC BEANSTALK

There is a lot of similarities between detective stories (from Sherlock Holmes, James Bond,???) and troubleshooting production problems. Detective stories need to have a very complex/burning problem. If your application is experiencing issues in production, it automatically becomes a burning problem in the enterprise and gets attention from Senior Management. A detective uses very basic clues, extrapolates them, rules out the odd possibilities, puts a lot of hard work and identifies the villain. He fights against all odds, takes risks and eradicates the evil. A lot of heroism is involved. This is no way different from debugging/troubleshooting complex production problems. Thus I am going to introduce a fictional troubleshooting character: ???Jack Che???. Through this fictional character ??? I am going to narrate how complex real world production problems faced by major enterprises are solved. Feel free to share your comments and let me know whether you like it. If not I can always revert back to regular writing style. While twitter, Google and others are talking about 10 milliseconds, 20 milliseconds response time, still there are significant enterprises whose response time runs for several seconds. There is one such enterprise, whose response time was running for several seconds for their ???search??? transactions. Recently, this enterprise ported their application to AWS Elastic Beanstalk environment in Java 8/Tomcat 8. When a customer performs ???search??? operation on this application, a progress bar is displayed on the browser. Once search completes, progress bar vanishes and search results are displayed. After porting to AWS Elastic Beanstalk for certain data conditions, the customer was seeing a progress bar on the screen forever. Management didn???t know what was causing this issue and how to go about solving it. Thus they engaged Tier1app LLC to solve the problem. Tier1app LLC sent out their top notch troubleshooting detective ???Jack Che??? to solve the problem. HTTP 504 Gateway Time-out Error Code Just like every time, Jack Che was super excited to solve this problem. He assessed the situation quickly. He wanted to understand what interaction was going on between the Server and the browser. Thus he launched the developer console in the chrome browser and triggered the search transaction. A few seconds later, he saw HTTP 504 error code thrown from the server. (HTTP 504 is a time-out error thrown from the backend). Ah, he got his first clue. Now Jack Che started to review the Ajax javascript which made the backend server side call. Unfortunately, javascript didn???t have any error handling code in place. Thus, when error code was thrown it wasn???t handled and the screen was displaying progress bar forever. Wow, initial breakthrough for Jack Che within few minutes of his job. Seeing the smoke, where is the fire? Now Jack Che was curious to figure out from where this HTTP 504 error code is thrown? Jack Che found a second clue now; exactly at 60th second of the search transaction, this HTTP 504 error code was thrown. Since exactly at 60th second, HTTP 504 error code was thrown, Jack Che believed there is some sort of timeout is kicking in. But he wasn???t sure where this timeout value is configured. He searched all throughout the application source code to see whether any 60 seconds timeout is configured. He checked with the application development team. But there was no 60 seconds timeout configured anywhere within the application source code. Elastic Beanstalk Architecture Now he came to the conclusion that timeout is triggered by some component that is outside of the source code. Thus he started to examine each layer in the technology stack. Below is a very quick overview of the Elastic Beanstalk architecture.

Using a JDBC Template

Spring provides a nice abstraction on top of the JDBC API using JdbcTemplate and also provides great transaction management capabilities using annotation-based approach. By using the JdbcTemplate and NamedParameterjdbcTemplate classes,

Booter; Optional Parameter in SQL

Tip: Add an Optional Parameter in SQL

You may not know this, but you can have an optional Parameter in SQL. It took me forever to figure it out. In any case, you can implement an optional