« first day (2489 days earlier)      last day (1521 days later) » 

12:00 AM
RELOAD! There are 6404 unanswered questions (90.1206% answered)
 
12:58 AM
0
Q: Code below reads .docx file and write a similar one with additions. It does not retain bullet points

Don FoxThis code discards bullet points; I need to keep them and indentations. from docx import Document from docx.enum.style import WD_STYLE_TYPE from docx.shared import Pt def main(filename): try: src_doc = Document(filename) tgt_doc = Document() styles = src_doc.styles ...

 
1:55 AM
0
Q: Pass 2-D array as constructor parameter and print contents

Darnoc ElocIs there a better (more memory efficient and safe) way to pass the 2-D array via the constructor below? Is it necessary/advantageous to utilize a ptr variable? What if the size of the array (both dimensions) is not predetermined? #include <iostream> #define MYNUM 4 class myClass { private:...

 
 
1 hour later…
3:13 AM
0
Q: Vectorize/Integration too slow in python as compared to Matlab?

Shankar_DuttI am new to community and please pardon me if I didn't provide information as intended. I am trying to learn python, coming from Matlab. I have a very simple code for starting purposes: from numpy import vectorize from scipy import integrate from scipy.special import j1 from math import sqrt, e...

0
Q: Word bucketing in Python

etnguyen03First I'm not sure what this is called formally but whatever. Basically I need to form "wildcard buckets". I think the best way to explain what I need to do is to take an example. For instance, say I have the three words "aaa", "aab", and "baa". Let me use * as the wildcard. Then from aaa I can...

 
I just posted the entire script I'm working on here: codereview.stackexchange.com/questions/237944/…Jamie Marshall 36 secs ago
 
3:32 AM
0
Q: Script for matching regex matches between two lists

Jamie Marshallgist of this project is that I have two datasets, 1. dfCore, which contains station_code and station_name 2. dfMetrix, which contains station_name the station_name form dfMetrix is supposed to tell me how to join to dfCore, based on either the station_code or station_name column in dfMetrix. ...

 
 
1 hour later…
4:55 AM
possible answer invalidation by Alan Vinícius on question by Alan Vinícius: codereview.stackexchange.com/posts/237931/revisions
 
Monking
@Duga thats ok
 
0
Q: Tentative to transform this scrape script into a class object program

Greg MFrom the last few days I have been studying scrapping webpages and for further development I challenge myself to transform the script I have created into a object class program which receive inputs from user. The main reason I'm posting this is because I would like to advices and insights on how...

 
possible answer invalidation by Alan Vinícius on question by Alan Vinícius: codereview.stackexchange.com/posts/237931/revisions
 
5:13 AM
@Duga rolled back
 
5:28 AM
0
Q: Simple employee GUI database sync/display/edit

bullseyeThis is a simple GUI to display employee data stored in the database, with editing options that sync with the database and adjust display according to mouse clicks/ keyboard scrolling/add/delete ... and please do not mind pictures of dogs, I thought they might look cooler for the sake of demonstr...

 
6:05 AM
possible answer invalidation by Vhin Gabuat on question by Vhin Gabuat: codereview.stackexchange.com/posts/237813/revisions
 
@Duga thats ok
 
 
1 hour later…
7:21 AM
-1
Q: How to convert these sensor output i.e in polar form as an integer data in Cartesian coordinates

shantmanuAt the moment I have continuous TCP/IP output data that looks like this: received "[650, 646, 642, 641, 640, 641, 634, 637, 633, 636, 632, 624, 625, 628, 621, 623, 624, 624, 621, 617, 616, 619, 612, 610, 611, 612, 607, 606, 606, 607, 602, 602, 603, 598, 595, 600, 601, 595, 595, 594, 598, 601, 59...

 
7:40 AM
0
Q: Vue component for Game Die (dice)

cezarAs part of learning Vue and Vue Test Utils I develop some simple games. I made a simple version of craps. Because in many other games a dice (or dices) are used I decided to create a reusable component GameDie. GameDie.vue <template> <span class="dice">{{ dice.icon }}</span> </template> <script

0
Q: converting object of arrays to an array of objects in a desired format

