« first day (965 days earlier)      last day (3986 days later) » 

8:01 AM
@MarkGarcia I fucking said it right there "Skinned bear feet" what the fuck did you think it was going to be? fucking marshmallows!
 
If you work in a slaughterhouse, that's definitely SFW
 
@thecoshman Someone might read it as "Bear skin feet" or something. Dyslexia. Yes.
 
@MarkGarcia dyslexics still read the words in the right order, but you are right, they could have read that as "kind bar feet"
 
Anyway, in here, do I need to loop and delete[] the sub-arrays or would delete[] on the whole array would just work.
 
Xeo
former, and don't do that
 
8:08 AM
From what I saw here, the whole array is delete[]ed, not "loop-deleted".
 
@MarkGarcia just use a 1D array
 
@MarkGarcia Spot the differences.
E.g. count the news, count the deletes.
 
it will give you a single contiguous block of memory, which will generally perform better. Plus it is easier to manage. Speaking of easy to manage, don't use raw arrays, this is C++ damn it
 
@thecoshman Yeah. But I'll use an std::vector or similar RAII containers. :)
@LucDanton ?
Oh.
Wait. Hm...
 
@MarkGarcia I don't think RAII is quite the right term there...
 
8:14 AM
You must loop through the array to delete the sub-arrays and not like this where you he only uses delete[], right?
 
@MarkGarcia auto arr = new int[12];
 
@MarkGarcia When?
 
@thecoshman @LucDanton Yes.
 
@MarkGarcia use a 1D array
hint: you can still access it like an ND array
 
@thecoshman I already know that. I'm just intrigued by this answer.
 
8:18 AM
@MarkGarcia what exactly intrigues you?
 
@MarkGarcia Each new must be matched by exactly one delete and vice versa.
Cardinal rule of acquire/release pairs.
 
@LucDanton and each new must be matched by at least one very good justification
 
hee hee
 
@LucDanton So new in that form does not do new[] on each subdimensions.
 
@MarkGarcia that auto is probably taking on int* btw, not the int** like you where manually doing
 
8:20 AM
@MarkGarcia Does it matter if it does?
I don't just mean 'each new must be matched [...]'; I mean 'each new must be matched [...]' and that's it. Rest doesn't matter.
 
that is why it is allocating the '2D' (really just a 1D) array with just one 'new' allowing just one 'delete' to free it up afterwards
 
@LucDanton Yes. And I'll consult the standard to clarify.
 
@MarkGarcia No it does not matter. Because in the program each new is matched.
I really can't be any more explicit...
 
@LucDanton I get that.
 
@MarkGarcia in that example, it is not allocating an int** but just a single int* thus it allocates all the rows*columns in one new[]
 
8:22 AM
@MarkGarcia If you truly do then you know the answer to your question, at least from the information available to you.
 
@thecoshman Hm. Right.
 
@thecoshman Are you aware that int** does not convert to int*?
 
Poor ponies.
 
@LucDanton I'll do further research. I'll be honest that I'm still messed up with multi-dimensional arrays. :)
 
@LucDanton no, I am saying that it is not allocating a first dimension, then for each element of that first dimension allocating a new array, it is just allocating a single 1D array
 
8:24 AM
$ c++filt -t PA4_i
int (*) [4]
 
@MarkGarcia hint: just allocate a 1D array
 
#include<stdio.h>
main()
{
int big,x=3,y=2,z=1,q=4;
big=(x>y?(x<z?20:10 && y>x?50:10) : (y>z?40:10 || x<q?30:10));
int c=20&&20;
printf("\nbig =%d\n%d\n",big,c);
}
anyone can explain me its output?
 
user142019
@KavishDwivedi There is no output.
 
user142019
The program is malformed.
 
@KavishDwivedi no, run your program yourself
 
8:25 AM
@KavishDwivedi Why?
 
user142019
A decent compiler will reject your program.
 
@thecoshman "I'm still messed up with multi-dimensional arrays. ". I've learned not to use features I don't fully understand.
@thecoshman And that means using 1D arrays. :)
 
@rightfold A decent developer will reject the program.
 
