« first day (1603 days earlier)      last day (2713 days later) » 

00:00
RELOAD! There are 4403 unanswered questions (90.7444% answered)
00:35
possible answer invalidation by user1692342 on question by user1692342: codereview.stackexchange.com/posts/176351/revisions
01:01
Apparently they are considering posting the GoL Tetris on CR.
 
1 hour later…
02:17
@Feeds Yet another duplicate of the font weights problem, -.-
03:10
possible answer invalidation by 200_success on question by SMC: codereview.stackexchange.com/posts/176317/revisions
@Duga No, that's ok.
03:32
0
Q: Runtime error(NZEC) on SPOJ while successfully running at ideone

Atul Kumarplease review the code? problem : for given a and b find the nth number divisible by either a or b def hcf(a,b): if a==0: return b else: return hcf(b%a,a) t=int(input()) while(t): a,b,n = map(int,input().split()) l=min(a,b) h=max(a,b)*n+1 hc=hcf(a,b) ...

0
Q: A priority queue where elements have keys and can adjust element priority by key

Andrew AuCan we please code review this? This is the code for a priority queue where elements have keys and can adjust element priority by key. Written in Python 3. class priority_queue: class node: def __init__(self, key, value, priority): self.key = key self.value =...

04:31
0
Q: format strings are created and commented out to increase DrinkyTheCrow's comprehension

DrinkyTheCrowFrom "Learn Ruby the Hard Way" Do my comments make sense? An exercise or practice Zed preaches is commenting out while learning; That is, after writing the code, students are to go back through the code and add comments above each line of code and describe the code's intended purpose or functio...

 
1 hour later…
05:47
The first part of the question probably belongs to CodeReview.SE, and the second part of the question has been answered here. — Nisarg Shah 14 secs ago
06:00
@wrkyle Phrogz is correct: when I wrote "with actual code" in my comment I was thinking "with actual data", sorry for that mistake. The problem is that you have too much data points, and that's why I suggested interpolating: you can reduce the data points and use a D3 curve. This answer of mine at Code Review can be useful to you: codereview.stackexchange.com/a/171946/143592Gerardo Furtado 12 secs ago
 
1 hour later…
07:19
0
Q: how to make biased rand function in python

codaholicI want to generate custom random number generator which should be 73% biased to the higher number. Like if I want a random number between 1 to 10 100times then it should give number more than 5 73times and less than 5 27times. As the Question has two parts here : Make a random number function...

08:06
This should be on the Code Review site. — JJJ 26 secs ago
08:23
0
Q: Project Euler: Problem 3 - Largest Prime Factor in JavaScript

