thirdchild asked: haha hi. very interesting reads. which school and what major are you reading in?
Hello, and thank you, that’s very kind of you. I’m currently studying a BA in Music Technology at Huddersfield University. I don’t think I’m really suited to it though. I started learning to program in my first year there (I’m in third year now, on a work placement) and ever since I’ve wanted to change courses to something like computer science or software engineering. At the moment I’m aiming to do a Master’s degree in CompSci once I complete my current degree. I have lots of learning to do before then though.
Theme from Attack on Titan but on a gameboy emulator.
I think I lost it.
I keep looking at code I wrote months ago and it all looks OK. That should never happen. Guess I haven’t learnt anything useful in ages.
Finding good books is important. I’m about 80% of the way through SICP and Build Your Own Lisp, trying to read Purely Functional Data Structures and Knuth’s Empricial Study of FORTRAN Programs. Last week I read Apprenticeship Patterns and More Programming Pearls, and I’ve had Seven Languages in Seven Weeks on the go for ages, though I did all of the Clojure section last weekend. (Nice language btw. I’m thinking of moving to it for all my Processing sketches). Keep meaning to read Spivak’s Calculus and something about category theory.
But somehow I still don’t feel like I’m learning anything. Like I’m writing better code. My job’s all plain C++ and Python, and none of it’s beautiful. And I’m just getting less creative and more boring.
Am I reading the wrong things? Should I be doing stuff instead of reading? Does anyone have any good ideas for gifs? Because I sure don’t.
Someone tell me everything will be OK please.
My phone finally arrived this week, and the camera has a snazzy hdr mode. Yesterday I decided to take advantage of my newfound picture-taking ability, by venturing outside and walking from Sacré Coeur to the Eiffel Tower. More photos here.
When I was in sixth form, I went to a party. Someone tried to hug me but I don’t really like human contact so the hug effort failed. On a later date they made me a cake with ‘sorry for touching you’ written on it. They took it along to another party, which I wasn’t at, because I was studying or didn’t feel like it or because no-one let me know it was happening. I found out about it maybe two weeks later and it is a source of sorrow to this day that I never witnessed the ‘sorry for touching you’ cake in all its glory.
sometimes I write silly theme songs for my friends so that they have an incentive to keep being my friends
the image was the first google result for ‘productive man’
updating my CV for when my placement ends
Sketches for my current project.
I beat it!
I’m assuming yes, but does this look like it’d be a kosher use of malloc and free?MyClass** stuff; stuff = (MyClass**)malloc( sizeof(MyClass*) * 8 ); stuff = new MyClass(...); // etc. // do things with stuff free( stuff ); stuff = nullptr;
You still need to walk through stuff and delete stuff[n] (with delete rather than free). Why not just do stuff = new MyClass … delete  stuff?
Short answer: because I’m a butt.
Long answer: this is for a quad tree, more specifically the pointer to the divisions. I’m basically just doing a direct port of my C# code, and I didn’t know how to check if an array of pointers had been initialized yet so I figured the most direct way would be to use malloc and free (without using a separate variable to keep check of that) so I could just compare against 0/NULL/nullptr. Visual Studio told me I couldn’t assign the nullptr value to an array, which was when I decided to use this way.
I’m going to leap in with a few points here:
- This is C++, so use C++ idioms - try not to resort to malloc if possible. You can use ‘new’ to allocate an array of pointers like this:
MyClass** stuff = new MyClass*;That way you don’t have to cast the pointer, and each pointer will be NULL’d out already.
- That being said, if you have to use a Cism, use calloc instead. You get a nicer syntax, and your pointers will be NULL’d for you. Malloc really doesn’t guarantee that much about the state of the returned array, so the pointer values will initially be undefined rather than NULL.
- Typically you use malloc to init a really big or an unknown (at compile-time) amount of memory. In this case neither of those are issues - why not use a std::array<MyClass *, 8>? Admittedly, the pointer values won’t be NULL’d for you, but you do get automatic (and templated, so probably optimised a bit) memory management and some helpful member functions. You could even write a small subclass of std::array<MyClass *, 8> that just defines a new constructor to NULL out the array contents.
9999bc asked: love your work! what are you in paris for and where are you from originally?
Thank you! Your animations are super cool too… and your blog! Those animated rollovers are the best!
I’m on a placement year for my Uni course, working at IRCAM. It’s fun - I get to spend most of my time programming audio software, which I enjoy. I don’t speak the language though, so currently my life is even more rife with awkward moments than usual…
I’m originally from the south of England, but my university is up north.
Sans Form do t-shirts the same way I would do t-shirts if I were any good at design :3
Today I discovered that on OS X, dynamic libraries have a name, like most files. But they also have an ‘install name’ which you can find with the install_name_tool.
The install name can be a filepath. Which means, if you link your executable against a library in one location, that library may use its install name to redirect the link to a completely unrelated location on your drive. Lovely. I guess it could have its uses, but it got me super confused for a while today.