« first day (2854 days earlier)      last day (54 days later) » 

12:00 AM
RELOAD! There are 7336 unanswered questions (89.6142% answered)
Q: Farmer, Wolf, Goat and Cabbage Problem: full decision tree in C

Country BoyI put a backtracking algorithm around the Farmer, Wolf, Goat and Cabbage problem - to see if there are any interesting branches, besides the (two) 7-step solutions. On first view it seems a dilemma. Then you realize it can be solved (by taking the goat back at step 4). Then you realize: it can al...

4 hours later…
4:08 AM
Q: Client-server application for logging running processes

Bn.F76My first client-server application. It's a simple Python script that gets a list of running processes from Server_1 and writes it to a datetime-named file on Server_2, every 5 seconds. I am planning on refactoring this code into one or two functions, maybe one for securing the connection and one ...

4:27 AM
Does your approach work? If so, this is more of a code review question. — M-Chen-3 46 secs ago
5:05 AM
2 hours later…
6:48 AM
Do you have any specific problems with this code? If you want a review you should post on codereview.stackexchange.com instead. — churill 42 secs ago
3 hours later…
9:27 AM
"I have created a working solution, but I would like to see if I am totally off course" -- If you have a working solution, you must not be off course. If you're looking for general code review, this is the wrong site. But maybe Code Review.SE can help. — Flimzy 29 secs ago
9:48 AM
Q: Proper way to map the object

WexoniI have a simple task. Array of people object comes in, up to a thousand. Need to iterate over it, and create a custom payload for external service. I have created a working solution, but I would like to see if I am totally off course, and what changes should I make. I have reduced non-important...

10:13 AM
Q: I need to modify my phonebook application in C. Please show me the way. Thank you

JonathanI hope I am doing this right, I am a beginner in C and I am having trouble to figure out how to modify an entry. I am doing a phonebook application that will write and record into a text. file. I have finished most of the coding but I just can't modify the contact. Please guide me or show me the ...

10:59 AM
(Although I would exercise caution with implementing HSTS - or at least the "preload" list - on a shared server. See also: codereview.stackexchange.com/questions/250805/…) — MrWhite 56 secs ago
11:50 AM
Q: a simple interrupt polling program due to AXI DMA IP

drakonofThe program transfers a data array from a Zynq-7000 PS DDR to a BRAM IP (block RAM) memory in a PL part of a FPGA due to a PL AXI DMA IP. Inferring a xilinx axi dma driver (not scatter-gather mode), an interrupt controller and the vendor's printf function the data array is carried from the DDR to...

12:28 PM
For general code review, this is the wrong site. Maybe Code Review.SE can help. — Flimzy 47 secs ago
2 hours later…
2:16 PM
Q: Improvement of the config file management in a project that manage simulation experiments

th0mashImprovement of the config file management I am working on a personal project for more than 6 months now, this project is composed of three distinct parts, simulation (wrapping a software), database related stuff (store the simulated data in a database) and modelization (a lot of machine learning ...

Q: Cron expression parser

CodeYogiProblem Write a command line application or script which parses a cron string and expands each field to show the times at which it will run. ~$ your-program "*/15 0 1,15 * 1-5 /usr/bin/find" minute 0 15 30 45 hour 0 day of month 1 15 month 1 2 3 4 5 6 7 8 9 10 11 12 day of week 1 2 3 4 5 comman...

2:35 PM
I have a question: for a library that is expected to be distributed by composer ... and this can be executed by CLI or by a web environment; It should have separate methods for execution or you would expect it to be the library that determines what environment it is running in.
@FranciscoNúñez I'm not sure. I think it would depend on what the library does and how it's expected to be used.
Is this something that is compiled to WebAssembly?
I'm talking about this library:
Q: Class showing a format similar to var_dump

Francisco NúñezSome methods of this library require some improvements (see this description): In the constructor I am trying to create the possibility that the user modifies the colors of the output. I think it can improve but I do not know if there is any standard or good practices in this regard, or if there...

I'm not a PHP expert, but it looks like the theme is applied in the web environment but not via CLI. Is that correct?
Are there other differences?
Might it be possible to pass in a variable indicating the desired context?
@FranciscoNúñez The problem here is that you want the script to dynamically choose it, when the normal reality is to build three scripts: 1) the core functionality that abstracts the concepts (and in your case, returns things like comment: <comment text>); 2) the web-wrapper which digests the core output and formats it for web; 3) the CLI-wrapper which digests the core output and formats it for the CLI.
I am making improvements to the highlighting and one of the points; is that it can be used both by CLI and by a browser ... but I don't know what is more convenient if doing it separately; then I have an output() method; and another output_cli() or implement a single output() method and within this determine if it is cli with php_sapi_name() === 'cli'
2:47 PM
Maybe output(cli) and output(browser)?
Leave it up to the user to specify the context instead of having the library attempt to determine it.
I think that would also simplify testing.
Really it should be $outputToFormat = runMyCustomVarDump(); cli_output($outputToFormat);
Yes, that's better.
Also if you were on my team and I saw ini_set I would be working with you to remove all that.
What is your question? If you want a code review, I suggest posting it to the dedicated stackexchange. — Lescurel 6 secs ago
Greetings, Programs.
2:57 PM
I already have an output for web and another for CLI; but I have not yet uploaded the CLI to the repository, my doubts are about the correct path that the encoding of the same library should have ...

