« first day (2797 days earlier)      last day (1518 days later) » 

00:00
possible answer invalidation by Linny on question by Oliver Schönrock: codereview.stackexchange.com/posts/254056/revisions
RELOAD! There are 7247 unanswered questions (89.6337% answered)
@Lurch thats okay - trailing code fence
00:40
0
Q: Generic hashmap with dynamic resizing and collision handling

766F6964This is a (more or less) continuation of a previous post I made: Generic implementation of a hashtable with double-linked list. I got lots of valuable feedback, so I decided to rewrite the entire module from scratch to improve readability, performance and also to add new features. Specifications:...

Maybe try posting this on code review? — Chris 59 secs ago
01:03
I'd need more of an example to look at. Try submitting a possible solution on the codereview stackexchange and asking if there's a better way. — pjz 33 secs ago
 
2 hours later…
02:45
0
Q: Persist keyboard backlight color on linux laptop

ShapeOfMatterSystem76 sells laptops that come preloaded with their Ubuntu spinoff Pop_OS. The laptop keyboards have backlights that can change color and brightness, but so far I haven't found any way to keep the setting when I restart the machine; it goes back to bright white. Here's someone else struggling w...

03:35
0
Q: Make two random enemies shoot projectiles every second

Happy CoconutJust finished my canvas game that is more or less replica of the old school arcade game "Space Invaders". The code below chooses two random enemies every second (approximately) from the enemies array to shoot projectiles. If there are two or more enemies left in the array I want two random enemie...

03:53
I recommend codereview.stackexchange.com as this site is geared towards solving a specific problem, not improving code. — Dale K 7 secs ago
04:05
possible answer invalidation by Happy Coconut on question by Happy Coconut: codereview.stackexchange.com/posts/254072/revisions
04:40
possible answer invalidation by Happy Coconut on question by Happy Coconut: codereview.stackexchange.com/posts/254072/revisions
Monking
possible answer invalidation by Happy Coconut on question by Happy Coconut: codereview.stackexchange.com/posts/254072/revisions
05:40
0
Q: Fastest (in clock cycles) 16-bit x 16-bit unsigned integer division algorithm for ATMEGA1284?

user4574I am trying to create an optimized 16-bit division algorithm for the AVR ATMEGA1284. The goal is to reduce the number of clock cycles as much as possible. AVR INSTRUCTION SET MANUAL: https://ww1.microchip.com/downloads/en/devicedoc/atmel-0856-avr-instruction-set-manual.pdf AVR200: Multiply and D...

06:30
0
Q: UART receiving random values

Unpared ElectronI tried to transmit "S" using De0 nano FPGA board and UART over USB module . The problem is i am not receiving "s" constantly . I am using the software Called Hterm to see receiving data. When i remove the USB to UART module from the PC and reconnect the receiving value changes. After removing ...

07:14
Make the question self contained (summarize the problem statement, the described solution, your code, and (if any) the details of the mentioned input test cases) -- because this is a "make my code faster" question it can also be asked on Code Review -- remember to read their help center before asking. — user202729 31 secs ago
07:27
@user202729 Considering there is no code to be seen, this is absolutely unsuitable for Code Review. There is no request for review, there's a request for a solution. — Mast 19 secs ago
07:39
If you want it reviewed, the goto platform is this stackexchangeanurag 12 secs ago
Considering a lot of users can't find our help center, here's a direct link. — Mast 25 secs ago
@Lurch Sure, tell a 12k user that has been around for years what the most obvious meta post is.
08:10
0
Q: Why writing by column is slow in two dimensional array in C#

Muhammad Faizan KhanI have two-dimensional array when I am adding values by column it write very slowly (less than 300x): class Program { static void Main(string[] args) { TwoDimArrayPerfomrance.GetByColumns(); TwoDimArrayPerfomrance.GetByRows(); } } class...

09:25
0
Q: How to carryout two operations from GET request Django

Avishka DambawinnaI'm trying to build a wish list for my website. So I created a view that will render out the wish list and to add items to the wish list - using ajax Those two tasks are carried out by the same view. Here's how I did it, views.py @login_required(login_url='/login') def wishlist(request): w...

09:35
possible answer invalidation by Happy Coconut on question by Happy Coconut: codereview.stackexchange.com/posts/254072/revisions
09:50
0
Q: Perceptron usage and callification accuracies with Python

reivaJI recently finished a homework on the perceptron algorithm, the given answers on the website from where this exercise was extracted are different on the top_10 word lists and on mnist accuracy test results, I must have messed up somewhere. My answers and code are on hw3_part_2_main.py, the origin...