SquishlingI have created a soloution for Project Euler: Problem 3 - Largest Prime Factor in JavaScript: function isPrime(value) { for (var i = 2; i < value; i++) { if (value % i == 0) { return false; } } return true; } function findFactors(value) { var array = ...

08:36
0
Q: Is there anything else I can do to this Django model for better performance?

user149459Am trying to write a Cleaning Service API using Django Rest Framework, but I think how I defined this model is not robust enough for Production and in turns will make any application using this API have a very slow response, example of what am saying is that the model has no indexes defined whats...

09:06
0
Q: Find angles of a triangle from given lengths

Ahmad QayyumI have been given an assignment to construct a java program in which user enters three lengths. The program then tells whether a triangle is possible or not from the sides that are entered. Then it should tell the angles formed in the triangle. I have done the part where it says triangle is possi...

09:24
0
Q: Meeting Scheduler

santosh singhI am building a simple meeting scheduler application in c#. I have written following code in c# which is working fine. void Main() { var sc = new MeetingScheduler(); sc.Schedule(); } public class Meeting : IComparable<Meeting> { public DateTime StartTime { get; set; } public...

10:08
If this is tested and working, see Code Review. — jonrsharpe 56 secs ago
10:55
0
Q: Simplifying a working code about stock trading

hamsterbyteThe code below works, I'm just trying to see if there's any way to simplify it. The script uses a financial indicator called moving averages and their crossover points to recommend best actions for stock trading (buy vs sell). starting_cash: initial cash position prices: list of prices (ordere...

11:06
The first line of the code will trigger an exception. Same thing for the very last one (return statement but no function exists). So this question is not acceptable on CodeReview @jonrsharpe — Billal BEGUERADJ 23 secs ago
11:22
This seems to belong on codereview. — nwp just now
11:45
Monking
11:56
0
Q: Project Euler: Problem 5 - Smallest multiple | JavaScript

SquishlingThis is my soloution for Project Euler: Problem 5 - Smallest multiple. Tell me if there is any way this could be improved: main: for (var i = 1; true; i++) { for (var j = 1; j < 20; j++) { if (i % (j + 1) != 0) { continue main; } } ...

12:38
0
Q: Render Whitespace on GitHub - a browser extension

glebmI wrote a browser extension that renders whitespace on GitHub. It looks like this: This is the first browser extension I've ever written so I'd appreciate a code review. The code for the extension is here: https://gist.github.com/glebm/5b6c4517322193fbc51090dc3b57a44a Thanks

12:55
possible answer invalidation by jrtapsell on question by Ahmad Qayyum: codereview.stackexchange.com/posts/176367/revisions
13:20
-1
Q: How to loop a character with php?

augustin1340how to print the symbols (*) next? $a = "*"; $b = 0; $c = "*"; echo $a; while($b <= 7) { $a = $a + $c; echo $a ."<br />"; $b++; } I don't understand my errors ???

See stackoverflow.com/questions/1452721/… . P.S. Nobody wants to see a "full implementation" here. This is not a code review site. The only thing that must be posted is a Minimal, Complete, and Verifiable example. — Sam Varshavchik 43 secs ago
13:45
1
Q: McDonald's Food Order System - Can I make this code more efficient?

Milan TomIs there any way I could make this code more efficient or improve functionality? Also, I was wondering, what is the easiest way to add coloured text in python? def processOrder(quantity, item_list): global total if quantity > item_list[2]: print("There is not enough stock!") ...

0
Q: Python - Performance of this code very slow

SrinivasThis is an excerpt of my html code <div class="row"> <div class="col-md-3"> <div class="left_menu"> <!-- <h2></h2> --> <h2>Search</h2> <ul class="w_list"> <li><a href="">Search</a></li> </ul> </div> </div> <

I'm voting to close this question as off-topic because it has already been cross posted to codereview.stackexchange.com/q/176371/10206deceze ♦ 40 secs ago
14:14
1
Q: Validate a password mostly to NIST-2017 standards

202_acceptedI have an application that needs to validate user passwords to a very reasonable custom validator, which is heavily based on NIST-2017 requirements. The validator intends to satisfy the following restrictions: At least n characters (default n is 12); No more than n sequential, neighboring digit...

Kaz
Kaz
Monking @all
Are any Python people around?
I'm very lightly python, and I'm in and out.
@Kaz I'm a very small snake, not of much help I'm afraid
Kaz
Kaz
Probably more than me ^^ I decided I'm going to completely re-write my Trading robot this weekend.
V1 has done great things, but it's about time to take all those lessons learned and build something better.
Plus, I have some technical interviews on Monday, so this is a good opportunity to brush up on my Python.
Planning to join a different company?
14:21
@Kaz Usually.
Kaz
Kaz
@skiwi Seriously considering it.
Assuming they want to hire me ofc.
Trying to start with ML in Python?
hands @Kaz a massive Python project to code in order to help them brush up on Python
Kaz
Kaz
This is less of a "I want to leave my current job" and more "that particular job would be awesome enough to persuade me to leave"
@Kaz Well, I thought that was always a pretty good thing if you want to join a company :P
14:23
@skiwi Also helps a lot during the interview if it's the company itself that you want to join, not just the job you want to fill.
@Mast Ah yes, that of course
@Kaz No seriously, last time I've used Python is probably two years ago
Kaz
Kaz
Friend of mine recommended me for the job. It's doing Quant Ops for a Super-Secretive-Paranoid-Quant-Fund, where you run around the business, picking apart databases and spreadsheets, looking for problems and inefficiencies.
Quant Ops?
waves around the fact he just rewrote a Python based mailing list system to be DMARC compliant
Kaz
Kaz
@ThomasWard I wish I knew what that meant, but it sounds awesome ^^
14:25
it's a PITA
Domain-based Message Authentication, Reporting and Conformance (DMARC) is an email-validation system designed to detect and prevent email spoofing. It is intended to combat certain techniques often used in phishing and email spam, such as emails with forged sender addresses that appear to originate from legitimate organizations. Specified in RFC 7489, DMARC counters the illegitimate usage of the exact domain name in the From: field of email message headers. DMARC is built on top of two existing mechanisms, Sender Policy Framework (SPF) and DomainKeys Identified Mail (DKIM). It allows the ad...
Kaz
Kaz
@skiwi Their terminology. "Quantitative Operations Analyst".
^ DMARC
and you all know what "ListServs" are I hope.
and if you don't know what a ListServ (email mailing list) is, y'all need slapped
@Kaz Alright alright
@ThomasWard The only Servs I know are ChanServ and NickServ
so you don't use mailing lists
Kaz
Kaz
As distinct from the actual Developers, Researchers, and Trading Ops people.
14:27
Mast slaps Thomas Ward around a bit with a large trout
5
Thomas Ward slaps Mast around a bit with a large hammer
lol jk i'm not that evil ;)
... yet.
my ex and my gf both say i'm getting more evil every day though
I don't know if that's true or not
@Kaz Had anything specific in mind? I know Janos is our local interview questions in Python guru, but if you have a specific question I'm glad to help.
@ThomasWard It's the eyes.
@Mast Ehh, maybe.
Kaz
Kaz
@Mast Not really. According to my friend who works there, he doesn't think they need anything too high-level. The role itself is mostly analysing datasets in many different contexts, so general programming, scripting, stats, excel & python are all very useful but you don't necessarily need to be able to build serious software in them.
It's Python. Nobody intends to build serious software in it until all of a sudden the project turns out to have spawned serious software anyway.
4
Kaz
Kaz
14:32
Honestly, I'm more worried about the stats/probability part.
stats and probability are easy heh
Kaz
Kaz
I can do maths innately, but my formal knowledge is rather lacking.
And they wouldn't give me any more directions on what to expect other than "Statistics, Probability, Excel & Python"
@Kaz you might want to take a look at the basics - average, min, max, median, quartiles, extrapolation based on other datainformation, interpolation based on the datasets, etc.
@ThomasWard Did they look into your eyes?
TBH my formal math knowledge is blah - but I know my way around basic algebra :P
14:34
@Kaz Take 5 minutes to read this :-)
@Kaz Build a neural network that does your job
@skiwi The eyes I have here, or the soulless black voids that are my eyes when i'm tired as hell?
@skiwi You still haven't build a neural network in assembly yet, have you?
2
@ThomasWard It's more threatening when one eye shoots laser-beams and the other is non-existent
@Mast No, I was thinking about writing one in Brainfuck though
3
@skiwi well that's me when i'm horribly horribly drunk, so be glad I ain't drunk today.
14:35
@skiwi lmao
Kaz
Kaz
Well, I've finally figured out what was going wrong with my trading robot. I accidentally inverted a conditional, so it was buying when it should've been selling and vice versa.
4
Ouch.
Buy high sell low?
Seems like a good strategy but only if you don't want to make money. (No judgement.)
Kaz
Kaz
@202_accepted Thankfully, it isn't trading like that. It was more "Trying to buy when it had no money to buy, and trying to sell when it had nothing to sell".
Hah, even better. :P
Kaz
Kaz
Probably cost me about £20.
Which, I guess, is a fairly cheap lesson.
14:49
@Mast I'm looking into some use-case for Rust though
@Kaz And you still made money?
And on the other hand I'm still trying to find a free/open-source alternative to the application I work on at work, with which you can create other applications, but building it myself seems too difficult
The problem with our work one is that 1) I cannot get the full version for free and 2) If my employment ever ends there, then I lose my license, and that's unacceptable for my uses
Ah, you lost 20. I vaguely recall you making a profit the first day though, so that must have been sheer luck.
Kaz
Kaz
@Mast It's been live for 3 months. I got it pretty settled as of 2 months ago. In those 9 weeks, it's made about 9%.
So I'm reasonably happy.
Haha, awesome.
14:53
Last time I checked, I wasn't happy with Access 2016
Even faulty software can work as intended.
2
Basically I need a database + default and custom GUIs
@Mast Bug + Bug = No Bug
@skiwi bug + bug = bigger bug + massive bug = no bug.
15:09
@Braiam Dots are a universal symbol of joy, hope, and happiness. Dots bring sight to blind stick figures. Dots are what bring TLDs and domain names together. Dots are used in many languages to retrieve properties and separate angry sentences. Without dots, regexes would be more verbose and .NET would be plain NET. DOTS MAKE THE WORLD GO 'ROUND. ...Squares are just boring. — Andrew Myers Sep 12 at 23:27
2
Kaz
Kaz
@Mast On the plus side, if the market now falls 15% (eminently possible), it will have been a profitable mistake. So I guess what's really happened is I bought some unintentional downside protection ^^
1
Q: Add or modify bunch of data into database

