Showing posts with label software. Show all posts
Showing posts with label software. Show all posts

Just got the C# gold badge at StackOverflow

This is a “marketing” post… Open-mouthed smile Just kidding.

This is just to inform that I got the C# #Csharp gold badge at #StackOverflow @StackExchange after 5 years and 6 months and 342 answers posted on the C# tag! What a milestone towards a so awesome programming language.

C# gold badge earned at StackOverflow

Once when I was starting back in 2003 a somewhat experienced coworker told me: this thing [ coding ] is not for you.

I proved him wrong!

The lesson to be learnt here is: never trust others when they say you are not capable even more when you are just starting something. Instead use that as a trampoline. Not easy but you must not give up. Keep pushing always.

People that motivate us are a rare kind. So use this post as a motivation and BEFORE that remember: put God first in everything you start in your life. I remember at that time in my life I talked to God and told him that I really liked this profession|area and asked for his help so that he could guide me and provide me wisdom. Here I’m today being able to write this post. How grateful I’m.

To top that, last week a cousin (13 years old) approached me and told me he’d like to follow the same path I followed and asked what I did to get where I’m today. I answered: you have to have a passion for what you do, strive for excellence and be prepared to spend some good amount of time trying and trying... as I wrote above: don’t give up. There’ll be for sure many rocks on the road… The Long and Winding Road as sung by The Beatles is a truth but if you persist in what you really believe then success is a matter of time.

Somehow sometime somewhere God will move things in your favor.

And we know that all things work together for good to them that love God, to them who are called according to his purpose. Romans 8:28 https://www.bible.com/bible/1/rom.8.28

A snapshot of my StackOverflow profile on the day I got the C# gold badge

http://stackoverflow.com/users/114029/leniel-macaferi

Leniel’s Software House (software customizado para seu negócio)

MP3 Scan+Repair tool for iTunes on Mac OS

This is another post to add to my MP3 series

Yesterday I tried to add/import a folder full of MP3 files to my iTunes library. Just after adding I opened iTunes and went check those MP3s. To my surprise the MP3s were not added to iTunes. I had a hard time trying to find those files since iTunes moved them from their initial location to a special folder called Not Added. My MP3s ended up here:

/Users/leniel/Music/iTunes/iTunes Media/Automatically Add to iTunes/Not Added/2012-01-16 14.34.38

Note that iTunes created a folder inside Not Added named with the date and time the import operation occurred. The folder Not Added also stores image files and whatever file iTunes doesn’t recognize as valid files to be imported.

Now I see that I have some folders like that one - that are being created since 2010-9-17 (when I bought my Mac mini) and some of those folders have MP3 files that I didn’t notice were missing in my library. Smiley decepcionado

MP3 Scan+Repair LogoThen I realized that for some odd reason iTunes rejected those files. I googled about it with "iTunes won't import MP3" and to my delight I found a forum thread in which the user Afric Pepperbird recommended a fantastic tool called MP3 Scan+Repair by Christian Zuckschwerdt. Using this great piece of software I managed to add those MP3s to my iTunes library.

So as way to say thanks I decided to write a post to demonstrate how it works.

