« first day (1304 days earlier)      last day (3646 days later) » 

12:37 AM
I'm looking for an odd kind of lock, kind of like a reader-writer lock except that the two phases aren't multiple readers vs one writer, it's multiple in phase one, and multiple in phase two, but the two phases can't overlap
is there a name for that sort of lock? An implementation?
damn, this room is empty
 
Man, I need to watch this Fiddler on the roof
 
:/
I guess I'll use boost condition variables..
 
1:08 AM
Hi
@MohamedAhmed - I typedefed the boost::dynamic_bitset. Hopefully you will see the error(s) that you are making when using the typedef as opposed to the un-typedefed name. — PaulMcKenzie 16 mins ago
 
:/ I didn't think typedefs changed anything, they're not a type they're just a name for a type
 
<3 nice!
 
1:58 AM
ugh, I'm trying to put up a simple one-page site for myself
 
The trick to webdesign is plagiarism.
Anybody know of a sparse gpu solver that has native support for diagonal matrixes?
 
not sure how much I can plagiarize here considering I only have a few words to say
so far I've gotten to this: thelatenightcoder.com
ignore the URL, will change to alexmdevelopment.com soon
 
I'm getting confused by std::condition_variable... why is there a mutex, all I wanted was for a bunch of threads to wait on a signal and for them all to wake up on notify_all? Is there a standard way to do this in c++ without cruft I don't want?
 
The "cruft you don't want" is an essential part of the mechanism.
 
I picked the handwritten font because I think it fits a gamedev better than a sober font
 
2:04 AM
You probably should avoid touching things you do not understand.
 
after all I'm not stuck knee deep into CRMs and other stuff
 
@AlexM. open-source has a hyphen. Also add a favicon. Link to stack overflow careers is broken because the profile is hidden(?)
 
oh shut up, I've been a programmer for probably more years than you've been alive
 
@Mikhail I'd rather finish the site before adding a favicon, but good point
 
@JoshS And yet, you still suck at it.
 
2:05 AM
@Mikhail nah, it's broken because I'm a genius
and I linked to shit
fixed
 
@JoshS The mutex you need when using a condition variable is used to protect the CV itself.
 
In production and development, open source as a development model promotes a) universal access via free license to a product's design or blueprint, and b) universal redistribution of that design or blueprint, including subsequent improvements to it by anyone. Researchers view open source as a specific case of the greater pattern of Open Collaboration, "any system of innovation or production that relies on goal-oriented yet loosely coordinated participants, who interact to create a product (or service) of economic value, which they make available to contributors and non-contributors alike...
open source doesn't seem to have a hyphen
 
... maybe an hyphen to avoid plagiarism?
 
lolwat
 
 
2 hours later…
3:46 AM
Out of curiosity, has anyone successfully used clang's C++ modules in a project?
 
Local real estate agents now accept bitcoins, how lovely @catplustplus
you can buy a house using bitcoins!
 
@Nican no, but it would be cool. How do you want to use them?
 
clang.llvm.org/docs/Modules.html Mostly tired of header files. Clean up code.
 
Oh, I misunderstood, I thought you meant incorporating clang into a project
there's some module system?
C++ just isn't a modern language when it comes to modules. Somehow I'm not all that interested in how they can mutate it though - I use C++ but I want to see better languages built from the ground up
though I love the new atomics with their memory models, I don't know of any language that gets to that level and it's totally necessary on modern cpus
 
4:07 AM
@Mysticial I was going to say "what in the actual everliving fuck", but because of the sexual connotations carried by the word fuck, I am going to say "what in the actual everliving shit" instead. What in the actual everliving shit.
 
did you mistype I don't see any comments by mysticial
 
@JoshS Click the arrow
 
Ha! Honor cultures.
I made perogies
you have insulted my honor, we must battle with PHP to the death!
 
