« first day (706 days earlier)      last day (4468 days later) » 

19:00
You need Arma2 and Arma2 Operation Arrowhead. It's like 30$ on steam as a combo. Something like Arma2 Combined Ops or something
Aaaannnnddd it's like a 18 GB download lol
Ok, I can handle that.
I've become a mean son of a bitch.
Thank you for stating the obvious and what has been said about 5 other times here. — Drise 42 mins ago
I feel bad...
Friday night party on Mumble! All Loungers are cordially invited! :) :)
@TonyTheLion Meh, DayZ must play lots.
19:02
@Drise So I can hopefully find a sniper rifle and take the zombies out from a distance?
@TonyTheLion: Mumble is that like Ventrilo/Teamspeak?
@Chimera Yeaaaaaa... No. I just found my first DMR after about 3 months of playing.
Of course, this was my first trip up to the airfield.
@Drise Ok so it's takes a while to build and get equipment... that's cool
@Chimera But I do have a AKS74 Kobra, which is boss.
@Borgleader basically
19:04
Cool cool
@Chimera An hour or so. Bambis usually take a bit to adjust to the controls. They are not exactly intuitive.
@Borgleader loungecpp.sehe.nl
is what you connect to
with Mumble client
@Drise thats not bad
I'll check that later, I'm at school atm and the internet sucks
19:05
watching it now
Kinda gives a good feel for the game, some good advice.
And tells you what bambis are. lol
I like Frankie. He's pretty funny and keeps a good spirit even when shit goes wrong lol
0
Q: Check if a string is available in a bigger string of length 100,000 with about 50,000 test cases

r20rockHow do I check if a string is present in a bigger string of length of 100,000 characters in C++ or Java? I know a method str.find("sub_string"); but it can't handle such a big string in C++. The max execution time is 1 sec. Also the sub strings I need to look for can be 50,000!!! Thanks

