Computing

To avoid having to wait for the next DNS cache update users may manually flush their DNS cache using the command prompt with administrative privileges and running the following command:
ipconfig /flushdns

Technology:

One solution is to use task queues. In Django it is easy to implement a task queue with a third-party library called "huey". It allows developers to specify when to execute a task using annotations:

@huey.periodic_task(crontab(minute='*'))
def print_time():
print(datetime.now())

This task would be executed every minute. Apart from scheduled tasks it also offers the option to execute tasks in the future.

ProgrammingLanguage:

SocialTags:

Technology:

Apparently sparql doesn't allow non aggregate variables in the select clause unless they are also in the group by, which affects the query's meaning. So I came up with another solution which includes an intersection(join):

select ?country ?area ?lake
where {
?lake rdfs:label ?label .
?lake rdf:type dbo:Lake .
?lake dbo:areaTotal ?area .
?lake dbo:country ?country .
?country rdf:type dbo:Country .
FILTER (lang(?label) = 'en') .
FILTER(?maxarea = ?area)
{
select ?country (MAX(?area) AS ?maxarea)
where {
?lake rdfs:label ?label .
?lake rdf:type dbo:Lake .
?lake dbo:areaTotal ?area .
?lake dbo:country ?country .
?country rdf:type dbo:Country .
FILTER (lang(?label) = 'en') .
}
group by ?country
}
}

Technology:

SPARQL group by only one variable

In semantic web, sparql is a powerful language which can among others query for specific knowledge from provided rdf databases. Recently I tried to find out the largest lake in each country in the world from dbpedia. I came up with a query which resulted in the country and the area of its largest lake but without the name of the lake. I wanted to list the name of the lake in the table. So when I added a new variable to the select clause without putting it in group by clause, it complained that "Variable ?label is used in the result set outside aggregate and not mentioned in GROUP BY clause".

Calais Tags:

The best way to customize a WordPress theme, is to create a child theme. To do this, you need to create a directory in the themes folder, add a style.css and set the the ‘Template’ parameter in its header to the name of the parent theme:

/*
Theme Name: Some Child Theme
Template: some-parent-theme
*/

Then you need to create a functions.php file and make sure to enqueue the parents css:

add_action( 'wp_enqueue_scripts', 'mytheme_enqueue_styles' );
function mytheme_enqueue_styles() {
   wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}

After that, you can copy any template file from the parent theme to your child themes directory and change whatever you need. These files won’t be overwritten when the parent theme receives an update.

Technology:

Using Browser Configuration
The process to solve this from happening again had two steps.
1. Clear Browser data. Using Google Chrome (my case), in the “Clear Browser Data”, there are plenty of options: password settings, browser history and cookies controlling the ads, which we want to delete.
2. Block Cookies using the browser settings configuration.
These steps solve the problem in a short-term basis, however many pages do not allow navigation unless cookies are activated. Nevertheless, even if the general settings block cookies, they can be activated individually in those websites which require it.

Using VPNs
Although it is not a free (economically speaking) solution, VPNs will allow to tunnel the traffic through an encrypted connection and make the content available on the other side.
The main disadvantage of VPNs is they do not have a user interface. They need to be hardcoded into the operating system, and implementaation can sometimes be difficult for users.

Technology:

Mapping taxonomy terms from Drupal 5 to Drupal 7

In Drupal 7 tagging terms are stored as fields of the entity. In previous Drupal versions tags are assigned to nodes stored in a table taxonomy_index(nid, tid, created). In D7 we have some table as for example field_data_field_taggings were each term refrerence is stored as a row. If more then one term is assigned to a content node (e.g. in the answers module), the value in the column delta incremented to have a unique key. To generate this table we need an sql statement that increments this delta if more than one term exist for the node.

Pages

Subscribe to Computing