@JoshS It can be. There have been proposals to fix it and it looks like it's getting accepted at some point in the future because the committee has placed it as a high priority thing.
Modules and Concepts are the only thing IMO that C++ is truly lacking. Possibly Unicode as well.
 
There are so many things about it I find annoying
 
4:14 AM
C++ needs LINQ.
 
And I don't even know what Concepts are
 
@Nican It doesn't fit well with C++.
@JoshS C++11 and C++14 have improved pretty much 85% of the language.
 
Actually, what I really miss is having coroutines. Async kind of fits the cake, but not sure how well it scales.
 
one sec on phone
 
@Nican C++ is sufficiently versatile that you can do 90% (or so) of LINQ without the "LI" part.
 
4:24 AM
I want a language designed for metaprogramming, that comes with a good jit
 
The N doesn't stand for anything
L ist IN tegrated Q uery. :v
 
Actually, since I don't know of any language that has everything I want to play with, I'm in the middle of writing one
 
@Rapptz language integrated Query.
 
Oh yeah, language.
Forgot.
 
also I want something much nicer than templates.... God
 
4:25 AM
templates are great
:v
 
They kind of figured out that templates can be turing complete by accident, backpatched the compilers to implement that interpretation of a totally ambiguous design
and ended up with the worst language in history - the template compile time language
Not readable, not debugable
not tracable
no good data structures
no good control structures
Scheme had the idea of making the macro language the same as the programming language - then a bunch of professors had a "better" idea and have made it a powerful but HORRIBLE cludge
So it's not like there's a great alternative
maybe clojure has one
 
@JoshS That's not entirely accurate. The design was unambiguous and already implemented, and then people figured out it was Turing complete.
 
I'll say this, if you have something hard to program in C++, then you can get as much done in a day in Scheme as in a couple months with C++ - and it's amazing what 1000 lines of scheme can accomplish
 
You seem to love Scheme.
Stick to it.
 
not really. The macros are bad, the syntax is unreadable
the multiprocessing support isn't there
uhm the threads block on basic stuff
the multiprocessing support isn't there
nothing like atomic
Racket has an optional type system with some really strange ideas that seem to have come from mathematicians not programmers
 
4:34 AM
@JoshS mpl::vector, std::tuple.
@JoshS std::conditional
I'm not sure what you're using templates for actually
I have a few gripes with it though.
 
mostly to try to get around limitations of the language
 
Such as?
 
sigh - at times I've made lots of things now covered by the standard like atomic types
and similar, should look like a number or should look like a pointer
I made my own any type once
like boost
uhm.. but these things are REALLY hard to get working
and they break when compilers change
they break bad
 
any is quite literally easy to do o.o
you could do boost's implementation in ~50 LOC.
 
and handle the edge cases?
no
not at all
 
4:39 AM
yeah pretty much
you use a smart pointer, e.g. std::unique_ptr and it handles it for you
 
well I wrote this stuff from scratch without boost obviously
and before c++11
 
Well. Learn C++11 :v
 
It's funny the changes they make... at one point I had templates that could calculate stuff like the square root in GNU - then they decided that doing float arithmatic in templates wasn't standard and took it out
Lol using newton's method
 
3 messages moved to bin
 
5:21 AM
@JoshS: You do not need templates for that in C+11, you can use constexpr functions instead.
 
6:17 AM
@rightfold run.
 
user1804599
:D
 
user1804599
case mmulti_no { … }
 
user1804599
He says multi_no is a function, so were function calls without parentheses or something? :v
 
user1804599
multi_no is an atom in modern Erlang.
 
Can't functions be "cased"?
 
user1804599
6:24 AM
You can, but it’s pretty pointless. :v
 
IC.
 
user1804599
case fun multi_no/0 of
    % what the fuck can I match it with?
    X when is_fun(X) -> … % hmmmm :D
end
 
user1804599
Just multi_no is always an atom. If you want to refer to it as a function, you need to do fun <name>/<arity> because otherwise it couldn’t know which arity overload to pick.
 
