« first day (460 days earlier)      last day (3562 days later) » 

12:00 AM
[NSMutableDictionary dictionaryWithCapacity:numCols];
When I instantiate the dictionary, I'm telling it to be the right size.
Because you are right, if a mutable collection has to expand its size, this will drastically slow it down
 
could any of the delay be a result of working on the background queue?
 
$ clang++ nextint.cpp
nextint.cpp:1:10: fatal error: 'algorithm' file not found
#include <algorithm>
         ^
1 error generated.
google isn't helping, any suggestions? fresh llvm install on windows
 
I'm not sure. But not being on the background queue isn't helpful.
Considering there are times at which I dispatch up to 7 of these at the same time.
 
If you can't include some standard header, there's something wrong with your installation.
 
And even with 7 of these working all on their own queues, the last returns within a second of the first being dispatched given queries with a small number of results.
But a single query that returns 1000+ rows takes more time even if no other queues are going.
It's probably this:
[table addObject:[row copy]];
not the copy part.
The addObject.
I should test this tomorrow with a query that is 2000 columns wide but only a single row.
 
12:07 AM
glad i could rubber duck for you :) sorry if i am not much help
 
Compared to a query that is 2000 rows, 1 column.
withCapacity: on collections means that the collection will be put in a memory location that is at least big enough to hold that many objects.
Just because a mutable collection is at the size you initialized it with though doesn't mean you can't add more.
But once you add one object to a collection which has run out of memory space in it's current location, it gets moved to a memory location with more space
Usually reserving twice its current space.
And if an array with 1000 dictionaries needs to be moved to a larger space to add that 1001st object... that's a lot of time spend moving values
 
Boo... from the middle of nowhere on mobile chat
 
Hi!
 
maybe just make the capacity larger up front by a reasonable margin of error?
 
The problem is that I can't know what capacity to make it.
 
12:11 AM
Just checking in ... consecutive days and all
 
Making the capacity 2000 for a query that returns 2 rows isn't going to be good...
 
one thought I had was that if you could know more about what the layout of the database would be ahead of time, that could help. I don't know how much worse 2 queries would be. but the first query could be small, and just ask for that relevant data to prepare for processing it?
 
That would presume that anyone using the library is always connecting to the same database.
Or require two queries per query.
And it'd still be hard to predict the results of a query without just running the query.
But the bigger problem is also that even if just preallocating space for 50,000 rows per table is enough.... we'd still be slow if the query returns 3,000 tables of one row each
[result addObject:[table copy]];
Unless we also preallocate the array of tables to some very large number also
And now, when we preallocate such a large chunk of memory, we're substantially limiting the number of simultaneous queries we can run.
 
@Morwenn tried a reinstall, and a reboot, no luck :/
 
if you could control the database I suppose it would be easy because you could just set something up to ask how many tables rows and columns there are going to be?
 
12:28 AM
@nhgrif I feel pretty sure selecting 2000 columns will be slower than 2000 rows, just because SQL engine has to go and fetch the DML from information schema 2000 times with columns, instead of once with rows. But would be curious to see the figures.
In fact, I may try it myself if I get bored tonight
 
The slow part isn't the query though.
I believe you that the query might run slower.
But after the query runs, the results have to be sent back, then parsed from a TDS into Objective-C objects.
And that's the slow part.
 
OK I misunderstood your explanation
 
Try codereview.stackexchange.com — mhawke 44 secs ago
Oh boy...
 
What's a TDS?
 
Tabular Data Stream (TDS) is an application layer protocol, used to transfer data between a database server and a client. It was initially designed and developed by Sybase Inc. for their Sybase SQL Server relational database engine in 1984, and later by Microsoft in Microsoft SQL Server. == Background == During the early development of Sybase SQL Server, the developers at Sybase perceived the lack of a commonly accepted application-level protocol to transfer data between a database server and its client. In order to encourage the use of its products, Sybase came up with a solution through the use...
 
12:41 AM
Thank you
 
Also, our newest tag. ;)
 
Don't tell Jamal... lol.
 