ReinhardtI got my code works fine, but I am not really sure whether the approach that I took is a best practice or not. So, I decided to ask in this forum instead. So here is my situation: I got my model which looks like this: public class Member { [Range(1, int.MaxValue)] public int? MemberID...

15:32
Please don't paste your entire program, especially when it really has nothing to do with your core question. Also, this isn't a code review site. It's for asking very specific programming questions. — Paul J. Lucas 44 secs ago
15:57
Monking-ish
2
Monking-ish @Vogel612
16:51
Did you try to compile and run your code? Your question may be more appropriate on /codereview — Nielk 38 secs ago
@Nielk Definitely not a good fit for codereview. Asking for an explanation of a piece of code is one of the explicit Off-Topic reasons. — Kaz 24 secs ago
17:30
0
Q: takeWhile, groupBy and group higher order functions

user3169543I'm trying to implement few higher order functions from Haskell in C++. Below are the definitions of takeWhile, groupBy, and group. I would appreciate it if someone can review and comment if the implementation takes care of all scenarios. Should I be using universal refs for parameters to these ...

I'm voting to close this question as off-topic because this isn't a code review site. — Alan Stokes 57 secs ago
However, there is a stack exchange code review site... be sure to read the rules and question-posting guidelines before asking there. — Ben Voigt 29 secs ago
I'm voting to close this question as off-topic because this question needs to be migrated to [email protected]Thomas Matthews 33 secs ago
0
Q: Check whether or not write permission is enabled in a remote server

user149485I have written C++ code which will say whether write permission is enable on the server or not using the smbclient command. Since the smbclient command is not returning a proper error code if the remote server is read-only, my logic is that I try to write in the remote server if successful, then...

18:14
0
Q: Parsing indented text and inserting its data into a tree

jokoonMy goal is to parse indented text in the style of python and YAML. This only find the parent of each line. This bit of code seems to do the trick, but I'm not really satisfied and I wanted to know if you would do this another way. raw = """animal carnivorous tiger lion ...

0
Q: search for a value in tuple of lists/vectors

palikI guess there is some smarter way to implement such simple piece of code, but I couldn't figure out other solution by myself. Could it be done recursively without some sort of if's? I'll greatly appreciate any advice. import Data.Vector (Vector) import qualified Data.Vector type Seq...

18:44
0
Q: Syncing database from remote API

CodeYogiDescription: There are a set of VM each containing a number of databases, the database name along with vm name makes a unique combination. The database can be added or removed from each VM. The remote API at any given point of time gives us the snapshot of the system and doesn't maintain any his...

18:56
Looks approximately fine to me (I didn't check it that accurately but it has the expected features of union by rank and path compression) but code reviews should happen on code reviews. Why does the constructor take an array that it doesn't use though? — harold just now
19:51
Could somebody please tell me if there's anything inherently wrong with my question? I'd love to get an answer, or even a comment telling me everything is alright. codereview.stackexchange.com/questions/176334/…
@MartinKleiven you have 5 upvotes there...
not quite sure what else you want? ;)
Yes that's what I thought was odd.
the fire emoji is a nice touch, but your question is "only" a day old and it's a weekend...
Reviews can take quite some time...
I'd love 0 upvotes and an answer.
But no problem. I just wanted to fix it now if there was something wrong. If there's not, then thank you!
oh yeah the weekend part.. I am working these days :(
20:29
Nothing is wrong with your question. Reviewing code takes time, and we're all doing it for fun as volunteers. Some questions, unfortunately, don't get answers.
21:06
@200_success Is it appropriate to use a mod flag to request a very useless comment to be deleted, when it's a very repeat offender? (The comment itself adds no value, and it's arguably pedantic at best, and demonstrates harassing behavior at worst.)
Meh, nevermind. I'm just going to permanently ignore that user from now on. No point making someone else deal with it as well.
Go ahead and flag it anyway. If the moderators notice a pattern too, we can do something about it.
The problem is the comment itself isn't anything "flag worthy", it's just that this particular user always leaves some really useless (and I really want to use a more appropriate, but foul word there) comment due to...I'm not sure what, possibly a language barrier. I think I'm just more angry about it because it happens all the time and it's to the point where I can guess who it is by the notification language...it's annoying.
Just flag it. Thanks.
21:34
0
Q: Generate NDVI Rasters from USGS EarthExplorer Landsat 8

Peter WilsonI've written the following using Python Dictionaries and Pathlib Module. I'd like to improve the first function: list_landsat_tiles. I've created a list of files patterns to match, which I then use Pathlib iterdir to iterate over each directory. The reason is that I need to group the Landsat til...

22:05
0
Q: Snake game rewiew

Vitaliy Petrenkoit is my first work in JS. It works but I would like to hear criticism of this code. Please, point me to error. https://github.com/RileySalander/rileySalander.github.io

23:01
0
Q: Changing dataframe names using for loop

Jose Miguel Hernandez OchoaI am trying to loop over 12 dataframes already loaded into my environment. I need the loop to change the name of my objects. For example, normal_1 to normal_2... normal_2 to normal_3...etc. It should be straight forward but it seems that R does not index over object names. Any advice? for (i i...

0
Q: Program to filter a log file and extracts by different properties in java

AryaI have implemented a program to extract a log file which contains a header line, followed by zero or more data lines, in comma-separated value format.The file consist of 3 columns. The first column is the Unix time stamp , the second column is the country code, and the third column is the time i...


« first day (1603 days earlier)      last day (2713 days later) »