Language:
switch to room list switch to menu My folders
Go to page: First ... 40 41 42 43 [44] 45 46 47 48 ... Last
[#] Wed Nov 11 2009 18:37:33 EST from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Any sufficiently complicated C or Fortran
program contains an ad hoc, informally specified,
bug-ridden, slow implementation
of half of Common Lisp.
--Phil Greenspun's Tenth Law of Programming

http://ll1.ai.mit.edu/shriram-talk.pdf

[#] Sat Nov 14 2009 08:55:03 EST from davew @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

I wasn't actually complaining about the lack of a mutex or anything else per se. I was just trying to get it perfectly straight in my mind exactly how we were getting away with things, specifically why no two threads ever attempted to service the same accept(). I, wrongly, assumed that select() would only awaken one thread for a pecific set of fd's triggering and that other threads in select() would wait for activity on the remaining fd's.

Hmm, thats not very clear.... which is exactly why I asked.

We are multiplexing our threads and there is usually a form of state machine involved but that is determined by the protocol in use. It usually takes the form of a command - response loop.

The thing that prompted all this was I noticed my server was handling new connections and not servicing existing connections (some little nerk trying to hack me) and another more complex situation that doesn't matter here.

Thanks to all for the information.

 



[#] Sat Nov 14 2009 08:55:57 EST from davew @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

 

Wed Nov 11 2009 02:28:26 AM EST from dothebart @ Uncensored
hm, it was mstone I was talking about. _this_ definitely is one of my tripple-m's, IG.

Yes, mstone. used that before.

 



[#] Fri Nov 20 2009 22:56:18 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

This amused me.. someone described the '-->' operator as the 'goes down to' operator:

#include <stdio.h>
int main()
{
     
int x = 10;
     
while( x-->0 ) // x goes down to 0
     
{
       printf
("%d ", x);
     
}

}



[#] Fri Nov 20 2009 23:15:34 EST from the8088er @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

I thought -> had to do with pointers...
Like x-> is equivilent to (*x)

[#] Sat Nov 21 2009 06:46:49 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

*chuckle*

It's not ->... it's -->.



[#] Sat Nov 21 2009 10:40:07 EST from davew @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

it would be better written as

while ((x--) > 0)

just to eliminate the ambiguities.



[#] Sat Nov 21 2009 15:39:05 EST from dothebart @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

hey, fleeb, i'd call that my first real good c-joke. Realy fucking cool!



[#] Sat Nov 21 2009 20:34:04 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Mine, too, dothebart!  Cracked me up when I found it.



[#] Sat Nov 21 2009 21:21:20 EST from LoanShark @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


--> is the "state transition" operator, obviously.

[#] Mon Nov 23 2009 00:34:06 EST from IGnatius T Foobar @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Even something like

while (x-- > 0)

would have been more understandable (or at least, not mistaken for an operator)

[#] Mon Nov 23 2009 05:50:49 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

And kill the mystery?



[#] Mon Nov 23 2009 07:51:26 EST from IGnatius T Foobar @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Ok then, since we now have access to Unicode, perhaps we should start defining even more bizarre operators since we have so many characters to choose from.

Unfortunately I don't know of an easy way to get them all on the screen in a way that everyone here is guaranteed to be able to read. For that matter, a potential C compiler might have the same problem :)

[#] Wed Nov 25 2009 16:23:53 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


I did something kind of fun today.

I created an input stream manipulator for a custom class.

std::string str( "+01:02:03:04" );
std::stringstream strm( str );
timecode tc;
strm >> type( timecode::ePAL ) >> tc;
assert( tc.get_type() == timecode::ePAL );
std::stringstream strm1( str );
strm1 >> type( timecode::eDROP_FRAME_NTSC ) >> tc;
assert( tc.get_type() == timecode::eDROP_FRAME_NTSC );

[#] Wed Nov 25 2009 16:42:46 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


I told Ford II a little about this project I've been working on, but if anyone else out there is into C++, and some of the funky things you can do with it, you might find this interesting, too.

I already mentioned elsewhere that I've been working on an object that allows you to work with timecode. I think I am nearly finished with this.

My timecode object, as it stands right now, can convert between a good number of different kinds of timecode, allows you to add and subtract between the various kinds of timecode, iterates frames or decrements frames, can express itself in wchar_t or char character types, and can express itself in terms of the boost 'ptime' object (think of this as a platform-independant expression of time). You can compare them against each other, such that you can figure out which bit of timecode happens before some other bit of timecode.

This timecode object can be streamed, either out or in. It won't throw an exception on a bad parse... it simply has a type of 'eUnknown'.

If you have some kind of time code that doesn't conform to any of the kinds of timecode I current understand, you can use this as a framework to create your own very easily, through a templated class. Under the covers, I use the same mechanism for all the kinds of timecode I know about (PAL, film, NTSC [drop frame or not], and this funky 3/5 pull-down thing that I hope I figured out right, plus the double-NTSC, double-drop-frame-NTSC rates for interleaved video). If you need to support a fixed frame rate that's unusual (e.g. 72 fps), it's as easy as templatizing my existing classes using '72' instead of, say, 30 or 25. Even if you come up with something that's downright ludicrous, I should most likely be able to handle it if you create a class to explain how to calculate the timecode, and drop it into the template.

The class that can convert between the known timecode types is a beauty, though. It uses something very much like the 'union' keyword, except that it works with complex types. So, the 'timecode' object can use any of my known typedeffed templated classes as its underlying type, yet still compare 'timecode' objects, even though they're completely different types. It can even perform calculations between the two different types... so you could conceptually subtract PAL timecode from NTSC drop-frame timecode and have it make some kind of sense. I would hope nobody would actually do this, but it's still pretty cool to be able to do.

At this point, I need to handle crossing the midnight boundary, and incrementing against days (or going negative). Otherwise, I think it's done.

[#] Thu Nov 26 2009 19:01:07 EST from IGnatius T Foobar @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

It's always a mixed blessing when you find an elegant solution to a problem that shouldn't have existed in the first place, isn't it?

[#] Fri Nov 27 2009 02:45:06 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Pretty much.



[#] Wed Dec 16 2009 06:48:06 EST from Ford II @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

today I found out about a programming language called go. I found out abut it because somebody is writing a go popserver adn wanted my help on the pop4 implementation stuff.

Why YET ANOTHER LANGUAGE?
It sounds like a cross between java and C.
why why why.

[#] Wed Dec 16 2009 09:04:02 EST from dothebart @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

because of...

google.



[#] Wed Dec 16 2009 13:22:01 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

If I've read it right, Google came up with a language named 'Go', but someone else has a language (that predates Google's Go) named 'Go!'.

Let the confusion continue.



Go to page: First ... 40 41 42 43 [44] 45 46 47 48 ... Last