« first day (636 days earlier)      last day (4314 days later) » 

10:02 AM
I'll use std::set<of iterators> and knowing how much is n, I will iterate throgh every sub-vector and add elements to this set until it's size is equal to N or that vector is exhausted. then I'll move to the next vector. and I will keep on pushing one element into the set and removing the last element, until the removed element (the smallest) is the same one that was just inserted.
in that case I will move on to the next vector.
This should work and I think that it's quite elegant ;)
 
I'm not sure if it's more efficient (insertion on a set is not free), but try it out.
Also, I assume your input has no duplicates.
 
insertions on a set are logn
 
Heh I recently implemented merge sort in Python for algo-class (coursera).
 
@KarimA Yeah. So you get worst case O(NM log N) (in the worst case you'll insert N elements from each of the M vectors) versus worst case O(NM). That's why I said you should try it.
 
Why Java why.
 
10:10 AM
What you doing?
 
I have an Android app to rate code-wise and modify.
This is a codebase that have things like foo == CONST ? true : false.
 
Rating: "It sucks."
Modification: "It's beyond salvaging."
Done.
 
And catch (Exception) all over the place.
 
@CatPlusPlus Who wrote it?
 
And catch (NullPointerException) in some places.
 
10:11 AM
@CatPlusPlus hehe. Checked exception FTW.
@CatPlusPlus Fuck. Ouch.
 
@RMartinhoFernandes I've just googled your suggestion: stackoverflow.com/questions/5055909/algorithm-for-n-way-merge
 
And catch (ExceptionA) { code } catch (ExceptionB) { the same code as above } catch (Exception) { the same code as above }.
 
It is essentially the same algorithm that I described if you want to have n-way merge
 
@RMartinhoFernandes An idiot.
It was outsourced several times before reaching us, I think. The history of this project is as colourful as this codebase.
 
@CatPlusPlus Java7 has multi-catch or whatnot to deal with that now. Not like it justifies the duplication.
 
10:14 AM
It's Android project, so I can't even use Java 7.
 
@KarimA Cool.
 
2
A: strange behavior: ( 0 == "string") is true, switch (0) gives the first case 'case: "a": '

refpToo Long; Didn't Read To sum this up in this rather long post; an implicit conversion from one type to another takes place, if you don't want this to happen use the more strict === or an explicit cast. Examples including both can be found further down in this post.. Will the world will end, ...

 
yeah! isn't it? :D
 
when I'm bored I try to type as fast as possible, answering questions I don't really care about with a shitload of information
 
@refp You're answering PHP questions?
Traitor.
 
10:16 AM
just curious, how it looks like to dev on android with c++ ? did it in java already
 
@RMartinhoFernandes I answer all questions when I'm on a hunt for rep, currently I need accepted answers (and tag-votes for badges)
 
@refp This is why PHP should trigger a fluctuation in the space-time continuum and vanish from existence.
People think they can do this sort of thing and that inevitably leads to trouble
 
@Fred Even more painful.
 
hahaha c++ is natively painful :D but I prefer it to objective-c (iOS)
 
@refp Precisely my strategy :)
 
10:19 AM
@Fred No, C++ it's not natively painful.
NDK development is painful.
Also, good luck with the crappy docs.
It's like Google made it painful on purpose so people wouldn't even bother.
 
@RMartinhoFernandes lol
 
@RMartinhoFernandes lol it must have some serious compatibility issues unless you really know what is safe to use
 
+1 I think, reading form the OP, this is most likely what he was after. Essentially: he wants something not-vim. Or, at least, less-vim. — sehe 11 secs ago
"How do I start vim in insert mode". Someone is not getting vim.
 
seems like java is fitting android's philosophy, I was surprised to know about c++ being supported
 
If you want to start vim in insert mode, you want to use some other editor.
@lwburk I have habit of using GUI based editors.. and currently I use down-arrow to navigate. — Santosh 2 mins ago
I'll never get this.
GUI-based text editors.
 
