« first day (1044 days earlier)      last day (3907 days later) » 

8:01 AM
I just overhauled my entire dictionary class.
It's probably a piece of shit now. :3c
 
"A beginners guide that will make you feel smart" -- Nice
 
> It seems that WebSockets is a new feature for IIS 8.0, it cannot support earlier versions of IIS.
I keep discovering new exciting reasons why IIS is a piece of shit.
 
@ThePhD Why did you write your own dictionary?
 
@FredOverflow I wanted a dictionary class that internally used an open-addressing scheme.
Rather than the bucket-based list-based version of the std::
It's an exercise for fun. :3c
 
8:11 AM
How do you resolve collisions?
 
Using hopscotch hashing.
Hopscotch hashing is a scheme in computer programming for resolving hash collisions of values of hash functions in a table using open addressing. It is also well suited for implementing a concurrent hash table. Hopscotch hashing was introduced by Maurice Herlihy, Nir Shavit and Moran Tzafrir in 2008. The name is derived from the sequence of hops that characterize the table's insertion algorithm. The algorithm uses a single array of n buckets. For each bucket, its neighborhood is a small collection of nearby consecutive buckets (i.e. one with close indexes to the original hashed bucket). ...
 
Oh, it was only invented 5 years ago. Interesting :)
 
Yeah. I implemented it... 2, 3 years ago?
When it was still sort-of fresh.
I don't know if anything tops it right now, though.
I did a lot of research on hash algorithms, internal hash implementations, and hashing styles (chained v. open addressing, variants of that, etc.)
 
As I remember, open addressing and removal of elements don't play nicely together. When I last implemented an open addressing scheme, I needed tombstones for the removed elements.
 
I ended up picking MurmurHash / FowlerNoVoll1a for the hashing, Hopscotch Hashing for Collision Resolution and Open-Addressing for the style.
Turns out the FowlerNoVoll wasn't too bad of a pick: VC++'s STL uses it too. :D (For strings, IIRC)
@FredOverflow They don't? I was under the impression it worked nicely.
Albeit, I call destroy / the destructor manually on elements, but...
Shrugs.
@FredOverflow What is Tombstoning?
 
8:18 AM
4
A: search using hashing

nneonneoLinear probing will look for an element until it hits an empty hash bucket. In this case, it will examine 8, 9, 0, 1 and 2; at 2 it will stop because the bucket is empty. Note that deletion is handled by replacing a bucket with a special "tombstone" value which marks the element as deleted but a...

If you insert elements A, B and C with the same hash and then remove B, will C still be found? Have you written no test case covering this scenario? :)
 
I have metadata that allows me to avoid this case entirely.
Namely, 2 integers
One is the hash value, the other is the hop value
If I wanted to be extra greedy, I could chop the hash value (because it's really not THAT needed)
Hop can tell if the block is empty or not because the first bit ( hop & 1 ) tells whether or not its own block has data.
 
What if the lookup requires a hop over an element that you later remove?
When are you sure the element is not in the set? How do you determine when to stop hopping?
 
Hop values are updated upon search. When an element is removed, its data is destroyed ( hop &= ~1; data_allocator.destroy( &table_data_storage[ bucket_address ] ) ). Search will modify the hopping information as it goes. Whenever it doesn't find the value its' looking for, it will either shift elements around or just edit the bits that represent the neighborhood.
 
Okay I think I really need to read up on that 2008 algorithm then :)
 
The hop information for that table will still be valid data, and won't be destroyed ( table_meta_storage[ bucket_address ].hop )
 
8:27 AM
Is it dramatically faster than classical approaches? Does it solve some specific problems?
 
