Have you ever used cmd.exe (a.k.a Windows Console)? In my day to day tasks usually I have from 2 ~ 3 consoles open, which brings me to this post.
Lets be fair: Anyone that has used any *nix based shell (bash comes to my mind), usually considers (seriously) moving to Linux or some *nix based OS ;)
Even though I do recommend using a different OS, such a radical change is not required all you want is a better experience when using a console; on Windows, there are some alternatives to cmd.exe; for instance, I have used console2 for some time and recently I switched to ConEmu (mostly because it has been updated more frequently); in any case I do recommend you to take the time to check both to see which one you adapt better, if any :).
Since I started using such console replacements I don't miss cmd.exe even for a second ;)
(Este post em Português)
Happy coding.
Sep 17, 2013
Utilitário útil da semana: ConEmu
Se você é um usuário avançado do Windows provavelmente recorre ao console (cmd.exe) para executar várias das suas tarefas diárias. Eu, em geral, tenho 2 ~ 3 consoles abertos normalmente e este fato é exatamente a motivação deste post.
Vamos ser sinceros: se você já usou algum shell (tipo bash) que acompanha uma instalação Linux moderna usar o console do Windows dá vontade de mudar para o Linux ;)
Felizmente não é necessário uma mudança tão radical (muito embora eu recomendo usar o Linux, ou qualquer outro S.O. sempre que possível). Por exemplo, a algum tempo eu vinha usando o console2 que é uma boa alternativa ao console do Windows. Recentemente eu passei a usar o ConEmu simplesmente porque o mesmo tem sido atualizado mais frequentemente que o console2 (de qualquer forma eu recomendo instalar ambos e experimentar para ver qual lhe agrada mais).
Entre outros recursos o ConEmu suporta múltiplas tabs, seleção de texto muito melhorado, uso de qualquer fonte, etc.
Quanto a mim, não pretendo voltar a usar o console do Windows (talvez, quem sabe, usar mais o power shell, mas isto já é assunto para outro post :).
(This post in English)
Vamos ser sinceros: se você já usou algum shell (tipo bash) que acompanha uma instalação Linux moderna usar o console do Windows dá vontade de mudar para o Linux ;)
Felizmente não é necessário uma mudança tão radical (muito embora eu recomendo usar o Linux, ou qualquer outro S.O. sempre que possível). Por exemplo, a algum tempo eu vinha usando o console2 que é uma boa alternativa ao console do Windows. Recentemente eu passei a usar o ConEmu simplesmente porque o mesmo tem sido atualizado mais frequentemente que o console2 (de qualquer forma eu recomendo instalar ambos e experimentar para ver qual lhe agrada mais).
Entre outros recursos o ConEmu suporta múltiplas tabs, seleção de texto muito melhorado, uso de qualquer fonte, etc.
Quanto a mim, não pretendo voltar a usar o console do Windows (talvez, quem sabe, usar mais o power shell, mas isto já é assunto para outro post :).
(This post in English)
Sep 4, 2013
Blogging experiments....
Hi,
Even though in the beginning I used to post in portuguese (my native language) I decided to switch to english to force me to write more in this language.
Although I am still firm believer that anyone interested in information technology field do need to be able to read english I came to the conclusion that posting in portuguese is also valuable so, starting with this post I'll experiment posting in both english / portuguese.
What do you think?
If I get no feedback then I may decide switching back to english only posts :).
(you can read this post in portuguese)
Happy coding!
Although I am still firm believer that anyone interested in information technology field do need to be able to read english I came to the conclusion that posting in portuguese is also valuable so, starting with this post I'll experiment posting in both english / portuguese.
What do you think?
If I get no feedback then I may decide switching back to english only posts :).
(you can read this post in portuguese)
Happy coding!
Posts em português
Olá,
Quando eu comecei a postar em meu primeiro blog eu postava em português; contudo depois de algum tempo decidi postar em inglês. Meu objetivo era o de me forçar a escrever neste idioma e assim aperfeiçoar minhas habilidades com o mesmo.
Contudo após este tempo eu repensei a decisão e concluí que não postar em português estimularia esta tendência de adotar o inglês em detrimento do Português. Assim sendo, a partir deste post, pretendo seguir um modelo em que postarei nos dois idiomas (contudo o conteúdo dos posts não serão uma tradução literal de um idioma para o outro).
O que você acha? Após alguns posts vou reavaliar e decidir se continuo neste modelo, se volto a postar apenas em inglês, se passo a postar apenas em português ou, quem sabe, se paro de postar :)
PS: Aqui esta a versão em inglês deste post.
Happy coding!
Contudo após este tempo eu repensei a decisão e concluí que não postar em português estimularia esta tendência de adotar o inglês em detrimento do Português. Assim sendo, a partir deste post, pretendo seguir um modelo em que postarei nos dois idiomas (contudo o conteúdo dos posts não serão uma tradução literal de um idioma para o outro).
O que você acha? Após alguns posts vou reavaliar e decidir se continuo neste modelo, se volto a postar apenas em inglês, se passo a postar apenas em português ou, quem sabe, se paro de postar :)
PS: Aqui esta a versão em inglês deste post.
Happy coding!
Aug 24, 2013
Looking for a new Job: the experience
Hi.
On this post I've said that I was joining a great team and that I was really excited about it; I did meant that but unfortunately this journey came to an end on Feb/1/2013 when my contract was not renewed after the latest corporate acquisitions round.
In this post I'll describe the process I took to find a new job, but first lets make things as clear as possible:
The first thing you need is to realize that
It may look like restating the obvious but I haven't realized how much time it may take! So, be prepared to dedicate a lot of time to this phase (fortunately, job wise I hadn't much else to do :).
My first step was to create a list of requirements/constraints for the new job, sorted by importance; you should take into account aspects such as compensation package, relocation, type of work, etc. Depending on your constraints it'll take longer to find your new dream job.
In my case the list looked something like:
At this point you really need to think about what you want, review your requirements list and refrain from accepting the first (or second, third, whatever) job offer you may get only because you are running out of money.
Of course there is a hard deadline and you can't wait indefinitely in my case I strove to get at least 4 ~ 5 job offers before taking a decision. More importantly than the number, was the quality of the offers; there was one in particular that I was really interested in so I discussed with my wife and we decided we'd squeeze as much as possible from our small savings and would try to allow me 1 ~ 2 more months before taking the decision (while I was waiting for the interviews to come I took the time to experiment with something new, but related to my field of interest).
After some time the interviews started to come and suddenly I had participated in 3 ~ 4 of them, some in the traditional sense of the word and some virtual interviews (through skype / phone).
Some notes from these interviews (process wise):
On this post I've said that I was joining a great team and that I was really excited about it; I did meant that but unfortunately this journey came to an end on Feb/1/2013 when my contract was not renewed after the latest corporate acquisitions round.
In this post I'll describe the process I took to find a new job, but first lets make things as clear as possible:
- I am not an HR expert (far from it, I'd rather say I am a complete newbie on the subject), so take every world with a whole mountain of salt ;)
- yes, I did follow most, if not all, of the presented advice.
Perhaps the most important advice (and probably the hardest to follow) is: don't panic! I know that it is easier to say than to do (I've been there, remember ?), but try to keep calm and review your options carefully.
Looking for a new job is a full time job!
It may look like restating the obvious but I haven't realized how much time it may take! So, be prepared to dedicate a lot of time to this phase (fortunately, job wise I hadn't much else to do :).
My first step was to create a list of requirements/constraints for the new job, sorted by importance; you should take into account aspects such as compensation package, relocation, type of work, etc. Depending on your constraints it'll take longer to find your new dream job.
In my case the list looked something like:
- It had to be fun and challenge.
- The company I'd work for should at least recognize and be committed to implement/use good development practices (TDD, continuous building, pair programming, etc).
- Compensation should be closer to or higher than what I was earning before.
- Work from home if possible.
- Avoid relocation.
At this point you really need to think about what you want, review your requirements list and refrain from accepting the first (or second, third, whatever) job offer you may get only because you are running out of money.
Of course there is a hard deadline and you can't wait indefinitely in my case I strove to get at least 4 ~ 5 job offers before taking a decision. More importantly than the number, was the quality of the offers; there was one in particular that I was really interested in so I discussed with my wife and we decided we'd squeeze as much as possible from our small savings and would try to allow me 1 ~ 2 more months before taking the decision (while I was waiting for the interviews to come I took the time to experiment with something new, but related to my field of interest).
After some time the interviews started to come and suddenly I had participated in 3 ~ 4 of them, some in the traditional sense of the word and some virtual interviews (through skype / phone).
Some notes from these interviews (process wise):
- Never forget that interviews are a two lane road: you are not the only that is being interviewed! You should also be evaluating the company in question.
- Don't be afraid of challenges! Instead, use them as a motivation to you to learn and improve.
- Be humble but not shy. Do not put yourself in the position of someone that is reluctant to disagree because you are afraid of not getting an offer: be yourself.
- Be prepared to face ridiculous, unrealistic job skill set requirements / compensation packs. Just keep the professionalism.
- Show enthusiasm; would you hire a candidate that looks (and behaves) apathetic in an interview?
- Even if, in the middle of the interview, you've already made your mind and you don't plan to accept a (possible) job offer, keep the professionalism.
Fun fact: there was 2 situations that I found very strange: in one of the interviews I was asked absolutely no technical questions (at least none that I think would be able to assess my ability to do the job) and in another one the interviewer sold the company in question as the best company in the world but said that they could not get good developers to join them, hum... (guess what? I discarded both of them).
When you finally get a job don't forget to get back to any pending job offer and let them know you are not available anymore.
When you finally get a job don't forget to get back to any pending job offer and let them know you are not available anymore.
Hope this was helpful.
Aug 15, 2013
Did you know? Windows 7 Cool feature
Warning: I've started to write this post a long time ago (whence references to Windows 7 as the new kid on the block) but I refrained to posting it since I could not verify the behavior; now I decided to give it another try.... :).
A common complain on Windows platform is that whenever you try to use a file already being used by another process there is no easy way to find out which process is using that file. The canonical sample is trying to delete a file using Windows Explorer:
It happens that Windows Vista introduced a new COM interface named IFileIsInUse that could be used to allow other processes to figure out which process have the file open. Unfortunately, AFAIK (and based on the MSDN documentation), applications must be aware of this interface and actively do something with it if they want to play nicely with other applications, including the OS.
This morning I was reading some blog posts and someone suggested that Windows 7 had finally fixed thismisbehavior (bug?). Cool! Now I could not resist playing a little bit with it.
My first try was to run a C# application that just kept a file open until some key is pressed and try to delete the file; Wow! it worked perfectly!
But now I was left wondering whenever this could have something to do with CLR 4.0 changes (since I was compiling with VS 2010). You know, maybe the FCL team decided to do the IFileIsInUse interface dance internally (when you open a FileStream for instance).
In order to solve this doubt I took 2 actions:
By the other hand, in the last 2 cases (iii and iv) explorer failed to detect the application that had the file open (with exclusive rights).
To me looked like on Windows 7 (and 8 also BTW) Windows Explorer is falling back to NtQuerySystemInformation if it cannot find an IFileIsInUse entry in ROT. So I wrote a simple app (DumpROT.cpp) that searched the ROT for IFileIsInUse implementations and as I suspected when I run the app that keeps the "Test.txt" file open, RotDump fails to find any IFileIsInUse in ROT (it looks like even Libreoffice fails to register opened files in the ROT). Some other programs I've tested (including Visual Studio 2012) didn't registered open files either (see the output bellow):
The -verbose command line option instructs DumpROT to show all entries in the ROT irrespective to what these entries references.
As a last test I decided to run MS sample for this interface and voilá it does register an IFileIsInUse reference in the ROT for the chosen file!
This output was obtained by running DumpROT with the same set of opened files from the previous one (since I omitted the -verbose option the tool gave no feedback). Then I run it again, but this time with -verbose option; you can see in the output that no reference to IFileIsInUse was found in ROT. Next step was to run FileIsInUseSample (the MSDN sample with some changes to accept a file path through the command line) and executed DumpROT again; this time you can see that DumpROT found an entry to "output.txt" (the file passed to the sample app) in the ROT.
Unfortunately I don't have MS Office installed here to check whenever it takes advantage of this feature or not.
Happy coding!
Adriano
A common complain on Windows platform is that whenever you try to use a file already being used by another process there is no easy way to find out which process is using that file. The canonical sample is trying to delete a file using Windows Explorer:
It happens that Windows Vista introduced a new COM interface named IFileIsInUse that could be used to allow other processes to figure out which process have the file open. Unfortunately, AFAIK (and based on the MSDN documentation), applications must be aware of this interface and actively do something with it if they want to play nicely with other applications, including the OS.
This morning I was reading some blog posts and someone suggested that Windows 7 had finally fixed this
My first try was to run a C# application that just kept a file open until some key is pressed and try to delete the file; Wow! it worked perfectly!
But now I was left wondering whenever this could have something to do with CLR 4.0 changes (since I was compiling with VS 2010). You know, maybe the FCL team decided to do the IFileIsInUse interface dance internally (when you open a FileStream for instance).
In order to solve this doubt I took 2 actions:
- Targeting CLR 2.0 (by changing VS configuration for the project)
- Write a native C++ application to do the same thing as the C# one (the code bellow).
- Compile the same native program (2) with VS 2010 on Windows XP box (which has no support for IFileIsInUse at all)
- Compile the same native program (2) with VS 2010 on Windows Vista box (which does has support for IFileIsInUse)
#include "stdio.h"
int main(int argc, char* argv[])
{
const char *fileName = "Test.txt";
FILE* p = fopen(fileName, "w+");
if (p == NULL)
{
printf("Unable to create file...");
return -1;
}
printf("[%s] Press any key to close the file ", fileName);
getchar();
fclose(p);
return 0;
}
and in the first two cases (i and ii) the result was the same: Windows Explorer was able to detect which application had the file open (with no extra effort from my side :)! Really nice! (Ok, I agree, Windows should have been doing this for ages, but better late than never, don't you agree ? :)By the other hand, in the last 2 cases (iii and iv) explorer failed to detect the application that had the file open (with exclusive rights).
To me looked like on Windows 7 (and 8 also BTW) Windows Explorer is falling back to NtQuerySystemInformation if it cannot find an IFileIsInUse entry in ROT. So I wrote a simple app (DumpROT.cpp) that searched the ROT for IFileIsInUse implementations and as I suspected when I run the app that keeps the "Test.txt" file open, RotDump fails to find any IFileIsInUse in ROT (it looks like even Libreoffice fails to register opened files in the ROT). Some other programs I've tested (including Visual Studio 2012) didn't registered open files either (see the output bellow):
The -verbose command line option instructs DumpROT to show all entries in the ROT irrespective to what these entries references.
As a last test I decided to run MS sample for this interface and voilá it does register an IFileIsInUse reference in the ROT for the chosen file!
This output was obtained by running DumpROT with the same set of opened files from the previous one (since I omitted the -verbose option the tool gave no feedback). Then I run it again, but this time with -verbose option; you can see in the output that no reference to IFileIsInUse was found in ROT. Next step was to run FileIsInUseSample (the MSDN sample with some changes to accept a file path through the command line) and executed DumpROT again; this time you can see that DumpROT found an entry to "output.txt" (the file passed to the sample app) in the ROT.
Unfortunately I don't have MS Office installed here to check whenever it takes advantage of this feature or not.
Happy coding!
Adriano
Aug 8, 2013
I love my job ;)
I am so proud of being part of the team behind Unity (even if my contributions so far are really a tinny part of it - almost nothing ;)
I've joined Unity team 5 months ago and everyday I get impressed by how much they have achieved already.
Sure, as any other job, it has its "this task sucks" moments but most of the time I'm having fun and learning new stuff (and the developers / team mates are really supportive).
Thanks all for the opportunity. I am really happy working with such great people.
Happy codding.
I've joined Unity team 5 months ago and everyday I get impressed by how much they have achieved already.
Sure, as any other job, it has its "this task sucks" moments but most of the time I'm having fun and learning new stuff (and the developers / team mates are really supportive).
Thanks all for the opportunity. I am really happy working with such great people.
Happy codding.
Subscribe to:
Posts (Atom)