10:25 AM
ohai
 
Oxymoron much?
 
@RMartinhoFernandes No?
A text editor can very much be CLI.
 
ed!
 
@Cicada Are you deliberately trying to confuse me?
 
potato
 
10:32 AM
My plan is foiled.
 
@Cicada oooh, keep trying and soon you might be able to count to carrot
@RMartinhoFernandes steel your self man
I'm having alloy of fun with metal puns
they are comedic gold
 
... only 2 so far
 
@thecoshman "steal" is not a metal, btw.
 
though, you have to be careful how you treat them, hammerite
please say I fixed it in the nickel of time
 
Dammit, should have waited some more.
 
10:35 AM
you have to have mercury on me
 
That's poisonous, you know.
Not merciful at all.
 
git out
 
I have to get tin some how
 
@Cicada ed, sed -i?
 
10:40 AM
I fear I might be a bit depleted, should go for some enrichment soon
 
Please make clear whether you will always have 3 letters and 4 digits, and if the letters will always be "ABC" or "abc". — Sloede 1 min ago
 
I'm sure you'll iron things out.
This room is like a bad pun magnet.
Ready for meltdown
 
And the OP edits question to add "I always have 4 words before number."
 
Have a downvote :)
 
I don't want to Lithium this planet any more
 
10:42 AM
We don't make you :)
 
You're pushing it.
Also, lithium doesn't exist. Authoritative reference: dwarffortresswiki.org/…
 
reality check
 
hay, I coppered onto that one, dwarf fortress indeed
 
This room is not conducive to reality on Fridays.
We need to regalvanize over the weekend.
Sunday, cathodic mass for all of you!
Perhaps we need to relabel the newbie-hints "code of conduct".
 
Sounds like a good plan.
 
10:46 AM
Do default arguments in C++ use a constructor if available, or always the assignment operator?
 
Never the assignment operator.
The fact that the = symbol is used is irrelevant.
 
Just as I thought then! So it's valid code to have, for example Func(std::shared_ptr<Foo> =nullptr)?
 
catch (OutOfMemoryError err)
 
Haha. Best.
 
10:48 AM
;_;
 
I think my production of metal related puns might be caesium-ed
 
If you are new here, please read the code of conduct. Thank you.
32
 
What is this.
 
Oh my. I don't corrode it.
 
A takeover.
 
10:49 AM
Super conduction
 
hay man, have you just outed me? heavy man (ok, I really am struggling with these now)
 
Never fear, I am galvanised against your mean ways
 
@thecoshman Secret of the smith
@thecoshman Just go far aday!
 
problem is, I have lead my self down a path I can't return from :(
 
10:53 AM
My first instinct was to reply "led".
 
@RMartinhoFernandes you must be a bit rusty when it comes to puns :D
 
Are anonymous unions standard C++?
 
@FredOverflow Y
 
@thecoshman Yeah. I'm not enjoying most of your puns.
 
10:55 AM
@RMartinhoFernandes Since C++11 or always?
 
Since C++11.
 
Oh crap, anonymous unions don't seem to work well with uniform initialization :(
 
@thecoshman I am not enjoying your punderstorm, I might add.
(Yes, I am fighting back with TVTropes links).
 
message before going for lunch: I don’t get HN. Like, at all.
for instance, how am I supposed to reach the search box?
as soon as I reach the bottom of the page, more news article are loaded, hiding the search box and the navigation links immediately above it
 
I might just silver away for lunch, like a hungry snake
 
11:00 AM
I am not ashamed of resorting to such low tactics.
 
wow. good. I am using digital mars C/C++ compiler. İ will check it out — tuğrul büyükışık 1 min ago
not quite the reply I was expecting to my mostly for fun answer
 
hi
Im planning to deploy a Windows Desktop Application
 
I am out
 
I have Tested it,But i don't know if the testing is enough
This is the First Version of the app
 
11:04 AM
@techno no amount of testing is ever enough
 
