« first day (2889 days earlier)      last day (1129 days later) » 

12:00 AM
0
Q: Text-based Tic Tac Toe in Python (First Project)

MikiranI've recently started learning Python again after a long time away from it and doing MATLAB at university. Today, I spent some time working on a first little project of mine. Right now it works as it should minus ending the game when all the fields are full. I would love to get advice on how I co...

 
RELOAD! There are 7474 unanswered questions (89.4953% answered)
 
Ben Popper on March 31, 2021
Sometimes, everything just clicks into place.
 
12:51 AM
0
Q: Program for checking gaps in hierarchy?

jovenyIn my data I have few hierarchy values - example address Name -> Street -> City -> County -> State -> Country The validation i need is, if a value in the above hierarchy is present then all the previous/higher order values should be present. below is a valid case Name -> Street -> City -> Stat...

 
 
3 hours later…
4:01 AM
possible answer invalidation by mTvare on question by mTvare: codereview.stackexchange.com/posts/258915/revisions
 
4:22 AM
This seems like a better question for Code Review. — Henry Ecker 26 secs ago
 
4:37 AM
0
Q: Function returning a vec with prime factors of number

Antonin GAVRELSee code below and my comment with questions: pub fn factors(n: u64) -> Vec<u64> { let mut m = n; // is it possible to convert n to a mutable type without using another variable? let mut a:Vec<u64> = Vec::new(); while m % 2 == 0 { a.push(2); } // in C we can just write...

 
5:27 AM
0
Q: Conventional C# for LinkedList with (non-)nullable references + xunit tests

ManninghamI'm new to C# and would appreciate any feedback you might have on the following doubly-linked list implementation, particularly WRT the following language features: Exception handling Debug.Assert Null state attributes (e.g. MaybeNullWhen) The Try pattern with out params Test style with xunit An...

 
 
1 hour later…
6:44 AM
This might be a better question for Code ReviewHenry Ecker 56 secs ago
 
7:07 AM
0
Q: I tried to make a noob version of Jarvis and I have an issue looping it

ROHIT coderThis piece of code is pretty simple as I am a new guy and I have built it as is satisfies much of my requirements. Where I am actually facing a problem is that I want Jarvis to keep on asking me his help till I say my final 'no' i.e. I wanted to loop def allbegins() and created another function t...

 
Did someone tell you to make your methods testable? In this case question fits better codereview site. — Sinatr 10 secs ago
 
7:32 AM
posted on April 01, 2021 by Istiak

JavaScript alert("Working"); $.ajax({ url: "update.php", type: "POST", data: { id: <?php echo $row['serial']?>, type: "Canceled" }, cache: false, success: function(dataResult){ var dataResult = JSON.parse(

 
8:15 AM
codereview.stackexchange.com might be the correct place for this question. — Karthikeyan Vaithilingam 13 secs ago
 
0
Q: Cin taking invalid number of inputs

AetoocI assign the variable arrSize with zero ( int arrSize = 0; ) and in next line I take input from user for the variable arrSize. Let's suppose the user assigns 5 value to the variable. When I execute my code, Cin is taking only 4 values instead of 5. But when I only declare the variable ( int arrS...

 
9:14 AM
0
Q: Web scrapping and design pattern lifting

curiousI would like to get some feed back on my code; the goal is to get all agencies adress of banks. I wrote a pretty simple brute force algorithm. I was wondering if you would have any advices to improve the code, design it differently (do i need an OOP approach here) etc . import requests from lxml ...

 
10:04 AM
Code Review might be a better place for this type of question. — Hao Wu 40 secs ago
 
10:44 AM
Please focus on one specific problem. Otherwise, you could post you code in codereview.stackexchange.com . Furthermore, note that OpenMP can help you to do that easily. — Jérôme Richard 25 secs ago
 
10:59 AM
@CaptainObvious Broken code.
 
11:41 AM
possible answer invalidation by Manningham on question by Manningham: codereview.stackexchange.com/posts/258950/revisions
 
11:54 AM
The way you're question is written you should put it on codereview.stackexchange.com . I suggest you edit this question to say "how do I get this code to perform better under heavy load?" — O. Jones 8 secs ago
As written this question does not fit the format for SO and is better suited to codereview.stackexchange.comAD7six 19 secs ago
 
12:55 PM
@Duga Rolled back with comment.
 
@Duga I rolled back and commented on that one.
 
1:26 PM
1
Q: Quicksort using Lomuto partition scheme in C

Andy Sukowski-BangThis is my implementation of the divide-and-conquer Quicksort algorithm using the Lomuto partition scheme in C. This is part of a personal project and I'm following Linus Torvalds's coding style. void swap(int *i, int *j) { int tmp = *i; *i = *j; *j = tmp; } int partition(int *arr, i...

0
Q: How to upload video to cloudinary using MERN and FormData?

Sandesh let formData = new FormData() formData.append("file", myfile) console.log("uploading",formData,apiss) const headers={ "Content-Type": "multipart/form-data", } ...

 
2:05 PM
ha ha. I have wiki's dedicated to constructor-injection. and links to Mark Seeman. google.com/… But .. some people are married. The other thing (kissing cousin) is they love to #overMock, which relies on magic-string matching on the name of the @autowire property. Constant code review comments "inject the dependency in the constructor, do not rely on mock-string-matchign-voodoo. #goodTImes — granadaCoder 1 min ago
 
Greetings, Programs.
 
0
Q: is this ok as a safer strcmp?

DBJDBJThe core is this // safer strcmp static int safer_strcmp_ ( const size_t N, const size_t M, const char (*L)[N], const char (*R)[M]) { assert( 0 == ((*L)[N]) ); assert( 0 == ((*R)[M]) ); return strcmp(*L,*R) ; } Basically just checking if both strings are properly terminated...

 
2:46 PM
possible answer invalidation by TmSmth on question by TmSmth: codereview.stackexchange.com/posts/257682/revisions
 
3:20 PM
Monking- Happy Friday eve!
@Feeds When I first saw the image I was thinking it was designed especially for close voting...
I'm seeing great potential for comics like XKCD that show expansion into a keyword with more than 100 keys...
 
possible answer invalidation by Jack on question by Jack: codereview.stackexchange.com/posts/258890/revisions
 
@Duga The answer doesn't mention that aspect... it appears to be in response to a comment to the OP
Doesn't work for { new A(2, "a"), new A(-1, "b"), new A(3, "c"), new A(-1, "d") }. Output cbad expected bdac or dbac. It sorts properly only indexes, not data. Or is it expected output? Also a tip: string.Format("index = %d, value = %s", index, value); won't work, do string.Format("index = {0}, value = {1}", index, value); instead. — aepot yesterday
 
3:38 PM
Monkinzg
 
possible answer invalidation by Jack on question by Jack: codereview.stackexchange.com/posts/258890/revisions
possible answer invalidation by Jack on question by Jack: codereview.stackexchange.com/posts/258890/revisions
 
4:17 PM
@SᴀᴍOnᴇᴌᴀ How about those? ^
 
@Mast The one answer doesn't appear to mention the aspects changed, which really was just adding using System; to the top of the code and then adding clarifications about the code
though somebody with more familiarity with could prove me wrong
 
0
Q: Simple interpreter in C

ArianKGI made simple interpreter in C and now, I want to make my code better. Here is my code: #include <stdio.h> #include <stdlib.h> #include <stddef.h> #include <string.h> #include "def.h" int main(int argc, char *argv[]) { int i; char ch[100]; char input[100]; char sinput[100]; ...

-1
Q: Web-site navigation bar (part II)

AlexanderSplatWith the help of @Manningham on my previous question, I've managed to make my navbar code much leaner. I still can't get a few things right, however, hence this follow-up question. My code now looks like below (here it is on CodePen). The things that have me stumped: I've changed the nav-link cl...

0
Q: dynarr - yet another simple C dynamic array library

TheDcoderI wrote my own dynamic array library for C as I was not happy with the others I found. It is very crude but the basic logic should be correct, it mainly revolves making realloc easier to use and avoiding repetitive code. Please offer your suggestions and criticisms! #include <stdlib.h> #include <...

 
Not that it makes it any less of a review but the answer does contain questions that could have potentially been asked in a comment before providing an answer
 
PSA: Both Vogel612 and Mathieu Guindon are stepping down. Election date April 12th.
8
To whomever pinned the bad news to the starwall, I've cleaned it up a bit.
@Mast And only now do I realize there's a major typo in there...
@CaptainObvious That has a lot of downvotes, but it could do with more close votes.
 
4:48 PM
0
Q: Pandas Filtering based on the length of the same kind variables in a column

Andrea CiufoIn my real case I have a set of time series related to different IDs stored in a single DataFrame Some are composed by 400 samples, some by 1000 samples, some by 2000. They are stored in the same df and: I would like to drop all the IDs made up of time series shorter than a custom length. I wrote...

0
Q: Uploading Image file of the form using oop php

mrshiamI have these codes for inserting data of Vehicle into the MySQL database using OOP PHP. All works fine. But Now I wanted to upload an image using the form. But I cannot insert my image to the argument by which I can insert the data to the database. So I am sharing my codes. Firstly This my Databa...

 
5:11 PM
@CaptainObvious CNWAI
@CaptainObvious CNWAI
@Duga I left a comment to warn the OP
 
@SᴀᴍOnᴇᴌᴀ Might that be fixable by rewording the question?
 
@Mast methinks no... there are three questions, all seem to be why_/_how-to-esque
> I still can't get a few things right ...The things that have me stumped:...
thanks for commenting
As you've found out, we can help you by spotting the problems with your code. However, it appears you've already found the problems and are looking for specific solutions. Specific problems are more in Stack Overflow's territory, although they require a minimal complete verifiable example per problem. At this stage, you are probably helped more by posting one question per problem you face (and please, not all at the same time). — Mast 4 mins ago
 
I'd suggest you try softwareengineering or maybe codereview. SO is better suited for code that doesn't work. — mkopriva 11 secs ago
 
5:54 PM
This problem does not appear sufficiently well-defined at present to be into code review; the next step should be better definition of the modelled scenario, since this looks like it involves too much guessing. — Joffan 35 secs ago
 
6:19 PM
check out this codereview.stackexchange.com/questions/188594/… and please be more specific from next — Fahim Hoque 42 secs ago
 
1
Q: "Smart pointer" meant to stay updated when the pointed object is moved in memory

BarnackI wasn't sure about how to name it, maybe "follow_ptr", "self_updating_ptr", or "stalking_ptr" or something on those lines. For now it's called Identifier. What I'm trying to achieve is a pointer wrapper which will always refer to the same object even when that object is moved in memory (vector r...

 
@Mast @pacmaninbw Do you know of any rules around tagging with both and ? Should only one tag be used like with Python 2 and 3.
 
@Peilonrayz It makes very little sense to tag with both, unless there's the very specific situation of having 'translated' code to .
@CaptainObvious I think you're talking about this question.
 
Thank you. I don't think any C99 -> C11 translations have happened. Do you know which version we should keep on the following question? codereview.stackexchange.com/q/258964
 
It should drop a tag.
 
6:33 PM
Oh, nice! You know exactly what I'm on about
 
They probably want to drop c99, but it's been a while.
So I've left a comment.
 
Thank you for the comment and help @Mast
 
Np
 
@Peilonrayz @Edward would be a better person to ask, he has access to most of the standards.
@Peilonrayz However, in this case it should apply to all versions of C since 89.
 
@pacmaninbw Thank you, I'm mostly only concerned around Code Reviews tagging standards rather than C standards. For example I can post code which works on Python 2 and Python 3 as . Showing I'm using Python 3 and don't care about Python 2 support.
 
6:39 PM
The question can be better answered at codereview.stackexchange.comShivam Singla 12 secs ago
To make this attractive to SO users, you need to make the problem statement and code more succinct. For example you don't need to 3 versions of the same machine_... in the example. But maybe someone on CodeReview will be more interested in tackling this - but do read its expectations and requirements first. — hpaulj 11 secs ago
 
@Peilonrayz It's possible they want it to work on both, but very rare. There's a use case for that with Python and that simply doesn't fly with C.
As in, so rare it should be stated really explicitly in the question.
The only sensible moment to do it is during a translation, a modernisation that's half-way through.
 
@pacmaninbw "in t.he" -> "in the"? (not a comment to not make the change an edit)
 
6:55 PM
@Peilonrayz Thanks. You are correct.
 
@Mast Interesting, I'm assuming if you can call C11 code in a C99 project? When I say code I probably mean a compiled .so or something. Makes sense. I didn't know if there was a don't tri-tag rule for C like Python has. But may just be bad tagging either way
 
@Peilonrayz It should have been left as a C tag. Doesn't need to get more specific than that.
 
@Peilonrayz Running C11-specific code in a C99 project won't run, so you'd have guards around it to make sure it's only run on a specific version.
It's like using Python 3.9 functions in 3.5. They don't exist yet.
For the record, C11 is more recent than 99.
It's actually ISO/IEC 9899:2011, to make things even more confusing.
 
@Mast @Peilonrayz but the reverse, calling C99 functions from C11 should work.
 
@pacmaninbw Usually.
Although the output might differ somewhat if there was a case of UB, but that's dangerous territory either way.
Doesn't stop some people though.
 
7:00 PM
I guess libraries are commonly written in older C and applications can be written in newer C?
 
So tell me why you think my answer already got a down vote.
 
@pacmaninbw Not mine, but probably because you wrote an answer that requests clarification. That's a comment thing.
 
The question got an upvote. Possibly will see another answer soon?
 
I did the upvote when I removed my VTC.
 
I assumed you did the first (timings lined up). The question's at +2 now.
 
7:03 PM
@Peilonrayz You'd have to compile them under the new standard by setting the relevant flag (it's cxxflags="-std=c++11" under C++, not sure what it's on C), but yes.
Unless that's already the default of your compiler.
 
@Mast Yeah that makes complete sense to me. I'm guessing C also doesn't introduce breaking changes like Python 3 seems to love doing every now and then. I can't wait for Python 4, maybe then typing will be a bit more stable...
 
@Peilonrayz "I'm guessing C also doesn't introduce breaking changes" No promises.
People tend to think C++ is backwards compatible with C (as in, you can write C and compile it as C++), but that isn't fully true either.
When using sensible programming methods, it's mostly backwards compatible and no breaking changes.
That's why C++ has an explicit declaration to wrap C code in, to force it working.
C is basically persuading your device to do what you want and praying you read the spec right.
 
@Mast Ah, I should have thought realistically rather than idealistically for once... ;)
Possible AI on My safer strcmp @pacmaninbw
 
possible answer invalidation by DBJDBJ on question by DBJDBJ: codereview.stackexchange.com/posts/258964/revisions
 
@Peilonrayz roll it back, eating lunch
 
7:22 PM
Why?
> To improve the question you should provide some actual usage.
Looks like they did.
@Mast you are right and I am not targeting them both in the same time. These are just tags on this post. Please see the Godbolt link provided for a working sample. — DBJDBJ 2 mins ago
facepalm
That's so not how it works...
I've removed both of them.
 
@Mast No Picards today? :O Yeah probably easiest way to solve everything.
 
user image
3
There you go.
 
possible answer invalidation by DBJDBJ on question by DBJDBJ: codereview.stackexchange.com/posts/258964/revisions
 
 
2 hours later…
9:12 PM
Please post code that "did work!" to Code Review. SO is for code that failed 😜 — hc_dev 26 secs ago
@Forcela8 You might want to delete this question and ask it on codereview.stackexchange.com instead, but check the help pages there first. — Progman 33 secs ago
That's why I put "wrong" in quotes. In the real world of code reviews, C++ code with usage of new[] are now rejected by the reviewer. That has been superseded by std::vectorPaulMcKenzie 23 secs ago
 
9:53 PM
0
Q: PNG steganography tool in C

Andy Sukowski-BangThis is a steganography tool enabling you to conceal any file within a PNG file. In order to compile the program you need libpng to be installed on the system. It is one of my personal projects and I would love to receive expert advice. Running Hide message in PNG file: steg -h <file_in> <png_in> <...

 
If this code is working you should post it to Code Review to get recommendations for improvement 🤓 BTW: a List<List<>> is just another representation of a 2-dimensional array. — hc_dev 1 min ago
 
10:18 PM
0
Q: Method that parses multi-line input into a list of lists

vesiiIn my Java code, I call external 3-party tool and get its output. The output looks like: <host> <status> <pid> <path> <name> <date> <host> <status> <pid> <path> <name> <date> ... <host> <status> <pid> <path> <name> <date> Then I want to itera...

0
Q: JS, a multi purpose function

Moamenthis is an Angular application, this page will have a list and sublist with action for each one (add/edit/delete) the buttons (add/edit) will show a popup with the same form except the landmark will show one more filed. <ng-template #modaleTemplate> <div class="modal-header"> <h4 class="mo...

 
10:44 PM
0
Q: Parsing "my lhs = my rhs"

yolenoyerJust below is a nom parser which can parse one-line expressions like my lhs = my rhs: Cargo.toml [package] name = "basic-test" version = "0.0.0" edition = "2018" [dependencies] nom = "6.1.2" src/main.rs /// Nom shortcuts. mod nom_prelude { pub use nom::{ IResult, combinator:...

 
11:01 PM
 
@RMunroe the real site has an interactive thing... with sound...
 
@SᴀᴍOnᴇᴌᴀ Oh that's pretty cool. I wonder if there's a morse code easter egg too.
The on hover of ...---... does nothing ):
 
it uses a script called morse.js
 

« first day (2889 days earlier)      last day (1129 days later) »