Erlang overloads based on... the arity?
That doesn't make any sense.
 
6:41 AM
Have been bitten by mozzies for at least 10 times in the past few days & it is almost winter :/
 
a week of stormy weather + flooding in the capital & that huge amount of hail that looked like snow once it settled
two days of sunny weather
and now it's stormy again
what the hell is wrong with the weather
 
reminds me to stay away from the bushes ...
 
7:08 AM
if I have two condition variables that never trigger at the same time, can I let them share a mutex?
they alternate
 
I guess but why would you
you're inviting deadlocks for the cases where you did something wrong and they alternate poorly
unless you want that, so you can spot it and fix it
 
because they protect the same struct apart from the condition
I could use one condition var, but then I would wake threads that I don't want to wake, they'd have to test and wait again
I'm assuming the implementation is:
1) you grab and lock a mutext
2) you wait on it - it releases that mutex as it waits
3) it grabs the mutex back if it wakes you
4)when you release that mutex (on a notify all) the next notified thread wakes
I'm not sure I get it, but it seems like you always use the same mutex for all calls to the same condition var, both wait and notify
 
added bounty and w/e, still nothing on my codereview question
 
I remember doing this sort of thing using windows calls that wait on some kind of event..but no mutex was necessary for that
 
I can only conclude that one of the following is true
1) My code was so horrible all of the possible answerers ran away in fear for their life.
2) I write amazing Scheme.
I think it's 1)
 
7:14 AM
sigh, I wish my doc on condition var was more detailed
alex: 3) no one on the planet can read scheme, it's a write only language - powerful though
also very few people use it. - where
is your code
 
here it is
1
Q: Rosalind's 3rd problem in Scheme

Alex M.I have an imperative programming background and I've decided to study functional programming by applying it to problems found on sites such as Project Euler and Rosalind. My language of choice is Scheme (I use CHICKEN). As can be seen, I'm only starting out. This is about the 3rd problem found o...

I never had to read someone else's Scheme
I can read mine fine... because I wrote it days ago
I should get off this chair and go to work to sit on another chair
 
firefox locked up for a whole minute it seems
 
shit, now everything makes sense
not even browsers can display my Scheme
 
if you click on my icon, you'll see that I answered a question with scheme code once, but I wonder if anyone can use my answer 'cause they don't use scheme
naw, it's just that I right clicked the link which always locks up firefox
scheme is too easy to use to be called a functional language these days
when people say "functional language" they're thinking of some hard to use strongly typed thing without mutable variables or loops
if there's no whips and ball-gags it isn't functional
 
shrug
the way I was taught to do it was to start with a mathematical model of each function and then implement it
I chose Scheme because the only other languages I know of are Haskell and F#
I found Haskell's syntax to be difficult to get
and F# came with VS
 
7:23 AM
"begin" isn't necessary, let does multiple expressions
 
well post an answer, it's bad to leave questions unanswered
 
as for style, I guess it's fine. I tend to process whole files at once like that because it's simpler. I suppose if you want to save memory you could do it C style and read and write chars at a time
I haven't been using scheme long enough to have functions memorized, I always go back to racket's doc pages whenever I wonder what functions there are for io and everything else
 
yeah in this case read-line really read the file's contents because there was a single line in it
 
I like using map because it makes some problems so much simpler than looping by hand
 
I should change the code when I get back home and have the time to read it character by character and perform the actual char replacement on the spot
 
7:28 AM
but when I loop I use named lets
 
adding each replaced char to the start of the list would also get me the reversed list
 
the for loops are too funky in scheme
really strange
and recursion through named lets is really convenient
actually more flexible than loops in other languages
 
yup map was an obvious choice here
 
in the for loops you see a hint that scheme is an old language
like fortran
here's some scheme I wrote stackoverflow.com/questions/28256/…
 
Xeo
Mornin
 
7:31 AM
@JoshS was taking a look at that when you mentioned your answer before
 
hi
 