do you have 100% coverage?
 
If i have missed a few bugs?Is it a big problem?
i don't know the software testing Standards?
 
@techno that depends on how severe it would be if you failed (is it a life support system or air traffic control?) and how expensive it is to release updates
 
If someone could guide me.
 
11:06 AM
@RMartinhoFernandes yeah, gcc is pretty good at the optimisations, but that means it propagates constants with high enough optimisation so it ends up as notl $constant which is never going to work
 
I have integrated an Error Reporter that sends the Error Reports to the Server so that i can correct the errors easily
 
@techno the other question is how likely your users are to carry on using it or give up and never touch anything you release ever again
 
No one else can answer that question. For any nontrivial piece of software, it's pretty much impossible to make it entirely completely utterly bug-free
 
that's some kind of business/markety thing
 
So you have to decide if you trust it to be good enough
based on the testing you've done and your knowledge of the product and the code
And if you don't trust it, then you'll have to figure out what to do to change that. What will you test? How will you test it? Will going through the code help you?
 
@jalf I trust my Product and i have tested it in the normal workflow
 
@techno so do you trust that it'll work if a user installs it on his machine?
 
I plan to find out the hidden bugs which may only arise as the result of going out of normal workflow after releasing the product
 
Have you tried installing it on a clean PC (one without dev tools installed)? That's one thing that goes wrong surprisingly often
 
@jalf Yes 100%
@jalf Yes i have done that
 
11:11 AM
I don't know what we can tell you then. You trust your program, and you're planning to fix the remaining bugs post-release. Then there isn't much more you can do before releasing, is there?
 
@techno you will know the last bugs when a real user will install it and do some unexpected things with it
 
Label it as beta and do a round of user-powered testing.
 
If you're confident that it'll work, then that's the best you can do. If you're not, then you'll know why, and then you can figure out what to do to gain confidence in it
 
Ola
 
11:13 AM
the best hint would be : don't go on a trip while deploying, it will likely have some special cases to adjust, or at least some follow-up with users :)
 
Does anyone know a good page with programming excersises? It isnt for C++ but for Java, I think it doesnt matter.
 
@jalf Im sure the Product will not have problems when used normally,I have not taken much time to evaluate the varying conditions that may arise.Although im confident i can fix these minor bugs and release patches post-release
 
@user1178729 projecteuler.net
 
There isnt a chat for Java, so...
 
11:14 AM
We hear that all the time.
 
@Fred I agree
 
@techno Why are you telling us? The point I'm trying to make is that we can't make this decision for you
 
@user1178729 But there is a tag, so you'll find plenty questions there. I treat Stack Overflow questions as exercises
 
@Fred Is there any way they can be sorted by level?
 
@Fred We only test the product in the PERFECT WORLD
 
11:15 AM
You have to decide
 
@techno The perfect world doesn't have a caps lock key
 
@sehe I have a low/intermediate level so I can't answer a lot of the questions.
 
Well, if you like, I can make the call for you. But I'll just say something random. The only person who can make an informed decision is you
But if you ask me, then hey, ship it!
 
@user1178729 (1) Start with the simple ones .... (2) Look at how the others get answered. ??? (9) Profit!
 
@user1178729 yes, higher levels means higher knowledge required
 
11:16 AM
@sehe You're missing a missing step.
 
Yes, but how can I find the easier ones to start with?
 
@techno haha yeah, crazy stuff happens with users that are ready to try entered "Hello" when it asks for a number :P
entering *
 
@RMartinhoFernandes huh. I'm not well versed in memes. Better now?
 
@user1178729 Try to answer them. If that works, it was simpler.
 
11:18 AM
Trying is the important step.
 
I tried to answer one and answered it incorrectly and got 6 downvotes
 
@techno already got an issue with a long running task, caused by someone double-clicking on a button
 
@user1178729 So fix it or delete it when it reaches -2? Read the accepted answers to learn what was wrong with your answer.
 
