« first day (1930 days earlier)      last day (3036 days later) » 

8:02 PM
Guys
 
user1804599
Guy
 
What do you think it means O(n) bits, here?
I gave up tutoring this guy, so don't worry I'm not stealing your ideas to make money
 
Insertion
 
I'm dum
2
O(n) + O(log(n)) is O(n) right?
 
yep
 
8:08 PM
@Shoe It looks to me like it's basically just saying you can only use storage proportional to the elements that have been inserted, not to the total range of numbers (like the bit-per-value one does).
 
But then why not make it insertion, deletion and member be O(1)?
I mean with a bit vector + an integer you can have all those 4 operations at O(1)
 
> deletetion
 
@Shoe It's basically allowing you to create something about like a std::set (a balanced tree of inserted values).
@Shoe ...but you use storage proportional to the range of inputs, not to the values actually inserted.
 
@JerryCoffin a balanced tree would be O(n) space
It requires O(n) bits
 
hi morwenn <3
 
8:11 PM
@JerryCoffin Which is what is required there
n is the range of the possible input
 
hi shoe
 
@WGhost Hey <3
 
hey scott
 
trees require about O(n) space, where n is the number of elements in the tree.
they don't give a fuck what the range of the input is.
 
exactly
you can't use trees here
 
8:12 PM
trees have leaves :)
but sometimes money and sometimes bees, lotta times fruit
 
I can't remember how to remove nodes from trees . damn :(
 
@Shoe Rereading, you're right--I was thinking they'd defined n as the number of elements stored.
 
shake the tree
stuff falls down
 
Am I the only one thinking that assignment makes no sense?
 
@ProblemSlover Depends on the type of tree. Assuming a binary search tree, removing a leaf node is trivial. If you have to remove a non-leaf node, you find the next smaller (or larger) leaf node, swap the two, then remove the (now out of order) leaf.
 
8:17 PM
@JerryCoffin Thanks Man. Seems Like You have had many times manually to clean up trees :)
 
@Shoe Not sure--it might still make sense. The basic question, how can you add a capability to find Maximum(S) in O(log n) with minimal impact on other operations (i.e., all of them have to stay at least O(log n) or faster).
 
Xeo
Argh, I'm so foodesperate, I'm munching on chicken bits with mayo and pepperoni slices
 
@JerryCoffin By also storing the maximum integer (O(log(n)) space)
 
@Xeo You're eating Mayo? That is true desperation.
 
insertion checks if the current maximum is still the maximum and updates it if not, which is O(1)
wait
deletion is an issue
 
8:19 PM
@Shoe Bingo.
 
right
is this even posssible?
 
Deletion always ruins everything
 
user1804599
@Shoe Bartek also thinks that assignment makes no sense.
 
@Shoe Probably, yes. I'd note that it specifically mentions pointers, so chances of the intended solution using some pointers seems to me to border on an outright certainty.
 
user1804599
Why is 2 << -1 not equivalent to 2 >> 1?
 
8:22 PM
Where
 
user1804599
Python, Go, C++, everywhere
 
@MadameElyse It (or its equivalent) is in at least a few languages. In something like C or C++, programmers generally assume that x << n will translate directly to something like sla x, n, so defining it otherwise tends to be difficult/problematic.
 
C has the excuse of "but teh machines don't implement it consistently"
 
shifts are binary operations
 
user1804599
In Python it results in a runtime error and in Go it results in a compile-time error.
 
8:24 PM
I don't see why they would act any way other than treating each operand as just a blob of bits
 
The right operand is a number though
 
@Xeo I am tempted to wonder whether you have some sort of drug or gambling problem, or something like that though. Just a few days ago you were talking about having unexpectedly large amounts of money, yet now you're reduced to eating mayo. There's clearly something wrong with this picture...
 
Xeo
@JerryCoffin I just forgot to eat, then it got to 8:30pm, and now I don't have time to make a nice meal
Also, mayo is delicious and filling
The money's still there
Guess I'll nom the rest of my calories through cream. mmmm, cream.
 
user1804599
@Puppy The RHS is an integer, not a blob of bits.
 
@Xeo Ah, so the problem is actually psychiatric, not monetary.
 
8:27 PM
@WGhost hey :)
 
Xeo
@JerryCoffin Does japanese mayo count as a drug? Cuz it's delicious
 
@ThePhD grats m8
 
Are you coming to the Uncon @Xeo?
 
@TonyTheLion Hmm....since everybody else seems remiss in posting Fox News updates, I guess now it's my turn.
 
Xeo
@TonyTheLion Planning to, ye
 
8:29 PM
@JerryCoffin That is a nice fox :)
@Xeo Cool :)
Can't wait to meet some more loungers
 
0
Q: Is it possible to have these characteristics in a data structure?

ShoeI was tutoring a student that came up with this assignment. It basically requires a data structure with the following characteristics: it holds a set of integers in {1, 2, ..., n} n is power of 2 O(log(n)) insertion, deletion and maximum O(1) for determining whether an element is in the set it...

here if you know the solution
free rep
 