If I create individual methods for each environment or if I create a single method and that it has the ability to determine if it is web or cli ...
    public function Output($varname, $retrive = false)
        if (!$this->IsCommandLineInterface()) {
            $indents = $this->GetIndent($varname);
            $string  = $this->GetString($varname, $indents);
            $string  = $this->HighlightCode($string);
            $string  = $this->ApplyCss($string);
            return ($retrive ? $string : $this->OutView($string));
        } else {
            echo 'error: you are trying to run output() method from CLI and it is not supported, use OutputCli() or AdvanceOutput() with CLI argument  method instead.';
this is the example of that i have....
@DerKommissar thanks, I don't know how to remove it ... XD
If you're already going through the work of determining the environment just have it call the proper method internally
As a user of the library, I think I would prefer to have full control.
@DerKommissar I'm looking for the easiest way to do it for novice XD programmers ...
@Edward ok
There's no technical reason one should not be able to emit HTML from the command line. I might, for instance, redirect it to a file.
You can eliminate the ini_set by emitting full HTML instead of relying on the auto-PHP HTML, which you should do anyway because technically PHP INI stuff is an outside dependency you have no true control over.
Of course you can't do that if you're using var_dump, so you'd have to do it yourself.
3:12 PM
@DerKommissar ok thank you i will get this note for the theming instance of the library
this is a updat example of the en user programing control over CLI and Web broser:
    public function Output($varname, $env = 'wb', $retrive = false)
        $iscli = $this->IsCommandLineInterface();
        if ($iscli && $env == 'wb') {
            echo 'error: you are trying to run output() method from CLI and it is not supported, use OutputCli() or AdvanceOutput() with CLI argument  method instead.';
        } elseif (!$iscli && $env == 'cli') {
            echo 'error: you are trying to run OutputCli() method from web browser and it is not supported, use Output() or AdvanceOutput() with HTML argument method instead.';
3:36 PM
Ryan Donovan on February 25, 2021
We’re partnering with Tectonica to sponsor students eager to learn software engineering.
"Any suggestions?" is too broad for Stack Overflow. If you want a code review, then post to that site. If you have a problem with this code, supply the expected minimal, reproducible example (MRE). — Prune 36 secs ago
3:55 PM
@DerKommissar I'm already on this ... I have a very remote idea of how to cross the style between initset and the highlight-string method; Do you have an idea or an example that you can give me ...
You would have to start with writing your own var_dump entirely
Well, that's where I would start
@DerKommissar i have it ...
in the library
Well then if you have your own version it would be as trivial as having it output metadata about the formatting
1 hour ago, by Francisco Núñez
Q: Class showing a format similar to var_dump

Francisco NúñezSome methods of this library require some improvements (see this description): In the constructor I am trying to create the possibility that the user modifies the colors of the output. I think it can improve but I do not know if there is any standard or good practices in this regard, or if there...

@DerKommissar AnalVariable, EvalVariable are related to the output like var_dump
@DerKommissar Sound like you got the start of a review.
4:00 PM
As an aside, "AnalVariable" in English reads as "anal variable" which is not what you want.
@Mast Too lazy to write one.
@Edward shrug We put it on electrical schematics all the time for analog I/O
I think the name could be improved.
It's not the code review. I want someone who can give me a proper understanding and implementation of the `element-wise attention mechanism in detail that proposes the mentioned paperwork. The given code is just for the starter and my current understanding so far of it. — M.Innat 52 secs ago
@Mast I just use D[IOLC] and A[IOLC] for that
4:02 PM
@Edward Special meaning for those of us who are analytical analytical.
Thats on some kind of personality rating.
@Edward Anal | ysis of Variable
I admit I can be rather analytical in code reviews.
I'm not a fan of the abbreviation either, but so far nobody has complained about the usage.
The power rail for analog field I/O is the Anal PSU supplying Anal PWR
:57167583 001<?php
002# Author: Andy Wrigley wptest.means.us.com
003ini_set('highlight.default', '"class="aw_default');
005ini_set('highlight.string', '"class="aw_string');
006ini_set('highlight.html', '"class="aw_htmlsrc');
007ini_set('highlight.comment', '"class="aw_comment');
008$aw_source = highlight_file('your_sourcefile.ext', TRUE);
009echo str_replace('style="color: "', '' , $aw_source );
@FranciscoNúñez Doesn't translate to English all that well, Anal means related to the buttocks or rear of a person.
4:06 PM
@Mast That's AC -> AO for us
adjective: anal

involving, relating to, or situated near the anus.
"the anal sphincter"
(in Freudian psychoanalysis) relating to or denoting a stage of infantile psychosexual development supposedly preoccupied with the anus and defecation.
"he's anal about things like that"
Tell me more...
Is that Freud?
Yes it is.
@FranciscoNúñez Anyway instead of ini_set wrap each thing (name, =>, value, comment) in a <span class="whatever">...</span>.
I have to go build a Redis cluster
4:10 PM
@DerKommissar what you say is not about writing the var_dump, for that what I would be doing would be about writing the highlight_string.
Whatever you want to call it or wherever you want to put it.
@DerKommissar I don't know, maybe for a later patch. for now I will continue with the initset.
I heard yall were talking about anal
@brug There was an audible chuckle at that
4:17 PM
I'm reminded of a certain role from the t.v. show Arrested Development - a portmanteau of analyst and therapist
It was alredy corrected
@SᴀᴍOnᴇᴌᴀ 0.0
rename to AnalysisVariable()
That's a better name.
Just use standard PHP convention of nonsensical names: a_var.
4:22 PM
@DerKommissar where is that documented?
It was a joke lol
@DerKommissar ok
I'm bad at understanding jokes, sorry.
is that I have a degree of autism.
Dr Freud definitely looks very analytical.
4:44 PM
@DerKommissar AO is analog out. Sometimes AQ.
Yeah, same here.
Where Output just means some sort of power, if it's logic it's AL.
You can ask code review related question here -> codereview.stackexchange.comyoucantseeme 39 secs ago
5:01 PM
Q: how to make the array output step by step?

AndriyipzI do so, but something displays already slightly rearranged array I do not understand why or so it should be? is it still possible to implement this idea? The essence of quicksort is to shuffle the elements of the array so that it is divided into 2 parts. The first contains elements that are less...

@skiwi How many ways do you know to open tabs?
What is your tab count up to these days?
5:18 PM
This is Stack Overflow and not Code Review. You should post your question over there. I have not completely reviewed your code, but there is too much Open-/close window etc. This is a view model and should not deal with open close logic - it doesn't close windows or reacts to windows being opened or closed. It seems you mixed up some responsibilities. Also CRUD operations in view model sounds not good. This is model logic. View model does not know underlying data persistence layer. — BionicCode 13 secs ago
I’m voting to close this question because This question belongs on another site in the Stack Exchange network(Code Review) — BionicCode 6 secs ago
@pacmaninbw I mean, in the end only the result is what matters, more tabs
> List all 3350 tabs
@skiwi are you looking for more ways to open tabs?
It's not about the ways, it's about the accumulation speed.
somebody could make a skiwi'd script... though maybe that already happened
@SᴀᴍOnᴇᴌᴀ You know.. I once wrote a script to reopen tabs after Firefox crashed and I lost them all, it wasn't successful though because it couldn't open them correctly when I opened them quickly in succession
5:25 PM
Yea, opening that many tabs should crash the average computer.
Browsers got very good at storing tabs.
Opening 3000 within a couple of seconds though...
maybe a delayed effect would help
addons.mozilla.org/en-US/firefox/addon/tab-session-manager I use this session manager on top of the Firefox in-built recovery system in case of a crash
Q: Rust Book: The Twelve Days of Christmas

muffinIn order to learn Rust I'm going through The Rust Book and did the implemented a program for the following exercise: Print the lyrics to the Christmas carol “The Twelve Days of Christmas,” taking advantage of the repetition in the song. I have decided to use lookup tables for the repeating line...

@skiwi Does that work on the same cloud as the FF account system?
Script with a 1 second delay for each tab to open. Start script, go get lunch.
5:31 PM
That's some lunch.
@Mast Hmm if my PC goes up in fire then it's probably all gone
I try to avoid that.
@Mast That's some fire-proof advice there
@Mast 3600 seconds in an hour.
@pacmaninbw My lunch takes 30 minutes, at most.
5:36 PM
@pacmaninbw It cracks me up when people say "one a second is so long" then it gets put into the perspective of 3600 seconds in an hour, or 86,400 seconds in a day.
"We need a bigger storage data-type for this column! It logs something like once-a-second!" "Uhhhh, that's only 31.5 million things a year, it would take 68 years to overflow it."
If it takes 68 years to overflow, you don't have a problem at all.
Unless we're talking Y2K bugs here.
But for an internal DB, shiii, I'd like to have that as my biggest worry.
6:23 PM
I've read an analysis that looked at the cost of storing the full year vs. the cost of fixing everything before New Year's Day 2000 and concluded that the Y2K problem was actually a cost savings.
Not sure I believe it, but it was an interesting thought.
6:37 PM
Hmm GME to the moon again today
6:58 PM
Example, the smallest Double needs 1000+ characters to print exactly, yet for all Double, sufficient to print to 17 significant decimal places to round trip the text back to the orginal double. — chux - Reinstate Monica 46 secs ago
7:56 PM
Q: Create file path and filename in JSON and send it to discord

ProtractorNewbieI have been working on a function which I call report. What it does is that whenever I call the report function. I can give it a payload of my dict with some data and as well as "reason" where I can have custom message or the exception errors of whatever can happend. For now I have created someth...

@CaptainObvious AOC TMCVN
possible answer invalidation by th0mash on question by th0mash: codereview.stackexchange.com/posts/256438/revisions
8:21 PM
Q: Vigenère Cipher problem in competitive programming

John DoeI've just started doing programming problems. https://icpcarchive.ecs.baylor.edu/external/58/p5880.pdf The code below works fine, but my run time is 2.715 seconds and the time limit is 3 seconds. How can I improve speed of this code? I've already started to use sys.stdin instead of input(). impor...

Your code confuses the concept of a "deck" with the logic of dealing out cards to multiple players -- a "deck" should just be a list of cards. Check out codereview.stackexchange.com/questions/234880/…Samwise 15 secs ago
9:13 PM
@Duga likely in response to comment by @peilonraz - meh....
Have you forgotten an __init__.py in package/simulation? — Peilonrayz 3 hours ago
9:33 PM
Q: assignment idiom?

user1095108What do you think about this assignment "idiom"? template <typename ...A> constexpr auto assign(A& ...a) noexcept { return [&](auto&& ...v) // noexcept(noexcept(((a = std::forward<decltype(v)>(v)), ...))) { ((a = std::forward<decltype(v)>(v)), ...); }; } It seems a better altern...

9:58 PM
Q: Design pattern to replace switch case?

Steve NgaiI have a simple service class here which import csv or xml file into database using .NET Standard library C#. Any comments? public class AbcPaymentService : IAbcPaymentService { private readonly IAbcPaymentContext _abcPaymentContext; private readonly IConfiguration _configuration; pub...

10:28 PM
@CaptainObvious @Mast Does this question smell fishy to you?
I noticed that earlier today... yes it has code but it looks more like a design/structure question....
FWIW design questions are on-topic. And I can't remember any rules around project structure. None the less the question seems fishy to me
Might be a "should" rather than an "is" situation

« first day (2854 days earlier)      last day (54 days later) »