10:20
possible answer invalidation by Happy Coconut on question by Happy Coconut: codereview.stackexchange.com/posts/254072/revisions
11:11
@feridok how do you set variable backgrounds directly within the xml layout file? I will add my data class. Just to advise as per comment from Prashant padding corrected my issue. And as a beginner I don't doubt there can be many improvements. As you suggest helping me with the data side please see this post instead codereview.stackexchange.com/questions/253777/…UnknownError 27 secs ago
@Lurch That's a self-done manual rollback.
Ugh, I should've caught the much earlier ones.
This is a bit ugly now.
11:30
1
Q: Simple hangman game from beginner

JessicaBrThis is my first project I am attempting in Python, and my first time on Stack Exchange, so please be kind. The game uses a text file with lots of words. I was wondering how to improve the game by having different difficultly levels. E.g. easy for 1-4 letters, medium for 5-8 letters, hard for 9+ ...

 
1 hour later…
12:43
Have you written some code and it is too slow? If it works, then here isn’t the place to ask about performance the question should be on codereview.stackexchange.com — barny 51 secs ago
@barny a little trick, try writing [codereview.so] and see what happens :) — Tomerikoo 22 secs ago
@Tomerikoo While you're at it, please link to the help center instead. — Mast 35 secs ago
 
1 hour later…
13:49
Monking
Monking
Any Excel gurus around?
Does it involve VBA?
I have data in a table on some site, but when I paste it it gets pasted as all rows and it doesn't recognize the columns
Is the source an HTML table?
13:53
paste special?
Instead of 1753 rows I want 150 rows with 14 columns
Oh to make matters worse, it leaves out empty columns.. boo!
It's not even an HTML table :(
I just notice that it doesn't even copy empty columns from the source.. so that makes importing hard/impossible
I've found that saving as a text file and then opening that often works better than pasting directly.
It's got classes like ui-grid-canvas, ui-grid-row and ui-grid-cell-contents
Apparently Angular or something :/ afraid simply copying isn't gonna work
13:57
Are you going to be doing this operation repeatedly or just once?
Well, once today :P Few times per year
I'd be inclined to write a quick program to grab the web page and parse it into CSV
Hmm probably.. it does involve programming in my holidays though :P
I'd probably do it in Python, but as I recall, you're a Java expert
@Edward Hmm not anymore, all my previous years experience is in C#
14:00
Yes, programming on holiday. What else would you possibly do? :)
Either Java or C# have pretty robust libraries for web access as I recall.
Sorting through thousands of trading cards around here ;)
Ooooooooooooooh! I was digging into network now and the data is submitted as JSON :)
There ya go!
Made my day literally
@skiwi Import it differently.
And yes, I'd Python it.
This is why I hate CSV, because everyone exports it slightly different and Excel will save it in a format that's not the original.
JSON helps :-)
After getting used to CSV and JSON I now have a XML problem, so it's trouble again...
So apparently Excel has a fancy JSON importer now
14:15
I was just thinking of refactoring a project of mine to switch from ini to JSON for config file.
I've never understood why people hate so much on ini files. They're bloody brilliant for simple configurations, even if it's a thousand lines.
Categorizing the keys helps.
It's not awful, but JSON is better for lists IMHO
If you're using levels, yes. If everything is on the same level...
This is not what I wanted
14:17
It's very concise.
You're trying to use a pivot table aren't you? You don't want a pivot table straight after an import.
If this is what Excel recommends, you got pranked.
Got what I wanted :)
2
Had to check some more boxes and then poof it worked
Ah, yes, last time I imported CSV into Excel I had to select the data format for all 220 columns.
Fun times.
Because, naturally, some were numbers, some were text, and I would've been fine with considering everything as text but there was no option to pick one for all columns.
@Edward To use Fedora on my laptop I will probably need to download a third party driver for my display. I'm seem to be currently seem to be limited to 1024 X 768.
@pacmaninbw What's your video card?
14:21
Isn't software nice when it all just works
@skiwi Yes it is.
@skiwi That happens?!
3
@skiwi Then, and only then.
@Edward I didn't even know anymore that it was possible..
@pacmaninbw Possible help with that: ask.fedoraproject.org/t/…
14:28
@Mast NVIDIA Quatro RTX 3000
@pacmaninbw Quadro? That's a CAE card.
Nice.
Yes, you'll have to download the nVidia driver from their site.
Aaaaan apparently Linux drivers are no longer on the nvidia site.
Ah, NVIDIA doesn't play nice with Linux. You can either download drivers from nVidia or use the rpm_fusion repo.
Oh boy, lots of fun today.
It's currently using the nouveau driver I guess?
14:32
0
Q: Why is this Segmented Prime Sieve so fast?