user142019
I'm going to print that program on paper and then burn it.
 
@rightfold Waste of paper - it's more valuable than the code.
 
user142019
8:27 AM
It's not about the paper.
 
user142019
It's about the burning.
 
Its giving output
10
1 on my gcc and this was actually asked in the written paper of MS .
 
@MarkGarcia it's simple, say you want a 5*5 array, allocate a single 25 long array, then access the cells in that, myAray[ row_number * columns_per_row + collumn_number ]
 
user142019
The burning is more valuable than the code and the paper combined.
 
@KavishDwivedi The only good answer is 'I would fire any developer who wrote code like this'.
 
8:31 AM
@MartinJames: I would do the same but I have to understand these if I have to clear the written.
 
@KavishDwivedi ..or maybe, following on from rightfold, 'Excuse me, may I have some scissors and a match?'.
@KavishDwivedi Well, if you sincerely want to unravel it, and cannot do it by examining the code, (and, lets face it, who would want to), edit it to split out all the compound statements into something readable and debuggable.
 
Ah. I understand now. So it is just one new. As what I've read from the standard, doing new int[3][4] creates 3 int*[4]s, so no recursion of news is happening unlike what I've previously thought.
@LucDanton And thanks for clearing me up with the news and deletes.
:)
 
new int[3][4] yields a pointer to the first element of an int[3][4] array.
 
@LucDanton Is it illegal in C++03/C++98?
 
No.
 
8:45 AM
Oh.
 
5
Q: How should I use quotation marks in sections of multiline dialogue?

Neil TroddenIf I want to introduce a “pause” between lines of dialogue from the same person by inserting a spacing line, how should I use the quotation marks correctly to indicate continued dialogue? I really don’t want to write it in a gossipy “he said, she said” way! I have noticed that closing quotations...

I did not know that!
It irritates me when I see unbalanced quotation marks.
 
@wilx Hehe. Me too!
 
9:07 AM
This is an outrage! I'm being accused by the system of being a bot just because I give correct answers!
 
@StackedCrooked For a moment I thought that was a smiley. :
 
)
don't freak me out!
 
Is there someone here playing Minecraft?
 
9:15 AM
@MarkGarcia See "Anonymous multidimensional arrays" here.
 
@FredOverflow +2 on you. :) Reading it now.
 
@MarkGarcia Fool the bot by occasionally giving deliberately rubbish answers. Even better, wait until you make an embarrassing mistake when answering - you can then avoid some downvotes by adding 'Hey I was just trying to fool the system bot detector'.
 
@StackedCrooked lol
Morning lads
 
@MartinJames lol. I'll do that when I'm not in the mood of answering.
 
Xeo
Holy crap. Setting your second monitor to portrait mode instead of landscape, while it's actually still in landscape makes for something pretty mindfucking
 
9:25 AM
@Xeo If you had four monitors, maybe you could make a 'closed display' with all the windows circulating in orbit around the centre :)
 
Xeo
Also, I somehow managed to make my taskbar "vanish". It's now just a small 2px high bar that shows and hides on mouse-over, but doesn't react to anything
Okay, resetting that option fixes it
@MartinJames Probably
 
@MartinJames I was thinking about buying a 3rd one and putting all 3 in portrait
it would be surprisingly panoramical: (10x3):16 = 30:16 = 15:8, which is more than 16:9
 
for(w.start(); !w.empty(); w.next()) {
    std::cout << w.front() << '\n';
}
 
is that java-style iterator?
 
I wrote a silly wrapper with non-static member functions that forwards to the ADL operations of the underlying range. I amuse myself :v
 
9:32 AM
:V is appropriate indeed
 
@BartekBanachewicz o_0 what's the lowest common factor for those...
 
Ell
Morning
 
hi @Ell
@thecoshman not sure, I just divided it
Also invariant centroid out vec3 color; WTF
GLSL keeps amazing me
Also humbly reminds me that my "knowledge" about GL is fucking lame.
 
9:48 AM
@BartekBanachewicz take a more biased sample, and you will find you have fucking amazing knowledge :P
 
@StackedCrooked +1.
 