The one time I profiled it (std::unordered_map versus Dictionary with hopscotch hashing for a HashMap<unsigned long long, String> for up to 600,000 elements), it was faster (reaching some 0.5-2 seconds better than the 5-8 sec timing of the std::unordered_map). But I had template-specialized for this one specific case, because I knew what I was working with (the File system, I was indexing an entire goddamn harddrive).
Plus, my class doesn't support all the invariants std::unordered_map does, so I can't really make a good call. :c
Or at least, I don't know if it does.
From other's benchmarks and my own not-really-benchmarks-but-just-daily-use, it Hopscotch Hashing is pretty resilient to load factor and can scale pretty well, despite having to call Resize if you go over the size of the internal open-addressed array.
It inserts better, and has fairly efficient lookup because the search pattern is deterministic and (if all else fails) falls back on a linear search of the neighborhood, but only of the neighborhood (and not the whole hashtable).
As with all open-address schemes (or most) it obviously gets even faster the larger the data set you're working with.
Or rather, it degrades at a rate far less than most other hash table schemes, which makes it useful.
It's supposed to be even more kick-ass for concurrent usage, but I haven't made a concurrent hash map out of hte algorithm (Hopscotch Hashing, that is)
 
I just noticed the importer script is one method, full of inner functions.
Which have inner functions.
:suicide:
 
Importer script for what?
 
Liferay -> Drupal database converter.
One is a shitty CMS, and the other one is too.
 
8:43 AM
CMS?
 
A Content Management System (CMS) is a computer program that allows publishing, editing and modifying content as well as maintenance from a central interface. Such systems of content management provide procedures to manage workflow in a collaborative environment. These procedures can be manual steps or an automated cascade. CMSs have been available since the late 1990s. CMSs are often used to run websites containing blogs, news, and shopping. Many corporate and marketing websites use CMSs. CMSs typically aim to avoid the need for hand coding, but may support it for specific elements or en...
 
I got REALLY distracted writing that overhaul fo dictionary, though
 
Where were you living
 
I really need to get back to my reflector. ._.
Oooh.
... I never thought about a CMS.
 
@ThePhD So basically you ripped a second hole in your bottom for a 0.5 seconds advantage? That's hardcore :)
 
8:45 AM
I guess Steam would be considered a bit of a CMS too.
@FredOverflow I didn't know what would happen if I made the changes: I just knew that a std::unordered_map taking such a long time really bit me in the ass.
I was trying to do anything and everything to get a speedup, because waiting that much time before my application actually came alive was.... really shitty.
Since then I scrapped the whole system anyways and now it runs lightning fast because I let the OS do the caching for me and I just let Windows deal with finding ids and shit.
 
@thecoshman @Ell Look! :3
 
I traded a lot of responsiveness and some nice features of the FileSystemWatcher for it, though. =/
@BartekBanachewicz handle<GLuint> <333
 
@ThePhD and you are?
 
Nobody.
 
that's what I thought. I figure you said nothing too.
anyway what counts is that Nicol is looking at OGL+
if he starts to help in this project, I sense amazing future of it
 
8:50 AM
I thought it was called GLDR?
 
that's a different thing
 
Oh. Uh.
Well, okay.
So wait
What's the difference between GLDR and OGL+ ?
 
@ThePhD OGL+ is a project started around 5 years ago by Matus Chochlik. GLDR was started a few months ago by me, Ell and pirate, and we are currently thinking if it's feasible to continue its development. I've talked with Matus and shared a few of our ideas.
No point in having two libraries if you can have one that's better.
 
(And also if someone else can do the dirty work :v)
 
that too
 
8:59 AM
Liferay ~~friendly URLs~~ are so fucking shitty
/some-stuff/-/eo_what_the_fuck/<few random letters>/content/another-slug
You can't come up with this stuff if you're drunk, high and Idontevenknow
 
@CatPlusPlus You forgot .php
 
Liferay is in Java.
 
@CatPlusPlus aww
 
But there's PasswordPolicy, so it's enterprise-ready like nothing else.
 
god, that's not stupid enough
I was reading an article about Disney movies' inspirations.
Apparently the Notre-Dame cathedral was an inspiration for the particular movie. How surprising! (the rest is less obvious)
 
9:04 AM
You don't say
 
@CatPlusPlus it's from JM
anyway 'twas a whole new level of retardness
 
WHY ARE ALL CMSES SHIT
lkcvzkaljadf
 
9:21 AM
IF YOU DO FRIENDLY URLS THAT DONT INCLUDE A GODDAMN ID THEN YOU SHOULD BE SHOT
Ahahaha of course that random letter string doesn't matter for resolving.
 
9:38 AM
Ugh.
One of these again.
0
Q: cin in C++ is much slower than scanf in C?