@user1178729 then try to understand why your answer is incorrect, so you can write a better answer next time :)
 
@jalf I just want to ask experienced people like you before i do something.I think my product is ready to go and i will correct the minor bugs after post-release
Does this mean non standard procedure?
 
11:19 AM
@user1178729 If you learned something from it, I'd call it a win.
 
Yes I learned something
 
@techno Sorry to hear that your decision process is irrational. I'm happy to inform you, you just succeeded in asking experienced people. Now you can make your decision
 
@techno There isn't any one "standard procedure"
 
@user1178729 the first one is really easy I think
 
11:20 AM
Standard procedure is to FIX ALL THE BUGS before release.
That's why most projects never ship
 
@user1178729 if you want some challenge, do it in assembly
 
yes it is really easy, but in a lot of them you require math knowledge that I dont have
what is assembly?
 
yeah, that's why you must keep a google open lol
 
@user1178729 A lot of java questions require math knowledge? That is strange. Surely you mean project Euler now
 
11:22 AM
ok
 
Yes, project Euler questions I meanyt
 
@user1178729 It's machine code in some kind of English. :-P
 
I think will go with the Launch.
 
@user1178729 The craft of putting things together from smaller components
 
If you want a "standard procedure", try the following: ask everyone involved with the product to give you a thumbs up/thumbs down. If every agrees that it's ready, then ship it
And if "everyone" is just you, then you just have to ask yourself. And it sounds like you think it's ready
 
11:22 AM
@jalf This could easily lead to 'never shipping' in the right environments :)
 
my "standard procedure" is a friend of mine who always find tons of bugs in everything haha
 
@jalf I think will go with the Launch.Im Just going to ship it
 
@sehe Shoot the downthumbers.
 
then after he twisted the app in every ways, there's not so much bugs remaining
 
Your friend is a monkey
@RMartinhoFernandes Don't give the secret away
 
11:23 AM
@RMartinhoFernandes if it's only about writing the question really boils down to stackoverflow.com/questions/11138188/…
 
@techno good luck :)
 
@RMartinhoFernandes though, is it a dupe?
 
@refp Ah! I was looking for that too.
 
Thanks.Bye
 
@refp Though, will it blend?
 
11:24 AM
lol, he's a puzzle-maker, tries everything in every possible ways,
 
That was dangerously close to kthxbai there
 
@sehe I think it will, I've given it some thought and now.. yeah, I'm going for it. time to vote-2-close!
or.. should I? :/
well, it's a bloody vote
 
@refp Only if it is a dupe. Otherwise leave it there. Let the people decide it's merit
I like the question. Makes you think about assumptions.
 
leave it, where?
 
 
11:26 AM
but where, SO is bigger than super big
 
SO is not bigger than space.
Space is vastly hugely mindboggingly big.
 
@refp Huh. Just leave it where it is, of course
 
@sehe I'm not sure what you are talking about to be honest..
 
2 mins ago, by refp
@sehe I think it will, I've given it some thought and now.. yeah, I'm going for it. time to vote-2-close!
@refp I assume you are talking about closing this, since that was the only question in context
 
@sehe no, I'm talking about closing this as a duplicate of that.
 
11:31 AM
@refp I don't know if that's what @Fred wanted, but it seems like it.
 
@RMartinhoFernandes that's my interpretation as well
 
@refp aha
 
im not sure of what I wanted and when it looked like so lol
 
Off to lunch.
 
@RMartinhoFernandes peace.
 
11:36 AM
yeah, i was afk for a couple of minutes
for those who could be interested, I'm trying to do an android universal remote; but reality is : there is MANY interfaces and MANY ways to access them
so, someone has an approach to suggest ? :D
first thing would be for vlc, then eventually for more things
for vlc I thoug about using the rc interface and access it with an open port
problem is : rc seems buggy and slow
 
> Tools are just tools. – Jeffrey Snover
gtfo
 
11:52 AM
What.
 
Jeffrey Snover is out of subject
 