user142019
Holy shit.
 
erm... isn't REST connectionless?
 
@thecoshman Indeed.
Each request involves open and close of a TCP connection.
 
user142019
10:01 AM
@StackedCrooked Not necessarily.
 
so what could this requirement mean "make up to and including 10 connections in parallel using REST"... maybe it just means that only 10 transactions can be processed at once...
 
user142019
@StackedCrooked HTTP 1.1 allows you to send multiple requests on the same connection after one another.
 
user142019
If you need parallel requests, you need multiple connections.
 
@thecoshman I think they mean 10 parallel requests.
 
so it's more that the REST server will only accept upto that 10 connection, the 11th will be rejected
 
10:03 AM
@rightfold yeah yeah
 
but once one of those 10 are finished, a new one can be made
 
@thecoshman REST is more about architecture philosophy rather than implementation IMHO
 
user142019
REST doesn't specify any limits related to connections.
 
user142019
A specific REST API may, though.
 
user142019
REST is just a general concept of using the correct HTTP methods and that's really it.
 
10:07 AM
right so
 
@rightfold it has no mention about HTTP either
main principles of REST are very general; HTTP was designed so that REST structure can be implemented using it
 
user142019
Oh right I was confused.
 
user142019
REST is about transferring and modifying resources each of which has a globally unique ID.
 
user142019
(In many cases an URL.)
 
user142019
10:13 AM
> The best general-purpose HTTP server that money can't buy.
 
user142019
He forgot about nginx. :>
 
"forgot" :)
 
@StackedCrooked Senior Principal Scientist o.O
that's like the highest engineering corporate position you can get
 
I'm senior principal scientist of stacked-crooked.com.
I guess it means more if it's adobe.
 
@rightfold you can by nginx?
 
user142019
10:19 AM
> can't buy
 
@rightfold bah, words
 
erm... I think some at work got the idea of REST wrong, we will use 'POST'
seemingly, only POST... the JSON will contain what action you want to do, such as delete or create
 
user142019
Use DELETE if you want to delete stuff.
 
user142019
For creation use POST.
 
user142019
10:26 AM
For replacing use PUT.
 
user142019
For modifying use PATCH.
 
yeah... but when you have constraints on how to something has to be implemented
what? they are proposing that if you want to see the result of any operation, you have to make a GET request with the transaction ID. not only does that defeat the stateless idea, but means extra donkey work. if something fails or not, for this sort of work, clients NEED to know, they can't just assume, so why not just respond to the request with the actual results anyway
 
@thecoshman that's lame as fuck
that's exactly NOT REST
 
user142019
This is neat. jsfiddle.net/2vWfk
 
@thecoshman using GET to get the result doesn't mean any state
 
10:37 AM
@BartekBanachewicz welcome to enterprise software design, where the words are buzz and ideas are bullshit
 
anyway I am not sure that sending anything after a POST request is mandatory
 
Ell
I don't know what REST is
 
Any recommendations for good Twitter libraries?
 
@BartekBanachewicz no, but it means you are now aware that there are transaction numbers, but the really problem is having to request this, it should be returned by default. Sure if there is a huge error log, perhaps return that action failed and 'request this if you want more info'. but you should not have to make a request, then make a second request to see if your first one worked or not
 
@Ell nothing wikipedia cant fix ;)
2
 
10:47 AM
19 hours ago, by R. Martinho Fernandes
@DeadMG But there's a 1500€ jackpot on the quizz and my team is really good!
We didn't win (No one did; more jackpot in two weeks)
 
@WTFlookatmypoints s/n /n yet/
 
Xeo
Seriously? The Name?
 
Xeo
> WTF look at my points
 
Oh. Just a silly joke.
user image
21
From here.
 
Xeo
10:52 AM
I know, but still
 
sbi
@WTFlookatmypoints What's that?
 
A pub quiz is a quiz held in a public house. These events are also called quiz nights or trivia nights and may be held in other settings. Pub quizzes may attract customers to a pub who are not found there on other days. The pub quiz is a modern example of a pub game. Though different pub quizzes can cover a range of formats and topics, they have many features in common. History Origins of the pub quiz are unclear but there is little evidence that they existed before 1970 in the United Kingdom. A 2009 study put the number of regular weekly pub quizzes in the UK at 22,445, and one web...
 
