Posts

Showing posts with the label performance

Selenium search by tag name option

Image
Selenium search by tag name option I'm trying to get all data from a website called Correios, in this website, I need to handle some dropdowns wich i'm having some issues like: It's returning a list with a bunch of empty strings. That's my code: chrome_path = r"C:\Users\Gustavo\Desktop\geckodriver\chromedriver.exe" driver = webdriver.Chrome(chrome_path) lista_x = driver.get("http://www2.correios.com.br/sistemas/agencias/") driver.maximize_window() dropdownEstados = driver.find_elements_by_xpath("""//*[@id="estadoAgencia"]""") optEstados = driver.find_elements_by_tag_name("option") for valores in optEstados: print(valores.text.encode()) And what i get from that is: b'' b'ACRE' b'ALAGOAS' b'AMAPxc3x81' b'AMAZONAS' b'BAHIA' b'CEARxc3x81' b'DISTRITO FEDERAL' b'ESPxc3x8dRITO SANTO' b'GOIxc3x81S' b'MARANHxc3x83O' b...

What do you do without fast gather and scatter in AVX2 instructions?

What do you do without fast gather and scatter in AVX2 instructions? I'm writing a program to detect primes numbers. One part is bit sieving possible candidates out. I've written a fairly fast program but I thought I'd see if anyone has some better ideas. My program could use some fast gather and scatter instructions but I'm limited to AVX2 hardware for a x86 architecture (I know AVX-512 has these though I'd not sure how fast they are). #include <stdint.h> #include <immintrin.h> #define USE_AVX2 // Sieve the bits in array sieveX for later use void sieveFactors(uint64_t *sieveX) { const uint64_t totalX = 5000000; #ifdef USE_AVX2 uint64_t indx[4], bits[4]; const __m256i sieveX2 = _mm256_set1_epi64x((uint64_t)(sieveX)); const __m256i total = _mm256_set1_epi64x(totalX - 1); const __m256i mask = _mm256_set1_epi64x(0x3f); // Just filling with some typical values (not really constant) __m256i ans = _mm256_set_epi64x(58, 52, 154, 1...

Android Obtain all the children that a Layout has (Including Sub-childs)

Android Obtain all the children that a Layout has (Including Sub-childs) Basically what im trying to do is create a function that has a recursive calling , so i can obtain all the RadioButtons, Buttons, FAB, TextView, and even others SubViews ( LinearLayouts, RelativeLayouts, FrameLayout, ViewGroup ). Right now i can obtain all the Layouts but when i wanna access the subcontent of those subViews those values never return... var contentList = ArrayList<String>() fun ManageView(viewGroup: ViewGroup, action: String, context: Activity){ try { loop@ for (i in 0 until viewGroup.childCount) { var child = viewGroup.getChildAt(i) contentList.add(context.applicationContext.resources.getResourceEntryName(child.id)) when (child) { is ViewGroup->{ ManageView(child,"vacant",context) } is RadioGroup -> { contentList.add(context.applicationCon...