Yearly Archives: 2019


ACM ICPC – Cyprus National Competition 2019

On the 8th of June, the Cyprus National ACM ICPC programming competition was held at the premises of the University of Central Lancashire – Cyprus in Pyla.

The competition was co-organized by all major academic institutions in Cyprus under the auspices of the Cyprus Computer Society. The participating Universities (in alphabetic order) were the following:

  • Cyprus University of Technology
  • European University Cyprus
  • Frederick University
  • Open University of Cyprus
  • UCLan, Cyprus
  • University of Cyprus
  • University of Nicosia

The technical aspects of the competition were held up to the standards of the International Olympiad in Informatics using an automated grading environment with live feedback for the contestants.

In total the competitions hosted 8 teams of 4 members (3 contestants and one mentor). 5 problems were given to the contestants to solve in a competition that lasted 3 hours.

Thanks to the work of the Organizing Committee and especially the efforts by Dr. Josephina Antoniou the competition was successfully completed without any issues.


Assigning auto-increment IDs to empty fields in a KML/XML file

Recently we were processing some KML files using OpenLayers and at some point we realised that some place-marks were not appearing on the map. After inspecting the debug console and the files more carefully we understood that OpenLayers did not like empty placemark IDs.

To mitigate the problem we wrote the following AWK script that will go over all lines in the KML/XML file, find the empty id fields (id="") and assign them with an auto-increment value. A note here, initially we just replaced all empty IDs with the same value but it seems that OpenLayers does not treat kindly conflicts on IDs and thus we had to go with an auto-increment solution.

# Assigning auto-increment IDs to the placemarkers as openlayers does not show conflicting-ID elements.
awk -i inplace '{
  for(x=1;x<=NF;x++) {
    if($x~/id=""/) {
      sub(/id=""/,"id=\"" (++i) "\"")
    }
  }
}1' "$output_path/$file_name";

Side notes

In case you already have some IDs defined, you would have to make your code a bit more complex… You would first need to find all filled IDs and then you would have two options:

  • empty them and execute the above script
  • or register them and make sure the script does not create conflicting IDs either by starting the variable i from a number greater than the biggest registered ID or making it even harder by filling in the gaps between the already registered IDs..

Stop Windows 10 Updates

Recently, we were working on a Windows 10 machine on a metered connection. Even though we are not fans of blocking updates, this time we had to stop the updates as they were sucking the data package dry. To do so we executed the commands of the block below in a command prompt with administrative rights.

To start a Command Prompt (cmd) with administrative rights we pressed Windows+X that showed the Quick Access menu, from the menu we clicked on Command Prompt (Admin). After that we got prompted by User Account Control window if it was OK to allow this application to make changes, where we clicked Yes.

In the new Command Prompt window we executed the following 3 commands that kill all services immediately related with the updates

net stop wuauserv
net stop bits
net stop dosvc

Explanation

  • net stop wuauserv stops the Windows Update service.
  • net stop bits stops the Background Intelligent Transfer Service service
  • net stop dosvc stops the Delivery Optimization service

Revert action and Start Windows 10 updates

To resume (actually restart them since we stopped them) the Windows 10 updates you can either restart the machine or in a command prompt with administrative rights execute the following:

net start wuauserc
net start bits
net start dosvc