@WTFlookatmypoints By my recent activity my name should probably be Grammar Nazi.
 
sbi
@yiz You're a wussy faintheart.
@MartinJames Nope.
 
room topic changed to Lounge<C++>: WTF look at the robot's points [c++] [c++11] [c++-faq] [no-helpdesk]
room topic changed to Lounge<C++>: WTF look at the robot's imaginary internet points [c++] [c++11] [c++-faq] [no-helpdesk]
 
10:55 AM
s/t p/t dollar p/
 
sbi
@MartinJames The good news is, I'll get away. The bad news is, you'll now have to live up to your promise and get that beer. :) Have you guys got a venue yet, @WTF?
 
@WTFlookatmypoints internet dollar points?
 
sbi
@WTFlookatmypoints Where's that? What kind of quiz is it?
 
@sbi It's on Neukölln, bar called Sameheads.
What do you mean by "kind of quiz"?
 
pub quizzes tend to be general (read obscure and sports) knowledge
 
sbi
10:58 AM
@WTFlookatmypoints IIRC, there was a pub quiz at the ACCU conference where they asked C++(11/14) questions. I suppose yours is not one of those.
 
@sbi Ah no. It's general stuff.
 
I didn't go to any pubs with anyone at the Bristol meeting
 
sbi
That would have been starkly out of character anyway.
 
agree
 
user142019
I need a new Vim theme.
 
11:08 AM
@sbi This week there was a "flower round" (not necessary about the plant thingy; people and things named after flowers too), a "who am I? round" (given a short description identify a famous person), a "music round" (a song plays; identify the artist), a round with pictures of famous people that we had to tell the birth names of, and a general knowledge round. It varies from week to week, though.
 
sbi
@WTFlookatmypoints Is this in German?
 
No, in English.
 
Ell
Oh I go to a pub quiz every thursday
they are great fun. The prizes aren't big but you can win a free round of beers or £20
 
I did in my first year
and in my second year of uni until I got sick
 
sbi
There's this web page by a local newspaper where information snippets about the flood appear minutely as they trickle in, and it's soo addictive to constantly hit refresh on that, reading almost life as the horror progresses northwestward.
 
11:12 AM
@Ell This prize on this one is only big because no one has won the jackpot since January. It's not that big usually.
 
Ell
Ohh right
People usually win the jackpot by £60 over here
but usually it's won every time
I don't know if that sentence made sense o.O
 
@Ell In this one, the winning team has to pick between three envelopes. One has the prize money, and the others minor stuff like a bottle of wine, or a goat. Wait, not goats. Since it's up to luck, it's not uncommon for the prize money to not be won for a couple weeks.
 
Ell
Haha a goat :P
Speaking of goats, we had a goat in our school the other week
 
(The goat was a nod to the Monty Hall problem)
 
Xeo
Right, so "uniform initialization" isn't. — Mike Kinghan 7 mins ago
And another one disillusioned.
 
11:17 AM
disillusioned
 
31
Q: Does a computer use more electricity when charging USB devices?

arneheheSomething I've always wondered. If I constantly hook up cellphones, hard drives and the like via USB to my computer, will it eat up more on the electricity bill? Or are the USB ports using up electricity by just being enabled anyway, thus not affecting the power usage?

 
Xeo
whatever, I always mix those up
 
Speaking of delusions.
 
user142019
I like this theme.
 
Ell
@WTFlookatmypoints Oh yes of course
Woah.
I just noticed your nick xD
 
one of these days, I'd like to get around to working on my own parser generator.
 
Ell
ugh the minecraft modding api is horrible :'(
 
@Ell it's in java; what would you expect?
 
Ell
I knoow
I want to write a JRuby wrapper now
 
Ell
11:29 AM
But that wont help much
 
you should stop playing with Ruby
 
Ell
the design is bad
Haha why? I <3 ruby
 
ruby is bad too
 
Ell
why?
 
