« first day (2139 days earlier)      last day (2808 days later) » 

3:01 PM
@TheQuantumPhysicist In that case, use logic roughly similar to how reverse_iterators work: for (unsigned long i = size; i>0; i--) process(vec[i-1]);
 
@JerryCoffin Sure, this'll work. I just dislike manipulating the indices instead of the loop itself
 
@TheQuantumPhysicist Then you need to correct your likes/dislikes, because they're leading you toward complex solutions to simple problems.
 
@JerryCoffin You have a good point, although I can mention situations where it can be dangerous to play with the code within the loop instead of the looper header
 
for(auto i : boost::irange<size_t>(0, v.size()) | boost::adapters::reversed)
 
@milleniumbug dear lord...
It just got orders of magnitude more complicated... now for a loop I have to compile the boost library
 
3:06 PM
lol not using Boost
 
for(auto i : ((((((((((((boost))))))))))))::irange<size_t>(0, v.size()) | boost::adapters::reversed)
 
also you don't need to "compile" Boost library
 
Depends on the operating system
On Windows, you do
 
@TheQuantumPhysicist ...that's not how it works yo
 
No you don't
 
3:07 PM
read the fucking manual
 
I'm saying the fact you're not using Boost means you're wasting your time already
 
@Griwes Easy, dude!
@milleniumbug still, including boost just for looping is... insane, I'd say!
If it's already there in your program, then perfect
but just using boost for something as trivial as looping... is too much
 
Have fun writing all these by yourself
 
@milleniumbug Writing what myself? A reverse loop?
 
pretty much anything
 
3:10 PM
I use boost, I use ASIO for SSL and Serial. I use it for complicated things.
 
@TheQuantumPhysicist That sounds just like "including a whole header just to get vector? that's insane!" to me.
 
But again: Just adding boost because you want a reverse loop is not the right thing to do
 
For not complicated things I use Python
 
@TheQuantumPhysicist If your program consists solely of one reverse loop, then Boost probably won't save you enough to notice. If your code is much more substantial, you're probably losing quite a bit if you insist on ignoring Boost. And no, it's not just for complex things--it can help a lot with simple areas as well.
 
@Griwes vector is in the standard library. You don't even have to modify your make file for that
 
3:11 PM
@TheQuantumPhysicist You don't need to modify your fucking makefile to include boost.algorithm.
 
@JerryCoffin I think we agree on the principle, then.
 
@TheQuantumPhysicist Most of Boost is header-only, so you don't have to modify your makefiles for that either.
 
Ell
@Griwes maybe he needs to add -I/path/to/boost?
 
@Griwes On Windows, you do!
@Ell Exactly
 
> windows
> makefiles
 
3:12 PM
> makefiles
 
@Griwes Yes, I use qmake and cmake on Windows
 
> windows
> makefiles
 
and normal makefiles with MinGW
 
@TheQuantumPhysicist So... cmakefiles!
 
Ell
@TheQuantumPhysicist in future, don't say makefiles because that makes people think of GNU make
 
3:12 PM
@Griwes Also makefiles
 
Ell
if you are using qmake that will confuse people
 
@Ell That still works with MinGW
 
cmake -G "MinGW Makefiles" <- there
 
nwp
maybe I'll invent another build system and name it Maker just to be able to hold a talk "Meet your Maker"
 
@Ell It certainly shouldn't make them think of gnu.
 
3:13 PM
@TheQuantumPhysicist "Makefile" means "files in the format understood by POSIX make".
@Ell No, of POSIX make.
 
@nwp haha! ^_^
@Griwes I disagree.
 
@nwp inb4 someone has done that
 
@TheQuantumPhysicist Then you're wrong.
 
@Griwes This sounds to me like a "not true scotsman" argument
 
@Griwes y u no GNU Make
 
3:14 PM
@Griwes You really need to chill
 
Ell
@JerryCoffin I guess I have it wrong
I always think of GNU Make for some reason
 
@набиячлэвэли lol
 
@TheQuantumPhysicist also public service announcement
 