1 - Download MP3 Scan+Repair (it's in Beta and is free for the moment)

http://triq.net/articles/mp3-scan-repair-download

2 - Open the App and drag and drop the problematic folder (the one that lies within the Not Added folder) to the app screen:

MP3 Scan+Repair main screenFigure 1 - MP3 Scan+Repair main screen

3 - Select all the files using command+A and then click the hammer button (mouse button is over it) to repair the files:

MP3 Scan+Repair listing the files and their respective problemsFigure 2 - MP3 Scan+Repair listing the files and their respective problems

See the Messages column with the description of what’s wrong with each file… even warnings prevent iTunes from adding the MP3 file to its library.

When repairing MP3 Scan+Repair will try to recreate the MP3s moving the old ones to the trash and writing the new ones to the current folder.

After following these easy steps you should be good to go and add those MP3s files to your iTunes media library.

The app is straightforward and does what it advertises… I’m really satisfied!

Xcode iPhone beginner projects with GitHub integration

I decided to follow a different path to learn software development for the iPhone - instead of online tutorials and Apple docs I got a book. I postponed my desire to learn but it’s time to revive it. I grabbed a beginner’s book on the subject: A Beginner's Guide to iOS SDK Programming by James A. Brannan & Black Ward. This book covers iOS 4.2 + Xcode 4. iOS 5 is on the verge of being released…Smiley confuso

I had to download the recent Xcode and its accompanying SDK bits again ( 3.17 GB ) as the ones I had installed were out of date (from September 2010) Smiley pensativo. It was just a matter of hitting Mac App Store and looking for Xcode. The download has everything you need to install to be able to follow the book samples.

As I started creating the sample projects in Xcode I thought it’d be an excellent opportunity to store these samples in an online repository ( repo ) with source code control for further reference and to share/allow the beginner developer to download and study all the samples. It’s also a good chance I have to play with Git since I’ve been using Subversion during the last years.

This post covers the basics to integrate Xcode with GitHub for the Mac OS user. GitHub is a web-based hosting service for software development projects that use the Git revision control system.

I try to synthetize lengthy and scattered docs you find on the subject and provide links to key docs and posts…

I learned how to use Xcode Organizer to integrate my online GitHub repository with Xcode built in support for software control management and started sending the projects to GitHub right after the second book sample. It’s better to start early or you’ll never do it!

This article in Mac OS Developer Library: Managing Versions of Your Project has everything you need to configure your project to use it with Git.

When you create an online/remote repository in GitHub you get instructions on how to set up the repo as getting a copy of the repo to work locally in your computer or sending an existing project to the remote repo. This help article from GitHub clarifies some things: Set up Git in Mac OS.

This post has the steps you have to follow to get a GitHub repo to work with Xcode projects: Version Control System with XCode 4 and Git Tutorial.

You’ll have to use Mac OS Terminal to type some commands. Nothing difficult.
As a matter of fact you should familiarize yourself with Terminal if you haven’t yet. The real fun is when you play with git commands in Terminal (take for example the powerful rebase command). Later in this post I’m going to use the support offered by Xcode which has UI for basic git commands as commit, push, pull, merge, etc - but Xcode doesn’t give you the power of the full set of git commands that are only available through the command line.

These are the Terminal commands I typed to send the book’s initial sample projects (QuickStart and C Main Project) to my remote repository located at GitHub: https://github.com/leniel/iPhone-Beginner-Guide
Take a special look at the highlighted commands:

Last login: Fri Aug 19 19:29:32 on ttys001
Leniel-Macaferis-Mac-mini:~ leniel$ cd /
Leniel-Macaferis-Mac-mini:/ leniel$ cd iPhone
Leniel-Macaferis-Mac-mini:iPhone leniel$ cd Local
Leniel-Macaferis-Mac-mini:Local leniel$ ls
C Main Project                iPhone Beginner's Guide.xcworkspace
QuickStart
Leniel-Macaferis-Mac-mini:Local leniel$ cd QuickStart
Leniel-Macaferis-Mac-mini:QuickStart leniel$ ls
QuickStart        QuickStart.xcodeproj
Leniel-Macaferis-Mac-mini:QuickStart leniel$ git remote add origin git@github.com:leniel/iPhone-Beginner-Guide.git
Leniel-Macaferis-Mac-mini:QuickStart leniel$ git push -u origin master
Counting objects: 16, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (14/14), done.
Writing objects: 100% (16/16), 8.27 KiB, done.
Total 16 (delta 2), reused 0 (delta 0)
To git@github.com:leniel/iPhone-Beginner-Guide.git
* [new branch]      master -> master
Branch master set up to track remote branch master from origin.

Leniel-Macaferis-Mac-mini:Local leniel$ cd "C Main Project"
Leniel-Macaferis-Mac-mini:C Main Project leniel$ ls
C Main Project            C Main Project.xcodeproj
Leniel-Macaferis-Mac-mini:C Main Project leniel$ git push -u origin master
To git@github.com:leniel/iPhone-Beginner-Guide.git
! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:leniel/iPhone-Beginner-Guide.git'
To prevent you from losing history, non-fast-forward updates were rejected.
Merge the remote changes (e.g. 'git pull') before pushing again.
  See the 'Note about fast-forwards' section of 'git push --help' for details.
Leniel-Macaferis-Mac-mini:C Main Project leniel$ git pull origin master
warning: no common commits
remote: Counting objects: 16, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 16 (delta 2), reused 16 (delta 2)
Unpacking objects: 100% (16/16), done.
From github.com:leniel/iPhone-Beginner-Guide
* branch            master     -> FETCH_HEAD
Merge made by recursive.
QuickStart.xcodeproj/project.pbxproj             |  288 ++++++++++++++
QuickStart/QuickStart-Info.plist                 |   38 ++
QuickStart/QuickStart-Prefix.pch                 |   14 +
QuickStart/QuickStartAppDelegate.h               |   19 +
QuickStart/QuickStartAppDelegate.m               |   73 ++++
QuickStart/QuickStartViewController.h            |   13 +
QuickStart/QuickStartViewController.m            |   44 +++
QuickStart/en.lproj/InfoPlist.strings            |    2 +
QuickStart/en.lproj/MainWindow.xib               |  444 ++++++++++++++++++++++
QuickStart/en.lproj/QuickStartViewController.xib |  156 ++++++++
QuickStart/main.m                                |   17 +
11 files changed, 1108 insertions(+), 0 deletions(-)
create mode 100644 QuickStart.xcodeproj/project.pbxproj
create mode 100644 QuickStart/QuickStart-Info.plist
create mode 100644 QuickStart/QuickStart-Prefix.pch
create mode 100644 QuickStart/QuickStartAppDelegate.h
create mode 100644 QuickStart/QuickStartAppDelegate.m
create mode 100644 QuickStart/QuickStartViewController.h
create mode 100644 QuickStart/QuickStartViewController.m
create mode 100644 QuickStart/en.lproj/InfoPlist.strings
create mode 100644 QuickStart/en.lproj/MainWindow.xib
create mode 100644 QuickStart/en.lproj/QuickStartViewController.xib
create mode 100644 QuickStart/main.m
Leniel-Macaferis-Mac-mini:C Main Project leniel$ git push -u origin master
Counting objects: 14, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (13/13), 3.95 KiB, done.
Total 13 (delta 3), reused 0 (delta 0)
To git@github.com:leniel/iPhone-Beginner-Guide.git
   05ec270..fe84a7a  master -> master
Branch master set up to track remote branch master from origin.
Leniel-Macaferis-Mac-mini:C Main Project leniel$

Great! With the above commands I have sent both projects to my repo located at GitHub.

It’s important to note that for each project I created in Xcode I selected the option to create a local git repository as shown in Figure 1:

Xcode - Selecting Create local git repository for this projectFigure 1 - Xcode - Selecting Create local git repository for this project

With this in place I can now safely delete my local copy of both projects (folder Local I used above in Terminal commands) and work directly with the code of my remote repository. Let’s do it:

Open Xcode Organizer selecting the menu Window => Organizer:

Organizer window accessible through Xcode’s Window menuFigure 2 - Organizer window accessible through Xcode’s Window menu

I suppose you have already configured and added (+ button in the bottom left of Figure 2) your GitHub repo (green circle in Figure 2) to the Organizer following the docs I linked above.

To get a local working copy of your remote repository you must click the Clone button (see bottom part of Figure 2) and choose a location to place the repo files. After doing this you’ll get a new repo (mine is located in the folder /iPhone/iPhone-Beginner-Guide as you see in Figure 2). When I click my local copy of the repo I get this beautiful screen where I can see commit comments and changes I made to each file along the way (click to enlarge):

Local ( Clone ) copy of my online GitHub repository seen in Xcode OrganizerFigure 3 - Local ( Clone ) copy of my online GitHub repository seen in Xcode Organizer

Now it’s just a matter of working and modifying the project files or adding new projects and commit them to the repository through the menu File => Source Control => Commit…

One more important note is: when you commit something, it’s just committed in your local copy. You need one additional step: push the changes to GitHub. In Xcode you can select the file(s) or project(s) you want and go to File => Source Control => Push… For more on this, read: Commit Files to Add Them to a Repository.

In my case, when I select Push I get this Xcode dialog where I can select the Remote endpoint (GitHub repository) to which my committed files will go:

Xcode Push user interface and GitHub remote locationFigure 4 - Xcode Push user interface and GitHub remote location

As a bonus I created a Workspace as seen in Figure 5 to have all the sample projects at hand in a single Xcode window. The workspace has references to the projects and work somewhat like Microsoft Visual Studio’s solution file if you’re used to Microsoft developer tools. The workspace helps a lot during the commit and push tasks!

Xcode workspace with projects at left side paneFigure 5 - Xcode workspace with projects at left side pane

Well, I’m new to this new Xcode world and I think I’ll learn a lot from these simple sample beginner projects.

The next thing I'm gonna do is learn what file types I can ignore when committing… Thanks to StackOverflow there’s already a question addressing this very topic: Git ignore file for Xcode projects

Edit: following the advice of the above StackOverflow question, I added a .gitignore file to the repo.

Hope this helps.

Sistema para Gerenciamento de Academia de Ginástica

Esta é uma aplicação web que nasceu através de uma parceria entre mim (o único desenvolvedor) e o proprietário de uma academia de ginástica ( a qual eu frequento ). O sistema está em uso e o proprietário/usuário está muito satisfeito.

A aplicação valoriza a simplicidade e é super fácil de usar.

A figura a seguir mostra a home page de onde o usuário pode acessar as funcionalidades da aplicação. Clique nela para ver uma versão ampliada...

Página inicial da aplicação Fitness Center

A aplicação é composta por 5 módulos e possui Controle de Acesso baseado em cargos (Administrador, Professor, Usuário, etc).

Módulos
- Alunos
- Anamneses
- Medidas
- Pagamentos
- Relatórios ( baseados em gráficos e listas )

O sistema está disponível em Português do Brasil (pt-BR) e Inglês (en-US). Ele tem tudo pronto para o caso em que exista a necessidades de localizações adicionais. É completamente viável ter a aplicação em execução em qualquer outra cultura/idioma com pouco trabalho.

Estilos/cores/formatação e logotipo podem ser personalizados usando (CSS).

Tecnologias
A aplicação usa o estado da arte das tecnologias da pilha Microsoft, bem como bibliotecas de código aberto:

C#, .NET Framework 4, ASP.NET MVC 3, SQL Server Compact 4.1, CSS, jQuery 1.5.2, jQuery UI 1.8.12, jQuery Globalization 1.0, jQuery qTip2, modernizr 1.7, Microsoft MVC Ajax, Microsoft Chart Controls for. NET 4, WebGrid, Chirpy

Telas
Você pode ver screenshots da aplicação aqui.

Descrição
As seções subsequentes descrevem cada módulo e as ações que o usuário tem permissão para executar.

A lógica de negócios também é descrita ao longo do caminho se eu ver que ela se encaixa na descrição do módulo.

Não é minha intenção descrever cada regra de negócio da aplicação neste post. Este post é uma visão geral.

Alunos
Ações: Criar, Editar, Detalhes, Excluir
Este módulo trata de dados básicos do aluno como foto, nome e sobrenome, data de nascimento, endereço, sexo, telefone, e-mail, etc. 
Tudo no sistema está relacionado ao aluno. Isto significa que se um aluno é excluído, os dados de cada módulo que fazem referência aquele aluno também serão excluídos.
Alunos que estão em débito são destacados em vermelho na lista/grid de alunos.
Se o nome de um aluno é clicado na lista de alunos, o sistema leva o usuário à lista de pagamentos do respectivo aluno.

Anamneses
Ações: Criar, Editar, Detalhes, Excluir
Este módulo manipula as informações básicas sobre o histórico de saúde do aluno, tais como se o aluno é hipertenso, diabético, fumante, etc. Diferentes tipos de doenças também podem ser selecionados. Estas doenças são agrupadas em categorias, tais como doenças dos ossos e articulações, respiratórias e doenças da tireoide. O estilo da atividade física na qual um aluno se encaixa quando ele se matricula na academia também pode ser selecionado.

Medidas
Ações: Criar, Editar, Detalhes, Excluir
Este módulo trata das medidas das circunferências do corpo do aluno. Estas são as medidas que o sistema controla:
- Altura (m)
- Peso (kg)
- Gordura (%) 
- Pescoço (m)
- Tórax (m)
- Glúteos (m)
- Ombro (m)
- Abdome (m)
- Cintura (m)
- Braço Esquerdo (m)
- Braço Direito (m)
- Coxa Esquerda (m)
- Coxa direita (m)
- Panturrilha Esquerda (m)
- Panturrilha Direita (m)

O usuário é notificado através da lista de medidas se é hora de tomar novas medidas de um aluno. O intervalo de tempo entre as avaliações (medidas) pode ser configurado no sistema. Atualmente está definido como um intervalo de três meses.
A % de Gordura é calculada pelo sistema através de uma fórmula padrão (ver link). Se o usuário passar o mouse sobre o cabeçalho da coluna (%) Gordura na listagem de medidas ele verá uma tabela com valores padrão para % de gordura que inclui Essencial, Atleta, Fitness, Média e Obeso.

Pagamentos
Ações: Criar, Editar, Detalhes, Excluir
Este módulo é o coração do sistema, uma vez que lida com o que podemos chamar de a Raison d'être (razão de ser) de um sistema como este.
O sistema permite a criação de pagamentos para um determinado aluno.
O usuário define um valor de desconto (se necessário) e o campo total é calculado automaticamente. Depois disso uma data de pagamento deve ser selecionada. Há também um campo de observação no qual o usuário pode anotar alguma coisa importante relacionada ao pagamento.
O usuário sinaliza que o pagamento foi realizado marcando o campo pago.
Sempre que um pagamento é marcado como pago, o sistema gera um novo pagamento automaticamente (cópia do pagamento feito) para o mesmo aluno com a data de vencimento 1 mês à frente.

Relatórios
Este módulo gera 4 tipos de relatórios. São eles:

- Total de Pagamentos (gráfico)
O usuário seleciona uma data de início e uma data de fim para gerar um gráfico de colunas que agrupa os pagamentos por mês.

- Pagamentos em Atraso/Vencidos (grid/lista) 
O sistema gera automaticamente um relatório em formato de lista extraindo os dados dos pagamentos que têm uma data de vencimento inferior a uma data especificada. Por exemplo: pode-se conceder uma margem (em dias) para que o sistema considere que o aluno está em débito - 1 semana, 2 semanas, etc após a data do vencimento do pagamento. Isso pode ser configurado no sistema.

- % Alunos Ativos/Inativos (gráfico)
O sistema gera automaticamente um gráfico em formato de pizza que retrata muito bem essa informação.

- Medidas ao Longo do Tempo (gráfico)
O usuário seleciona um aluno e uma data de início e fim para gerar um belo gráfico de linhas que mostra o aumento/diminuição das medidas ao longo do tempo.

Por que comprar?
O principal benefício é que você terá um ponto central para gerenciar sua Academia de Ginástica. A partir dele você pode extrair informações valiosas dos dados. Isto te permite estar sempre um passo à frente para planejar seu próximo passo. Não haverá mais anotações em cadernos e com isso você deixará de perder dados importantes!

Instalação
A aplicação é um arquivo .zip (arquivo compactado) e possui todo o que é necessário para ser executada em um servidor web que tenha o .NET Framework 4 instalado.

Se precisar de ajuda adicional no que diz respeito à hospedagem web/instalação e configuração, eu também posso fazer isso por você. É só me avisar.

Há também a possibilidade de executar a aplicação em um servidor web local usando Microsoft WebMatrix por exemplo. É assim que instalei o sistema no computador do usuário. Fazendo dessa forma você não terá que pagar um provedor de hospedagem on-line. A única desvantagem neste caso é que você não será capaz de acessar a aplicação a partir de qualquer lugar.

Como comprar?
Basta clicar no botão abaixo para comprar esta app barata ( somente R$ 1.200,00 ) através do PayPal:


Depois de clicar no botão acima e concluir o processo de pagamento, escreva para mim e me informe sobre sua compra. Poderei, então, dar prosseguimento no processo de negociação entregando para você a aplicação através de e-mail. A aplicação está contida em um arquivo .zip pequeno ~4MB.

Software é um campo muito interessante porque você trabalha muito para construir uma aplicação, digamos meses, e o produto é apenas um pacote de alguns megabytes. Vai entender…

Direitos autorais
Este produto de software é protegido por direitos autorais.

Você pode ler a EULA aqui (em construção).

Suporte
Ficarei mais do que feliz em fornecer qualquer informação adicional que você precise para que a aplicação seja instalada e funcione em seu servidor.

Se você encontrar algum bug na aplicação eu prontamente irei corrigi-lo e disponibilizarei a aplicação atualizada para você.

Recursos adicionais
Se você precisar de qualquer outro recurso, seja ele um novo módulo ou relatório que não faz parte desta aplicação, apenas me informe e o considerarei para uma versão futura.

Software to automate website screenshot capture

I needed a software that allowed me to capture screenshots of a web application I developed. The software should do it automatically (batch capture). This way it’d save me a lot of time.

How do I used to do that?
I visited each web page I wanted to take a screenshot. It took me about 1 hour to finish the work.

I posted a question at Super User as always: Software to automate website screenshot capture and got an answer suggesting that I use a combination of a URL fetcher + Selenium capability to take screenshots.

Well, I tried Selenium (.NET bindings selenium-dotnet-2.0rc3.zip ) to test its screenshot capture feature but it doesn’t seem to fit the job because it doesn’t allow you to configure screenshot properties as size (height x width). Moreover it doesn’t work well with Ajax (requires you to write a lot of code to check for the existence of Ajax calls, etc). This kills a screenshot that needs everything in place (I mean every DOM object should be part of the screenshot). I tried the 3 drivers available: Internet Explorer, Firefox and Chrome. Screenshots taken with Internet Explorer driver were close to what I expected.

This is a sample code I used based on the code taken from here:

using System;
using System.Drawing.Imaging;
using System.Text;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.IE;
using OpenQA.Selenium.Support.UI;

namespace SeleniumTest
{
    [TestFixture]
    public class SeleniumExample
    {
        private FirefoxDriver firefoxDriver;
    
        #region Setup

        [SetUp]
        public void Setup()
        {
            firefoxDriver = new FirefoxDriver();
        }

        #endregion

        #region Tests

        [Test]
        public void DisplayReport()
        {
            // Navigate
            firefoxDriver.Navigate().GoToUrl("http://localhost/FitnessCenter/Report/TotalPaymentsByPeriod");

            IWebElement startDate = firefoxDriver.FindElement(By.Name("StartDate"));
            
            startDate.Clear();
            startDate.SendKeys("January 2011");

            IWebElement generate = firefoxDriver.FindElement(By.Id("Generate"));
            generate.Click();

            var wait = new WebDriverWait(firefoxDriver, TimeSpan.FromSeconds(5));
            wait.Until(driver => driver.FindElement(By.Id("Map")));

            SaveScreenShot(firefoxDriver.Title);
        }

        /// <summary>
        /// Saves a screenshot of the current error page
        /// </summary>
        public void SaveScreenShot(string fileName)
        {
            // Get the screenshot
            Screenshot screenshot = firefoxDriver.GetScreenshot();

            // Build up our filename
            StringBuilder filename = new StringBuilder(fileName);
            filename.Append("-");
            filename.Append(DateTime.Now.ToString("yyyy-MM-dd HH_mm_ss"));
            filename.Append(".png");

            // Save the image
            screenshot.SaveAsFile(filename.ToString(), ImageFormat.Png);
        }

        #endregion

        #region TearDown

        [TearDown]
        public void FixtureTearDown()
        {
            if (firefoxDriver != null) firefoxDriver.Close();
        }

        #endregion
    }
}

Indeed, Selenium is powerful for what it does, that is, helping you automate browser interactions while you test your code. It even allows you to take a screenshot let’s say when something goes wrong (a test fail for example). That’s great and that’s what it does best. It’s a choice for every operating system since it’s an API that can be programmed against.

Paparazzi! beautiful application iconWhat I needed was something more specialized to take screenshots. A software that allows me to configure screenshot properties. The good news is that I managed to find such piece of software and it’s called Paparazzi! - a very suggestive name by the way. One drawback is that it’s only available for Mac OS. As one would expect, it uses Safari browser engine behind the curtains to capture the screenshots. Paparazzi! has minor bugs but it gets the job done. It doesn’t have documentation. I had a hard time trying to make it work. It has batch capture capability but no docs explaining how to do it. So I hope this post will shed some light…

The following lines describe what I did to achieve my objective with Paparazzi!:

1 - Created a list of URLs I’d like to take screenshots of. Like this (one URL per line):

http://192.168.1.106/FitnessCenter/Account/ChangeCulture?lang=en&returnUrl=%2FFitnessCenter%2F
http://192.168.1.106/FitnessCenter/Student
http://192.168.1.106/FitnessCenter/Student/Create
http://192.168.1.106/FitnessCenter/Student/Edit/79
http://192.168.1.106/FitnessCenter/Student/Details/79
http://192.168.1.106/FitnessCenter/Student/Delete/79
http://192.168.1.106/FitnessCenter/Anamnesis
http://192.168.1.106/FitnessCenter/Anamnesis/Create
http://192.168.1.106/FitnessCenter/Anamnesis/Edit/79
http://192.168.1.106/FitnessCenter/Anamnesis/Details/79

.
.
.

2 - Open Paparazzi! and click the Window menu => Batch capture (really difficult to find this option Disappointed smile ):

Paparazzi! difficult to find Batch Capture menu optionPicture 1 - Paparazzi! difficult to find Batch Capture menu option

3 - Drag and drop a text file .txt (the file that contains the URLs) to the Batch Capture window:

Paparazzi! Batch Capture window surfacePicture 2 - Paparazzi! Batch Capture window surface

Here is where I think I found a limitation and it’s by design. This should definitely not happen IMHO. If you try to add a file clicking on ( + button), Paparazzi won’t let you select a text file. The only way I got it working was selecting the .txt file and then drag and dropping the file to the Batch Capture window.

4 - Configure screenshot properties by clicking the list button (see mouse cursor above it):

Paparazzi! screenshot process basic configurationsPicture 3 - Paparazzi! screenshot process basic configurations

You can define the screenshot size. There are pre-defined values for standard screen resolutions. It allows you to define new presets.

You can also delay the capture to wait the page finish loading, etc.

There are a set of configurations available related to the batch capture functionality. To access these configurations, go to Paparazzi! menu and select Preferences:

Paparazzi! Preferences… menu optionPicture 4 - Paparazzi! Preferences… menu option

The first configuration worth mentioning the Default Filename Format available in the General section:

Paparazzi! General preferences sectionPicture 5 - Paparazzi! General preferences section

Above I’m defining this format:

%t = page title
%Y = year
%m = month
%d = day
%H = hour
%M = minute
%S = second

The example in the picture is pretty clear… Smile

Another set of configurations is available in the Batch capture section:

Paparazzi! Batch Capture preferences sectionPicture 6 - Paparazzi! Batch Capture preferences section

Here you can choose where to save the screenshots as well as the type of the images.

After configuring the batch capture session, it’s the gran finale time...

5 - Click the Play button, go take a coffee and relax while the computer does the job for you Fingers crossed.

Paparazzi! Batch Capture in actionPicture 7 - Paparazzi! Batch Capture in action

Hope you have found this post interesting and that it’s useful to help in documenting a little bit of this small but really powerful application.

Pointing up Now I get all the screenshots in less than 1 minute!

References
Paparazzi!
http://derailer.org/paparazzi/

Fitness Center management software ( web app )

Fitness Center Management System/Web Application
This is a web application that was born in a partnership between me (the only developer) and the owner of a Fitness Center that I happen to be a frequenter/student. It’s currently being used there and he (the owner/user) is really satisfied with it.

The application values simplicity and is super easy to use.

The following screenshot shows the home page from where the user can access the application functionalities. Click it to see a larger version…

Fitness Center Management System Home page

The app comprises 5 modules and has access control based on Roles (Administrator, User, etc).

Modules
- Students
- Anamneses
- Measurements
- Payments
- Reports (chart and grid based reports)

It’s available in Portuguese from Brazil (pt-BR) and English (en-US). It has everything in place in case of additional localization needs. It’s completely viable to have the app running in any other culture/language with little work.

Application styles/colors and logo can be customized using cascading style sheet (CSS).

Technologies
The app uses state of the art technologies from Microsoft stack as well as open source libraries:
C#, .NET Framework 4, ASP.NET MVC 3, SQL Server Compact 4.1, CSS, jQuery 1.5.2, jQuery UI 1.8.12, jQuery Globalization 1.0, jQuery qTip2, modernizr 1.7, Microsoft MVC Ajax, Microsoft Chart Controls for .NET 4, WebGrid, Chirpy

Screenshots
You can see screenshots of the application here.

Description
The subsequent sections describe each module and the actions the user is allowed to perform. Business logic is also described along the way if I see it fits. It’s not my intention to describe every business rule of the application in this post. It’s just an overview.

Students
Actions: Create, Edit, Details, Delete
This module handles basic student data as photo, first and last names, birth date, address, gender, phone, email, etc. 
Everything in the system is related to Student. This means that if a Student is deleted, every other module's data is deleted as well.
Students that are in debt are highlighted in red in the Students list/grid.
If the name of a Student is clicked in the list, the system takes the user to the Payments list of that respective Student.

Anamneses
Actions: Create, Edit, Details, Delete
This module handles basic information about the Student health history such as if the student is hypertense, diabetic, smoker, etc. Different types of diseases can also be selected. These diseases are grouped in categories such as Bones and Joints, Respiratory and Thyroid diseases. The style of physical activity a student currently fits in when he/she joins the Fitness Center can also be selected.

Measurements
Actions: Create, Edit, Details, Delete
This module handles measurements of a Student's body circumferences. These are the measurements the system keeps track:
- Height (m)
- Weight (kg)
- Fat (%)
- Neck (m)
- Thorax (m)
- Buttocks (m)
- Shoulder (m)
- Abdomen (m)
- Waist (m)
- Left Arm (m)
- Right Arm (m)
- Left Thigh (m)
- Right Thigh (m)
- Left Calf (m)
- Right Calf (m)

The user is notified through the measurements list if it's time to take new measurements for a Student. The time interval between measurements can be configured in the system. Currently this is set as a 3 month interval.
Fat (%) is calculated by the system. If the user hovers his mouse over the Fat (%) table header he/she can see a table with standard Fat (%) values that include Essential, Athletes, Fitness, Average and Obese.

Payments
Actions: Create, Edit, Details, Delete
This module is the heart of the system since it handles what we can call the Raison d'être of a system like this.
The system allows the creation of payments for a given Student. The user defines a value, discount (if necessary) and the Total field is automatically calculated. After that a Due date must be selected. There’s also an observation field in which the user can annotate anything important related to that payment. The user signals that a payment was made by checking the Paid field.
Whenever a payment is marked paid, the system automatically generates a new payment (copy of the payment being made) for that same Student with a due date 1 month ahead.

Reports
This module generates 4 types of reports. They are:

- Total Payments ( chart )
The user selects a Start and End date to generate a column chart that groups the payments by month.

- Overdue Payments ( grid/listing ) 
The system automatically generates a grid/listing report extracting data for payments that have a due date less than a specified date. This can be configured in the system.

- % of Active/Inactive Students ( chart )
The system automatically generates a pie chart that depicts very well this information.

- Measurements Over Time ( chart )
The user selects a Student and a Start and End date to generate a beautiful line chart that shows measurements increase/decrease over time.

Why to buy?
I think the main benefit is that you’ll have a centralized point to manage your Fitness Center. From this you can extract valued information from data and be always one step ahead to plan your next endeavor. No more notebook entries and missing important data!

Installation
The app is self-contained in a .zip file that has everything it needs to run on a webserver that has the .NET Framework 4 installed.

If you need additional assistance regarding installation/web server hosting and configuration, I can also do that for you. Just let me know.

There's also the possibility of running the app in a local webserver by using Microsoft WebMatrix for example. This is how I installed it in the user's computer. Doing this way you won't need to pay an online hosting provider. The only downside here is that you won't be able to access the app on the go.

How to buy?
Just click the following button to buy this cheap app ( only $ 600.00 ) through PayPal:

After clicking the button above and completing the payment process, write to me and let me know about the purchase. I can then go further in the negotiation process and handle you the app through e-mail since it’s a small .zip package ~4MB.

Software is a really interesting field because you put a lot of work to construct it, let’s say months and the product is just a package of only a few megabytes. Go figure.

Support
I'll be more than happy in providing any further information you need to get the app up and running on your server.

If you find any bug in the app I'll promptly correct it and send the patched app to you.

Additional features
If you need any other feature, be it a new module or report that is not part of this app, just let me know and I'll consider it for a future release.

More MP3 guessing pattern with Mp3tag in Mac OS

I mentioned in my last MP3 series post that I had the material to write a new post regarding this topic and so today I’m fulfilling the promise I made. I’m going to show how you can use the powerful Swiss Army knife called Mp3tag (Windows “only” app) right within your Mac. Yes, you read it right. You can run Mp3tag using your Mac. Nowadays almost everything is possible… Open-mouthed smile

The great thing here is that there’s a way to use our beloved Mp3tag in Mac OS. I even asked a question at SuperUser where I was trying to find some similar software that I could use in Mac. Here’s the question: Alternative to mp3tag for Mac OS X. Well, after searching a little bit more I found a great site called PlayOnMac. What is PlayOnMac?

PlayOnMac is like wineskin, winebottler or crossover a piece of software which allows you to easily install and use in your Mac numerous games and software designed to run only with Microsoft®'s Windows®.

I then found Mp3tag bundle here. You get a .dmg file which contains Mp3 Tag.app (172.5 MB) on disk. Just mount the .dmg file with a double click and extract the .app file to your Applications folder in Mac OS dock. Doing this you have the power of Mp3tag right inside your Mac. No Windows virtual machine needed/no need to load your bootcamp Windows. It’s good because you’ll have more memory left for your Mac (in the case of a virtual machine) or you won’t spend your time changing the operating system (in the bootcamp case).

Ok, the bundle is a little bit lazy to load and the visual (retro) is Windows like but who mind?

There’s nothing better than a use case to showcase something. Today I need to organize some MP3 tags because their Track - Artist - Title fields are all a complete mess. Some data are already there and some are missing completely. I of course will use Mp3tag guessing pattern feature to solve this.

To get to the Guess values dialog window, click the Actions (Quick) icon in the toolbar and select Guess values in the dropdown menu. Screenshots can be seen here.

Here are the MP3 files before the process:

Mp3tag Guess Values for Track Artist and Title in FileName [ before ]Figure 1 - Mp3tag Guess Values Window for Track Artist and Title in File Name [ before ]

As you see most of the tracks have 1 in the Track field and Title and Artist fields are missing in most of cases. All the information that is missing is present in the Filename field. Really interesting fact.

Let’s take advantage of Filename info and fill the missing tags with that data. How? Using Mp3tag Guess values window.

Source format: %_filename%

Guessing pattern: %track% - %artist% - %title%

Really easy, isn’t it?

What the hell these % symbols are doing here? They are simple placeholders that tell Mp3tag about a specific pattern found in fields of MP3 files. In this specific case, Mp3tag will extract data from the Filename field ( source ). Looking at Figure 1 we see that all file names follow a pattern: Track # - Artist - Title. Such pattern is then passed to Mp3tag in the Guessing pattern field. With this input Mp3tag is able to infer/parse the file names and split them accordingly. Each part will then be used to fill the correct MP3 tags.

Here’s the post-processed MP3 files:

Mp3tag Guess Values Window for Track Artist and Title in File Name [ after ] Figure 2 - Mp3tag Guess Values Window for Track Artist and Title in File Name [ after ]

That’s a much better view and experience within your preferred Media Library software!

Things like this makes me really happy with computers…

Hope you find it as useful as it’s being to me in this hard task of keeping a MP3 collection organized. I at least try my best.

To see more ways of using the Guessing Pattern, check the MP3 series of posts.

Software to add Lyrics to MP3 files ID3 metadata

Take a look at the MP3 series. Probably you’ll find something interesting.

If you're like me, you also like to take a look at the lyrics of music that is currently playing in your computer or mobile device as the iPhone. I do it to learn a bit more of English since its not my main language and of course because I also want to sing along correctly. :)

The iPhone for example allows you to read the lyrics of the current song if the lyrics are present in the MP3 ID3 metadata container. This is pretty cool. If you already have lyrics embedded in your MP3 files you can see them while in a bus trip, waiting for a service, etc.

Every MP3 has a specific field (also know as frame) in its metadata to store lyrics information. It’s just a matter of filling this field with the correct lyrics. This is a hard work to do manually because you have to search for the lyrics and then copy/paste it in the right field. This sounds like a great thing to be done by software instead. Again, that’s what computers are for… save us time.

In iTunes (the media player/library software I use) for example, one would right-click a music file and then select the Get Info context menu option. Then you’d select the Lyrics tab and paste the lyrics in the white huge field making sure to click OK as seen in Figure 1 below:

Adding lyrics to an iTunes music file through the Lyrics tab
Figure 1 - Adding lyrics to an iTunes music file through the Lyrics tab

Some time ago I asked a question at SuperUser site: Software to add Lyrics to MP3 files ID3 metadata. It seems that there are a lot of people (3,356 to be precise as the time of this post) out there looking to accomplish what this post tries to clarify.

When I asked the question I was using Windows and I got good answers.

I also discovered other software by myself as MiniLyrics for Windows at that time. If you’re interested in MiniLyrics, here goes a small tutorial to save the lyrics to MP3 metadata!

MiniLyrics
Right click MiniLyrics icon in the system tray, choose Preferences and then select the Lyrics icon. Under the Save downloaded lyrics in: - select Save lyrics in mp3 file.

Other great feature MiniLyrics has is that while the music is playing the lyrics can be shown on your screen according to what is being sung, that is, the lyrics flows in your screen according to the music timing. Fantastic job from crintsoft people... :)

