« first day (1439 days earlier)      last day (3506 days later) » 

12:00 PM
Lua struck me as a language treating all values equally
it was really weird after coming from C++
and somehow I had a feeling "that's how it's supposed to be in the first place"
 
Ell
@BartekBanachewicz what do you mean?
 
I don't think Lua is as good as I praised it 2 years ago
 
user1804599
@BartekBanachewicz Are you sure about that? error treats non-tables differently by making them into strings.
 
user1646075
@BartekBanachewicz it's irresponsible to design a language that makes you HAVE to build on them. See also Perl OO, Javascript OO, ......
 
@Ell You have a value or a table. A table is a collection of key-value, where key is a value. A table is also a value.
there, Lua.
@aclarke I am not very interested in OOP.
 
user1646075
12:02 PM
@BartekBanachewicz clearly, but the point is.....
 
Ell
You can do that in c++ just fine though, right?
 
I never was frankly.
 
What do you guys think of banning Haskell talk in this room unless you have at least a decade of experience with it.
6
 
Ell
but you lose all of the typing goodness
 
@Ell not really.
C++ has much more friction
 
12:03 PM
(I completed one decade since I started learning Haskell around last week :P)
 
Let's ban all programming talk
 
it's not worse per se...
 
Ell
@BartekBanachewicz Okay fair. You can do it in most dynamic languages though
Python and err... ruby :P
 
@Ell yes, but they introduce way too many concepts that I have to learn about (not a problem) and then remember (actuall becomes one)
Lua is... not surprising, mostly.
 
Ell
To me lua is just too minimalistic
 
user1804599
12:04 PM
To me Lua is a good target language. :P
 
user1646075
@R.MartinhoFernandes but you'll be responsible, right?
 
@BartekBanachewicz TIL the universe is "very similar" to Haskell and Lua
 
Ell
I need a stronger type system, I can't deal with tables and values. I know you're supposed to implement it yourself, but I think that's just a bad design choice personally
 
@Ell Rubby's type system isn't really much better than what Lua has
 
@aclarke You don't have to do OO in JS.
 
user1646075
12:05 PM
@LightnessRacesinOrbit but yet it's de rigeur
 
user1804599
The flexibility is very useful.
 
@Ell Rubby doesn't give you any hints either. It claims it has all paradigms ever invented, so you theoretically as free to do anything as in Lua
slapping one predefined class system on such a language is a waste.
And again, I don't really care about javalike OOP that much.
 
Ell
@BartekBanachewicz you can at least query the type of something
 
@Ell which you shouldn't be doing in a well-designed code in the first place
 
user1804599
Wait for Styx. :F
 
user1646075
12:06 PM
@BartekBanachewicz prototyping. Annoying
 
regardless of whether it's dynamically or statically typed
 
Ell
@BartekBanachewicz Right, but it's useful for debugging
and you kind of do in statically typed
 
@Ell what?
 
Ell
with overloads. I know it's not querying but it's requesting a specific type
 
No, it's ad-hoc polymorphism (see I'm learning things)
 
user1646075
12:08 PM
@rightfold They're TOURING again????
 
user1804599
Ad-hominem polymorphism.
 
@Ell which happens at compile time, not at runtime
 
Ell
@BartekBanachewicz right
 
what you wanted was RTTI.
 
Or not.
What you wanted him to want was RTTI.
 
Ell
12:09 PM
@BartekBanachewicz Well no, what I want is to know what type I'm dealing with
 
@Ell what is the difference?
 
Ell
@BartekBanachewicz I don't need RTTI to do that in statically typed languages
 
well and you need it in dynamically typed ones
IDGI
 
user1804599
12:10 PM
Remove types and all your type-related problems are gone (except for the problem of lack of types).
 
I wish I had the patience to try out Smalltalk
 
@CatPlusPlus didn't like it at all. Ecosystem is bad, IDEs are bad, the idea of running system is bad, the language is meh at most.
 
user1646075
@rightfold I'm fed up with NOT having a compiler tell me all those stupid little issues. Be careful what you wish for.
 
IDEs are always bad
 
there are funnier message-based languages nowadays
 
12:11 PM
@CatPlusPlus I think learning FORTRAN could be good for the money :P
 
