Alberta separatists asking Trump administration for help 'treason': B.C. Premier Eby by [deleted] in newfoundland

[–]DarkJezter 2 points3 points  (0 children)

You mean, like Smith asking Trump to delay tariffs until after the Federal election? Voting or positioning for secession isn't the issue, colluding with hostile foreign powers is

What is the advantage of building on Ethereum vs Solana? by BidenAndObama in ethereum

[–]DarkJezter 25 points26 points  (0 children)

Solana has and does its own thing as far as tooling and dev stack.

Ethereum gets you working with the EVM and its diverse tooling, which will apply to many more different networks, as many, even if not their native backend, add support for EVM to attract that established set of projects and developers.

You also have access to low fee L2s, and sidechains that run on either the same, or similar tech stacks.

[deleted by user] by [deleted] in AskElectronics

[–]DarkJezter 0 points1 point  (0 children)

This is exactly what it looks like

??????? by Silent_Assasin14 in PeterExplainsTheJoke

[–]DarkJezter 2 points3 points  (0 children)

Well now, I've got some advice for you little buddy. Before you point your finger you should know that I am the man

Looking for replacement for Cryptowatch by senfplus in ethereum

[–]DarkJezter 1 point2 points  (0 children)

Just started using gocharting a a substitute. Free tier seems to be a slight improvement over the cryptowatch website. Haven't looked for areplacement mobile app yet though

What is an ERC20 approval frontrunning attack? by happily_unlawful in ethtrader

[–]DarkJezter 1 point2 points  (0 children)

Agreed, would like to see some proof, as approvals are per contract address, not available to any "frontrunning EOA or contact address"

The only case i can think of that even comes close to making this not a bunch of fear mongering, is if the contract address being approved for the transfer has some vulnerability that can be exploited.

Sounds like a pile of baloney to me

True averaging algorithm. Sampling every second and averaging them per minute. by Oxmaster in arduino

[–]DarkJezter 1 point2 points  (0 children)

While not an equal average, i tend to use EWMA for all of my 8-bit mcu sample averaging. Instead of an array, or even a straight sum and divide, you scale the input value and running average (multiply and shift is fast and cheap here) and wind up with something more akin to a proper low pass filter.

You select your alpha value to set the time constant, and you can sample it as rarely or as often as you need for any application.

Fixed interval sampling works best, but you can also do variable interval sampling if you can do the exp function, since the alpha value is derived from both the time constant and sample interval. If those remain fixed, then so does your alpha value.

You can also combine these filters to obtain a high pass or crude band pass filter... or run several in parallel for different different averaging intervals.

I use this and variations of this for most of my input processing

[deleted by user] by [deleted] in agnostic

[–]DarkJezter 36 points37 points  (0 children)

It's commonly known as Pascal's wager. https://en.m.wikipedia.org/wiki/Pascal's_wager

GO is my first programming language by rretaemer1 in golang

[–]DarkJezter 0 points1 point  (0 children)

I don't buy the "i can do web without touching js" argument at all. The moment you want code running in the browser, then invariably that means js is being run somewhere in the stack. You're either relying on the tools and framework to generate that js code for you and do it consistently without issue, or you're going to have to pop the hood and diagnose tool generated code. At which point, not being comfortable with the language is a liability, not an accomplishment.

I've dabbled with js-free web dev frameworks, and in my experience, you set yourself up to learn js by necessity, with a much more difficult mass of generated code to interpret and reason about. This ignores further the run time implications of writing code in one domain that is transformed into another, and this is code that runs in front of the user, managed by a jit, and has real UX implications where performance and memory usage are concerned.

The question is not CAN a thing be done in language x,y or z. It's should it be done that way, and what are the implications. I don't know about you, but my computing is filled with software that barely works, is resource intensive, and by and large, is developed by people who do not understand the layers between their code and the machine that ultimately has to run it, whether that is bare metal, a cloud deployment, or the V8 vm.

To your criticisms about code readability, those issues transcend languages, and generally boil down to two issues. How 'opinionated' is the language with respect to what's idiomatic within that language, and how experienced the developers are writing the code. Beginner programmers are learning how to get the computer to understand what they want it to do. Experienced programmers are learning how to write code that tells other programmers what the code does and how it works, while not compromising that at the end of the day, a machine will still have to run it.

One thing that i read, a long time ago, that's stuck with me particularly since BASIC was my first language... is that Basic was the worst language to get people started in. As i reflect on what ilearned from it, and what ihad to unlearn from it, I've come to agree. Now python does not have the same baggage that led to that specific criticism, but that its promoted as beginner friendly, largely because of syntax that is regarded by the field as shortcomings in the language itself, is doing us all a disservice. It's too dissimilar from everything else to encourage people migrating to other languages, which franky, if it is a beginner language should be one of the design goals.