Besides saving the lyrics to MP3 metadata, there are lots of features and possibilities when it comes to lyrics in MiniLyrics software.

From the official site:

    MiniLyrics Display lyrics for your favorite music!

        * Lyrics plugin software for iTunes, Windows Media Player, MediaMonkey, Winamp, etc. You do not need to change the way you enjoy music.
        * Display scrolling lyrics, you can follow along with the artist and catch every word.
        * Automatically search and download lyrics.
        * Huge lyrics database, and it is expanding everyday.
        * Free Trial version that never expires.

Lyricator
Lyricator as suggested by merv is a fantastic/great/cool piece of software to go with MediaMonkey but it is having some problems currently as you can find in this thread.

I had to resort to other service while Lyricator is being repaired. I found other free software that does the job, but only on a Mac computer (that’s OK because I’ve switched to the Mac world). It's name is Get Lyrical.

Get Lyrical

Get Lyrical doing its job in the background
Figure 2 - Get Lyrical doing its job in the background

    Get Lyrical auto-magically add lyrics to songs in iTunes!

You can choose either a selection of tracks, or the current track. Or turn on "Active Tagging" to get lyrics for songs as you play them.

    You can also browse and edit the lyrics of your iTunes tracks right from Get Lyrical.

I highlighted in yellow above a powerful feature of Get Lyrical. You can even add lyrics to a selection of tracks at once. This is a batch processing feature really welcome when you want to add lyrics to an artist’s complete discography for example.

