« first day (1200 days earlier)      last day (3116 days later) » 

19:07
@Duga Well then Mr. Python. Show me what you got.
Looks OK to me
0
Q: Controller method to update properties of a request

Joe CuevasI have a view that displays details of a work order request submitted by a user. As far as security and database querying is concerned, which one of the following options would be better if I'm going to update a table named "Requests" with some changes to the properties? Is the extra query to the...

0
Q: Transaction page for adding virtual credits to user account with credit card PHP

K E N N E RI'm creating a website where users can buy virtual credits to buy items on my site with. This is the transaction/checkout page where the user would input their credit card info (Which would be sent off to STRIPE) and if the payment is successful the credits would be added to their account. Ple...

@CaptainObvious Not touching that one
   // if they are empty
   if(empty($sessS)){
     $sessS = 69;
   }elseif(empty($sess)){
       $sess = 96;
   }
WTF, talk about some error-prone naming
Rust is so simple and intuitive, I love it
except the borrowck..
 let read_bytes = &buffer[0..number_of_read_bytes];
I guessed this syntax and it "just worked"
What does that do?
19:17
given buffer is an array
it takes a pointer to immutable slice of bytes 0 through number_of_read_bytes
fn handle_client(mut stream: TcpStream) -> Result<(), Error> {
  loop {
    // We're only going to allow 5k bytes, this is a reasonable amount
    // without overwhelming the server
    let mut buffer = [0; 5000];
    let number_of_read_bytes = try!(stream.read(&mut buffer));
    let received_bytes = &buffer[0..number_of_read_bytes];
    // TODO: parse the bytes..
  }
}
also it really highlights how pervasive mutability is...
handle_client is kind of an odd/non-descriptive name for a function...
meh, WIP
#HereBePedants
Surprisingly readable, I must admit
19:22
I quite like the let .... match syntax
but yeah on the whole it isn't so hard to read given it's a low-level systems language
and i don't think it gets much denser than that
The only confusing thing is having to specify both let mut buffer = [0; 5000]; and &mut buffer
(because &buffer would result in an immutable borrow of a mutable variable)
also i'm loving the downvotes on q/a on this question
compared to the original question whose title is absolute rubbish
yes i'm salty
Fusion, with a hammer.
And yes, he explains it for dummies. Easy to follow.
@Phrancis Do you have a new image?
@N3buchadnezzar It's his old one
It seemed to lack something...
@Mast lol, "The temperature required for fusion is 150billion C. This is rather warm."
19:30
He's totally right.
That's also 10x the temperature of the core of our sun.
Nothing like a bit of humour to get people's attention.
@N3buchadnezzar LMAO
"rather warm", uh-huh
@Phrancis Thank you.
@Phrancis OMG you brought it back!
Yes!
19:36
oh wow, some people...
How do I add 7000 to a drop down list? — Jonnyboi 10 mins ago
X-Y problem by definition
nobody wants 7000 items in a dropdown list
7000!?
well, you know, using Excel as a poor man's database
@Mat'sMug What about 7001?
@Mat'sMug Gosh, no kidding
7000 rows in a sheet, sure, fine, but in a drop-down... wtf
@Mat'sMug dropdownlist += 7000
done
19:39
@Mat'sMug That's a lot... I think 20 would already be too many.
@DanPantry JavaScript would totally accept that.
What about Rust?
it would slap you for being stupid
6
@Mat'sMug pls
@DanPantry LOL
2
"how do you add 7000 to a dropdown list"
19:40
@DanPantry grabs trout
the correct answer is "you use a combobox"
No. If you add 7000, a combobox won't save you.
No, but a combo box would allow you to only render some elements at a time
The main issue with 7000 things in a list isn't the 7000 things in a list, it's displaying all of them at once
It would be a lesser problem, but still a major problem.
oh wait, this is Excel and not DOM? lol gl
19:41
The maximum amount you should have in a combobox is what, 300 or so.
you don't need to display 300 things in a combobox, you just use it as an autocomplete so you only ever display the ones relevant
reminds me of a closed RD issue that was highlighted by some usercode with >30K symbols
Excel is not designed to do what you want it to do. You might consider writing it to a text file or something like that, instead. — Phrancis 25 secs ago
What if he wants a dropdown menu to input the users name? :p
@Phrancis Is it time for 'Excel is not a database' yet?
19:42
@N3buchadnezzar A combobox does that
@N3buchadnezzar slap
A combobox allows you to a) filter from X values or b) enter your own
@Mast It always is, albeit, this is not this user's actual problem. They want to write 7000 lines of data into a single cell, which only accepts about 300 lines of text
Wut.
2
but all of this is irrelevant because OP is trying to make a GUI inside of Excel
19:43
Does he even realize why he can use multiple cells?
Gotta learn, somehow.
@DanPantry You can totally do that. Turn Excel into a website, a full-fledged GUI, it's all possible.
@Mast office.com
Your VBA developers were so preoccupied with whether or not they could, they didn’t stop to think if they should.
@Mast Possible != Advisable
19:44
@Phrancis Details, details...
hey, you could make each cell 1x1 pixels and turn Excel into a 4K TV if you wanted
@Mast Not allowed to use VBA
LOL @Mat'sMug
@Mat'sMug GTFO
19:45
Retina display....
Retina because your eyes will jump out of their retinas when they see the abomination you made
> Best viewed with gridlines turned off
21
Q: Life is a Game - Play it