user1804599
IDEs are not always bad.
 
I like the introspection you can do
 
@CatPlusPlus except you can't really write smalltalk outside of Pharo or someshit like that
 
user1804599
@BartekBanachewicz Erlang!
 
And this idea works so terribly in practice
 
user1804599
12:12 PM
Images ftw.
 
@BartekBanachewicz You can but that's w/e
I don't write C# outside of VS and VS is a horrible text editor
 
@BartekBanachewicz JavaScript has types Boolean, Null, Undefined, Number, String, Symbol, and Object. Done. That's his point.
 
@CatPlusPlus yeah that's the "can't" I meant
 
It's still wrong :v
 
Ell
@BartekBanachewicz Right. But lua doesn't give me it by default. It's difficult to understand type errors when everything is a table
 
12:13 PM
w/e
 
Ell
okay with primitives it's a little different
 
@Ell It'd difficult to diagnose type errors in a dynamically typed language in general :v
 
Not really
 
user1804599
@R.MartinhoFernandes Gotta love typeof null === 'object' :D
 
12:13 PM
@BartekBanachewicz Yeah, no.
 
oh do tell
why are we using static type analysis in the first place then?
 
I shouldn't need to, because apparently you know a lot about Ruby.
 
> a well-designed code
 
user1804599
Because it is useful to fail early.
 
Ell
@R.MartinhoFernandes can't find this on loungecpp.net/w/Commonly_used_acronyms ...
 
12:14 PM
Ruby is strongly typed.
 
Ell
oops.
 
Ruby is strongly hyped.
 
@Ell Table-oriented programming.
 
Ell
Ohh
 
Ell
12:15 PM
Termination of Pregnancy
 
user1804599
You can fail at compile-time with static typing, at runtime with dynamic typing, not at all with Perl or only sometimes depending on php.ini in PHP.
 
Another way of seeing it is that Lua and JavaScript have no user-defined types.
 
"Tacky Optimizing Puppy (Linux)" LOL
 
@R.MartinhoFernandes ┬──┬◡ノ(° -°ï¾‰)
 
I've noticed Puppy is barely here since he got employed. On the surface of it, that makes sense; then again, we're all here and we were always employed.
 
12:17 PM
@R.MartinhoFernandes yep
 
@LightnessRacesinOrbit Give him a month or two to get used to it
 
@BartekBanachewicz Well, that was Ell's point.
 
@R.MartinhoFernandes I just got it.
 
@LightnessRacesinOrbit Young Nasty Git Association
@R.MartinhoFernandes well, we would have to apply that logic to all things really, and that means no talking at all...
 
@LightnessRacesinOrbit I chat here at work
it says C++ in the corner so it looks ontopic to anyone who sees it
then again, there are people here who play Diablo 3 and LoL
so I'm not sure anyone gives a fuck about my browsing
 
