CSCD18 Fall08
How to setup
OpenGL for Cygwin
MATA32 Quiz Solutions
Notes
2009-03-05
-
When writing to or reading from streams using array buffers, beware the
type of object being written and how to call its size.
stream.write( (char*) &var, sizeof(var));
stream.write( (char*) var, sizeof(var));
stream.write( (char*) var, sizeof(*var));
The first is correct when writing out a single variable. The third is
correct when writing out something in a pointer. The second is wrong as
it's using var as a pointer, and unless var is itself the same size as the
data to be written, it's wrong. It's easy to drop or add one of the terms
by mistake, and will be a headache to find.
e.g. int array[4]={1,2,3,4};
stream.write((char*) array,sizeof(array)*4);
This works on 32 bit systems because ints have the same size as pointers,
but it will choke on 64 bit systems because pointers use the 64bit address
while ints may still be 32bit in size.
2009-03-03
-
ssh sessions dropping and destroying your work? screen will save you (in
some cases).
-
imresize in Matlab 7.7.0.471(R2008b) 64bit linux behaves differently than
in Matlab 7.0.1.24704(R14) SP1 32bit windows with different sizes for
resized images.
e.g. 190x140 image rescaled to 1/4 size resizes to 48x35 for 7.7.0 and
47x35 for 7.0.1
-
~ doesn't work as home directory in c/c++ programs. Maybe it's just a
handy shell shortcut?
-
Addendum to large switch statements between msvc and cygwin; it's actually
between msvc and gcc.
2009-03-02
-
Cygwin chokes on windows pathnames because the new version of make
dislikes colons. Workaround is to replace make with an older version
which likes it. Affects cygwin compilation, and cygwin integration in
eclipse.
-
Matlab throwing "Cannot enable breakpoint. Error using ==> dbstop. Cannot
find function" where the function is obviously open in front of you and the code runs, may be
caused by symbolic links. Startup registered my home directory as
/u/wongam/ where pwd in the directory reports /h/54/wongam/. Manually
code in the path pwd returns. For me, it was my startup.m registering bad
paths (maybe).
-
Massively large switch statement(129 cases) for setting up particular
run parameters compiles ok in msvc release mode, but chokes in
cygwin/mingw release mode; not sure what the difference is.
Maintained by Alex Wong
wongam at cs dot utoronto dot ca