Recent blog entries for redi

18 Aug 2008 »

reality check

adulau says an OS is useless without Git. Even if I ignore the existence of non-developers, I can think of some more important tools. adulau's own recipe for updating screen is useless without make and a compiler and he could download a tarball of the screen sources instead of using git. Am I alone in not being sexually aroused by Git?

14 Aug 2008 (updated 14 Aug 2008 at 11:20 UTC) »

die, spammer, die

If DrDeniro isn't spammer scum I don't know who is. A huge <div> obscures the button to flag the account as spam and on Internet Explorer also redirects to a pharmacy site. This seems like a mod_virgule bug that should be addressed.

Click here to flag the account as spam.

robogato, I've emailed you the problematic markup in the "Notes" section.

7 Aug 2008 »

Uh oh.

pa.swap(pb) still works even without the new swap() overloads, and is still equivalent to pa = pb.

Stay tuned for more live C++0x.

7 Aug 2008 (updated 7 Aug 2008 at 20:47 UTC) »

The answer to my C++0x quiz is that the explicitly-specified template argument means that these swap() overloads are tried:


void
swap<A>(shared_ptr<A>&, shared_ptr<A>&);
 
void
swap<A>(shared_ptr<A>&&, shared_ptr<A>&);
 
void
swap<A>(shared_ptr<A>&, shared_ptr<A>&&);

pb doesn't match any of those types, but if a temporary shared_ptr<A> (pointing to the A subobject of *pb) is created from pb, that temporary then binds to the rvalue-reference in the the third swap() overload. So pa is swapped with a temporary, and both pa and pb end up pointing to the same object; swap has performed an assignment!

The solution proposed by Howard Hinnant an hour ago is simply to remove the new swap() overloads from the working paper. The original motivation for them came from n1690, but now that we have std::vector::shrink_to_fit() there's no need for the overloads. So I won't bother adding them to libstdc++.

cdfrey, you may remove your suspenders ;-)

6 Aug 2008 (updated 7 Aug 2008 at 20:23 UTC) »

C++0x quiz

This came up while I was bringing GCC's shared_ptr up to date with the latest C++0x working paper.

What will happen here?

$ g++ -xc++ -std=c++0x - <<EOT && ./a.out
#include <memory>
#include <cassert>
struct A { };
struct B : A { };
int main()
{
  std::shared_ptr<A> pa(new A);
  std::shared_ptr<B> pb(new B);
  std::swap<A>(pa, pb);
  assert( pa.get() != pb.get() );
  return 0;
}
EOT

What do you think should happen?

6 Aug 2008 (updated 6 Aug 2008 at 10:59 UTC) »

Fedora desktop suckage due to KDE 4.0

I can't drag files from konqueror to the desktop or vice versa (meant to be fixed in KDE 4.1)

I can't reduce the panel size because the clock resizes itself wrongly and wraps to the top edge of the screen. The bug report was summarily closed because it's been fixed upstream. Except it hasn't, in a perfect example of the situation apenwarr describes:

With 4.1 just around the corner, it's time to close off 4.0 bugs. In the off chance that I'm wrong in believing this to be fixed in 4.1, please reopen. :)

You're wrong and the smiley face doesn't change the fact you didn't bother to check.

Screen Saver Settings gives me the option of blank screen or random (which will pick from the list of blank screen, and erm, that's it.)

Something regularly swallows Alt-Tab so I can't cycle through windows.

I have files in ~/Desktop that aren't shown on my desktop and stranger still: icons on my desktop that don't refer to any files. Clicking the settings button on the icon tells me its location is ~/Desktop and its name is 0889.html.gz, but ls ~/Desktop/0* shows no matches. Whose clever idea was it to separate the contents of ~/Desktop and the contents of my desktop?

All in all, a significantly worse desktop experience than Fedora 8. The new things that actually work are pointless bells & whistles that I couldn't give a flying toss about. I understand why the KDE team made a dot-oh release like this, but I can't understand why distros thought it was ready to ship. Fedora had better not turn from a RHEL beta-testing environment into an alpha-testing one. I like Red Hat and hope they are successful making money, but for the first time in over a decade I'm seriously considering switching distro.

17 Jul 2008 »

I agree with lkcl that you can avoid being marked as a spammer by taking 30 seconds to say what your involvement is in open-source software. Linking to a brand new Wordpress account that has no content doesn't convince me you're doing anything except preparing to spam (see one of today's new accounts.)

Create a new account could recommend being more descriptive, to protect against the trigger-happy spam police (I include myself in that category.)

11 Jul 2008 (updated 11 Jul 2008 at 12:47 UTC) »

ncm, yep, I only mentioned the one that most annoyed me, as I'd already done one hatchet job on it in the #cplusplus channel at work. There are a few sensible rules, though they tend to be in the blindingly-obvious category, rather than useful e.g. "Use the C++ keyword explicit for constructors with one argument" - not really a style tip, more like "remember to tie your laces when you put your shoes on."

Update: I hadn't noticed they require ALL_CAPS for enumerator names. Epic fail.

10 Jul 2008 »

Having read the Google C++ Style Guide I can safely say I would never work for Google. Any style guide that recommends 2-stage construction "if at all possible" is shit. That style is, as Stroustrup said eight years ago, a relic of pre-exception C++.

10 Jul 2008 »

Dear Advogato,

I've been too busy to read you recently, except for a few people's diaries that I watch for updates. I hope you don't mind.

I thought you might like to know I released a new version of PStreams yesterday, but you probably don't care. I've also resumed porting STLsoft and Pantheios to Solaris, and made my biggest change yet to GCC: GNU Compiler Collection, fixing something I helped break back in February this year.

Until next time.

145 older entries...

New Advogato Features

FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!