hiya
 
people who've never used scheme must just look at that code with only alpha chars and parens and their eyes cross and they can't make head or tail of it
Like I feel looking at Haskell, lol or even C++ templates even though I've written lots of those
 
I like how you can draw a tree with what gets executed and when in your answer there
or in any Scheme program that I've written so far I guess
main -> op-parse -> further ramifications -> ... -> return value
probably because
the whole program is f(input) = output
 
ha, it never occurred to me to even notice that I turn scheme into C by defining main and calling it >.> it's clear anyway
 
7:39 AM
call it entry point and name it appropriately
like, -><-
 
you can see a problem with scheme there, since you're not defining classes just functions, using common names like "start" pollutes the global symbol table
I avoid classes in Racket because the implementation is SO slow though
 
I'm fine with doing just maths and stuff with Scheme
don't feel like letting it take the place of C# in my work anytime soon
 
When I defined my own class system (a projected which bogged because metaprogramming in racket has lots of pitfalls) I found that my own version of things like new and call were an order of magnitude faster
 
I think gamedev would be painful in a functional language
 
I got pissed off at the problems and switched back to c++
 
Xeo
7:41 AM
@AlexM. Eh, why?
 
@Xeo because I can't think of anything I've done so far without it being all about state that changes when I tell it to
 
In it's current state, I can define classes and methods and use them from static source files, but I messed up so that you can't use these things from "eval" or add to classes at run-time which I wanted
 
I read some answers about this
 
I know how to rewrite it to fix that, but I didn't care to rewrite
 
Xeo
@AlexM. You need to rethink how the logic works
 
7:44 AM
how in a functional game you'd have to jump from snapshot to snapshot where each snapshot is a possible universe
but I'd be damned if that makes much sense to me
 
Xeo
it's a different mindset with FRP
 
I mean it does make sense but it feels too complicated
 
Anyway my current hobby is writing my own language
 
Xeo
also, I wrote a Tic Tac Toe in Haskell (without FRP) without problems, really
State + lenses are awesome
 
@Xeo that's a huge step though
 
7:46 AM
You're right, IMO.
 
the biggest thing I have written so far is an in memory assembler and a memory management system for the code
which would be the basis for a jit
 
Doing something inherently stateful in a FP language is more trouble than it's worth.
 
@AlexM. every programmer new to FP thinks like you
 
Unity should make an april's fools joke and say they drop support for C# and add support for Scheme instead
 
Just my two cents though.
 
7:46 AM
Unity has a javascript like language
 
Don't think it's ~impossible~ or too hard. I just wouldn't do it.
 
but they disabled eval not only on ios but also on android
never mind why I wanted that
 
@JoshS there's a 3rd party plugin which lets you exec JS defined at runtime
and even interact with the internals
 
they disabled eval because apple's license doesn't allow loading scripts at run time
 
it's a must have for anyone who wants to make their game modifiable by the user w/o much stress
 
7:48 AM
:/ but why do it for android?
by the way state is no problem in scheme
scheme is as much an imperative language as C
Racket has a typed extension so you could get the speedup of throwing away the runtime checks
 
Lisp was considered a functional language because it has first-class functions. But definition of function has become more strict over time.
 
