« first day (765 days earlier)      last day (4200 days later) » 

12:00 AM
@Pubby I did do some Haskell at a few points.
 
@AlbertoBonsanto Yes, why ?
 
but more realistically, I don't see why I would want to
 
@kbok hardly, the most likely reason for a C++ program to not compile is because of the nut behind the wheel
any hoops, time to hit the sack
 
@thecoshman Some compilers get confused by nuts indeed
 
work isn't going to be depressing on it's own
 
Ell
12:01 AM
@thecoshman <3 ?
 
@Ell huh?
bah, night
 
user142019
factorial :: Integer -> Integer
factorial n = foldl1 (*) [1..n]

main :: IO ()
main = print $ factorial 42
-- Actually short and readable.
 
Ell
@thecoshman sack, ball sack. anyway, nighty nighty, sweaty ballsack dreams. I mean sweat dreams.
 
.. list notation is silly
 
user142019
.. list notation is awesome. I couldn’t live without it.
 
Ell
12:05 AM
.. range notation in ruby is awesome. and ...
 
19
A: Summing a large list of numbers is too slow

Daniel FischerLists are not loops So don't be surprised if using lists as a loop replacement, you get slower code if the loop body is small. nats = [1..] :: [Int] evens = filter even nats :: [Int] dumbSum :: Int dumbSum = sum $ take 15000000 evens sum is not a "good consumer", so GHC is not (yet) able to ...

Dunno if this is related
Haskell optimization is something I don't ever want to do
 
user142019
I benchmarked it once and it seemed faster than recursion. Let me try again…
 
user142019
factorial 0 = 1
factorial n = n * (factorial $ n - 1)
-- 4,33s user 0,05s system 99% cpu 4,404 total

factorial n = foldl1 (*) [1..n]
-- 5,02s user 0,06s system 99% cpu 5,102 total
 
user142019
Snap, you’re right. :P
 
-- explicit type recursion with functors and catamorphisms

newtype Mu f = In (f (Mu f))

unIn (In x) = x

cata phi = phi . fmap (cata phi) . unIn


-- base functor and data type for natural numbers,
-- using locally-defined "eliminators"

data N c = Z | S c

instance Functor N where
  fmap g  Z    = Z
  fmap g (S x) = S (g x)

type Nat = Mu N

zero   = In  Z
suck n = In (S n)

add m = cata phi where
  phi  Z    = m
  phi (S f) = suck f

mult m = cata phi where
  phi  Z    = zero
  phi (S f) = add m f
^ that's how you write a factorial function!
 
12:09 AM
@AndreBoos I apparently lost track of the prose in the question around "binned counts". My quick response did already sidestep the (gross) inefficiency of while(j<range_starts[i]) pi++; in the OP. Note that std::lower_bound has O(log n) rather than linear runtime. I realize that your own solution goes a lot further than this. Perhaps you can still exploit the 'strictly increasing' property of your offsets data. Cheers — sehe 6 mins ago
^ guy has an interesting site. yawn
 
@Zoidberg'-- Could you benchmark this one?:
facAcc a 0 = a
facAcc a n = facAcc (n*a) (n-1)

fac = facAcc 1
 
@Pubby Walls of Code?!
 
user142019
@Pubby what is the type of facAcc supposed to be? Integer -> Integer?
 
user142019
I want explicit type annotations since I want all to deal with Integers.
 
@sehe It is a great wall
@Zoidberg'-- Int -> Int -> Int
 
12:11 AM
@kbok you built this city (on Rock&Roll?)
 
user142019
@Pubby 4,82s user 0,05s system 99% cpu 4,894 total
 
user142019
Recursion is the fastest till now.
 
facAcc is just recursion with accumulator
 
user142019
Problem is that recursion crashes with giant numbers. Hmm.
 
I'm surprised the memoizer is faster
 
user142019
12:13 AM
3,72s user 1,12s system 13% cpu 35,254 total
 
