A base install of Cygwin does not include the clear command, though the same functionality can be achieved using ^L. The command is part of the ncurses package that may be found in the Libs category.
Thanks to Ruben Laguna for his post on the subject.
EDIT: This ncurses package now appears in the Utils category.
It seems that Cygwin’s subversion port and Tortoise SVN do not play well together. A default installation of both can result in the following error occuring seemingly at random during long checkout or update operations:
Can't move '/cygdrive/c/xxx/trunk/.svn/tmp/entries'
to '/cygdrive/c/xxx/trunk/.svn/entries':
Permission denied
To resolve this, Tortoise SVN’s icon overlays may need to be disabled entirely as suggested here. While Tortoise SVN doesn’t have a Disable overlays checkbox, they may be effectly disabled as follows:
- <SecondaryClickContextMenu> > Tortoise SVN > Settings > Icon Overlays
- Ensure the checkout directory is included in the Exclude paths mask (I’ve taken to using
c:* and c:*).
Others have suggested that it may not be necessary to disable Tortoise SVN’s overlays entirely, as long as the Show overlays only in explorer tickbox is ticked. This didn’t work for me; your kilometerage may vary.
NSLog(@"hello, %@", @"world");
Having installed mercurial via macports, any hg command fails with:
<nasty Traceback snipped>
ValueError: unknown locale: UTF-8
This is mercurial 0.9.5 and Python 2.5.1, but its seem that its caused by Leopard’s Term.app not setting the local encoding correctly. To resolve this, add the following to .profile:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
as noted in the mercurial mailing list.
Published by marc at 2008.03.12
in Code.
The ClasspathFileClassLoader now supports system properties. Thus, the command line for any Java application need consist of only:
java \\
-Djava.system.class.loader=tierseven.cfcl.ClasspathFileClassLoader \\
-Dtierseven.cfcl.ClasspathFileClassLoader.properties_file=/path/to/cfcl/properties_file \\
-classpath /path/to/cfcl/classes \\
<main_class>
The properties file should contain other properties, including tierseven.cfcl.ClasspathFileClassLoader.file, which will in turn contain the classpath elements.
The source is available from a Mercurial repository:
hg clone http://bitbucket.org/sinistral/cfcl
When installing SVK (2.0.2) via MacPorts (port install svk) make sure that CPAN is installed and has been configured, otherwise the SVK install will go into an infinite loop wating for user input.
This is evident with a port install -v svk. Without the -v it will simply appear to hang at the Configuring svk step); see also MacPorts bug #12050. The problem is that because CPAN has not yet been configured, it is prompting for the configuration that it needs in order to install SVK.
The first time cpan is run from the command line, it will prompt for configuration data; the process can be re-run using o conf init from within the cpan shell, and individual variables can be set with o conf <variable> <value>, e.g.:
cpan> o conf wget /opt/local/bin/wget
to set, and to unset:
cpan> o conf wget ""
I also ran into this rather less-than-obvious error message compiling Objective-C code on MacOS X 10.5:
syntax error before ‘AT_NAME’ token
I eventually resolved it thanks to this blog entry. The compiler was moaning about a missing @end in a header file.
Published by marc at 2008.03.04
in Code.
I’ve long been a fan of Apple. In 1985 my father returned from a US visit with a brand new Macintosh Plus and introduced me to a whole new world of personal computing (You have no idea how big a deal this was to a little South Africa boytjie – thanks, Dad!). While my friends were fighting with phix so that they could play Montezuma’s Revenge, I had the Dark Castle games. In later years, however, limited access to (relatively) expensive Apple hardware meant that, by the time I started started programming, all that was available to me was Windows and GNU/Linux on Intel hardware.
It is only recently that I’ve had the privilege of getting re-acquainted with the beauty that is Apple.
I’ve been curious about Apple’s choice of Objective-C and, now that I have the opportunity, I’ve decided to learn the language for myself. The bits and bytes that I pick up, I will post here – mostly as a reminder for myself, but also in the hope that it will help someone else who, like me, is just starting out. As most of my experience to-date has been as a Java developer, some of the things that took me a little while to figure out will no doubt be blindingly obvious to a C/C++ developer.
So … my first step was to try to write something very simple that would let me play around with the classes in the standard frameworks. For me this means being able to do a quick command-line build, without having to fire up Xcode. What I ended up with is the following main.m:
#import "Foundation/Foundation.h"
int main (int argc, char** argv)
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSMutableArray* records = [NSMutableArray arrayWithCapacity: 3];
[records addObject: [NSMutableDictionary dictionaryWithCapacity: 2]];
[records addObject: [NSMutableDictionary dictionaryWithCapacity: 2]];
[[records objectAtIndex: 0] setValue: @"marc" forKey: @"name"];
[[records objectAtIndex: 0] setValue: @"male" forKey: @"sex"];
[[records objectAtIndex: 1] setValue: @"michelle" forKey: @"name"];
[[records objectAtIndex: 1] setValue: @"female" forKey: @"sex"];
[records writeToFile: @"entries" atomically: NO];
[pool release];
}
This may be compiled using:
gcc -framework Foundation Test.m
There were a couple of things that weren’t immediately obvious to me:
-
- to use the classes in the
Foundation framework, one needs to include Foundation/Foundation.h; I was looking for specifc headers files for each of the referenced classes.
- the linker must be instructed to link against the framework using the
-f <framework>
option. If you’re not linking, a
gcc -c main.m
is sufficient.
SVK is a great source control and versioning solution. I particularly like the idea of having local access to an entire respository while still having the safety of an off-site upstream server.
As its written entirely in PERL, SVK is fairly portable (but there’s a "but" coming), but (ah, yes … there it is) while it works flawlessly on my Gentoo system, I’ve had problems getting it to work on Windows. Win32 binaries are available, but they rely on plink for svn+ssh, and I’ve not been able to get the combination to work. I elected instead to run the standard CPAN distribution of SVK under Cygwin. This, of course, brought its own set of problems.
I’ve posted a wiki article that outlines the steps that I followed to get SVK running under Cygwin.