« first day (3314 days earlier)      last day (708 days later) » 

12:03 AM
REFRESH! There are 8089 unanswered questions (89.3008 answered)
 
 
5 hours later…
5:44 AM
1
Q: Download Ubuntu daily ISOs and make them into VMs for alpha and beta testing

ArrayBolt3I'm an Ubuntu contributor, and I finally got tired of the workflow for ISO testing I was using (zsync, gpg, sha256sum, create Gnome Boxes VM, install, delete VM). So I decided to make a Bash script to automate a bunch of the process for me. Trouble is, Bash is not my "native" programming language...

 
 
2 hours later…
8:01 AM
if this code works and you are just asking for feedback, this question might be more appropriate for Code Reviewblackgreen 44 secs ago
@blackgreen yes, it works. And I have posted the snippets in code review. Thank you — Srikanth 8 secs ago
 
0
Q: Go Routine: Multiple Consumers to RabbitMQ

SrikanthHere I'm trying to create the multiple consumers of rabbitmq queue using the goroutines. Also, I'm trying to achieve a graceful shutdown. Is the following approach create any memory leaks? or is it the correct way to handle them? package main import ( "fmt" "log" "os" "os/signal"...

 
 
2 hours later…
10:19 AM
0
Q: A Sorting Algorithm

user13387446I've written this sorting algorithm in C. It looks for the element with the max value every iteration and adds it to the end of the array, swapping it with other smaller elements. This way, by almost n swaps, an n element array can be sorted. #include <stdio.h> int max(int arr1[],int l){ int...

 
10:48 AM
Monking
 
11:09 AM
0
Q: Responsive nav bar with dropdown

johnHello I implemented this relatively small responsive navbar with dropdown, feedback welcome. Technology used: React, CSS, styled components. Here is link to Demo. import React from "react"; import styled from "styled-components"; import { useMediaQuery } from "react-responsive"; import menuIcon f...

 
11:59 AM
0
Q: Largest product in a series

Amir MotefakerProblem description: The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832. 73167176531330624919225119674426574742355349194934 96983520312774506326239578318016984801869478851843 85861560789112949495459501737958331952853208805511 1254069874715852...

 
12:09 PM
@Mast Weird question -- what symbol does Germany use for tolerances on schematics?
We use the ⌀ symbol in FCF, curious if you use the same thing
 
 
1 hour later…
1:11 PM
You'll want to familiarise yourself with codereview.stackexchange.com. — deceze ♦ 23 secs ago
Please read about How to Ask. Questions here should be focused about a specific programming problem. General improvement questions are off-topic and might be better suited on Code ReviewTomerikoo 22 secs ago
 
1:38 PM
@DerKommissar I think we use the same in NLD, so Germany probably as well.
 
you may get more feedback posting this on codereview.stackexchange.comTJ Rockefeller just now
 
Makes sense
Here it's supposed to only be for radius (circle) tolerance but we use it for all of them because people are too lazy to write "TOL" on the sheet
 
2:28 PM
0
Q: Is there a way to make this cleaner?

wbBdkbs6@functools.cached_property def __compressed_streams(self): return [ np.frombuffer( self.__data[ self.__compressed_streams_offset + 0x2 : self.__compressed_streams_offset + 0x2 + self.__number_of_compressed_str...

0
Q: Countdown Timer with reset functionality in React

KindthI have a countdown timer set at every second. Every time I would reset the counter and choose another period to countdown, the previous timer keeps counting and will have multiple timers in the background. I tried to reset the timer. How can I stop the timer each time I go back and choose another...

 
3:17 PM
Monking
 
0
Q: A database trait in Rust. How can I make all these generic parameters easier to use?

hazI am trying to hide the implementation details of accessing a Postgres database. To do this, I want to create "database" and "transaction" traits for use in a repository struct. This should allow: Using a fake implementation for unit tests Migrating to a new database implementation without requi...

 
3:35 PM
@DerKommissar Yea, we use it mostly for bends. But I think our plate lengths etc. use the same symbol.
Although, probably, we use this one more often when not about bends/diameters:
The symbol you used is the Diameter symbol. The one I showed is the Geometric Tolerance.
Which is more universal.
But you probably use this too, since it's all part of the standard GD&T.
Depends on the company whether it's strictly enforced IIRC.
 
4:05 PM
Monking
 
4:44 PM
@CaptainObvious @pacmaninbw I added a link on the text blade components - they are a part of the Laravel blade template engine
 
5:27 PM
0
Q: algorithm that adds two numbers passed in as strings

DeEssI wrote a function that adds two numbers passed in as strings. The output is a string as well. This method of adding numbers just lets the numbers exceed their limitations due to datatypes like Integer. Nevertheless my algorithm seems pretty messy in my opinion and could possibly be simplified. M...

 
5:50 PM
Since you don't have an error in your query and are only seeking some form of "easier" metric for you code, this might be better suited for Code Review. The goal of Stack Overflow is to fix errors / problems with code, not to make it "easier" or "better" — devlin carnate 37 secs ago
 
6:12 PM
@WiktorStribiżew Thanks for your comment. I didn't even know there was a code review area. — twelsh37 37 secs ago
 
0
Q: Decrease number of lines in Teradata SQL

user259255I have query in Teradata SQL like below: CREATE TABLE ABC.SUMMARY AS ( SELECT DISTINCT A.NR, A.DATE, COUNT(DISTINCT B.ID) AS TRX_CNT, MAX(CASE WHEN B.ID IS NOT NULL THEN 1 ELSE 0 END) AS TRX_AB FROM BASE AS A LEFT JOIN TRX_BASE AS B ON A.NR = B.NR WHERE 1=1 AND B.TRX_DATE EBTWEEN ADD_...

0
Q: Is it possible to handle None, empty string, and 0 values with one if statement?

JThaoCurrently I am checking a dictionary value to see if its either Null, empty string, or contains a 0, if so I am appending an "" empty string to it and updating it as a new key value pair. Assume I am checking a dictionary with key "normalHours". Here is my code, hours_per_week = {} if item["norma...

 
This would be a better post on Code Review: codereview.stackexchange.comMansueli 50 secs ago
 
Monking
 
Before posting on CR, please read the SQL tag info. It is important you do this before posting. — Mast 34 secs ago
 
6:41 PM
0
Q: Is there a better way to write this postgres function for retrieving data?

mischkezHello dear people, I would like to know if there is a better way of writing this function: create or replace function get_user_profile(user_id uuid, auth_id uuid) returns json as $body$ begin return ( select json_build_object( 'id', p.id, 'userId', p."userId", 'displayName...

 
6:52 PM
I’m voting to close this question because it's about code review — richardec 16 secs ago
What would be your code review comments for the above code? — Mugil Karthikeyan 59 secs ago
 
7:34 PM
My apologies Yves Daoust, I didn't realize until today when I got this answer on Code Review SE that this codereview.stackexchange.com/a/276972/259116 was what you were describing with the stack. I hadn't seen this kind of implementation before and that's why I was confused by your answer. Here's a belated +1, and I deleted my earlier comments which were critical of your suggestions. — Quack E. Duck 31 secs ago
 
7:56 PM
0
Q: Do I need to await a completed task?

RussI have a method that takes a collection of objects, and in turn calls a method that handles a single object. My question is, do I need to handle the tasks coming from the DeleteSingleAsync method since it's not really an async method or is this safe since the concrete implementation is just retur...

 
 
2 hours later…
10:10 PM
@JamesTownmagiccoding The points are that (a) there's no "correct" answer to "how many classes is too many", and (b) topics like this are (roughly) off-topic on SO. The Code Review Stack Exchange may be a better place to ask, but it has its own standards for posting (which I don't recall). — Dave Newton 41 secs ago
 
10:41 PM
When to use these operators? Depends on what you're doing and just how vital it is to save the CPU cycles. There's really no hard and fast rule save for when you get an unfavorable code review that asks you why you're bothering with bit shifts instead of multiplication/division so that the code is readable. — Makoto 19 secs ago
 
11:16 PM
0
Q: Python battleship game - Code to place random ships on the board

sweet_summer_childI am writing code to randomly place ships on a board in Python. I need help reducing the amount of Global variables I have in this code. I have thought about using a Ship class here but I'm not very comfortable with OOPS yet. I have also thought about passing these global variables by as function...

 
11:26 PM
possible answer invalidation by haz on question by haz: codereview.stackexchange.com/posts/276986/revisions
possible answer invalidation by haz on question by haz: codereview.stackexchange.com/posts/276986/revisions
 
@Duga from a cursory glance it looks okay - just adding context in response to commentary at the end of the one answer, but feel free to prove me wrong
 
11:43 PM
OP notified the user that provided the answer
Thanks for your answer, and very good point on the repository being useless! I think I'll keep it in the question as a minimal example of using the Database trait, though. I've added some more detail on trying to add a lifetime to the Transaction struct. I quickly ran into issues with HRTB and GATs :( — haz 14 mins ago
 

« first day (3314 days earlier)      last day (708 days later) »