Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Saturday, July 28, 2012

Orwell Dev-C++: Dev-C++ 5.2.0.3 Released

Not a big fan of Windows C++ IDEs.... well I'm not a big fan of Windows, I'm not a big fan of IDEs and I don't particularly like C++ either. As far as I'm concerned, if you really need a C++ IDE for Windows you should have started using CodeBlocks or Eclipse. However, if you really want to stick with Dev-C++, at least grab this new version.

The importance of using a modern C++ compiler should not be overlooked.

Orwell Dev-C++: Dev-C++ 5.2.0.3 Released: Time for another pile of bug fixes. I've also added a few features, like an updated set of built in compiler options and full file path hint...

Tuesday, January 25, 2011

Install Clojure on Windows

I'm not a big fan of the Microsoft platform. I'm not a hater either, though in a binary world I would probably be the second. Luckily enough we have some degree of fuzziness which makes life more fun (besides, I think that programmers in a binary world would feel perfectly comfortable with directly writing opcodes, possibly directly using a magnet on a hard disk, so no Lisp at all).

For a very long list of reasons (which is so long that it would deserve a post on its own, provided that someone but me cared) I'm using windows a lot at work. This has something to do with my macbook having a broken hard disk and me being lazier than a Haskell interpreted with a Haskell interpreter. Anyway...

HasOffice - {Mac} = {Windows}

So... and I'm a lot into experimenting new technologies. My new found subject of experimentation is clojure: after at least an year I'm planning to start using it for some real world apps, eventually the time has come. And unfortunately I have to do it in an hostile environment. I usually find easier to try new stuff on the Mac or on some other Linux systems. I'm more at ease with the OS and usually developers tested and developed the thing on a system rather similar. Especially the installation stages are troublesome, as a working compiler is often assumed present (and usually it should be gcc).

On the other hand Clojure lives in a Java environment. Essentially it follows different rules from this point of view. The runtime is a jar, altready compiled. My IDE just downloads it and things work. I also have clojure box and things work out of the box (a part from a very strange bug which freezes the whole Emacs). Amazingly enough, some years ago I had some troubles with using it CLI on the mac (I think it was version 1.0 and something in the internal class structure changed so my old way of invoking the repl just did not work -- this is solved, thanks brew!).

The only "problem" with installing clojure on windows has to do with putting things in the right places.
First I downloaded the clojure zip from the official site and tested that the jar actually worked (which it does) [ I actually substitute the greater than char with % to have less troubles with escaping].

% java -cp clojure.jar clojure.main
Clojure 1.2.0
user=% (println "foo")
foo
nil
user=% (println "foo")

So, now, it is just a matter of placing it on the path and perhaps use some nocturnal mammal script to improve usability. There is such a script in the help page, however, it needs some modifications.

The modifications basically account for the very first lines in the script. I think that it is better if we just omit the version numbers, so that when upgrading we can just put the new stuff in place of the old. However, the modified version is included afterward.

We create a directory clojure in the root of the file-system (well... Windows "root" C:, so C:\clojure). I assume that all the libraries have been unpacked in the same directory (e.g., Downloads). And now we are going to copy the clojure, clojure contrib and jline jars in the that (C:\clojure) directory.

% mkdir \clojure
% cd clojure-1.2.0
% copy clojure.jar \clojure
1 file(s) copied.
% cd ..\clojure-contrib-1.2.0
% copy target\clojure-contrib-1.2.0.jar \clojure\clojure-contrib.jar
1 file(s) copied.
% cd ..
% copy jline-0_9_5.jar \clojure\jline.jar
1 file(s) copied.
% dir \clojure
Volume in drive C has no label.
Volume Serial Number is 74BF-5A64

Directory of C:\clojure
24/01/2011  11:12     DIR           .
24/01/2011  11:12     DIR           ..
19/08/2010  10:01           477.050 clojure-contrib.jar
19/08/2010  10:06         3.237.168 clojure.jar
24/01/2011  11:05            46.424 jline.jar
3 File(s)      3.760.642 bytes
2 Dir(s)  47.933.681.664 bytes free

I also saved a slightly modified clj.bat script and saved it in \clojure:
:: Setup:
:: 
:: 1. Change the constants to match your paths
:: 2. Put this clj.bat file on your PATH
::
:: Usage:
::
:: clj                           # Starts REPL
:: clj my_script.clj             # Runs the script
:: clj my_script.clj arg1 arg2   # Runs the script with arguments

@echo off

:: Change the following to match your paths
set CLOJURE_DIR=C:\clojure
set CLOJURE_JAR=%CLOJURE_DIR%\clojure.jar
set CONTRIB_JAR=%CLOJURE_DIR%\clojure-contrib.jar
set JLINE_JAR=%CLOJURE_DIR%\jline.jar