user142019
Ruby is good.
 
11:29 AM
it's just tiny bit better than perl
which is still kinda awful
 
user142019
Perl is good too.
 
Ell
I don't know anything about perl so that doesn't really help me :L
 
user142019
I like Perl.
 
Perl is absurdingly bad
Ruby is just damn bad.
 
Ell
Why?
What is wrong with it?
 
11:31 AM
what's not wrong with it?
 
Cue "everything"
Dammit.
 
Ell
@BartekBanachewicz it is succint
It is easy to write
easy to read
has kewl metaprogramming things
 
both are subjective
 
Ell
It's multiparadigm
 
I find ruby code terrible to read and I can't write in it
@Ell that's wrong
 
Ell
11:32 AM
No it's not
Why isn't it multiparadigm?
 
no, I mean being multiparadigm is wrong
 
Ell
Why?
 
Because it tries to do everything, and as things that try to be good at everything, it sucks at everything
And the icing on the cake is how fucking slow it is
 
@Ell What does it have, btw?
 
Ell
@R.MartinhoFernandes like iterating over classes, iterating over methods
modifying methods at runtime
 
11:37 AM
@Ell show me a dynamic language that doesn't have it
 
Ell
@BartekBanachewicz You can't use "it sucks at everything" as a point against it
@BartekBanachewicz It's still a feature
 
@Ell which each and every language has. What's unique about ruby?
Give me the money shot.
 
Ell
extensive standard library :P
 
better than python, huh?
 
Ell
I haven't really seen python's standard library :P
 
11:40 AM
well excuse me then but have you seen any other language then?
 
user142019
@Ell Well, it's ginormous. docs.python.org/3.3/library
 
maybe it's time you dumped ruby and compared it with something that is, for a change, usable
 
Ell
I find ruby perfectly fits my needs
 
have you tried anything else?
 
Ell
I've started using python with django
 
11:41 AM
@Ell that's extremely lame BTW
 
Ell
I use c++
I'm using java
@BartekBanachewicz I don't understand why ruby sucks. What does python have over ruby?
 
@Ell I see
@Ell what does ruby have over python?
 
Ell
You have pointed out ruby has no "unique feature", but a unique feature doesn't make it a good feature
 
Ell
I prefer the way ruby looks :P
 
user142019
11:43 AM
Ruby's syntax is nice.
 
Ell
I haven't used python enough to compare with personal experience
 
@Ell speed, community, better libraries, better interoperability with other languages
and oh, it's installed by default on most systems
while Ruby is still a niche product
 
user142019
It's not.
 
user142019
Most systems run Windows.
 
11:43 AM
WAAAAAAAAAAAAAAAAAAAAAAAAAAAT
FUDOVERFLOW
 
user142019
And Windows doesn't include Python.
 
Most *ix distributions do, though
 
Ruby ships with MacOSX
 
@R.MartinhoFernandes lol rly?
 
11:44 AM
@BartekBanachewicz That's DeadMGing right there.
 
Ell
@BartekBanachewicz okay, you can compare python to ruby and say python is better for your needs, but I don't see how that makes ruby suck
 
that's new for me.
 
@BartekBanachewicz Yes, it does.
 
user142019
Python, Ruby, Perl and PHP all come with OS X.
 
47 secs ago, by R. Martinho Fernandes
FUDOVERFLOW
 
11:45 AM
@Ell I am going to take a long shot and dare you to show me anything ruby can do that Lua can't do better
 
user142019
> Lua
 
because I am not that versed in Python
well we have to separate things
 
Ell
meh. Hmm. I'll try to think of something :L
 
if we look at libraries (we need them) python is obviously better
 
Ell
Give me a sec to write something up
 
11:45 AM
@BartekBanachewicz You can redefine the length of strings.
 
when it comes to embeddable, raw language part, Lua will win hands on.
@R.MartinhoFernandes can you illustrate it somehow?
 
@BartekBanachewicz lol no
 
@Abyx arguments or GTFO.
 
Ell
@BartekBanachewicz tbh I haven't got anything to write :L
 
@BartekBanachewicz yep. passing arguments via stack.
 
