Posts

Technology News Worth Reading

Here are a few technology news stories that I’ve read in the past week or so.

News Headlines

Code Partners Acquires SmartInspect from Idera/Gurock

SmartInspect is an advanced .NET logging, Java logging, and Delphi logging tool for debugging and monitoring software applications. It helps customers identify bugs, find solutions to user-reported issues, and gives a precise picture of how software performs in different environments. Read the article by Code Partners. Read the official announcement by Idera/Gurock.

Bill Gates says tech companies ‘deserve rude, unfair, tough questions’

Bill Gates believes tech firms “deserve” the kind of scrutiny they got during Congressional hearings last month. “If you’re as successful as I am or any of those people are, you deserve rude, unfair, tough questions,” the Microsoft founder told host Dax Shepard. “The government deserves to have shots at you,” Gates said. “That type of grilling comes with the super successful territory. It’s fine.” Read the Verge Article.

Scientists use artificial intelligence in new way to strengthen power grid resiliency

At the U.S. Department of Energy’s (DOE) Argonne National Laboratory a research team has developed a novel approach to help system operators understand how to better control power systems with the help of artificial intelligence. Their new approach could help operators control power systems in a more effective way, which could enhance the resilience of America’s power grid, according to a recent article in IEEE Transactions on Power Systems. Read the TechXplore Article.

FBI, CISA Echo Warnings on ‘Vishing’ Threat

“The COVID-19 pandemic has resulted in a mass shift to working from home, resulting in increased use of corporate virtual private networks (VPNs) and elimination of in-person verification,” the alert reads. “In mid-July 2020, cybercriminals started a vishing campaign—gaining access to employee tools at multiple companies with indiscriminate targeting — with the end goal of monetizing the access.” Read the Krebs on Security Article.

How Shopify Reduced Storefront Response Times with a Rewrite

In January 2019, Shopify set out to rewrite the critical software that powers all online storefronts on Shopify’s platform to offer the fastest online shopping experience possible, entirely from scratch and without downtime. Read the Shopify Engineering Blog Article.

Blockchain pet adoptions

Blockchain technology is not limited to cryptocurrencies. There are many other applications that might benefit from such as secure information system. Writing in the International Journal of Blockchains and Cryptocurrencies, a team from India explain how a blockchain might be used in pet adoption. Read the TechXplore Article.

Open source has a people problem

Open source sustainability is really a people problem. Or, as Langel highlights, “In open source, the maintainers working on the source code are the scarce resource that needs to be protected and nurtured.” Read the InfoWorld Article.

Fortnite battle escalates: Apple to terminate developer program membership, Epic files injunction

Epic attempted to lure users to use the new payment system by offering discounts of up to 20% on virtual purchases including the in-game currency V-Bucks on both iOS and Android. Both Google and Apple demand a 30% cut, and once the bypass was introduced, Fornite was removed from both Google Play and Apple’s App Store. Lawsuits have been launched against both tech giants. Epic deems the commission rate as “oppressive” and despite trying to use the massive Fortnite customer base as leverage — alongside some rather intense public mockery — the row now has the potential to severely impact iOS developers. Read the ZDNet Article.

How to disagree with your boss without losing your cool… or job

It doesn’t have to be this way though. You can totally express your opinion to your boss or manager without losing your cool. This post contains some of the scenarios where speaking up would be justified. Read the TNW Article.

Engineers set new world record internet speed

Working with two companies, Xtera and KDDI Research, the research team led by Dr. Lidia Galdino (UCL Electronic & Electrical Engineering), achieved a data transmission rate of 178 terabits a second (178,000,000 megabits a second) – a speed at which it would be possible to download the entire Netflix library in less than a second. Read the TechXplore Article.

Roberto V. Zicari interviews Bjarne Stroustrup, the inventor of C++ programming language

Roberto V. Zicari interviewed Bjarne Stroustrup, the inventor of C++ programming language, back in 2007. Roberto again interviews Bjarne 13 years later.

In the interview, Bjarne talks about notable computer scientists that influenced his career and work. Bjarne also talks about why he designed the C++ language and why he started with the C language. Bjarne also talks about three guiding principles for the design of the C++ language: “Make the language simpler! Add these two essential features now!! Don’t break (any of) my code!!!”

Read the interview on the Roberto’s ODBMS.ORG site.

My Conversations with Bjarne Stroustrup

I’ve also had two opportunities to talk live online with Bjarne about the C++ language during past Embarcadero CodeRage online conferences:

A Conversation with the C++ language designer, Bjarne Stroustrup
Monday, December 10, 2012
C++ Language Conversation with Bjarne Stroustrup and David Intersimone
Tuesday, December 4, 2018

About ODBMS.ORG

ODBMS.ORG is designed to meet the fast-growing need for resources focusing on AI, Big Data, Data Science, Analytical Data Platforms, Scalable Cloud platforms, NewSQL databases, NoSQL datastores, In-Memory Databases, and new approaches to concurrency control.

About Roberto Zicari

Roberto is Full Professor of Database and Information Systems at Frankfurt University. He was for over 15 years the representative of the OMG in Europe. Previously, Roberto served as associate professor at Politecnico di Milano, Italy; Visiting scientist at IBM Almaden Research Center, USA, the University of California at Berkeley, USA; Visiting professor at EPFL in Lausanne, Switzerland, the National University of Mexico City, Mexico and the Copenhagen Business School, Danemark.

About Bjarne Stroustrup

Bjarne is a Technical Fellow and a Managing Director in the technology division of Morgan Stanley in New York City and a Visiting Professor in Computer Science at Columbia University. Bjarne designed and implemented the C++ programming language. To make C++ a stable and up-to-date base for real-world software development, Bjarne says “I have stuck with its ISO standards effort for almost 30 years (so far).”

Bjarne Stroustrup’s homepage

Using C++Builder to list all available VCL styles in a ComboBox and apply a selected style using the ComboBoxChange event

Back in June a developer asked a C++Builder question on StackOverflow. The question was “How can I list all the available VCL styles in a combo box and in the ComboBoxChange event, apply that style in C++ Builder?” I answered the question and gave the example code.

One of my favorite RTL features for the VCL and FMX frameworks is the ability to customize the look and feel of your applications using Styles. The first step is to create a C++Builder VCL project and select a few of the VCL Styles in the Project | Options | Application | Appearance settings. The C++Builder 10.4 Sydney DocWiki explains that “the VCL Styles architecture has been significantly extended to support High-DPI graphics and 4K monitors. In 10.4 Sydney all graphical elements are automatically scaled for the proper resolution of the monitor the element is displayed on. This means that the scaling depends on the DPI resolution of the target computer or the current monitor, in case of multi-monitor systems.”

The C++ Application User Interface

For the application user interface I have a TButton (has code to populate the ComboBox with selected application styles) and a TComboBox (to display and allow selection of a style).

The C++ code

//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
#include <Vcl.Themes.hpp>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
	// populate the ComboBox with VCL styles that are selected
	//    in Project | Options | Application | Appearance
	ComboBox1->Items->BeginUpdate();
    try
    {
		ComboBox1->Items->Clear();

		DynamicArray<String> styleNames = Vcl::Themes::TStyleManager::StyleNames;

        for(int i = 0; i < styleNames.Length; ++i)
        {
            String styleName = styleNames[i];
			ComboBox1->Items->Add(styleName);
        }
    }
    __finally
    {
		ComboBox1->Items->EndUpdate();
	}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ComboBox1Change(TObject *Sender)
{
	// set the style for the selected combobox item

	Vcl::Themes::TStyleManager::TrySetStyle(ComboBox1->Items->Strings[ComboBox1->ItemIndex],false);
}
//---------------------------------------------------------------------------

The Application in Action

TComboBox populated with VCL styles selected
Application Style Changed by TComboBox selection

References

VCL Styles Overview

Project Options Application Appearance

VCL Styles Support for High-DPI Graphics

C++Builder Product Information

C++Builder Product Page – Native Apps that Perform. Build Windows C++ Apps 10x Faster with Less Code
C++Builder Product Editions – C++Builder is available in four editions – Professional, Enterprise, Architect and Community (free). C++Builder is also available as part of the RAD Studio development suite.

Multithreaded Sorting with C++Builder and the Parallel Programming Library (PPL)

The Parallel Programming Library (PPL) is one of my favorite features in C++Builder runtime library. PPL allows developers to create tasks that run in parallel to take advantage of multi-core processors.

Using the PPL, you can: 1) speed up loops with a Parallel For, 2) run multiple tasks in parallel using TTask, and 3) use Future Objects to allow a process run with your program focused on other work until the future value is set.

To showcase the TTask feature of the PPL, I’ve created a C++Builder VCL application (build and tested using the C++Builder 10.4 Sydney release) that runs three sort algorithms in separate tasks – Bubble Sort, Shell Sort and the ISO C++ standard Sort (which implements the Quicksort algorithm).