@sehe Nope, it was a photo of a huge lego city I took at some exhibition today. I have a bunch of them.
 
user142019
For main = print $ factorial 100000000. :P
 
user142019
13% CPU? What?
 
@sehe the robot comes from there too
@Zoidberg'-- 8 cores maybe ?
 
user142019
@kbok no, then it would go to up to 800% at most.
 
user142019
12:14 AM
And I have four cores.
 
Oh yeah, top works differently indeed
 
user142019
At least, I don’t know how time counts the percents.
 
user142019
Activity Monitor adds 100% per core, so a program could use 400% CPU time.
 
@Zoidberg'-- hyperthreading?
 
user142019
@sehe what is that?
 
user142019
12:21 AM
Anyway, the machine I’m on right now has four cores.
 
user142019
My MacBook is downstairs so I’m on Linux right now.
 
user142019
 
user142019
I know.
 
user142019
What was the question?
 
user142019
I don’t know. I just feel like it.
 
12:25 AM
@ScottW He's still young.
 
Wow are you leke genius programmers? able to program in their head? without mistakes? :)
 
user142019
Only me.
 
@AlbertoBonsanto No.
No one is.
 
user142019
Jun 16 at 10:49, by DeadMG
yes, I parse it by hand. I also generate the machine code by hand. And I resolve all ambiguities with rand().
 
user142019
> visionmedia has 165 repos written in JavaScript, C, and Shell. Follow their code on GitHub.
 
user142019
12:27 AM
165 repos. wat.
 
I have like 40 and I barely do anything.
 
user142019
He also has over 211 npm packages. T_T
 
user142019
I have two GitHub accounts and 12 repos.
 
user142019
Only one repo is slightly popular.
 
user142019
> Last updated 2 years ago.
 
user142019
12:29 AM
Wow, didn’t know I was on GitHub already back then. Time goes fast. :)
 
@EtiennedeMartel speak for yourself
 
@sehe Dude, you're a bear.
 
Oh I forgot
 
user142019
Oh gawd, it still uses jQuery 1.4.2.
 
@Zoidberg'-- Yeah. Let's toss all the software that is >3 months old
 
12:30 AM
@Zoidberg'-- Sounds like you have an identity crisis
 
user142019
Ah well, except that it stores your password in plaintext it works fine.
 
How are ever going to become a monoid if you don't have an identity?
 
This would become remotely answerable if you had a grammar and a basic implementation here. Also, what does it mean to "Animate the algorithm reading and drawing the program state stack". I have a hunch that description already pre-supposes a particular implementation. — sehe 5 mins ago
What I see here now is "Not a real question" (because there are no concrete requirements, only loose thoughts) and "Too localized" (because the 'implied requirements' (animation(?), specific scoping ideas) are unlikely to be relevant to others in the future. — sehe 3 mins ago
^ Does anyone agree? I feel like voting to close, and I gravitate to 'NARQ' over 'Too localized'
 
user142019
@Pubby I don’t have an associative binary operation either.
 
@ScottW I have a picture which says "don't believe ScottW's lies"
 
user142019
12:33 AM
I’m Radek S.
 
user142019
I wasn’t.
 
"Animate the algorithm reading and drawing the program state stack" really does sound like technobabble straight out of a sci-fi TV show.
 
user142019
I’m ill.
 
user142019
TIL: “blauwaderige yoghurtpomp” is Dutch slang for “penis”.
 
user142019
12:48 AM
“Blue-veined yoghurt pump”. ಠ_ಠ
 
hi
 
user1357851
I wish I have the username user10000
 
;)
 
user142019
At least 9000 is not a prime number. Nor is 1551592.
 
12:54 AM
I had mine changed actually... didn't get it assigned automatically, ha
 
user1357851
which means user1000000 is still available
 
user1357851
maybe
 
user142019
Multiple people can have the same name, you fool.
 
