Categories
Mastering Development

Why is my array populated only in the subscription function?

In the GetAllMainStore() function, I am able to get the data from the API and the console (from the console.log within the function) shows that there is data in "this.MainStoreArray". My issue is that when I try and access "this.MainStoreArray" outside of the GetAllMainStore() function, the array is empty. I cannot figure out why this […]

Categories
Mastering Development

gvim swaping between underline and normal visual text selection in visual mode

I’m having a weird issue running gvim 8.2.1081 on fedora 32 using kde,when selecting text in visual mode gvim keeps swapping between an underline and the expected visual text selection while moving the cursor. Example in the images below. correct text visual selection text selection with uderline Gvim was installed using the vim-X11 package. At […]

Categories
Mastering Development

How to fill 2d numpy array with some 2d numpy array

I have a 2d numpy array which varies in size from one value to other. How can I generalize the size by filling in zeros if the input value has less dimension than required? Exmaple: Input list with numpy array dimension: [(40, 173), (40, 14), (40, 56), (40, 173)] And I want to have all […]

Categories
Mastering Development

Query about cv2.imshow()

When I use this method with an 1 channel image, it’s shown in grayscale. Is there a way to use other color maps (not grayscale) when showing an 1 channel image? If there is, it means grayscale is the default for imshow when working with an image with only 1 channel? Thanks in advance

Categories
Mastering Development

fixing this statement of if,elif, else [closed]

cdis = ["F41H10.4", "Y75B12B.6", "C28D4.7", "Y52B11A.2a",] for sheetname in writer.sheets: df.to_excel(writer,sheet_name=sheetname, startrow=writer.sheets[sheetname].max_row, index = False,header= False) for cdi in cdis: driver.get("https://wormbase.org/#012-34-5") search = driver.find_element_by_id("Search") search.send_keys(cdi) search.send_keys(Keys.RETURN) ids = driver.find_elements_by_class_name("locus") ids1 = driver.find_elements_by_class_name("gene-link") ids2 = driver.find_elements_by_class_name("field-content") The goal is to get the CDI’s input and retrieve information from that website. But depending on the CDI’s there […]

Categories
Mastering Development

is local variable thread safe?

public void doSomething(){ Object[] a = new Object[5]; for(int i=0;i<5;i++) a[i] = executorService.submit(callable[i]).get(); for(int i=0;i<5;i++) //do something with a[i] } Is this thread safe or not? cause a is being accessed by 6 threads. and if a is being returned by doSomething(), is it gonna be thread safe too? Code version 2: public void doSomething(){ […]

Categories
Mastering Development

What happens to static class’s variables and methods when libraries are statically and dinamically linked

The following escenario is intriguing me. (A) source code library. (B) a shared library which includes (A) (C) a static library which includes (A) (D), a top level program linking with (B) and (C). Previously I read the following answer and understood that if the linkage is static the variables are truly static and exist […]

Categories
Mastering Development

toLocaleString with timestamps

I’m trying to output a UNIX timestamp value in en-GB using toLocaleString("en-GB"). var currentTimestamp = 1594859725; console.log(new Date(currentTimestamp * 1000).toLocaleString("en-GB")); For some reason the date format outputs in MM/DD/YY 00:00:00 format when I’m trying to output it in DD/MM/YY like "en-GB" should. Any help? :S

Categories
Mastering Development

PHP Calling Powershell script not to wait for script completion

I am calling a power shell command from PHP using shell_exec i don’t want PHP to wait till the script completes as i need to kill php once it run the power shell I am using below code: $abc ="powershellscript.ps1 " ; $abc = shell_exec("PowerShell.exe -command $abc"); I have tried to put > Null or […]

Categories
Mastering Development

The pointer associated location in C

I am learning some pointer of C. Here is one homework I think the answer the teacher gave is wrong: So the question is at point 2 what is the location associated with *((*p1).next). The answer I was given is m7.2. I think this is the location associated with *p1.next not the one he is […]