I’ve been using Get Lyrical for some time now and it is really competent in the job. I highly recommend it.

Useful tips/tricks about everything Mac

This post is where I’ll maintain useful things that I usually do in my day to day while using the computer and that I find nice to know about. They can save you some mouse clicks and most important: save you time.

As time passes by, this page will grow. :)

Adobe Acrobat

How to select only the text of a column of a table in a PDF file?

shift+option and select the text with the mouse.

iTunes

How to go to Current Song playing in iTunes?

command+L

or

You can right click the time bar and select Go to Current Song context menu option.


How to Delete duplicate songs from iTunes?

option+delete and select Keep File


How to delete Album’s embedded artwork from all tracks at once?

Select all tracks from the album. Right click over anyone of them and select the Get Info menu option. Now check the checkbox on the left side of the Artwork field (see screenshot below). Click OK and voila, iTunes will delete the artwork embedded in each file so that you can add a new/bigger/better artwork. This way you avoid having duplicate artwork making iTunes show the only one you want.

Make iTunes delete Album Artwork from all files at once


How to create a playlist using a Finder folder?

Creating an iTunes playlist from a Finder folderSelect the folder in Finder and drag it to iTunes icon in the dock. iTunes icon will blink. Wait a second or two. iTunes will be the active window (I consider iTunes is already open in the background before you perform this operation). Keep holding the mouse button. Now drag the folder to the Playlist section in iTunes left bar and release the mouse. As you see in the picture, I’m dragging and dropping a folder called My MP3 folder to iTunes PLAYLISTS section. When iTunes recognizes that you want to create a playlist from a folder it’ll highlight its left bar. This let’s you know that it’s time to release the mouse button and drop the folder there.