ZakI haven't made a game in Excel yet, so I decided to Make Conway's Game of Life. If you wish to play along, I've uploaded the workbook here. Right now it's very rudimentary (No user interface, no buttons/controls, no automatic tick-increment), but I would like to, in the future, add all of the a...

to be fair I think conway's game of life is acceptable in excel
pride and prejudice? maybe not so much.
someone should make a 3d engine in excel lol
0.00003fps doesn't matter
Where is @Zak? I want to see him cry.
yes! and make a game and call it xlDoom
I'm voting to close this question as off-topic because requests for codereviews ... better go to codereview.stackexchange.com — GhostCat 45 secs ago
19:47
@Mat'sMug i thought of doom too, yeah
@Duga NOOOOOOOO
> Please enable macros to play My Excel-lent 3D Shooter
Code must be working to belong on Code Review. This code is not working. — Dan Pantry 29 secs ago
@Duga Wow, that's a new close reason
Pacman in Excel would be a good start.
19:50
@skiwi counter strike: offensive boss
CS: No
Only map is cs_office
But named ms_office to stop valve from suing
@RoboSanta Posted a 100 bounty
@DanPantry that question looks right up your sleeve ^^
I was about to comment on his inline styling, then realised it was part of the assignment
20:06
I meant to say "up your alley", whoopsiedoodle
I am curious
how long does it take you guys to solve this (pretend it's an interview)
If F(k) = the 32-bit 2's complement of k, what is sum(F(k)) over a <= k <= b?
where -2^31 <= a <= b <= 2^31-1
I can get the optimal solution but it took me like 20m, feels like it is too slow
what on earth kind of interview would ask me that
A maths one
20:14
@The29thSaltshaker It would take me 15 minutes to figure out what you mean.
0
Q: Python code for a Selenium Kijiji Web Scraper works with Firefox but not PhantomJS

gtdwatI have this script working when I do it with Firefox but, when I change it to PhantomJS it works when I step through the code or, intermittently. I have tried all sorts of combinations of implicit and explicit waits to little success. Any feedback would be appreciated. from selenium import web...

0
Q: Can this code for project Euler #8 be made more efficient?

Lord Loh.This a problem from Hackerrank.com and Project Euler #8. The problem statement is as below. Is there a specific algorithm to solve such problems? Can my code be made more efficient? Find the greatest product of K consecutive digits in the N digit number. Input Format: First line contains tha...

@CaptainObvious 1) Way too many imports. 2) Broken.
Swedeen is going down. leading 3 - 10 in hanball.
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Look up value from one dataframe and find percent of values in another dataframe that are less than that
@The29thSaltshaker depends what the job is for. if it's for writing VBA macros to read Excel worksheets into a database, I'd just walk away slowly. If it's for computing the trajectory of a nuke, I'd just walk away slowly.
4
20:23
I sense a certain discrimination against nukes.
@Mat'sMug I would run.
oh I got it - F(k) = uc + it, with some permutations
7
I'd want my nukes to be delivered as efficiently as possible. Developer time is not really relevant on those things.
Glorious leader need nukes to improve diplomatic relations.
I still got stars for some reason.
20:25
I believe this question is more suitable for code review SE. — atayenel 46 secs ago
18
Q: Is DRY the enemy of software project management?

