« first day (2140 days earlier)      last day (1867 days later) » 

12:00 AM
RELOAD! There are 5876 unanswered questions (89.9323% answered)
 
12:10 AM
TTGTB
 
0
Q: Calculating the potential of a matrix of size (424600, 55)

An studentI have the following working code to calculate the potential of a matrix after normalizing the matrix. But it is too much time consuming. Is there a way to make this code run faster? import csv import numpy as np from normalization import normalized_matrix n = len(normalized_matrix) sigma = 1 po...

 
12:31 AM
0
Q: Project Euler problem 8 Not sure what I'm doing wrong

GokuTrying to do project euler problem 8, and I'm super confused what I'm doing wrong. I know this algorithm is brute force and that is intentional until I get the right answer. I could skip further ahead whenever i find a 0 etc. Just want to know why I'm not getting the right answer // ProjectEuler...

 
1:29 AM
I'm voting to close this question as off-topic because this belongs to codereview. — Naman 45 secs ago
 
1:48 AM
0
Q: Move and resize square boxes with Vanilla JS

gentlejoFeature requirements. I can move a square box. I can resize a square box by stretching four edges. Many square boxes can exist. I've implemented moving and resizing square boxes by module pattern. Of course, I thought making a square box as a Class. But I think that using module pattern is be...

 
2:27 AM
0
Q: Return Full Month Name From 3 Letter Month

user2676140I have piece metaled this code together from multiple google searches and thanks to the function from the site mentioned in the code. I am sure there are ways to optimize this for speed. What do you guys suggest? using System; using System.Globalization; public class Program { public ...

 
2:46 AM
0
Q: code is duplicated to meet various conditions

SerenityThe use case that this code tries to meet is There will be an interview session where the video calling is done between two participants, interviewer(ER) and interviewee(EE) For this i need to have a video element and reference that video element using ref. For ER its a localStreamRef and for EE...

 
3:44 AM
0
Q: Can I make this Dictionary sort (smallest to biggest) algorithm more concise? Swift

OutsiderI have the bellow sorting algorithm which takes an array of dictionary values as declared below. guard var imageUrlString = anyImage.value as? [String:AnyObject] else { return } I then loop through it adding the values with the smallest Int key to a new array to be used afterward. Thus the v...

 
codereview.stackexchange.com is probably a more appropriate place for this question. — Nick 23 secs ago
Considering your code already achieves the desired result, this question may be more suitable for StackExchange's CodeReview instead :) — Obsidian Age 58 secs ago
As others have said, this would be a better question for Code Review. Before posting there, please take their tour and be sure to ask a specific question (what, exactly, do you want people to analyze about your code?). — Ed Cottrell ♦ 28 secs ago
 
4:06 AM
0
Q: Ranking Score System

Prashin JeevaganthI have an assignment to solve this problem. There are a total of 12 test case files, 1 of which that I have failed due to exceeding limit on the script. Question Description Bob has somehow managed to obtain a class list of N students that contains the name of the students, as well as...

 
4:25 AM
0
Q: String Replace for 8000 Company Names Iteration with PHP (Slug)

EmmaI wrote most of this working and beginner PHP script and I'd appreciate it if you would possibly review it and help me to replace slugCompany method (which only iterates ~8000 times) in the UpdateStocks class with a faster or simpler method. Thank You So Mcuh! Method: /** * * @return a string...

 
 
1 hour later…
5:51 AM
Monking.
I talked to some customer support the other day, as I wasn't able to login on their site.
> We can't see anything broken in your account; you have however a rather long password, is it longer than 18 letters? We only support passwords from 8-18 letters due to security reasons.
Turns out, my 20 character password was accepted and probably trimmed when I created the account, but not trimmed when I tried to login. Still begs the question whether they store the passwords unhashed, how would they note the password length other wise?
 
6:18 AM
Monking
 
6:44 AM
Monking
@Zeta Oh, I've had that crap before on my router. There's different tools for maintenance on that (cheap) thing and not all of them can handle the same passwords.
It's quite disconcerting that they can see your actual password though. Not that the competition is doing it better (usually), but still, it's 2019. Before best-practices reach half of the companies takes much longer than it should.
 
7:00 AM
0
Q: Usage of R-value reference

samnactionI had submitted below code for review. //centerX, centerY, xradius, yradius is some float value for (int i = 0; i < num_segment; i++) { float theta = i * M_PI / 90; ====> got an code review here x = centerX + (xradius * cos(theta)); y = centerY + (yradius * sin(theta)); .... } ...

0
Q: 2D counterpart of std::array in C++17

LingxiI implemented a 2D counterpart of std::array named array2d in C++17. It is an aggregate like std::array, and provides similar interface. The goal is that if you know how to use std::array, then you will find yourself at home using array2d. Any comments are welcome :) For better viewing experience...

 
7:50 AM
possible answer invalidation by Rovdjuret on question by Rovdjuret: codereview.stackexchange.com/posts/215361/revisions
What is the question? If you just want someone to review your code you need to post on the code review site. — rghome 15 secs ago
 