close please
same user asked same question again
I know a method str.find("sub_string"); but it can't handle such a big string in C++. The max execution time is 1 sec.
If your computer takes longer than one second to do that for a string only 100000 characters, buy a better computer. >.>
19:11
Like, 100000 characters is only 100kB.
so I googled the tagline
first result:
in Tavern on the Meta on Meta Stack Overflow Chat, 2 mins ago, by Drise
Is there something we can do about this user?
@TonyTheLion That’s even instant in Haskell interpreter, which uses linked lists.
I have a feeling that'll be instant in C++ too.
@daknøk No, the problem is when it comes to searching for abcd in abcabcabcabcabcq
19:18
His computer probably just sucks.
I know. I did that.
Only I used linked lists instead of an array.
And whether you have a list of integers or a list of characters makes no difference.
How is that even instant?
@Drise Not if you use some Boyer-Moore variant.
@JerryCoffin Quick explination?
Instant as in instant to the human eye.
Certainly not even half a second.
19:22
@Drise It starts by building a table of how far each character is from the end of the string. Then it starts by looking at the first spot the end of the needle could land, shift forward according to the table, and continue. (hmmm...lousy explanation. code might be easier).
It takes 23ms for me in Haskell, including I/O.
23ms is about the same as finding the 300000th fibonacci number.
Here's an implementation of Sunday's variant of Boyer-Moore-Horspool I wrote long ago (C, not C++). ideone.com/xNmt0
That's... really confusing @JerryCoffin
19:29
@Drise Of course it’s confusing. It’s like, C.
Okay, maybe it's easiest to start with something more like an example. Let's say we're searching for abcd. We start by looking at the fourth character. If that's anything other than a, b, c or d, we know it's not in our word, so we can skip ahead another four characters, right?
hehe clever
@JerryCoffin We can?
@JerryCoffin That's KMP?
19:34
@Drise as long as you stay on index mod 4 = 0, 4 being the length of the substring, yes, AFAIK.
@VinayakGarg No -- KMP is similar, but this is Boyer-Moore (of which there are quite a few variants).
@daknøk Ok. I'm following.
@Drise Yes -- if the fourth wasn't in our word at all, then the next place the end of the word could land is four later.
Hmm.. need to revise
^ Oh yeah that. :P
@JerryCoffin Can’t you use the first character of the substring?
19:37
because if we had abcqthd, it's impossible for the other 3 to make a 4 char word, right?
Not that it would make any difference, maybe alignment issues or something. I’m not very good at this stuff. :P
String searching becomes veeeeeery interesting once you factor Unicode into the picture. Pretty much the only thing you can easily reason about is when you have a fixed-width character encoding and pre-normalize to some chosen canonical form first. And then you still need to account for collations (you may want to rank different code points equivalent)
@daknøk Nobody is, really. The good news is, you only need to implement once, test a decennium
@sehe Just do it the easy way with two for-loops in that case until you realize it’s too slow. :P
Which then disqualifies the first 4 characters. Ok @JerryCoffin I follow.
@daknøk That would be: before starting.
19:39
Also, variable-width encodings suck. :<
I have enough memoryz.
The next part is what happens if we find a character that is in the word. We want to know how far to shift the word over to get it to match up. That'll be the distance that character is from the end of the word. Then, instead of "shifting" by the length of the word, we shift that amount instead.
I wrote a java program that searches for abcdq in a string of full of abcd (104000 characters long).
Seems like the search takes 5 milliseconds
@JerryCoffin Which is what happens with abcqrbcd
@sehe I meant this. I haven’t tried it, though.
And it sucks.
And I want bacon.
:D
@Drise Exactly..
19:47
@daknøk I have bacon :)
Damn chat
what about it?
@TonyTheLion Dude. Bacon Jerky.
@TonyTheLion Keep crashing
@Drise never tried it
@Drise not for me
@sehe Yeah, Unicode throws several wrenches into the works -- it really only leaves two choices: several levels of tables to do things like mapping from code point to collation, or else just live with everything being dreadfully slow.
19:48
Yes it works! ideone.com/tAjX8
@daknøk Why is it in C?
And why does it print the extra !
@daknøk > runtime error
fail
@TonyTheLion no return statement.
It returns garbage; UB, which happens to be not equal to 0. Hence the runtime error.
why does it print world! instead of world
@TonyTheLion ideone.com/RQPyY
@Drise because the function returns a pointer to a char in the haystack.
19:52
Yea, I finally got that
hehe :P
Stupid C
I could malloc and stuff, but meh. Too lazy and this workz.
this was my substr I wrote a while back liveworkspace.org/code/960e047f7fbcdb64592d9820f5891259
I returned a bool for whatever reason :P
Then call it hassubstr. :P
19:55
yea
should be called that
I return a pointer which can be cast to a Boolean if desired.
And NULL on not found. :P
Or maybe I should use this:
God dammit. Did I get my flagging privileges revoked?
enum Bool {
  False,
  True,
  SubstringNotFound,
};
don't call it bool
because it's not technically a bool anymore
The function would randomly return False or SubstringNotFound if the substring couldn’t be found. :P
19:57
lol
Like PHP’s count function.
Returns the number of elements in var. If var is not an array or an object with implemented Countable interface, 1 will be returned. There is one exception, if var is NULL, 0 will be returned.
0
Q: Binary search in C++

Craig CampbellProgram Sample from compiler #include<iostream> using namespace std; void binarySearch(); int main() { //Called the function in main binarySearch(); system("pause"); return 0; }; //void function for binary Search void binarySearch() { //creating array int...

