« first day (2054 days earlier)      last day (1966 days later) » 

12:00 AM
RELOAD! There are 5841 unanswered questions (89.7553% answered)
 
0
Q: Game of Life with Scala and Functional Programming

jkratz55I have been doing OOP and imperative programming my whole career but I wanted to dabble in Scala along with functional programming. Rather than writing Java like code in Scala I wanted to try a more functional approach. I decided to try a simple Kata with Scala, Game of Life. The following is wha...

 
12:55 AM
-1
Q: Solving square operational

GagantousI tried to build simple code that solved square operational with value n using python, plus, I want to learn recursion. I made three different style code like this: First code def pangkat(nilai, pangkat): a = int(1) for i in range(pangkat): a = a * nilai return a if __name...

0
Q: Random tree generation always creating regular tree

streptococotteI have been doing experiments with tree algorithms in C. To check their correctness I have implemented a simple function to generate random binary trees. Somehow it seems that all the generated trees are regular, meaning that the tree is "full" and has exactly (2^height)-1 nodes. I start at the ...

 
 
1 hour later…
2:20 AM
possible answer invalidation by dustin on question by dustin: codereview.stackexchange.com/posts/209821/revisions
 
 
2 hours later…
4:21 AM
0
Q: Repository + Unit Of Work Pattern in WebAPI

AkhilI am refactoring my existing product's webapi part of the solution. Current Repo pattern does not allow me to add custom functions to a specific repository. In result, most of the functions directly use the Db context in the controller. I read various articles and come up a good way of implement...

 
4:51 AM
0
Q: String Mix Code Wars Kata

Aditya CherlaProblem Statement Given two strings s1 and s2, we want to visualize how different the two strings are. We will only take into account the lowercase letters (a to z). First let us count the frequency of each lowercase letters in s1 and s2. s1 = "A aaaa bb c" s2 = "& aaa bbb c d" s1 has...

 
5:22 AM
0
Q: Performance concerns and improvement suggestions for multi-threading program

Uthred RagnarsonI recently graduated and started my first ever job. I'm trying to review this code for improvement. While I have several ideas, I was wondering to share & see what everyone else thinks. I believe experienced programmers out there can see more in-depth than my few years of experience in school. I ...

 
Monking
 
This might be more suited for code review actually, considering that your unittest code supposedly works but doesn't have the full coverage — Antti Haapala 37 secs ago
 
6:09 AM
-1
Q: Python code for Krikwood-Buff Integrals

D.H.NI am writing a code for the Krikwood-Buff Integrals which has the formula as: https://i.stack.imgur.com/lMtie.png I have the r and g(r) values in the file with 1st and 2nd column respectively.The code is: A=open ('abc.dat','r') C=open('def.dat','r') D=open('ghi','w+') f=4*pi for row, col in izi...

 
@CaptainObvious broken
 
 
3 hours later…
8:58 AM
0
Q: create Labels on the number of data in the column in database

B. AkaraI want to create Labels on the number of data in the column in database and each Label has a value from the column and I want to show all labels in Panel, I used Stored Procedure to Select data from Database. Label lbl = new Label(); DataTable dt = show.ShowData(lbl.Text); ...

 
 
1 hour later…
10:00 AM
0
Q: hangman in php, learner

marcelHangman This is the simple game of hangman. Guess letters and six wrong letters means your dead. This took about 20 hours. And I learned enough to be certain I could make something better now in half the time. Still, give me your honest (and brutal) opinion, since that will help me improve the ...

 
You're free to try to make a "better" implementation. If you do so: post your code here if it doesn't work (or on code review if it does work) — joop 32 secs ago
 
11:00 AM
Monking
 
11:17 AM
0
Q: unpack a nested dataclass and named tuple