SivixThe idea of a prime sieve is fascinating - but it has to be segmented to increase the locality of the code if you want it to be fast. Walish's segmented_sieve.cpp (see below)showed me that it works - fast. It took me some time to understand how the segments are managed. Once my version was workin...

probably, what ever installed with the latest version of Fedora. Both CentOS and Ubuntu work correctly.
A guide to installing nVidia drivers on Fedora here, not tested.
Apparently you'll need the akmod-nvidia
That's right. It's a more durable solution than downloading from NVIDIA because it allows automatic updates.
It gets even more complex when attempting to use cuda.
Thanks gang!
Although I don't know how often Quadro's get driver updates. It's stability and longevity over minor increases with that series.
We're looking into getting a couple for our department as well.
14:40
Hmm now on to the part I hate most... Say I bought 50 cards for 600 euro in total, now I need to artificially split them over different rows because it was a total price
Use a separate table for that.
How do you mean?
For combo packs.
Use an identifier noting the pack number, give the pack a price.
If you split cost equally over the pack, now you can calculate the cost based on the size of the pack, retrieved by pack number.
Hmm actually in this case I don't even care for profit per card per se, I just want to give one number to multiple cells in a row, but I guess Excel doesn't let me
Would make for some nifty SQL, not entirely sure how VBA would best solve that.
14:44
Put the value into 1 cell then use that cell in others in a formula.
Yea, Excel is pretty good at that.
In B1: =A1
But you already know that, right?
Would it only count once if I want to sum the values?
If you sum per column, there's no problem.
@CaptainObvious Am I correct in my presumption in my comment?
Use the Subtotal formula
It excludes previous subtotals.
14:47
@FreezePhoenix Eh, possibly, but I really wouldn't want to abuse compiler optimizationlevel for that.
Hmm not sure if I understand all that
Just force to use all variables.
Problem is that using all the variables would require outputting them somewhere
I.E logging them all
And that isn't a good idea with that many things to log
shrug
For benchmarking purposes, why not...
@FreezePhoenix Or send them to an empty external function. The compiler can't optimize that away.
14:50
True
Is volatile an option here?
That usually prevents a compiler from optimizing a variable away too.
Yes, but depending on the code, it could have other unfortunate side effects.
I.e. it could prevent optimizations that it should actually be able to do.
Possibly.
Ehhh like
volatile int a = 1;
volatile int b = 2;
int c = a + b;
And the compiler doesn't just set c to 3? Stuff like that?
14:54
@FreezePhoenix Yes, but it would also refuse to cache the value of either a or b if they were used in a loop, forcing a reload every time.
Oh, yikes
Yes.
That's why I recommend an external function.
It's great for I/O, less great for everything else.
I've only use volatile for hardware addresses.
14:56
Yes, things that change outside of the software.
That includes other threads or a signal handler (the latter is often overlooked).
FYI the original Sun C++ compiler on Solaris optimized out even volatile variables. Major bug.
Eh, volatile shouldn't be used to prevent optimizing things away
Actually, yes, it is required by the standard.
It should prevent it
But shouldn't be used solely for that
15:00
Oh, yes, I see what you mean now.
Why is it required by standard?
Is it because unknown deconstructors might need to run?
@Edward I don't.
I mean, it can probably be abused for many things, but that's essentially what it's for, right?
Or does the standard prescribe it for more situations?
Volatile seems to supposed to be used for things that other programs could modify
So if you have
volatile int a = 1;
someOtherThing();
It depends on which version. C++20 made some (welcome!) changes in that area.
You are probably trying to account for the fact that someOtherThing may modify a in ways that probably shouldn't be done lol
15:04
@FreezePhoenix Or should. Like with hardware addresses.
Sometimes you want 2 programs to use the same data.
As mentioned by @pacmaninbw, a very common use of volatile is for I/O.
When programming microcontrollers I used it a lot, never since.
For example, on ARM processors, all I/O is memory mapped, unlike x86.
@Edward Oh. That makes things different.
@Mast Well, yeah. tl;dr when you alter things via memory addresses and don't want caches to be a problem
15:05
When working on bare metal, you don't want caches to hinder your interrupts.
I guess altering things in ways they shouldnt be is probably just assigning arbitrary things to ram indecies lol
So if you need to read, say, a read-only freerunning timer, it would be volatile.
Most of my microprocessor work had no cache. Just a meager prefetch buffer.
Or input from a button a user can push, or a lever that can be struck, or any kind of input that has to be handled now.
Okay, got a Dr appointment in an hour, gotta go.
see ya!
15:08
Best of luck @pacmaninbw
@Edward They put this in C++20, but it's not yet in C? So the two languages will actually be handling it differently?
Yes.
Fun.
Although this is likely to be a theoretical problem for some time. Embedded compilers lag notoriously behind standards.
Oh yes.
Gotta love decompiling webassembly
15:14
Also, the reason for the change is that existing ambiguity makes different compilers work differently already.
Interesting. I've been meaning to learn more about webassembly.
The language itself seems to be stack-based, primarily, and able to interact with other languages through the stack
Reminds me of an actual, in-person code review from many years ago. There was a line a = 5; and then several lines below a = 5; again.
When asked why, the programmer just said, "Well a really needs to be 5 there."
@FreezePhoenix Why...
@Edward Haha, that's so relatable and so wrong at the same time.
15:17
@Mast IDEK. WebAssembly variables are weird, you can assign things to integers, because in the end you're actually assigning to that index in the stack.
The repeated a = 5 reminds me of this solution to the Trolley problem:
This is btw WebAssembly decompiled back to C code, so it's not the best.
weird!
WebAssembly loses syntax for pointers when decompiled to C-code
15:19
What are using to decompile?
And yes, you can totally move a trolley like that for real.
And to compile:
There's a small issue with that decompiler though, it sticks fn_ in front of every function when it decompiles lol
Thanks!
WebAssembly has two formats, a text format and a binary format
Obviously, I suggest writing in a text format lol
Bookmarked them all. Thanks! How are you using webassembly?
15:29
How am I using it?
Like, how do you run it?
No, I mean for what purpose.
Ohhh I currently am not using it at all I just learned it a while back to add it to my toolbelt.

