« first day (1151 days earlier)      last day (2865 days later) » 

11:00 AM
') DROP TABLE StarList;
 
Zak
@Gareth Why? What else should it be?
 
@janos hmm, okay. good thing I'm interviewing for a position inDublin then eh
@Gareth just because sql is old doesn't mean sql is bad
 
 
Zak
I'm out of stars and it's not even midday
 
:) I'm in good company here then, everyone around me is Mongo or other NoSql.. I get tired of having to justify relational.
 
11:04 AM
Mongo has had a few problems that have surfaced recently that really justify the name.
NoSQL isn't bad, it's just good for some circumstances, SQL is good for other, and graph DBs good for others. I work in fintech, as does @Zak, and SQL is pretty common in that industry
 
I'm joining the right party then. I'm banking IT in london.
 
This is some serious spaghetti code. Once you get this working, I would strongly recommend to post the working code at codereview.stackexchange.com. There is a lot of things you need to learn. — Lundin 14 secs ago
 
My company probably receives data from your employer :)
 
@Duga At least it says once and not if
 
Try this to get a good job:
1. Attend a conference related the languages / technologies you like, and where many related companies host their booths. Go wearing your Code Review T-shirt
2. Talk to the interesting companies, most importantly the developers. Find out what it's like to work there. If sounds good, find out if they are hiring, and how to take their test
3. Prepare well for the tests, for example by solving problems and writing clean code as much as possible
 
