Categories
Linux Mastering Development

Editing a file based on a pattern appearance

I have a file that contains text and numbers like this: state(1, s(1,a), [s(1,b)]). state(1, s(1,b), [s(1,a)]). state(1, s(2,a), [s(2,b)]). state(1, s(2,b), [s(2,a)]). state(1, s(3,a), [s(3,b)]). state(1, s(3,b), [s(3,a)]). state(1, s(4,a), [t(1), t(2)]). state(1, s(5,a), [t(1), t(3)]). state(1, s(6,a), [s(6,b)]). state(1, s(6,b), [s(6,a)]). …so on I want the numbering with in s(x,y) to change as […]

Categories
Mastering Development

unable to understand why im not getting the proper output

I’ve written a code for streams of factorial. type ‘a lazee = ‘a hidden ref and ‘a hidden = Value of ‘a | Thunk of (unit -> ‘a) let demand (l: ‘a lazee) : ‘a = force l; match !l with | Value v -> v | Thunk f -> raise (Failure "shouldn’t happen like […]

Categories
Mastering Development

Data hazards in a single instruction

Considering the following mips code snippet add $t1, $t1,$t2 lw $t1, 0($sp) I understand that there is a RAW data hazard on $t1 between instructions 1 and 2, but is there a WAR hazard on line 1 because we read from and write to $t1 in a single instruction?

Categories
Mastering Development

RISC-V Assembly Language Program to Convert Fehranhite to Celsius

An assembly language program to convert a temperature value given in Fahrenheit to Celsius. The formula to be implemented is 𝐶 = (𝐹 − 32) × 5⁄9. Data Segments Required: F_temp (word) C_temp (word) The value 32 (byte) The value 5 (byte) The value 9 (byte) Prompt for input (string) Message for output (string) The […]

Categories
Mastering Development

Unsigned Multiplication using Signed Multiplier

I have been assigned with a task to perform unsigned multiplication using signed multiplier. Despite multiple attempts, I couldn’t get it. Is it possible to do this? Code: #include <stdio.h> int main() { // Must be short int short int a=0x7fff; short int b=0xc000; unsigned int res1; signed int res2; //unsigned multiplier res1= (unsigned short […]

Categories
Mastering Development

Regex in Mongodb Aggregate pipeline

My Mongodb pipeline is like this: {‘$match’:{‘name’:{‘$in’: Selected_names },’t’:{‘$gte’:start}}}, {‘$project’: {‘name’:1,’t’:1, ‘strokes’: {‘$sum’: ‘$data.%s.value’ % (possible_combination)}}}] I would like to do some kind of regex basically possible_combination could be anything from list: [‘AA’, ‘AB’…….’AZ’] if in collection it should sum. Is there any way to achieve this?

Categories
Mastering Development

Issue with RenderFragment in Blazor after leaving page with injected scripts

So, I’ve been learning how to create dynamic html in Blazor using RenderFragment, most the test have worked ok so far, except when generating html which injects javascript that modifies the end result. In this case I’m generating the scripts for the LinkedIn button public RenderFragment RenderButton() { RenderFragment form = b => { if […]

Categories
Android User Help

How do I get fastboot/adb to find my device after a reboot?

I am trying to unlock the bootloader of my Samsung Galaxy J7 Sky Pro using this guide. If I do > adb start-server > adb devices I get my device as connected, however when I then reboot into the bootloader using > adb reboot bootloader Everything works as I would suspect I get the boot […]

Categories
Mastering Development

Handlebars helpers within rocket (rust)

I’m learning rust and I stumbled across a problem that I’m not able to solve. I am trying to register a helper for handlebars the ultimate goal is to be able to have a helper that calculates/prints the length of a Vec. But I already fail to get the samples from the documentation into my […]

Categories
Mastering Development

expand dates in two columns based on another two columns with ranges

I have table 1 as given in the Rcode below. This table gives the start and end ranges of dates. I have another table,table 2 which gives the outer ends of ranges of dates that should contain start and end ranges from table 1. My final table should look like given in Rcode below. Final […]