Low level C driver API

Recently I had my first experience writing a wrapper around FTD2XX driver for a desktop tool that communicates with an embedded device. The library provided some common device specific functionality and encapsulated low-level MPSEE and board specific configurations from the user.

While writing this library I found myself choosing between two types of APIs that the library provides

  1. Function X takes in specific arguments that it needs and nothing more like the following

    eSTATUS spi_init(FT_HANDLE ftdi_handle, eFREQUENCY clock_freq)

  2. Function X takes in a control block structure that encapsulates some specific state of the device (previously configured or otherwise)

    eSTATUS spi_init(sDEVICE_CBLK cblk, eFREQUENCY clock_freq)
    // where sDEVICE_CBLK is a struct containing a handle as well as other device-related fields

The function does the same thing in both cases, but API looks fairly different.

Looking around at various examples I see both approaches as well as mixed ones. My thinking is that approach 1 is more self documenting and “lightweight”, in that you only supply what is needed, but approach 2 is a lot easier to refactor in the future (in case of adding a field to a struct) but then it somehow seems less “aesthetically pleasing” to me, in that it’s nowhere near as self documenting

What I found is that some functions may get away with approach 1, while others require device state to operate correctly (such as GPIO directions), but then I end up with heterogeneous API which I would like to avoid if possible.

What I strive for is an API that is intuitive and easy to use and easy to refactor if needed. ABI backwards compatibility isn’t a requirement in my case

It seems to me that approach #2 is far more practical and clean – nearly every function will have the same API, refactoring becomes easier and it makes sense that such library provides a control block structure for user to initialize and manage through provided API.

Is there a preferred approach in such situations? I understand this is very open-ended so I would appreciate any thoughts on the matter

sharepoint online – Change external sharing options with PowerShell on tenant level

You can do it with following option:

Connect-SPOService -Url https://tenantname-admin.sharepoint.com -Credential admin@domain.com

after connection, you can pick one the below option:

Set-SPOTenant -SharingCapability ExternalUserAndGuestSharing
Set-SPOTenant -SharingCapability ExternalUserSharingOnly
Set-SPOTenant -SharingCapability Disabled

Managing Sharing and Access in SharePoint Online
But now there is catch, if external sharing is enabled and being used on many site collection:

If you turn off external sharing for your entire environment and later
turn it back on, external users who previously had access to content
or documents on sites will regain access to them. If you know that
external sharing was previously turned on and in use for specific site
collections and you do not want external users to be able to regain
access if external sharing is ever turned on again globally, we
recommend that you first turn off external sharing for those specific
site collections.

Now you have to turn off the external sharing on the site collection where it was enabled, run below powershell to get that list:

Get-SPOSite | Select Url, SharingCapability

Now use the Set-SPoSite command to disable it.

Set-SPOSite -Identity ""Sitecolelction url" -SharingCapability Disabled

How would a server keep hugely different pings on a same (timed) gameplay level

Following scenario (loosely based on my real experience in Modern Warfare MP):

Two players move onto the same corner from different directions and about to collide on said corner. Player 1 (P1) has a ping of 30ms. Player 2 (P2) has a ping of 180ms.

As far as I understand this: if any other factors are identical P1 must win this engagement 10/10.

If we apply some simple math (given that reaction time on both players is ~40ms; from “being able to see enemy” over “reaction” to “reaction received by server”), we get:

P1 > 30ms + 40ms + 30ms = 100ms
P2 > 180ms + 40ms + 180ms = 400ms

Shouldn’t this mean that before P2 even has time to react he already lost the engagement due to his 6-times higher ping?

And if this is true, how is it so common that players with 3-8 times higher ping tend to be the “best”(or rather fastest to react) player by score?

How would a server even handle the time gap between the majorly different time “zones” without “cheating” in some form and without P2 having laggy movement ingame?

Based on the high ping P2 should be literally 1/5 of a second behind the reality on the server.

How to create a link-less parent (top level) menu item that doesn’t use an tag

My question is closely related to this one: How make top level menu item not have link, but have sub-menus that are linked?

When I create menu items with the style customizer, every menu item gets created with an <a> tag. When there is a URL present, this will be something like <a href="URL" class="menu-link">. When I create a menu item that opens to more menu items, I refer to this as the parent menu item. Sometimes it makes sense to have a page to link to for a parent item, but there are other times when I do not want there to be a link.

The typical, current practice for a link-less menu item seems to be creating a Custom Link item and leaving the URL section blank. This works, but it still creates the menu item using an <a> tag, where there is no “href” attribute. This is not really “good” HTML, and it also causes Lighthouse to raise a penalty for an uncrawlable “link”.

Example: Creating a Custom Link menu item
Example: A high level "Custom Link" menu item with a blank URL

What’s the easiest way to solve this problem, of creating a menu item that doesn’t use an <a> link tag? I’m okay with plugins if they add no overhead when the client loads the page.

Putting javascript:void(0); in the URL section is invalid.

security – Why is transaction pinning more of a concern at the commitment level rather than the HTLC level of Lightning?

In this week’s IRC workshop on L2 onchain support t-bast and ariard agreed that transaction pinning is more of a concern at the commitment level (e.g. delaying the parent of a child CLTV transaction) rather than the HTLC level.

It wasn’t immediately obvious to me why or how this works. I was under the impression that the confirmation of commitment transactions aren’t time sensitive. There are two time sensitive concerns; not receiving the preimage of a HTLC in a timely fashion and getting your justice transaction confirmed in the case of your counterparty broadcasting an expired state. What am I missing?

sharepoint online – Can we create a custom permission level on our custom list which allow users to create items without been able to view/edit them

We have a custom list inside our SharePoint online >> and we want to create a custom permission level to allow users to create new items, but without been able to edit or even view them. is this possible? we need this as we are building an internal feedback list which allow all users to submit their feedback while only the HR team can view and edit those items.

Any advice?

algorithm – Making a level progression system similar to Bravely Default’s

So I am working on an RPG and I want the level up system to be similar to Bravely Default’s, which must be similar to how FF classically levels up characters.

What I know about the level up in the game is that.

  1. The game starts of with a large exp pool to fulfill, and the enemies give large drops of exp too (ex: in lvl 1 areas enemies give 50-150 exp points, and you need around 500 exp to reach lvl 2 and so on)
  2. The larger the level, the more exp you will need (to the point you need x0 000 exp points to continue in the midgame), however in the late game, the exp point does not increase exponentially (let’s say it doesn’t reach x00 000 not even at level 99)

Obviously, we want more effort to gain more levels, but this is more about assigning the enemies appropriate exp points depending on the region of the game.

Currently my algorith is lvl = constant * sqrt(exp), however I feel this formula doesn’t work for very large numbers.

dnd 5e – How does Warlock Spell slot level interact with the feat Metamagic Adept from Tasha’s Cauldron of Everything?

dnd 5e – How does Warlock Spell slot level interact with the feat Metamagic Adept from Tasha’s Cauldron of Everything? – Role-playing Games Stack Exchange

which raid level do yo use ?


for hosting server,

which raid level do yo use ?

i use raid 10 now,

i wonder if using raid 60 later ?… | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1849268&goto=newpost

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive Proxies-free.com New Proxy Lists Every Day Proxies123