The User Interface

The VCL user interface for my application includes a TButton, two TMemos, and four TLabels. The TButton onClick event handler creates a vector of integers, creates three TTasks (for the sort algorithms) and waits for the sort tasks to complete using the TTask::WaitForAll method.

The Code

MainUnit.h:

#ifndef MainUnitH
#define MainUnitH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ExtCtrls.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:	// IDE-managed Components
	TButton *Button1;
	TLabel *SortingStatusLabel;
	TLabel *BubbleSortLabel;
	TMemo *Data_Memo;
	TMemo *SortResult_Memo;
	TLabel *ShellSortLabel;
	TLabel *STDSortLabel;
	void __fastcall Button1Click(TObject *Sender);
private:	// User declarations
public:		// User declarations
	__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif

MainUnit.cpp:

//---------------------------------------------------------------------------

#include <vcl.h>
#include <System.Threading.hpp>
#include <vector>
#include <algorithm>
#pragma hdrstop

#include "MainUnit.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{

	_di_ITask My_Tasks[3];
	const int max_data = 15000;   // number of random numbers to create

	int LoopValue = 0;

	Button1->Enabled = false;
	Button1->Update();
	BubbleSortLabel->Caption = "Bubble Sort";
	BubbleSortLabel->Update();
	ShellSortLabel->Caption = "Shell Sort";
	ShellSortLabel->Update();
	STDSortLabel->Caption = "std::sort";
	STDSortLabel->Update();

	SortingStatusLabel->Caption = "Sorting "+IntToStr(max_data)+" integers!";
	SortingStatusLabel->Update();

	// Windows GetTicks() start and stop for each sort method
	int StartBubble,StopBubble;
	int StartShell,StopShell;
	int StartSTD,StopSTD;

	Data_Memo->Lines->Clear();
	SortResult_Memo->Lines->Clear();

	// create a vector of data that all sort algorithms will use
	std::vector<int> my_data;

	// populate the vector with integers
	for (int i = 1; i <= max_data; i++) {
		int random_value = Random(max_data);
		my_data.push_back(random_value);
		// Data_Memo->Lines->Add(IntToStr(random_value));
	}

	// copy data vector to sort vectors
	std::vector<int> bubble_data = my_data;
	std::vector<int> shell_data = my_data;
	std::vector<int> std_data = my_data;

	// First Task - Bubble Sort
	My_Tasks[0] = TTask::Create([&](){
		// Set Bubble Sort Windows GetTickCount()
		StartBubble = GetTickCount();
		// body of Bubble Sort
		bool swapp = true;
		while(swapp){
			swapp = false;
			for (size_t i = 0; i < bubble_data.size()-1; i++) {
				if (bubble_data[i]>bubble_data[i+1] ){
					bubble_data[i] += bubble_data[i+1];
					bubble_data[i+1] = bubble_data[i] - bubble_data[i+1];
					bubble_data[i] -=bubble_data[i+1];
					swapp = true;
				}
			}
		}
		// Set the Bubble Sort Stop GetTicks()
		StopBubble = GetTickCount();
	});
	// Start the Bubble Sort Task
	My_Tasks[0]->Start();


	// Second Task - Shell Sort
	My_Tasks[1] = TTask::Create([&](){
		// Set Shell Sort Windows GetTickCount()
		StartShell = GetTickCount();
		// body of the Shell Sort
		for (int gapSize = shell_data.size() / 2; gapSize > 0; gapSize /= 2) {
			for (int currentIndex = gapSize; currentIndex < shell_data.size(); currentIndex++) {
				// save the currentIndex
				int currentIndexCopy = currentIndex;
				// save the value of the currentIndex
				int item = shell_data[currentIndex];
				while (currentIndexCopy >= gapSize && shell_data[currentIndexCopy - gapSize] > item) {
					shell_data[currentIndexCopy] = shell_data[currentIndexCopy - gapSize];
					currentIndexCopy -= gapSize;
				}
				shell_data[currentIndexCopy] = item;
			}
		}
		// Set the Shell Sort Stop GetTicks()
		StopShell = GetTickCount();
	});
	// Start the Shell Sort
	My_Tasks[1]->Start();


	// Third Task - std::sort
	My_Tasks[2] = TTask::Create([&](){
		// Set std::sort Windows GetTickCount()
		StartSTD = GetTickCount();
		// Body of the std::sort
		std::sort(std_data.begin(),std_data.end());
		// Set the std::sort Stop GetTicks()
		StopSTD = GetTickCount();
	});
	// Start the Shell Sort
	My_Tasks[2]->Start();

	// wait until all of the sorting tasks complete
	TTask::WaitForAll(My_Tasks, sizeof(My_Tasks)/sizeof(My_Tasks[0])-1);

	SortingStatusLabel->Caption = "Sorting All done!";

	BubbleSortLabel->Caption = "Bubble Sort Time: "
		+ IntToStr(StopBubble - StartBubble)
		+ " ms";
	BubbleSortLabel->Update();

	ShellSortLabel->Caption = "Shell Sort Time: "
		+ IntToStr(StopShell - StartShell)
		+ " ms";
	ShellSortLabel->Update();

	STDSortLabel->Caption = "std::sort: "
		+ IntToStr(StopSTD - StartSTD)
		+ " ms";
	STDSortLabel->Update();

	// if you want to see the sort results un-comment
	// one of the for loops and the sort result memo statement
	// for(int n : std_data) {
	// for(int n : bubble_data) {
	// for(int n : shell_data) {
		// SortResult_Memo->Lines->Add(IntToStr(n));
	// }

	// clear the vectors
	my_data.clear();
	bubble_data.clear();
	shell_data.clear();
	std_data.clear();

	Button1->Enabled = true;
}
//---------------------------------------------------------------------------

