Categories
CMS Mastering Development

Commerce: what is the purpose of a line item’s snapshot?

Having nearly completed my first real Commerce project, I managed to utilize most of the features offered in Commerce 3. However, I never quite figured out what the use of a line item’s snapshot is for. What is it and when would you need to use it? There isn’t anything about it in Commerce’s docs.

Categories
CMS Mastering Development

Localization Section propagation settings, and related entry field setting “Manage relations on a per-site basis”

Craft 3.4.20. Site is running multiple localizations Sections: Blog Post Propagation method set to, "Save entries to all sites enabled for this section" Blog Category (Structure entry with nothing more than the default Title) Blog Post Section entry has a field to relate to our Blog Category Structure. We have a field under our Blog […]

Categories
Cryptocurrency Ethereum Mastering Development

want to get address of account from truffle console to one of the function in smart contract and set some values

i have 3 accounts in private node. i want to get addresses of two accounts from truffle console to set values in 1 of the function in my smart contract. when i copy paste account address in truffle console. it gives error of Big Number. help me out on this one. following is the sample […]

Categories
Linux Mastering Development

Reboot with kexec without making it default

Upon installing kexec-tools, on Ubuntu at least, I am asked if I want to use kexec to handle all invocations of reboot. I don’t, but there are some occasions that I do want graceful termination of running processes and unmounting of filesystems and then execution of kexec to reboot the system. How can this be […]

Categories
Linux Mastering Development

RTX 2070 Super on Ubuntu

Heyo, this is the first time I’ve installed NVIDIA drivers on Linux (Ubuntu 20) and things aren’t working the way Google tells me they should. I’ve gone into additional software but nothing pops up. How do I install drivers for NVIDIA RTX 2070 Super?

Categories
Linux Mastering Development

Replacing Linux Distro with another in dual boot system

I’m using a dual system Debian/Win10, and I’m trying to replace my Debian with Fedora, so I booted into Windows then deleted the Debian partition, used Diskpart to list partitions and then rd debian /S to delete Debian from UEFI and avoid any grub issues while booting, it worked fine, no grub anymore and windows […]

Categories
Mastering Development

How to initialize an event handler in swift?

For the given event handler attribute methods: class AudioServer { var didReceiveData: ((AudioBufferData) -> Void)? func websocketCallback(event: WebSocketEvent, client: WebSocket) { switch event { .. } func handleMicrophoneData(_ data: AudioBufferData) { .. } How can those be set up /initialized? They are not available yet in the init() method so the following most straightforward implementation […]

Categories
Mastering Development

How to extract values from grouped rows to specific columns in Oracle SQL?

Suppose I have a table like this in Oracle: +———-+———–+——–+ | PersonId | ValueType | Value | +———-+———–+——–+ | 1 | FirstName | John | | 1 | LastName | Smith | | 2 | FirstName | John | | 2 | LastName | Doe | | 2 | City | London | +———-+———–+——–+ How […]

Categories
Mastering Development

Array elements not mutating inside for of loop

function rot13(str) { let alphArr = “ABCDEFGHIJKLMNOPQRSTUVWXYZ”.split(“”); let n = 13; let arr = str.split(“”); let len = alphArr.length; for (let i of arr) { if (alphArr.includes(i)) { if (alphArr.indexOf(i) + n <= len – 1) { i = (alphArr[alphArr.indexOf(i) + n]) console.log(i) // This is as expected } } } console.log(arr) // Array itself […]

Categories
Mastering Development

How to get the latest commit hash on remote using gitpython?

Is there a way that I can get the most recent commit on a remote repository using gitpython? I do not want to perform operations like a pull or merge on my local branch. I also do not want to depend on the master branch on my local to get this information. All I have […]