@Jamal "I put my heart and flabs into it." :O
 
...and there's a typo.
 
@nhgrif I love how you write your code, I know nothing about Obj-C and barely any Java (or other OOP) and it still makes sense to me
2
 
1:22 AM
You forget how nice it is to be able to just edit a post. So grateful atm.
 
1:32 AM
 
It got (sort of) quiet all of a sudden...
 
1:53 AM
Zenku the chat killer strikes again!
Lol. Sorry. I used to go by that handle on an MMO. I have a terrible knack for killing chat.
 
Well, with hardly anyone around and nothing else to clean up now, I might as well do some non-SE stuffs for a change...
Well well well. The latest migrated C# question contains an answer from Jon Skeet.
 
@ckuhn203 speaking of wrong answers, this is frustrating me more than it should codereview.stackexchange.com/a/59127/44723
 
0
Q: SQL design for representing a two-level hierarchy of objects with containment

DovI am trying to represent questions in quizzes. The database is Mysql but I am using fairly generic sql. The assumption is that varchar cannot handle more than 255 though, so I am supporting longer text by having multiple text components. There are four primitive kinds of questions: multiple cho...

 
FileStream is already buffered. adding a BufferedStream on top makes no difference, the only reason it doesn't throw an OOM exception like OP's code is that instead of reading all 4GB at once (StreamReader.ReadToEnd()), it reads 2GB lines at a time (StreamReader.ReadLine())... and then runs a regexp over them!
 
2:34 AM
@CaptainObvious I think that's got my name all over it
 
2:53 AM
0
Q: Switching i's value in a C# for loop?

Pantomchap if (ram[i] == 0xA) { if (gotoCount < 255) { gotoCount++; i = ram[i + 16]; // This is the line that I'm stuck on. } if (gotoCount == 255) { ...

 
@mjolka I honestly don't understand much about that question.
 
@ckuhn203 basically OP wants to remove non-ascii chars from a 4GB file. original approach is to read 4GB string into memory and run a regex over it
accepted answer reads 4GB file one line at a time, but lines might still be 2GB
svick correctly says to use a fixed-sized buffer to process the file
but still using a regex, which is crazy slow
 
Regex is scary. It's really easy to get it wrong.
and replace the wrong thing.
 
yep, and there's heaps of performance traps using them in .NET (from memory)
 
3:27 AM
I hope OP reads this. I also hope he starts clicking on all of the references.
0
A: Optimize total code in one sub

ckuhn203I think you've missed the point of having subroutines. The idea is to reduce the problem into small simple steps. Each step of the problem is translated into a subroutine (or a function). Let's start at 30,000 feet in the air. What you want to do is perform an action on a number of worksheets. ...

 
3:49 AM
@nhgrif tell me what you think codereview.stackexchange.com/a/59338/14608
 
@ckuhn203 "I did replace the subroutine name slbstd with something a little more meaningful" :)
 
Lol
I could go another round on it, but I'm tired.
 
I thought I was going to get the badge, but then I found out that it's still 12 questions short of 100...
 
Bummer
 
Well, maybe VBA will reach 100 first.
 
4:04 AM
I saw that our meta tag post was completed.
 
Yes it is.
 
Maybe if we can get some repeat business.
VBA posters seem to show up once or twice then disappear.
 
4:30 AM
Hi!
 
HI
 
I'm back from the woods!
I had left my browser opened... but my lovely wife shut off the power before leaving, so...
> 380 days, 1 consecutive
:(
 
:-(
 
I'm guessing everybody saw this answer from @Pops
12
A: I bet you didn't know about this comment by Jeff Atwood on Code Review's viability

PopsWithout any further ado: Code Review is a successful asset to Stack Exchange in its own way. (I hope that I qualify as one of the "people in charge" for the purposes of this discussion.) To be fair, comments three and a half years old probably shouldn't generally be considered authoritative. P...

looks like some more awesomeness is about to hit us :)
 
:'-)
 
4:39 AM
I just cast the 5th close vote on the meta dog-food post.. wth
 
Ooo... an auto-flag. We hardly get those on Meta.
 
Hi @Pops!
(nice timing!)
 
@Mat'sMug I see I should have bolded "It's still far too early in the process to be specific about this in any way" and maybe left in the bit about "not making any promises."
Can't take credit for the timing, I was here recently enough that I got your ping.
 
HI
 
oh, I.. didn't think that would have ping'd you!
 
4:43 AM
That "it's not you, it's us" part still cracks me up. XD
 
^^
 
Still a better love breakup story than Twilight.
 
well, zombies vs glittering vampires... my money is on the zombies ;)
 
Wait, twilight had a story?
 
I'm not sure...
 
4:47 AM
I was being distracted I guess by Robert Pattinson's pretty face and wondering what the creator of Dracula would think about this teenage flick vampire movie.
 
@Jamal When something goes wrong, it's pretty much always right to blame us. And by "us," I mean "the dev team." Actually, wait... they might read this. Let's say the sales team instead.
8
 
lol
So we are a bunch of kids asking "are we there yet?" over and over again...
 
I think "the sales team" is code word for the unicorn no?
 
@Pops Phew. For a second, I thought all the blame was supposed to be on the Nazi mods...
 
@JAMAL ADMITTED IT, YOU ALL SAW IT, HE'S OPPRESSIN' US ALL
5
 
4:51 AM
mwahahaha
wow @Jamal I just saw your Jamalizer's handbook!
 
@Mat'sMug Yes. But in your defense, it has been a really long ride.
 
@Mat'sMug And I think I've still left out many things.
 
I just drove some 800km, with two 2-year-old twins in the back.. no "are we there yet" but damn... that was a long ride.
 
@Mat'sMug What were you running from?!
 
@Pops Except, this car keeps stopping too many damn times to pick up new people. And there are way too many bathroom breaks. Wait, what?
 
4:55 AM
We need those bathroom breaks! Have you seen some of the stuff our passengers have been leaving in the car?!
Don't even try to say "no"; the flag handling stats don't lie.
 
^^ far, far from home
 
@Pops Yes... yes I do... gags
(and by that, I mean "close w/o comment" auto-flags)
 
@Mat'sMug In a magical place where it's possible for your camera to get intoxicated, I see.
3
 
We get spam like... once a month. I think.
 
lol yeah, that was me being homesick in need to log on to CR, and not being able to. So I, uh, played with some photo-editing app that came with the phone :)
 