mosheviI want to create a function that unpacks nested dataclasses and namedtuples (or a combination of both) my attempt I found this answer about how to unpack a named tuple, and i am simply extending it: the unpack function def unpack(obj): if isinstance(obj, dict): return {key: unpa...

 
This might be better suited for: codereview.stackexchange.comAlen Genzić 43 secs ago
 
11:32 AM
0
Q: Azure Blob and Table storage rewriting the code in a more simple way

T xI wrote this code, but is not very practical. I'm still new in this area of coding. Basically I'm storing an image into a blob container, and i'm saving the url in a table. I'm doing the same thing for a text file. So i would like to use dependency injection for azure connection part to make my c...

 
 
1 hour later…
12:51 PM
You could try using Pandas library to read chunks of the data and then organize it. Btw, if your code already works and you want to improve it, the right place to go is Code Review (codereview.stackexchange.com). Stack Overflow's focus is to fix non-working code :) — Helena Martins 1 min ago
 
1:05 PM
0
Q: Unit testing python

MaxI am creating a test class for the following code. splay_test.py which is the unit test code for splay tree. I needed help with writing unit tests for python to get %100 coverage. I am very bad at unit testing but have started off ok. just need someone to help me finish it off and maybe find any ...

 
1:37 PM
@Lundin, it is Diab compiler that we are using and MPC5646C MCU, which is based on PowerPC core. As for quality and safety, this is a small agile project, so we are perfoming module tests, integration tests and code reviews, and all have passed. This issue is encountered very rarelly and never on test environment. I know C++ and automotive is a horrible combination, but this is how we took the project :) — Moraru Gabriel 23 secs ago
 
1:51 PM
0
Q: Finding all subsets using backtracking c++

poojaI am solving the problem of finding all subsets of a given set using backtracking. The following c++ code gives wrong result and I am not able to figure out why. My logic is to remove each element from the given vector and call the function recursively on the remaining vector. A set is used to en...

0
Q: Best practice for send notifications with Django channels

KIN1991I have project on Django wich use Django Channels. I use Django Channel for sending notifications to users who are subscribed to articles changes (adding/editing/deleting comments on article). So I've chosen this way of realization: every group of channels is an article and when changes happen, ...

 
2:14 PM
I want more hats
 
TWO DAYS UNTIL I GET KEYS TO MY NEW HOUSE!
 
SWEET!
that is awesome! Congratulations
 
2:38 PM
@202_accepted Congrats!
 
Hi! Is anyone alive here?
 
No, only dead, unfortunately.
2
There may also be lingering programs hanging about, ever since the great machine uprising of 2015.
2
 
2:54 PM
@202_accepted that's too bad. I am hoping someone could check out my code formatting...
 
@morbidCode That's always valid for a question, if it's really brief chat can work sometimes too.
 
I am not sure if its OK to move the question to codereview.stackexchange.com but maybe it is. You need to read on the concepts of testing first a bit, maybe watch a video or two; the key is to do some action in isolated environment and verify that it went OK + data is correct. So you need to be able to set up the isolated environment (like have a record in a database) do some test on it (change it) and then compare the results, was the record changed? is it changed to the correct value? if yes then destroy everything and move to next test. — Kyslik 45 secs ago
Possibly more appropriate for Code Review. — Nico Schertler 39 secs ago
 
3:12 PM
@202_accepted I am blind. I am using a screen reader. You see, I usually don't format code because I don't need to, my screen reading software just reads me the code. The problem is people found my code too unreadable, so some of my questions got ignored due to extremely bad formatting. So I tried learning how to format and using ctrl+k. It's very easy with c-style languages, but very hard on scheme. That's why I would like people here to check the formatting before they got ignored.
7
 
@morbidCode Oh wow, that's pretty impressive still. Depending on how much it is you can probably drop a small snippet here and we can help out, I'm not sure how formatting with a screen reader works or what we would need to tell you in order to make it work properly, though I'm sure we could do something. :)
 
Greetings, Programs.
 
@202_accepted Thanks! I'm hoping I got the hang of formatting scheme code someday. Is it ok if you check the formatting in this question? I asked this yesterday. Someone commented about the format so I reformatted today. Thanks. codereview.stackexchange.com/questions/209840/…
 
@morbidCode I'm just guessing here, but it sounds like languages with format based syntax, such as Python, would be troublesome.
 
@Donald.McLean python is not so hard. It is just like java without the braces. That is, add additional 4 spaces for subexpressions or something like that. Languages that want the format of an abstract syntax tree though, is frustratingly hard.
 
3:23 PM
@morbidCode Well, the formatting looks substantially better to me, and seems readable, based on the version history. The only thing that is a "red flag", so-to-speak, is the "my procedure seems to be working correctly, but I can't be sure" statement -- generally, here on Code Review, we expect that your code works. Changing that phrase to something like "all the test cases appear to pass" and removing "can anyone check it" should make your question much more properly received. :)
 
@202_accepted Thanks! I'll edit it now.
 