if (%1) == () (
:: Start REPL
java -cp .;%JLINE_JAR%;%CLOJURE_JAR%;%CONTRIB_JAR% jline.ConsoleRunner clojure.main
) else (
:: Start some_script.clj
java -cp .;%CLOJURE_JAR%;%CONTRIB_JAR% clojure.main %1 -- %*
)

Then it is just a matter of putting C:\clojure in the path. From the CLI it is just (here % stands for %, not for greater than):

set Path=C:\clojure;%Path%

Or better it can be set from the GUI once and for all:
  1. right-click on "Computer"
  2. choose Properties
  3. choose "Advanced System Settings"
  4. choose the Advanced tab
  5. click "environment variables" button
  6. select the Path line from the System Variables box
  7. add at the beginning C:\clojure; [note the ; at the end]
  8.  click ok
The Paths variable is a sequence of ; separated directories, that's it. I'm also considering adding C:\clojure\clojure.jar in the CLASSPATH variable.

Tuesday, October 5, 2010

Me and my IDE

Introduction

As customary in my articles on text editors and IDE I originally started this post with a self-condescending presentation of my skills and expertise. Then there have been some miscomprehension between chrome and blogger and the second part of the draft was not saved although blogger stated otherwise.

As a consequence I had the more self-condescending part and I lost the slightly more interesting one. I thought to do everybody a favor and delete that stuff. Now, a slightly less condescending paragraph on myself in order to motivate my point of view.

The past

I almost always used editors. Emacs, vim… and when on BBEdit and TextMate. Ah… light tools. Not only that: I was quite vocal in the IDE vs. Editor war (from the editor side, of course). And this can also be related to my choice of  “freedom languages” (more on this on later posts, perhaps?).

But some weeks ago I realized that now, without noticing, I’m mostly using IDEs. How has that happened? The easy part to explain is the Java related one. Java greatly benefits from IDEs (or perhaps the widespread diffusion of IDEs has tampered the development of good language features?); in fact it is quite much harder to develop Java without an IDE, since the language is very verbose. On the other hand its restrictions and bounds make it quite easier to develop good and powerful tools. Of course I could use UltraEdit on Windows… but no luck with OS X and Linux (moreover, I had to pay that as well… and I preferred to buy IntelliJ).

Emacs has very nice modules to work with Java. On the other hand they have to be installed separately (and in my experience also slowed down normal operations). When I have to loose to much time configuring my editor, I usually try other solutions. That is why I used TextMate and BBEdit extensively… because they are almost already set-up. I also like vim, since has decent default setups for most situations.

For somewhat similar reasons, I bought WingIDE to work with Python. I could set up Emacs (or vim) to do that stuff, of course. Still, I had not much time, not motivation… and I bought the thing. I especially liked it because it worked equally well on single files and on large projects. It also had the best auto-completion for Python I ever tried, nice debugging features (I use them rarely, but when I do I love to have an easy to use environment, especially because I use them rarely and I tend to forget the tricks). In the pack there is also nice support for unit-testing (and that is a definite plus).

In the same time I worked extensively with C++. I mostly used editors (vim, because I especially like it with C/C++) and BBEdit because of its easy to set up “project management” features. BBEdit also has most the processing power of classical editors and that is nice. I quite enjoyed the best effort auto-completion it provided and ctags based stuff. Ok… still too much template metaprogramming (or simply correct and not basic use of templates) crippled smart “IDE like” features which I would have liked.

In other words, I sincerely craved for a nice C++ IDE. Perhaps I should try Java based IDEs with C++ as well… I may be surprised. Though I hate setting up projects in IDEs. Every IDE has its conventions and it is not always immediate how to work with a project that both needs “classical command line build interface” (which is something I’m not disposed – nor can I afford to – lose) and the IDE based build. Somewhat CMake eases the problem, but at the price of restricting myself to the supported IDEs.

Other languages I use, but I think that they account for less than 30% of my development time (and it is going to drop). And perhaps they could be moved to IDEs as well… as soon as I solve the “single file project problem” [or I simply give up my hopes with that].

This basically rules me out from editor flame-wars. Still, I believe that learning using IDEs is a terrible mistake… but is a modest position. Moreover, nowadays most editor proponents show you how to add all the IDE features to their editor of choice. So what’s the point? It’s not an Editor vs. IDE matter, it’s Emacs vs. Eclipse. And somewhat I believe Eclipse is going to become what Emacs was in the past years. And hopefully it is going to become faster like Emacs did…

The future