Also because JS is slow as heck, and WebAssembly would allow me to write hot code paths in a faster language. Good for more calculation intense things, because C / WebAssembly has some pretty good optimization, which JS just doesn't have.
Makes sense. To me it's appealing because I might be able to write some simulation code in C++ and have it run with reasonable performance in a browser.
The WebAssembly's memory is exposed as an ArrayBuffer
WebAssembly can call JS code and vice versa
@Edward Your primary bottleneck with a small simulation will be JS drawing to a canvas. The C++ code isn't gonna be an issue.
Yes, I hope to be able to use typical Web stuff (js, html, etc.) for the GUI and do the heavy lifting in webassembly.
The simulations I have in mind just need to show the end result, not each step.
15:54
Greetings, Programs.
Web Assembly sounds like an on-line all-school meeting.
It is and you're late! ;)
Is there a good IDE for it? Somewhat decent to write?
I’m voting to close this question because Stack Overflow is not the appropriate site for code review requests. — Daniel Mann 51 secs ago
I get the sense that writing directly in webassembly is not the main way it is going to be used.
Yeah, if there isn't a JetBrains plugin then it doesn't exist.
16:08
Yeah you're not supposed to directly write in WebAssembly.
You can, but, eh
possible answer invalidation by Usman Khan on question by Usman Khan: codereview.stackexchange.com/posts/254024/revisions
@Mast that could lead to Yet Another Fast and Furious (YAFAF) movie
16:28
@FreezePhoenix What do you write in then?
@Mast WebAssembly is compiled from C or C++ code
Ok
16:44
0
Q: Simple 5 operator calculator in C#