@milleniumbug :P
 
@набиячлэвэли Unfortunately I do GNU make, because POSIX make still doesn't have some features.
 
3:15 PM
GNU/Linux
 
@Griwes Why "unfortunately" doe
 
Though there's this weird != thing (I think that's how it's spelled) that is supposed to replace $(shell), so all good there.
@набиячлэвэли GNU make is awful.
 
Because you're restricted to platforms which GNU Make supports
 
yo
 
@milleniumbug Well, BSD make also supports some GNU make extensions.
Still bad though.
 
Ell
3:16 PM
why is GNU make bad?
 
I need to make despayre usable and then I'll be happy. vOv
 
This is why you shouldn't be writing makefiles and should instead invest in 2 kinds of files.
 
@Ell Go spy the source code for copyrights.
 
don't use make in general
 
VC++ project files for Windows/MSBuild, and ninja for everything else
 
3:16 PM
@ThePhD No, you should write just despayre buildfiles. :P
 
let this 40 year old tool die in hell
 
@ThePhD Ninja is dumb in its confirmation of the need to have CMake :/
 
@Griwes Use a generator on top of it like python or something.
 
Ell
@Griwes sounds like effort :V
 
@ThePhD Also bad. :/
 
Ell
3:17 PM
it's released under gpl right?
 
@Griwes vOv
 
no one sane writes makefiles by hand
 
Ell
@Griwes it's good imo
 
@Ell That's not what I meant.
 
so ninja is pretty much on the same level make is
 
3:18 PM
@milleniumbug But that's what everyone tells me to do when I have to. .-.
 
I meant the years in those copyrights.
 
Ell
I like the separation between "build engine" & "build generator"
Oh I see
 
@ThePhD they're morons
 
Ell
but old doesn't mean bad necessarily
 
@milleniumbug I have a makefile template that I just use everywhere.
 
Ell
3:18 PM
I'm sure other make`s are comparatively old
 
I don't like CMake's weird procedural language for making projects.
 
@Ell Sortix make is pretty new.
:D
 
It's clunky and honestly kind of shit.
 
@milleniumbug Make has outlived a lot of would-be successors, and will undoubtedly outlive quite a few more before it dies.
 
