|


I've started implementing Ecore events. Lots of keyboard events work, and mouse events appear to totally work. Pretty cool!
Keyboard stuff is a mess... I'm borrowing heavily from the ecore_sdl module in that regard, but... they're missing a lot of characters. So, that'll be tonight. Then to clean stuff up and send in an Ecore_Quartz patch. Ehh. I named it Ecore_Quartz. It's more Ecore_Cocoa. Maybe I should change that??
Code is in Git. Including stuff to make test/orig/ecore work with Ecore_[Evas_]Quartz
2008.08.15 in code

Here's a post I promised a long time ago. I was playing around with Lisp back in late June, and wrote a little brute-force n-body problem solver. I should note that when I say brute force, I mean most naïve solution possible -- summing all of the forces, etc.
It seems this is one of the first things I write in a new language now... not sure why, it's not exactly a very good test of any language; at least not this type of implementation.
After the Lisp bit, I wrote a little point viewer in Perl (with Perl::OpenGL). It's not as pretty or fast as the one Radiohead used that was implemented in Processing, but this was before that was announced, and I've never (yet) written anything in Wiring/Processing, so I wouldn't have thought to use it.
So; it's all really very slow, and silly. Very. Very. Slow. But, it works. Also, it's physically inaccurate, in order to get results in any reasonable number of frames. Like, G is seven orders of magnitude larger than normal. So much for gravity being the weakest fundamental force... (EDIT: actually no. it's still not even close.)
So, for your particle-simulating-pleasure: the Lisp and the Perl.

I know Summer of Code is wrapping up (Monday is the absolute-pencils-down date), but I've got more news!
Following last weekend's advances (getting a Cocoa app up without a bundle and a NIB), I've restarted work on Ecore. After fighting a little bit more with Autotools (aargh!) to get Objective-C building successfully (which worked much more easily with Expedite).
After that, I dropped in some code from my Expedite engine, to set up Cocoa. And, as you can see, I was met with success! A tiny Ecore_Evas_Quartz test program, successfully running. No events, yet, but they should come within a day or so...
In any case, my biggest issue right now is I'm not entirely sure what to put in Ecore_Evas_Quartz, and what should go in Ecore_Quartz. Nathan suggested something like that Ecore_Quartz should provide functionality to talk to Quartz that Ecore_Evas_Quartz itself uses; I guess I'm still not entirely clear on what exactly should go where. So a lot of stuff is going in Ecore_Evas_Quartz right now, but I can move it out once I find out what's really what. (probably by reading other people's code, though if I've learned anything from this, it's that that's a bad idea *ahem*Evas_Cairo*ahem*).
Also -- this code is up in Git. Not SVN, though, obviously.
We decided that, before Tim left to go back to school, we should make one more dinner. This time, on August 13th (almost a month after our last full meal), we decided to go all out—which means a table cloth, perfectly aligned settings and every course imaginable (except for soup...). We decided to make a chicken and pasta bake, which I have made before with some friends at the Ronald McDonald House. In addition to that, we found a recipe for a spinach salad with sesame dressing. To our meal, we added dinner rolls and a mint tea punch. For dessert, we decided on profiteroles, which are basically cream puffs with ice cream instead of cream.
We went shopping on the 12th, which is always an exciting adventure. We scouted out everything that we needed, except for lemon juice. We solved that issue by buying lemons and squeezing them ourselves. We even got to check ourselves out, which is always fun! I spent some time last night going through the recipes and organizing a timetable for when we should start each separate piece so that we could end up with a hot dinner at around 6:30.
Today, we started at 4:00 with the rolls, because they had to rise. We mixed all of the ingredients (yeast, milk, flour, eggs, salt, shortening and sugar) in half quantities, so that we only had 12 rolls. The next step was to knead the dough until it was smooth. That turned out to be the most exciting thing ever! Well, not really. We floured the cutting board and plopped the dough down. Then Tim set to work kneading. I poured (and I mean poured) flour onto the dough and his hands so that it would stop sticking. I can't say that it worked too well. The dough was horribly sticky and messy, but we got it into the greased bowl and let it rise for an hour.
While we were waiting, I did the dishes and Tim took some pictures. Before we knew it, it was time to start the main dish. First, I cut up all of the vegetables and gave them to Tim to sauté. I continued to combine ingredients—the tomatoes and spices. Then, when the vegetables were done, we added those to the tomatoes. Tim went off to cook the chicken which I cut up, and I set the pasta to cook. Those all finished in about ten minutes, and they too were added to the vegetables. Everything was mixed well and poured into a 13x9 pan. I shredded the monterey jack cheese and poured it into the whipping cream, while Tim measured the grated parmesan. All of that cooked over medium heat until it was a sauce. That was poured over the chicken/pasta/vegetable mixture. Then, we put into the oven to bake for 45 minutes.
With that done, we moved back to the rolls. They had to be split into 12 pieces and put on a pan. I floured my hands and dove into the dough. Eventually, with a lot of flour, the dough became 12 very round rolls. We put them in the oven with the chicken and pasta so that they would both be ready at the same time.
Next came the drink. We boiled some water and put tea bags in it, as well as a bunch of mint sprigs. We let that steep, and then I took out the leaves and we added sugar and orange juice. We squeezed the three lemons and had exactly enough lemon juice to add. Then came the five cups of cold water. We put it in the fridge to cool, took out the chicken pasta bake and moved on to the salad.
I mixed the spinach and red onion together and started on the dressing. We cooked the sesame seeds and added the other ingredients (soy sauce, oil, salt, sugar and cider vinegar). Once it was boiling, which was quite dangerous, I poured it onto the salad and tossed it together.
Tim was pouring melted butter and garlic salt over each roll (at which point I burned two fingers on the pans...) and letting them cook for another few minutes. Once that was done, they were taken out of the oven and put in a basket. Tim set the table perfectly and then we put everything on it.
So, all of our food was done and on the table, and Mom was working her way through our mountain of dishes, but we were still waiting on Dad to get home from the neighbor's house. When he finally got home, we started dinner.
Every bit of dinner was excellent. The chicken pasta bake tasted really good, and had a lot of different flavors. The drink had a lot of flavors as well, but they all seemed to work together perfectly. The rolls worked much better than expected. It all worked together quite well... but then there was dessert...
So, for dessert we attempted to make profiteroles, which are, apparently, as hard to make as is it to say their name. It's really simple to make the batter and shape it on the trays, but once it's cooked, they 1) don't come off of the pan well and 2) don't fill well with ice cream because a) they don't cut in half and b) they fall apart. Basically, this was our first big... issue. I wouldn't say it was a disaster because how can you go wrong with ice cream? But it wasn't what it was supposed to be, which was very sad.
Besides dessert, this was a very successful day of cooking!
On July 19th, Tim and I made food for ourselves, while Mom and Dad were at the neighbor's house for dinner. We decided to make our own pizza which has apples, cheese, chicken and onions.
Our first adventure was to make a crust for the pizza. Now, we're good at making pie crusts, but a pizza crust is a completely different thing. It turned out to be not as much trouble as people made it out to be, but trying to figure out how to cook it so that the crust didn't burn, but the top bits got cooked enough was interesting.
Tim cooked the chicken (as always) and I cut up the apple and onions. We piled that on the semi-baked crust. Then we poured on the cheddar cheese and attempted to do the same with the pepper jack cheese. See, we couldn't find any shredded pepper jack, or a bar of it. So we bought slices. And then we had to shred it. We tried to use the large grater, but that failed. So Tim used the spinning hand held cheese grater—which worked perfectly. With all of our ingredients on the top, we put the pizza in to cook for another 10 minutes. When it came out, it was just browning and smelled great.
The pizza was excellent. We cut it up in to 9 pieces, and had it for lunch the next day as well. It tasted great and was quite simple to make. The crust worked extremely well and the apple/cheese combination is really good.
So I made a little discovery in a 7 year old mailing list post yesterday, and found out how to create a fully-functional Cocoa app, without letting the default run loop take over permanently, and without embedding the executable in an application bundle. Here you go:
EDIT: OK Wordpress is being silly; obviously, put < > around the #import file :-)
EDIT 2: Also, obviously, you need MainMenu.nib to be in the same folder as your executable.
EDIT 3: If you want to go NIBless, use NSBackingStoreBuffered, not the default NSBackingStoreRetained when creating your window!
// Build like so: gcc short.m -framework Cocoa
#import Cocoa/Cocoa.h
int main(int argc, char *argv[])
{
[[NSAutoreleasePool alloc] init];
[NSApplication sharedApplication];
[[[NSNib alloc] initWithContentsOfURL:[NSURL URLWithString:@"MainMenu.nib"]] instantiateNibWithOwner:NSApp topLevelObjects:nil];
ProcessSerialNumber psn = { 0, kCurrentProcess };
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
[NSApp finishLaunching];
while (1)
{
NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate dateWithTimeIntervalSinceNow:0.001] inMode:NSDefaultRunLoopMode dequeue:YES];
if (event) [NSApp sendEvent:event];
}
}
So, I'm not sure exactly where I was last time I wrote about my progress on Evas_Quartz... so I'll just mention the things I know I've done recently...
1) Gradients work now! Except, only some of them. It seems that linear, sinusoidal, and angular gradients work, but I haven't seen a radial gradient out of it yet. Not sure that this is my fault, but it really only seems reasonable that it is. I just haven't figured out why yet (anyone care to help?)...
2) The biggest problems with the text block layout code (actually, the problems were with my functions for querying Core Text font metrics, as I knew) are all fixed now. Text blocks (at least the ones in Expedite, and the ones I made for my little throwaway test programs) all look great! A part of the solution is very clearly hackish, but it works for now. I've come back to this code, revising it massively, a few times during the project... one more pass should probably do it.
3) I spent a lot of time cleaning up memory leaks in #1 and #2. I suppose this is technically part of #1 and #2, but it happened more recently than the initial implementations. Heh.
In truth, I was leaking a lot. A legitimately embarrassing amount, at first... so in an afternoon, it went from >100MB (just silly!) to 100KB, and now it's at 14KB (through the entirety of the test program). The remaining leak is somewhere in the image data access functions (image_data_put, I think)...
4) I've got bits and pieces of the Ecore bits started, if you count... nearly empty files compiling and installing properly as started. I haven't added them to Git yet, and I have to find a home for them in Google Code SVN (since the root of that is currently the evas directory... oops). I think it's pretty clear that between sorting out threads/runloops/etc. and ... just ... making Cocoa work like a more conventional system, I'm going to be at this part for well into the school year, which is fine with me (maybe I can convince Robb to point me in the right direction, once I can show him what's up). But maybe there's others that work like this, I don't know. Carbon would certainly be literally a million times easier. Gah!
I had a thought yesterday about a feature I'd like to see in Nautilus or Finder...
If you're anything like me, you probably keep a lot of crap on your desktop, mostly related to things you're currently working on (and you file them away later). This certainly isn't the most efficient system, and I can assure you that it's not the prettiest.
So I thought... wouldn't it be cool if you had a little menulet that allowed you to rapidly create directories (in a definable place, say ~/Documents/Projects, or something), and switch your Desktop between representing the contents of each of these project directories easily? If you could get this implemented, it would also allow you to assign a particular project's directory to a Space/Virtual Desktop, I suppose, but I don't use them, so I'm more interested in the thought of a cleaner desktop, and the inherent organizational improvements.
I shared this idea with Robb (who noted that he thought something similar might possibly be in KDE4, though none of us have paid much attention there), and he started to implement it in Nautilus, but discovered that, while Nautilus respects XDG_DESKTOP_DIR, there's no way to convince it to reload the directory (SIGHUP, the most obvious choice, also causes the creation of a new browser window). He also noted that simply replacing the ~/Desktop folder won't work, because, if you've registered for filesystem notifications on the old ~/Desktop, you'll lose your notifications when you replace the directory.
Finder is a different story entirely. Apple uses some sort of magic to determine what directory is the Desktop, and I haven't figured it out yet. It was very promising at first... I created two directories with files in them, deleted ~/Desktop (with root privileges, because a user can't delete their own Desktop...), linked one of the new directories to ~/Desktop, and *BOOM* the files are there on my desktop. But that's the only time it works... if you try to change the link, the desktop continues to represent the new folder, no matter what you do. I have a thought regarding chained links, but I'm not actually sure it's going to work; I'll try it tomorrow.
So! If anyone has any suggestions... now would be the time :-)
Ahhhh! It's been a long time since I last posted, but I'm back up and running for good, now (there'll be another 24 hour outage when I move to RPI, but other than that, we should be good!).
I've replaced Trinity with a nice new machine, built from a bunch of parts I bought (all from Newegg, of course).
I initially tried OpenSolaris (which Mike is succeeding with), but between the package manager needing a serious amount of help and my general inexperience with a rather different OS, I had to go back to Debian. So, no ZFS for now, maybe next summer.
Here's what's what in the new computer:
2.53 GHz Intel Core 2 Duo (E7200)
2GB DDR2 RAM
2x750GB Western Digital Caviar SE16
all in a cute little Shuttle case (the K48). I had to later acquire an extra SATA cable and a ATA-to-SATA power cable (to get data and power for the second drive), but that wasn't a problem...
The stock Intel fan sucks, as everyone has already noted, but Arctic Cooling's fan simply doesn't fit in the small case! (so don't spend extra money on it... just... make the Intel one work!)
The most awesome bit: I get 106MB/s writing to the disk (and 60MB/s over AFP over Gigabit Ethernet, or about 80MB/s over SAMBA). Mike and I discovered that Apple's SAMBA client is broken: I get about 2MB/s with SAMBA on OS X, but 60MB/s with AFP on the same system, and 80MB/s with SAMBA on Linux on the same machine. So, simply put, don't use SAMBA from Leopard.
My PowerMac G4 seems to have stopped working. Luckily, Dad brought a G3 B&W home from our neighbor's a few months ago, so check it out!:

What with crooked disks and a 300MHz CPU, the chances of this being a lasting solution are somewhat slim; I'm going to replace Trin with a small homebuilt machine (based off a Shuttle box)...
Also... this is running inside a chroot off of the Debian 4.0 install CD, so if it goes down... don't look at me :-)
|
|