So what now? I’m lazy to the bone. And I’m quite new to the IDE world. I have my habits and I don’t really want to change them. And don’t believe the ones who tell that using IDEs is easier. Nor faster. It depends on your skill set. As I have my own requirements, some things may be slower with IDEs, at least until I figure out how to do them.

Which basically means that an IDE is not automatically more productive: it may be, provided that you know the tool. Yes, some have a very good learning curve (like WingIDE), others are very good, but need you to figure the way they work to exploit them fully (IntelliJ). Moreover, I still have to figure out how to develop Java projects easily built both with IDEs and with command line tools. Perhaps I should explore maven (which should be well integrated with all the main IDEs). After-all its racist on my part to spend time with cmake and auto-tools and not doing that for Java “based” projects.

Friday, September 17, 2010

Security researchers 'destroy' microsoft asp.net security - The Inquirer

May I say I'm just a little bit worried as I probably have sensible data on some ASP based server out there...

Security researchers 'destroy' microsoft asp.net security - The Inquirer

ok... Java Server Faces has that as well...

Monday, June 7, 2010

PDF and other tragicomical histories

Today I had the unlucky task of creating a PDF from a Word document we wrote.
In fact, I did not think the thing would have gotten tricky (ah, how naive!). Word 2007 has a nice "save to PDF" menu item and I thought I could use that to solve my problem. Luckily enough, I double checked the generated PDF on the Mac. And, apparently, all the bold fonts were substituted with another font. I already mentioned this in a post earlier today.

This is completely illogical since the font was Times New Roman and I have Word on the Mac as well, which would install a lot of additional fonts, even if TNR was not that standard. So I searched for a Windows PDF creator (which, by the way both OS X and Linux-based desktop programs have). I found a bunch of them, some commercial, some free, some open source. My choice was PDFCreator.

Some reasons are: i) it is free as in free beer, ii) it is free as in free speech, iii) had no ads, iv) is based on the same softwares I happily used with Linux. Of course, reason i) was paramount: I had no intention to buy a stinking PDF creator for Windows unless it is absolutely necessary (which may be). The other three reasons have to be considered together: I searched google for suggestions, but I had no clue on which one was supposed to be better.

Usually the only problem with open source software is lack of support/user friendliness. However, that was not the case of PDFCreator. Unfortunately, for reasons beyond my comprehension, the generated pdf completely screws[0] a TIFF picture I put in the document. The same picture is perfectly fine in the PDF generated with word built-in generator. I tried to include in word a PDF, but that did not work either (the PDF was linked, but not visible -- nor printable --). Amazingly, Word for Mac is capable of using PDF image files, IIRC.

Perhaps, I should have tried more generators. I went home, opened Word for Mac, double checked that the formatting was fine (which was not, but I could fix it in little time) and simply printed to PDF. The PDF is perfect. This goes under: how to completely waste a Monday morning.

Footnotes

[0] This is a technical term, essentially it looked like it had low resolution

Using word to write...

Using word to write articles is a rather perverted art. E.g., why are the "regular expression" different from every other syntax I met and there are two different syntaxes depending whether you are using jolly characters or not?

Why is the bibliographic tools such a joke that almost everybody does it by hand (and, moreover, many conferences explicitly tell you to do it by hand? and the W2007 implementation is not compatible with W2003 – at least that is the opinion of W2007 on that matter)

And using images is a PITA. But that is a PITA with Latex as well. Last but not least, I have yet to understand why a PDF created with word for windows visualize bold characters (I'm following the IEEE template, so changing the font is not an option... besides, it's times new roman) with a *different* non-bold font when opened on the Mac. If it were not such a standard font I would have said it's a matter of not including the font.

Saturday, March 25, 2006

ReactOS

Per chi non lo sapesse ReactOS è un'implementazione libera di Windows NT. Non ancora completa, è comunque un sistema bootabile e funzionante, che permette anche di fare girare alcune semplici applicazioni di windows "native".

Uno dei vantaggi di avere un MacIntel è che Q (ovvero qemu + gui) è in grado di fare funzionare a velocità decenti sistemi per x86, fra cui ReactOS. Mi sono scaricato la iso per qemu preinstallata e lo ho lanciato. Ha funzionato tutto e si è automaticamente configurato per usare la scheda di rete di qemu.

Beh.. ecco uno screenshot.

QScreenshot1.miniatura-2006-03-25-11-11.png

Ed eccone un altro... sigh

QScreenshot2.miniatura-2006-03-25-11-11.png

Il sito ufficiale di ReactOS è questo

Al di la della schermata blu, è davvero un progetto interessante per coloro che volessero impratichirsi con gli internals di Windows.