8:25 AM
Monking
@Zeta Either they store the password encrypted and they have the key (which is bad) or they store it plaintext and that is even worse! If you are able to switch run while you can ;)
@Zeta Passwords should have a upper bound if they are hashing them with a good algo, else you could potentially DDOS the backend by letting it compute hashes of 10000 letter passwords
 
0
Q: Coding style - Early return from method or "if" before calling method?

Krzysiek RyszLet's assume I have to add some functionality (i.e. calling new web service) into old code in several places, under some condition. Example: public void someFunction() { ... //old code if ("A".equals(item.getCode())) { String comment = item.getComment(); webService.call(comment); ...

 
8:49 AM
Your code is perfectly fine. These questions are better to ask at codereview.stackexchange.comSam 36 secs ago
 
0
Q: Angular pipe to suppress sensitive information

AhsanI have created an Angular pipe to suppress the sensitive information like credit cards, bank account, ABA numbers etc. This is working fine but I would like to know if this is the best possible way to implement the logic. Here is the Typescript code for pipe logic. export class SuppressInfoPi...

 
9:53 AM
0
Q: Powershell - Excel | Count number of rows in specific sheet

RémiI'm trying to count the number of rows for a specific sheet in Excel with Powershell. Here what I tried : $excel = New-Object -ComObject "Excel.Application" $excel.Visible = $false $workbook = $excel.Workbooks.Open($fileList.Item($i)) $workbook.Sheets.Item(3).Activate() $worksheet = $workbook.W...

0
Q: Fetch the multiple images from JSON using foreach

vickey colorsI am fetching the images & its positions from JSON using foreach.... Is there any way i can improve code standard for performance & other things.... https://codepen.io/kidsdial/pen/EMQVqK var target; let jsonData = { "path" : " newyear collage\/", "info" : { "author" : "", "ke...

 
10:12 AM
Monking
 
10:34 AM
You should check if your question would be better suited to codereview.stackexchange.com . Here we fix bugs or answer specific programming questions, we don't do a general comment on your code quality. Thanks. — ADyson 8 secs ago
 
10:51 AM
0
Q: Generic library for querying various kinds of databases

Black Rock ShooterSince C# 8 and .Net Core 3 are going to be released sometime this year, I wanted to try and convert the library I made to make querying databases easier, implementing the already accepted features (using declarations, patterns, ranges, ...). I'm going to pre-emptively say that parameters aren't ...

0
Q: Generic map library in javascript

ebelairI'm not a JS master, so I need some advice about something I need to do. I want to make a generic lib that use Google map or OpenStreetMap depending of the config. So, after reading mdn doc, I've created something. Can you tell me if this code is good practice or not. Maybe there is a better way ...

 
11:11 AM
0
Q: How to optimize my manhattan distance?

Pedro MartinsI have an algorithm (IDA*) that solves the 4x4 sliding puzzle program. My program is a bit slow, and I am looking for ways the speed it up. I managed to find the main problem of this speed issues, and it was my manhattan function. I followed this post Optimizing Manhattan-distance method for ...

 
11:30 AM
0
Q: Unable to move discs in sequence - Tower of Hanoi (Animated)