Mac OS

How to open a docked application at startup time/login?

Right click the app icon in the dock and select Options –> Open at Login.


How to search anything in your Mac from anywhere?

command+space This will bring Spotlight.


How to put Mac to sleep?

option+command+eject


How to go to any folder in Finder by its address/path (like Windows Explorer address bar)?

Right click Finder icon in the dock and select Go to Folder. Type or paste the folder path and click Go.

Finder Go to the folder dialog window


Added on 5/14/2011

How to copy the full path of a file or folder in Finder (really useful in software development)?

Use this fantastic Copy Full Path automator service workflow by Marcus Barnes. Read his post for more info.

Mac OS Finder with Copy Full Path Automator service

Learn more about Automator in this post: Automate tasks in Mac OS with Automator


How to show hidden files in Finder?

In Terminal type:

defaults write com.apple.finder AppleShowAllFiles TRUE

killall Finder


Added on 5/24/2011

How to open a terminal command window starting from the current folder you have open in Finder?

Use cdto. macoscdtologo Download it here.

cdto is a small app that opens a Terminal.app window cd'd to the front most finder window. It’s designed (including it's icon) to be placed in the Finder window's toolbar as shown below (mouse cursor is over it):

Mac OS cdto App Icon in Finder Toolbar

Add Songs to iTunes Playlist with Automator

