mastodon.xyz is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Mastodon instance, open to everyone, but mainly English and French speaking.

Administered by:

Server stats:

818
active users

#functions

2 posts2 participants0 posts today

We use scalasql at work (yes, I'd recommend) and we had a bug where we mistakenly created nested transactions (which scalasql doesn't support -- but it does support savepoints).

Anyway, we found a clever way to statically prevent nesting transactions using macros, which I thought I'd share as an illustration of the helpfulness of macros
gist.github.com/aboisvert/c716

GistIllustration of using Scala macro to statically prevent nested transactions using the scalasql libraryIllustration of using Scala macro to statically prevent nested transactions using the scalasql library - preventNestedTransaction.scala

[#TLDR: JUST TELL ME IF YOUR TABLET CAN DO #CALLS!]

#DearVendors of #Android-#Tablets:

Off all the #Functions you can put into a #Specifications Sheet of your Devices there's one you should ALWAYS answer clearly on your #Website:

DOES YOUR TABLET [with #4G / #5G / …) SUPPORT MAKING PHONE CALLS?

Like: IS IT TOO MUCH TO ASK TO HAVE THAT INFO IN THE SPECSHEETS?

You're obviously able to list all the #Codecs natively supported and the user-available storage as well as supported Frequency Bands, WWAN modes, WiFi channel width and the Display Glass vs. Panel dimensions including DPI of the latter and whether or not it has a hall effect sensor to detect your overpriced 1st party tablet covers!

Now some folks may ask: "WHY does this matter?" or outright dismiss this as a problem.

Listen:
Not everyone is able or willing to carry two devices when 1 SHOULD BE ENOUGH and also some places (i.e. #Turkey) have #ImportRestrictions re: #MobileDevices, so having more than 1 #IMEI is already a "NOPE!" by the authorities.

  • Also this isn't something one can "fix" post-purchase like installing #VLC to decode some obscure file format in Software: Either the #Baseband and #ROM support #PhoneCalls or they don't!

So why do NONE of the #Tablet manufacturers allow to #search or #filter for that???

NO, instead one has to download an obscenely huge #PDF just to then read on page 34 that for any "#telephony" function you NEED YET ANOTHER DEVICE FROM THE SAME MANUFACTURER AND HAVE TO SIGNUP WITH AN ACCOUNT and even that level of #abuse WON'T GUARANTEE THAT IT WORKS...

  • I mean, come on, this ain't some obscure functionality like #OMAPI to do some "evil sourcery" like managing an #eSIM that is in a #SIM-Card form factor!

Pretty shure A LOT of other folks have the same question and ain't willing to get yet another device & #SIM just to recieve the occasional call because #TechIlliterates can't be assed to send an #eMail or learn #XMPP+#OMEMO to message one...

  • Obviously they same manufacturers are able and willing to specify f-stops of the built-in cameras and list EVERY SINGLE #WEARABLE they made and certify as 'compatible' with, as if anyone is gonna take their non-#waterproof #Tablet for a marathon or god forbid triathlon...

Oh my goodness, how did I miss that in ES7 you can use a closure as a method. Goodbye `bind()`, you will not be missed :)

e.g.,

```js
class A {
b = () => console.log(this)
}

const a = new A()
a.b() // A { b: [Function: b] }

const c = a.b
c() // A { b: [Function:b] }
```

Nice! :)

**Edit**: Be careful with this. See this note by @marsup: mastodon.social/@marsup/113799

MastodonMarsup (@marsup@mastodon.social)@aral@mastodon.ar.al Respectfully, this looks like an anti-pattern. `b` won't be part of the prototype, potentially preventing some meta programming, and you're going to get a new `b` for each instance of that class, consuming that much more memory for each instance you hold.