user195194I am trying to move each disc automatically to its location. Basically show the user each step visually. I am able to move a block horizontally but I am finding it difficult to move them all automatically in sequence. What I used to print to text: var poleA_X_Coord = '200px', poleB_X_...

 
@CaptainObvious broken
 
12:09 PM
0
Q: ocaml merge sort

Andrew AuHow do I make this more "ocamlic"? let rec spilt = function | [] -> ([],[]) | [h] -> ([h],[]) | f::s::t -> let (rf, rs) = spilt t in (f::rf, s::rs) let rec merge a b = match a with [] -> b | (ah::at) -> match b with [] -> a | (bh::bt) -> if ah < bh then ah::(merge at b) else bh::(merge a bt);;...

0
Q: Ruby - Core skills example project (command line vehicle registry)

NiallThere are no requirements for this project nor will it ever be used for any purpose. I used this project to cement my knowledge of basic programming skills, I got bored copying the examples and felt I would learn faster if I built everything into a functional program with a little complexity. I...

0
Q: Function to parse .NET composite string format

Zev SpitzWhen generating a string representation of expression trees, I would like to render calls to String.Format with a constant string as the first parameter, as interpolated strings (link). In order to do so, I have to parse the compiler-generated composite format string. I've written the following ...

 
Discussion of running code is offtopic on SO and more a subject for codereview.stackexchange.comQuasimodo's clone 1 min ago
 
 
1 hour later…
1:26 PM
2
Q: How do I simplify my virtual zoo game through Object Oriented Programming?

Jon FrankI have finished my code for a "Virtual Zoo" game and I'm wondering how I would make the animals I added so far (Lion, Tiger, Bear) into sub classes so it's easier for me to add an animal in the future and the code would look neater. My goal if possible would also be to add the attributes of 'he...

0
Q: Find same characters in 2 strings

DasSaffeI have a solution, which compares 2 given strings and returning the number of total matching characters. I know I havn't initialized the variables and arrays and that this (correctly) yields warnings. I know the variables aren't self-explainatory as they should be. function commonCharacter...

 
2:26 PM
This is also off topic for code review. — 422_unprocessable_entity 27 secs ago
 
2:45 PM
How long does it take? Thought if the code works you should go to codereview — Damian 31 secs ago
 
3:02 PM
0
Q: Permutation and subsequences of string

Prashin JeevaganthI have an assignment to solve this problem. Iā€™m not too sure how permutate works by tracing, just tried on inspiration and it works. This code runs on all provided test cases, but Iā€™m just trying to look for ways of improvement in terms of time efficiency, space efficiency and styling. Questi...

 
This is a also a forum where "people ask about their broken codes". You can get help if you post your code and have some problem. If you want someone to review your code and suggest improvement, I would say, post on "codereview.stackexchange.com" — Swanand 40 secs ago
Give me a link to your Code Review post if you make one - interested to see what they can do — Badja 16 secs ago
Would my question above be a Code Review question? — Joost 47 secs ago
 
3:35 PM
Also, probably a question better suited for codereviewRawrplus 49 secs ago
 
4:00 PM
-2
Q: AI self learning program?

Panda23How can i make a self learning A.I Program ? . I saw an answer but when i copied pasted it into blueJ , it says that the package does not exist and that i have to change the location of the package or to create one , how do I do it ? , as im very enthusiastic about it and i want to learn , please...

 
@CaptainObvious No...
 
4:20 PM
0
Q: A class scraper meant to grab some profile name

MITHUI've created a script in python to log into stackoverflow.com using credentials and fetch the profilename once logged in. I've tried to do it using class. I created the methods within that class in such a way so that they work like chain. Should I stick to this design or there is anything better ...

 
Welcome to StackOverflow! Questions like "can this code be better" (the answer is always yes) are too broad and are not well-suited to StackOverflow. You might try Code Review Stack Exchange. — Adrian 20 secs ago
 