5:01 AM
Woo hoo, my first star hat trick in this room!
2
 
^^ (resists urge to star that)
 
Do devs have a way to star every single message in a room? Just wondering.
 
@Mat'sMug Good, if I get four in a row on the board, I'll have to conclude that you're sucking up to me for something.
@Jamal Not that I'm aware of, but I suppose (WARNING: blatant uninformed speculation ahead) it wouldn't be too hard for them to build one. But why?
 
Wait, didn't I do the same thing, and all I got was a lousy diamond?
@Pops No reason
 
nah, it's just The 2nd Monitor's star-happiness at play. I think my record is somewhere around 5-6, I wish there could be a SEDE query for that :)
 
5:06 AM
0
Q: Python - Upload & resize Image

PattinsonI have implemented following code to upload and resize image in django. Please suggest me the method to make it more pythonic. def view(request, spot_id) IMAGE_DIR = MEDIA_ROOT + 'spot/' + spot_id if request.method == "POST": form = PublishedSpotForm(request.POST, reque...

 
@CaptainObvious isn't that logo copyrighted?
first post, old [migrated] question, I skipped the review: codereview.stackexchange.com/a/59339/23788
 
5:19 AM
0
Q: Scraping HTML using PHP

ecnepsnaiBecause a website I need data from doesn't have any API or RSS feed for their service status, I use a Web Scraper I built using PHP to grab the data I need and structure it as JSON. However I want to make sure the script is as resilient as possible. <?php error_reporting(E_ALL & ~E_NOTICE); he...

0
Q: Comparison of Fibonacci (Multinacci) Functions in Python3

mleyfmanAfter coming up with a formula on this Stack Overflow question, defeating recursion limits and finding a few new ways of calculating these numbers (as per this Stack Overflow question), I decided that it was time to write up the solutions and submit them for a proper review. For those that are n...

 
Is Captain Obvious a script?
 
5:34 AM
hey @mleyfman!
 
Hello
 
Captain Obvious is just a feed, faithfully posting every single new question (with a slight delay) into this lovely chatroom :)
 
