Author Archives: @ndreah

Marco Alberti in his book “Open Diplomacy” [02] reviews the way of doing diplomacy after by the nine years of experience at ENEL Company as responsible for international institutional affairs.

New technologies have transformed and changed international relations. In this constantly evolving world diplomacy must operate and develop strategies and visions. It must use all possible new means: innovation, digitalization, data science (data-driven diplomacy) to be competitive in the international scenario. Diplomat must act as System Orchestrator to face the quick changing of the world and have to take advantage of the human factor by enhancing its competence to win the challenge.

As the diplomat represents the state, which in turn represents the citizens, his goal is to interpret the complexity in order to protect, defend and promote his state and citizen interests and create value while promoting cooperative relations with other states.

ICT COMPETENCE OR DIGITAL COMPETENCE

In general, by competence we intend the potential to put into operation an effective behavior. When we talk about competence, related to person, we must consider on the one hand his qualities, which help him to be successful at work and in the life, on the other hand his competence as knowledge acquired during his studies and during his experience.

It is clear that personal qualities and knowledge put together give the ability to a person to produce superior performance in work as well as in other fields.

ICT COMPETENCE AND DATA DIPLOMACY

Data has a source, can have an owner, can be public or private, shared or not shared. Then use of them can lead to benefits or disadvantages. Data could have an impact on the individual, institutional, state, or on global level.

Data are of many types: structured, unstructured, quantitative, and categorical. Huge quantity of data (Big Data), then, is massive and contain greater Variety, arriving in increasing Volumes and with higher Velocity (3Vs).

It occurs Data Science to manage and work with data. Data Science is a multidisciplinary field that understands and extracts insights from the ever-increasing amounts of data. It put together concepts from computer science, statistics/machine learning and data analysis.  It uses two paradigms of data research:

  • Hypothesis-Driven: given a problem, what kind of data do we need to help solve it?
  • Data-Driven: given some data, what interesting problems can be solved with it?

Data Science tries to understand what can learn from data and what actions we can take once we find whatever it is we are looking for.

In this framework where data can affect diplomatic processes or triggering policy actions, we have to consider the risks associated with using it especially in data-driven interactions. Digital data and algorithms/software can be modified, manipulated, tampered and therefore they can easily be “hacked” by actors with malicious intent. Given the global nature of cyber threats, it occurs appropriate caution and a cybersecurity infrastructure to filter, protect and use digital data.

The origin of data can be international institution like OCSE, ONU and so on, open source, whistle-blowing data disclosures (Edward Snowden’s public revelation) or data scraped and shared by hackers.

So it occurs to give the right weight to data by trying to distinguish “trusted data” from “fake data”. This is very important when it is used a data-driven decision schema from important players like diplomats.

REFERENCES

[01] "Diplomacy X.0": coined by the Ambassador Giampiero Massolo;

[02] Marco Alberti, Open Diplomacy. Diplomazia economica aumentata al tempo del Covid-1https://www.ibs.it/open-diplomacy-diplomazia-economica-aumentata-libro-marco-alberti/e/9788849865134;

[03] Andy Boyd, Jane Gatewood, Stuart Thorson and Timothy D.V. Dye, Data Diplomacy https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6785044/#FN5

[04]  Should Data Science be considered as its own discipline? https://thedatascientist.com/data-science-considered-own-discipline/

Continuous improvements of ICT technologies give exponential accelerations to all areas in all private and public sectors.

The gold for a private or public manager/diplomat is to keep up with the changes caused by new technologies by using a soft skill approach.

Diplomats should be efficient and flexible and should possess a high ability to adapt to the fast changes of the world.

In this scenario, we assist to an improvement in the development of open source intelligence (OSINT) tools and techniques.

OSINT is the act of gathering intelligence through exploiting all the information that is publicly available.

Wikipedia defines OSINT as “Open-source intelligence (OSINT) is a multi-factor (qualitative, quantitative) methodology for collecting, analyzing and making decisions about data accessible in publicly available sources to be used in an intelligence context.” [02]

The amount of publicly structured data, semi-structured data e unstructured data is huge. We need skill for analyzing them in order to make correlations, extracting information and then knowledge, which could be used for predictions or making policies and strategies.

Many governmental and non-governmental structures use OSINT services: government organizations, Economist Intelligence Unit, BBC, who do investigative journalism, many private corporations for commercial advantages and do son.

Why not use OSINT services in the diplomatic field? Diplomacy could gain advantages on knowledge obtained by OSINT services putting into operation strategies and policies in a predictive way especially in the economic sector.

OSINT smart prediction machine

The scheme of work of OSNT is simple:

  1. Gathering and collecting all type of public data you can in any form;
  2. Organize them in a way you can manipulate;
  3. Analyze them and find hidden correlations;
  4. Generate information and statistical projections;
  5. Produce useful knowledge.

Here it is the machine model:

where:

  • Open Source Data (OSD): datasets, survey data, metadata, audio or video recordings and so on;
  • Open Source Information (OSINF): books on a specific subject, articles, interviews and so on;
  • Open Source Intelligence (OSINT): all information discovered, it is the output of open source material processing;
  • Validated OSINT (OSINT-V): OSINT confirmed/verified using highly reputable source.

REFERENCES

[01] Clima, energia e digitalizzazione: le sfide per la diplomazia economica 4.0 - Intervista a Marco Alberti a cura di Alessandro Strozzi: Pandora Rivista N.3/2020;

[02] https://en.wikipedia.org/wiki/Open-source_intelligence Open-source intelligence;

[03] Nihad A. Hassan, Rami Hijazi, Open Source Intelligence Methods and Tools, Apress 2018;

[04] Michael Bazzell, Open Source Intelligence Techniques 5th edition, 2016

JAVASCRIPT EXECUTION LIMITS IN THE WEB BROWSER

When we ask the visualization of a web page in the browser, it could shows you:

Warning: Unresponsive script" prompt that says "A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete."

It means that a script takes too long to run and the browser doesn’t accept it.

A consequence of it is that the user interaction with the browser and web page is stopped.

The browser UI and JavaScript code share a single processing thread. Every event is added to a single queue. When the browser becomes idle, it retrieves the next event on the queue and executes it.

In reality, browsers starts a new OS process for every tab. However, there is still a single event queue per viewed page and only one task can be completed at a time. This is necessary for rendering the web page and for the user interaction with the web page in the browser.

To test the speed and limit of web browser in the execution of the JavaScript code we are going to use a heavy processing algorithm for generation of combinations without repetitions.

DONALD KNUTH’S ALGORITHM FOR GENERATION OF COMBINATIONS WITHOUT REPETITIONS

The number of combinations of n things, taken k at a time are exactly:

We can think these n things as an ordered collection of objects and we can use binary notation to discover combinations.

For example, we take a set of five letter: {A,B,C,D,E} and we want to list the combinations of 2 letter from this set without repetitions. Using the formula above the number of combinations is 10.

We consider this set as an ordered set: A<B<C<D<E and we use the binary notation to represent it where

0 means the letter is not in the combination and 1 means the letter is in the combination.

We know that the number of all subsets is = 32 > 5, while we have to select of these subsets only those that have a number of elements equal to 2.

Considering the set as an ordered set {A,B,C,D,E} and using the binary notation, the list of all subsets of this set are:

Only good binary representations are used to generate good combinations.

Here it is a combination tool.

A program in JavaScript to codify the algorithm could be:

