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

How to add default value in input text field

I bought a plugin ,the plugin is fine but I want to modify a feature ,but the support team seem too busy to help. What I’m going to do is add default value "+886" in the start of the text field.I tried add defaultvalue: "+886"in the code, but unfortunately not work. This problem has bothered […]

Categories
Mastering Development

‘list’ object cannot be coerced to type ‘integer’ — WRS2 package

I come across the below error when trying to use a function of WRS2 package. Error in sequence.default(piece, …) : ‘list’ object cannot be coerced to type ‘integer’ Below is the code. Percentile_rank, grade_level, and books_quantile’s data types are numeric data. Percentile rank’s value is from 1-99, grade_level from 1-10, and books_quantile from 1-3. And […]

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

Altair plot is cut off at top

I am using the code alt.data_transformers.disable_max_rows() alt.renderers.enable(‘altair_viewer’) alt.Chart(res_fake).mark_circle(size=50).encode( x=’gwp’, y=’eval_val’, fill=’wF’, row=’eval_name’, column=’name’ ).properties( height=150, width=500 ).resolve_scale( x=’independent’, y=’independent’ ) to produce an altair image, the top panels are cut off. I am not able to scroll up: When I zoom out (by a lot) all my facet panels are displayed. However, they are not […]

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

How do I preserve line breaks from a command output and write it to a file using ansible copy module

I am trying to copy the output from the linux find command to a flat file without losing the line-breaks and I can’t seem to find a way to do it. the contents of the file are always without line breaks. Any ideas would be greatly appreciated. My code: – name: Play to run find […]

Categories
Mastering Development

Problem installing matplotlib or certifi with pip

This is on an arm based machine runing arch linux. ERROR: Requested certifi>=2020.06.20 from https://files.pythonhosted.org/packages/5e/a0/5f06e1e1d463903cf0c0eebeb751791119ed7a4b3737fdc9a77f1cdfb51f/certifi-2020.12.5-py2.py3-none-any.whl#sha256=719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830 has different version in metadata: ‘2020.12.5’ Traceback (most recent call last): File "/usr/lib/python3.9/site-packages/setuptools/installer.py", line 75, in fetch_build_egg subprocess.check_call(cmd) File "/usr/lib/python3.9/subprocess.py", line 373, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command ‘[‘/usr/bin/python’, ‘-m’, ‘pip’, ‘–disable-pip-version-check’, ‘wheel’, ‘–no-deps’, ‘-w’, ‘/tmp/tmponkebyxp’, ‘–quiet’, ‘certifi>=2020.06.20′]’ returned […]

Categories
Mastering Development

Binary algorithm for calculating greatest common divisor of big integers

In order to calculate GCD of two Big Integers, I used binary algorithm and save big integers in arrays to calculate the GCD of two big integers efficiently. Input One line containing two integers, a and b, where 0 < a, b < 10^256 Output Please output an integer representing gcd(a, b). Time limits 1 […]