@morbidCode Include the test cases if possible so that people can see for themselves. Tests also clarify intended use and context.
 
@Donald.McLean done.
 
4:27 PM
@Malachi visit stackoverflow.com/teams and then do something like answer a question that has been inactive for more than 6 months
Hey There BTW
 
hi. I gotta meeting to head to BBL
 
@Duga wat you talkin' about, girl?
 
4:40 PM
Sounds like a job for Code Review = SO is for code problems. — Darren Bartrup-Cook 12 secs ago
 
5:04 PM
If this code works fine and you are just worried about scalability, this should be asked on Code Review instead. Keep in mind though that their question requirements are different than Stack Overflow (be sure to take their site tour). Stack Overflow is more appropriate for questions about non-working code; this question is too broad/POB/open-ended. — TylerH 29 secs ago
 
@SᴀᴍOnᴇᴌᴀ There probably was a comment on that answer that got removed somewhere between detection and posting.
Something like that anyway.
I think.
 
yeah sounds about right
 
5:28 PM
-2
Q: Convert Hash to Tree

chrisgeeqI wish to convert a hash to a tree so here is my hash value { "C"=>"D", "B"=>"C", "A"=>"B" } i wish to traverse the tree and get something like A.children and D.ancestors where A.children => [B,C,D] D.ancestors => [C,B,A]

-2
Q: cannot figured out why not working [python]