It also has a lazy extension (that's probably REALLY inefficient) so you could play with haskell like laziness without the rest of the language
also an embedded prolog extension
 
this reminds me, nobody compiled SWI-Prolog for Android yet
the official tutorial says you should run Ubuntu on your phone and run Prolog in it wtf
 
And I wrote an embedded backtracking library that can do some weird superset of prolog and imperative programming with backtracking
you can do odd things like specify code that will only run if it backtracks through that point
 
7:54 AM
grats
I'm off to work, cya later
 
also weird logical like variables that are stateful but revert their state on backtracking
an amb...
stuff you can only do in a language that has continuations and metaprogramming macros
@AlexM.I'm packaging up my answers to go on your page
Oh I don't have a codereview account
they might not like my "I don't have too much to say" answer
I did my first answer on the programmer site the other day and got -3 for my trouble
lol
@sbi can you answer my question about condition_variable and mutexes from above?
since you're our c++faq!
 
sbi
I dunno, because I haven't looked at it.
 
55 mins ago, by Josh S
if I have two condition variables that never trigger at the same time, can I let them share a mutex?
hmm that doesn't get you the whole question
I was hoping it would be a link
oh it works, hit the "55 mins ago" part
 
sbi
Why would I do that?
 
to help?
i want to know how condition vars work and I wonder if the guess I posted is right
and I have an actual problem
I suppose I could use one variable instead of two, but then I'd be waking up threads just to make them sleep again for the right phase
 
Xeo
8:11 AM
Btw @Rapptz, I checked with some tools, and even if I went dual-GTX760, it seems like a 550W PSU would be enough
 
:v 550 W is a strange PSU
Didn't even know they sold 550 W PSUs.
 
Xeo
I'm seeing quite a lot of them
next up is 650
and then 750
 
maybe I misunderstood condition_variable, maybe every waiter has a DIFFERENT mutex
:/
someone in the chat said that the mutex was to protect the condition variable itself
grr why is the documentation so sparse?
 
sbi
I wouldn't presume to know whether you misunderstood condition variables. I am pretty sure, though, you misunderstood what this chat is for.
11 hours ago, by sbi
Waves hand towards @Josh This isn't the room you are looking for.
 
:/
what's chat for, guy?
 
8:15 AM
talking about random things
 
sbi
How about: chatting?
 
there's no law against being helpful
 
read the rules
they're in the sidebar -->
 
it just says "random claims are the best claims"
 
sbi
If you pose a question I am intrigued by, I might get interested and sometimes I even might spend some time on it. If you keep poking at me annoyingly, I might, surprisingly, get annoyed. Now get off and read the rules as linked from the sidebar, before I plonk you.
 
8:17 AM
how do you plonk?
 
sbi
I plonk cold, wet, and fishy. How do you?
 
Hello
 
go ahead and plonk me, it's not like you're helpful
 
@JoshS this chat is not about being helpful
the point you need to get
 
sbi
If you have a programming question you need answering, there's a site on the Internet which is dedicated to do just that. It requires you to think before you blurt out your confusion, and that's for a reason.
 
8:20 AM
who knew, I assumed a C++ room would have people who like to talk about C++
 
yes we like to talk about C++, but usually about more advanced stuff
 
so your answer to "the doc for the standard library isn't clear" is "read the code newbie?"
 
I'm so sorry.
 
Funny I've been programming c++ for 15 years
not advanced enough for your highness
 
yet you have a rep of 59
 
8:22 AM
so what?
 
it's not ~advanced~ stuff
it's just interesting stuff
 
Xeo
@JoshS We like talking about how C++ sucks. And talking about Haskell.
 
I am not part of that group
 
@Patrick Here's a hint: you can be a highrep user if you want to. It's simple, repfarm: instead of closing, downvoting bad questions you go and answer them. So being a highrep user doesn't really imply to have more knowledge than a low rep user. On that note, maybe I should stop giving bounties until I reach 10K :P — HamZa 2 days ago
 
8:23 AM
:v
 
Xeo
@Rapptz You just don't know yet.
 
Oh I know.
 
@Rapptz I facepalmed with both hands
 
Sorry about your face.
 
I meant @Xeo
 
Xeo
8:24 AM
Also, we need to keep up appearances, so shush.
 
@Xeo And moms.
 
Funny, I'm in the middle of writing a useful library that you might all have a need for some day
 
so I'll just go spend 2 hours reading the boost source cause no one want's to answer
jesus
 
"Now, if you lurk for a while, you might realize that we have no problem in answering questions asked by a regular. So what's going on? Well, we are a small community after all, and now it seems you have to earn your "right to ask" in the Lounge by becoming part of that community. If you don't have time for that, or don't care for that, then go on Stack Overflow instead. And please, for the love of all that is nice and fluffy, don't act like we owe you something. You'll get flamed to death."
@JoshS ^ from the law
 
8:26 AM
@JoshS Yes, my son?
 
@sehe what? did you want to look at my question here ? chat.stackoverflow.com/transcript/message/16401884#16401884
 
@HamZa lol, obviously you are not good at identifying trolling :p
 
@JoshS Are you trying to manipulate people into doing things for you?
 
oh god, never mind I'll find a more helpful group to hang out with
 
@JoshS thank you
 
8:28 AM
@JoshS why don't you answer more questions on SO (with 15y of experience)?
 
@JoshS the answer is yes, of course. You can even use a single mutex for all purposes. It will just increase contention. The good thing about single mutex is that you'll never run into deadlock (assuming you're not cheating with other blocking thread sync primitives)
 