//--------------------------------------------------------------------
function GenerateCombinations()
	{
	  var Answer_Head = "<table border='1' >";
	  var Answer_Body = "";
	  var Answer_Tail = "</table>";
	  var ErrorCode = 0;
	  var ErrorMsg  = "";

	  var nCombSize = 0;
	  var BaseComb  = new Array();
	  var iBaseComb = 0;
	  var CodeComb  = 0;
	  var CombList  = new Array(); 
	  var ACombItem = "";  
	  var BinaryNumber       = new Array();
	  var BinaryStringNumber = "";
	  var NProgres           = 0;
	  var RNProgres          = 0;
          var NFilter            = 0;
   
          var Start = Date.now(); 
	  var End = Date.now();
	  var Elapsed = End - Start // time in ms	
	  var cElapsed = Elapsed.toString();
		    
	  
// AREA INTELLIGENCE 
	  
  // Clear Area
  window.document.getElementById("i_BackMsg").innerHTML  = "" ;
  window.document.getElementById("i_Answer").innerHTML   = ""
	     
	
// Check Input Data
  if ( isNaN( window.document.getElementById("iN").value) ) {  
        ErrorCode = 1;
       ErroMsg   = "Attention !!! The Combination Size must be a number."; 
	 }	 
else {
     if (window.document.getElementById("iN").value == 0 || 
         window.document.getElementById("iN").value == "" ) {
    	 ErrorCode = 11;
    	 ErroMsg = "Attention !!! The Combination Size must be a value more then zero."; 
          }
        else
        {
           if (window.document.getElementById("iN").value >= 20 ) {
              ErrorCode = 11;
              ErroMsg   = "Attention !!! The Combination Size must less then 20.";
            }
	    else
	    {             	           
	      nCombSize = window.document.getElementById("iN").value ;
	    };           
	};      
	};

// Show Msg  
  if ( ErrorCode > 0 ) {  	       window.document.getElementById("i_BackMsg").innerHTML =ErroMsg+"<br/>" ;	  
return;
 } 
  else
 {
  window.document.getElementById("i_BackMsg").innerHTML ="OK!" ;
 };
	  
    
    
// Check Elements
  iBaseComb = 0;
        
  if ( !(window.document.getElementById("i_e01").value == "" || 
       window.document.getElementById("i_e01").value == "0" )) {          
              BaseComb[iBaseComb]=window.document.getElementById("i_e01").value;
              iBaseComb++;
  };      
          
         
   < .... >
          
        
if ( !(window.document.getElementById("i_e20").value == "" || 
      window.document.getElementById("i_e20").value == "0" )) {          
              BaseComb[iBaseComb]=window.document.getElementById("i_e20").value;
              iBaseComb++;
        };      


     
       if ( iBaseComb == 0 || iBaseComb <= nCombSize )  {     
    	   ErrorCode = 11;
    	   ErroMsg = "Attention !!! The Elements must not be equal to or more than the combination size.";	   
       };
       
  	  // Show Msg  
    	  if ( ErrorCode > 0 ) {
    	     window.document.getElementById("i_BackMsg").innerHTML =ErroMsg+"<br/>" ;	  
    	     return;
    	  } 
    	  else
    	  {
    	      window.document.getElementById("i_BackMsg").innerHTML = "" ;
    	  };       
     
     
    // Combination Code
       CodeComb=0;
       for (j=0;j<=iBaseComb-1;j++){
           CodeComb+= Math.pow(2,j);
       }; 
               
	// Combination Generator
          CombList  = new Array(iBaseComb); 
       
       for (y=0;y<=CombList.length-1;y++){
          CombList[y]="0"
       };
       RNProgress = 0;
       NProgres   = 0;
       for (k=0;k<=(CodeComb); k++) {
         
            BinaryNumber = DecimalToBinary(k, iBaseComb);
         
                                 
            if ( IsAGoodCombination (BinaryNumber, nCombSize ) ) {
                    
                  for (y=0;y<=CombList.length-1;y++){
                       CombList[y]="0";
                   };                    
                      
                   // Make the combination       
                   for (x=0;x<=BinaryNumber.length-1;x++){                   
                        
                         if (BinaryNumber[x]=="1"){
                            CombList[x]=BaseComb[x];                                             
                         };                         
                                     
                      };
                      
                     CombList.sort(function(a,b){return a - b});
                      
                     NProgres++;
                     
                      
                     ACombItem="";        					  
        for (j=0;j<CombList.length;j++){
			 		     
	    if (CombList[j]!="0"){						  
               ACombItem=ACombItem+CombList[j]+" ";                                             
             };                         
	};
                     window.document.getElementById("i_Answer").innerHTML+=NProgres.toString()+" - ";
 window.document.getElementById("i_Answer").innerHTML+=ACombItem+"<br />";
      };         
 };       
 window.document.getElementById("i_Answer").innerHTML+=Answer_Tail+"<br /><br />";
 End = Date.now();
 Elapsed = End - Start // time in milliseconds		
 cElapsed = Elapsed.toString();
 window.document.getElementById("i_Time").innerHTML="Time Elapsed: "+cElapsed+" ms";
 return ;
}
	
//--------------------------------------------------------------------
function DecimalToBinary (iDecNumber, iSize){
  
 // Section Data Structure
    answer = new Array(iSize);
    n10  = iDecNumber;
    x2   = iDecNumber;
    log2 = 0;
 // Section Initialization 
    for (j=0; j<=answer.length-1;j++){
         answer[j]="0";
    };          
// Section Intelligence      
    while (x2>=2) {
          x2=x2/2;
          log2++;     
    };
     for (l2=log2;l2>=0;l2--) {
       power = Math.pow(2,l2);
       if (n10 >= power) {
           answer[l2]="1";
           n10 = n10 - power;
       }
       else {
           answer[l2]="0";
       };      
     };     
     answer.reverse();     
     return answer     
  }
	
//--------------------------------------------------------------------
	
function IsAGoodCombination ( iBRNumber, iCombSize ) {        
    var NumberOfOne = 0 ;
    for (j=0;j<=iBRNumber.length-1;j++) {        
        if (iBRNumber[j]=="1") {          
          NumberOfOne++;          
          if ( NumberOfOne >  iCombSize ) {
             break;
          };
        };     
    };    
    if ( NumberOfOne == iCombSize ) {
       return true; 
    }   
    else {
       return false;   
    };
  }  
//--------------------------------------------------------------------

WEB APPLICATION CLIENT-SIDE JAVASCRIPT PERFORMANCE

The results of using as benchmark the JavaScript program previously described are the following ones.

How we can see from the tables and graphs above SpiderMonkey Engine in this test result the winner.

Only in the increase of execution time for high number of combinations it is not the best.

REFERENCES

[01] Donald E. Knuth, The Art of Computer Programming Volume 4 Generating All Combinations and Partitions Fascicle 3, July 2005;

[02] JavaScript Execution and Browser Limits https://www.sitepoint.com/javascript-execution-browser-limits/ ;

[03] Web Browser http://www.volucer.it/?p=143