« first day (573 days earlier)      last day (4372 days later) » 

3:00 PM
@DeadMG I have feeling my rep pts will remain at current levels until you guys go on vacation :-)
 
@Scottymac find yourself a niche (you might get the unsung hero badge which is practically impossible to get past a certain point)
 
I don't have a job, so :P
 
@DeadMG I think kill is much worse.
 
@awoodland still looking for my niche... if people have questions about weather, earthquake models... I can probably help :-)
 
$ whatis kill
kill(2) - send signal to a process
$ # fabricated output (I don't have a linux box handy) but it is something like that
 
3:02 PM
don't see too many questions on that stuff
 
@RMartinhoFernandes why did he lock it immediately before deleting it? that does not seem to make sense?
 
kill is aptly named !
 
robot
I must ask you, a question
should I just copy my sim's results to the renderer in like, a giant memcpy?
 
@CheersandhthAlf I have seen that pattern before. I suppose that's something the system does automatically so that the owner can't undelete (so that mod deletions are final).
@DeadMG What about some double buffering scheme?
 
3:05 PM
I don't require concurrency
although supposedly, real renderers have some interpolation something going on
 
double buffering is probably better anyway since it skips the copy and memory is cheap right?
 
fyi, "rm * .o" is a radically different command than "rm *.o" *cries*
 
@awoodland Exactly.
And it's not that complex to implement.
 
the other solution I was gonna use is just setting the values directly?
but then I'd have to expose the renderer or controller to the sim
which I dislike the idea of
 
@DeadMG I believe what you are referring to is when some renders don't render the latest simulated version, it's an interpolated state some where between the two latest
 
3:07 PM
I think I will introduce that if I start running a lower tick rate
 
@thecoshman surely an extrapolation would make more sense?
 
but since I'm running 30 ticks/sec
 
ot, but, what's tick rate of universe?
 
I read an article which argued that triple buffering is almost always worth doing unless you have like a matrox graphics card or something awful like that
 
and what happens between ticks? he he
 
3:08 PM
@CheersandhthAlf (wild guess) 1 tick per Planck time?
 
@CheersandhthAlf Mostly the UI runs :P
 
@DeadMG The UI of the Universe?
 
i think it was Searle-man who speculated about the "between ticks". good party discussion
 
What is that?
 
oh, I thought you meant, in my engine :P
 
3:09 PM
@CheersandhthAlf You can always take the cop-out approach and just say that there is no "between ticks".
 
What you don't realize is that God is actually running a universe simulation right now. To us, time takes an eternity to pass, but to him 0.42 seconds have gone by.
 
@awoodland i'm fairly sure that interpolation is what is used, perhaps with some sort of over simulation...
 
anyways, I don't really like the idea of double buffering or something like that
then the sim would have to be coded with the explicit knowledge of said
 
it must know where the output goes right now?
 
yeah
that's what I want to eliminate
the Sim::Unit holds a Render::Object*
and I don't like the idea of the sim being responsible for the output of the renderer
 
3:12 PM
@CheersandhthAlf I like this idea of good party discussion from Niven: What can you say about chocolate-covered manhole covers?
 
I mean, if I implement effects, they'd have to go in the sim, which is pretty suck
 
@RMartinhoFernandes uh, don't go down that slippery slope
 
@DeadMG your right to not like that
 
I mean
 
your simulation should be built such that it cares not about the notion of rendering
 
3:13 PM
Java Y U NO TYPEDEFS.
 
@RMartinhoFernandes of all the things to wish for, typedefs
 
but you know what?
I guess I have to make the sim aware of at least some other component
it has to tell the UI when orders are over, for example, anyway to make the UI function
 
@thecoshman Writing List<Variant<String, Foo>> gets tiring pretty fast.
Though I could ask for more, like type inference...
 
@RMartinhoFernandes At least they don't have typename List<Variant<String, Foo>>::Iterator
 
@RMartinhoFernandes public class typedefClass extends ArrayList<Variante<String, Foo>> { }
 
3:16 PM
@Neil List is an interface!
 