Last time I showed you how to Automate tasks in Mac OS with Automator. I used Automator to create a simple workflow that helps moving MP3 files to iTunes folder. Check that here.

Now I have another task to Automator.

This is the description of what I want to accomplish or the problem description if you prefer:

I often download some free legal MP3 files from the internet for evaluation, more specifically from Indie Rock Cafe (great great site by the way :D - check it out if you like Indie Rock music). I use IndieRockCafe mainly to discover bands that I’ve never heard about. It’s being a great experience so far. I’ve come to know some really good bands that, else I would never hear a song of theirs.

To download those MP3s I use DownThemAll that is a really nice piece of software that works beautifully with Firefox. I wrote about DownThemAll in Automate the download of a list of URLs/links. Although I didn’t write how to download only MP3 files with DownThemAll, this post gives you an idea about the purpose of DownThemAll. I’ll write about how to download only specific kind of files (MP3 in this case) using DownThemAll, but that’s another post. Probably I’ll detail this download process I’m mentioning here.

As I was telling you, I often do the same task, that is, I go to IndieRockCafe, click on DownThemAll icon in my Firefox toolbar and tada, the download of IndieRockCafe’s recently added MP3s just start. DownThemAll will download only page links that point to MP3 files saving these MP3 in a single folder called IndieRockCafe.

