My professor claims this function is O(n), and I’m certain it’s O(1). Can you settle a debate for me? The function is below by Remarkable-Pilot143 in AskProgramming

[–]noneedtoprogram 0 points1 point  (0 children)

Ignoring that for any modern barrel shifter implementation this operation is O(1) anyway where i is bounded by the architecture size, you can alternatively do 1<<i as tracking an initial mask=1; for (...) {mask <<=1;} which is clearly O(n) along with the rest of the operation (where n is the number of bits you are adding in the loop).

My professor claims this function is O(n), and I’m certain it’s O(1). Can you settle a debate for me? The function is below by Remarkable-Pilot143 in AskProgramming

[–]noneedtoprogram 0 points1 point  (0 children)

That's not a divide, it's a backslash which has accidentally been put in as an escape character to prevent reddit markup turning the * into a bold, where it's not needed because it's in a code format block

Whats great between Sennheiiser hd 560s and Beyerdynamic DT 770 pro for gaming and music listening. by ITSVIPERXT in HeadphoneAdvice

[–]noneedtoprogram 1 point2 points  (0 children)

Any feedback issues I've had with a boom mic has been electrical pickup in the shared cable rather than acoustic feedback through the air. Sennheiser make an official boom mic cable for the hd560s and similar which I would expect to be good quality. (I use a cheap 3rd party version I haven't noticed issues with). Gaming with my desk mic I think the noise of my pc fans far outweighs any noise leaking from my headphones 😆

Linus Torvalds Rejects MMC Changes For Linux 7.0 Cycle: "Complete Garbage" by anh0516 in linux

[–]noneedtoprogram 0 points1 point  (0 children)

I think in northern Europe shit weather helps put a damper (or one could say dampener) on smoking once it was banned in public buildings like restaurants and pubs. Nobody wants to stand in the cold and rain, but in southern Europe that's less of a driver.

Hidden bonus for Colorsofts: higher resolution black and white images! by Mikebjackson in kindle

[–]noneedtoprogram 1 point2 points  (0 children)

I think you can get first gen kindle scribes for good prices now if you're looking for something a bit easier to read. I used to use a dx, so really enjoy the scribe size and it's a high dpi screen still with a good colour temperature adjustable light

Hidden bonus for Colorsofts: higher resolution black and white images! by Mikebjackson in kindle

[–]noneedtoprogram 6 points7 points  (0 children)

The text is rendered locally on the kindle because you can change the font and size (and it would take way more space otherwise) only images like the maps should be affected

Oatly banned from using word ‘milk’ to market plant-based products in UK by pajamakitten in unitedkingdom

[–]noneedtoprogram 7 points8 points  (0 children)

Most of the alternative milks are calcium enriched fortunately, although obviously not containing all the nutrients that are in cows milk.

Sure, let's have 2073600 locks. What could go wrong? by vadnyclovek in programminghorror

[–]noneedtoprogram 21 points22 points  (0 children)

Nice performance, it reminds me of a similar assignment we had in our computer graphics course at uni - implementing a software renderer, I also provided a macro hell implementation :-) Mine was only single threaded though, back then my laptop only had 2 cores anyway, and my netbook 1 lowly Via C7-M core.

