The issue is that if one follows the usual steps, the keyboard layout handler
doesn't change the layouts. It's a very well known issue.
From the above link, and most specifically this post, the solution is as follows:
NB. This problem was read in the blogpost (https://www.glc.us.es/~jalonso/exercitium/numeros-libres-de-cuadrados/) of @Jose_A_Alonso. | |
NB. Problem statement: given a positive integer N, it's called square-free if no square number (eg 2^2, 11^11) can be created from its prime divisors. | |
NB. Created using the J903 online playground (https://jsoftware.github.io/j-playground/bin/html2/). | |
NB. Let's get the matrix of the prime divisors of an array of integers | |
q: @> 10 30 40 1000 11 121 | |
NB. 2 5 0 0 0 0 | |
NB. 2 3 5 0 0 0 | |
NB. 2 2 2 5 0 0 | |
NB. 2 2 2 5 5 5 |
The issue is that if one follows the usual steps, the keyboard layout handler
doesn't change the layouts. It's a very well known issue.
From the above link, and most specifically this post, the solution is as follows:
# Credit to `oskar31415` from the r/APLjk discord server for sharing the code and his friend for writing it. | |
''' | |
Original code: | |
(lambda N,P:(lambda f,i:P.show(__import__('matplotlib.animation',fromlist=['FuncAnimation']).FuncAnimation(f,lambda i:[i.set_array((lambda g:(lambda n:N.logical_or(n==3,N.logical_and(g,n==2)))((N.sum([N.roll(N.roll(g,y,1),x,0)for x in(-1,0,1)for y in(-1,0,1)if x|y],0))))(i.get_array())),[i]][1],interval=0,blit=1)))(P.figure(),P.imshow(N.random.rand(200,400)<.2,)))(__import__("numpy"),__import__("matplotlib.pyplot")) | |
''' | |
# Expanded by mlliarm@ | |
import pdb | |
try: |
I really love listening to music when programming, on my old Linux laptop.
So, to save resources I looked for a CLI Youtube app. And there is an amazing one.
mps-youtube
. Find yewtube here. Follow the instructions in the README.md file to install it.//header | |
#pragma GCC target ("avx2") | |
#pragma GCC optimize ("O3") | |
#pragma GCC optimize ("unroll-loops") | |
#include <bits/stdc++.h> | |
using namespace std; | |
typedef long long int ll; | |
typedef long double ld; |