Frank PufferOne of the most basic and widely accepted principles of software development is DRY (don't repeat yourself). It is also clear that most software projects require some kind of management. Now what are the tasks that are easy to manage (estimate, schedule, control)? Right, repetitive tasks, exactl...

No, that's now how it works.
There is no dilemma. If the project manager wants you to do a lot of superfluous manual work because it is easy to estimate, then the obvious solution is to fire the project manager. — JacquesB 7 hours ago
I've found that abiding to DRY too strictly has bitten me in the ass sometimes
Now this on the other hand:
211
A: Can you drink a potion one-handed underwater?

EikreI am a huge dumb nerd so I just went and proved this for myself with a bathtub and a bottle of Red Guitar. By pulling the cork with my teeth and immediately folding my thumb over the lips of the bottle, I managed leak only the merest iota of wine. If I had the clearance to stand upright instead o...

> You might as well ask for a STR check to extract your foot from your shoe.
Working code that you want reviewed and improved can be better submitted to the code review stack exchange. — James K 34 secs ago
20:38
@Mat'sMug As a programer you failed that strength check
Now I'm wondering how hard it would be to convince the local swimming pool to allow me to try his experiment at 1.5m depth.
@JamesK, okay, thank you - can I leave this question up and also post it on the code review? — heather 25 secs ago
it couldn't be wine though. alcoholic beverages wouldn't be allowed on premises. and not a glass bottle either.
@JamesK: Arguably, it doesn't actually "work", since you have to run it multiple times. She's not asking for a code review. — recursive 6 secs ago
@Duga I like that one
20:40
a plastic bottle should be extremely easy then. Just squeeze it, like it's hot.
@JamesK This would be a lousy fit for Code Review. Leave it be. — Mast 17 secs ago
omg dat code
@Mat'sMug During opening hours? No. But they're my neighbour and I've been a regular there since years.
@Mast They still might not. Liability issues and drowning and stuff.
This is the Netherlands, not the USA.
We don't sue half as much as you do.
Sure, it would need to be done responsible and supervised.
None of those have to be a dealbreaker. Not here.
20:45
@Mast You could get sued for saying that
0
Q: how to make three classes

AshleyWrite a Java code for creating three classes, namely branch_office, employee and lastly head_office which should manage details about the employees, The programmer wants to create three classes so that the employee class is only going to be accessed by branch_office whilst head_office will fail t...

@N3buchadnezzar I could get sued for quite some things I've said in this chat. shrug
@CaptainObvious HAMMERTIME!
Judge: *Points at starwall*
What do you have to say in your defence?
Is Zak back?
That escalated quickly.
No, Zak never has stars by this time of the day.
5
that descalated quickly
20:56
Thanks, that kind of code review is always good to take! Post edited. — Remi.b 40 secs ago
0
Q: Python wrapper class around HTTP API

André BorieI wrote this little class to wrap around a work-in-progress, poorly documented API and I'd like to know what else can be improved. I feel like there's a lot of repetition in the functions and I'd love to know if I could turn all those functions (which do the same thing, just setting a different c...

@RoboSanta R is so ugly
Dont let Dan hear you.
R != Rust
R is ugly
I taught my colleague R
and i still have no idea what the bloody hell it does
21:13
Even common Lisp looks like an elegant language next to R, IMO
Better than my five year old nephew's drawing. It looked like the ofspring between Cthulhu and Excel.
21:27
that's the offspring. and you know the kids aren't alright.
cough mkay. TTQW
is it possible that the intelliJ IDE for java is not as smart as it tries to be? it tells me my logic statement is always false when reached because it doesn't seem to realise that "this.something" can change if you call the method with different objects :o
IntelliJ is a JetBrains product, the people behind ReSharper. They do get false positives, but I've never seen R# be wrong on "condition is always false". got some code?
0
Q: data structure linked arrays

Ahmed Mazherthis is hyperid implementation of linked-list & arraylist implementation the total capacity are divided into √n (arrays) * √n (array size) this will lead to as i assume O(√n) for operation like indexing ,insertion and deletion and constant time for adding performance test time in nano sec...

else if (this.x == 1 || this.x == 6 && this.y == 0 && dst.x == 3 && dst.y == 1)
    return true;
else if (this.x == 6 || this.x == 1 && this.y == 0 && dst.x == 3 && dst.y == 1)
    return true;
for the second else if it tells me this.x ==1 is always false
are you sure you're reading logical operator precedence the way the IDE is?
btw that seems quite inefficient, a convoluted conditional with two branches returning the same thing... I'm pretty sure there's a much simpler way of doing this
gotta go. but anyway I'm pretty sure it has to do with || vs && operator precedence, and most likely intelliJ is correct ;-)
21:42
well I assembled my field in a pretty odd way, leaving me with a stupid amount of if statements (16 in total) to see if fields are neighbours. I didn't find a good logic to be way more efficient than that, since all ways of adding ,subtracting coordinates etc. ended up in 2 or 3 possible ways which I would have needed to differentiate between again.. so I was like "let's just go with the way that gives me the least headache"
if it works as intended it sounds like a prime candidate for a nice Code Review post
I don't think IntelliJ is incorrect.. I just think IntelliJ somehow doesn't realise "this.x" can be different values on different objects
but yeah.. I'll test it when I finish a few other things for my method and if it doesn't work I'll never question IntelliJ ever again
Anyone want to proofread an answer?
&& takes precedence over ||.
0
A: DLL for basic math operations

Hosch250Please be consistent: public static double addfunc(double num1, double num2) { return (num1 + num2); } public static double mulfunc(double num1, double num2) { return num1*num2; } In one method, you use parenthesis around the expression, and in another, you don't. In one method, you use ...

This question is confusing... You're asking for feedback, but there's hardly anything interesting going on in your code. Then, in a comment, you're talking about 'showing that developing a class library is easy', which sounds like you're writing some kind of tutorial. What sort of feedback are you looking for exactly? — Pieter Witvoet 6 hours ago
That kind of strikes me as funny, because I certainly found a lot of interesting things in that question.
I know how Boolean logic works, that's why I'm so distracted by the highlighted "is always false when reached" comments by the IDE. It would make sense if this.x could never be a different value than the value tested before that. But anyway I'll just test it when I'm done with my statements because I'm fairly certain they'll work.. but if not I won't deny that IntelliJ beat me :P
@DaeVo I've had that more than once incorrectly by R#.
I've also had it more than once correctly, so...
21:51
@Hosch250 lol, makes me feel better about Rubberduck =)
Crap. It's raining like hell and I'm going to ruin my suit
Borrow an umbrella.
@Mat'sMug Well, you could always buy a few seconds of time and look at the LQP queue.
I'd like to be able to wear polos, jeans, and sandals when I start work, which is probably around next May, if the economy doesn't crash again...
If it does crash, well, that won't be amusing. I guess if it does, I'll study study calc again/more in depth.
Yeah, well, I work for a company that makes suits (high-quality ones at that), ...how does 98% wool / 2% lycra handle heavy rain?
At least I'm not wearing the 100% silk jacket I got myself made last year
Apparently wool suits can get wet, I'll just have to lay it flat to dray when I'm home
It wasn't relevant to my question at all so I omitted to be concise and clear, this is codereview afterall. I edited with additional code. @HansPassant — Xander Luciano 10 secs ago
@Hosch250 Good answer, for such a bad question
Zak
Zak
22:06
@Mast You got me ^^
@Mat'sMug Uh, you must dress fancy.
Gosh, how much do those things cost?
We were looking to get me a suit a while back, and it was a couple hundred bucks for a low-end one. Ended up going with a sweater, tie, and slacks.
Suits are certainly not cheap (nor are they cheap to make)
I don't think I could bring myself to wear silk, I don't think.
Breeding animals for food is one thing, but silk is unnecessary.
Especially since I can't eat many nuts/soy products because of allergies.
22:12
@Hosch250 I think the silk jacket is around retail $2,100 (CAN), and the wool suit I'm wearing is probably about that much as well. I have one that's wholesale $700, so take a 70% markup and do the math... it's shit I'd never even think of ever buying for myself lol
BTW, would you guys mind taking a look at this? programmers.stackexchange.com/questions/328328/…
@Phrancis not when they're hand-crafted and union-made, indeed
So, you guys make the suits for the Canadian PM, or something?
lol, some celebrities too.. and we have quite a market in the US
So, you mean DT's suit just might be from your company?
No idea lol
How much of a discount can you get me?
I've got a wedding in december
@JeroenVannevel Finally marrying one of your GF's? Or is one of the king's granddaughter, or something?
I can't, it's my cousin
This is not Alabama
22:19
Well, say good luck and throw a handful of rice for me, please.
Well, AFAIK, even Alabamans can't marry their cousins anymore.
@JeroenVannevel aren't you in Europe?
yeah but I figure I could give you my sizes and that'll be it
I think employee privs are restricted to employees though
it's very easy, just use Superman's measurements
Bwahahaha
22:23
:->
You can't ship suits without paying exorbitant customs.
All right, driving now. Behave, CRitters =)
I'll find something here in London
See you.
I've seen a suit or two in this area already
22:38
Hi, @StrongBad.
@Hosch250 hi.
Someone suggested we rename our chatroom over at academia.se.
Was just checking out other chat rooms with non-default names.
0
Q: Naughts and Crosses game