11:15 AM
> Go wearing your Code Review T-shirt
3
:(
 
or similar
 
Heyo captain jack
 
Man, I'm going to need a Code Review suit, going on the job market soon
 
Also please use a deodorant. Like please
 
I went into a local store to buy a suit jacket a couple days ago
 
11:17 AM
you don't need the real thing. Print your own.
 
I did not realise upon checking the price tags I had walked into a shop that made suits from unicorn hair.
£800. For a suit jacket. £800. what
 
You can order custom t-shirts online very cheap
 
nothing else. just the jacket
@janos I know ^^ I'm applying for a job currently in Dublin. They seem pretty impressed so far. Time will only tell how the next stage goes.
 
the Code Review T is a great conversation starter
 
@DanPantry Unicorn hair? I can now see why the UK has lost its mind
/s/hear/hair/
 
11:20 AM
Code review: every line of the input file is checked to see if $. == 1. It is faster and more concise and readable to just my @arr1 = split /\t/, <FH> before the loop — Borodin 38 secs ago
 
Looking at some old code
from faktorisering import*
Uh oh...
from faktorisering import*

import itertools

def num_to_lst(num):
    return map(int, str(num))
Was this written by me or drunk irish monkey?
 
faktorisering sounds somewhat German to me
 
@N3buchadnezzar you should try refaktorisering it.
 
@skiwi In German it would be Faktorisierung.
@DanPantry Lal +1
 
Zak
@DanPantry Yeah. Not worth it. You can get a *tailored* suit for half that.
 
11:28 AM
@DanPantry suit? for the interview?
 
@JeroenVannevel suit jacket. Because I like suit jackets.
I wear them with t-shirts. Yeah. I'm a hipster, I know.
but I don't like them so much as to drop £800 on them
 
meh
if you like them then it's fine I guess
but I think it might be counter productive
You're meeting with devs -- they probably won't wear anything like that
 
I know, which is why I said I wanted one because I like them
They have explicitly asked me to wear whatever I feel comfortable in
 
I just got the outspoken badge here. I don't think I have got that on the rooms I actually frequent. You guys love your stars it seems.
 
Zak
As a general rule, when it comes to business relationships, over-dressing won't hurt.
 
11:34 AM
@Matt We're actively trying to compete with the night sky.
4
 
@Zak That is why I wear a clip-on tie with my tshirt on my self designate semi formal casual Friday.
@DanPantry lol. Nice
 
@N3buchadnezzar What the...
 
Zak
@DanPantry TS so hard.
 
Jun 21 at 14:44, by skiwi
Look up the sky! What do you see? No stars? That's because they're all here.
 
@Mast I didn't see that, but I wish I had. That's great.
I'm wrong. I did see that. I even starred it.
 
11:36 AM
@Mast oold code
 
Time flies in the 2nd monitor.
 
Old code is the worst.
 
star flies
 
For good reason I am never impressed with my old code.
 
@Matt Yeah, I actually did not think I have written this code. It is slow, weird and does strange things.
Sadly it works. And I can not for the life of me find a fast reliable solution. Stupid old me.
 
11:37 AM
I am never impressed by my old code, but I'm always impressed with my old documentation.
 
Does it shoot rockets?
 
As long as it makes breakfast I am willing to wait
 
@Pimgd What is this documentation you speak of?
@Matt What about second breakfast?
 
Docstrings.
 
@Pimgd In my case there's nothing to be impressed about
 
11:38 AM
Sounds like something I would do if I had time.
 
@N3buchadnezzar If you have to ask that, you're doing it wrong
 
Old me did not believe in documentation. He thought new me would remember.
 
@Pimgd Same. I love my comments throughout VSDiagnostics
 
but yeah, either there is no documentation or there is good documentation
 
It's needed, considering I often don't work on it for weeks/months and then have to get back into it
 
11:39 AM
Funny enough my biggest shame I had when programming is in my first year of university
Part of the assignment was to return the output of rolling two dices
My code: return 2 * rand(1, 6);
 
especially documented build procedures for old projects
 
Enough about your second breakfast. Should have had enough at the first. Next your going ask me about elevenzies
 
It's so good when you have to push out a fix and you can follow a check list to make sure everything is done right (better yet would be automating but eh)
 
@JeroenVannevel It looks reasonably complicated
 
11:41 AM
And yet you can read through it without much prior knowledge and understand what's going on.
I think
 
Now the question is whether I want to read through 400 lines of code :P
 
Depends
Do you want to learn from the best?
 
// First step:
// Second step:
mate u wat
 
sudo get second_breakfast
 
why is this not separate methods already
 
11:43 AM
And pass 20 variables around?
It's the main algorithm
subtasks are done in separate methods
 
eh, fair enough
first one can be a method, second one can be moved up
that's minor shizzle
 
@Pimgd elevensies...
 
Zak
@Phrancis What's your opinion on "Map these to those" tables?
Like so:
 
Have you run VSDiagnostics over VSDiagonistics?
 
Zak
11:48 AM
(and without, for context)
 
Much less spaghetti @Zak
 
here you have one variable and would like to set it based on the value of another
this takes you 13 lines.
 
Zak
@DanPantry Yeah. I think I'm pretty happy with it at this point.
 
11:51 AM
@Pimgd Checklists are awesome.
 
0
Q: Program to display array elements in the ascending order of number of factors each element has

axaysdinput : 1000 23 100 26 32 output : 23 26 32 100 1000 since 23 has '2' factors and 26 has '4' factors and 32 has '6' factors.. and so on.... 1. SHOULD I USE A LINKED LIST FOR THESE TYPE OF PROBLEMS? 2. IS MY CODE EFFICIENT? OR HOW CAN IT BE OPTIMIZED? #include <stdio.h> #include <stdlib.h>...

 
@CaptainObvious CAPtain obvious
 
@JeroenVannevel That's 6 times VSDiagnostics in one URL...
2
 
@JeroenVannevel basically, long method is long, where is CR question so I can shoot at it in peer-reviewed format
 
> Welcome to Foreign Key Hell. The drinks are free and the db servers run on single core.
2
 
11:54 AM
@Mast UrlDiagnostics
 
@Quill i want to star this forever
 
Also, @JeroenVannevel your analyser looks seriously amazing from the usage gif, but I just can't understand the code - there's a lot you'd need to know before reading it, if that makes sense. Any resources I could look at? Something simpler perhaps?
 
Zak
@Quill Is it really that bad?
 
@Zak There's more FKs in that photo than I have hairs on my head
 
11:57 AM
the rest of your review is locked behind a paywall
2
 
Zak
@Quill Sure, but why is that necessarily a bad thing?
 
@CaptainObvious Broken for multiple reasons.
 
@Zak lots of FKs usually means a lot of JOINs, which usually means shoddy dbas can write very slow code
 
Shoddy DBAs will write slow code anyway
Normalisation is good
 
it's one of those things that can go very wrong if you don't know what you are doing
 
12:00 PM
s/DBAs/any developer
 
Zak
@Quill I'm willing to trust in myself and the CR community
 
@Zak one of those trusts is misplaced
 
@Pimgd you'll have to trust in yourself to find out which
 
Or trust in us, and we'll tell you which one it is
 
I found a good method at Code Review: codereview.stackexchange.com/questions/97950/…Breeze 15 secs ago
 
12:03 PM
0
Q: Explain this program

Surendra Anandpackage progs; import java.util.Iterator; import java.util.Scanner; import java.util.Set; import java.util.TreeSet; public class Sort_unique { public static void main(String[] args) { // TODO Auto-generated method stub Scanner in = new Scanner(System.in); Set<String> set = new TreeSet<>(); int...

 
> This program demonstrates Timefuck's handling of the grandfather paradox. Using the many-worlds view of space-time, this program simply arrives at the . with the current cell 0 even though that value hasn't been created yet.
 
Monking!
> You've earned the "Taxonomist" badge
 
commit freeze @ work because we're rolling out an release
can we have git already, pls
 
I forgot I had created
 
new 100 rep bounty posted by asker
2
Q: Migrate files from MySQL BLOBs to PostgreSQL largeobjects

leseAs title says, this piece of code migrates files (binary and metadata) from a database to another one with different structure. Currently my problem is that when I have to deal with a big database (about 30GB) , at a certain point the script slow down very much. Currently (Jun10 15.30) is still...

do we have a bot/feed for that
(do we need one?)
 
12:08 PM
I don't think we need one
 
@syb0rg Congratulations!
 
bounties are just incentives to answer a question, we don't need them in chat
 
@Mast Thanks! I think that's one of the harder silvers to get!
 
okay
 
@Mast yeah, gotta get the word out
 
12:10 PM
> I would like to decrease the execution time to 1day maximum : )
 
@DanPantry This is the most complicated diagnostic I wrote -- pick any other one and you'll find it's much simpler
 
Shiiit.
 
@Mast wow
 
@Pimgd Those two loops are largely the same. I've tried to mix them together two or three times before but I can never get it right
 
@JeroenVannevel Alright, thanks.
 
12:11 PM
@Pimgd I don't think we need another bot to add that capability, but it would be nice to know about those kind of posts
Maybe add the functionality to another bot?
 
On the upside: I've got freaking beef lasagna from the Italian place around the corner
 
Oh, there's a for in an if in a for in a for.
3
I think I found the problem.
 
@JeroenVannevel I thought that sentence would end differently
Like you had lasagna on your pants or something
 
@JeroenVannevel What's the difference between "beef lasagna" and "freaking beef lasagna"? Mad Cow Disease?
rimshot
 
 
12:12 PM
@JeroenVannevel paywall sneak peek: move the similar parts to methods, keep the different stuff duplicated
 
Woah the swagger has extended to the codebase
 
simplify simplify simplify until you can see the solution
 
@Pimgd 30 GB took over 2 days according to the question.
 
@Pimgd they are in methods
 
        // Remove the local variable
        // If the expression is surrounded by an invocation we just swap the expression for the identifier
        // e.g.: bool contains = new[] { ""test"", ""test"", ""test"" }.Contains(o as string);
        if (!IsSurroundedByInvocation(asExpression) && !IsInConditionalExpression(asExpression))
        {
            RemoveLocal(asExpression, editor);
        }
 
12:13 PM
@Mast For 30GB and O(n⁴)? I believe it taking that long
 
can be a method!
 
@syb0rg Yup.
Very, very inefficient.
 
I'm not going to put the if-condition in a method
That would obfuscate things
 
Removing one of the loops should fix his problem, probably.
 
If I do that, you'll just see RemoveLocal()
 
12:14 PM
> I am wondering if I am learning it the right way or using it right cause I don't want to learn it the wrong way then I'll have to relearn it
New user's post lol
 
@Quill lol
 
@Legato Thanks for the accept!
 
is Jeroen complimenting himself inside of his codebase? :P
 
@JeroenVannevel I don't quite care - you've got duplicated comments, which means you need better method names, even if it's a wrapper
 
> The implementation is not available yet. We heard someone was trying to rescue the original implementation from an old floppy disk, but he then went missing. We are sure there's nothing fishy about this.
The stuff people come op with...
 
12:16 PM
Maybe you just need to encapsulate the conditional
and then the comment is no longer needed?
 
@Mast That last sentence, lol
 
eh, maybe one day I'll look at it. It's not ugly enough to warrant an intervention and breaking stuff
I'm pragmatic now
 
@JeroenVannevel pragmatic lazy
see earlier comment about posting a cr question so I can shoot at it
 
possible answer invalidation by axaysd on question by axaysd: codereview.stackexchange.com/posts/133284/revisions
 
0
A: Migrate files from MySQL BLOBs to PostgreSQL largeobjects

PimgdYou don't have any performance metrics, so there is no telling whether this will have a significant effect, but one of the things you could do is combine your queries. Take this one: full_qry="SELECT resource_id, path, address, asas_id, progress \ FROM resources \ WHERE ...

half-assed answer
@Duga no answer invalidation; question shouldn't have been answered to begin with
 
12:24 PM
@Pimgd How many queries does that combine into one?
 
looks like it would combine N many queries, where N is the number of rids. So, potentially a lot.
That could take a chunk out of the time on its own
 
I think he could do this for all cases
provided you write a batcher of sorts
I did this for my internship
it was pretty fun
 
Welcome to Code Review! Unfortunately, this is not a review of the given code. Note that this question is likely to be closed soon and actually shouldn't be answered. Welcome anyway, feel free to join us in The 2nd Monitor if you got any questions. — Mast 8 secs ago
 
5
A: C# - Job Pipeline

Adriano RepettiI'd need more context so please consider some suggestions as implicit questions. In PipeLineStep class StepName property is a read-only property. If you just return a constant value you may want to make it a constructor parameter instead (where you may also include some sort of validation): pro...

Pimping this answer, it's pretty comprehensive
 
Well I'll learn.
thought my answer was valid, he asked how to optimize. There were 2 places to optimize. the sort, and the factorization.
 
12:30 PM
 
that's valid code review?
 
What happened to the close-vote count?
12
Q: Checklist or General Directions on how to write a good CR-ish answer

Vogel612This question is intended to be the counterpart of: Checklist for how to write a good Code Review question Getting started with CodeReview: New users often seem to have problems to understand, what exactly is expected from a CR-Answer. Many come from Stackoverflow, others maybe from Programmer...

 
I don't know ?
 
@Mast Maybe it got reopened?
 
didn't realize there was one.
ignorance is bliss :)
 
12:31 PM
0
Q: Create repeated loop to generate neighbours

Valorian85I'm trying to generate a sublist of nieghbours with below criteria: The input would be possible partitions to the list S = [1,2,3,4,5,6] Criteria for Neighbourhood Using Split Operations Criteria 1 – Split largest element in the list. Criteria 2 – Always split the largest element by //2 (e...

 
@skiwi Ah, yes, @janos re-opened it. Although I don't see why.
 
He also closed it as off-topic prior to that
Maybe he wanted to delete his CV and that behaves differently as mod?
 
@Gareth Don't worry :-)
 
I don't see how it's broken
 
It realllly annoys me on SO how answerers just give the user the answer instead of trying to explain what is wrong. Even worse when they say "Just try this" and have a code dump...
 
12:33 PM
Your code is broken. The variable i is not initialized before it is used as an index in a for loop. — pacmaninbw 48 mins ago
Just verified that one is correct
 
@DanPantry Yup.
int main(void) {
    int n,a[2][25],i,j;
@skiwi It is initialized, just at a really, really weird place.
 
Only without the exact command to compile (and run?) this program we won't know I guess, C is a bit quirky
@Mast Does the fact that it has no value not matter when indexing?
 
Well, it's set to 0 when starting the for.
 
it is declared, not initialized
 
The user claims he got output though... if we choose to believe him then he actually managed to run his program
 
12:35 PM
indeed, i is used before it's initialized. But I don't think it makes it "broken"
 
It should only be broken if it doesn't compile, right?
 
@janos In an array? This can't work.
 
welcome to c
 
by "broken" we usually mean here: doesn't work as intended
 
int main(void) {
    int n,a[2][25],i,j;
    printf("Enter the no. of items\n");
    scanf("%d",&n);
    printf("Enter the items\n");
    for(j=0; j<n; j++)
    {
        scanf("%d",&a[0][j]);
    }
    for(j=0; j<n; j++)
    {
        a[1][j] = facts(a[i][j]);         // here i is undefined
    }
It can not work.
 
12:37 PM
i is declared but not initialized
if I recall correctly, C implicitly initializes it to 0
 
75
Q: What happens to a declared, uninitialized variable in C? Does it have a value?

ashIf in C I write: int num; Before I assign anything to num, is the value of num indeterminate?

 
in that online compiler it works
it is not broken (anymore?)
 
 
also, a post should be considered innocent until proven guilty
 
12:38 PM
@Quill lol
 
Looks like i just happens to be 0 at the grace of the compiler
 
^^^ yes
 
@janos That sometimes works with arrays, but does that go for integers as well?
 
int num;
int a = num;
int b = num;
There's no guarantee that a equals b in that case
 
I don't think this is grounds for closing. It's a good code review answer to point out the OP that he should initialize variables, and also keep an eye on compiler warnings, because any decent compiler will warn for this
 
12:40 PM
Now you've got undefined behavior talking
 
possible answer invalidation by lese on question by lese: codereview.stackexchange.com/posts/131622/revisions
 
@janos I think I can only agree with that, though it's not worthy of my upvote but YMMV
 
@janos That combined with the fix he made half an hour ago, you're probably right.
 
@Duga hmmmmh valid?
 
Interesting inner sanctum review of code review.
2
 
12:45 PM
@Gareth This means you can now review the question again :-)
Feel free to edit your existing answer.
 
Gareth you might want to mention more functions.
 
it's ok, I'm not touching it.
 
Why are there videos in my YouTube history that I didn't watch... this is odd
 
@skiwi Has garbage in it
 
it just lost me 10% of my points
I can't invest my time in negative returns
 
12:46 PM
@Pimgd It didn't modify code... looks valid to me
 
@Gareth I am willing to convert my downvote to an upvote if you review it in a bit more detail
 
@Gareth Improving the answers will probably net you at least 10%.
 
There's an hour worth of Tech Insider videos in my YT history, seems like something has gone rogue
 
@pacmaninbw Hey, a fellow user!
 
To be honoust, I pointed the coder to a link of factorization algorithms, and he promptly asked me how to improve his factorization algorithm. I also want all the answers on a plate
 
12:49 PM
Welcome to Code Review, where your answers may have to explain things
7
Well, actually, you have to do that everywhere on StackExchange
 
@Pimgd If it does, that's by chance
 
coder is probably like all the other c#, js, c++, c, cobol, fortran, sql, mysql, mongo, perl, lisp, python, matlab, .... coders. Doesn't bother doing any research, and refuses to participate in any code reviews, or use branching. What can I say. I'm off to lunch at Pret. Yes. to play on my broken 2 core 1.4MHz 8 year old laptop.
 
Undefined behavior is occuring
I'm surprised that worked actually
 
@Gareth has nothing to do with the language, it has to do with personal drive
 
I will return, but for now my stomach curls
 
12:52 PM
not everyone has drive to do research, they just want to get the job done. most people in 2nd will use those languages but do care about researching it, reviewing and branching etc.
and most answerers on CR, I'd say
 
@syb0rg So are we.
 
I'm not
 
:) Sorry, I thought the list was extensive enough to make it read as a bit of humour.
 
static variable has to be initialized to a default value based on type?
 
@Gareth It did read as humour, but there's truth behind it, no?
 
12:53 PM
and we can do whatever we want with local variables?
 
@DanPantry I feel like I've mostly been doing research and not a whole lot of coding lately
 
why not treat them the same as static variables?
 
@Pimgd But it's not static
 
LUNCH
 
a compiler IS allowed to summon demons
but summoning demons is hard [citation needed]
 
12:54 PM
@JHache Planning is a lot more important that implementing
@Pimgd True, it is up to a compiler how it chooses to implement some things
 
possible answer invalidation by lese on question by lese: codereview.stackexchange.com/posts/131622/revisions
 
@Mast Where is this code?
 
@syb0rg true, but I've also not been assigned to any actual projects. Planning is useless if the end goal is not clear
honestly just been reading anything and everything
 
@syb0rg Here
 
It's initializing i to 0: ideone.com/ZXveel
Which the compiler is choosing to do
So it will compile and work on some systems
But for the majority, it should break
 
12:59 PM
It's likely to work on most but not all.
 

« first day (1151 days earlier)      last day (2865 days later) »