@Rapptz What've you been up to lately, yo?
 
> O(1) for determining whether an element is in the set
I don't know how you would achieve that with the other requirements
 
Is there a way I can check at runtime if a function overload exists? Or compile time would probably work too...
 
actually I think I have an idea
 
8:35 PM
Isn't CompSci like a better place for that question?
 
there's a computer science stackexchange site now?
 
auto foo(int);
constexpr auto foo_int_exists = std::overload_exists<foo, int>::value;
constexpr auto foo_double_exists = std::overload_exists<foo, double>::value;
//foo_int_exists should be true while foo_double_exists should be false
 
oh boy
 
Xeo
@caps that's.. the normal way of checking if a function exists, since you have to supply arguments to check
142
A: Is it possible to write a C++ template to check for a function's existence?

XeoThis question is old, but with C++11 we got a new way to check for a functions existence (or existence of any non-type member, really), relying on SFINAE again: template<class T> auto serialize_imp(std::ostream& os, T const& obj, int) -> decltype(os << obj, void()) { os << obj; } template<...

 
Ell
8:38 PM
I'm going to set up an XMPP server on digital ocean
 
Xeo
@TonyTheLion lolz. Checking for flights, I could book each trip for 40bucks ... and get free cancellation until 30min before the flight for just 240bucks!
 
@Xeo wait wut
 
@Rapptz Discord... WAIT, the Discord Chat/Voice server thing?!
 
yes
 
Ell
8:39 PM
not sure whether to enable public ipv6
 
Suddenly connects all the dots.
Rapptz pls stop being so badass.
 
Xeo
@TonyTheLion :D
 
they actually gave me a job offer
didn't take it though
 
@Xeo Dang, I was hoping for something simpler / provided by STL or Boost.
 
Xeo
You can't pass function names anywhere, so nah
 
8:40 PM
I mean, LoC-wise that's not bad, but it's dense.
 
Xeo
you have to set it up for every function name :/
 
@Xeo crickey
 
Xeo
Seems so stupid to even offer that
 
Xeo
"Yeah, here, have 240 bucks so I can cancel my 60 bucks ticket and get the money back!"
 
8:41 PM
because no one in their right might would pay that money just to cancel a 60 bucks ticket
 
Xeo
But yeah, seems like I can get to Wroclaw and back for under a hundred bucks
 
@Xeo I have to figure out my flight plans. Currently, it'll be much cheaper for me to fly to somewhere like the UK or France, and then figure out a way to walk/bus to Wroclaw.
 
@Xeo pretty good
 
Oh right.
 
I'm betting my trip will be more expensive
 
8:42 PM
Another Uncon.
In Europe.
 
Rapptz, come!
 
You know I can't make 'em.
The plane rides are >$1k
 
ah not bad, 77GBP, for return flight
 
Not if you fly to France and then do the bus/train thing!
 
8:43 PM
Flying to France is hella expensive here
 
@Xeo an additional 238€ and you get to cancel the flight...without charge. How much does not showing up for you flight cost? :/
 
Can I not do... std::is_function<decltype(foo), int>::value?
 
@Rapptz Yea I would come there, but no one else from EU would spend the money to go there
 
@caps No, that won't do
 
Write a is_callable trait.
 
8:44 PM
@Rapptz result_of?
 
@Rapptz @xeo was just implying that's not possible.
 
@ThePhD If you come to the UK, we can travel to Wroclaw together
 
It's not possible for overloading checking
But you looked like you had an X/Y problem.
 
@TonyTheLion But you've gotta fly, and I don't want to go with someone who will drive a lot of the way because I cannot drive and thus not share the road with 'em.
 
Going to the UK is considerably more cheaper than going to France I think.
 
8:45 PM
@caps That would require treating the overload set as a first-class entity, which isn't
 
>Tourists.
 
user1804599
I don't think you can write an is_callable trait.
 
@ThePhD I would fly, and rent a car there
because driving will take too long
 
user1804599
A call operator template may be guarded by an ever-failing enable_if.
 
Ell
fuck
I'm retarded
3
 
8:46 PM
You could recursively take the bits you are considering, split them in two and check if the right part is 0, if so, then the maximum is on the left, if not then the maximum is on the right.... and so on
 
@Rapptz 873 cheapest round trip from Boston, MA to UK, London
 
Ell
I bought train tickets for what my brain told me was 16:05 but was actually 14:05
 
Which would make finding the maximum a O(log(n)) operation
 
@MadameElyse don't forget possible conversion to function pointer :D
 
And that's without looking for deals.
 
user1804599
Just program in Go.
 
@Shoe but aren't the elements in a tree ordered in some kind of a way?
 
user1804599
It's more fun.
 
@Ell oh ell oh ell
 
Sss.... fuck.
 
8:48 PM
@TonyTheLion no tree
just a bit vector
 
The prices for the france flights increased by 50 dollars
 
you can't have a tree
 
@Shoe oh. I'm not familiar with that
@Shoe but I want a tree bby <3
 
no
 
Guess I really would have to boat/bus/train/ski to Wroclaw after getting in England...
 
