Earlier music projects and historical technical notes are collected in the Archive.
Prefer browsing by topic? See all categories.
Earlier music projects and historical technical notes are collected in the Archive.
Prefer browsing by topic? See all categories.
Note (2025): This post dates back to 2014 and uses password‑based IMAP access for Gmail. Modern Gmail/Google Workspace typically requires OAuth 2.0 and app passwords/“less secure apps” are disabled. The example is kept for archival purposes; adapt authentication accordingly in new projects. A few years ago I helped manage a radio and I needed a tool—an ASP.NET web page—for the periodical download of promo mixes. They were linked in emails recognizable by a few keywords. ...
Multitasking means the capability of executing multiple tasks concurrently. The *multitasking* concept find its origins in the computer industry. Nowadays consumer computers, phones, tablets are perfectly capable of running multiple logics in the same time window, they've become so good at this that some company are already focusing toward the next big step, [anticipatory computing](https://en.wikipedia.org/wiki/Anticipation_(artificial_intelligence)) (eg: Google Now). Assisted *multitasking* brings huge benefits in terms of productivity, some computations can be anticipated and so them results, which is a huge win for everyone. But other than devices, can, our brain, multitask? The answer is apparently, *no*. Subconscious mind Technically speaking, we are constantly multitasking. Breathing, like heartbeat, belongs to a subset of tasks handled by our subconscious mind and these tasks represent one exception. ...
Update (2025): This article was written in 2013. It still offers useful basics, but a few notes: Date.getMonth() is zero‑based (January = 0). Date.getDay() returns the weekday (0–6), not the day of month. There is no setDay() or setUTCDay() method in JavaScript. Moment.js is in maintenance mode; modern alternatives include Luxon, date‑fns, and native Intl.DateTimeFormat. Consider these for new projects. JavaScript has a Date object you can use to handle dates. Supported constructors are: ...
With this post, I intend to leave a trace of the specs of this blog. I started this project in 2008 and never publicly mentioned it. Codename is Ichigo, named after Kurosaki Ichigo, the main character of the manga series Bleach by Tite Kubo. There’s no particular reason for the reference—I just like the manga. Since then, the blog has been a playground to experiment with technologies, including Entity Framework, Dynamic Data, URL Routing, ASP.NET AJAX, jQuery, @font-face, and OAuth. ...
The following solution involves two popular SCM tools (SVN and Git), an always‑on server (I use Windows, but the cloud works as well) and a few free tools. You will need the Force.com Migration Tool, Apache Ant, and Java JDK. Start by setting things up with the following checklist: Java JDK Apache Ant Force.com Migration Tool Cygwin Shell or Git Bash SVN Client (if using SVN) Setup Create a working folder and scripts: ...
A snippet for getting the size for all tables in a SQL Server database that might prove useful to: understand where most of your data is going find database bottlenecks free up disk space reduce maintenance cost WITH table_space_usage (schema_name, table_name, used, reserved, ind_rows, tbl_rows) AS ( SELECT s.name, o.name, p.used_page_count * 8, -- KB p.reserved_page_count * 8, -- KB p.row_count, CASE WHEN i.index_id IN (0,1) THEN p.row_count ELSE 0 END FROM sys.dm_db_partition_stats AS p INNER JOIN sys.objects AS o ON o.object_id = p.object_id INNER JOIN sys.schemas AS s ON s.schema_id = o.schema_id LEFT OUTER JOIN sys.indexes AS i ON i.object_id = p.object_id AND i.index_id = p.index_id WHERE o.type_desc = 'USER_TABLE' AND o.is_ms_shipped = 0 ) SELECT t.schema_name, t.table_name, SUM(t.used) AS used_in_kb, SUM(t.reserved) AS reserved_in_kb, SUM(t.tbl_rows) AS rows FROM table_space_usage AS t GROUP BY t.schema_name, t.table_name ORDER BY used_in_kb DESC;
When working with Apex code that iterates a lot, you may encounter a truncated log. The error looks like this: MAXIMUM DEBUG LOG SIZE REACHED At the time of writing, the maximum allowed size for a debug log is 2 MB. The default monitoring level for Apex code includes a lot of clutter you usually don’t need (like METHOD_ENTRY, METHOD_EXIT). By common practice, you should put a log filter on the monitored user, or on the classes involved in the transaction by using an override flag. ...
A simple snippet for counting @future calls in a 24‑hour timespan, useful for monitoring peaks and acting accordingly. Please note: supports up to 50,000 future calls in a 24h timespan. public with sharing class AsyncApexJobUtils { public static integer futureCount() { integer c = [select count() from AsyncApexJob where JobType='Future' and CreatedDate >= :Datetime.now().addDays(-1) limit 50000]; system.debug('#futureCount: ' + c); return c; } }
Telerik’s RadComboBox does not behave like a traditional DropDownList. Instead of a RequiredFieldValidator, you should use a CustomValidator. Here’s an implementation. Step 1: Markup <asp:Label ID="lblExample" runat="server" AssociatedControlID="rcbExample" Text="Example" /> <telerik:RadComboBox ID="rcbExample" runat="server" /> <asp:CustomValidator ID="cvlExample" runat="server" ControlToValidate="rcbExample" Text="*" ClientValidationFunction="cvlExampleValidate" OnServerValidate="cvlExample_ServerValidate" /> Step 2: Client-side validation function cvlExampleValidate(source, args) { args.IsValid = radComboValidate("<%= rcbExample.ClientID %>"); } function radComboValidate(controlName) { var combo = $find(controlName); var text = combo.get_text(); if (text.length < 1) return false; var node = combo.findItemByText(text); if (node) { var value = node.get_value(); return value.length > 0; } return false; } Step 3: Server-side validation protected void cvlStatus_ServerValidate(object source, ServerValidateEventArgs args) { args.IsValid = rcbStatus.SelectedValue.Length > 0; } Note (2025): This article is from 2010. Telerik’s RadControls have evolved significantly since then; check the current Telerik UI for ASP.NET AJAX documentation for modern practices. ...
This simple script converts a text string into a valid URL slug. It mixes jQuery with standard JavaScript, and can be easily adapted to pure JS. <!-- Example input element --> <input id="controlId" type="text" /> // Handles typing $(document).ready(function () { // If the Title is specified, avoid overwrite if ($('#controlId').val().length === 0) { $('#controlId').on('keypress', function () { $('#controlId').val(slugify($('#controlId').val().toLowerCase())); }); } }); // Replacements function slugify(text) { text = text.replace(/[^-a-zA-Z0-9,&\s]+/g, ''); text = text.replace(/-/g, '_'); text = text.replace(/\s/g, '-'); return text; } Note (2025): For modern projects you may also want to normalize accents (é → e), trim repeated separators, and prefer input event instead of keypress. This post keeps the original 2010 logic. ...
Allow Google Analytics to help understand how this site is used? Analytics stays off unless you accept. You can change your choice using Cookie settings. Privacy policy