Posts

Showing posts from February 13, 2019

Opengl necessarily use winapi on windows for drawing graphics? [closed]

Image
0 I know that in linux, opengl can work with video memory directly. Is this true for windows? I'm not talking about the interaction of opengl and window manager. I am talking about drawing primitives, images, etc. That is, the question is whether opengl uses the winapi functions for drawing shapes, or it implement thats functions, working directly with memory. if it can bypass winapi, then how can i write similar native code to draw pixels in a windows window? (Without winapi or external shells) opengl graphics share | improve this question edited Nov 12 '18 at 3:38 Nicol Bolas 287k 33 478 649 asked Nov 12 '18 at 0:24 Daniel Holmes Daniel Holmes 1 2 closed as unclear what you're asking by Nicol Bolas, Rabbid76, lagom, V-rund Puro-hit, Foo Nov 12 '18 at 7:17 Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exa

France Koblar

Image
France Koblar Born ( 1889-11-29 ) 29 November 1889 Železniki, Austria-Hungary (now in Slovenia) Died ( 1975-01-11 ) 11 January 1975 Ljubljana, Socialist Federal Republic of Yugoslavia (now in Slovenia) Occupation literary historian, editor and translator Notable awards Prešeren Award 1951 for his work in theatrical culture, literary history and criticism Prešeren Award 1969 for his life's work in literature France Koblar (29 November 1889 – 11 January 1975) was a Slovene literary historian, editor and translator. Koblar was born in Železniki in what was then Austria-Hungary and is now in Slovenia. He studied Slavic languages and Latin at Vienna. He worked as a secondary school teacher at the Poljane Grammar School in Ljubljana from 1919 till 1945 and became a professor of dramaturgy and history of theatre at the newly founded Ljubljana Theatre Academy in 1946 where he worked until 1970. He was president of the Slovene Writers' Association between 1938 and 1945. [1] [2] He

Central District (Bashagard County)

Image
Clash Royale CLAN TAG #URR8PPP The Central District of Bashagard County (Persian: بخش مرکزی شهرستان بشاگرد ‎) is a district (bakhsh) in Bashagard County, Hormozgan Province, Iran. At the 2006 census, its population was 9.322, in 2,131 families. [1] The District has one city: Sardasht. The District has two rural districts ( dehestan ): Jakdan Rural District and Sardasht Rural District. References ^ "Census of the Islamic Republic of Iran, 1385 (2006)". Islamic Republic of Iran. Archived from the original (Excel) on 2011-11-11. .mw-parser-output cite.citationfont-style:inherit.mw-parser-output .citation qquotes:"""""""'""'".mw-parser-output .citation .cs1-lock-free abackground:url("//upload.wikimedia.org/wikipedia/commons/thumb/6/65/Lock-green.svg/9px-Lock-green.svg.png")no-repeat;background-position:right .1em center.mw-parser-output .citation .cs1-lock-limited a,.mw-parser-output .citation .cs1-lock-regi

XOR greater than 4 of even-even or odd odd pair

XOR greater than 4 of even-even or odd odd pair Given an array of even and odd numbers, I want to get the number of (even-even) and (odd-odd) pairs whose XOR is greater than or equal to 4. I tried this with the code below but it runs in O(n^2), (yikes). Please can anyone suggest a means of optimization? n = int(raw_input()) #array size ar = map(int, raw_input().split()) #the array cnt = 0 for i in xrange(len(ar)): for j in xrange(i+1, len(ar)): if ar[i] ^ ar[j] >= 4 and (not ar[i] & 1 and not ar[j] & 1): cnt += 1; #print ar[i],ar[j],ar[i]^ar[j]; elif ar[i] ^ ar[j] >= 4 and (ar[i] & 1 and ar[j] & 1): cnt += 1 print cnt EDIT: I discovered something. any number x, which gives a remainder after % 4, i.e x % 4 != 0, will result to 2 when XORed to a number -2 itself. For example, 6. It is not divisible by 4, therefore, 6 XOR 6-2 (4),==> 2. 10 is not divisible by 4, hence, 10 XOR 10-2 (8) ==> 2. Can you please tell me how this could help me optimize my code?