8:49 PM
You guys always pick the weirdest places.
 
@Rapptz What place in EU would you come to?
inb4 none
 
I'm having a meet up with a different group of friends in Vancouver in late June.
 
14 hours to drive.
 
@Rapptz y u no std::result_of or std::invoke?
 
inb4 italy
 
Ell
8:50 PM
@Rapptz it's cheap as chips
also the plurality of the lounge is polish
 
Are they now
 
Hey, quick question. What's the fastest and simplest way (doesnt have to be super safe) to convert strings to wstrings? I found a few things online, but they all seemed overly complicated
 
I only know 3 poles.
 
The good news is, the trip is mostly straight East.
We'd need... 2, 3 days?
To land in London and then just start trekking it.
 
You really like walking, don't you?
 
8:51 PM
@TonyTheLion iunno tbh
 
@TonyTheLion I meant using busses and cars and shit.
 
"iunno tbh" is not a place
 
Well, not cars, because I don't want someone to drive me since I can't drive. I'd have to figure out trains and shit.
 
@ThePhD return flight from London to Wroclaw comes to 77GBP
trains will be more expensive
 
Ell
yes
they will be
 
8:52 PM
flying from europe to europe is so cheap
 
So I'd have to have a double flight....
 
flying from US to US is never that cheap
man you guys are lucky
 
Ell
it would be cool if we could all be on the same flight
 
I did that before
 
@Ell oh man, the coordination required for that
 
8:53 PM
@melak47 they used to suck and not exist, respectively—not to mention they do different things
 
it doesn't require that much coordination
 
Xeo
@Rapptz flying from europe to europe is apparently cheaper than a train ticket in GB
 
That means total round trip would be around 220 USD + 873 USD = 1093 USD, without first going deal hunting.
 
Ell
@TonyTheLion haha
 
unless one person books the flight for all people involved
 
8:53 PM
@Xeo Well, it's train tickets to cross 3/4 countries.
 
Ell
@TonyTheLion also there is the issue that I'm from the midlands :V
so getting to london will cost
but that's fine really
 
you just need to tell your flight number
 
Xeo
@ThePhD this is what I meant
 
@LucDanton fine, you can call the trait "is_invokable" :p
 
8:54 PM
most flights are never full ASAP
 
as soon as possible?
 
Ell
actually that'd cost me £40 or so
 
@Shoe yeah
 
@melak47 different in that they don’t compute a yes/no answer :|
 
@Ell I thought you were in Bristol?
 
8:56 PM
I think of all Euro countries flying US to UK is the cheapest.
 
@TonyTheLion ergh, what a shit hole :P
 
Ell
@TonyTheLion I am now, but after uni finished I'll be at home
 
My parents did US to Italy in like October 2015 and it cost >$1k
 
@thecoshman heheh
 
@Rapptz Seems to be the case, yeah.
 
8:56 PM
@LucDanton well...use it in a void_t or whatever? :)
 
Ell
@Rapptz oh shit
why is it so expensive?
 
if @Rapptz is coming to uk, let me know, I will too :D
 
Maybe Spain is cheaper?
 
Fucking tourists man.
 
@Ell Its not a common route
 
8:57 PM
HAAAAAH
 
London is a common route for UK -> US traffic
 
@Shoe Binary search?
 
1K straight to go to Spain
 
@Puppy ?
 
47 rep in one day
 
8:57 PM
Fuuuuck that.
 
see
 
did you know that there is 7 direct flights from London Heathrow to Los Angeles per day
 
>$1k every time
it's insane
;_;
 
@Shoe Never mind.
 
user1804599
I wish I were as smart and experienced as Rob Pike.
 
8:57 PM
do you know what $1k gets you
 
@Ethan you can try having a look at std::codevt :D
 
@Rapptz its not that bad, considering the distance you cross
 
@melak47 at which point there is 0 improvement (and, again, std::invoke didn’t exist then)
 
work it out per mile travelled
 
@Rapptz Infinity Pizzas.
 
Ell
8:58 PM
just swim
 
I wonder how cheap going by boat is
lmao
 
Well, it's gonna be 1K to get to Wroclaw unless I a train that goes London -> Poland and walk the difference.
 
I doubt it would be cheaper than the flight
 
Me too
 
just wait until continental drift brings everything back together again
 
Ell
8:58 PM
@ThePhD how much is train to uk?
 
@LucDanton ???
 
@Rapptz one hell of a fuck
 
How is it not an improvement to not have to write it all yourself? :)
 
This is why I tell everyone I know that teleportation would be the best super power.
No one can tell me otherwise.
 
@melak47 over what the code looks like right now
 
8:59 PM
wtb teleporting
 
@ThePhD To be honest, its going to be a nightmare by train
 
we could have impromptu uncons
how cool would that be etc
 
Seriously, months later I'm still stuck with a bubble sort.
 
@Ell Nobody wants Americans to visit them
 
user406009
@Rapptz Time control would be the best superpower.
 

« first day (1930 days earlier)      last day (3036 days later) »