@JerryCoffin That's only because people are too lazy to switch.
(And don't even get me started on autofools.)
 
3:20 PM
Ugh. autoconf is my single biggest bane on Windows machines. =/
 
@Ell I don't, since "build engine" is just a future chain. vOv
@ThePhD Ewww, infesting Windows with that shit.
 
It's the SOLE reason I can't build, like
90% of the libraries I want to.
 
Linux is lost already, but you could at least spare poor Windows. :P
 
Ell
@Griwes But most of the time you are rebuilding, it is sensible to separate "build" from "add new file to build", isn't it?
 
@Griwes I disagree. In an awful lot of cases, it's because the would-be successors were simply inferior, at least for the general case. They fit one person's ideas of how things should work, but often departed widely from many other peoples' ideas.
 
3:21 PM
@Ell The amount of stat syscalls is about the same. vOv
 
Ell
but but separation of concerns
 
@JerryCoffin make should've died the second a build system that recognizes a target can have multiple outputs started existing.
@Ell but duplication of functionality
@Ell Also... I have a tool that loads a file that describes how a build is performed, and then performs the build.
 
@Griwes That's the one thing I like about VC++ and its new "Add References" feature.
 
It's a clearly separated responsibility. vOv
 
@Griwes To paraphrase The Joker, this build tool need an enema. Too much ancient shit in there.
 
3:23 PM
You literally just check a bunch of boxes that say "this build depends on the output of those projects", and it drags all that stuff right in.
Sure, you still have to set up the headers and stuff but at least it takes care of the output and puts it all in the right directory so I can package / run my exec easy.
 
@Griwes ...as long as that build tool didn't completely screw up something else that mattered to more people more often--which most did (and still do).
 
I really sorely want something like that for the non-VC++ world.
 
@JerryCoffin There's literally nothing to screw up, because make doesn't actually have features.
 
It kinda does, doesn't it?
Chaining makefiles in subdirectories and stuff
 
ewww
 
3:26 PM
Albeit that could be fixed by just having a proper project referencing scheme.
 
What make does vs what should be done is literally the difference between #include and modules.
(Yes I know make also has -include.)
 
@Griwes That kind of inability to see what's in front of your face is what leads to the build tools that fit your notions perfectly and are completely ignored by the rest of the world.
 
@JerryCoffin So what's the great make features that are possible to screw up?
 
I just want a project-based, multi-output, auto-copy-on-success, build-order-discerning Build Generator / Engine.
 
@Griwes Who said "great"? I'm just talking about meeting people's basic needs--which most attempts at build systems don't.
 
3:29 PM
@JerryCoffin That adjective was sarcastic.
People's basic needs is "build me my thing sanely".
 
I also shouldn't have to goddamn fight with the difference between rmdir and del on windows: if my build engine can't give me basic file system IO in some system-agnostic way, fuck that build engine.
Move, Copy, Rename, should be build system primitives.
Not something I have to ask the shell to do after giving it a footrub.
 
Good point.
 
@Griwes For varying definitions of "sanely", and with the added limitation of "in exchange for a small and (especially) predictable amount of work on my part."
 
Need to put a filesystem plugin on my despayre-plugins-to-write list.
@JerryCoffin Contrary to popular belief, building C++ properly is not a hard task.
 
@Griwes Nobody said it was hard. I did say (or at least implied and do say) that regardless of how easy it is, most attempts at build tools screw it up even worse than make does.
 
3:34 PM
@JerryCoffin Eh?
 
@Griwes Simplicity of the task doesn't change the fact that while make is bad, most of the attempts at replacing it have been even worse.
 
Ell
I think ninja is better than make
 
Yes, objectively it is.
 
CMake on the other hand is amazing on how its design choices seem to be poor .____.
 
But the fact that you need a meta build system for it doesn't make it good.
 
Ell
3:39 PM
I think it does
 
@Griwes Do you mean: "The fact that you need a meta-build system for it prevents it from being good"?
 
Ell
it shouldn't have both
 
@JerryCoffin Probably, yes.
@Ell have you seen despayre
 
Ell
No
 
It's not very far, but it is capable of building itself (still somewhat dumbly, but eh).
I'll get back to it once I hit another roadblock in Vapor. :D
 
4:04 PM
Honestly, after getting good primitives for a build system,
 
my ideal build generator / engine would just be "Visual Studio Property Sheets" on steroids.
It perfectly mimics how I think about my build.
 
> >ideal
> >Visual Studio
 
Sorry you're not allowed to split sentences across messages like that @ThePhD
 
Ell
4:07 PM
@Griwes is there an example config build file?
 
I'm gonna send myself an e-mail with that idea.
Property Sheet Build System
 
Ell
wat
 
Properly Shit Build System
2
 
:D
 
Hi @JerryCoffin, how have you been keeping?
 
4:10 PM
@AndreasPapadopoulos It even sounds great too: PSBS
 
4:23 PM
ThePhB why are you not discordin
 
browser became a regular file
no I'm confusing with Ell
 
4:35 PM
@CatPlusPlus Dreading school, feeling like shit, feeling worthless. At least in this chatroom I don't have to see Elim being amazing and Borgleader doing great things and I can huddle up in a corner and slowly waste away.
 
@TonyTheLion Pretty fair. How 'bout you?
 
@набиячлэвэли still better than make
 
as working on my C++ to Java code converter.. I'm now stuck at the phase of building the parser, I think I should be drawing state diagrams by now..
 
@ThePhD That's because it's 90% randoms posting crap
 
4:43 PM
@ThePhD That's OK you can make fun of Tony and I if that makes you feel better you elitist piece of shit
 
COME TO THE DISCORD SIDE
It's a friendly spaceship
Bartek-free
 
@JerryCoffin Not too bad. Bit tired, slept only 5 hrs last night
 
user406009
@ThePhD Lol, the only thing we have seen from Elim lately is PROCEDURALLY GENERATED LIES
 
ELIM WHERES MULTIPLAYER
 
18 quintillion sockets
 
4:44 PM
@TonyTheLion Obviously need to get drunk and pass out by 10PM tonight. It's not really sleep, but it's better than nothing... :-|
 
@JerryCoffin Yea actually I wouldn't mind a trip to the pub
 
user406009
@ThePhD Anyways, I sorta feel you. I'm starting to dislike all my classes.
 
user406009
The main thing driving me forward is one more year until graduation.
 
user406009
Every class is one less class on the list of graduation requirements.
 
user406009
3 more credit hours towards freedom.
 
4:52 PM
lol that always happens I told ya all that 3 years ago
 
Freedom until you start a job that you hate
and then get stuck in it because money
 
@TonyTheLion Am I really that unusual in having mostly had jobs that I liked at least a little?
 
@JerryCoffin No you're probably just wiser
 
@CatPlusPlus ayy
 
5:47 PM
@JerryCoffin Hopefully not. Not leaving a job one does not like is a suboptimal strategy
 
@TonyTheLion Perhaps I'm just easily satisfied. A few of the people at my current job don't seem to think it's the greatest possible place to work.
 
6:05 PM
@Lalaland The worst part is that when you get done, you're going to realize you didn't learn enough... Anyways, take a bunch of math classes, because you can't learn that anywhere else.
 
 
1 hour later…
7:28 PM
@CatPlusPlus And rich in porn
 
Porn has been nuked because apparently it was anime?
I don't know I was asleep
Also muted that channel long ago
 
Just logged in yesterday. For curiosity's sake. I can assume the dozens of pages I saw were just the ones not deleted
 
log in today and read the news
 
Also, I don't follow the juxtaposition with anime. Is that some kind of DRM logic or so?
@JohanLarsson I might.
 
or better yet, open a tab and never close it
close the twitter tab if out of tabs
 
7:34 PM
I like this fresh take, slightly different vantage point. I think it adds insight [I admit a lot of the appeal is the brevity. It's just easier for me to grasp & recall :). @TannerSansbury, do you see any problems with this as a highlevel mental model?] — sehe 1 min ago
I might be too lazy as a developer
 
@sehe No I mean the porn was literally anime
 
@JohanLarsson I'm never out of tabs. I've dropped gazillions of tabs from our code base so I have spares
 
Or so I've been told
That channel got deleted todayish I think
 
@CatPlusPlus Most of it, quantitatively. Still, don't get why that is grounds for removal
 
Supposedly there was something gross idk I don't care
Touch any real channels and I'll fite u but the NSFW ones are like whatever
 
7:37 PM
Well. To each his own, but I don't see why it was there in the first place. Can't people link to a site
 
The will of the peoples
 
Fight? IDGI. It's just another chat, right.
 
It's my chat, a cat chat
Also I had some beer
 
Heresy. What happened to the vodka
 
@jaggedSpire is this bad implemenation? ix.io/1gwK
 
7:39 PM
There is no such thing as a bad implemenation. There are only abominable ones
 
@jaggedSpire the only difference between my solution and some of the passing ones was that they used a map to determine powers of 2. but mapping is O(log n) and mine is O(1) no?
@sehe whats abominable about it?
 
user406009
@thepiercingarrow Your code is sorta incorrect though in that it will fail very badly when n > 100000
 
@thepiercingarrow The spelling, for one
 
it was wrong - i just updated it
 
@Lalaland Or 0
Many whoosh. Such update. Much pow
 
7:42 PM
Sorry I should have gave context as well. It is the solution to codeforces.com/problemset/problem/702/B
@sehe what? i no understand dogespeak
 
Among others
 
user406009
Oh, there is a guarantee that n is below a certain limit.
 
@Lalaland The first line contains the single positive integer n (1 ≤ n ≤ 10^5) — the number of integers.
 
@thepiercingarrow This is Lounge<C++>
 
I know
that is C++ code
 
user406009
7:44 PM
@thepiercingarrow Also, your solution takes n^2 time. I believe there is a solution which is roughly O(n).
 
user406009
Actually wait. I need to think.
 
@sehe If you're wondering about the scanf and printf, I was told in a competition book that they are much faster than cin << and cout <<
 
user406009
Yes. Approximately O(n)
 
@thepiercingarrow lel
I'm not wondering. Just judging.
 
@sehe I'm serious. And its also more flexible.
Lemme find the book...
 
7:46 PM
... spare yourself the trouble
 
user406009
Well, actually, O(log2(a_max) * n)
 
Competitive Programming edition 3 - the new lower bound of programming contests
 
user406009
You can basically just use k2code.blogspot.in/2012/01/… on every power of 2.
 
nwp
@thepiercingarrow does the book explain what cargo cult programming is?
6
 
Delicious ironic justice. Served hot. Season to taste.
 
7:48 PM
> Not many C/C++ programmers are aware of partial regex capabilities built into the C standard I/O library. Although scanf/printf are C-style I/O routines, they can still be used in C++ code. Many C++ programmers 'force' themselves to use cin/cout all the time even though it is sometimes not as flexible as scanf/printf and is also far slower.
@nwp not sure, haven't read much yet
@sehe also, about 2 months ago a guy here was asking for help with cout printing non-printable characters. I rewrote the program using printf, and it fixed his problem.
 
King of the jungle then.
 
user406009
Anyways, competition programming is really different from real life programming.
 
@Lalaland You genius!!! o.O
 
user406009
Anyways, I would recommend code.google.com/codejam over codeforces if you are just doing them for fun.
 
user406009
7:52 PM
Google code jam actually has legit problem explanations.
 
user406009
And you can program in any language on your own machine.
 
user406009
Much more fun.
 
user406009
Don't participate in any of the actual competitions though. They are lame and stressful.
 
user406009
Just look at the old problems: code.google.com/codejam/contests.html
 
ahhh
I'm doing them for practice (not fun)
@Lalaland They are lame and stressful?
 
user406009
7:59 PM
@thepiercingarrow Watching the clock while programming can be stressful. And lame in the sense that there really isn't that much point.
 
user406009
I won't win. You (probably) won't win.
 
Another problem is that some teams are vastly more experienced than others, some have been working on the project weeks before the competition
 
user406009
You just have to ask yourself why you woke up early and blocked off the time to do something when you could have just played with the problems after the contest is over.
 
hmm. I am actually doing codeforces to train for USACO... would you say that this codejam is more/less stressful than USACO?
Wait what project?
 
@thepiercingarrow If you're interested almost exclusively in code simplicity, it's probably sort of all right. In terms of execution speed, it's almost certainly open to substantial improvement. Powers of 2 follow a fairly specific pattern, which it completely ignores.
 
user406009
8:01 PM
@thepiercingarrow I think @Mikhail is talking about a different type of competition.
 
@JerryCoffin Yeah, I am bad at math. I got a 4 on the AIME last year :/
@Lalaland Oh, okay
 
@thepiercingarrow cin and cout can definitely be slower when they are synced to each other. They are also much safer than the C-style functions you mentioned; that is probably why C++ programmers generally prefer them (similar to why they avoid things like strcpy)
 
user406009
@thepiercingarrow Never done the USACO. Only did a couple of the codejam competitions. Did poorly. Stopped caring.
 
lala, lol
@caps Whats wrong with strcpy? If you are in a controlled environment, they won't bug out.
 
user406009
@thepiercingarrow In the "real world", performance almost never matters compared to correctness.
 
user406009
8:03 PM
And nothing is in a controlled environment.
 
nwp
@thepiercingarrow They never bug out. You bug out and they don't fix it.
 
@Borgleader
-25
Q: My account was deleted and my co-worker's account was suspended

mel_santThis evening, I found that my account has been deleted and my co-worker's (who is also my friend and fiance) account has been suspended for 7 days. Why was this done? I researched this topic and found that because I used to like his posts, you have killed his account and my account. Please try to...

I'm sorry officer, I didn't know I was speeding, so no ticket, right? — Alexander O'Mara 16 hours ago
 
@thepiercingarrow Let's say your N is 5. By brute force, you find that the next power of 2 is 8. From there, you can compute successive powers of 2 directly (2 * the current power of 2). So, we start with N+3, then N + 3 + 8, then N + 3 + 16, N + 3 + 32, and so on until we get to the upper limit. Then we get N = 6. For this, we get exactly the same set, except that it's N + 2, N + 3 + 8, N + 2 + 16, and so on. Likewise for N = 1, we get N + 1, N + 1 + 8, etc.
 
@thepiercingarrow It's not safe at all.
 
That means, as soon as we compute the count for 1 greater than a power of 2, we also know the count for the next M numbers (up to the next power of 2).
 
8:06 PM
Example (from the C perspective): natashenka.ca/strcpy
 
user406009
@JerryCoffin You don't have the numbers in series though.
 
@Mysticial I had this happen when a relative got banned from Wikipedia...
 
user406009
You are provided a list of numbers.
 
user406009
Which may or may not be consecutive.
 
@JerryCoffin Um, what?
 
8:07 PM
@thepiercingarrow randomascii.wordpress.com/2013/04/03/stop-using-strncpy-already (from a hybrid C and C++ perspective; his "best" solution involves templates)
 
@Ell this builds functioning despayre (there's a build-multistage in the repo that basically does a multistage bootstrap and checks if all is good)
@Ell it's basically a declarative description of how everything is supposed to be built.
 
nwp
I disagree with all these strcpy functions. When there is not enough room in the buffer it should assert, not truncate. Bug hiding is not cool.
 
To extend the functionality with some procedural code, you write a plugin in C++.
 
@nwp time to check return values
 
(C++ support is the one plugin that exists, and it even somewhat works.)
 
8:14 PM
@Lalaland Oh, you have to do a quick lookup to find if each target addend exists in the input, sure. Of course, to optimize that you want to start by inserting the numbers into some sort of set to get fast lookup. You could use an std::unordered_set, or just a std::vector<bool> (numbers limited to 10^9, so that uses only about 120 MB).
 
nwp
@sehe does anyone actually do that? And not assert on the return values? Way too much code.
 
It's pretty hard to ignore the warnings.
I don't usually drop down to C land. I can write perfectly purrrformant C++, but you know.
 
nwp
maybe I'm just doing it wrong, but I don't get warnings for not checking the return value of strcpy
and it is on -Wall -Wextra
 
@nwp You're using strcpy, so yes, you're doing it wrong.
 
-Wunused-result
 
nwp
8:16 PM
@caps I'm using strncpy, but it isn't actually better
@Mikhail that is terrible, you get so many false positives like for printf
 
@nwp That's how I would feel.
 
also std::strncpy
@nwp Thats not a false positive! You can't have it both ways! I really, like Resharper for static analysis and code highlighting, etc...
 
@nwp strncpy is actually quite a bit worse--in fact, it competes with strtok for being the worst designed in the entire library (now that gets is gone).
 
nwp
one could argue that strcpy is better than strncpy and strlcpy because strcpy has a chance to properly crash when an error happens while the other ones are guaranteed to hide it
 
@JerryCoffin I don't understand your solution...
 
8:18 PM
why are we even discussing retarded C APIs here anyway
 
@lala Which method are you using? I see a n log n solution but not the log n*max
 
nwp
@Mikhail so you are saying you always check all return values?
 
@nwp no, but I don't check the other guy either
 
@Griwes because some of those "retarded C APIs" are superior to their C++ counterparts.
 
user406009
@thepiercingarrow The third approach listed on k2code.blogspot.in/2012/01/….
 
user406009
8:19 PM
Remember you just check every power of 2.
 
@nwp Anyways, there is a product from JetBrains that has reasonable defaults enabled for static analysis...
 
user406009
(Well until 2* max a)
 
@thepiercingarrow Which one?
 
@caps printf/scanf
 
user406009
printf and scanf actually do have a somewhat nice API.
 
8:21 PM
And if anybody makes fun of you, you can just write std::printf
 
@thepiercingarrow Start by inserting all numbers into some sort of set. An unordered_set (for example) gives expected O(1) lookup to see if a number to produce a power of 2 is present so you can use it. Then walk through powers of 2 and compute the difference between that power of 2 and your input. Check if that difference is present. If so, count a hit. If not, on to the next.
 
@Lalaland printf, yes. scanf, not so much
Too many bloddy platform specifics. That are quite essential AFAIR
 
user406009
@JerryCoffin Pretty much just what the link I already posted suggests: k2code.blogspot.in/2012/01/…
 
@JerryCoffin Ur smart xD
 
8:24 PM
I'm so glad I looked into transcript to see plonked messages.


BUAHAHAHHAHAHAHAHAHAHAHAHAHHHAHAHAHH
 
@Lalaland Pretty much, but he skips one I pointed out above: instead of a hash table, you can just use a std::vector<bool>. It'll take up ~120 MB in this case (inputs have range 10^9) but then each lookup is guaranteed O(1).
 
@caps What about the regex/specifier capabilities of scanf not present in cin?
 
@Griwes Superior in the same way that PHP has superior community support, deployment characteristics and productivity benefits
@thepiercingarrow very hard to use right and safely. Even harder to make portable
Just use std::regex, boost::qi::match or whatever.
Code talks:
4
A: C++: Fast way to read mapped file into a matrix

seheI have numerous examples doing this/similar written up on SO. Let me list the most relevant: I've done quite a few of these benchmarks. Yes, for sequential freading, read/scanf have a tiny edge (see e.g. scanf/iostreams and files vs. mappings, and parsing floats, or read being slightly faster ...

 
@thepiercingarrow scanf is not a good interface, regardless of capabilities. I'm not necessarily defending cin here, but if you're going to say "cin doesn't have the capabilities I want" my response would be "use (or create) something that provides them safely."
In other words, ask sehe.
 
Also:
8
A: Is there any std::istream manipulator that consume predefined string from input?

seheWith Boost you can use Spirit's qi::match manipulator: std::istringstream input("some text that i'd like to ignore 42 \tthe rest of line"); int number; if (input >> std::noskipws >> qi::phrase_match( "some text that i'd like to ignore" >> qi::int_ >> "the rest of line", ...

 
8:29 PM
Okay, fine. Now I gotta memorize a ton of stuff just for I/O. Drats.
 
You see the fallacy here? You already memorized a ton of random shit for sscanf. That's the argument you're holding.
So, it's just human inertia.
Next, please.
 
I really didn't need to memorize anything for scanf, it's all in the man page...
But I do see your point.
 
Note how sscanf falls woefully short in areas of strong typed extraction and extensibility. There's no thing like alternatives or conditional parsing. It's just an antiquated tool that /is/ nice for a very limited subset of tasks. "Competitive coding" might just be the best arena for it.
 
Why use sscanf? You can just parse it yourself.. Use scanf for just I/O, no?
 
hi folks
 
8:33 PM
Hey
 
@sehe is there any generator equivalent to Karma in Spirit-X3?
 
Nope
 
damn, not even hidden in develop?
 
I don't even think it's planned.
 
do you know why not? or are generators considered a dead end?
 
8:41 PM
I'm myself not fond of Karma. For most text serialization I'd either be better of generating some flat stuff without karma OR it is just too inconvenient to things with Karma
 
oh OK, well given an AST writing is indeed a lot easier than the parsing of input
hm, just found this video, don't recall seeing this before
probably not part of the X3 team?
 
@JerryCoffin @Lalaland so, it looks like a bitset would be better than a hash-table?
 

« first day (2139 days earlier)      last day (2808 days later) »