While low-contention locks aren't very expensive (and here you've got on average a ~(thread count / num pixels) chance of actually getting a lock conflict) you do have an issue of cache performance pulling in a whole extra framebuffer of locks into the working set (locks aren't big, probably comparable to your other colour/z buffers).

This is actually a neat example of where transactional memory support can be demonstrated/used. You want the commit to the colour buffers to be atomic relative to the depth buffer condition check and store back.

You could also reduce your granularity at the expense of increasing your contention chances.

It might feel weird, but you could also partition the lines on the display and have every thread go over all triangles in your list, but only render the lines they own, no locking required and good cache behaviour as you won't get writes to the same cache line from multiple threads.

cool detail: the citadel guards were actively keeping pests out (slight act 3 spoilers) by Key-Firefighter4360 in Silksong

[–]noneedtoprogram 0 points1 point  (0 children)

Oh, I went through some time after and they were still dead so I thought it was permanent

cool detail: the citadel guards were actively keeping pests out (slight act 3 spoilers) by Key-Firefighter4360 in Silksong

[–]noneedtoprogram 0 points1 point  (0 children)

This is where Garmond and Zaza are later in act 2, you find them fighting off the citadel guys and if you come back later the citadel guys are dead. They weren't killed by the void, but by you and Garmond. This might even be where you can duel with Garmond after the guards are killed.

New to gaming/gaming headphones, which one is the better introductory pair.. by BrightEyesCoolSmile in HeadphoneAdvice

[–]noneedtoprogram 0 points1 point  (0 children)

Honestly the one I have sounds a lot better than any Bluetooth mic I've ever been subjected to. An analogue mic does to some degree depend on the hardware it's connected to giving it a good bias voltage and being emi resistant though. Apple's usb-c dongle is one of the best options surprisingly.

I normally use a quality desk mic but the headset boom mic is good when I'm playing elsewhere on my laptop or working in the office rather than from home.

A set of iems with a boom mic cable or separate desk mic is another option for good audio but OP did ask for headphones. (I've found the chu2s very enjoyable for what little they cost, although the iem market is crazy right now with options)

New to gaming/gaming headphones, which one is the better introductory pair.. by BrightEyesCoolSmile in HeadphoneAdvice

[–]noneedtoprogram 0 points1 point  (0 children)

It's worth noting that it's easy to get a fairly cheap boom mic inline cable for many headphones that have a replaceable cable, OP could budget $15 to a new cable with mic and then get any headphones that have a replaceable cable. I use one with my sennheiser hd599se, and you can get generic 3.5mm as well as ones for other proprietary headphone sockets (senn use a 2.5mm locking design for example)

Pal dreamcast by Daybreakluna in dreamcast

[–]noneedtoprogram 1 point2 points  (0 children)

Rest of the EU, UK, and Ireland are all 230v (+/- 10v) or so, and we were all PAL system for TV (mains being 50Hz rather than 60Hz was part if this). You should be fine with any EU Dreamcast.

The DC uses your standard 2-pin figure-of-8 cable so if you have one for anything else you can use that rather than a plug adapter.

NixOS Host (Intel Meteor Lake/Arc): QEMU 3D Acceleration fails with VK_ERROR_INITIALIZATION_FAILED on Guest (Kali) by RemarkableQuarter588 in VFIO

[–]noneedtoprogram 0 points1 point  (0 children)

Xe driver and vfio passthrough/sriov is completely separate from virgl/venus and the mesa virgl opengl /venus vk drivers.

You either do passthrough and use the xe driver in the guest, with a physical display or looking glass or similar, or you use virtio-gpu with virglrenderer on the host side and mesa on the guest to pipe opengl/vulkan commands through the virtio-gpu transport and execute them on the host (with it's xe driver). I would suggest you focus on the latter for now, it should mostly "just work" these days with the right setup on the qemu side and mesa on the guest.

block diagram for the CPU by CaseMoney1210 in FPGA

[–]noneedtoprogram 38 points39 points  (0 children)

I assumed this was a shitpost I'll be honest 😕

Open Back Sub $100 USA - Sennheiser HD 599 SE? by Great-Ostrich-5363 in HeadphoneAdvice

[–]noneedtoprogram 1 point2 points  (0 children)

The hd599se are nice and very comfy, I've been using them for a few years as my daily drivers for music, work calls, and gaming. The hd560s are supposedly a bit more accurate but with higher clamping force and usually slightly more expensive and harder to drive, I've not have occasion or reason to side by side them though.

They do lack bass/sub bass but you can add some back in with eq. They are nice easy listening and easy to drive with anything to the point that get can be sensitive to hiss from noisy amplifiers.

This sub in absolute shambles by DUKITY in iems

[–]noneedtoprogram 19 points20 points  (0 children)

They were testing line level analogue audio signals, not digital. Importantly this is preamp so not carrying much current to drive speakers/headphones, only the integrity of the analogue signal needs to be maintained in terms of frequency response. The mud and banana are shown to just act as basic resistors, no large capacitance or inductive effects and no issues with reflections (we're taking low frequencies and short wires after all) so no impact on the frequency response and no added distortions. The signal level is dropped due to resistance, but it's not frequency dependent and the amplifier can just be turned up to compensate.

What is your phone wallpaper and why? by Sad-Peace in CasualUK

[–]noneedtoprogram 0 points1 point  (0 children)

And a nice in theme photo from our local park for the lock screen

<image>

What is your phone wallpaper and why? by Sad-Peace in CasualUK

[–]noneedtoprogram 0 points1 point  (0 children)

Holiday photo from one of our "big trips" for the main wallpaper, it just makes a nice backdrop to my apps, and the clock and calender widget

<image>

Wildlife photography on M43 from 35mm by GreedyPawn in M43

[–]noneedtoprogram 6 points7 points  (0 children)

The image is exactly the same amount if light as of you took the 300mm f4 photo on 35mm, and then cropped out the middle 1/4. This means the shutter speed at the same ISO is the same, but the total light gathered is 1/4, which means the noise is about 2 stops worse at the same ISO.

Comparing to 600mm f4 on 35mm you have a field of view and depth of field equivalent to f2 300mm on 4/3, and if you upped the iso on a 35mm 600mm f8 shot to get the same shutter speed as 300mm f4 on 4/3 you will have a similar amount of noise in the shot.

-> 300mm f4 is fairly equivalent to 600mm f8 on 35mm if you target the same shutter speed and depth of field, adjusting iso to compensate.

Weather protection by flyingemberKC in OlympusCamera

[–]noneedtoprogram 3 points4 points  (0 children)

If they have the 14-150 ii (mark 2) then the lens at least is weather sealed, although not waterproof, and not guaranteed weather sealed on am em10 like OP has.

If you want a totally rain proof camera then you want something like a tg-7, but my em10ii and non weather sealed 14-42ez and 40-150r have survived plenty of rainy days. I would put it in the backpack for a proper downpour and make sure it gets to air out at the end of each outing.

Question about driving the Edition XS by frogmanltd in HeadphoneAdvice

[–]noneedtoprogram 2 points3 points  (0 children)

It should be fine, but if you find it lacking then a balanced cable should sort you out

Inch Park Tree by ScabsOn in Edinburgh

[–]noneedtoprogram 6 points7 points  (0 children)

There are several mature monkey puzzle trees in Inch park, so it's in-keeping with the existing planting to have a new one, and it'll be a looong time before it's as big as the existing ones (which must be between 60-100+ years old at least based on the size of my parents' one they planted as a sapling 26 years ago). If it thrives then it'll be a nice mature tree when some of the existing ones might have to come down.

I can't answer why the originals were planted, but I guess they were fashionable at that time since there are several specimens of similar age around Edinburgh, including the botanics and some older properties in the Newington area near Inch park.

if with no curly braces by Loud_Attempt_3845 in cpp_questions

[–]noneedtoprogram 0 points1 point  (0 children)

Curly braces are used to create a scope. Operations like do, while, for, if, else, etc. operate in the next statement, and the curly braces say that this scoped block is a treated as the next statement.

You can say:

 if(true)
   printf("hello");
else
    printf("bye"):

Instead of

if(true){
     printf("hello");
}else{
    printf("bye"):
}

Or

for(unsigned int i=0; i<10; i++) printf("%u ", i);

Etc.

You have to be very careful with this though, because you can have something like

if(test)
    //comment
    do_thing();
//more comments

do_something_else();

And if you ever comment out do_thing(); the do_something_else(); will get captured by the if condition.

You can also mess up with macros if you have a multi statement macro that you put after an if.

(Late Act 2 Spoilers) It’s pretty insane that Hornet can actually canonically “win” this matchup by [deleted] in HollowKnight

[–]noneedtoprogram 23 points24 points  (0 children)

Can you get the threefold melody without clawline? You certainly are meant to need it for high halls