RIP.
 
sbi
@JoshS Maybe we do. But that doesn't mean you have a guarantee that we are interested in your question. (Even assuming your questions were about C++, which they are not.)
 
@HamZa Because he's not obligated to. What... Are you now trying to reciprocate entitlement?
 
@sehe I'm not implying that he should. I'm just interested in his answer.
 
sbi
8:30 AM
@JoshS Than maybe, one day, we'll be interested in it. Right now, we're more interested in making you stop spoiling the room's mood because we're not falling over each other trying to serve you.
 
Xeo
He's already gone
 
I should say "thank you" more often :p
 
sbi
@Xeo He wasn't while I caught up with his message and typed my replies.
 
@Xeo btw, nice avatar. What's the source (name of manga/anime)?
 
sbi
@HamZa Manga/anime is of Japanese origin.
 
8:33 AM
@sbi nice try
 
he could have posted it as a question on SO, yet he came over and thought he's entitled to get the answer whenever he wanted it
 
Xeo
@HamZa It's Accelerator from A Certain Magical Index
Specifically from a picture in the Light Novel version
 
sbi
2 mins ago, by chmod 711 telkitty
I should say "thank you" more often :p
 
I see, thanks
@sbi thank you sir
 
@sbi umm ... thank you? :p
 
8:37 AM
@chmod711telkitty you're welcome
 
@Xeo he was not nice to the sisters
I didn't realize it was your avatar though.
 
Xeo
@StackedCrooked He was misunderstood, is all!
 
Xeo
He's pretty damn awesome in the LNs after the Sister Arc.
Especially with Last Order
@StackedCrooked It's kinda hard to tell, yeah.
 
user1804599
Good morning boys and girls.
 
8:44 AM
@Xeo I guess mine is slightly more obvious.
 
holy crap, I just opened a .docx file in LibreOffice and it doesn't look obviously mangled
 
you are a brave man
 
@jalf that's probably just rasterized image then
 
also, this must be some kind of punishment. I come back from vacation, and the first task I get is to update documentation :(
4
 
Xeo
haha
 
8:46 AM
@jalf Eww! Who did you piss off?
 
Your documentation is in a .docx? o.o
 
haha
 
user1804599
Word for documentation? What are you, Microsoft?
 
user1804599
C# language spec is written in Word. :facepalm:
 
As far as I experienced, .doc should work better than .docx as a crossplatform fileformat
 
8:52 AM
@JoshS I don't know how codereview works in that much detail
so I'm not sure how your answer would be received
okay, got my coffee, time to code stuff
 
user1804599
Coward hit and run ****ing downvoters. They are not even saying the reason!!!Praveen Kumar Feb 27 at 18:11
 
user1804599
lol
 
coward lol
 
hehe what do you expect with jQuery
 
@rightfold lol, 28k rep
 
8:58 AM
^ coward hit & run downvoter
hope I'm not the only one who played dota here
I remember there was at least someone else
 

« first day (1304 days earlier)      last day (3646 days later) »