12:19 PM
@AlexM. It rarely says C++ in the corner, plus I hide the room info :(
@AlexM. lolwut
ran out of goats to program?
@CatPlusPlus spose
@thecoshman You Never Get Anything
 
I guess Diablo 3 running in a window is not that bad for them
one of the guys doing it isn't a programmer
 
@LightnessRacesinOrbit I get myself all the time
 
I think he's some sort of manager thingy
no idea
 
@AlexM. oh, triple dildo
 
you know
I think I should also quit lounge for a while
3
 
12:21 PM
@thecoshman wut?
 
I'm spending too much time on trying to explain things badly to people and too little on actually learning new things .
 
@BartekBanachewicz Why?
@BartekBanachewicz Learn old things before you learn new things
 
And making me defend Ruby, FFS
 
Ell
@BartekBanachewicz why don't you just stop trying to explain things?
 
I've gotten to the point where I really need to study on my own a bit
 
user1804599
12:22 PM
@BartekBanachewicz I think that too.
 
Read Pierce finally
Yep.
 
user1804599
IME it's impossible.
 
Well then. A month should be ample.
 
user1804599
Nope. Impossible.
 
user1804599
Give up already.
 
12:22 PM
See you in a month. Love you all :3
 
user1804599
See you in an hour.
 
hey, let's help him out :P
 
Ell
@BartekBanachewicz bye
 
@thecoshman heh
@BartekBanachewicz Bye bitch
not quite sure what just happened
that was like the calmest ragequit I've ever seen
 
@BartekBanachewicz Take care, dude. Try not to get worked up over anything.
 
12:26 PM
@R.MartinhoFernandes fat chance :P
 
Why do people keep suggesting regexes for simple parsing things?
 
@rubenvb Cos they're misinformed?
 
user1804599
Because regexes are useful.
 
@rubenvb regex ALL the things!
 
Why do people keep breathing
 
12:26 PM
Because they're not suitable for parsing complex things!
 
I would match string with regex and then use std::atoi on the result. — Lukasz Daniluk 10 mins ago
 
Ell
@rubenvb they are quick and easy
 
Simple C++ is also quick and easy.
 
user1804599
@rubenvb perfectly fine use case for a regex.
 
@rubenvb I was going to write "I would fire you" in response, but in that case regex is perfectly appropriate..
 
user1804599
12:27 PM
The condition in your answer is very readable approach, yes.
 
@LightnessRacesinOrbit lol.
@rightfold ha, well, I didn't really read the question decently, I'll have to modify that
 
user1804599
Or you could use obj_(\d+) regex and be done with it.
 
user1804599
Works, concise and shows intent clearly.
 
12:29 PM
You wrote if(test.length() == 6 && test[0] == 'o' && test[1] == 'b' && test[2] == 'j' && test[3] == '_') and complain about people using a textbook regex for that same task?
 
dammit coliru is preventing me from quickly fixing my answer
 
kik
@rubenvb It's really not.
 
user1646075
@R.MartinhoFernandes zing! this isn't a "big" parse - who said that? why not regex...
 
At first I thought your example would involve backreferences and zero-width assertions and all sorts of stuff, but character classes and Kleene stars?
 
lol
 
user1646075
12:32 PM
hmmmm - how to encourage use of sscanf .... /thinks
 
Ell
Kleene Starâ„¢ - your worktop shiny and clean in no time!
 
@rubenvb That's quite the honeypot.
 
user1646075
hah - that printf question on SO is a gift that keeps on giving. I just got poked in the eye for providing, apparently, a gcc solution that somehow doesn't apply.
 
@aclarke link?
 
12:38 PM
Is some_string.find_first_of("0", std::string::npos); allowed?
 
user1646075
wow - i also got a tick of approval. 10k here I come!
 
user1646075
-3
Q: "printf" function outputs wrong values

Alex NiuI have this weird problem in CodeWarrior Development Studio: float adc_vout = 1.0; printf("%7.6f", adc_vout); Then I got this: 1.875000. Even when I was debugging it and put the mouser on the variable "adc_vout", the system displays the right value (1.0) Thanks for any help. Alex

 
anyone remember the command in linux/unix to run a process in an isolated directory
 
user1646075
chroot?
 
Are you talking about chroot?
 
12:39 PM
yeah chroot
Is it safe?
 
user1804599
std::system(("echo " + input + " | sed 's/[^\\d]//'").c_str()); done :D
 
I mean, even a chrooted process could access non chrooted processes using IPC?
 
@R.MartinhoFernandes would say yes (21.4.7.4)
and it would return std::string::npos.
 
user1646075
@LoïcFaure-Lacroix ummmmmmmmmmmmmmmmmmmmm
 
user1646075
sure - probably. RTFM on the full powers of chroot syscall
 
user1646075
ok - only changes the interpretation of any path starting with / - the end.
 
user1646075
even pwd can be out of the tree, and there's a known escape.
 
if it's out of the tree it shouldn't be possible to call it.
 
user1646075
@LoïcFaure-Lacroix the thing is, if the chrooted process is 'above' the new root, then any non-rooted path such as "../../etc/passwd" is accesisble.
 
@R.MartinhoFernandes I am chroot
 
12:44 PM
lol
 
user1646075
so a smart process would chdir to under the new root at the very least.
 
seriously... so it still reads filesystem as such so using ../../ it will check parent inodes on extfs
 
@aclarke Er, what?
 
user1646075
no - ../../ is interpreted based on the inode of the current workign directory. It just start from "." and follows the nodes. Thus, if a chrooted process happens to be above teh root, a hole exists.
 
user1646075
12:48 PM
@R.MartinhoFernandes clearly stated in "man 2 chroot"
 
user1646075
can I get a witness?
 
    query_string = query['query']['filtered']['query']['query_string']['query']
 
Only root can escape (which is not surprising at all and totally expected).
 
Amazing
 
user1646075
@R.MartinhoFernandes every process on a *nix O/S has, in it's process slot entry, a reference to the inode of the current directory. Also to it's "root" i guess...
 
user1646075
12:49 PM
and then...
 
@R.MartinhoFernandes There are ways for non-root to escape too
 
user1646075
if my cwd is "/a/b" and the process does chroot("/d/e/f") then....
 
grsec has a whole set of patches for chroots
 
@CatPlusPlus Well, modulo bugs. Root escaping is by design and as simple as cd ...
 
user1646075
if the process says open("/thing") it will open "/d/e/f/thing"
 
12:50 PM
@R.MartinhoFernandes Dunno if they qualify as bugs. Crappy design maybe
 
user1646075
if the process says open("../../etc/passwd") it will open "/a/b/../../etc/passwd" BECAUSE it starts from the recorded inode of PWD
 
@aclarke No, it won't.
It will fail because there's nothing above the root.
 
@aclarke according to wikipedia only the user root should be allowed
 
user1646075
"This call does not change the current working directory, so that after the call '.' can be outside the tree rooted at '/'"
 
user1646075
the "in particular" about root is how a root process can escape.
 
12:51 PM
@aclarke That's not the same at all.
If you start outside the jail...
 
Not that stealing passwd has any use
 
You're outside the jail already.
 
chroot is tricky to get right is the problem
 
user1646075
@R.MartinhoFernandes EXACTLY!
 
Also it's a crappy isolation anyway
Use LXC or VMs
 
user1646075
12:52 PM
behaviour would be non-intuitive
 
@aclarke Exactly what?
 
Filesystem is just one namespace to isolate
 
I don't see how you go from "obvious tautology" to "you can just cd .. your way out of it"
 
user1646075
@R.MartinhoFernandes you're outside of the jail already. The man page is giving a round-about warning, really
 
@aclarke Yes, and it's totally unlike the scenario you tried to describe.
 
user1646075
12:53 PM
umm, no
 
I can't even make an H2G2 reference because it's not "almost but not quite", it's just "not at all".
 
user1646075
"This call changes an ingredient in the pathname resolution process and does nothing else."
 
user1646075
specifically, affects only when opening "/stuff"
 
And you're assuming that change is something it's not.
@aclarke Says who?
 
user1646075
my interpretation. what's yours?
 
12:54 PM
What in that sentence makes you think that's the correct interpretation?
 
IIRC chroot was never meant to be a security thing, it was, more or less, a way of testing shit.
 
It mentions nothing about it.
 
it was designed for testing kernals and the likes wasn't it?
 
user1646075
"changes the root directory of the calling process to that specified in path. This directory will be used for pathnames beginning with /" + "This call changes an ingredient in the pathname resolution process and does nothing else."
 
@Deduplicator: Electric chainsaws which are not plugged in are still sharp and heavy, which makes them quite dangerous (and still difficult to juggle). — rubenvb 20 secs ago
 
user1646075
12:56 PM
someone could test - someone like Loïc Faure-Lacroix
 
@thecoshman I ever only used it to compile gentoo from a fedora live cd
 
user1646075
@thecoshman probably. I recall people used it for lightweight jailing.
 
@aclarke Yes, "changes the root directory"
There's nothing above the root.
 
user1646075
where lightweight means something like naiive
 
You can't cd .. past the root.
 
12:58 PM
@aclarke but that was not what it was designed for, it just happened to be handy for that too.
 
The following sentence does not invalidate that.
 
user1646075
@thecoshman maybe - i never learned the rationale
 
chroot would be pretty shitty if a rooted process could just call /.. and be accessing the outer world.
 
LXC is geared for more secure isolation
 
@aclarke the rationale for what?
 
user1646075
12:59 PM
things like uucp used to use it I think - on some versions
 
There's little reason to use chroot
 

« first day (1439 days earlier)      last day (3506 days later) »