Tuesday, August 31, 2021

Goodbye

 The beauty of Afghanistan remains:


 

 Did anything good happen in the last twenty years? Well, the population doubled. Still 

 have high birth rate with high childhood mortality; but the people were secure and fed...

Monday, August 30, 2021

Sunday, August 29, 2021

Code_J

 Makes me feel le somethng of a code jockey: I now know how

(complex) programs are tested as they evolve. And it involves testing whether

expected values are true or not ie the process is automated so that

anyone running the test can see what is going on...


Python recognizes the assert command as a request for a boolean on an expression.

If true, nothin; if false, an error is thrown.






All well and good, 10 squared is not 101. for a moew complex example, one

might be tempted to just test the program a few times. Again, there is a procedure

within Python, whcih involves expected examples in a test unit.



Here a code unit (with a (sh) extension is a shell command). This allows

the coder to run the test himself.




One can also use unittest which is a python library, (and doesn't use the shell script):





This gets run periodically! 


                                                             *     *     *

The lecture itself contains an interesting instance of an

error from  faulty code in a function. If we define is_prime

as follows, then we raise an error on 25 and 8. 





The issue: the notion of range. which does not include the second 

term as such. For example, range(1, 10) would go from 1 and include 9 

but not 10.


For 25, we are not picking up that the integer 5 squared gives 25, and

thus 25 is not prime. For 8, we end up with range(2, not including2) which

triggers the else condition of True. 


The same situation arises from both the shell code and the unittest. Prime

is just not built-in anywhere.














Saturday, August 28, 2021

Addition

 The main use of React.js for an 'eternal beginner' like me, 

might just be to be able to put together one page user interfaces

using the latest javascript technologies. Because not all browsers - 

older browsers - can process things like arrow functions and so forth. 

But react is more than that: it brings together the largest set of

javascript ready-made code components,  covering a wide array

of problems. 


It was initially put together at Facebook, in order to allow

different coders to mess with the facebook interface for the user, but just 

enough. From the poiint of view of coders themselves, they needed to 

not create confusion while doing things like translating to a myriad of languages 

and number presentations. React is now in the public domain. since 2017.


There are three components to basic React: the code functions such as state, 

component, properties (input), element(what should appear). Xjs for data handling 

(a form of XML). And Babel, which creates a virtual DOM with only certain festures 

up for update at any point.The CS50 project I followed references those three in the head 

section of the Html pageAt the very end of the code: a call to render the DOM.


The project itself is sweet: it is an addition game where user needs to accumulate 10

conscutive correct answers to 'win'. Below:


Note the frequent use of 'state'. This is the update call.








Geography

 Below, an awesome anthropological overview of 

Afghanistan. The take-away for me: Afghanistan is

a premodern society, Islamic the way the West was

religious before the Enlightment. Tribal in that the main groups

also identify ethnically with surrounding countries.

And - not mentionned in the talk but implicit - without

families: there are no proper names but people use the clan

or place name to identify themselves. Finally, there is no 

proper census...


Interesting from a political point of view: the Taliban and ISIS are

both about establishing an Islamic State, but that implies a notion

of statehood Afghan people do not hold. it is foreign to them as much

as communism or market democracies. Geography is destiny!?


Friday, August 27, 2021

Animation


Sometimes, the little things can make a big difference. In the 'hide' version, one can

make posts disappear with the click of a button. but care is taken to make the

transition smooth and intelligible to the user. First the opacity changes, then the

post underneath moves up in a 75% to 25% on 2 seconds.  To my surprise, done with 

the animationcapabilities of CSS. 


In effect, animation is there precisely for this kind of use!!







 

Thursday, August 26, 2021

More...

 

Infinity

 Ever wonder how nfinite scrolling is achieved. Or the ability to add more

items on a clothing site. All on the same page, as the scroll function illustrates.

One merely goes to fetch more.


I have added red text to the load function


itself. So there can be changes as time goes on...






The views page has a wait time of 1 second; I tried running it at 5 and sure enough, it then

takes 5 seconds for the first 20 to load, then another 5 for the next...


*     *     *
One can also use the server as an API,and specify start and end points What comes

back is Json data Below, I asked for posts?start=1&end=10:



Wednesday, August 25, 2021

Style

 The user interfaces tuto is very helpful. One learns how to - with great parcimony -

set up a website with many pages. There is really only one page, but one shows only

certain parts of it, on demand.


Below, the code for pages1, 2, 3:



Had a spot of fun adding style differences:





                                         

                                                                       *     *     *

Here is the magic part. One can, with django, make asynchronous javasxript

calls. This app has all the features of a django app, and works to show that bit

of text required from the user asking for page1, or2, or 3.








                                                           *     *     *


A fancier version of the index.html above goes so far as show the section the user has asked

for in the url; apparently, something the user expects. So this code 'adds' it in, mimisking

what a site with actual mutiple pages would do!! (Uses push going forward; pop going back).







Monday, August 23, 2021

Simple Code

Finally got the simplest code that picks up data and converts it to json.

It is a new function -fetch - and allows one to specify what to do with the

data later...





(The console displaying the data is 'developer tools' on the Edge. browser.)

                                                       *     *     *

Anf then, when you're rested, everything works. Got the code from the tuto to

work with a small adjustment. I am using a different source from the one illustrated

and had to define rate using 'conversion_rate'.







*     *     *
Found a fully fonctionning currency converter that lets one choose both the

base and new currency (from CodePen):

                                       





Sunday, August 22, 2021

POP

 This may be pure coincidence but...


I have been dutifully working my way through YouTube videos on 

Afghanistan and the Taliban: Vice, Aljazeera, historical stuff. Was sitting 

through the one below, when a song came on; so I hummed along to get a 

sense of the musicality involved.


Half-hour later, I am vacuuming the living-room when my right ear pops. 

I can now hear a phone tone as clearly from my right ear as my left; something 

that had been impossible to me for 20 years!! How about that!?




                                          *     *     *


The Children

 source: Le Figaro, updated 08, 21, 2021

author: Cécile Thibert

translation: GoogleTranslate/doxa-louise

Vaccinating children against Covid, good or bad idea?

The benefit / risk balance of anti-Covid vaccination has not yet been established for children under 12.  Studies are underway in the United States and Europe.

CHECKING-IN - As studies are underway to assess the efficacy and safety of vaccines in children under 12, the idea of ​​access to vaccination for this age group is starting to gain ground. Experts are not unaninous on this divisive subject.

THE QUESTION . Will the opening of vaccination to under 12s be the next step in the fight against the Covid-19 pandemic? While clinical trials are still underway to assess the safety and efficacy of Pfizer-BioNTech and Moderna vaccines in this age group, the idea is gaining ground within the scientific community. In the United States, at the beginning of August, the Academy of Pediatrics called on the Drug Agency (FDA) to " continue to work hard to authorize as soon as possible safe and effective vaccines for children under 12 ”, recalling that 350 children have died of infection in the country.

For the time being, no country has given the green light to the use of these vaccines in children, except in special cases. As of August 16, around 14,000 fragile children under 12 had already received at least one dose of vaccine in France. What about everyone else? While these are hardly ever affected by severe forms of the disease, would there be any benefit in opening the doors of vaccination centers to them in the coming months?

...


Saturday, August 21, 2021

Pi again

 As radii of a circle, AB and AC are both equal to 1. Which makes

BC worth 2^.5 ie the square root of two. Given the circumference

of a circle at 2 pi*r, the arc between B and C comes in at pi/2.


All this to say that the difference that circularity makes is about .15!





Friday, August 20, 2021

ExchangeR

 In aid of my ongoing work on the CS50 javascript tutorial, manages to

get an account with an exchange rate service which sends down json data.

this is what it looks like... Eventually, we want a javascript reception for

tgis data so it can be dispayed in a user-friendly fashion:



Interestingly, Canada clocks in a 1.2740 with respect to the USD. At 4pm,

when I check with Bloomberg, it is 1.280!!


Thursday, August 19, 2021

Global J.

 source: Le nouvel Observateur, Auguast19, 2021

author: Sébastien Boussois (doctor in political science)

translation: GoogleTranslate/doxa-louise

Opinion - Afghanistan, eternal land of renewal for global jihadism

With the return to power of the Taliban, can the country once again become a sanctuary for international terrorism? 

Among the many questions that have arisen since the Taliban took over Afghanistan, whether the country can once again become a sanctuary for international terrorism preoccupies the entire planet. More than the defeat of the West in pacifying this new "Talibanistan", with major responsibility on  corrupt Afghan elites for twenty years mired in a decay of power and weakness in the army, the news goes beyond the simple conjuncture but is fits well in a larger context of a civilizational crisis of  resistance organized to the world order by  marginal groups. Moreover, these fighting marginals, rejecting the dominant West for two thousand years, the most effective  years on year, are indeed Islamists. And Afghanistan has a prominent place in this endless fight and risks remaining so for the long term.

Let us recall that the veterans of Afghanistan of 1979, fighting against the USSR, were at the origin of the birth of a large part of the violent Islamist groups which swarmed from North Africa to the Sahel, from Bosnia to the Middle - East, as far as South-East Asia, and which ended up destabilizing America and then Europe. Their successes are notable from the attacks of September 11, 2001 in New York to the war in Syria and the attacks that struck the Middle East and the heart of the Old Continent. Since the fall of the Islamic State (IS) organization in Syria and Iraq, its veterans have undoubtedly become new models, some of whom will not have failed to redeploy themselves to the original lands of jihad to "recharge their batteries" and relax; "regenerate themselves". Afghanistan is one of these privileged destinations.

Who are the “new” Taliban?

As if the history of the last twenty years had shown that the end of a terrorist movement linked to Islamism left no room for the emergence of any other structure inheriting from the past movement. In Afghanistan, it is the Islamist millefeuille: we find there Al-Qaida of course which financed in its time the Taliban, the Islamic State which saw there a dream prey and has already cut its teeth with the Wilayat Khorasan in 2015 and the Taliban obsessed with the unique reconquest of their country since 2001. It is the outbidding for Islamism of the most "in", who would be the most "successful" in the face of Westerners in rout, in order to present themselves as “liberators” of their own populations in the face of corrupt “failed” states.

Today, it is the Taliban who can savor their success, while trying to present themselves as more acceptable to Westerners than twenty years ago. It is hard to believe it, but can we only imagine that their lightning victory could have been achieved without the clear consent of a good part of the Afghan population, fed up with the corruption and mismanagement of an incapable Afghan state? nGaining othing in two decades, with the Americans, for their security, prosperity and peace?

Afghanistan: "The victory of the Taliban will encourage the jihadists"

A priori, the Taliban project was, is and will be Afghanistan. But it is clear that they will give ideological and religious wings to other groups who also dream of reinstating their "caliphate" from Africa to South-East Asia via the Middle East. The resilient jihadist ideology has always attracted individuals from all over the world, and today's Afghanistan could spark new vocations, amid this ocean of Western hatred that exists in the Arab-Muslim world. This deadly ideology, but which remains a potential project for thousands of individuals faced with the political and economic vacuum and impasse in the Middle East for decades, has always known how to redeploy itself skillfully and violently. And faced with a glorified Afghanistan once again “bankable”, appetites will develop.

Fighting for the status of the country's Islamist leader

Because if they "normalize", if one day that happens, and are accepted by the West (to protect themselves from the worst yet to come), the Taliban will soon appear as the new traitors to the cause (1). A bit like the fighters of the Northern Alliance of 2001 who became traitors by joining part of power and who were never able to stem the return of the Islamists. By making compromises with the free world, they before, like the Taliban tomorrow, will generate new resistance in the country. Starting with their eternal enemy Daesh [Arab acronym for ISIS] , which until now has had limited hold.

This did not prevent the Taliban, in their progress, from having to face a self-proclaimed caliphate in 2015, by a franchise of Daesh, that was the Wilayat Khorasan. With the fall of Raqqa, the Islamic State created and proclaimed in Afghanistan in February 2015 quickly aspired to become the new Islamic caliphate. As early as May 2015, ISIS's black flag flew over Wilayat Khorasan and set up its headquarters in the Mamand Valley, before the first targeted strikes in July 2015 forced it to adopt a more mobile approach (after three chiefs Daesh were killed successively). And the worst thing is that the Afghan people welcomed this new actor positively, because they were convinced that it was serving the interests of the Afghan government, against the local Taliban. But things are changing. The Taliban entered a phase of confrontation with ISIS's Wilayat Khorasan. The latter had the upper hand, and as of June 2015, it controlled eight of the nine districts of Nangarhar province, which was its peak of power before collapsing. But it should be remembered that this was the first time that a terrorist organization from outside did not pledge allegiance to the historic Mullah Omar, head of the Taliban.[whose death in 2013 was announced in 2015] . And at the same time, the “caliph” Baghdadi had promised him to punish the Afghan “students” who had chosen not to join Daesh.

Afghanistan: Joe Biden pays the bill for twenty years of mistakes and lies

In the months to come, the war is likely to be more open than ever between the two protagonists who will continue to dispute the status of Islamist leader of the country. This is where the additional arrival of new "Daechists" from everywhere can weigh in the balance. Already within the country, there is no shortage of recruits. Indeed, Afghanistan has known for decades an influential extremist current, which is found in all strata of society, especially among many young people who have absorbed the jihadist ideology and will adhere to the new version of jihadism, the most violent. .

Especially if the Taliban are pushed too quickly to "normalize"! We understood that in Afghanistan, it was not the number of combatants that counted in winning. The far fewer Taliban have defeated an inert Afghan army. For the moment, the supporters of Daesh number a few thousand, but may well see their ranks swell in the months to come. We would then be heading towards a conflict which promises thousands of deaths and a total concentration of regional forces which risks destabilizing the entire region even more. And Afghanistan will become this new worldwide sanctuary of death. Will we one day come to have to help “normalized” Taliban to overcome an unconventional jihadist hydra even more nihilistic than them? History has shown that our support and our alliances have always been very pragmatic at the end of the day.


(1) Without counting all the conspirators, numerous in these currents, who already finally see Washington's hand in the takeover of the country, under agreement, by the Taliban.

Sébastien Boussois has a doctorate in political science, Middle East researcher on Euro-Arab relations / terrorism and radicalization, teacher in international relations, scientific collaborator of CECID (Université Libre de Bruxelles), OMAN (UQAM Montreal and SAVE BELGIUM (Society Against Violent Extremism).

Convert

 Woke up in the middle of the night - 3am - really thisty. Just

to occupy myself, looked up how to convert numbers with decimals to

binary. 






https://www.rapidtables.com/convert/number/decimal-to-binary.html?x=.1