Ah, that explains it
 
There's also a Stack Exchange feed for meta posts, and a Grima Wormtongue feed for every MSO (or MSE?) question tagged with :)
 
morning @all
 
5:37 AM
hey @chillworld
 
@Mat'sMug just reading the starred message's, @nhgrif say if you use ctrl+C and ctrl+V when you program it's wrong. Do I have to use ctrl+ins and shift+ins then?
 
Nah, use an infinite number of monkeys...
2
 
@Marc-Andre gratz with the badge
mhh intresting. fibonacci, who do it in fim++ with recursion?
anyone going to devoxx belgium?
 
@chillworld yyp is the correct way to copy paste :)
 
^^ but not to code... right?
 
5:44 AM
morning @all
 
monking!
 
@Mat'sMug sure, yyp is not the way to code. for that, use cp -R
 
morning @Heslacher bwa, it all depends, I do also lot of copy/paste. Decend code you can copy paste from one project to another, or from somewhere on the internet. The trick is to refactor it to your needs and not to copy all the bullshit
But you must be capable to write code without copy paste also.
This reminds me of an article I once read. Try to not touch your debugger for a month.
 
^^ easy - take a 1-month vacation!
 
I don't have problems with that (did used it once for 1 problem in 1 year time)
 
5:49 AM
(nerve-wrecking though)
 
@Mat'sMug when is your holiday?
 
I just came back, was away for a few days
 
I have 2 weeks starting the 15'th
 
(and my "consecutive days" counter has reset dammit)
I'm in my 3rd week off, resuming work Monday
 
@Mat'sMug that's worse, mine also resettet at 97 days .... (and I did login but didn't go to mine profile to check, SO did register it CR not :( )
@Mat'sMug ola already holiday :)
 
5:51 AM
oh, that sux... me was just between my ears, I wanted to reach 300 days...
so I left the browser opened on my CR profile while I was gone...
...but my wife made sure to shut off the power while we weren't home. you know, in case there's a thunderstorm or something.
 
@Mat'sMug lukcily you have a wife that think's of it ;)
parents of mine wife => thunderstrike on the cable.
 
hmm
 
Result => router dead, and pc burned up
just with the stupid internet cable :s
 
lol
shit happens eh
(looks at wires... hmm that could have happened)
 
yeah but that made me thinking. They always say to pull out all electrical devices. But do they tell you also to take out the cable?
 
5:59 AM
that's a good question
 
what a name for a component :)
 
naming is hard I guess :)
 
euuh nothing => I work in zk and I have a palette for it in netbeans. (I never use the palette but with the doublescreen the palette is just near the browser), Mine eye just fell on it
 
2AM here, my bed is calling me.. TTGTB - later @all!
 
laters @Mat'sMug
 
6:54 AM
0
Q: Given only a pointer to a node to be deleted in a singly linked list, how do you delete it?