Narq
DOWNVOTE :D
19:59
@Drise he's new, go easy. I don't downvote unless they have >200 rep, and I always comment before closevoting to explain how to get the question reopened.
@MooingDuck But he didn't even ask a question.
If you click “Ask Question”, and you don’t ask a question, you deserve a downvote even if you’re new.
What is your question? — Code-Guru 5 mins ago
At least 6 others agree
It should be deleted.
@daknøk Maybe not, but at least edited to be smaller and actually have a question. Till then, Narq
Have been here writing a program in c++ which consists of random number generated values which are then binary searched; not seeing successful
Lol, nice title
20:03
@Drise I edited to make it smaller :D
@MooingDuck By 125 characters, I know!
LoveFilm Instant, Y U NO WORK?
Sounds like a porno
it's a website for watching movies
lovefilm.com
@Chimera My email is drise13 with gmail or 2567776660. If/When you get DayZ and want to play, send me an email/text
20:06
@TonyTheLion like, the pirate bay?
@TonyTheLion streaming sites are full of viruses.
@Drise ok great, will do!
@Drise not true
I hate people who edit in "Basically..."
People who edit their own posts to add basically?
Oh I see
Basically I need to find out how to make values output on screen for the success part of my binary search. — Craig Campbell 17 mins ago
He copy-pasted the OP's comment
Still
Edit it right, or don't edit at all is what I was told
The problem with paraphrasing with questions like that one is that there's so little information, that it is hard understand what the OP wants, and your attempt at improving it might change the meaning. But he could've dropped the Basically :)
@Prætorian Yup.
So... anyone up for a Lounge DayZ group?
20:18
@Drise Yes, you.
@daknøk Not much of a group by myself now, am I?
A Dutch girl accidentally invited over 30,000 people to her birthday party, and now there is a chaos in her town.
Maybe you should do the same.
Really?
Loungers have too short average attention span for gaming groups.
how's GW2 Cat?
It's nice.
De mobiele eenheid heeft de jongeren weer teruggedrongen. Ongeveer een kwartier later renden de jongeren opnieuw de Stationsweg in.
Volgens ooggetuigen is het een complete chaos in de wijk. Auto's zijn gesloopt, schuren in tuinen van bewoners werden opengebroken of gesloopt en er is met dranghekken gegooid. Een onbekend aantal mensen zou zijn opgepakt, maar een woordvoerder van de politie Groningen kon dat nog niet bevestigen.
I can't read this
@Drise Google Translate can.
@daknøk Barely. "all gardens with fences thrown and neighbors broken up" Wtf?!
20:23
Well basically, all the people who came to her birthday party are now drunk and they are destroying people’s fences and throwing with barriers.
According to eyewitnesses, it is a complete chaos in the district. Cars are demolished, barns Gardens residents were broken up or demolished, and with fences thrown.
And probably there will be some fire soon. :P
"residents were broken up or demolished"
Lol
lolz
I will translate it.
No need
I'm laughing already as it is
20:26
lol
According to witnesses it’s a complete chaos in the neighborhood. Cars were destroyed, fences in gardens were destroyed and broken down, and they are throwing with barrier fences.
Like, a thousand youngsters, 90% of them drunk, are fucking everything up.
And all because one asshole of a girl forgot to check a checkbox on Facebook. xD
She deserves it, however, her parents don’t.
and they are throwing with barrier fences <-- How could this translate so poorly?
Whatever they call that in English.
Throwing with these things:
No, you keep saying throwing with
Just say "throwing barriers"
No, the barriers are helping them throw.
20:32
Okay, people pick up those things and throw them.
It would be more correct to say I was thowing barriers with daknøk at the drunks
@LucDanton up
Oh, already one death.
I cna't find any news on it
This is why I don't use facebook. Shit happens
@MooingDuck Of course not, it’s in the Netherlands. :)
Oh, they are using fireworks now. :D
20:36
alright, finally found english news iol.co.za/news/back-page/…
40000 people checked “going” on Facebook.
btw, what happened to the puppy? is he really dead or something?
Bunch of morons.
who?
Those morons in Haren.
Drunk rioters.
20:41
@Abyx Dutch
They killed somebody. :<
ah... it's so far away, why care %)
Well, I live in the Netherlands.
just found this in my own code:
for(i=0; i<=rl; i++) { /* @todo: wtf */
@daknøk Who is "they"
20:44
I lol'd
@Drise rioters
@netcoder what is it supposed to do, if anything?
@LordAro: well it's a for loop, so it loops ;-)
20:45
but looking at the code it seems quite unnecessary
you've no idea why you put it there in the first place?
the loop was probably written in an advanced state of drunkenness, the @todo was also probably written in an advanced state of drunkenness (so instead of removing the loop and not be sure about it, I just put a @todo there)
If you write a comment /* @todo: wtf */, you deserve to be confused in the future. Keep your code damn maintainable.
now that I'm not in an advanced state of drunkenness, and I'm sure it's useless, I'll just remove it
@daknøk: see above
Maintainability is the most important thing of code.
20:48
@netcoder then the world collapses
@netcoder then don’t be in an advanced state of drunkenness.
@daknøk: then where's the fun? :P
Oh wait, /*-style comments, so the language is probably one that sucks and not fun at all. Nevermind.
Use Haskell or Python.
@daknøk: It's C
and I use Python sometimes
@netcoder What I said. :)
C sucks by definition.
20:50
not because you can't code it that it sucks ;-)
suckage (if that's even a word, otherwise I'll happily make it one) is relative
I've melted my kit-kats :(
@MooingDuck Have a break.
@MooingDuck Don't leave them in your pocket. No bueno.
20:51
^ fucking tasty
Kinder is German for child
I think
I only used rosetta stone for about a week.
I got bored.
“Kinder” is German for “children”.
Dammit.
20:52
Kind is singular.
Kinder is plural.
But then you would want to use little boy or little girl
be gender specific, no?
I don’t know German that well.
Junge
Mädchen
kleines Mädchen
fucked-up language*
boy, girl, little girl.
20:55
Like, KISS. :P
I wish Guido van Rossum invented English and German.
It's unfortunate. I liked learning German. Too bad I have no incentive now.
He knows how to create languages.
@LordAro Everytime I see your avatar, I think of XKCD
good, you should ;)
20:57
@daknøk and that, dear friends, is why black had guy is awesome
I would do the same.
user image
2
I love the oatmeal
I wish he would produce stuff more regularly.
Me too.
Almost without fail, he makes me laugh everytime.
@MooingDuck A few things I have against HBH. It's hosted on blogspot. It's a nightmare to navigate.
21:03
@MooingDuck makes me think of ALL THE THINGS.
I have a feeling this applies to @DeadMG. The "lick testicles till clean" bit.
Cats do that too right?
@Drise Yes
@daknøk there's a reason for that
Ok people. Good day. I'm going home.
... dinner time ?
Yeah, at eleven PM.
ltib! :D
21:09
Guys!
God!
@daknøk Obviously not for Drise
Unless he’s French.
Today I made a chick I know learn Haskell, and she found it amazing. :P
Okay okay I know what kind of music litb listens to!
Folk music includes both traditional music and the genre that evolved from it during the 20th century folk revival. The term originated in the 19th century but is often applied to music that is older than that. Certain types of folk music are also called world music. Traditional folk music has been defined in several ways: as music transmitted by mouth, as music of the lower classes, and as music with unknown composers. It has been contrasted with commercial and classical styles. One meaning often given is that of old songs, with no known composers; another is music that has been tra...
Wrong.
Folk metal is a sub-genre of heavy metal music that developed in Europe during the 1990s. As the name suggests, the genre is a fusion of heavy metal with traditional folk music. This includes the widespread use of folk instruments and, to a lesser extent, traditional singing styles (for example, Dutch Heidevolk, Danish Sylvatica and Spanish Stone of Erech). The earliest example of folk metal was the English band Golgotha, whose 1984 EP Dangerous Games contained a mixture of New Wave of British Heavy Metal and folk styles. The genre was not further developed, however, until the emergence ...
Folk metal is awesome and the band in that picture is awesome.
In fact, Luc, I was just listening to music by the band shown in that picture. xD
21:32
hmmm
I'm more of a Chopin guy myself.
Well played
^ NVSFW in honour of our current topic
21:36
Hmmm The Innocence of Walrus
@sehe That should be Japanese.
@Johannes, would you by any chance have a neat pedagogical example of code for a deque container?
Deques don't eat code
i'm sorry i have to go sleep. illness :(
@sehe No just the :DATA region
ew
See, deques make litb physically ill
21:41
@JohannesSchaub-litb Get better.
@sehe sry, I don't buy that. I think litb fancies deques.
:)
The debian implementation is kinda tricky to follow
I'm looking for a gratis easy to understand one. I have two months to either make it myself, or to find one.
@CaptainGiraffe That should do, right? Does it need to be fully standard compliant?
Also "the debian implementation" ?! You mean, GNU libstdc++?
@sehe No not at all, just they deque idea
@sehe Yes, left it, and could not edit it=)
I'd actually just write one that contains few or no optimizations and is implemented on a std::list of std::vectors (or perhaps a list of std::array). Don't sweat the iterators (or use Boost in that department)?
21:48
Mind sharing? pastebin ideone?
Ah, misunderstood.
Xeo
Xeo
@sehe write what exactly?
@Xeo A hypothetical deque-like container sample
Xeo
Xeo
mhm. Since I didn't follow the discussion, what's with using std::deque?
Educational purps. Scroll up. It's just on this single page anyway
Xeo
Xeo
Derp, I see
21:58
@CaptainGiraffe Ahaha. Just looked at the STLPort one in the latest version. Can very much vouch against readable. You know, the allocator, exception guarantees, move semantics etc. make this stuff hard to breath
I reckon you could do without all of these factors
@sehe Yep exactly
The only container that is tricky in arguing for O(this) O(that) is the deque

« first day (706 days earlier)      last day (4468 days later) »