RoseI've recently decided to try and teach myself to code. I'm using Python as I've heard it's supposed to be easy(ish). As a first mini project I'm trying to code a VERY simple game of Naughts and Crosses, where the computer will just randomly pick locations and you play against that, but I'm havin...

Hmm. I remember the renaming of the Nineteenth Byte.
We had a meta post and chose by community consensus.
@Hosch250 yup, that is what I did. Was thinking about posting links to chat rooms with good names. Decided that was too much work.
Anyone care to continue the Book discussion from earlier?
22:46
@The29thSaltshaker Sure but may be best in The Nth Monitor chat room, where the whole conversation was moved
Ah -- what's the difference between rooms?
Well, this room is the main room for the site, so we try to avoid lengthy conversations. The other room, pretty much anything goes
@Mat'sMug I got your storm.
Unless it is its friend and relation, of course.
BTW.LispIsFun && BTW.MathIsFun
23:04
Which is more fun?
@N3buchadnezzar do you feel that much/any calculus knowledge is needed in learning discrete math?
I don't know, but calc is fun--I know because I did it.
@Hosch250 Depends. I'd say Lisp is funner to me at the moment, because I'm a bit better at it.
@Hosch250 Can you think of some kind of short reference (mostly for the symbols) that I could use whenever I see the occasional example that involves a bit of calculus?
Well, not really.
It can be hard to know what to look for if you don't know it.
Just learn how to do integrals and differentials. It seriously isn't hard at all once you know the shortcuts.
Depends on the problem
23:08
Like, you-could-do-it-in-your-head-easy for many equations.
My backup ^
File transfer apparently is slower for lots of little files than for one big one.
Also, that is over a USB 3.0 connection.
Oh no.
I didn't delete the deployments folder for RD.
R# cached hundreds of files in there.
Now my backup says 2 hours (experience says between 40-60 minutes).
Hehe, now it says 10 minutes because it hit the SQL Server download.
Someone want to move me out of here?
@Hosch250 lol, "community consensus" was like 6 users back then haha
For the Nineteenth Byte?
no here
23:18
It had almost 20 votes by the time the room name was changed.
Oh.
Code Review General Room sucked too much to keep it around much longer haha
See I'm stuck on this formula because I don't understand the calculus parts of it... :)
That is the lim, epsilon, sigma and those vertical bars lol
@StrongBad make it something that evokes a bunch of site regulars getting together chatting about the main site. Could be, idk "the boardroom", or "the principal's office" (although that might be more appropriate for the moderators' private room), whatever - make a meta for it, community is usually good to come up with something nice - and if it's bad, you could always change it later - good luck!
@MarcusS THANK YOU :)
Hmm that's not sigma, should be delta function
Like this
Thanks, that makes me feel like a preschooler looking at some algebra equation.
And this, kids, is why you shouldn't drop out of college
23:30
Well, it does me too, a bit, there's a pretty long explanation along with it
@StrongBad the mensa
Is it basically always the case in math notation that |x| means "the absolute value of x"?
no. $\vert x \vert$ is usually a defined operator
e.G. for Vectors it's usually their length
@Vogel612 Hm. Can you click on the last screenshot I just posted, and see the expressions between bars on the right... what do you think it means?
That's absolute value
Sometimes it's also used to indicate magnitude / length (for things like vectors)
or the cardinality of a set
23:42
@Mat'sMug Don't worry, I don't know those symbols either.
I know integrals and differentials, and that's it.
Or, I should really say "knew".
Yeah, been some 4.5 years since I did that, I guess.
All I remember is that the integral has to do with the slope of a curve. Literally, all I remember, 15 years later.
area under the curve yo
also really helpful in statistics and probability
for example: What is the expected length of the longest part of a stick of size 1 if you cut it in two at a uniformly-randomly chosen point?
and this is why I do SSRS reports for a living
23:47
@Phrancis that's an interesting way to phrase how limes works
@The29thSaltshaker guts say 0.5, but that's also the length of the shortest part of the stick
For some reason something seems to be telling me around .67.
^^ that sounds about right
Try posting on the Code Review Stack Exchange — Maybe_Factor 55 secs ago
possible answer invalidation by Ahmed Mazher on question by Ahmed Mazher: codereview.stackexchange.com/posts/138882/revisions
@Duga quoted code block, should be fine
23:51
@Mat'sMug You're looking for the expected length of max(x, 1-x)
You mean the max expected length is 1?
@Hosch250 probabilities come into play here
The far left of the stick, mark it 0, the far right of the stick, mark it 1. Let x be the point at which you make the cut. Then you get two sticks: One of size x, and one of size 1-x. The larger of the two is max(x, 1-x)
And x is uniformly chosen over 0 through 1
@Vogel612 He said that x == 1.
Oh, OK.
I could've solved that about 1.5 years ago when I did statistics, but I forget how now.
So you are computing E = [integral from 0 to 1] max(x,1-x) dx
23:55
IIRC, though, it is still around .6x.
well that's the same as \$E = \frac{1}{2} \int_{0}^{.5} x dx\$
which boils down to 0.5 + 0.125 = 0.625
that is if my maths is correct there
@Vogel612 Sounds about right.
I remembered from statistics that it wasn't .5, but I couldn't remember the exact number.
This can be split into two parts: x >= 1-x when x >= 1/2, and 1-x >= x when x <= 1/2, so E = [integral from 0 to .5] (1-x) dx + [integral from .5 to 1] x dx = 0.375 + 0.375 = .75

« first day (1200 days earlier)      last day (3116 days later) »