mzorroI did some algorithm practice today, and found that cin >> int in C++ is much slower than scanf("%d", &int) in C (when the income data is plentiful and rush). Also I found that cout << endl is slower than cout << '\n', but the latter I know is because cout << endl calls cout.flush(). But why cin >>...

heh
> It's, um, slightly embarrassing that the deprecated facility shows so strongly in this side-by-side comparison, but that's life.
 
9:59 AM
I've got a really good problem to solve with sfinae, but I don't want to post a SO question because I can't resist solving it myself first :/.
 
@BartekBanachewicz ... he's looking at GLDR
 
10:22 AM
bah, I'm pretty sure it's impossible without decltype
I guess I'll save that problem for when I start using C++11 in production
 
Mmmmm.
It is time.
To build a non-virtual Stream interface.
Or, mostly nonvirtual anyways.
 
cowboy_stream?
 
Meh. Power utility is messing me about. I've been rudely excommunicated twice already this morning:(
 
> This book is for anyone who wants to bring back souvenirs from their Internet travels.
lol
 
10:43 AM
@melak47 Sounds like a grade A idea. :D
 
@ThePhD it'll support input/output of any type, using cowboy_cast? :p
 
Exactly.
 
oh no, Ballmer is going to retire! ;_;
 
No more tongue sticking out!
 
who's going to care about the developers developers developers developers now?
 
10:57 AM
Developers Developers Developers Developers
Retirement Retirement Retirement Retirement
 
FUCK LIFERAY FUCK LIFERAY
 
@Mysticial Fill in the blank is an off topic close reason.
 
@CatPlusPlus Do you need a hug?
 
lh;svhdfvsdhfv
 
It must be really bad for you to be stressed out on a Sunday
 
user1804599
 
user1804599
Stop talking Danish.
 
@ThePhD Cat++ needs a delivery person instead
 
@CatPlusPlus liferay.com ?
Those motherfuckers?
 
Yep
I don't get how the URL mapping works.
 
> Liferay Portal is an enterprise web platform for building business solutions that deliver immediate results and long-term value.
 
11:13 AM
It doesn't follow any logic, except for the opium-fuelled one of its creators.
 
.... WHAT DOES THAT EVEN MEAN. IS THAT REALLY ENGLISH?
 
ararawerawerawreawerawerawerawerawerawe they have Apache rewrites there configured differently, too.
Though that's client's fault.
But that doesn't solve the ambiguity.
 
> Rapid innovation with customer-contributed sponsored development
customer-constributed... sponsored development?
What the holy tits.
 
It's all enterprise-grade marketing bullshit.
 
So, what does it actually manage to do?
 
11:22 AM
Someone had a question where they were multiplying all numbers in their string. Out of the four answers and one comment, there was no mention of std::accumulate.
 
OH OF COURSE THERE CAN BE -1 AT THE END WHICH IS NOT IN THE DATABASE BUT THERE NEVERTHELESS FOR SOME FUCKING REASON
WHY NOT
 
@CatPlusPlus I sure hope my coop goes better than this.
 
What coop
 
I think he means co-op
 
@CatPlusPlus University over the next five years, and yeah, I should've hyphenated it.
 
11:25 AM
rather than an enclosure for chickens
 
This isn't uni
 
@LightnessRacesinOrbit I only realized it looked like that after I said it.
 
The other C++ room: Tomalak & 17 newblets
 
11:49 AM
@CatPlusPlus How's the server thing going?
 
user1804599
Not.
 
I think I could use a windows hosting
 
user1804599
Gentoo.
 
What
 
user1804599
Never use Windows. Only use Gentoo.
 
11:51 AM
Gentoo is useless
 
user1804599
Gentoo is not useless.
 
12:20 PM
@kbok We've got the offer nailed down and now just waiting for the project to move further along.
I'll probably take the next week off and do some coding finally.
And we'll call ~~~a meeting~~~
 
@CatPlusPlus Will there be beer and pizza?
 
user1804599
@StackedCrooked I'm implementing your idea of KV store with only get, put and cas.
 
12:57 PM
@ScottW gud gud, u?
 
1:30 PM
God Python 2 is so fucking broken.
 
Wait a minute...
Why didn't they just make it so std::vector<int> v{5}; uses the size constructor and std::vector<int> v({5}); or std::vector<int> v{{5}}; uses list-initialization?
 
