Eseguire ASP.NET vNext su Mac OS con Kulture e Omnisharp

L’articolo descrive come eseguire ASP.NET vNext con sistema operativo Mac OS X. La procedura richiede alcuni passaggi e un po’ di pazienza. Fortunatamente OS X include già il prerequisito Ruby: versione 2.0 su Mavericks/Yosemite, 1.8.7 su Mountain Lion, Lion e Snow Leopard. Sublime Text Un text editor avanzato molto diffuso per Mac OS X è Sublime Text{:target="_blank"}. Personalmente lo uso anche in Windows per sviluppare soluzioni Salesforce.com{:target="_blank"} o per prendere note e redigere articoli in HTML. Altri editor supportati all’epoca della scrittura erano: ...

December 20, 2014 · 2 min · Andrea Azzola

Logging with NLog and SQLite

This article explains how to achieve a portable and elegant logging solution with NLog and SQLite on the .NET platform with a few configurations. NLog NLog is a free, lightweight logging library for .NET. It supports many targets (files, databases, console, network, email, and more). nlog-project.org Install (NuGet Package Manager Console) PM> Install-Package NLog SQLite SQLite is a simple embedded database engine. No separate server daemon is required; the database is a single file (e.g., .db3). ...

May 6, 2014 · 2 min · Andrea Azzola

MavensMate unable to reach GitHub on Windows

MavensMate was a popular community plugin for the Force.com platform, built on the Sublime Text IDE (created and maintained by Joe Ferraro) as a free alternative to the official Force.com IDE. Under certain conditions on Windows 7/8 (often proxy/firewall configurations), installation could fail with an error similar to: Installation of Sublime Text plugin failed. This is likely due to the installer being unable to reach GitHub. If you are behind a firewall or using a proxy, you should configure git accordingly (google: git config --global https.proxy) and ensure your HTTPS/HTTPS_PROXY environment variable(s) are set properly. Otherwise, please log an issue on the MavensMate GitHub project. There is an existing GitHub issue with a workaround suggested by Joe Ferraro. The steps that worked for me were: ...

April 6, 2014 · 1 min · Andrea Azzola

Search Email Inbox with C#

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. ...

March 27, 2014 · 1 min · Andrea Azzola

Manage and format Dates with JavaScript

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: ...

November 14, 2013 · 2 min · Andrea Azzola

Ichigo, an ASP.NET Blogging Engine

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. ...

November 12, 2013 · 2 min · Andrea Azzola

Get Size of Tables with SQL Server

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;

October 16, 2013 · 1 min · Andrea Azzola

Future Count with Apex Code

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; } }

July 14, 2011 · 1 min · Andrea Azzola

Simulating a RequiredFieldValidator with RadComboBox

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. ...

October 22, 2010 · 1 min · Andrea Azzola

Turn Sentences into Slugs with JavaScript

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. ...

October 20, 2010 · 1 min · Andrea Azzola