What the fuck?
 
1:09 AM
Dammit, it's Monday.
 
Still Sunday for 4 more hours for me :)
 
@Mysticial Why are you wtfing?
 
0
Q: TBB beginner tutorial?

noneCould someone point out a beginner tutorial on Intel's Thread Building Blocks?I find it kind of confusing.For instance,how do I turn: int CountNegatives(std::vector<bool> input) { int count = 0; for(int i = 0; i< input.size(); i++) { if(!input[i]) count++; } return count; } I ...

 
@Pubby :)
 
^ TBB and 'beginner' in one sentence...
 
1:15 AM
@Mysticial :(
 
Who else absolutely cringes on the thought of living through another work week
 
@sehe That sentence has TBB and beginner in it too!
 
I want next fucking weekend now.
 
Lift + Selenium --> Shittiest/Most absent documentation EVER
(in Scala)
 
Also: counting bits in a vector<bool> is something for bit twiddling hacks, really. Not something done with loops. std::vector<bool> is an antipattern, most of the time. Use std::bitset, if you can — sehe 55 secs ago
 
1:20 AM
Hey guys.
 
Hello husband
(or are you my wife?)
 
<333
What is the "The three-schema architecture" in databases?
 
@Crowz Not heard of it. wouldn't be surprised if it was another data warehousing buzzterm. Like we have 3 schemas: 1 optimized for OLTP, 1 completely denormalized and 1 star schema for OLAP/reporting ?
 
Yeah I got a test in the morning
 
ANSI/X3/SPARC three level architecture, which determined three levels to model data.]] The three-schema approach, or the Three Schema Concept, in software engineering is an approach to building information systems and systems information management from the 1970s. It proposes to use three different views in systems development, in which conceptual modelling is considered to be the key to achieving data integration. Overview The three-schema approach offers three types of schemas with schema techniques based on formal language descriptions: * External schema for user views * Conceptual s...
 
1:25 AM
Got a 100 on the midterm so I just need to get a 50% on this one HAH
 
1. External schema for user views
2. Conceptual schema integrates external schemata
3. Internal schema that defines physical storage structures
I hope that helps
 
-2
A: Function to replace specific letters won't run with void return type

jma127Strings are immutable in C++. That means that they can't be changed (if you want a changeable string, try char[]. Instead of returning void, do return std::replace....

What
 
A blind man walks into a bar. And a table. And a chair.
 
I GET IT
 
@je4d Hey you back :)
@Crowz Gratz
 
1:35 AM
Here's a thought I had: he said we can have a one page cheat sheet, and he will only use databases in the book
 
@sehe up late eh?
 
Can't I just copy every database in the book on my cheat sheet in every normal form?
 
@sehe just dropped by because I saw your edit :P
 
@je4d always
@je4d I edited?
 
@sehe you edited the question, at least according to my browser
 
1:37 AM
@je4d Oh remember now. That was gem, really: stackoverflow.com/revisions/…
 
user1357851
@Zoidberg'-- sweet, maybe I can steal your name and avatar and pretend to be you and no one would notice?
 
@je4d Routine editing :) I forget it as soon as I hit enter
 
@sehe wow that source is ugly
 
Funny as hell. I suppose he has 'space' remapped to 'tab' on his keyboard
 
@sehe btw I've been writing up my boost.intrusive project i mentioned before - you mind taking a look before i hit publish on it?
 
1:40 AM
@je4d I'd like to have a look. Just don't wait before publishing it since I can't guarantee time to spend on it
 
@sehe sure, no problem.. i'll drop the link via email
 
2:04 AM
I just got my first gold badge
dat fanatic
 
2:17 AM
I'm lame.
 
2:31 AM
@Crowz Terribly.
 
Yeeeah.
I gotta make this cheatsheet
 
DONE, I am fucking DONE. So many hours spent on this assignment and it is done!
 
What was it?
 
^ The whole point.
 