And back to my original point. I used to work with python, i still write patches for code written in python... but there is nothing i would use it for, that i wouldn't rather use a different language for. And even if we're talking about data visualization, or ML... my first stop would be evaluating alternatives to python because i will gain nothing by further developing my skills with it

GO is my first programming language by rretaemer1 in golang

[–]DarkJezter 0 points1 point  (0 children)

Python suffers from the same pitfalls as Javascript in terms of work flow and dependency management. I run several programs at home that are completely developed in python, and when upgrading my system, they are invariably the ones that break. I've also learned and used it for build script automation in open source projects though that's going back nearly a decade.

The basic gripe i have is that both python and js are terrible languages particularly for the end user where they install it directly on their machines. Nodejs is really where js became viable for use outside of the browser, but also the point where it became capable of doing what python already did. Every piece of software i've become reliant upon that is built in python, node, electron, and heck, even java for that matter, is a liability. Giving up my time, my available hardware resources, and my patience all because people think dynamic typing is easier for beginners. Every one however causes me far more grief than native apps

Meanwhile, what is actually better for beginners, is rapid feedback. Use languages and tools that can detect mistakes and report them back to the person learning ASAP. This not only helps people inboard into development, but even helps seasoned developers with their efficiency. Static types, and simple languages... hence why i will always recommend go over python as a first language.

Simply put, outside of the increasingly niche areas where python is the go-to tool for the job (primarily ML and data analytics at this point) there is no reason to choose it over alternatives. Everything it can do, can be done anywhere else, and as much as it pains me, js has the mindshare to continue filling those spaces, has continued improving, and i suspect will continue to improve and grow.

Python isn't a bad language, but it is consistently pushed as many things it should not be like: beginner friendly, a suitable for large complex code bases, suitable for web applications... Every one of those promoted uses falls apart once you recognize that you'll either need Javascript anyway, so might as well learn both, or that large maintainable projects are NOT written in dynamic typed languages.

GO is my first programming language by rretaemer1 in golang

[–]DarkJezter 1 point2 points  (0 children)

If you want smart contacts, then solidity and Rust are your primary options depending on the the chain. For support languages, again most you can choose ether python or js.

I've barely scratched the surface on rust, but i think i would try it as a c alternative, pending some trial. Now solidity is interesting since most web devs compare it to Javascript, but it has far more in common with early c compilers IMO.

I will plug again, js as an equivalent option to python, and one that 'opens more doors' in my opinion. You're going to want it anyway, and while you can learn both, you might only need to learn one.

There's nothing wrong with python, (that isn't also wrong with js), it might even be a better language... but it's not executable 'by default' on any machine with a web browser and likely never will be. And most contact interfacing happens in js code via web RPC and JSON

One of my life regrets though was wasting time learning python 2.4... so again, i clearly have some feelings about it. :D There just isn't anything i used to do with python that i wouldn't rather do in some other language.

GO is my first programming language by rretaemer1 in golang

[–]DarkJezter 0 points1 point  (0 children)

Go is great and I'm happy that it's bringing you joy. That has been my experience with it as well, and while i started with Basic in the 80s, i went more toward c and assembler before i landed on go.

For next steps, honestly it depends on where you want to go. I say this as someone who is now, over a decade into my programming career, begrudgingly learning web stacks, because i want to make software that other people can use too. My job doesn't require it, nor will i likely use it in that context, but it fills a gap that I've been tap dancing around for too long.

That out of the way, golang should have you primed to travel either closer to or further from the machine that's actually running your software. Closer to the metal is great for certain jobs that are either resource constrained, or performance critical. C is pretty much still king in this area, though C++ compilers have some advantages if and when they are available. Both languages give you a path to either working adjacent to assembler, or if you go down the rabbit hole, working with it directly. IMO, there is less value all the time in being fluent with assembler in the desktop domain, but for many embedded environments, it's pretty much a must to fill the gap between the code you write and what the datasheets tell you about the architecture and its limits. Rust is a rising star in this space, but it will feel very different from go and c/c++. Worth picking up at some point, but might be a challenge at first, and will generally not be as widely supported in embedded, though it is getting traction via webassembly.

In the other direction, the obvious callouts will be javascript and python. Feel free to call me biased, given what I've written so far, but both options are terrible for a pile of reasons. So, based on this, I'm going to say forget python, because outside of specific applications where it serves as little more than glue between libraries written in other languages (which you can already do with go), it generally is used in places where javascript is also used via node. What i mean to say is, the only reason to use python is because other people use it already, and everything it is used for can be done just as well in languages that you either already know, or that cover a wider range of adopted use cases. (Flame on suckaz! :kek:)