4:39 PM
1
Q: Non-Entity Framework Database Interaction Model in C#

pacmaninbwA C# WPF user interface has been developed for the Book Inventory MySQL database previously shown in this question. Since the database had already been developed this was a database first implementation. I did find that additional stored procedures were necessary to implement the Add Book dialog...

0
Q: Java 8: Efficient and performant way to get Current Timestamp and compute the Timestamp difference in minutes

RanPaulI have the below code to get Current Timestamp and compute the Timestamp difference in minutes, am wondering if this can be optimized further for production public static Timestamp getTimestamp() { java.util.Date date= new java.util.Date(); long time = date.getTime(); ...

 
4:57 PM
Monking
 
0
Q: Download and save bulk URL concurrecntly in golang

MatinMoeziI am new in golang and wrote program in order to download and save bulk url concurrently.It is work correctly but I want to ask is it efficient or can it be better? (I would like to use best practices) package main import (...) // Connection String const connectionString = "connectionString" ...

 
5:18 PM
0
Q: Design a class named Box whose dimensions are integers and private to the class

Ammar AhmadDesign a class named Box whose dimensions are integers and private to the class. The dimensions are labelled: length l, breadth b, and height h. The default constructor of the class should initialize, l, b and h to 0. The parameterized constructor Box (int length, int breadth, int height) should ...

0
Q: C : char ** dynamic allocation ->

Casey BowdenI get the following error, why? * Error in `parser': free(): invalid next size (fast): 0x000000000129b630 * int numErr = 0; char ** err; char * token; int main() { int i; token = malloc(sizeof(char *)); for(i = 0; i < 20; i++) { memset(token, '\0', strlen(token) + 1); ...

0
Q: Array that stores values from two ranges and compares if one cell is blank

Zack EThis is my first Array in VBA for Excel, but I need some help to optimize the code and try to reduce the number of If statements. The long and short of the code is that it checks to see if there is a Customer name in Column B and checks that against Column A; if there is no value in Column A the...

 
@CaptainObvious Broken code.
 
5:37 PM
0
Q: Select depart date, 5 days from today and return date, 6 days from today in Selenium

Sh87I am automating a scenario of flight booking on Cleartrip.com(https://www.cleartrip.com/flights) in which I have to enter depart date, 5 days from today and return date, 6 days from today. I have written below code. Date dt = new Date(); Calendar calendar = Calendar.getInstance(); calendar.setTi...

 
5:56 PM
0
Q: I don't want to define a method in a base class as abstract but I need that method to exist. Is it ok to do this?

Guillemo MansillaI have a method (send) that needs to access another method (beforeSend). BeforeSend might be defined in child classes to make some checks. With the approach I have bellow I don't like the fact that beforeSend() is a simple method that returns true. I want to know if this is OK. Originally I had ...

 
6:11 PM
@CaptainObvious that's some unfortunate URL truncation there
6
 
I accepted this answer because it was precisely what I needed to spot the problem and fix it. I disagree strongly with the downvotes. Other answers have veered toward an unrequested code review -- informative but not what I was looking for. I simply got careless adapting from the Go http tutorial and hit one of those mental traps where I overlooked the obvious. — Mike Ellis 12 secs ago
 
@CaptainObvious [i-need-that-meth]
 
0
Q: Asking for opinion: I'm not sure if quality of code in my Django project is decent

Kurachalike in title I'm not sure if quality of code in my Django project is decent. I wrote simple web app project during my process of django learning , and I want to start looking for my first job as developer(In start I want to intern), but I'm not sure about my code, especially whether my tests and...

 
@CaptainObvious No code, no glory.
So. Dwarf Fortress will come to Steam with graphic packs.
Will be interesting if dfhack still works after some patches, or if it is even necessary.
 
@Zeta ~bam
 
6:19 PM
*salutes*
 
@Zeta oh jeez, that sounds like a good timesink
 
A !!fun!! timesink.
 
to each their own, I guess?
I'll stick with supreme commander / dark souls / factorio
 
Eh, that was more or less a joke. If something is on fire, then DF will add exclamation marks around the object's name.
 
see, I'm too young to get that joke :)
 
6:23 PM
House: Normal. +House+: Good quality. !!House!!: This is fine.
 
Exactly.
 
I really like that "easter egg"
 
It's just "this is fine."?
 
without the dot.
 
6:25 PM
Got it, thanks.
 
You should be able to check the message history
 
Ayup.
 
> The numpyier version would require somewhere between 4000 seconds (1 hr, 20 mins) and 4,000,000 seconds (50 days).
yea, that seems reasonable...
 
What's the alternative?
 
waiting for the heat death of the universe, basically...
well, not quite, but...
probably something around a few years of runtime
 
6:30 PM
@CaptainObvious Not implemented. Broken question due to stray < in text. Box class completely missing.
 
yeeesh.... they didn't check the preview before posting...
 
They ask for code, they basically just dumped the assignment (it's the box-it challenge, see codereview.stackexchange.com/questions/146707/hackerrank-box-it for example).
 
I was kinda sidetracked by the fact that half of the description was swallowed by a stray <
but yea, now that I edited it and can read it without getting completely sidetracked, I agree
 
@Vogel612 Yes, why isn't it closed yet though?
 
@Mast I just skimread that and I don't know enough PHP.
But I didn't find instant-nuke stuff, so I enqueued it into my tablist
 
6:39 PM
class Bar extends Base
{
    //no beforeSend defined because i dont need to check anything
}


$a = new Foo();
$a->send();

$b = new Bar();
$b->send();
That's not an instant close for stub code?
 
I'm kinda mentally spent rn...
 
@Vogel612 Don't worry, that's what you got the rest of us for.
 
remedied :)
 
Gracias.
 
hey, at least I'm only 15 hours behind the site :)
 
6:43 PM
I've been staring at a slowly progressing htop output for some docker build, just to notice that it's the wrong image that I'm buildingā€¦
 
you're working late, huh?
 
Yeah. I really want to finish that build. Although I cannot remember why it was even necessary. Where's the git logā€¦
 
We all have our moments like that.
I remember coming back to work Monday morning, expecting to see the results of a simulation I had been running all weekend. Guess what?
Passed the wrong arguments to the simulation.
Bloody useless results.
 
Ouch.
 
I have code running in production for three months and today realized that a piece of my code is not doing what I intended it to do...
 
6:52 PM
that reminds me of my disaster with the RegexAnalyzer...
 
It's only used to return our half million webpages that get requested every day
 
whooooops
 
@skiwi Ok, you win.
 
Still need to read it
"The danger of TaskCompletionSource<T> class"
 
Should probably fix it before the weekend, I figure?
 
6:53 PM
Basically I have a single thread of which I thought that it would take responses, store them somewhere and continue... but apparently it's also handling the part after the await, which is way more expensive
 
1
Q: Code to find the sums of building heights

harshit54Problem Statement TLDR; Heights of first two buildings and the total number of buildings are given. For any three consecutive buildings, the heights of the two smaller buildings sum up to the height of the largest building within that group of three. This property holds for all consecutive trip...

0
Q: Python Tkinter Tetris debugging help and program efficiency

PythonFan3362I'm quite far into making Tetris in Tkinter along with the incorporation of Tetris' SRS. Due to the game becoming rather complex I need some help debugging it as I recently encountered some strange and weird bugs with the I pieces which I think is associated with the "hold" function. I think tha...

 
@Mast Meh, it worked the last three months, it'll work the next months as well
 
@skiwi So it's doing more than it should, instead of less?
That's a performance problem, not an immediate bug.
 
We had a two minute "outage" [most likely] because of it yesterday, and apparently it's been close to that a lot of times before, but it's not a big issue
 
@CaptainObvious ~broken, closed
 
6:55 PM
@Mast Yeah, but the whole application is structured with the idea of that thread almost always being available
Our webpages used to be synchronous, within a project I've made them asynchronous, but apparently only sending the request to the backend server is really asynchronous, the sending the results back to the user part is not performing well because of that issue
Btw, can you help translating this sentence to English? :D
"Ik zou jou weleens hebben willen zien durven blijven staan kijken."
 
@skiwi Darn. Sure.
"I would want to have seen you dare standing looking there."
Might need a comma.
Or two.
 
My brain melted when trying it
 
Both sentences are grammatically awkward, really.
 
I'd reorder the end there to "... dare standing there, looking"
 
But they should be about right.
 
7:04 PM
Also, fun Dutch word, "slechtstschrijvend"
9 consonants in a row :D
 
badlywriting?
 
@Vogel612 Yes, but I'd do that in the Dutch version too.
@Vogel612 worst
Note the slechtst
 
ah. ya the st kinda got drowned in the sea of consonants
 
@skiwi The German translation by Google translate looks readable.
 
@Zeta It makes a lot of sense surprisingly
 
7:06 PM
yay, down to ... 8 open tabs of CR questions
 
1196 tabs...
 
All CR questions?
 
It doesn't show the total :(
 
0
Q: Synchronization issues in blelloch scan

HimanshuI am trying to implement blelloch scan. I am attaching the code. I call this kernel with <<<1,NUM_BINS>>> as grid and block dimensions. NUM_BINS is 256 in my case. The answer I get for cummap varies in each run. I am not able to see where I am missing any synchronization or ignoring a race condit...

 
@CaptainObvious also broken ...
jeez...
 
7:15 PM
And it turns out that the docker build wasn't necessary, because the software configuration I changed was wrong. Thanks, broken/wrong documentation of external software >.>
 
~sending positive vibes
 
I'd rather have a pizza, but thanks :D
Well, the fast ugly hack works, so I guess I'll hit the "build everything while I'm away button" and go home.
 
@Zeta Sure sounds tempting
 
~sigh... started writing a review, noticed the code is bork
aaaand again ...
 
7:52 PM
It usually goes the other way around with me.
I only want to leave a comment, get trapped and write a review instead.
 
I haven't reviewed on here in a looong time
 
my new latest review is literally just "the whole point of the code you've written is to be a memory leak, you could fix that using WeakReference"
 
If any of you are good with algorithms, I did all the dirty work already here. Suggest a better algorithm and get free points.
He's using something greedy where he should be something optimized. But I'm not really (read: totally not) an algorithm-optimizer. Not my thing.
 
what he wants to do is preallocate an array and use a sliding window to fill it up and then sum it..
and the code that is currently used, does that, but in a somewhat unobvious way and without a double pass.
 
Damn, he has 5 seconds but it took him 5.013397 seconds
 
7:59 PM
I think there may be a mathematical solution to the problem, though ...
 
I vaguely recall trying something like that on a bunch of fibonacci rabbits, same idea?
@Vogel612 I'm convinced there is, yes.
@skiwi I think it stops after that.
 
I'm too braindead to think about it
@Mast Ah
 
\o
@YvetteColomb you came to auction some more SO questions?
 
@Vogel612 no. I have this room favourited :)
also, feel free to ping me in here if there's any help you need from our end
 
We're your favourites now? gush
 
8:03 PM
yep. Have been for a few weeks now
I got sick of going to your site and the chat room :)
 
And we have such an easy to remember name.
 
I mean, looking for the chat room that way... that sounded bad.. sick of going on your site
@Mast ikr.. I actually don't remember it :p
 
We have the 1st, the 2nd and the nth. It all makes sense.
 
Hah. Rolled back an invalidation before the mighty @Duga caught it.
 
8:10 PM
possible answer invalidation by harshit54 on question by harshit54: codereview.stackexchange.com/posts/215443/revisions
 
Yes, that one.
 
0
Q: Counting number of inversions in quick_sort algorithm(Partition is median)

DY92 The goal is to compute the number of comparisons, using the "median-of-three" pivot rule. In more detail, you should choose the pivot as follows. Consider the first, middle, and final elements of the given array. (If the array has odd length it should be clear what the "middle" elem...

 
@CaptainObvious ummmmmm....
dunno, that seems bork?
like... it does sort, but apparently it incorrectly counts, soo ...
@Mast I tried my hand at it for a bit, but there doesn't seem to be a terribly easy solution just yet.
there might be something around factorization and remainders, but I can't put my finger on it just yet
there's the thing around when a 0 shows up you get the building twice, then a zero in a loop.
 
@Vogel612 You can probably cut the iterations at least in half using some math trick, but I'm done with math today.
 
but until you get a zero, the building heights are decreasing overall...
 
8:18 PM
@Vogel612 Total bork, or half bork?
 
@Zeta total bork
Your output is incorrectly missing na and nt and incorrectly contains a duplicated tan, which is not a subsequence that is shorter than the complete alphabet. As such your code is not accomplishing the goal it was written for and therefore the question is unfortunately off-topic for this site. For more information, see the help center. Thanks! — Vogel612 ♦ 58 mins ago
and subsequently:
This code does not actually perform any kind of multithreading. As such it does not accomlish the goal it was written for. This means the question is off-topic for Code Review in it's current form. For more information, please see the help center. Thanks! — Vogel612 ♦ 55 mins ago
 
@Mast Speaking of the Nth, we should probably unfreeze it.
 
@CaptainObvious It sorts correctly but using more steps than he expects.
So, kind-of borked.
 
@Zeta I don't really see a reason for it...
 
It's only borked since the spec is so strict though.
 
8:20 PM
It's not like we're generating reams of transcript in here...
 
True.
 
Nth was intended as an "overflow"-room. If there's no overflowing happening, it doesn't serve a purpose
@Mast ha. Found something. The building heights have the property to nicely recurse according to divmod.
 
@Vogel612 Oh heck, recursion strikes again.
 
so given a, b, there is a sequence of floor(a / b) linearly decreasing values which ends in a % b.
and that in turn "starts" a new sequence with a%b, |a - b| or something similar
until you reach a case where a%b = 0
 
Which drastically reduces the amount of iterations, right?
 
8:29 PM
at which point you hit a loop and can calculate the remaining height
There should be an analytical way to capture these iterative reductions, so I fare this drops to a logarithmic complexity class
aka: yes. A drastic reduce in iterations
actually the follower sequence should be with a%b, min(a,b), if a/b < 2
 
And you found this out how?
 
mostly just running a few examples.
 
Was just going to say that the numbers start to repeat, e.g. 10,7,3,4,1,3,4,1,3,4,1...
 
20,2
20,3
2,20
@Zeta but that's not right... it's 3,4,1,3,2,1,1,0,1,1,0,1,1...
the only cycle involves a 0
 
Note to myself: don't check puzzles after a 13h(?) work day.
 
8:34 PM
oh wow .... are you alright?
or rather: how bad is the metaphorical fire you're putting out?
 
Oh, I'm already at home.
The metaphorical fire was but a candle.
 
@Mast I first tried to do it with a case analysis using building heights a and b, but that proved to be rather difficult to reason about
 
@Zeta So, no cooking for you?
 
Well, it's just one of many, soā€¦ ehhhh.
 
Candle illuminates others, yet destroys itself.
@Vogel612 Ok. Might you be interested in writing your findings as an answer?
 
8:40 PM
I don't quite have an analytical solution yet...
it shouldn't be too hard to figure it out, but I'm not really in the mood for it just yet
 
No pressure, it just seemed like you had a good foundation for an answer in hand.
Incomplete answers can still be answers. My review wasn't particularly complete either.
 
I found the seed for an analytical solution to this problem with a bit of messing around. Preliminary results are available around here in our main chatroom. Unless I get to it (and delete this commment) everyone is welcome to use what I found out to write their own answer :) — Vogel612 ♦ 1 min ago
how is there still 10 posts in the close queue...
I've closed 10 of 37 questions today...
 
0
Q: CSS Hover on contact form

thecableguyfirst question here :) I'm trying to edit this contact form and would like the basic hover color change on submit button, is this code below the best way to do it? .submit{ @include rtl-text-align-right(); .btn{padding: 5px 50px; border-radius:50pt; background-color: white; b...

0
Q: Validating user input

PerfectContrastI've written the below code to validate user input but I feel it's quite excessive for what seems to be a simple operation. I want to only accept non-negative integers or doubles as an input. This block of code is required three times in my program so I will need to put it into a method or someth...

 
@CaptainObvious sigh... misaligned code using tabs for indentation...
 
This question seems to be concerned with performance and if so may be better asked on another Stack Exchange site one dedicated to code review. Be sure to read the relevant FAQ before posting. Good luck — MickyD 45 secs ago
 
8:53 PM
I'm at 1929 reviews just for the Close queue alone.
 
~1k less reviews, ~1k more close-votes overall
dunno what your review to vote stat is though
 
@CaptainObvious Missing some code, e.g. input's declaration.
 
^^ do you see deleted posts that you voted to close there when selecting the [closure] subtab?
@Zeta input is a Scanner
that's inferrable from context.
 
 
hmm ... apparently tabs don't work with /users/current ...
 
8:56 PM
@Vogel612 Yes.
 
okay, cool. Good to know :)
 
@Vogel612 No, it works. But I don't see them, I think. Since it only shows 721 votes and I'm pretty sure I've VTC'd more than that.
Might be because I'm <10k.
 
yea, seems like it
 
I've told myself I should fix that. Over a year ago.
Progress last year in reputation has been abysmal.
 
because given the close rates of CR it's rather unlikely 1.2k of 1.9k reviews were a "leave open"...
@Mast yea, I've been voting waaaaayy less
and I think it's the same for many others...
 
8:59 PM
@Vogel612 I've been posting way less too, I think.
@Vogel612 Yes, I suspect at least 70% was VTC.
 
@CaptainObvious Added missing declarations.
 
Well, the queues are empty again for me.
 
Same here.
 
I've been wanting to upload my Steam Achievements helper for a while, but it's so rough it's not really presentable. Keep getting sidetracked.
Hope to get that done this weekend...
 
0
Q: Queue Interview Code basic methods made from struct Node optimized

gregUsing feedback from my previous implementation I'm writing a very simple Queue of struct Nodes with only these methods get_front(), get_back(), pop_front(), push_back(), and a ostream friend method. I want this to be reviewed as production code and is to be treated as code that could be used in a...

 
9:14 PM
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.com — Joshua 7 secs ago
 
9:29 PM
@Jarod42 Are you trying to melt the code reviewers brain? ;) — NathanOliver 25 secs ago
 
-1
Q: Plotting decision tree in R keeps getting error in rpart

Cam1909testsetp <- uselection2[uselection2$Election == ā€˜pā€™,] [sample(18,3),] testseto<- uselection2[uselection2$Election == ā€˜oā€™,][sample(13,2),] testset <- rbind(testsetp, testseto) trainingset<- uselection2[-as.numeric(rownames(testset)),] trainingset[3:14] <- sapply(trainingset[3:14], as.factor) tests...

0
Q: Refactor Program that Outputs Binary Values of Input

J PexI am looking to simplify my main() function. The nested if statements contain four lines of the same code, and I'm unsure of how to refactor and simplify it. I was attempting to use booleans, which seemed like a safe bet, but the logic gets skewed in the process. #include <bits/stdc++.h> #include <

 
9:55 PM
Considering your code already achieves the desired result, this question may be more suitable for StackExchange's CodeReview instead :) — Obsidian Age 1 min ago
 
10:05 PM
possible answer invalidation by Outsider on question by Outsider: codereview.stackexchange.com/posts/215392/revisions
 
 
1 hour later…
11:14 PM
I'm voting to close this question as off-topic because it is better suited to the code review Q&A — b.enoit.be 34 secs ago
 
11:25 PM
0
Q: Avoid repeating a function call from HTML in an Angular 7 application

Kushan RandimaI have been developing an application using Angular 7. I am calling some function written in Typescript, from some HTML elements. The function simply returns a boolean value based on the second parameter which represents the month ID. I am wondering whether I can call this function only once and ...

 

« first day (2140 days earlier)      last day (1867 days later) »