After the download I used to select all the files within that folder and drag and drop them inside an iTunes playlist called IndieRockCafe. iTunes is wise enough to tell me that some files are already part of the playlist and gives me the option to skip them adding only new files into that playlist. Doing so I always have a fresh playlist with the latest files of IndieRockCafe. It works, but it has a lot of manual steps.

Yesterday I thought: the above steps are a perfect fit to be automated with Automator.

Let’s create a workflow:

1 - Go to the Applications folder and select Automator.

2 - You’ll be presented with the following screen to choose a template for your workflow. Select Folder Action as the template.

Types of templates available to create an Automator workflow (Folder Action)Figure 1 - Types of templates available to create an Automator workflow (Folder Action)

3 - In Folder Action receives folders and files added to, select the folder you want. In my case it is the IndieRockCafe folder.

4 - Now select Music in Library list and then select Import Files into iTunes under the Actions list. Drag this action to the workflow area in the right.

5 - Select Existing playlist and the playlist you want the files to go to. As I wrote above I already have a Playlist called IndieRockCafe inside iTunes. So I selected it.

6 - Go to the File menu and select Save. Give the workflow an appropriate name, e.g. IndieRockCafe.

The following screenshot shows the Folder Action workflow configured:

IndieRockCafe.workflow configured according to the six steps described above
Figure 2 - IndieRockCafe.workflow configured according to the six steps described above

