« first day (2775 days earlier)      last day (1540 days later) » 

00:00
RELOAD! There are 7187 unanswered questions (89.6774% answered)
0
Q: Nested dictionary creation with setdefault

mlevitIs there a better way of creating a nested dictionary than what I'm doing below? The result for the setdefault is because I don't know whether that particular key exists yet or not. def record_execution_log_action( execution_log, region, service, resource, resource_id, resource_action ...

0
Q: Avoiding verbose compositional class design

Li BraryI've written some code which features Eric Elliot's javascript factory function mixin composition (https://medium.com/javascript-scene/javascript-factory-functions-with-es6-4d224591a8b1), but since there's no object field name associated with the class it doesn't seem like most other forms of com...

00:32
0
Q: Improved isinstance for IPython

OverLordGoldDragonProblem: IPython's autoreload and superreload may reload modules such that obj=Obj() -> edit file & save -> isinstance(obj, Obj) == False. Sometimes even imp.reload of all involved modules doesn't absolve it. Goal: a method with a 'fallback' on looser criterion that are as close to isinstance as ...

01:10
Anyone have any good recommendations for a book/course/online resource to learn python for peiople that already know how to program?
 
4 hours later…
04:50
Monking
@JohnP nope, don't speak python.
05:13
Monking
@JohnP If you already know multiple programming languages, Python is fairly easy to pick up. The docs have plenty of examples which may be sufficient depending on your goals.
 
1 hour later…
06:30
1
Q: External sorting with async read and write

CanhJust make the below code for a home task, and receive some negative feedback. Really appreciated the reviewer, but I really doubt when he said I use auto disorderly, and the algorithm is not optimal (I know it's not optimal, but comparing to the code that they expected which run about 5 x times s...

06:56
0
Q: Why my solution is relatively slow uses so much memory?

Ivan ShelomentsevSolved one of the easiest problem from acm.timus.ru. I would like to know why my solution is relatively slow (execution time is 1s) and uses so much memory (7 072 KB)? Compared to C++: 0.093s and 408 KB of memory. package main import "fmt" import "math" var a []int64 func main() { for { ...

0
Q: Getting output of a NodeJS script in PHP

Miguel StevensI'm using a NodeJS script to do some geo calculations using the h3.js library by Uber. the concept of getting a nodejs script result back into php is new to me. I found the following example online, which I'm not following. $output = []; $arg = escapeshellcmd('some variable to pass on'); $command...

 
1 hour later…
08:23
Just mentioning that New Feature: Table Support is now enabled network-wide.
08:37
If your code is in working order, you'd be probably better off asking on CodeReview instead. — Federico klez Culloca 6 secs ago
0
Q: wrapper class for random access iterator to hide template method implementation from header file

Sergey KolesnikI have a set of template functions that have itrator types as template parameters, so can be used with any kind of iterators. std::find can be a good example. Also I have a class that uses this function in its implementation and I don't want to expose my algorithms' header. Regarding the template...

 
1 hour later…
10:00
codereview might be a better platform for your question — jibsteroos 1 min ago
10:46
0
Q: PowerShell - calculate occurences of Friday the 13th between (including) two given years with builtin and without builtin

Xeнεi ΞэnвϵςIt's me again, talented programming beginner fast-learner, so I have overcomed yet another self-imposed programming challenge, I have developped two algorithms to calculate occurrences of Friday the 13th between two given years(including the two inputed years) as said in title using PowerShell, o...

11:07
Such questions are off-topic for SO. You might want to have a look at codereview.stackexchange.comThierry Lathuille 52 secs ago
Have a look at Code Review. It might be more suitable for this type of questions — Tomerikoo 1 min ago
 
2 hours later…
12:54
0
Q: C++ Simple brute-force algorithm

JeniaHere is the implementation of C++ brute-force class from newcpp: class Chance { private: const char start = 1; const char end = 0; string s = ""; void PlusPlus() { int a = 0; while (true) { if (a > s.length()) { s += start; ...

13:27
I wrote a bunch of for loops and if statements (that for the sake of the algorithm worked) but it was pretty ugly. If you have working code and you're looking for improvements, then you should post on codereview.stackexchange.com instead. — Mike Scotty 34 secs ago
Questions about improving working code are often better placed on codereview.stackexchange.com. Yes, "tail recursion" might be the right term, but as most major JS engines don't implement the specified tail-call optimization, it's probably of limited help. This Q & A and some other answers in that question offer useful alternatives. — Scott Sauyet 20 secs ago
14:03
You're not reloading a method, you're repeating a block of code inside a method. This could well be the right approach, but please make sure you describe it correctly. For actual advice on improving code that already works, it is better to ask on codereview.stackexchange.com instead of on SO. — Peter B just now
0
Q: Filtering Array Based on Element Values

Nɪsʜᴀɴᴛʜ ॐRequired to splice specific element value in an array based on the condition. Both the below code does the same job and yields the correct results. But couldn't figure out how to reduce coding structure with ECMAScript and which is performance oriented considering an array would have atleast 1.5k...

14:23
@pacmaninbw Got myself a table saw while it was on sale last week
Also got a new impact wrench and wet/dry vacuum, and a few other tools.
@DerKommissar Do you build furniture as well? You have a very well equipped shop, wish I could bring my Z4 in for service. :)
I want to start building small stuff like jewelry boxes, I have a 23-ga pin nail gun.
Are there any swap meets close to where you live so that you can sell that stuff?
Some I need for my house, some I'd probably put on ebay.
My dad is giving me an antique drill jig he used to have that he never used because it was a PITA, he's modifying it to make it easier to use.
I found the old commercial for the one he has: google.com/…
They don't make them that simple anymore. That one was a PITA because you have to remove the chuck for your drill, thread it onto the guide, then thread the guide onto the drill. He's modifying it so it has a chuck on it, and I can just drop it into the chuck already on my drill.
14:40
I could have used that last year when I was hanging my paper towel holder from my kitchen cabinets.
That one is also for 3/8” thread, which modern drills are 1/2” thread now.
Yeah, I can’t drill a straight hole to save my life, so I want that to help me put.
Are all your hand tools battery powered? My drill still has a cord.
Yeah, except for a handful: both my nail-guns, big impacts, and die-grinder are air-powered, my 4.5" grinder, router, and planer are corded.
Oh, my table-saw is corded too
I have a staple-gun rather than a nail-gun, it's muscle powered. A table saw will always be corded, you don't have a drill press that would solve some of your issues.
My drill, little impact, big electric impact, JobMax / multi-tool, drywall screwdriver, orbital sander, reciprocating saw, circular saw, and wet/dry vac are all cordless.
Yeah I have a manual staple gun too, Arrow IIRC.
14:47
You are much handier than I am, I wouldn't try to build some of the things you would.
What are you going to do to handle sawdust during the winter?
Blow it into the garbage can lol
I have a kerosene heater for the garage too
I have the Ridgid JobMax multi-tool system, I have to go pick up three more attachments today at HomeDepot.
Only cordless tool not pictured is my wet/dry vac.
Top is recip saw, then circ saw, big impact, JobMax + multi-tool + rotary head, drywall screwdriver, small impact, drill (with a Ryobi chuck because the chuck on it was wore out) and the orbital sander.
You have about 10 times the power tools I do.
I have a lot...the drywall screwdriver, JobMax and big impact in that picture I got this year, as well as the wet/dry and table saw.
How long will the battery last on the wet/dry vac?
I use the 1.5AH battery (smallest I have) and 10 minutes of use drained it 25%, so probably half an hour?
14:57
That is enough to clean the garage.
Yeah, I'm sure the 4AH I have would last a decent amount. It's only 3 gallon so half an hour is plenty to fill it lol
I got a tiny charger with the big impact that takes about 8 hours to charge the battery the impact has, so I just decided that the tiny battery and charger can be for inside my house.
Do you have an air compressor?
Yeah I have a big 60-gallon compressor.
Those are the batteries I take with my tools, the big one is a 4AH, the rest are 2AH.
Are those all good for about a day of work?
Depends on the tool, with my drill I can run it most of the day with 1 battery if I'm not constantly using it.
The circ saw gets 10-20 cuts with a 2AH, the recip / orbital saw gets 20-40 cuts with a 2AH, the sander gets about 30 minutes of runtime with a 2AH, and the little drill and impact get a lot of work in with a 2AH. I haven't used the 4AH or JobMax or big impact enough to know how they fare yet.
I also have the whole Ridgid tool storage system
All that stuff that was on the table fits in here with plenty of room to spare.
15:06
When are you buying a van to move this stuff around to jobs?
I have a CR-V
Is it big enough?
Can you put the back seat down?
15:09
Should do the trick.
So have you run ether net cable through the walls yet?
Yep, I can get all the hard-cases in the back with the back seats up just fine, and I can even get my tablesaw in there.
Yeah, I have Cat6 run to all my computer locations lol
When are you coming to Los Angeles?
;)
What kind of stereo setup do you have for movies?
Haha likely never, I'm not a west-coast guy.
I have a Pioneer receiver with 7.1 surround
I want Klipsch speakers but those are like $3k for my setup
Yeah, I have Snell speakers for my Yamaha Receiver it was $5K 20 years ago for the speakers. Snell is no longer in business.
Have you run the speaker cables through the walls?
I want good speakers eventually, I'm just not there yet. Probably when I move.
My living room is small so it's not a big deal anyway.
15:14
Are you selling the house?
In 3-5 years
I have a new Yamaha 7.1 on order, COVID wiped out the supplies in Southern California.
My old Yamaha can't handle HDMI
15:19
Any HDMI out to the TV?
> Full Bandwidth HDMI (4K UltraHD 60P/4:4:4) with HDCP 2.2
Yeah, 1 out IIRC
2 out actually
Has ethernet and Wifi and can stream Spotify and others
New ones have Chromecast built-in, I think mine is too old for that
This is what I have on order.
It also accepts PCM/raw audio input over HDMI, so for BluRay you can bypass the device's surround setup
Oh nice, not bad.
Mine can do 7.2.2 if I do Atmos setup.
Nice.
I've been using Yamaha receivers since 1993. The one I currently have I bought in 2000.
Yamaha was my backup, I use Onkyo speakers (Yamaha subbrand)
That's the speaker kit I want
+1 subwoofer
The floor speakers are Atmos on the top-end
15:28
Nice any mid range or tweeters in the back of the floor speakers?
I think so
My current receiver is a Yamaha RX-V2095, great for when I bought it. Got a good price because it was late in the cycle and they were introducing the replacement already.
I need to replace half of the speaker cables, especially for the Sub-woofer.
Talk about this makes me want to turn on the stereo, but I doubt my neighbors would appreciate that at 7:30.
Hehe I actually got mine when it was cycling out too, got it for $350...list at inception was $600 maybe?
If this code works, please ask at Code Review. — Andy Turner 53 secs ago
Welcome to SO. This question is more fitting for codereview. — Robert Todar 47 secs ago
Welcome to SO! Please take the tour and read How to Ask. This is too broad for SO. Please ask on Code Review instead, but check out their How to Ask page first. — wjandrea 36 secs ago
16:20
@pacmaninbw A lot of audio and PC supplies dried up lately. Hardware prices have risen 20%+ since August.
Generally if your code works but you want tips on improvement, Code Review is the site for you. That said, you're duplicating a lot of code, why not just calculate the rate once before the loop, then get rid of all of your if...else... statements that say the same thing — G. Anderson 58 secs ago
@Mast I've been seeing that. It was difficult to buy a new backup drive for my new laptop.
1 and 3 sound like process / documentation / code review issues. So you could solve them that way, if none of the technical alternatives are attractive — ADyson 5 secs ago
16:44
1
Q: make this code in better or simplest way

USAMA SARWARusing functions in shell script you are required to design an online shopping system maintain cart (a user can add and removing items from the card) print the final receipt of the customer. deleteelement(){ if (${#cartitems} -eq 0) then echo "There is nothing to delete in the cart"...

Monking
It looks like I've been missing out Tool Tuesday™
LOL!
Guess I should save my stereo comments for Saturday or Sunday.
we have a "buy nothing" group on FB for people in our neighborhood to offer things for free (I'd rename it to "buy fewer things" if I could) ... they have days like Tool Tuesday, Wish Wednesday, Thankful Thursday, Fat-chance Friday
sometimes I make up my own and do Slim-chance Sunday 😃
I borrowed a sander from somebody in the group to sand a twin bed with trundle for my son
Monking
That's nice.
Neat.
@pacmaninbw Do you have a Costco membership? on BF they had an 8 TB drive down to $120 from $170 - currently its at $140
@SᴀᴍOnᴇᴌᴀ Wish I had seen this sooner. I was able to get a Seagate 4TB drive to back up the new computer. The one you're pointing out I could have used to back up 2 or 3 computers.
17:22
Asking for generic improvements is a coding problem. Improvement of working code belongs on Code Review, not here. Again, please review the intro tour. — Prune 19 secs ago
@pacmaninbw I just got the rest of my JobMax heads
Jigsaw, shears and drill.
0
Q: How to eliminate derefs?

Maximilian BurszleySpoiler: Advent of Code 2020 Day 8 I'm solving AoC problems with Rust this year and ran across something where I feel there has to be a better, more Rust-like solution. In my loop, I'm derefing mutable references quite a bit and someone suggested smart pointers, but I don't know how that would l...

17:40
You probably should ask such questions there: codereview.stackexchange.comnatka_m 11 secs ago
18:01
0
Q: A star algorithm is very slow for large distances

Zyo2606I'm working on a school project where I need to implement the pathfinding algorithm. The requirements are that it needs to find the path in at most a few seconds and ideally in less than 1 second. I've been trying to optimize my code to make the algorithm faster but it keeps taking a few minutes ...

@DerKommissar Never knew that's called a jigsaw.
It's a decoupeerzaag in Dutch.
Basically semi-french for 'cut out saw'
Yeah we have like 4 names for it...jigsaw, cutout saw, scroll saw, plunge saw...lol
You're most likely to hear jigsaw or scroll saw here.
Though cut-out saw is relatively common.
18:26
0
Q: MongoDB Filter between two dates

ATheCoderSimple code for getting documents that have a creationDate between two values in mongodb. If the user provides only one of the values the code should still work and get the documents that have either a creationDate less than or bigger than the given value. I'm mainly looking for more readability ...

0
Q: How can I use threads to speed up or break up this code

plantsMy goal here is to use threads to speed up this program. I am really new to threads and I can't see where it would be most useful, but it is required. The code itself determines if a number is prime or not, and there are some initial checks to rule out some values. Other than that I really don't ...

19:17
0
Q: C++ implementation of a Stack with dynamic C-style array

Tom GebelI implemented a Stack in C++ using a dynamic C-style array. I tried sticking to the most important functions a Stack has to have to be usable. This is meant to only be for integers. I appreciate any suggestions on how to improve this. Here is my code: Stack.h #ifndef STACK_H #define STACK_H #incl...

19:35
I’m voting to close this question because it s a question about reviewing running code and should be asked at Code ReviewJens 12 secs ago
What are your criteria for "better"? This might be a more suitable question for Code Review. — Fred Larson 23 secs ago
@FredLarson when suggesting users post on CR it would be great if there was also a suggestion like "Please read the relevant help center pages like 'What topics can I ask about here?' and 'How do I ask a good question?". In the current form the code above would likely be closed as off-topic because it is missing details about what the code does, which happens frequently. — Sᴀᴍ Onᴇᴌᴀ 46 secs ago
20:07
This sort of question is more apt for codereview.stackexchange.comkluvin 49 secs ago
0
Q: React Bootstrap Table2 Footer and Column in different file

d0uph1xI am working on a react project where I used the react-bootstrap-table2 package, I have columns, footer and the table formatter all in one place, I feel this can be separated so it could be reusable, please how do I accomplish that, Thank you. Here is my code const app = () =>{ //Formatters co...

20:59
1
Q: Private VBA Class Initializer called from Factory #2

Cristian BuseAbout This is a follow-up of a previous question Private VBA Class Initializer called from Factory. I've decided to create a new question instead of answering my old question because I would like the community to review and possibly suggest improvements on the new improved code. VBA Class methods...

0
Q: SineCosine Wave

ArpitAs a beginner this is my first code. Any comments? import numpy as np import math import matplotlib.pylab as plt x=np.linspace(-360,360,45)*np.pi/180 plt.subplot(111) _sin=plt.plot(x, np.sin(x),label="Sine Curve") _cos=plt.plot(x,np.cos(x),label="Cos Curve") #_tan=plt.plot(x,np.tan(x),label="Tan...

21:25
0
Q: Correct approach for repository pattern with Unit of work using ADO.NET in C#

Rahul SharmaSo I am using the latest version of Dapper and it works great for mapping my POCO classes but there are some scenarios where I need to return a DataSet instead of strongly typed classes back to my service. I am following the UoW pattern but I am using ADO.Net, so I am not sure if that is the corr...

 
1 hour later…
22:40
Does this code basically work? If so, then this sounds more like a request for a code review? There's a separate Code Review site for that, check out their guidance and see if your question would work better there. — ADyson 10 secs ago
23:07
This might be better asked on Code Reviewdevlin carnate 21 secs ago
I’m voting to close this question because it's better suited to Code ReviewNick 7 secs ago
@Nick While this may be on-topic on CR, in the future, please don't use the existence of the Code Review site as a reason to close a question. Evaluate the request and use a reason like Needs more focus (as I have done here), primarily opinion-based, etc. Then you can mention to the OP that it can be posted on Code Review if it is on-topic. Please see Does being on-topic at another Stack Exchange site automatically make a question off-topic for Stack Overflow?Sᴀᴍ Onᴇᴌᴀ just now
23:33
0
Q: Implementing an RSVP Event App in C#

tommy99I'm creating an RSVP-type application which will later be implemented in a mobile application I'm making. In this mobile application the user can select different events around their area and can choose whether they want to come to the event or not. Of course in the real application the user will...

0
Q: A BIGINT class second version

theProgrammerI added more features to my BigInt class and would love to get a general review. BigInt representation was implemented to meet the following goals To store and easily manipulate huge integer values like c++ builtins integer type. To make conversion from BigInt effortless and easy As a practice t...


« first day (2775 days earlier)      last day (1540 days later) »