Categories
Mastering Development

Remove extra space before word ends

I need some help removing the extra place before a word/string ends. Does anyone have any ideas? input: hello output I get: ‘ …. . .-.. .-.. — ‘ expected output: ‘ …. . .-.. .-.. — ‘ MORSE_CODES={‘A’:’.-‘,’B’:’-…’,’C’:’-.-.’, ‘D’:’-..’,’E’:’.’,’F’:’..-.’,’G’:’–.’, ‘H’:’….’,’I’:’..’,’J’:’.—‘,’K’:’-.-‘, ‘L’:’.-..’,’M’:’–‘,’N’:’-.’,’O’:’—‘, ‘P’:’.–.’,’Q’:’–.-‘,’R’:’.-.’, ‘S’:’…’,’T’:’-‘,’U’:’..-‘,’V’:’…-‘, ‘W’:’.–‘,’X’:’-..-‘,’Y’:’-.–‘,’Z’:’–..’} def encode_Morse(my_msg): my_msg=my_msg.upper() my_msg_Morse=" " for letter in my_msg: if […]

Categories
Mastering Development

How to use a cut in prolog to find the number of daughters?

Exercise: Observe the family structure below where each person has a gender specification as their third parameter (m = male, f = female). Use a cut to write the predicate numDaughters(L, Count) in such a way that family(Husband, Wife, Kids), numDaughters([Husband, Wife|Kids],X) lists each family in the database and the number of daughters in each […]

Categories
Mastering Development

Oracle SQL request in PHP no returning anything but works in sqldevelopper

I’m facing an issue where I have a request that works in sqlDevelopper or VsCode with the oracle DB add-on but in the php code, it returns 0 rows. PHP version is old and I can’t do anything about that, 5.4.6, OracleDB is 11g (11.2.0.3.0). Here is the request : $sql = "SELECT PATIENT_SOIGNE.NOM, PATIENT_SOIGNE.PATRONYME […]

Categories
Mastering Development

I have a SQL query which needs to be written output in a spefic format in oracle

I have a table whose structure is test(id , col1,col2) Now I want to have the output of just col1 and col2 in combination . e.g. data in table is – output should be –> a,b,c,d,e,f

Categories
Mastering Development

Unittest, code coverage for a function throws an exception in Python(action_required)

Unittest, code coverage for a function throws an exception action_required `class Kill_Tasks: def __init__(self): self.action = None self.cmd=[] def kill_tasks(self): self.action = False #exp task = chrome.exe target = ‘chrome.exe’ try: self.cmd = suprocess.run([‘taskkill’,’/im’, target,’/f’],capture_output=True, check=True) self.action = True except subprocess.CalledProcessError as e: print(e) self.action = False return self.cmd def action_required(self): tries = 3 for […]

Categories
Mastering Development

Passing language specific characters from asp to CDO to HTML template not working [duplicate]

NB! to those who associates this post with : https://stackoverflow.com/questions/31524404/classic-asp-and-utf-8 it does NOT solve the issue, and everything in it has been testet. I have an ASP Classic form that sends through CDO using a HTML template to send an e-mail.. passing the special language charcters (In this case danish characters æ,ø,å) from form to […]

Categories
Mastering Development

Problem on How to make a receipt from food menu on Dev c++

hi im a beginner in coding and need a little bit help on my homework. Please be nice to me huhu. Im writing a code for a menu and need to display receipt of the choice. the problem is that i dont know how to display the code for food as a whole in the […]

Categories
Mastering Development

AWS EKS getting error “networkPlugin cni failed to set up pod”

EKS cluster version: Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.1", GitCommit:"c4d752765b3bbac2237bf87cf0b1c2e307844666", GitTreeState:"clean", BuildDate:"2020-12-19T11:45:27Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"18+", GitVersion:"v1.18.9-eks-d1db3c", GitCommit:"d1db3c46e55f95d6a7d3e5578689371318f95ff9", GitTreeState:"clean", BuildDate:"2020-10-20T22:18:07Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"} Given below is my deployment file : kind: Deployment apiVersion: apps/v1 metadata: name: sample-pod namespace: front-end spec: replicas: 1 selector: matchLabels: app: sample-pod template: metadata: labels: app: sample-pod spec: serviceAccountName: […]

Categories
Mastering Development

STM32L1 snprintf usage to convert float to string

I have problem with convert float to str on STM32, I have two simple functions to print Int and Float Int work fine, but float print cause program crash void LCD_PrintInt(int value) { char str[8]; sprintf(str, "%d", value); LCD_Print(str); } void LCD_PrintFloat(float value, uint8_t length) { char str[length]; snprintf(str, length + 1, "%f", value); LCD_Print(str); […]

Categories
Mastering Development

How to change color of each controlP5 dropdown list entry individually?

Using the following MWE: import controlP5.*; import java.util.*; ControlP5 cp5; void setup() { size(400, 400); cp5 = new ControlP5(this); List l = Arrays.asList("a", "b", "c", "d", "e", "f", "g", "h"); /* add a ScrollableList, by default it behaves like a DropdownList */ cp5.addScrollableList("dropdown") .setPosition(100, 100) .setSize(200, 100) .setBarHeight(20) .setItemHeight(20) .addItems(l) // .setType(ScrollableList.LIST) // currently supported […]