JavaDeveloperExample: If a linkedlist list contains 10->20->30->40, and 2nd node has to be deleted then the output should be 10->30->40 This question is attributed to Geeksforgeeks. Looking for code-review, optimizations and best-practices. class Nodde<T> { Nodde<T> next; T item; ...

 
7:09 AM
1
A: Any improvements for my ShuffleGenerator?

Emanuele PaoliniI would remove the: if( size > 0 ) and replace the do {...} while with a while {...} to simplify the structure of the code. You can also redesign your algorithm to simplify it further. You can use an Array instead of ArrayList and use the following shuffle algorithm which avoids the u...

This answer needs more upvotes, it shows a bug in the question that nobody else saw
 
@CaptainObvious unclear what you're asking?
 
@Phrancis I find it strange that he doesn't provide the next in the constructor
 
0
A: SQL design for representing a two-level hierarchy of objects with containment

PhrancisSome of your column names are cryptic: cqid? qid? aid? Mr. Maintainer would need to look at a lot of your code to figure out these mean CompoundQuestionID, QuestionID and AnswerID. It's hardly any effort to type a few more characters to qualify these, especially since those are not aliases, they ...

 
@200_success why is it not
 
7:25 AM
@chillworld hard to say, his explanation is minimal at best, hopefully the code reads better than the text around it
 
0
Q: Looking for pattern suggestion for game that handle multiple touch events , code got messy

user63898i have mobile game that has section in code that handle user touches basically what it dose is : 1. main function that get the touch 2. loop in module A all sprites check if the touch coordinates are in the boundary of one of the sprite if yes call function that associates with the action brea...

 
It's readable but have no intention to answer atm. the OP has with each post remarks on the global vars to set the scope, and look, his first class are again 2 vars with no scoping
 
welp
 
@Pimgd In some sense, all questions are reinventing the wheel.
 
Sure, but I get to answer with "use Java's library" now
and bam whole question is gone
I can even go on a rant how his implementation exposes its objects and is nothing but a simple wrapper
 
7:31 AM
^that... sounds like more of a CR answer
 
and that if the user accidentally turns it into a circular list and compares it with a clone of itself it will break
...
okay rant time it is
 
@Pimgd you could make a template copy+paste answer and modify it a bit, if this is a repeat error
 
@Pimgd how'd it go with msw on your answer yesterday?
 
But if I don't think that [You're doing it wrong and making your life difficult. Here is a link](www.google.com) is an interesting answer...
Bah, why is this^ not working -.-
 
I'm still working on my answer, but I already have two bugs
 
7:35 AM
@Pimgd don't forget to mention he always forget some global vars to scope ;)
 
In any event, Goodbye, World!.
 
@Phrancis that sounds like you're offing yourself
Not the brightest idea
 
@Phrancis I like your SQL more...
SELECT Phrancis.* INTO Bed.resident
 
Hopped back in briefly to show this... (2 years later)
Bye now
 
almost everybody get ^^
 
7:46 AM
0
A: Given only a pointer to a node to be deleted in a singly linked list, how do you delete it?

PimgdI have tagged your question reinventing-the-wheel, because you're recreating a LinkedList, and Java already has one. @200_success has removed this tag for some reason, allowing me to post this answer: Use Java's built-in LinkedList. There's no reason for you to be writing your own implementatio...

There we go
1x rant-answer containing multiple bugs
I have 1 question though
did my ranting go too far
 
@Pimgd no
 
hmm true, I didn't insert any curse words
I guess I was just shouting in my head
 
@Pimgd actually from what you wrote in chat I had expected more of a bear-trap..
 
=/
It's hard to be angry in a letter or forum post
If a dev at work would have done that I'd have given them a good shouting
 
@Pimgd it's hard?? no not really...
 
7:54 AM
Sorry
I've been a moderator for a while online in several places
after that it's hard to get angry when writing a long reply
Best I managed eventually was "Are you DENSE?" when someone was acting stupid
contrast my real life, where a single compiler error signals the sounding of multiple curse words
=D
 
@Pimgd nice one. I am too much of a flamer to restrict myself to that...
when someone acts stupid around me, I usually throw a fit and insult his capacities of thinking, or rather the existance of a brain or his qualification to use it.
just not that friendly ;)
 
short question how do you strikethrough
<del>
Thanks, code golf
 
<s></s>
and in chat \---|---
meh..
the escapist.
 
?
x
 
I escaped the strikethrough sequence, but the \ still shows up..
 
8:05 AM
*
so what's the difference between del and s
One more java answer for my tag badge =D
 
0
Q: Optimize code for better performance FB Login Ajax