InevitabilityIm new in python codding. Trying to make some code but dont work:( here is: start = 20 unknown = 1 finish = 100 def test(): check = start + unknown return check while check != finish: unknown += 1 test() else: print(unknown) where Im wrong? please help? Thank you.

0
Q: Bonobo + SQLAlchemy; first try

svenematoday I tried Bonobo + SQLAlchemy (for the first time), so it's bound to be full of bad practices. However, this is working code. I'm hoping for some feedback to do it The Right Way (tm). I started out using the SQLAlchemy extension for Bonobo, but I ran into limitations, so I wrote my own loade...

 
5:43 PM
1
Q: Elixir: string contains non-overlapping letter pairs

thesunneversetsI was trying my hand at learning Elixir via ancient adventofcode puzzles and was trying to write a function to satisfy this requirement: It contains a pair of any two letters that appears at least twice in the string without overlapping, like xyxy (xy) or aabcdefgaa (aa), but not like aaa...

 
Monking
 
5:59 PM
0
Q: How do I use more coding techniques to shorten my text game code

Leo GortzI recently started coding and after learning a bit about functions and basics I tried to make a simple text escape room game. My code is working and the game functions as intended but I now there are probably neat ways to reduce the long amount of code using techniques I haven't yet heard about. ...

 
6:11 PM
Thank you for your suggestion about Code Review. I will definitely ask this question there too. — thecosmicguys02 6 secs ago
 
-1
Q: Scaling issue for Server Sent Event with concurrent users over 10K

thecosmicguys02I am planning to user SSE to receive breaking news notification on my news website. It is build on Wordpress with PHP 7.0. I found that compared to ajax pooling SSE is a very good option to display breaking news as soon as database is updated without reloading the browser. I used following code ...

 
Code Review is a better site for asking advice on rewriting working code. — Barmar 54 secs ago
 
6:46 PM
0
Q: Wrapping certain elements in an array with an array with PHP

Aaron OlinI have a function that's doing this correctly, but I feel as though this can be done (possibly) with minimal code, with recursion, but I'm just wracking my brain. Basically I have JSON that gets decoded to an array. What I want to do is turn this: { "parentView": { "childViews": [ { ...

 
7:15 PM
@CaptainObvious Holy repetition...
 
7:33 PM
0
Q: Lazy-loading iframes as they scroll into view

darcherI'm working in a Tableau driven system, with large numbers of charts, I needed a way to reduce the strain of the initial load of our app. It's fairly simple, but wanted to ensure I accounted for every scenario, I don't generally utilize lazy loading. Print isn't a priority. jsfiddle: Demo (Tabl...

 
7:49 PM
0
Q: An index-based C++ iterator

Peter LenkefiI've got a case where I need to use sequential containers but need to avoid iterator invalidation on reallocations. I've got the idea to make an iterator from a tuple of (Container, Index), so for a slight memory-overhead the iterators stay valid (out of range error is possible on removal). This ...

 
8:01 PM
You may be confused about why you're being downvoted. I'll explain. This site is for code review, not essentially asking other to do the work for you. Do the work first. Show us the steps you've already taken to try to solve this problem. Here is a great post about asking good questions stackoverflow.com/help/how-to-askOrion 15 secs ago
 
8:13 PM
Anyone here used to Python? I'm using it for this year's advent of code, but so far I don't really like it... Is it just me or is Java streams, LINQ in C#, and Kotlin's collections much nicer to use than Python's list comprehensions and functions and various tools?
 
0
Q: Text file to spreadsheet

Sandro4912Lets say you have several .txt files in a folder and want to merge all text files into a single word document: A.txt A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 A16 A17 A18 A19 A20 A21 A22 B.txt B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B12 B13 B14 C.txt C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 C11...

 
@SimonForsberg Mast was just here... perhaps will be back soon; I've looked at it a little but not much
 
@Mast ping
 
@SimonForsberg I find F# pretty nice to use in all those regards, similar to Python except that python is more dynamic.
 
@202_accepted Well, I decided that I wanted to learn Python 3.7 for this year's advent of code.
 
8:28 PM
Nifty. :)
 
Maybe I should have went with Golang though, or something...
Although I have used a bit of python before I feel like I'm not really "fluent" in it
 
I suggest you return the vector from Student by const reference s you don't have to make a copy. That said, asking for ways to improve working code should be posted to CodeReview.SENathanOliver 12 secs ago
 
@SimonForsberg I kind of like Python's list comprehensions, TBH.
But, F# is awesome too.
They are a little tricky to understand, though.
 
@Hosch250 For mapping between elements, sure, and maybe also for filtering. But what about grouping by, finding maximum, finding most commonly used element, etc.?
I'm almost ashamed to call myself a moderator of Code Review considering this code
 
LOL.
@SimonForsberg Not sure, TBH. I've only barely used it, but I liked what I saw.
 
8:37 PM
@200_success might also have thoughts on the matter
 
I got a book of algorithms that uses Python, so I'll be using it sooner rather than later :)
 
I've implemented this for i686 + MMX before. Maybe you can adapt this code for the 8080? — fuz 17 secs ago
 
8:58 PM
This is probably one for code review codereview.stackexchange.comSorceri 19 secs ago
 
@SimonForsberg Might want to nab the numpy library, it's made for things like that
 
9:21 PM
0
Q: Search for specific embedded NdefRecord from NdefMessage

KonradHaving such payload as hex value like below parse it to see the NdefRecord structure using https://www.ndefparser.net/ : 94 03 49 61 73 76 94 01 06 69 04 02 71 79 79 71 54 03 39 63 75 73 94 03 11 63 69 64 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 19 01 03 03 54 63 70 6C 00 70 6C 54 03 1...

 
9:52 PM
0
Q: Getting rid of unwanted loop

MargedI use a Thymeleaf template to inject a set of files (which contain precalculated html) into one big html. The files with their metadata are stored in a map called files, the files content is stored in another map called content. Both maps share the same key which is basically an id of the files. ...

0
Q: Numbers adder via generics

Dima MorgunovThis method add all numbers in list and return it as double public HashMap<String, Double> add(HashMap<String, List<? extends Number>> map){ HashMap<String, Double> result = new HashMap<>(); map.forEach((key, value) -> { Double sum = 0.0; for (Number num : value){ ...

 
10:07 PM
0
Q: Remove div space on corners

Corsair 4 LifeI am wondering how to remove the space between the div a corner of the page. This is my HTML: <div> text </div> And this is CSS: div { background-color: black; color: white; margin: 0px; padding: 0px; border: 0px white solid; }

 
10:38 PM
0
Q: Multiple file access abstractions - follow-up - redesign

t3chb0tA couple of days ago I asked about an abstraction layer for accessing files (link). There were many great ideas that made me think a lot. The result of it is a complete redesign. When you think about it, working with files is nothing else but CRUD so by implementing this pattern I was able to so...

 
11:25 PM
0
Q: Banking ATM Project C++

csstd1Please help with the changing PIN number function. "Account" is a structure type. The structure has first, last, balance, pin, and account number. I am not sure how to get a new pin and make sure it doesn't exist, and then add it to the array that is of type account. This option should...

 
@CaptainObvious ಠ_ಠ
 
wat
 

« first day (2054 days earlier)      last day (1966 days later) »