12:00 AM

1 hour later…
1:03 AM
0

I am working on a project that needs to take a .bdf font file and turn it into a Numpy array. I am using the code below to turn the bitmap for the font into a numpy array. It currently works, I just feel that it's nearly impossible to read but I'm not sure if there's a better way to do it. How ...

Hello! This should be on another site in the Stack Exchange network named Code Review. Thank you! — MilkyWay90 34 secs ago

1:23 AM
0

Problem statement: If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total. If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used? NOTE: Do not count s...

2:04 AM
If your code works and you're looking for advice on how to write it better, Code Review is the appropriate site. — Barmar 39 secs ago

2:22 AM
0

I have the following implementation of quick sort (assuming an immutable array). Comments? const reorder = (arr, pivot) => { larger = [] smaller = [] for (i = 0; i < arr.length; i++) { if (arr[i] < arr[pivot]) { smaller.push(arr[i]) } else if(arr[i]>arr[pivot]) { larger...

possible answer invalidation by kkawabat on question by kkawabat: codereview.stackexchange.com/posts/224126/revisions

3:02 AM
0

The below query takes roughly 2 minutes for almost 2000+ records. The tables are indexed. what might be causing the issue? SELECT S_MATRIC_NMBR PRIMARY_ID, NVL(INITCAP(S_NAME), ' ') LAST_NAME, ( CASE S_SEX WHEN 'M' THEN 'Mr' WHEN 'F' THEN 'Miss' ELSE '' E...

0

I want to get table names and column names from queries in a dataframe. The dataframe is like this: Date Query 29-03-2019 SELECT * FROM table WHERE .. 30-03-2019 SELECT * FROM ... JOIN ... ON ...WHERE .. .... .... 20-05-2019 SELECT ... and I run function to that dataframe...

3:24 AM
Well, if you have a working code and is looking for a code review, you can check the site guidelines of codereview.stackexchange.com. However, it seems that this kind of question does not fit this site since you don't have any attempts and the specific roadblocks you're running into — Andreas 56 secs ago
This doesn't help. Try to create at least a part of the code with `if`s and then ask here or maybe better at codereview.stackexchange.com if it can be optimized. — Michael Butscher 48 secs ago

4:04 AM
1

TLDR: (Sent here from StackOverflow) The code I've presented is working. I'm looking for a code review from more experienced devs to know if what I have done is OK, and to learn if there are better practices I should focus on to expand my skills and understanding. Hello. I have completed versi...

2

Quick sort in JS assuming an immutable array: const reorder = (arr, pivot) => { let larger = [] let smaller = [] let equals = [] for (let i = 0; i < arr.length; i++) { if (arr[i] < arr[pivot]) { smaller.push(arr[i]) } else if (arr[i] > arr[pivot]) { larger.push(arr[i]...

@SᴀᴍOnᴇᴌᴀ That's dedication! Great intervention.

1 hour later…
5:35 AM
possible answer invalidation by AlexV on question by Anson Biggs: codereview.stackexchange.com/posts/224256/revisions

6:08 AM
thanks for answer, i will add this and suggestions I got on code review. — SqueakyDeath 10 secs ago

6:23 AM
0

input = ['A','A','B','C','C','A','A','D','D','D','D','D','E','A','A'] requiredElements = 3 output = ['A','D','C']. it is possible to change the required elements when it is changed to 4 it must return array of four commonly occuring elements

6:43 AM
0

This the flow: login get two tokens (access token and refresh token) and two expiration time (one for each token) from server from now on the Angular application can determine if we're logged in by monitoring the refresh token expire time. if the refresh token is still valid then it doesn't mat...

7:23 AM
0

I was messing around with ssh and decided to write a python program that scans for any connections that aren't from the system, then terminates them. It works well for many connections from my iMac to my MacBook. A more in-depth explanation of the program is written at the top of the code. I'd ap...

7:35 AM
I agree with @Maroun. Also there's codereview.stackexchange.com if you're looking for feedback on your code. — abdusco 42 secs ago

0

I'm thinking of importing separate language modules (or config data) to be used when chosen by the user. Everything else besides the displayed texts should stay the same, and (I think) this should help save memory since only the language used is being imported and read. Below is some sample code...

8:23 AM
0

Does anybody know how to avoid error: Got AttributeError when attempting to get a value for field data_from_file on serializer DataSerializer in below code? # models.py class Data(models.Model): data_from_file = models.CharField(max_length=20) # serializers.py class DataSerializer(serialize...

8:47 AM
If you want comments for how to improve code try: codereview.stackexchange.comPeter Collingridge 54 secs ago

1 hour later…
9:55 AM
I'm voting to close this question as off-topic because if you want working code reviewing then you should post to codereview.stackexchange.comhardillb 8 secs ago
@hardillb This question, in its current format, is clearly off-topic on Code Review too. — Erik A 36 secs ago

10:15 AM
No, you cannot selectively turn off language features for yourself in Java. This would need to be enforced in code review. Maybe you could write a static analyzer for this and hook it into your build. — Thilo 55 secs ago

11:04 AM
You should ask yourself why you need to do this in the first place. Usually it's because your application model isn't designed to fit your application needs, but rather to fit whatever shape the data you get from the server has. If your model had fit your application, you would probably have nested update functions for each type that construct the new model level by level, rather than global functions that each does everything in isolation. This is an architecture question that is probably too broad to properly answer here. You might try a forum or Code Review instead. — glennsl 41 secs ago

Monking
@Duga That's fine.

12:01 PM
I'm voting to close this question as off-topic because it belongs to Code Review forum. — sophros 43 secs ago
Hello W.D and welcome to Stack Overflow. As sophros said, you should ask this question here. Anyway, you should explain the problem in your post, most people don't want to watch youtube to understand it, and explain your approach. — Corentin Limier 14 secs ago

12:18 PM
Monking

12:57 PM

0

(You might get eye-cancer today. So if you do not feel ready for this. Leave!) This Server is trying to handle Clients communicating with each other. Because I was not willing to actually give every client a name, they are named by their socket's file descriptor. This is my first application whi...

0

my code detects if a cycle is present in a graph using Union find algorithm with Weighted tree analysis and path compression. It works and I have included test cases. # check cycles in graph using union find # weighted tree balancing added from collections import defaultdict class graph: d...

1:22 PM
0

I have the below code that performs well until input size reaches 1000. After that, it takes more than 2 milliseconds to finish. Any help? using System; using System.Collections.Generic; using System.Linq; class Program { public static void Main(string[] args) { var numbersCount = int.Parse(Con...

1 hour later…
2:25 PM
possible answer invalidation by johnashu on question by johnashu: codereview.stackexchange.com/posts/224203/revisions

Alessio Civitillo on July 16, 2019

import seaborn as sns

sns.set(style=‘white’)

plt.figure(figsize=(12, 8))

plt.title(‘Cohorts: User Retention’)

codereview.stackexchange.com is probably a better fit for code review questions. — Quentin Hayot 24 secs ago

2:45 PM
@Feeds Noice, the preview is some code that's half way through the post...

this should be on code review stackexchange, since it's not a programming problem. — BlueRine S 21 secs ago

Monking

3:01 PM
0

I write a lot of TODO's but I never keep track of where they are. This program will search through files (and folders if needed) and find any TODO comments and their line number. The details will be printed to the screen and a file will be generated in the folder which is a csv of the files and...

0

We're having a small debate in work about the following piece of code: private string GetNextFileName(string fileName) { int index = 1; string nextName = \$"{fileName}_{index}.png"; while (File.Exists(nextName)) { nextName = \$"{fileName}_{++index}.png"; } return...

0

I need to reduced following java method complexity according to sonar acceptable level. now ,it given this like sonar issue. need some expert help to do this. public List<X> Y(final DateTime treatmentDiscontinueTime, final List< P> vali...

3:21 PM
-1

In ionic, I want to get the firestore document id to display the stored information of the user who logged in. I set the documents name to the user's email like Collection[name] = Users Document[name] = user@zzzz.zz Here is how i set the document name in auth.ts import * as firebase from 'fireb...

@Peilonrayz hmm... perhaps the preview shows the first 5 non-empty paragraph tags...

3:55 PM
The should be a code review since it works. — Error - Syntactical Remorse 11 secs ago
possible answer invalidation by johnashu on question by johnashu: codereview.stackexchange.com/posts/224203/revisions

0

This program opens a file and prints the text out to the terminal 1 character at a time and at a predetermined speed using time.sleep() Simple and maybe, if you think like me, pretty cool.. GitHub from time import sleep import sys BLINK = 0.2 chars_in_line = 50 def open_file(fn): with op...

0

This code computes the Minimum Spanning Tree of a given graph using Kruskals Algorithm. It works successfully and I have provided test cases within the code. I would like feedback on code efficiency (Choice of ds and functions/function size) and anything else to improve the code (Aside from pep...

0

As a practice exercise, I implemented a cellular automaton (Conway's Game of Life) in python (with help from this tutorial). I am very curious, if this code follows common best practices and I am wondering how to improve the code in terms of performance and readability. import numpy as np impo...

4:17 PM
@SᴀᴍOnᴇᴌᴀ I saw it too! It's interesting how the space between A and Minimalist seems to get crunched.

@SᴀᴍOnᴇᴌᴀ Thanks, LOL I can read that title at least.

4:35 PM
Monking

4:50 PM
@Duga rolled back
@Duga sheesh... rolled back

5:30 PM
That said I'd be curious to see the runs-all-day VBA code. Might be a good idea to put it up for peer review on Code Review. — Mathieu Guindon 28 secs ago

1 hour later…
6:30 PM

6:40 PM
@Duga IDK how that's got 6 answers, but no-one was like "yup that's unable to run"...
Might as well leave it now, rather than; close, allow the edit and then reopen.

7:12 PM
@Peilonrayz there have been several requests to edit the formatting to make it run, but always declined

@dfhwze One was accepted.
Well three if you include ones the OP allowed through
@dfhwze Also my point is about CVs not edits.

-1

I'm converting a response I get from SQL that looks something like this. { "COLUMNS":["SUCCESS","RETMESSAGE"], "DATA":[[true,"Order Approved"]] } Into a JSON object like this. [{ "SUCCESS":true, "RETMESSAGE":"Order Approved" }] I have a solution but I don't like it. I'm looking for ...

7:38 PM
@CaptainObvious This one has been edited by the OP. I feel it's more clear now. Should I remove my original comment?

8:13 PM
Why the downvotes? Roko is right - this is better suited for `codereview`, but as far as I'm aware, that doesn't mean it isn't suited for StackOverflow. Perhaps I'm mistaken. — Tyler Roper 15 secs ago

-2

I'm trying to create an abstraction for peripherals. It'd be straight forward if all of them shared the same interface, unfortunately, they do not. For example, let's say I have a peripheral A which I can communicate with and power it on or off. I also have a peripheral B, which I can communicat...

0

As I expliain in my rant, I have been searching for a replacement to hand-crafted POSIX-make-compatible makefiles to manage my dotfiles (which use symlinks). I decided the simplest thing to do would be to roll my own. Requirements: written in language likely to be immediately available on majo...

@pacmaninbw then I see names like `emadboctor` and think I am reading `bad doctor`

8:33 PM
If your code is working but you just want to optimize it, you should ask the question at Code Review instead: codereview.stackexchange.comRoope 18 secs ago

9:11 PM
Stackoverflow is for coding problems and debugging questions, not for help refactoring your code. Your question is probably better suited on codereview, but read their guides first to make sure your question is on-topic there: codereview.stackexchange.com/help/how-to-askMax Vollmer 15 secs ago

@SᴀᴍOnᴇᴌᴀ Yes, that was almost what I thought of the name as well. I thought mad doctor as in mad scientist.

possible answer invalidation by Sandio on question by Sandio: codereview.stackexchange.com/posts/224199/revisions

9:30 PM
@Duga rolled back

9:41 PM
-1

I am using NearestNeighbors for a text-based recommendation system. The purpose of the model is to return some set of codes For example: copper tube ->1010101 Aluminium pipe ->2020202 The training set contains two columns(aka features) : keywords(like copper tube) & code(like 1010101). from sk...

10:32 PM
This style of question, where you have a functional routine but you want opinions on style or help with refactoring is better asked on codereview.stackexchange.com (code review is not an option for migration that I can access in the review queues) — Chris Schaller 49 secs ago

0

By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. 3 7 4 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. NOTE: As there are only 16384 routes, it is possible to solve this problem by trying every route. However, ...

11:21 PM
0

I am reading a lot about chess impl and I have thoughts... In a lot of places I saw that Piece is the parent and all the types that can be as elephant are the children.There is abstract method : isValidMove(Box start, Box end, board) Box(is a Coordinate) Every subclass implements the isValidMove....