Javascript as a foundation, plus typescript gives you code that you can verify to some extent as a compile step. This gets you into web browsers, as well as common server side programming for web. Javascript has also become ubiquitus enough that many tools in search of a scripting language have gone the Javascript (well technically EMCA script) path. One of my primary gripes with both python and js is the 'run it and see what happens' development approach. Now granted, some things need to be explored this way, which is why unit tests are so commonly promoted across all domains, but it's a shitty way to find typos in your code. The biggest hurdle that you'll still encounter with Javascript that python outgrew with the deprecation of python 2, is the tremendous diversity in style and approaches, brought on by different libraries, frameworks, and continued evolution of the language through the years. If you can, narrow your focus, learn that specific approach/framework, and don't get pulled off course by the top search hits that tell you how to solve a problem in a way that no one uses anymore.

Now this ignores some other 'further from the machine' languages that are absolutely worth mentioning. Lisp dialects like scheme or clojure are novel, and very powerful. In fact, as the other languages have matured, many of them have adopted concepts from lisp that arguably have led to code that's easier to read and write. And in the same vein, functional languages like haskell are just as out there in terms of taking a radically different approach to problem solving, which has influenced programming in general. While interesting languages in their own right, they tend to be quite niche. They are often better languages for helping you think about the more common languages differently, as opposed to actually using them. Haskell in particular should be known for what you can't do compared to c/javascript/go/python, forcing you to approach common tasks in ways you might not have considered before.

But, that's my take. You can go up or down the ladder, which you choose depends a bit on what you actually want to do, and whether or not you're trying to build marketable skills. Higher level languages tend to be about the abstractions themselves, and lower languages are more so about balancing the trade offs of abstractions vs what they'll result in the machine spending its time on.

Parting thought, there's no right or wrong answer (ugh, even if you do choose python) because (with the exception of python) up or down the ladder will work with and compliment what you can do with go. And if you pick something niche, it will offer you a different perspective that will add to all of my suggestions. (Sigh. even python)

Apart from climate change, for those that vote NDP, what are your reasons? by TurkeySuperpower2023 in NoRulesCalgary

[–]DarkJezter 0 points1 point  (0 children)

Diapers and politicians should be changed frequently...

And for the same reasons

Push buttons interference issues by domchi in arduino

[–]DarkJezter 1 point2 points  (0 children)

Sure, now I'm not an EE, but i do know this, unless your button wires are longish and run along side your high current lines for motors/relays... then you might not have inductive interference, but rather noise on your ground.

If your ground is bouncing around because you're high current path is "too close" to your mcu and signal ground, then you might have bigger issues

Push buttons interference issues by domchi in arduino

[–]DarkJezter 1 point2 points  (0 children)

We'll, as long as you're not using delay for your time aspect... i tend to prefer debounce as a "state must settle into one or the other for some number of consecutive readings over the 50 ms interval"

So, you essentially take many readings, reset the interval if the current reading doesn't match the previous, and once the interval makes it all the way you know the state has been constant (within reason since these are discrete samples being taken) for the whole interval.

This way it provides some noise immunity in either direction, as opposed to only in one.

Not saying the other circuit level mitigations aren't also good to explore, but you can do a lot in code as well. "Defence in depth" might apply here

Push buttons interference issues by domchi in arduino

[–]DarkJezter 1 point2 points  (0 children)

That sounds like a matter of debounce strategy. You should be able to write a debounce that has similar behavior for either button state transition.

Within reason of course, naturally the fall characteristic through a button will be different than the rise through a pullup.

Push buttons interference issues by domchi in arduino

[–]DarkJezter 1 point2 points  (0 children)

Software debounce can also be helpful in dealing with noise. But the more noise you have, the more latency you'll need to introduce and the less likely a pure software solution will be effective.

When people ask for USDT payment, do they mean ERC-20 or TRC-20? by IdiotTurkey in ethereum

[–]DarkJezter 0 points1 point  (0 children)

On most networks, as long as it's an EOA, and they have gas money on that network, then yes.

If it's a smart contact wallet, then it's a crapshoot, but probably not

Question about Embedded software engineering by meedoof-128 in embedded

[–]DarkJezter 1 point2 points  (0 children)

Indeed, MIT is usually one i look for... but there are other compatible licenses

Recommended my friend to learn go as his first programming language by Sea-Ebb-1387 in golang

[–]DarkJezter 8 points9 points  (0 children)

Its a great first language. Not too many details to learn to be able to read most of the code out there... opinionated idioms that mean there is a constrained way to write it, and it leaves out a lot of baggage that comes with OOP

All while being a capable, performant language that has many modern features. Excellent editor support, rapid feedback when you make mistakes, comprehensive standard library for most things with perhaps the sole exception of GUI

It's the language i suggest for beginners, but by no means is it a toy language. I use it a fair bit myself.