Jump to content

  • Log In with Google      Sign In   
  • Create Account


superpig

Member Since 26 May 2001
Offline Last Active Apr 04 2011 11:43 AM
-----

Topics I've Started

Gdnet Black (Alpha)

10 January 2011 - 09:44 PM

If you look at the bottom of the page, you'll see that there is now a little drop-down box that lets you change your skin (if you're logged in).

I've put together the very beginnings of a dark-based theme, for those of you who HATE THE LIGHT, SSSSSSSSS. It's more of a proto-skin at the moment, but it should allow you to read threads in a lot more comfort. I'll work through the other major pages and fix them as well in time, but I figured that some of you might like to start using it now. Be aware that it is under construction, so don't be surprised if you're browsing the site, and suddenly: POW, RIGHT IN THE KISSER. Er, I mean, the stylesheet.

So yeah. Enjoy. Let me know if you've got better palette suggestions, I'm not an artist and have really just picked shades at random most of the time.

One thing that would help me would be if anyone else is happy to contribute CSS rules to the skin. That way I can just copy and paste them in, and it'll all be done a lot faster.

(edit by Gaiiden)
Please everyone if you notice issues with the black theme, do not use the Feedback tab, but report them here so everyone can see them, offer corrections and superpig can also have all issues in one place for making edits to the theme.

Code review request: LINQ sequence split

25 March 2010 - 02:37 AM

I've just written a LINQ extension method to split a sequence up into subsequences partitioned by particular elements. Similar to String.Split, but working on any sequence, not just sequences of characters. Here's my solution. Can you find any problems with it, or suggest way to improve upon it? It strikes me as being quite a lot of code for such a simple thing.
public static class LinqExtensions
{
    private class SplitSequenceEnumerator<T> : IEnumerator<IEnumerable<T>>
    {
        private readonly IEnumerable<T> _baseSequence;
        private readonly T[] _separators;
        private IEnumerable<T> _remainingSequence;

        public SplitSequenceEnumerator(IEnumerable<T> baseSequence, T[] separators)
        {
            if(baseSequence == null) throw new ArgumentNullException("baseSequence");
            if(separators == null) separators = new T[0];

            _baseSequence = baseSequence;
            _separators = separators;
            _remainingSequence = null; // Initial state should be such that we're "before" the first elem
        }

        public void Dispose()
        {
            
        }

        public bool MoveNext()
        {
            if(_remainingSequence == null) Reset();
            _remainingSequence.SkipWhile(t => !_separators.Contains(t)).Skip(1);
            return _remainingSequence.Count() > 0;
        }

        public void Reset()
        {
            _remainingSequence = _baseSequence;
        }

        public IEnumerable<T> Current
        {
            get { return _remainingSequence.TakeWhile(t => !_separators.Contains(t)); }
        }

        object IEnumerator.Current
        {
            get { return Current; }
        }
    }

    private class SplitSequence<T> : IEnumerable<IEnumerable<T>>
    {
        private readonly IEnumerable<T> _baseSequence;
        private readonly T[] _separators;

        public SplitSequence(IEnumerable<T> baseSequence, T[] separators)
        {
            _baseSequence = baseSequence;
            _separators = separators;
        }

        public IEnumerator<IEnumerable<T>> GetEnumerator()
        {
            return new SplitSequenceEnumerator<T>(_baseSequence, _separators);
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }
    }

    public static IEnumerable<IEnumerable<T>> Split<T>(this IEnumerable<T> xs, params T[] separators)
    {
        return new SplitSequence<T>(xs, separators);
    }
}


ACORN

15 September 2009 - 03:12 PM

I was watching O'Reilly earlier tonight, and he had a couple of commentators on discussing the ACORN tapes. The guy commentator - I can't remember his name, unfortunately - said that the film-makers had "by their own admission" tried to catch out "hundreds" of other offices and been turned away or had the police called on them. O'Reilly didn't know that (though the point was swiftly ignored, sadly). I can't find any actual source for the statement. Has anyone seen it? The closest I can find is Scott Levenson's statement in which he apparently says that they tried five other places and didn't get the same result (the link in question doesn't seem to have that part but I've seen a bunch of transcripts).

Asset management systems

04 May 2008 - 10:32 AM

Hi folks, Have any of you encountered systems for managing audio assets during the development process? Like, for storing and searching a database of FX, loops, sounds, music, etc... So far I've found Sonomic TLS, Soundminer, MSoft's ServerSound and Gallery MTools, but I'm wondering if anyone can point me at any others.

Countdowns...

22 April 2008 - 04:58 PM

I've just installed a little countdown timer on my machine to count down the days until I have to hand in my project. Currently I've got 25 days, 6 hours, 58 minutes, and a few seconds. I'm not yet sure whether the timer is going to motivate me, depress me, or just drive me insane with its infernal measurements of the passage of time. What do you guys think? Do you use countdown timers for things, and why, or why not?

PARTNERS