HNHacker News
TopNewBestAskShowJobs

svens_

95 karma · joined March 8, 2016

submissionscomments
svens_··on Ask HN: How to learn electrical engineering?
Unfortunately there aren't as many good electronics resources online as you can find for software.

"Lessons in Electric Circuits" by Tony R. Kuphaldt is a pretty good introduction to the basics, you can find an improved version online: http://www.allaboutcircuits.com/textbook/

The most popular book is probably "The Art of Electronics", it's pricey but well worth it if you're serious: https://www.amazon.com/Art-Electronics-Paul-Horowitz/dp/0521...

Check the usual suspects for communities, e.g. Reddit (/r/electronics, /r/AskElectronics) and StackExchange.

svens_··on Introducing Instagram Stories
Thank you, this is very useful information.

That's pretty quick actually, didn't expect that they'd be so fast.

Edit: I'd be pretty interested if other developers could share their experience with the approval process too.

svens_··on Introducing Instagram Stories
Are you implying that the /users/self/media/recent endpoint now ignores the count, min_id and max_id parameters?
svens_··on Introducing Instagram Stories
Can you elaborate a bit on your developer experience?

I've started building an app for Instagram and would like to know. Apart from the newly introduced sandbox and app approval requirements I haven't noticed any major pain points yet.

It's true that most libraries are only seldom updated, but on the other hand the API doesn't change much and it's REST with OAuth after all.

svens_··on Pcb-stackup: Generate beautiful and accurate SVG renders of printed circuit boards
This is only a Gerber file renderer. Gerber files only contain manufacturing data (it's basically a vector image format).

So 3D models would be very hard to add. It would only work if you export a BOM with position data and references to STEP files for your board. This is not currently supported by most commercial software (no idea if it's possible with KiCad), positions are easy to get, but then you'd still need the 3D models (including position offsets and rotation).

svens_··on Let's Play a Game – find bugs in popular open-source projects
You're right.

The timer on the page put me under more stress than I'd like to admit. Maybe this is quite a good simulation of code review reality though, where you try cover lots of code in a small amount of time.

svens_··on Let's Play a Game – find bugs in popular open-source projects
Yeah. Unfortunately this is very true and relevant. Many projects have a huge number of warnings - not all of them are errors, which makes it hard to spot new non-obvious bugs when they are made.

This "game" only tells half the story about static code analysis. Sure it's very impressive that all those bugs have been found and they are indeed hard to spot. However what's actually important would be the percentage of false-positives.

svens_··on How to promote your website the smart way
That is almost obvious advertising for Wix. Wouldn't be surprised if this is paid content.

The funny thing is, the post even describes the (probably) sole purpose of this blog:

  SEO doesn’t work like it used to, keyword stuffing and tricky tactics will not lead you anywhere anymore. You’ll need to have ideas to regularly create content to promote.
svens_··on Tinder for a11y color palettes
The page should probably hide the score of the color palette you're currently rating. After you notice it, you can easily be influenced by it. Showing it after voting would be interesting though.
svens_··on Cool your macbook by placing copper coins on it
Cooling a MacBook like this seems inconvenient, but it certainly works.

However the second picture in the article - where someone is using copper coins on an internal computer component - is utterly stupid and dangerous. Copper is one of the best conductors. If one of those coins falls onto the mainboard it could easily short out something. In the best case you break your mainboard, in the worst you start a fire.

svens_··on You Can't Always Hash Pointers in C
Yes, MIPS is a cheap candidate for when you need a bit more computing power than just a microcontroller.

Home routers usually have MIPS CPUs and run Linux on top of it. This wouldn't be possible with the 8051.

svens_··on You Can't Always Hash Pointers in C
As someone who did a lot of embedded development, I wouldn't exactly call it "more interesting". More like "that shit needs to die already".

The biggest problem with those is, that modern compilers don't support it. Well, that is open-source compilers. IAR will happily sell you a license of their IDE for 2.4k$/seat. There is sdcc, but it's no comparison to a modern gcc or the commercial offerings.

Unfortunately you're right though, 8051 processors are cheap and abundant. Chip makers use it as the go to architecture for any simple embedded processing requirements. It's slowly changing though, but ARM licensing costs are still much higher. Let's hope that in a decade or so they'll use RISC-V instead.

svens_··on You Can't Always Hash Pointers in C
That's probably true, however there's a small catch.

Looking at the standard (no difference between C99/C11), chapter 6.5.6 ("additive operators"), point 9 defines the behavior of pointer subtraction:

  When two pointers are subtracted, both shall point to elements of the same array object,
  or one past the last element of the array object; the result is the difference of the
  subscripts of the two array elements.
However reading further:

  The size of the result is implementation-defined,
  and its type (a signed integer type) is ptrdiff_t defined in the <stddef.h> header.
  If the result is not representable in an object of that type, the behavior is undefined.
Unlike the (u)intptr_t types, ptrdiff_t is not optional AFAIK. The way I understand it, you could still invoke UB if the implementation uses a very silly type for ptrdiff_t, though I didn't do further research on it.

Still, using pointer difference makes this a lot safer and more portable. Especially on platforms with unusual memory models, where a pointer might not be just a single integer (e.g. segmented memory on x86). Also the operation is Theta(1), so it doesn't impact performance much.

svens_··on Pebble 2, Time 2 + All-New Pebble Core
No, that's not how taxes work. At all.
svens_··on Pebble 2, Time 2 + All-New Pebble Core
Exactly. In addition they also don't have to care about scaling their webshop to now almost 4000 buyers in the first hours.
svens_··on Pebble 2, Time 2 + All-New Pebble Core
Seeing how fast backers are adding, they probably save a lot of headache by leaving the scaling to others. Kickstarter handles the traffic from user signup to charging the credit cards at the end. And Kickstarter already figured out how to do this on that scale.
svens_··on Pebble 2, Time 2 + All-New Pebble Core
Never noticed that Kickstarter has live updates for money and backers.. It's crazy how fast they sell (probably in part due to the earlybird specials), almost 1k USD / second.

That being said, it almost feels like an abuse of the platform. It's their third generation of smartwatches after all. I really like the new models with heart monitor though and now they've also added a pure fitness tracker-like device.

svens_··on Cache Sizes with CPUID on Intel CPU's
functionID is what's called "standard level" in the link I posted. So it should be 4 (you can also see that in the C version btw.).

I agree that the example isn't very well tested - the author probably pulled it out of some existing code and wasn't very careful.

svens_··on Cache Sizes with CPUID on Intel CPU's
Just declare cpu_info as int[4] and it should run.

Basically on x86 CPUs you can use the cpuid instruction to get information about the CPU and the cache: http://www.sandpile.org/x86/cpuid.htm

The code in the first snippet uses a compiler intrinsic to execute this instruction and calculates the cache size from the result. In the second snippet the assembler code is written by hand instead.

svens_··on Tutorial On Designing/Building A PCB (Using FOSS)
That's exactly what I was thinking - the footprint editor is horrible in that aspect.

You don't have to hold "M" to move, it picks up the component when pressing.

The shortcuts in general are not as nicely placed as Altium, e.g. Zoom-to-fit (Home) is very awkward. Sure you can change that, but stuff like this requires a lot of time and the setup will be incompatible with other people (and one might have to adapt it on the next update, etc.).

svens_··on Tutorial On Designing/Building A PCB (Using FOSS)
Very nice introduction to KiCad - also for people with a background in other CAD tools like me.

It's awesome to have a short but complete example of the whole process. KiCad definitely has some room to improve in terms of UI/UX flow, so that was very helpful.

← PreviousPage 2 of 2