user406009
Lol, just watched Skyfall. The "hacking" scene was like "He used polymorphism to protect his code".
 
2:36 AM
@Crowz Web assignment. Had to do a few relatively simple things but with an obscure framework. And then do tests in an even more obscure one. I was about to shoot myself.
 
@Borgleader Sounds super lame
 
user406009
Sorta sad that Hollywood still hasn't gone past youtube.com/watch?v=hkDD03yeLnU.
 
@Lalaland Yeah, I think that's the thing I disliked the most about Skyfall.
 
Well the tech is cool, but OH MY GOD DOCUMENTATION PUH-LEASE
@Lalaland rofl wat
 
> "I'll create a GUI interface using Visual Basic, see if I can track an IP Address."
> *Goes to the bathroom to snort coke*
 
2:37 AM
and once again im reminded of two idiots one keyboard: youtube.com/watch?v=u8qgehH3kEQ
(that is litterally the google search i use to find this video)
 
@Borgleader Oh damn.
 
user406009
@EtiennedeMartel It almost felt like the script writer just looked in the index of a programming textbook and starting randomly taking words.
 
@Lalaland But, yeah, I don't get this "need" to put technobabble is stories.
 
user1357851
lol funny hollywood is not all that far from silicon valley - just 8 hours drive
 
I mean, if you can't get the lingo right, don't bother.
And if you really want to sound "computery", just use the right terms, the average viewer won't understand anyway, and isn't that the whole purpose of technobabble?
 
user406009
2:41 AM
Well at least there were guns. And explosions. And women.
 
If you put dialogue whose sole purpose is to confuse the viewer, why go out of your way to put random crap in there?
 
user1357851
@Lalaland woah they have women, who would have thought :p
 
Don't tell me they lacked the budget to hire an itsec consultant, damn it.
 
@EtiennedeMartel You'd think it wouldn't be all that hard (or expensive) to find some high school kid who at least knew a little programming to give them a little guidance.
 
user1357851
there is a niche market, I'll be the first to create: Entertainment IT consulting
 
2:43 AM
@JerryCoffin According to WP, Skyfall had a budget between 150 and 200 millions. You'd think it wouldn't be hard to do, indeed.
The only explanation is this: They just didn't care.
 
user1357851
Maybe they did ask, but don't quite understand the answer
 
@Borgleader > It might calm your mind to know that one of the writers of the show said in an interview that they do these ridiculous scenes on purpose and it's basically a game between the writers always trying to one-up each other with more ridiculous computer scenes.
 
@sehe Oh good lord, I hope so.
 
user406009
Just imagine all of the people scared away from learning more about computers from these stupid scenes ...
 
user406009
I really need to double-check whatever I write before pressing enter :(
 
JTA
3:08 AM
Does anyone know what you call that fake language Microsoft typically uses for filler example text at times? If so, are there libraries available to produce this?
 
user406009
In publishing and graphic design, lorem ipsum Even though "lorem ipsum" may arouse curiosity because of its resemblance to classical Latin, it is not intended to have meaning. If text is comprehensible in a document, people tend to focus on the textual content rather than upon overall presentation. Therefore publishers use lorem ipsum when displaying a typeface or design elements and page layout in order to direct the focus to the publication style and not the meaning of the text. In spite of its basis in Latin, the use of lorem ipsum is often referred to as greeking, from the phrase ...
 
user406009
Just a random guess.
 
JTA
Great, thanks
 
3:26 AM
Hello, Is there a way through templates to inherit from all types in a given template parameter that is a tuple?
say: template <typename Arg> class InheritAll {};
and when I usa InheritAll<<std::tuple<ClassA, ClassB, ClassC>>, I want InheritAll to have 3 base classes.
 
This might work:
template<typename... T>
struct foo<std::tuple<T...>> : T... {};
 
user1357851
circular pointers, good or bad
 
@Pubby does that recurse?
 
user1357851
person -> counts
 
user1357851
count -> person
 
3:36 AM
@melak47 No
 
@Pubby oh, right, inherit from T...? does that work? I'm too tired for templates it appears :o
 
@Telkitty If you can keep them behind a non-circular interface then they're not terrible
@melak47 ideone.com/R5j4qx says yes
 
Pubby, works! :)
 