Mastermind817The program takes 2 decimals as input and an operator (+, -, *, /, ^) so far. Any suggestions to make this code cleaner or shorter? using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Calculator { class Program { ...

17:10
0
Q: A recursive_transform Template Function Implementation with recursive_invoke_result_t and std::ranges::transform in C++

JimmyHuThis is a follow-up question for A recursive_transform Template Function Implementation with std::invocable concept in C++, A recursive_transform Template Function Implementation with std::invocable Concept and Execution Policy in C++, A recursive_transform for std::vector with various return typ...

Isn't this more of a code review question? — M-Chen-3 17 secs ago
@GSerg The only purpose is to understand the mechanism behind VB which is very useful for finding the cause of other bugs or coming up with new approaches (e.g. Private Initializer) — Cristian Buse 45 secs ago
17:35
0
Q: Optimize nested loops for counting the total number of selections

Hongxu ZhaThe question is: To select 2 numbers out of n positive integer inputs (order matters), where the number that is placed anywhere before the second must be greater than the second by a given number m. Count the total number of selections. An example answer would be, given the inputs 5 1 3 2 4 and m...

possible answer invalidation by Mastermind817 on question by Mastermind817: codereview.stackexchange.com/posts/254095/revisions
17:56
If you are wanting to change the speed of this loading bar, then you should provide the code (copy paste it here) in this question. If your bar is dependent on what happens in the background, then that's code optimization and should be moved to codereview.stackexchange.comSomePerson 21 secs ago
@Lurch rolled back
0
Q: A Simple Media Generator with Directional Control

CodeLoveGuyMy goal was to have a single page display bulk amounts of media without the need to load new pages. I also wanted it to be able to load fast, so the generator uses a JavaScript array to display one item at a time. The user can move through the array backwards and forwards with the use of two butt...

18:14
Had a nice appointment with the Cardiologist. I checked if I could have a couple of drinks at a Zoom New Years Eve party I'm going to tomorrow and he said yes.
Cheers!!
That's good news.
Yes it is. :)
19:03
If this code is working but you're looking for efficiency, shouldn't this be in CodeReview? — Chris H. 51 secs ago
19:21
@ChrisH going along with what ChrisNeilsen stated: Please see Does being on-topic at another Stack Exchange site automatically make a question off-topic for Stack Overflow?. I see you have a CR account but it might also be helpful to read this if you haven't already: this answer to A guide to Code Review for Stack Overflow usersSᴀᴍ Onᴇᴌᴀ 1 min ago
@pacmaninbw Congrats.
19:43
0
Q: Writing unittisting for coference managment class

user1568064I try to use unittest for conference class, but I am sure that I have considered all condition or more complex tests should be added? conference.py from datetime import timedelta, datetime class Conference: def __init__(self): self.inputs ='input.txt' self.outputs = 'output...

20:34
0
Q: Distribute items based on the time duration

x80486I just finished a small assignment and I would like to get some feedback about the implementation here. Basically, it was all about distributing items ("talks" in this case) throughout the day based on the time constraints (their duration). For instance, a given place have different "tracks" each...

20:49
Using only a much more trivial CopyMemory method I had crashes when porting from 32 to 64 bits. It all boils down to assure the size of object based on your table of sizes ITypeInfoVtblOffset and IDispatchVtblOffset versus get actual size through LenB(Obj). Maybe it is worth to do some tests to compare. — Marcelo Scofano Diniz 1 min ago
@Mast It's always good when you make the doctor laugh. My appointments with the cardiologist keep getting further apart. Definitely a good thing.
0
Q: Filter out comments in Delphi source code

EdwardToday I am working on refactoring and documenting some ancient Delphi code. In that language, which is derived from Pascal, there are three forms of comments: (* This is the original Pascal style comment, which is never used in my files *) { this is TurboPascal-style comment which I want to remo...

0
Q: My String Class

Albin MHere's my very basic String class. This is my first attempt, to try to design and write a basic String class in C++, without using the absolute new features provided by newer C++. class MyString { public: MyString(): pSize{0}, pStr{nullptr} {} MyString(const char* cstr): ...

21:10
The display is working better on Fedora now. Thanks!
@pacmaninbw Great! Did you use the rpm fusion approach?
21:39
Yes
I followed the script of the link you sent me.
21:55
Post that question under Code Review. — Louys Patrice Bessette 23 secs ago
possible answer invalidation by Kevin on question by Kevin: codereview.stackexchange.com/posts/253959/revisions
If this is working code, I think it is better asked on code review. — Thymen 41 secs ago
@Lurch post is currently off-topic
22:15
0
Q: Basic schemas for database and tables creation, bulk import from .csv and basic queries enhancement and improvement

I. Я. NewbThe following SQL code is for the purpose of asesing basic SQL Server literacy for university assignment. I am creating database and tables schemas, inserting data from .csv files. Constructing 8 simple qeries as answers to assignment tasks. The code works well, but as I am very new to MSSQL Serv...

0
Q: Tic-Tac-Toe Game vanilla JS/CSS

Sarbast UmarI am practically brand new to coding and this is my first "real" project I've been attempting. It's an attempt at a vanilla JS game with selectable layout and win conditions (partially implemented). ATM it only has a vertical win condition included as I didn't want too much cluttering of the code...


« first day (2797 days earlier)      last day (1518 days later) »