@RMartinhoFernandes Fixed. :D
 
@DeadMG the UI should request this from the SIM, or set up a callback system. The sim it self should not have any idea how the UI or render work
 
@Neil But I want to type List<...>, not ArrayList<...> (I won't expose concrete types in a public API.)
 
@thecoshman I already had a callback system
 
@RMartinhoFernandes You really are lazy then. Then try encapsulation.
 
3:18 PM
@Neil How?
 
@DeadMG ok then :D but if you simulation has even the mention of anything UI/rendering related, your doing it wrong
 
@thecoshman Yeah, I got that far
just not sure exactly how to encapsulate that
 
@DeadMG are we agreeing? :O
 
@RMartinhoFernandes Make dummy class which performs whatever operations you require from the encapsulated list.
 
If I'm comparing unicode characters, should I compare code points or code units?
 
3:19 PM
@Neil Ah, right, tons of boilerplate.
 
@RMartinhoFernandes You'll need to add the methods you need, but after that you're good
 
Problem in Java? Needs more boilerplate.
 
@RMartinhoFernandes Then Ctrl+C, Ctrl+V. Take your pick.
 
@SethCarnegie Are there any encodings that can have two encodings for the same codepoint?
 
@RMartinhoFernandes I have no idea
I'm using UTF16
 
3:21 PM
@RMartinhoFernandes No UTF has two encodings for the same codepoint.
 
so a code unit is 16 bits and a code point is 32
 
So there's really no difference.
 
Well aren't there characters that can't fit in 16 bits?
and if you try to compare them it'll chop it in half
 
@SethCarnegie There are characters that'll make your monitor explode if printed. I'd show you, but it'd make my monitor explode.
 
@SethCarnegie Ah, you mean compare a single one not an entire string?
 
3:22 PM
> If I'm comparing unicode characters,
yes sorry, single characters
 
Then use codepoints. That is, if you want <combining acute accent><latin letter A> and <latin letter A with acute accent> to be different.
Otherwise, grab ICU and normalize and shit (i.e. beyond this point my knowledge is useless).
 
@RMartinhoFernandes I am using ICU
 
Why do links in the google search results open a new tab for me now?
 
@RMartinhoFernandes I fail to see how going to the bathroom helps him.
 
Xeo
@MooingDuck maybe your Alt key is stuck?
If you hit Alt-Enter in FF, you make a new tab
 
3:24 PM
Isn't it Ctrl?
 
Xeo
nope
 
I found an elipsis character, cool beans.
 
@RMartinhoFernandes Normalizing cannot reduce all combinations.
 
@DeadMG That's where the "and shit" part enters!
 
you have to use ICU's BreakIterators and stuff like that if you want to start dealing with Unicode UIs
 
3:30 PM
One day I'll read about that.
 
@Xeo it only happens on the google search results page for me that I've noticed, for about the last week
 
@RMartinhoFernandes Basically, they are supposed to correspond to what the poor user views as one character (but may actually be N codepoints).
 
Question, you have an array a of length 3 or greater. Is it possible with one pass, to find a[i] < a[j] < a[k] such that i < j < k?
 
I'm starting to notice a pattern. If I say "One day I'll do X" it often turns out "I'll never do X".
 
@Neil Yep.
 
3:31 PM
with one pass?
 
yep
 
@Neil I'm not sure I understand. You want to find the ordering of the entire array in one pass? No.
 
@MooingDuck No, only a constant-size subset of it.
 
@MooingDuck No. He wants to find three values that are ordered between themselves in the array.
 
No, you need to find a situation in which there are 3 increasing values in the array, not even necessarily consecutive
 
3:32 PM
@RMartinhoFernandes oh, makes sense
 
Id est, given [4, 6, 2, 5, 10], an answer could be [4, 6, 10], or [2, 5, 10], but never [2, 6, 10].
 
actually, I have a nasty feeling that it would not be possible.
 
@RMartinhoFernandes Precisely
 
one pass yes. Linear time is less obvious to me.
 
Increasing subsequence as a google search term?
 
3:34 PM
@Neil {3, 2, 1}
 
Nah, that gets polluted with LIS.
 
wait my subway sandwhich looks different today. Did they do something new in US
 
@JamesCuster What's {3, 2, 1}?
 
An array in which you can't find a[i] < a[j] < a[k] such that i < j < k at all
 
what you would need to do is something like heapify it
 
3:35 PM
Heapify is linearithmic.
 
but that's O(n log(n))
I don't think you can do better in the general case
 
@JamesCuster It would have to know that no solution exists, but you could easily verify that with a simple constant-time check after the algorithm
 
2
Q: How to select increasing subsequence of values from IObservable<T>

user837982How to write this method? public static IObservable<T> IncreasingSubsequence<T>(this IObservable<T> observable, IComparer<T> comparer) { // ??? } Resulting observable should push only those values that exceed maximum of all previous values.

 
unless you kept some kind of vector of all the possible current subsets
 
you can do it in linear time and constant storage.
one-pass.
 
3:36 PM
Best thing I could find. The answer provided is indeed linearithmic.
 
I seem to have a 9 inch subway sandwhich
 
@StephenCanon Show algorithm or no doggy treat.
 
@RMartinhoFernandes That is a snazzy C# solution, but that doesn't mean it is done in one pass
 
@Neil Like I said, it's n log n.
 
read forward through array. keep track of 1. smallest element seen so far and 2. sequence of two increasing elements with minimum second element seen so far.
 
3:37 PM
@RMartinhoFernandes Well in one pass I meant O(n) time
 
at each step, check for an increasing 3-sequence against the existing known 2-sequence.
 
@StephenCanon { 2 3 1 4}
 
@Neil I know. I'm saying it isn't in one pass.
Mathy explanation.
 
@RMartinhoFernandes Oh.
 
@MooingDuck: that's handled properly.
 
3:38 PM
@StephenCanon That was my first thought. But I don't believe it can find all possible positions
 
the question doesn't require all possible. It requires one.
If one exists, that will find it.
 
but that one could be in any possible position
meaning you have to search them all
finding one is the same as finding them all, but with early terminate. it doesn't change the algorithmic complexity.
 
@StephenCanon I didn't understand then. Doesn't seem to handle {4 5 1 2 3}
 
of course it does.
 
@MooingDuck It does.
 
3:40 PM
I'll write the state at each step as {min-element, (min-sequence)}. Then we have the following:
 
@RMartinhoFernandes then I defininitely didn't understand the algorithm. I'll go reread it a bunch more times. I think I figured it out now.
 
Bootstraps with ([4, 5], 1) then becomes ([1,2], 1), then [1,2,3]
 
{nil, nil}
{4, nil}
{4, (4,5)}
{1, (4,5)}
{1, (1,2)}
next step we find the sequence.
 
@StephenCanon oh, yeah yeah, I get it
 
@StephenCanon Your algorithm doesn't handle {2 3 4 1} though
 
3:41 PM
yes it does.
 
You find 1 as smallest, then you find 2 3, but it comes before 1
 
you never reach the 1.
 
@Neil It stops before reaching 1.
 
@Neil handles it fine
 
you terminate at the 4.
 
3:42 PM
Either you get the smallest by making a pass or you get the "smallest thus far", meaning it works for {2 3 4 1}, but not for {2 3 0 1 2 }
 
5 mins ago, by Stephen Canon
read forward through array. keep track of 1. smallest element seen so far and 2. sequence of two increasing elements with minimum second element seen so far.
 
@Neil smallest thus far would work fine for that.
 
> smallest element seen so far
@Neil That second example is just like the one the Duck showed above.
4 mins ago, by Mooing Duck
@StephenCanon I didn't understand then. Doesn't seem to handle {4 5 1 2 3}
Same wolf, different coat.
 
The only downside is that it requires O(k^2) storage for finding the length-k sequence, which seems inelegant. On the other hand, it's not obvious you can do better.
 
@StephenCanon That wasn't a prerequisite for the problem
 
3:45 PM
@StephenCanon It's constant in N, which is I think the important thing.
 
I'm struggling to express a meaningful invariant, though.
 
problem: {2 3 4 1}
read 2: {{},2}
read 3: {{2,3},{2}}
read 4: {{2,3,4},2} bailout, solution found.
 
@Neil: I know it wasn't a requirement, it's simply unsatisfying.
 
{1 3 2 0 5} wouldn't work for this maybe
 
3:47 PM
you hit 0 and you start from scratch, when your solution could be 1 2 5
 
you do not start from scratch when you hit zero.
 
You hit zero and you have (0, (1,2)).
 
when you hit zero, your state is {0, (1,2)}
 
@StephenCanon From what I see, it would require, at most, 2k storage, not k^2
 
3:49 PM
Once you have the 2-sequence built, the minimum is unnecessary.
 
so you keep an array of values you have to keep updated? That smells of O(n^2)
 
@DeadMG For k you need to store the least k-1-sequence, k-2-sequence, ..., and 1-sequence.
 
@DeadMG you need the sequence one shorter than target, two shorter than target, three shorter than target, etc. I think it's k^2
 
You need to store the sequences with minimal last element of length 1,2,3,...,k-1
 
thought you said you'd keep the smallest
 
3:50 PM
That's O(k^2)
 
@Neil It's not. You iterate through the source array once.
 
@Neil it smells of, but isn't quite. That part is actually O(3^2)
 
@RMartinhoFernandes Ah yeah, forogt about the k-2... sequences.
you know
 
@MooingDuck No, it's n, not 3.. there could be n objects in this list
 
maybe I should just accept limited encapsulation
 
3:51 PM
@Neil: no, there can't be.
 
@Neil irrelevant, the storage part is O(3^2)=O(1) The rest of the algorithm is all linear.
 
instead of going for total encapsulation
 
The list you're searching is size n. You only keep track of 3 elements of data.
 
@StephenCanon there are n subsets in this array
@StephenCanon It's true it does not exceed size 2, but there are n of them.
 
The "array of data" you're constantly updating that appears O(n) is a fixed size, and not related to n.
 
3:52 PM
@Neil But you only need to track one of them at once.
 
@Neil: what are you even talking about?
 
@DeadMG Sometimes you have to give up on warm fuzzy feelings and go with what works. Annoying, but well...
 
There's only one array: the input array.
 
5 6 4 5 3 4 2 3 1 2 means your list grows as {{5}} -> {{5, 6}} -> {{5,6}, {4}}, {{5,6}, {4,5}}
 
3:53 PM
No, it doesn't. I don't have a list.
 
Each time, you're checking each sub-item to see if you've made a set of 3 or a solution
 
@Neil no, the last bit is {{4,5}, {4}}
 
@Neil No, he only needs to keep one card(2) set.
 
You completely misunderstand the algorithm.
 
there is no value which can satisfy {5,6} but not {4,5}
so you know in advance that you can drop all the subsets except the one with the smallest second value
 
3:54 PM
@DeadMG Okay, I was modeling his algorithm
 
@Neil you don't have to keep {5,6} and {4, 5}, since the second is always better, discard the first.
 
Exactly.
 
therefore you only need to keep one 2-subset around
 
The actual state is just (a) the minimum element and (b) the 2-sequence with minimum second element.
It's size is constant.
 
I wrote that example, but it could be 5 10 4 8 3 6
You can't discard 5, 10 because you found 4, 8
 
3:55 PM
That has no solution.
 
of course you can.
 
or can you?
 
@Neil yes you can
 
@Neil If you find a 9 or 10, it completes 4, 8. If you find an 11+, it completes both.
 
@Neil There is no value which satisfies 5,10 but not 4,8.
therefore you absolutely can discard 5,10
 
3:58 PM
@Neil should we code it up on ideone so you can test it out yourself?
 
@MooingDuck No, when I get to the point where people are trying to spoon-feed it to me like I'm incapable of understanding the problem, I know I'm no longer having a conversation but rather being persuaded.
 
@Neil :( sorry.
 
@MooingDuck Don't apologize. If you said it, it was because the others were thinking it.
 
@Neil personally I like samples of algorithms like this to play with. It gives a more tactile feel toward believing it, if not understanding it.
 
It's a psychological thing I guess. When one person disagrees with all the rest, it easily turns into a "Lets see if we can't explain it to him" conversation.
Which would be fine if the one person is always wrong (which he normally is)
 
4:02 PM
@Neil That has little to do with 1:N, and more to do with the fact that we have an idea/concept/belief that you don't. I often find myself in N:1 situations, because I'm a bona fide genius.
 
you know
even if I created a massive 100k units
that's still only 1.2MB of data to go over to the renderer
copying that in memory shouldn't take tooooo much time.. right
 
@Neil usually it's me :D
 
@DeadMG But, but... something.
 
@RMartinhoFernandes but it's horrifically fugly? :P
 
4:05 PM
Not that much.
 
but, logically, I have an unsolvable problem
 
I just have some aversion to gratuitous copying.
 
either you operate on the same set of data, or you copy it.
and thar be no magical bullet changing that fact
 
I fail. Full of corner cases, and doesn't work. ideone.com/jIFnW
 
@RMartinhoFernandes well fix it
 
4:12 PM
@cat how broken is glskel for linux?
 
@MooingDuck Debugging Haskell on ideone will be painful.
 
@RMartinhoFernandes I know how hard C++ is to debug on ideone :( Is Haskell harder?
 
@MooingDuck In C++ you can std::cout stuff.
@MooingDuck Fixed! ideone.com/7LgSm
(Debugged in my head... :S)
 
@RMartinhoFernandes 3 or general case?
 
That's for 3.
 
4:16 PM
3
 
For k-sequences I wouldn't be able to use so much pattern matching like that.
 
4:29 PM
maybe I should point them!
fuck me, that's the stroke of genius I was looking for
 
Point what?
 
Oh, share it.
 
and I can allocate the struct in an object pool and make it sexy-fast to access
 
You should put a toString on Object.
 
4:34 PM
Hey check it out, MSVC11 is missing more than half of the required overloads: msdn.microsoft.com/en-us/library/ee404875%28v=vs.110%29.aspx
 
twould be amusing, but hardly necessary
 
@rubenvb are those new to C++11, I don't recall them
 
> Converts a floating point value to a string in the style ddd.ddd. At least 6 digits are written after the decimal point character.
What about NaN and infinity?
 
Ell
4:39 PM
where did the prolog is better thing come from? o.O
 
@classdaknok_t I think those are ID.
 
@classdaknok_t float doesn't have to be IEEE754
 
@Ell From here:
8 hours ago, by R. Martinho Fernandes
room topic changed to Lounge<C++>: Java is a better language than C++ in all regards. [c++] [c++11] [c++-faq]
 
and to_string is defined in function of printf macros
 
The Cat changed to Prolog to piss off the puppy.
 
Ell
4:41 PM
haha :L
 
@RMartinhoFernandes Didn't even notice.
 
@classdaknok_t "Each function returns a string object holding the character representation of the value of its argument that would be generated by calling sprintf(buf, fmt, val)"
 
@JamesCuster thanks!
I want mushroom soup.
 
I think I'm going to write a small boilerplate generator in Haskell this weekend. Then my productivity on Monday will skyrocket.
 
FrameworkElement, y u no get left clicks?
 
4:55 PM
@thecoshman No event handling.
And poor error handling.
I'm working on plugging Qt in to do heavy lifting while I work on standalone drivers.
 
@CatPlusPlus Qt might be overkill, no?
 
No, why?
 
Because it's overkill?
 
@CatPlusPlus erm, on linux I am getting an error as I try to build it --> ../src/linux/window_factory_impl.cpp:92:39: error: cannot convert ‘GLXContext {aka __GLXcontextRec*}’ to ‘Display* {aka _XDisplay*}’ for argument ‘1’ to ‘void glXDestroyContext(Display*, GLXContext)’ does that look like something I have set up wrong?
 
No it isn't. :.
 

« first day (573 days earlier)      last day (4372 days later) »