Camara support in HTML5 and JavaScript
At the moment, there are very good efforts to be able to access devices directly with HTML5, which would integrate native webcam support directly into the browser. However, there is still the fundamental problem on the Internet that most systems do not support HTML5. Even the current browsers do not provide the update functionality, which would cover the needs of today’s speed of development. This topic, however was already discussed in a previous article.
Read the rest of the article »
More Recent Hacking Articles
Resolve many-to-many relations a bit different with MySQL
In database modeling, a m:n relationship is usually resolved by an additional table. But what if this relation is used only for archiving and the number of links in the resulting table is not too high? In that context, I got the idea to store all referring ID’s as CSV string directly into a TEXT column of one of the referring tables. I came to this idea, because otherwise I would have to build complicated foreign keys and this way I also save one additional table. Certainly, this only makes sense if the data is not frequently accessed as foreign key. Nevertheless, I would like to tackle the problem, even if the implementation is very MySQL-oriented.
Read the rest of the article »
SQL-modes right to exist
At the beginning of a new project, one is faced with the question if MySQL’s strict mode should be used or if the default behavior is sufficient for most scenarios. This mode certainly makes only sense if you evaluate the error codes and acting accordingly in the application – thus, it would be a bad idea to apply SQL modes to a running system. Unfortunately, SQL modes are not really common and have thereby a few bugs. Also the fact, that the user can bypass the mode in the session raises the question whether it makes sense to use these settings at all. I decided to only set a selected list of options; just what really makes sense and improve the behavior of MySQL. Strangely that these modes are not set by default, what one might expect, as they are close to a natural approach of databases usage.
Read the rest of the article »
At the moment, there are very good efforts to be able to access devices directly with HTML5, which would integrate native webcam support directly into the browser. However, there is still the fundamental problem on the Internet that most systems do not support HTML5. Even the current browsers do not provide the update functionality, which would cover the needs of today’s speed of development. This topic, however was already discussed in a previous article.
Read the rest of the article »
More Recent Hacking Articles
In database modeling, a m:n relationship is usually resolved by an additional table. But what if this relation is used only for archiving and the number of links in the resulting table is not too high? In that context, I got the idea to store all referring ID’s as CSV string directly into a TEXT column of one of the referring tables. I came to this idea, because otherwise I would have to build complicated foreign keys and this way I also save one additional table. Certainly, this only makes sense if the data is not frequently accessed as foreign key. Nevertheless, I would like to tackle the problem, even if the implementation is very MySQL-oriented.
Read the rest of the article »
At the beginning of a new project, one is faced with the question if MySQL’s strict mode should be used or if the default behavior is sufficient for most scenarios. This mode certainly makes only sense if you evaluate the error codes and acting accordingly in the application – thus, it would be a bad idea to apply SQL modes to a running system. Unfortunately, SQL modes are not really common and have thereby a few bugs. Also the fact, that the user can bypass the mode in the session raises the question whether it makes sense to use these settings at all. I decided to only set a selected list of options; just what really makes sense and improve the behavior of MySQL. Strangely that these modes are not set by default, what one might expect, as they are close to a natural approach of databases usage.
Read the rest of the article »
The easiest way to get user statistics from your own site is probably binding third-party tools like, e.g. Google Analytics into your code or parsing the logfiles with AWstats or webalizer. Evaluating your own logged data is the best way to look over the (imaginary) shoulder of users and bots. Moving static content on different servers remain the accesslog also manageable and free from unnecessary data.
Read the rest of the article »
Probably the biggest problem of a high degree of specialization may be that learning outcomes can be long in coming if you do not even open up new areas of studies for yourself. So I was looking for a system that I’ve never used before. The second criterion was that I wanted to quickly achieve results to have something demonstratable at the end of the day. Thus, I have to announce two new jQuery plugins, which are really useful – at least, I hope you also see the benefits 🙂
Read the rest of the article »
In early 2007, a nice trick made the circuit to reduce parallel connections by bundling CSS and JavaScript files to one larger file. I immediately started the research to optimize this approach. But why should you combine static files at all?
Read the rest of the article »
Imagine we have a user table in MySQL and similarly, a products table. Each user can now busily buy items. But this is not what this article is all about. This article is more about, that users can also favor articles they like. From a database point of view, this represents a m:n relation, which is resolved by an additional table. We now want to display a list of all products and all users who favor a specific article. In real world scenarios, this can be a really big amount of data, but let’s bring an approximation later into play and focus on the main idea for the moment. In addition we want to know, if the person who is actually logged in into the system, already favors a certain product.
Read the rest of the article »
A few years ago, I’ve started creating a list of features, that web-browsers should be able to do, to build rich Internet applications without complicated tweaks and hacks. The time passed away and nowadays, many creative heads concern on web-development, thus some of my ideas landed in HTML5 or other web-standards, without my help. So, I want to show an extensive collection about techniques of browsers, which are already implemented, and which are still needed for developers to design the Internet of the future.
Read the rest of the article »
With my last HTML5 experiment «Space Shooter», I had to solve a problem of checking, if an angle is between two other angles. Sounds easy for the first moment, but let’s see, if there is not the one or the other portion of trouble in it.
Read the rest of the article »
In a few scenarios, I prefer using the data-type TIMESTAMP of MySQL, with the flag ON UPDATE CURRENT_TIMESTAMP. This is much easier and even faster than using a trigger which sets a specified column to NOW() or CURRENT_DATE(). I love this feature, when it comes to set last modified flags of tables. Now, I encountered a problem with a tagging table by using the flag. Every tag in the table has besides the tag-name, also the aggregated number of relations and a timestamp of last update (or the insert). Everything is okay, until you want to update the aggregated column, when the numbers are wrong for any reason.
Read the rest of the article »
Originally posted on June 7th, 2010.
A useful feature of statistical systems in social networking backend’s is the analysis of when members are mostly, or better said, in average online. Imagine, that we have a database table to store DATETIME-timestamps of when users logged in, which could look like this:
Read the rest of the article »
Originally posted on June 4th, 2010. 1 comment
The Caesar cipher is one of the simplest encryption algorithms in which every latin letter of a given string is simply shifted cycliacally by a certain offset.
Read the rest of the article »
I’ve already mentioned the topic integer-multiplication optimization in the article about my mathematical failures. I was quite obsessed with the idea and while I looked over some results of this optimization method, I noticed a beautiful pattern in the binary representation. I wrote a small algorithm to get all possible numbers which can be optimized a bit as constant factor of a multiplication. The algorithm is implemented in JavaScript, so if you’re interested in the source code, feel free to read it.
Read the rest of the article »
It’s quite natural to use features of the main programming language used in a project to generate user thumbnails or thumbnails of other images. Let’s assume, that we generate 3 sizes of every picture. With a rigid system, you would generate every size and store them temporarily on the webserver until it wasn’t uploaded to the static server. That means we have a lot of write operations on the webserver to generate the small pictures and finally writes to upload each of these pics to the static server – the CPU cycles intentionally left out.
Read the rest of the article »
When I celebrated my birthday, I got the idea that there must theoretically be a date on which two peoples ages are in a certain ratio. The basic idea were born when I thought that there must be a date on which my mother is exactly twice as old as me. Actually, this is the point of time when I’m as old as my mother was, when I were born. That means
Read the rest of the article »
-34.500808
-58.644458
Me gusta esto:
Me gusta Cargando...
Debe estar conectado para enviar un comentario.