The form after sorting 15,000 integers

References

PPL – Parallel Programming Library – http://docwiki.embarcadero.com/RADStudio/Sydney/en/Using_the_Parallel_Programming_Library

Using TTask – http://docwiki.embarcadero.com/RADStudio/Sydney/en/Using_TTask_from_the_Parallel_Programming_Library

Using TParallel::For – http://docwiki.embarcadero.com/RADStudio/Sydney/en/Using_TParallel.For_from_the_Parallel_Programming_Library

Using TTask::IFuture – http://docwiki.embarcadero.com/RADStudio/Sydney/en/Using_TTask.IFuture_from_the_Parallel_Programming_Library

Algorithms Library – https://en.cppreference.com/w/cpp/algorithm

std::sort – https://en.cppreference.com/w/cpp/algorithm/sort

C++Builder Product Information

C++Builder Product Page – Native Apps that Perform. Build Windows C++ Apps 10x Faster with Less Code
C++Builder Product Editions – C++Builder is available in four editions – Professional, Enterprise, Architect and Community (free). C++Builder is also available as part of the RAD Studio development suite.

Teachable – The Complete Python Course

A Teachable course about Python programming. Learn Python for AI, Machine Learning, Data Science and App Development for only $29 USD. The course includes:

  • 12 hours of easy-to-understand videos and activities
  • Coding exercises
  • Practice activities
  • Certificate of completion

For more information go to the course landing page

About the Instructor

Mosh Hamedani is a software engineer with almost two decades of experience. He’s taught over three million people how to code or how to become a professional software engineer through his online courses and YouTube channel. “I believe coding should be fun and accessible to everyone.”

 

 

Welcome to My World!

Welcome to blog.davidi.com! This is a blog about everything related to Software Development (including the kitchen sink). Posts that appear here contain articles about Tools, Technologies, News, Tips, Answers, Tutorials, Conversations, Videos and Stories across all Programming Languages and Platforms.

About David I

David Intersimone, known to many as “David I”, is a passionate and innovative software industry veteran who extols and educates the world on developer tools, software development and software architectures. David I wrote his first computer program, a Prime Number Generator using Fortran on an IBM 360/40, in the Fall of 1969 as a Cal Poly San Luis Obispo student. After graduation with a Computer Science degree in 1973 David spent his first 13 years in the computer industry as a software engineer and project manager.

David joined Borland Software in 1985 where he practically invented Developer Relations. During David I’s five decades as a software engineer, development manager, developer community executive, development cheerleader, and developer advocate, he has created and participated in thriving global developer communities while producing thousands of articles, videos and blog posts while travelled more than 4 million miles to visit with developers.

Before Embarcadero acquired the developer tools business from Borland Software, David spent more than 20 years with Borland in various evangelism, engineering, and development capacities, including creating the company’s developer relations program.

Today, David I shares his visions and insights as a software engineer and pioneer in developer relations with program managers, directors and developers where he gives workshops, webinars, guidance and advice on developer communities, developer advocacy and software development.