user406009
Wouldn't the main issue with circular pointers be which one outlives which? Just make one the "owner" (with either unique_ptr or shared_ptr) and one not owning (with naked pointer or weak_ptr respectively).
 
@KarimAgha You can edit your own messages, by clicking the down arrow and then the edit link
 
3:43 AM
Of course.
 
@Lalaland Neither owning is fine too. Such as in doubly-linked nodes.
 
@Pubby, ideone.com/8pc3xm, compiles and works correctly, just slows down the compiler as fuck ;)
it takes like 4 or 5 seconds longer to compile.
(I'm using a custom Collection<...> variadic type in this example, because I'm running MSVC and it's tuple is still using std::_Nil and it fails to inherit from std::_Nil)
 
@Borgleader It's up arrow isn't it.
 
Xeo
4:03 AM
@Rapptz I think he meant the small arrow to the left of the message
 
Up arrow more superior!
 
Anyone here good with math?
driving myself insane over PE, need help w/a problem
 
PE? Packet Editor?
Premature Ejaculation?
 
haha XD
project euler
 
Oh. Which problem?
 
4:11 AM
new one, 402
having a HELL of a time finding a fast way to calculate S(N)
about ready to shoot myself in the face
 
Oh wow 401 is easy. 402 looks easy too
 
yeah, it was a quick one
402 is not easy :<
it is agonizing
 
The sum is bad-ish, I guess.
 
S(N) is already bad enough
using fib(1234567890123) as a parameter, plus all the rest
is disgusting
i mean 1,234,567,890,123 is like over a trillion. making a trillion iterations is no easy feat and i doubt it's what is supposed to be done
 
That'd overflow in C++.
I always hated how we don't have a BigInt library.
 
4:16 AM
im using python for this, no overflow
but any idea for S(N)?
 
4:29 AM
@Rapptz I'm pretty sure the arrow at the left of the message box is pointing down not up...
Is it just me that gets bored by project euler? For some reason I can't get myself to code "meaningless" puzzles
 
the new one is a doozy
it's quite hard
 
user406009
Google's Code Jam tends to be much more fun.
 
code jam is fun as well
S(N) is a bitch to solve for though, i can't figure out any good way to do it
no patterns anywhere
 
user406009
Do you have a solution for M(N)?
 
somewhat, yes
 
user406009
4:35 AM
Sorry, M(a,b,c)
 
it's not closed form but it works
def M(a,b,c):
    m=1+a+b+c
    while 1:
        for n in range(1,m+1):
            s=(n**4+a*n**3+b*n**2+c*n)%m
            if s!=0:break
        if s==0: return m
        m=s
 
@Borgleader Press up arrow
It edits your previous message!
 
@Rapptz Oh yeah sure, but I was talking about the UI arrow (which works all the time, up arrow only works if your message is last in the list afaik)
 
even with a good M(a,b,c) function though the problem is finding a good way to calculate S(N) without needing to cycle through every single a,b,c combination
 
@Borgleader No -- up-arrow works when other messages show after yours. If you post two quickly enough, pressing up-arrow twice (or more) will let you edit your own messages previous to the most recent -- but if you press any other key between the up-arrows, it'll switch to navigating the current message instead of moving between messages.
 
4:48 AM
The time window for editing post is two minutes, just like comments.
 
> [...] The problem seems to be that nobody involved with the C++ standard has the experience and the desire to standardize a suitable library! – Dietmar Kühl
Welp.
 
Anyone else looking at the PE problem or am I blowing smoke in here, lol
 
@JohnSmith I glanced at it, but only long enough to decide I wasn't interested.
 
@R.MartinhoFernandes I am distressed by comment quoted above by Dietmar.
 
@LucDanton So join the committee! Seriously, I think it largely comes back to one thing: most of the people on the committee are experts in language and compiler design, not internationalization. Worse, I'd almost bet that internationalization is an area where it's particularly difficult to form a consensus, making it hard to do much about it in the committee.
 
4:58 AM
@JerryCoffin I don't think any less of the SC for it. I'm worried that the current situation might be 'improved' by well-meaning people (from the SC or not).
 
@LucDanton Worry is probably inevitable and (unfortunately) fully justified. Probably the best (though admittedly non-trivial) way to prevent problems is write and submit a paper advocating what you think should be done (then others who disagree can think of you as one of those well meaning people who are trying to 'improve' it).
 
Well, I have been looking at Ogonek for the few past minutes.
 
Is there an easy way to find out if they're ever having meetings in your area? I'm not sure how up to date this is.
 
@LucDanton I've spent a bit of time looking at it as well -- I think it might be a decent candidate for an addition. As a rule, rather than a huge library that tries to do everything right, they're likely to prefer one that's small and simple and doesn't do anything that's clearly wrong.
 
@JerryCoffin Is it that simple? I can imagine comments being raised over a library addition for Unicode and Unicode only. Boost.Locale illustrates more what's in the spirit of e.g. locales. Not that I can imagine it being an addition.
 
5:13 AM
@LucDanton I don't think it's finished enough to submit as it stands right now (or at least as it stood when I looked). As to whether a finished version would be accepted as-is, or they'd want to add a lot more, I'm uncertain. I think they're fairly aware that things like locales have been something of a failure, so they might be amenable to it, but I have a hard time being at all sure.
 
user1357851
5:25 AM
iphone app is on app store, android on google play. What's windows phone app on?
 
user1357851
window phone store?
 
user1357851
window phone app+game store?
 
@Telkitty I was wondering the same thing too.. On W8 it's "Windows Store", but on the phone it looks like they're calling it the "app+game store". Not sure if that's just what they're calling it online though
 
user1357851
I think I am using Windows Store
 
user1357851
after spending whole 2 minutes googling
 
5:36 AM
Only microsoft..
 
i have a really weird problem with ifstream.read() anyone care to help?
 
@Portaljacker Maybe -- if I find it interesting.
 
ok, so i have a while(file.read(data,1016*sizeof(char))) loop
for sending packets
so i read it in chunks
i put a breakpoint at the line after that
and it shows the values of data as 0's
 
Are you sure the file opened correctly (and contains non-zero data)?
 
oh god, i think i figured it out >_<
i reversed the packet writing
but now i get more issues
i have no clue what happened, it worked perfectly
i did nothing
and it fails
 
5:51 AM
@Portaljacker If you really didn't change anything in this code, but its behavior has changed, then you probably have some undefined behavior in some other code.
 
@Pubby Wut.
 
it's being weird, it's saying i have a memory access violation, i'm just reading a file
hmm
 
@Portaljacker The problem isn't the file you're reading, the problem is what you're reading into.
 
?
what is the problem exactly?
i'm writing 1016 bytes of data into a 1016 byte container
the containter being a char array of size 1016
*container
@EtiennedeMartel ?
 
6:01 AM
@Portaljacker How is data declared?
And initialized.
 
char data[1016] and memset 1016 bytes of it to 0
i just looked at our fake router that tracks packets
it breaks at the 20th or so run of the read
 
Wait, are you sure it's that line that's segfaulting?
 
The read call.
 
i'm not sure
it breaks into other code
it's on the 20th read
 
6:04 AM
Hmm.
 
the file is 113kb
so it's near the beginning
 
My clairvoyance powers tell me that the problem probably has something to do with what you do with data after reading in it.
 
i do sprintf(packet.message,data)
to put it into the packet
 
Erm, that's not how sprintf  works.
 
6:08 AM
sprintf assumes the second parameter (the format) is null terminated.
My guess? data isn't.
 
Use memcpy to copy stuff.
sprintf is for formatting.
 
user1357851
memcpy is unsafe?
 
Also, if your packet happens to contain a '%', sprintf will try to treat the next character as a conversion, and attempt to read data from the stack (that you haven't supplied) to convert (e.g., if it happens to contain "%f", sprintf will try to grab a nonexistent double from the stack and write its decimal value to the output.
 
it worked!
 
6:10 AM
@Telkitty Not really. It's unsafe in the sense that you have to make sure the size parameter you pass to it matches the size of the destination buffer.
 
yay!
 
@Telkitty Yes, somewhat. If he's doing this in C++, std::copy is generally a better choice.
 
The core issue is that arrays don't know their size.
 
now if only i could get the acks to work properly :P
they work perfectly with no packet delay or drop
but as soon as anything delays or drops it fails >_<
 
@EtiennedeMartel lookofdisapproval.jpeg
 
6:13 AM
@LucDanton Alright, well, they do, but arrays decay so fast that before you know it, you end up with a pointer.
 
Xeo
Hm. I wonder if it's sensible to have a type_array<Ts...> type whose instantiation is O(N), but actual indexing is O(1).
@LucDanton Opinion on ^?
 
Vidya gaems!
I'm going to kill gigantic antagonistic arthropods.
 
Xeo
Wait, what?
 
I'm not going to play that, but you know
 
user1357851
reminds me of this:
 
user1357851
6:27 AM
 
Xeo
So no opinion on the type_array. Carry on, then. :P
 
6:41 AM
Welp, kicked out. So much for that.
 
7:07 AM
Of course this is more of an amortized O(1). Which is useless because everything is amortized with templates.
 
Xeo
@LucDanton That was my basic idea behind the type_array. Either N overloads and a single Uint<I> argument, or one overload and inheritance. O(N) build-up time and O(1) indexing.
 
It's easy to fix though.
 
Xeo
I was more interested in whether it makes sense to have something like that at all.
 
template</* stuff */> struct make_indexed_list<list<T...>, indices<I...>>: indexed_list<item<I, T>...> {}; with template<typename... Items> struct indexed_list: Items... {};.
Then it's all in pack expansions.
But yeah if we want to substantiate the implicit assumption that pack expansion is preferable to linear instantiation stuff you need to benchmark. You, not me!
Building up indices from a given size is still logarithmic with state-of-the-art though lol.
 
Xeo
@LucDanton Eh, with that you're still O(log N) at best
 
7:14 AM
@Xeo It's not unlikely that in the near future indices get cheap (compiler built-in, language improvement, better generation technique).
 
Xeo
Also, when asking Richard Smith, he always counts the number of instantiated tokens that are introduced, which basically adds N* to anything.
So our O(log N) for the indices is O(N log N) for him if I got him right.
 
Going by instantiation count is compiler-agnostic.
 
7:26 AM
If you can find a way to express item<I, T>... given mismatched indices<I...> and list<T...> sequences then you can use the same big index pack to zip along type and index lol, no need to generate on demand.
I don't there is one way which doesn't require an instantiation inside the pack expansion (which would defeat the point).
 
Xeo
If only they added expansion to the minimum size, huh.
 
Okay, hear me out.
We get an indices_child that inherits from all indices<0, ..., N -1> (incl. indices<>), up to an arbitrary limit.
Then we use again an overload trick to select the right pack, by using some kind of sizeof...(I) == N SFINAE trickery or something.
So as you can see that's constant in the number of parameters in the input list :p
Time for groceries.
 
Xeo
@LucDanton template<unsigned... Is> struct all_indices<seq<Is...>> : GenSeq<Is>...?
 

« first day (765 days earlier)      last day (4200 days later) »