Ell
11:47 AM
The only thing that comes to mind instantly is it's not as easy to write classes in Lua
 
@Abyx via which stack? C interface?
 
@BartekBanachewicz C interface.
 
@Ell define not easy. Lua has no "class" concept in language, you create it similarly to features in Haskell
@Abyx that's not exactly Lua itself, innit?
 
or just make a table with some shit in it.
 
@BartekBanachewicz but it has "methods"
 
11:48 AM
@Abyx no, it doesn't. It has functions.
 
Ell
class Something
    def initialize
    end
end
 
@Ell and that perfectly illustrates nothing.
 
Something = function() return {} end
 
@BartekBanachewicz obj:method()
 
@BartekBanachewicz You can write code that makes ("aa" + "aa").length 5 (proving an equation from a famous novel true). AFAIK Lua's string length function is hardcoded.
 
Ell
11:49 AM
then add inheritance and virtual methods
@BartekBanachewicz well I don't know what to say, I'm not a language expert :L
all I want to see is evidence that ruby sucks
 
@R.MartinhoFernandes Yeah.
 
@Abyx that's a function residing in a table f["x"] in key "method", called as method(f["x"])
 
Ell
I'm not here to prove anything because I'm a n00b at everything
I just want to know why ruby sucks because I don't see it
 
@Ell which you can do perfectly the same in Lua, + more if you need it.
@Ell maybe you should watch the Wat video.
 
@BartekBanachewicz But you claimed it could do it better, not just the same.
@BartekBanachewicz That's your argument?
 
11:51 AM
@R.MartinhoFernandes waaat
 
@BartekBanachewicz "tables can also carry methods (see §3.4.10). " rtfm
 
@Abyx Er, yeah, I think that we all know how Lua's OO calling thing works.
 
@BartekBanachewicz You can do more in Ruby as well. No one cares. Can Lua do the non-more part better?
 
11:52 AM
isn't Ruby full of horrific Perlisms, magic variables, and shit like that?
 
@DeadMG well it seems that Bartek doesn't
 
@Abyx that's still a function, only called for the sake of explanation a "method" :/
 
oh yeah
 
and seriously and if you don't understand how this works you shouldn't try to educate me
 
@DeadMG While I admit to regularly mentioning that, they are all optional and all have alternative names and alternative sane usages. Think of them as bait to draw Perl users in.
 
11:53 AM
ah, I see
 
@R.MartinhoFernandes I am not sure. It certainly will do it faster with less memory, but that's not the part of the language per se.
 
so the bug I was working on last week that I couldn't fix traced back to an overflow of a 32bit integer, among other things.
 
Xeo
So you finally fixed it?
 
No, my coworker took it over a week ago, and is not quite done with it
it was far more complex than it looked
 
Xeo
I see
 
11:56 AM
not knowing the entire system, I stood no chance of fixing that
 
Ooh, that reminds me.
Can Lua do pow(2,60) better than Ruby?
 
how could you get pow(2, 60) wrong?
 
(Hint: doubles can only get integers right up to 53 bits)
 
then I doubt it
 
@DeadMG Aren't all Lua numbers doubles? Or am I outdated?
 
11:57 AM
I guess it's an overflow then
 
Lua's numbers are all doubles unless you change it to be an AP type yourself
 
Ell
@BartekBanachewicz how do you call a lua function stored in a table?
 
Btw, I'm the new moderator for the C++ Lounge wiki
 
@BartekBanachewicz It's not an overflow. It's just an approximation instead.
 
@Ell a["name"](params) or a.name(params)
 
11:57 AM
@R.MartinhoFernandes They are, but I don't know the range of doubles giving precise integers, so.
 
@R.MartinhoFernandes right. Ruby has infinite integers built-in?
 
python does too, IIRC
 
@BartekBanachewicz 64-bit integers are enough for 2^60, though.
 
@R.MartinhoFernandes I see your point. You would need Terra to use that
it has int64 IIRC
 
Xeo
11:59 AM
Is Terra your second wife, next to Lua now?
 

« first day (965 days earlier)      last day (3986 days later) »