7 - Now that the workflow is created, there’s a last step required to orchestrate things: go to the IndieRockCafe folder and right-click it. Select Services > Folder Actions Setup… Make sure you attach the IndieRockCafe workflow to this folder as shown in Figure 3:

Attaching IndieRockCafe.workflow in Folder Actions Setup
Figure 3 - Attaching IndieRockCafe.workflow in Folder Actions Setup

Make sure you click the Enable Folder Actions checkbox too:

Enabling Folder Actions and turning IndieRockCafe.workflow ON for the IndieRockCafe folder
Figure 4 - Enabling Folder Actions and turning IndieRockCafe.workflow ON for the IndieRockCafe folder

… and we’re done! As you see this is totally life saver.

Every new MP3 that gets added in my IndieRockCafe folder through DownThemAll or that I manually place in this folder will be automatically added in IndieRockCafe playlist.

Task successfully automated!

I’m a music lover and I hope you can take advantage of it too.

Important
DownThemAll creates file segments ( *.dtapart files ) while downloading. DownThemAll splits the file into several parts and then downloads each segment of the file individually, which gives you better speed from servers, especially those that choose to limit your download speed. This behavior will cause the workflow created above to fail because iTunes won’t recognize those parted files when trying to import them. To solve this problem, do the following:

In Firefox Tools menu choose More dTa Tools and then select Preferences.

In tab Advanced and under Temporary files choose a directory to store those dtapart files. See screenshot below to have an idea:

Using a temporary folder to store DownThemAll file parts or segmentsFigure 5 - Using a temporary folder to store DownThemAll file parts or segments

Doing the above, DownThemAll will store those partial files in a separate folder. When it finishes downloading a file it will join its parts and then will move that file to the IndieRockCafe folder I specified in the workflow. Now iTunes will import the MP3.

Note
Folder action workflows are saved in
/Users/YourUserName/Library/Workflows/Applications/Folder Actions

Download
You can download this workflow at:
https://sites.google.com/site/leniel/blog/IndieRockCafe.workflow.zip