ZackCan someone modify the code for better performance, its working fine but sometimes hangs the browser for a second, also not displaying the success data. When browser refreshes it shows then.May be i am doing too much on dom. $(document).ready(function() { window.fbAsyncInit = function(){ ...

 
8:17 AM
Huzzah 20 java answers
And only 51 more rep until I can see deleted stuff =D
 
8:29 AM
how do i get 7 rep to hit 1337 then :D
 
uh lemme see
Either get +5 for a question, then +2 for a tag wiki edit
Or +10 for an answer, then -3 for 3 downvotes
Or you could edit 7 answers that you have downvoted so you can remove the downvote
But you don't have that many downvotes
... or votes in general
 
;)
 
9:00 AM
Monking
 
heeyo
 
Today... I am going to be productive.
 
good plan @skiwi
 
@skiwi not happening
 
@nhgrif Real men use Ctrl+Shift+ArrowDown
 
9:10 AM
it's not flipping my screen
why not
 
It's shortcut in Netbeans
copies the selected lines downwards
or if you don't select anything, the current line
 
CTRL+D does that in FlashDevelop
 
ALT + Arrow in Eclipse
@Pimgd what you are looking for is: AltGr + Arrow
 
... nope
It's not flipping
 
chose arrow direction for the new bottom of the screen.
read: AltGr + ArrowUp...
 
9:20 AM
it navigates browser history
 
Does anyone perhaps have experience in what library to use to connect Java and Lua?
 
nope
 
@skiwi sweet, a readme
I was going to downvote this (for saying "just use LinkedList" on what looks like a data structures assignment or challenge) then I remembered I was on codereview. — immibis 6 mins ago
Hah, another convert?
 
9:37 AM
@Pimgd Ya, readmes so good
I did Travis CI integration just a few days ago... I must be able to do it again and this time finally write down how I did it
 
9:56 AM
Ha, I got it setup in 20 minutes!
and everything perfectly works in the first try, what are the odds
Except, that I forgot to specify my main class correctly
 
well played...
 
and that I made another mistake ;P
 
well I got my custom-styled header for the joomla site working...
and damn hell does it look shitty...
 
nice
 
10:08 AM
@Vogel612 doesn't look too bad
 
but the blue of the logo and the blue of the header are borking in that combination..
dammit this should be done by a web-designer...
and not a software engineer in training..
software != web-design...
 
Post it on graphic design se
 
true
 
0
Q: Check if given pair of string's are Anagram?

kyleThis is my sample code to check if a given pair of strings are anagram or not . static bool AreAnagram(string s1, string s2) { if (s1.Length != s2.Length) return false; foreach (char c in s1) { int ix = s2.IndexOf(c); if ...

 
> You are learning programming? Sure you can help with my cool new website with (CMS of choice)!
 
10:10 AM
@Vogel612 you are living next to me ;-)
 
how so?
 
Stuttgart
 
Lol how did you find out?
nevermind...
weather ftw.
 
Your posted image
 
um... wat?
oh righhhht.
actualy I am even closer (if my geography's working correctly)
 
10:12 AM
Stuttgart is quite far into Germany
 
Flughafen....
@skiwi ?? far into??
mid-south-western
hurrrrrrrr
 
just far into Germany, watched from th Dutch border :)
 
not as far as Munich
 
I'll be in Köln next week at this time
 
you are aware that that's a 4 hours drive from here??
 
10:15 AM
yep
but it's Germany
at least
 
yea, it's even Europe ;)
 
@skiwi and a very nice city
 
GamesCom ftw.
 
Yeap, GamesCom :)
Though I'll be staying in Düsseldorf
 
2K REEEEEEEEEEEEEEP wooooooo
aww yeah look at all these informational stats
 
10:20 AM
@skiwi you better not mention that to any native Kölner...
these two are like oil and water (Düsseldorf and Köln)
 
:o Didn't know that there
 
@skiwi now you know ;) They're like the football clubs Dortmund and Schalke..
If you are near a Dortmund fan never mention Schalke and vice versa.
that is if you want to keep all your teeth and limbs ;)
 
PSV, Feyenoord and AJAX here... enjoy
Eindhoven, Rotterdam and Amsterdam
 
10:55 AM
Huh, since when can you classes inside Java methods?
 
@skiwi ??
 

« first day (460 days earlier)      last day (3562 days later) »