It really wouldn't help anything.
 
If I know the distance of a line (and the angle), is x = acos(angle)*distance? Apparently I haven't done this for a while.
 
At least uniform initialization would be more... uniform.
@Pawnguy7 You don't do arc* on angles, but yeah, d*cos(theta)
A diagram might help.
 
I made one, actually :D
An ugly one, though.
 
1:39 PM
> MemoryError
 
Oh wait, arc is to find the angle, I don't know what I am doing :D. Yes, I will do as you suggested.
 
@Pawnguy7 You should use the upper right quadrant. Angles start on the positive x-axis and go counter-clockwise.
 
In terms of diagrams?
 
@Pawnguy7 Yeah, or that's always what was implied when I was taught anyway.
 
I was taught that as well. I guess I drew it the way I expected the angles to be. I am making lightning, and thus, it will go down. I don't need to alter the output, do I? If memory serves, that was just with atan, and there is atan2 to fix it.
 
1:48 PM
Huh.
There's a std::hypot function.
Never knew that.
 
@Borgleader Finally I'm up to 100% on the first Algorithms programming assignment :)
 
Yay for persistence.
 
Persistence as in data bases or persistence as in functional programming?
 
@chris This is exactly what bit me yesterday. Well, now I know.
 
@chris I think it's simpler if the x{y} form always uses the constructor taking an initializer list (if it exists, of course).
 
2:00 PM
@FredOverflow It's not very intuitive IMO.
 
 
I'm not gonna argue about IMOs ;)
 
@FredOverflow :P
 
@CatPlusPlus k
 
Generics and when the initializer-list constructor can't take what you pass in (causing it to look for another) are two examples that could be more confusing.
 
2:06 PM
@FredOverflow Gratz. I'm the one stuck at 87% xD
 
@Borgleader Problems with backwash? :)
 
Yeah =/
 
There are several posts in the forum that hint at an easy solution. Some think it's brilliant, some think it's a hack. I haven't decided yet.
 
2:26 PM
What a nice title.
give me a c programme for this or atleast algorithm
@chris thank you, downloaded "Thinking in C++". Great to find it free and in my local russian leng) — user2714617 47 secs ago
All I said was to use one on the list, promise! :p
 
TIC is free.
 
Oh, I haven't read it.
 
user1804599
I'm wondering.
 
user1804599
What HTTP verb would be best for CAS in a REST service for a key-value store?
 
POST.
 
2:35 PM
I have a template masturbation challenge: stackoverflow.com/questions/18429919/…
 
user1804599
How about PATCH?
 
Any guesses?
 
@not-rightfold You're replacing entire thing, not part of it.
 
user1804599
PUT?
 
2:37 PM
Maybe PUT, but eh.
I treat POST and PUT the same.
 
user1804599
How about CAS. :P
 
The spec outlines a difference between POST and PUT and I still see same thing done twice.
Fuck PUT.
Maybe WebDAV has something. :v
 
user1804599
HTTP allows custom methods. :P
 
user1804599
I'll like at Web*ugh*DAV.
 
user1804599
It has LOCK and UNLOCK. :V
 
2:57 PM
It's basically SVN.
 
3:08 PM
@not-rightfold Is that a duck face emoticon?
 
wow
well, that final was incredibly disappointing.
 
JBL
3:29 PM
@DeadMG Yeah...
What a one sided stomp..
 
Jaedong: "I'mma build mutas regardless of circumstance!"
 
JBL
That and so many quite "big" mistakes.
Like the speed in game 2.
And the overconfidence in the last one.
 
3:44 PM
@DeadMG link to stream please D:
 
was, it's over.
 
besides
my above quote basically spares you the pain of watching it for yourself
Bomber pwns Jaedong because Jaedong acts like a one-trick-pony and Bomber knows that one trick.
 
He will LOVE to post new questions after this one. Great job guys, the man didnt know something so he simply asked, it dont see nothing wrong about that. But yeah it is easy to say ARE YOU REALLY SERIOUS, when you know the answer. Cheers — Manolescu Sebastian 19 mins ago
inb4 another meta post
 
Xeo
Morning
 

« first day (1044 days earlier)      last day (3907 days later) »