@jalf Hi
@Fred I have some concerns Regarding my earlier Query.
 
@Cicada It’s just such an utterly useless comment. He could equally well have started his post with true == true, or true != false. And nothing of value was learned.
 
I have an Online Documentation ie:.chm file converted to HTML with Frames
are these pages SEO Friendly?
 
@KonradRudolph Sometimes stating the obvious is necessary.
 
11:55 AM
hmm
 
You can actually forget about it (really).
 
@techno test it. how should we know?
@Cicada Agreed
 
Class template question: Can the base class of a class template be a template parameter?
Like template<class Base> struct InitializationWrapper: Base {T() { DoSomething(InitializationWrapper<Base>); }};
 
how can I check if a number is prime?
 
Sometimes stating something as itself is not a useless statement
 
11:58 AM
@Cicada Relevant:
 
If that something can mean several things
 
Good news, your username isn't: 1178729 == 17 * 69337
And, that really is good news in this room.
Tools and practices are like stars and planets. Few people manage to see the practice next to the glare of the shiny new tool
 
@user1178729 Have you done a little research on the topic?
 
A bit, but i think i'll have to use java threads
 
12:00 PM
@user1178729 sieve of erasthothenes, elliptic curve, just simply trying all factors to sqrt(number) etc
@user1178729 trolling
 
@user1178729 What.
 
It is for a project euler program, i'm maybe overengineering it.
 
Yeah... indeed you are.
 
@RMartinhoFernandes You should answer this one stackoverflow.com/questions/11469933/…
 
@user1178729 read my link
 
12:01 PM
I'm reading it
 
Project Euler is never over engineered. It's project Euler.
 
So can the base of a class be a template parameter?
I haven't used templates for like two months :(
 
good one lol, what's the context ?
 
Basically I want the same wrapper class around different base classes.
 
@Nils yes it can.
 
12:05 PM
@Nils That’s commonly used for traits (such as allocators) to benefit from empty base optimisation
 
It is even the stereotypical demo (silly) implementation of std::tuple, like more or less with Mixins:
template<typename... Mixins>
struct myclass : public Mixins... {
  myclass(const Mixins&... mixins)
    : Mixins(mixins)... { }
};
 
Ah I had a stupid typo in my example. Works now, thx :)
 
Hey, can anyone proof-read this shit I wrote?
 
12:23 PM
@IntermediateHacker Excess commas in the first paragraaaaaaph.
 
removed them
 
Other than those, looked fine. Only scanned, though.
 
there is a bug on l15 of the code
 
I really don't like the ///////////////////////////// style of comments personally
 
@thecoshman using namespace std;?
 
12:28 PM
indeed
 
@Flexo I don't like the /* comments */ actually
 
@Flexo neither do I, /************* is slightly better, but only just
 
@thecoshman how is that a bug?
 
I don't like the /* comment */ style because it prevents you from commenting whole sections of code if necessary
 
@IntermediateHacker bad practice, treat it like a bug
 
12:29 PM
oh, I see.
 
@Neil what do you mean?
 
should I use the using std::vector thing instead?
 
@IntermediateHacker no, just std::* where ever you want to use something from std
 
that way, you can still have std::vector<myMathsStuff::vector> and it makes perfect sense to all who read it, including the compiler
 
12:32 PM
I see.
 
using should be used when you want to save your self from writing long type names all the time
 
editing...
 
I mean I can't do this:
/* Commenting out entire method
/* Stupid comment here */
void function()
{
}
*/
Not without changing the stupid comment type anyway
 
L264 also does not sit well with me, I would change the 'open' variable to something more semantic like, 'quitGame'. thus set it true initially, change the loop to be while(!quitGame) and change L264 to quiteGame = CheckExit
 
potentially it keeps me from commenting 4 or 5 methods consecutively
 
12:34 PM
if I'm using // I still wouldn't do the whole line of // above and below though
 
thanks for the hints Neil
 
