Applications


Contest Management System (CMS) How to assign photographs to user profiles

The purpose of this post is to show how to assign profile pictures to the users of the Contest Management System (http://cms-dev.github.io/ https://github.com/cms-dev/).

First of all, make sure that the folder /var/local/lib/cms/ranking/faces exists. If it does not, then create it with mkdir /var/local/lib/cms/ranking/faces (most probably you will need to have root access rights to complete this command).

Then, for each contestant (user) you want to assign a photograph, place in the faces folder an image that has the same name as the username of the contestant. For example, if you want to assign a PNG image to user admin, then you need to copy the image in the faces folder using the name admin.png . Note that the image type can be any of the following .png, .jpg, .gif and .bmp.


Contest Management System (CMS) How to create and assign teams with their flags to users

The purpose of this post is to show how to create teams, assign flag images to them and then group users to those teams for the Contest Management System (http://cms-dev.github.io/ https://github.com/cms-dev/).

According to the documentation (https://cms.readthedocs.org/en/v1.2/RankingWebServer.html?highlight=teams#logo-flags-and-faces) flags and faces are part of the cmsRankingWebServer so the first thing to do is to identify the location where cmsRankingWebServer stores its data. Again, according to the documentation (https://cms.readthedocs.org/en/v1.2/RankingWebServer.html?highlight=teams#managing-it) the location we need is /var/local/lib/cms/ranking .

Please note that if you create a new team, while the cmsRankingWebServer is active, the change will not appear in the ranking website. Be sure to restart cmsRankingWebServer when you create new teams.

 

Teams

First of all, make sure that the folder /var/local/lib/cms/ranking/teams exists. If it does not, then create it with mkdir /var/local/lib/cms/ranking/teams (most probably you will need to have root access rights to complete this command).

Then, for each team you want to create follow these steps:

  1. In the folder teams create JSON a file using the name of the team (e.g. if the team is named ‘rocket‘ then create the file rocket.json in the folder teams)
  2. In the JSON file you need to write the configuration for the team and define the name of the team in a JSON object that has one property called name (e.g. for team rocket the contents of the rocket.json file should be {"name": "rocket"} )

Flags

Similar to before, make sure that the folder /var/local/lib/cms/ranking/flags exists. If it does not, then create it with mkdir /var/local/lib/cms/ranking/flags (most probably you will need to have root access rights to complete this command).

Then, for each team you want to assign a flag, make sure you created the configuration file described above and place in the flags folder an image that has the same name as the team. For example, if you want to assign a PNG image to team rocket, then you need to copy the image in the flags folder using the name rocket.png . Note that the image type can be any of the following .png, .jpg, .gif and .bmp.

Assigning users to teams

To assign a user to a team, you need to modify the configuration file of the user in /var/local/lib/cms/ranking/users . The files are JSON files named using the username of each user (e.g. The configuration file for the user admin would be /var/local/lib/cms/ranking/users/admin.json).

In the file there is some basic information for the user. The following are sample contents from a random competition: {"l_name": "Shimura", "f_name": "Shinpachi", "team": null} . You will notice that there is a field called team in the object but is set to null. We need to update that field to the name of the team we want to assign the user to (e.g. if we want to assign the user admin to team rocket, then we modify the contents of the configuration file admin.json to {"l_name": "Shimura", "f_name": "Shinpachi", "team": "rocket"} )

 


On-screen clock/count down/counter

This is the version that is used for IEEE Region 8 Committee meetings.

[download id=”1179″]

Update: Source code available here

Key features

  • You can change the ico that appears in the task bar by placing an ico file with the name watch.ico in the same directory as the executable (or the source)
  • You can drag the watch to a more convenient place
  • Double clicking on the watch it will hide it
  • Double clicking on the icon of the watch it will toggle it’s visibility
  • From the menu on the task bar you can “Set it on top”, allow mouse to click through the clock, hide/show the gui
  • You can set the color of the Font and the Color of the background using a color picker
  • You can set the transparency of the GUI
  • The tool has two modes, it can operate as a clock that shows time in 24 hour mode or AM/PM and can operate as a count down tool (timer)
  • The timer mode allows you to pause (and continue), reset and stop the time, reset and continue the time (using lap) or zero the clock

Create a sortable ‘Modified Date’ sortable column for posts and pages in wordpress admin area 7

2016-07-14: Post updated to support both pages and posts without redundant/useless code

Paste the following in the functions.php file of your theme:

// Register the column for modified date
function bf_post_modified_column_register( $columns ) {
    $columns['post_modified'] = __( 'Modified Date', 'mytextdomain' );
    return $columns;
}
add_filter( 'manage_edit-post_columns', 'bf_post_modified_column_register' );
add_filter( 'manage_edit-page_columns', 'bf_post_modified_column_register' );

// Display the modified date column content
function bf_post_modified_column_display( $column_name, $post_id ) {
    if ( 'post_modified' != $column_name ){
        return;
    }
    $post_modified = get_post_field('post_modified', $post_id);
    if ( !$post_modified ){
        $post_modified = '' . __( 'undefined', 'mytextdomain' ) . '';
    }
    echo $post_modified;
}
add_action( 'manage_posts_custom_column', 'bf_post_modified_column_display', 10, 2 );
add_action( 'manage_pages_custom_column', 'bf_post_modified_column_display', 10, 2 );

// Register the modified date column as sortable
function bf_post_modified_column_register_sortable( $columns ) {
    $columns['post_modified'] = 'post_modified';
    return $columns;
}
add_filter( 'manage_edit-post_sortable_columns', 'bf_post_modified_column_register_sortable' );
add_filter( 'manage_edit-page_sortable_columns', 'bf_post_modified_column_register_sortable' );

When you refresh http://<Your Domain>/wp-admin/edit.php or http://<Your Domain>/wp-admin/edit.php?post_type=page the ‘Modified Date’ column will be visible and sortable.