Vignesh Sharmaconst getSelectedItemsIds = selectedItemsList => { let keys = Object.keys(selectedItemsList); let selectedItems = []; keys.map(k => { selectedItemsList[k].map(id => { if (k.includes("projectIds")) { return selectedItems.push({ type: "PROJECT", id }); } else if (k.i...

 
Monking
@SᴀᴍOnᴇᴌᴀ Related
 
7:59 AM
0
Q: asp.net Razor Pages Image import

probstI got the following code in the .cshtml file: <tr> <td class="registerWidth"><b>Image:</b></td> <td> @Html.TextBoxFor(m => m.File, new { type = "file", accept="image/*" }) @Html.ValidationMessageFor(m => m.File, "", new { @class = "redColor" }) </td> </tr> This is in my Vi...

 
8:18 AM
0
Q: Python insert line in the middle of the file

gogascaI will be inserting a new text line in a setup.py file, this new line will contain text, and is part of the REQUIRED_PACKAGES. I parsed the file and look for REQUIRED_PACKAGES pattern (REQUIRED_PACKAGES = [ ... ]). Looking for alternatives during file insertion. A sample setup.py file looks lik...

0
Q: Count Total issued per month using LinQ

AdrianI'm doing a sample project where it counts the total issues per month that is to be displayed in a bar graph.. Here is my working SQL query SELECT SUM(CASE datepart(month,D_ISSUE) WHEN 1 THEN 1 ELSE 0 END) AS 'Jan', SUM(CASE datepart(month,D_ISSUE) WHEN 2 THEN 1 ELSE 0 END) AS 'Feb', so on....

 
@CaptainObvious broken
@CaptainObvious broken as well
 
 
2 hours later…
10:21 AM
@Ugur Note that if you don't have any issues/errors with your code and just want someone to review it or tips for improvement, better post it at codereview.stackexchange.comPᴇʜ 20 secs ago
 
10:59 AM
@CaptainObvious wow that one's a bit of a mess
 
0
Q: Template Matrix Class: implemented some basic functionalities

Prajwal_7I need your review o below class implementation in terms of efficiency, memory consumption and new features of C++11/14/17 that can be used. Basically I have written a matric class for addition, multiplication and scalar multiplication. Here goes the code: Matrix.hpp // Created by prajwal.sa...

 
11:57 AM
I'm voting to close this question as off-topic because it should be posted as a code review request: codereview.stackexchange.comStultuske just now
Keep in mind that codereview has it's own rules of "on-topicness" so best would be to have a look at their help page — Lino 20 secs ago
 
12:25 PM
0
Q: PHP - Deliberate loose == check and assigning to if statement

Jonathan Clarkif ($v->getMedical()) { $visitorHasMedical = $v->getMedical()->getMedCon() == true; // $visitorHasMedical will be false if "falsey" i.e. empty string or NULL } else { $visitorHasMedical = false; } Where getMedical() is a OneToOne Doctrine relationship that might not exist. Does this sn...

 
 
2 hours later…
2:07 PM
You can check out this: codereview.stackexchange.com/questions/122699/… and try some code and share exactly where you're stuck. — vahdet 40 secs ago
 
2:19 PM
0
Q: Check source contain replace string

JeffersonI created this function it is looking for the html tag and replacing it with the ^value. It seems complicated wanted to know if there is a better way to do something like this. Will you review the syntax, structure, and logic of my code. It can be tested using the main. Output dsfsadfsad 5<

 
2:34 PM
yes, there are still 1 or 2 cases where macros are useful, for logging you sometimes need __FILE__ or __LINE__ or __FUNCTION__ but that is really the only cases I would not reject in a code review — idclev 463035818 31 secs ago
You should use a custom IComparer to set the priority of the cards. On this thread you can read a useful implementation: codereview.stackexchange.com/questions/223593/…Marc 53 secs ago
 
0
Q: Does my file modifying code have any obvious beginner mistakes or errors?

FrozenAraI am currently coding a tool for my work that modifies a textfile by removing unneeded parts of a string at specific spots in the file. I would like to know if there are any obvious things I am missing or doing ot too complicated. I know that some of the comments are considered too long for PEP8....

0
Q: Python Shirtori Game Exercise

Meerfall the dewottI'm looking to improve my code writing in general by peer review. I've followed the following exercise: https://edabit.com/challenge/dLnZLi8FjaK6qKcvv. The exercise is to create an English version Shiritori Game. You can find an explanation by following the link but I'm going to explain below an...

 
2:57 PM
0
Q: mustache template for data table

Gabriel M. LinassiI want to build a data table and fill it with data from a json file. I'd like to know if this is a good implementation or there's better ways. I'm new to javascript, so if there's something better than mustache, please let me know. var obj = { titles: [ { name: "Título" }, { ...

0
Q: Database design of a simple teach-kids-to-read web-app

Code CompleteThe question is mainly about database design. Is it OK? I feel uncomfortable about having 2 separate WordTraining and SyllableTraining tables and about too simple design (not much normalized). Maybe there are any other issues. My web-app teaches kids to read syllables and words. First the use...

 
Any visual studio experts around, I'm trying to add an event and event handler in winforms and don't see a way in vs designer
 
@pacmaninbw to a control or just an event ?
 
If you are going to down vote the question, please leave a comment. Code review is so much politer than SO. — pacmaninbw 13 secs ago
 
like Button click event or like SucessfullyLoggedIn event
 
The form itself needs an activated handler.
form_activated
I know I can edit the designer.cs file but that is the wrong way to do it.
 
3:06 PM
Open the form in the designer mode, select the form, In the properties-window there is a little flash-sign. Double click in Activated and the handler is created.
 
For sure first click the flash symbol ;-)
 
Thanks for the answer.
I've got it added.
@Heslacher ^^
 
No problem
 
3:25 PM
This is more suited for the Code Review Stack Exchange. That said: the only thing changing anywhere is a single digit--seems straight-forward. — Dave Newton 13 secs ago
 
3:39 PM
Ryan Donovan on February 26, 2020
Blazor is a new client-side UI framework from the ASP.NET team. Its big selling point is the ability to write rich web UI experiences using HTML, CSS, and C# instead of JavaScript—something a lot of developers have been dreaming of.
 
3:53 PM
I'm voting to close this question as off-topic because it's asking for a codereview.stackexchange.com. — deceze ♦ 40 secs ago
It may be included as a question in code review exchange rather than SO — Hassam Abdelillah 59 secs ago
 
4:21 PM
Monking
@Duga wow a bold request...
 
Short answer, no. That is not agile.That can happen in any kind of team where you don't have agreed code standards that are followed and used in code reviews. — Daniel 55 secs ago
 
@Mast yes I saw that one first
 
0
Q: Clean up after shell script that is run via k8s pod on a gpu node for health check

AhmFMTeam, I have a working script but when we upgraded some drivers on the GPU system it’s starting to cause zombie process and system is lowing down as script runs periodically as a crib job. so I am trying to see is there a way I can have a graceful clean up after the Scripts run what is the bes...

0
Q: Concurrency and scalability improvement

bostonjavaI came across the following SpringBoot java code. @Service private Map<Id, MyClass> myMap = new HashMap<>(); public void addToMap() { ... myMap.put(...); } There are couple of issue with this code, with possible remediation below. I would like to hear what additional improvement could be ...

 
4:52 PM
@CaptainObvious @53648422 likely off-topic - too bad we didn't catch it on SO when CR was suggested ~ 60 minutes ago
that user has a CR account with 1 question... somebody should inform that user about off-topicness
 
@SᴀᴍOnᴇᴌᴀ 2 reasons to close, authorship and context.
 
5:10 PM
0
Q: What is the Fastest Way to Find the First Formula in an Excel Range with VBA?

William HumphriesIs there any quicker method than using a for loop to find the first instance of a formula in a cell? For Each dc In .Worksheets("testWS").Range(searchRange) If dc.hasFormula() = True Then formulaRow = Split(dc.Address, "$")(2) formula = dc.formula Exit For End If...

 
5:27 PM
Monking
 
-1
Q: trying to refactor JS i have a lot of repeated code there has to be a better way

Rwood219let date= new Date() let day = date.getDay() let weekday = new Array(7); weekday[0] = "Sunday"; weekday[1] = "Monday"; weekday[2] = "Tuesday"; weekday[3] = "Wednesday"; weekday[4] = "Thursday"; weekday[5] = "Friday"; weekday[6] = "Saturday"; changeText = () => { i...

 
5:56 PM
0
Q: Syntax highlighting for vba just changed

GreedoIt looks like the syntax highlighting has recently changed for VBA (I would post a sample but I don't think meta does code highlighting...) Here's an image to preserve what I'm seeing, tagged with lang-vb which is the default extension for the VBA tag: The blues are a slightly lighter shade a...

 
6:08 PM
0
Q: Dynamic module import in a class hierarchy

Patrick TrentinI have two python libraries, let's call them lib and extended_lib, that provide a very similar public API. To be more specific, extended_lib enriches the API of lib with new features and functionality; it also modifies the behavior of some functions that are also provided in lib (e.g. get_version...

 
This is a good question for [codereview.stackexchange.com/], but not for SO. — sleepToken 49 secs ago
 
6:46 PM
-1
Q: simplifying and compacting a sequence/series formula solver

MahdeenSkyso i made a formula retriever that works and allows importing of fractions because this python code is meant for the fx-cg50 calculator's micropython, hence there are alot of functions that dont work including fractions, some functions in math like gcd or isclose, so i really require some advice ...

0
Q: Recyclerview Adapter for weather app - Makes API calls for each item

DeyvidoesI have a weather app that allows the user to save Cities (with nickname and zip) into a room database. I'm using mvvm and livedata to observe the list of cities and update the recyclerview accordingly. I then perform an api call for each item in the recyclerview which to me seems wrong. It works ...

 
7:05 PM
0
Q: Sklearn Custom Imputer from prediction

masotannI asked this question on Stackoverflow, but thought it might be a better fit here. I'm playing around with the titanic dataset, and wanted to create a custom imputer to fill in missing age values with predictions from a LinearRegression model. Please find the code below: import seaborn as sns ...

 
You might consider posted it on codereview.stackexchange.com as it is not really practical to review here in the comments. They do kind of require that your code actually work before you post there because it's not for debugging, only criticism of design and that sort of thing. — Tenfour04 18 secs ago
 
7:43 PM
0
Q: Square the sorted array using haskell

presciI want inputs on how I can square the sorted Array more efficiently in haskell. I wrote a very naive algorithm to solve the problem. What I am doing is comparing the head and the last element of list on absolute value and whichever is max I square the element and add it to accumulator. But I thi...

 
7:53 PM
"How do I make this code better" is too broad for SO; SO is for specific questions with identifiable answers. You might try codereview.stackexchange.com instead. — Adrian 15 secs ago
 
0
Q: O.O. Style Palindrome Checker

K00lmanI am beginning to learn about object oriented programming in my programming class, and to make sure I had all the ideas down, I made a small palindrome checker program. It works by checking if the letter on the opposite side is the same. from time import sleep # To add readability delays clas...

 
... the right place would be code review... — Tomerikoo 45 secs ago
I am always happy to see new coders and would never want to discourage you or undermine your efforts. However this site can sound a bit strict at times, but the main reason is to provide the best possible help for coders sticking to the essence of this place, which is not a programming forum. There doesn't seem to be any question, nor anything we can help you with. Please look at codereview.stackexchange.comCelius Stingher 55 secs ago
 
8:30 PM
possible answer invalidation by presci on question by presci: codereview.stackexchange.com/posts/237999/revisions
 
0
Q: Domain name verifier and data collector

t3chneToday the code just generates an random hostname and appends it to a domain (tlds). Eventually I intend to add functionality to attempt to resolve the fqdn and retrieve nameserver information for each domain. On certain runs findHint() doesn't run all 5 times like it should. package main impor...

 
8:51 PM
 
9:42 PM
codereview.stackexchange.com is probably more suited for your question. — 0 0 26 secs ago
I think codereview.stackexchange.com is a more suitable place for this question — Mureinik 33 secs ago
 
@Duga that wasn't working and was deleted - may be coming in
 
0
Q: Cracking Caesar Cipher in Haskell

mthraI'm new to Haskell, so I wrote a program to crack Caesar Ciphered text for practice. The program calculates the frequency of each letter in the input, and then checks to see which shift minimizes the Euclidean norm of the element-wise difference between the text's frequencies and pre-measured fre...

0
Q: Custom Pizza creation code (IGCSE Practice)

OscarF123I have created a create your own pizza program and was wondering if there was any way to improve it. The image is of the task that we were given to create: https://imgur.com/J0QHPZt I have not completed task 2 or 3 yet. I apologise for the bad quality of the image. The code is below import rand...

 
10:14 PM
0
Q: Implementations of unzip in Racket

BrainFRZI've been practicing my folds and tail-call recursive programming, and I wanted to work on unzip for the general case as opposed to just pairs. This was very easy to do with standard tail call recursion. However, I was also told that any time you can use tail call recursion on a list, you could a...

 
10:25 PM
possible answer invalidation by Vogel612 on question by presci: codereview.stackexchange.com/posts/237999/revisions
 
@Duga bleh
 
10:58 PM
using similar to this but getting NameError: codereview.stackexchange.com/questions/164616/…saar 38 secs ago
 
11:49 PM
0
Q: Javascript Function To Add DOM Nodes

Jeff VdovjakI have a javascript function that will accept an array of objects (form a database or websocket). I am "self-taught" and learning but want to be producing professional looking/behaving code. Any insights into style or approach would be welcomed. Get the red marker out :) The HTML output from the...

0
Q: More Pythonic Context Manager Wrapper

StephenI wanted to ask this here because what I wanted to originally do felt like a really Pythonic method. I want to be able to use the syntax: d = {'a':{'c':4},'b':2} with d['a'] as item: print(item['c']) but found that Python doesn't allow for using lists, dicts, etc. as context managers. So ...

 

« first day (2489 days earlier)      last day (1521 days later) »