@Neil ah yes, I see what you mean, though, you could avoid that problem by just not nesting the comments, re-open the comment just before the 'void' not before the initial comment
 
@thecoshman I know but the point was to avoid having to do something like that
As I see it, /* style comments */ should be reserved for mass commenting
Meaning anything else has to start with // logically
 
done adding all the std::s whew!
 
@Neil yeah, I agree with that, though, it would be nice if '/' did not stop ALL comments, instead it should match, so if you write 5 / you HAVE to have and equal number of */
 
12:38 PM
I suppose that not using std as default namespace prevent possible confusion between std-defined and user-defined methods ?
 
@thecoshman I can see the reasons why they didn't do it that way, but I wish they had considered that with C++11
nested comments
 
@Fred exactly, you should (almost) always use your own name space for your own stuff, even if it's just namespace myStuff
 
Multi-line comments are rarely truly useful.
 
@CatPlusPlus I could find a thousand examples of things C++ does that are rarely useful
It happens to be useful to me anyway, and at least I would appreciate it
 
Xeo
lol @ code of conduct
 
12:42 PM
@thecoshman just saw how badly markdown twated that up for me ¬_¬
 
@Neil what about android c++ programming ? somebody just told few hours ago that it was bad.. but it must be at least one situation in which it's awesome to use it, no ?
 
I think I might have sorted out opening bit for CV
 
Nothing related to Android is awesome to use.
 
@Fred it's not too bad depending on what you want to do with it.
 
@Fred I'm not familiar with android c++ programming, why would it be awesome?
 
12:45 PM
@CatPlusPlus ¬_¬ not a fan of android phones?
 
It's awesome when you already have a portable C++ library that's easy to compile and use and solves the problem :)
 
idk, it's possible to develop with both java and c++ so I was wondering if there were some typical cases in which c++ is way better than java
 
@Fred when you just really can't stand to use Java any more
 
All cases.
 
I experimented some apps in java and it's really well documented and easy to use, then probably C++ will come when I get some time
 
12:48 PM
well that makes plenty of sense
 
Java is boring.
 
@CatPlusPlus beats PHP
PHP < Java < Everything else
 
That's not very remarkable achievement.
 
anybody here has an Android with SwiftKeyX installed?
 
I've never been able to put my finger on what I don't like about Java.. it's all pretty consistent, I can get things done with it, doesn't really get in your way that much, but good god is it boring to write
 
12:55 PM
@Collin Probably because it’s a lot to write
 
@KonradRudolph There is a lot of boilerplate, yes
 
@CatPlusPlus I agree that having some "low-level fun" is cool, unless the client wants something simple that doesn't have to be fully optimized
 
@IntermediateHacker error in your 'block' post here
 
@Fred What?
 
you are toiling away constructing boilerplate the whole time. Which makes it a horrible language, because this is the kind of tasks a computer should do for you
 
12:56 PM
What is with people pulling insane interpretations out of their ass.
 
in this case, using low-level stuff is expensive (debug)
 
@Fred I don't follow
 
@tuğrul I don’t think the term means what you think it means. Deadlocks don’t occur “just like that”. — Konrad Rudolph 2 mins ago
 
You have no idea what you're talking about, so don't. Thanks.
I have a funny comment on my mockpost.
> "Yeah, let’s chmod 777 everything, because something is not working."
> Wow, you have no idea how to get things running, so you just fuck the whole shit up and you're wondering why YOUR php is insecure?
What a moron.
 
@IntermediateHacker depending on the compiler used (?) you need to reorder the includes. Do the evil windows.h last, because otherwise evil MACROs min/max etc. wreak havoc on the standard library headers.
 
12:57 PM
chmod 777 everything!
 
He's so stupid I don't even know how to reply
Besides "you're a moron".
 
@IntermediateHacker std::system("cls"); results in sh: cls: command not found on my box. Perhaps you should prefer native APIs or ANSI <Esc>[2j
 

« first day (636 days earlier)      last day (4314 days later) »