Clicky

Commentary

For old entries, see Legacy Commentary. The bibliography is at the end of the page.

Better PDF version of Manufacturing Consent

Just like K&R: The C Programming Language, I found this fantastic version. Download from the archive.

DONE K&R: The C Programming Language

CLOCK: [2023-09-17 Sun 00:58]--[2023-09-17 Sun 01:06] (0:08)

This is the best available online version of K&R. I was looking for it everywhere and I could not find it, I looked it up in the chat between me and my friend Antar and I found it there. It should be available now on the link above.

DONE Did Size Matter to the Romans?   @watch

CLOCK: [2023-08-31 Thu 11:41]--[2023-08-31 Thu 11:45] (0:04)

Interesting. This videos shows the reason why ancient Roman heroes and athletes had very small genitals. It relates to self-control and being self-possessed. In contrast, in contract, characters with barbarian behavior would have been depicted with giant genitals.

DONE rssc - rss customizer   @write

CLOCK: [2023-08-14 Mon 16:25]--[2023-08-14 Mon 19:26] (3:01)

CLOCK: [2023-08-14 Mon 05:04]--[2023-08-14 Mon 07:15] (2:11)

CLOCK: [2023-08-14 Mon 04:09]--[2023-08-14 Mon 04:17] (0:08)

CLOCK: [2023-08-14 Mon 03:42]--[2023-08-14 Mon 03:49] (0:07)

CLOCK: [2023-08-14 Mon 00:47]--[2023-08-14 Mon 03:22] (2:35)

CLOCK: [2023-08-13 Sun 20:46]--[2023-08-14 Mon 00:00] (3:14)

CLOCK: [2023-08-13 Sun 15:33]--[2023-08-13 Sun 19:02] (3:29)

CLOCK: [2023-08-12 Sat 13:33]--[2023-08-12 Sat 14:20] (0:47)

Related: Where to get news?

I want to talk briefly about a problem that I encounter specially when using RSS feeds, which could be noticed if you kept in mind the feature of social media feeds that this article didn’t mention, which is that most of the time social media platforms get you news/feeds that are relevant to your interests, for example if you post so much about football you will not get sports updates from the BBC about basketball, however you will get when you follow BBC’s RSS.

Some RSS providers overstep this issue by providing feeds per key, and the key is a token that represents the user preferences.

However, the majority do not do that and provide you with a single XML source that include all the updates their site has. What if you only want to get updates about Egypt for example? You do not get to do so, but you can search on the feeds you received for entries having the word Egypt. Which is not very convenient, IMHO.

So I built a very simple customizer to solve this problem, it’s called rssc. You can get it from here https://rssc.fly.dev/. It’s very simple and self-explanatory as you will see in that page, so I do not really have to explain it here. Enjoy.

DONE Higher Education Percentage in Egypt

CLOCK: [2023-08-04 Fri 05:34]--[2023-08-04 Fri 05:47] (0:13)

This does not tell how bad the situation is currently, but it shows how bad it was 2-4 years before each indicator (since a Ph.D takes this time to obtain). The number in 2021 says that the situation was fucked in 2018, and so on. Since the situation currently is no better than 2021, I anticipate that I the rest of new indicator will be even worse.

While this not explicitly addressing the current severity of the situation, this analysis elucidates the extent of its gravity between 2 to 4 years prior to each corresponding indicator, given the temporal span typically required to attain a Ph.D. For instance the value attributed to 2021 serves as an indicator that the economical situation was considerably unfavorable in 2018, and this pattern continues retrogressively. Telling from the absence of any possible improvement since 2021 but only worse crisis, I anticipate that the rest of the indicator for the coming year will be in أسفل سافلين.

Commentary Egypt

The nature of what is good   drill

CLOCK: [2023-08-04 Fri 02:00]--[2023-08-04 Fri 02:20] (0:20)

See my statement before about wisdom here: What is Wisdom?. I found Marcus Aurelius similiar quote:

Begin the morning by saying to thyself, I shall meet with the busybody, the ungrateful, arrogant, deceitful, envious, unsocial. All these things happen to them by reason of their ignorance of what is good and evil. But I who have seen the nature of the good that it is beautiful, and of the bad that it is ugly, and the nature of him who does wrong, that it is akin to me; not (only) of the same blood or seed, but that it participates in (the same) intelligence and (the same) portion of the divinity, I can neither be injured by any of them, for no one can fix on me what is ugly, nor can I be angry with my kinsman, nor hate him.

DONE Journaling Effectiveness   @read

CLOCK: [2023-08-01 Tue 00:11]--[2023-08-01 Tue 00:30] (0:19)

CLOCK: [2023-07-31 Mon 23:27]--[2023-07-31 Mon 23:37] (0:10)

I also found this “An everyday activity as a treatment for depression: The benefits of expressive writing for people diagnosed with major depressive disorder” Which is interesting too. I’ve been doing journaling from time to time hoping that I will do some data science on what I will be left with of jounraling entries someday, but I started recently to question the effectiveness of that. Also, I think that another kind of jounraling should be inspected, that is the way used to Marcus Aurelius (his prominent book “thoughts” or “contemplation” was actually intended to be a journal rather than a book); that is to admonish and advice self.

TODO Amicable Numbers

CLOCK: [2023-07-28 Fri 03:04]--[2023-07-28 Fri 04:53] (1:49)

Amicable numbers were known to the Pythagoreans, who credited them with many mystical properties.

Amicable numbers are two different natural numbers related in such a way that the sum of the proper divisors of each is equal to the other number. That is, s(a)=b and s(b)=a, where s(n)=σ(n)-n is equal to the sum of positive divisors of n except n itself (see also divisor function).

People used to credit the amicable numbers for love and harmony, lovers used to share amicable numbers together, a famous amicable pair is 220 and 284.

I think a quick way to solve the question above would be by implementing Sieve’s Algorithm to calculate all the divisors of a number.

If n = p1^e1 * p2^e2 * ... * pk^ek, where each p is a prime number, then the
number of factors of n is (e1 + 1)*(e2 + 1)* ... *(ek + 1)

Don’t really get why this work.

His algorithm:

initial_n = n
num_factors = 1;
for (i = 2; i * i <= initial_n; ++i) // for each number i up until the square root of the given number
{
    power = 0; // suppose the power i appears at is 0
    while (n % i == 0) // while we can divide n by i
    {
        n = n / i // divide it, thus ensuring we'll only check prime factors
        ++power // increase the power i appears at
    }
    num_factors = num_factors * (power + 1) // apply the formula
}

if (n > 1) // will happen for example for 14 = 2 * 7
{
    num_factors = num_factors * 2 // n is prime, and its power can only be 1, so multiply the number of factors by 2
}

arch

Let’s first decide which algorithm can be used to solve such a problem (number of all factors); I didn’t find any sophisticated algorithm to do so, but this solution seems promising:

{
  int n;
  int i = 2;
  scanf("%d", &n);
  while (i <= sqrt(n)) {
    if (n % i == 0) {
      printf("%d,", i);
      if (i != (n / i)) {
        printf("%d,", n / i);
      }
    }

    i++;
  }
}

I’ve been thinking so far for an optimization. Seems like that the correct solution it a brute force-like:

from math import sqrt
L = 130000; ds = [1]*L
for i in range(2, int(sqrt(L))):
    for j in range(i+1, L//i):
        ds[i*j]+= i+j
an = []
for i in range(2, L):
    if ds[i] < i and ds[ds[i]] == i: an+= [ds[i], i]

N = int(input("Limit? "))
print ("Amicable sum less than",N,"=", sum(a for a in an if a<N))

I think that will work.

Oh this problem is very confusing. I will stop here.

TODO Corpus for Arabic stemming   @later @current

  • State “KILL” from “TODO” [2024-03-05 Tue 23:42]
  • State “KILL” from “TODO” [2024-03-05 Tue 05:48]
  • State “KILL” from “TODO” [2024-03-04 Mon 01:14]
  • State “KILL” from “TODO” [2024-03-04 Mon 01:14]
  • State “KILL” from “TODO” [2024-03-04 Mon 01:13]
  • State “DONE” from “TODO” [2024-02-29 Thu 22:56]
  • State “KILL” from “TODO” [2024-02-29 Thu 00:31]
  • State “KILL” from “TODO” [2024-02-27 Tue 23:54]
  • State “KILL” from “TODO” [2024-02-24 Sat 14:05]

CLOCK: [2024-02-07 Wed 02:25]--[2024-02-07 Wed 04:56] (2:31)

CLOCK: [2024-02-05 Mon 01:50]--[2024-02-05 Mon 03:47] (1:57)

CLOCK: [2024-02-05 Mon 00:48]--[2024-02-05 Mon 01:14] (0:26)

CLOCK: [2024-02-04 Sun 22:56]--[2024-02-04 Sun 23:07] (0:11)

CLOCK: [2024-02-04 Sun 21:07]--[2024-02-04 Sun 21:12] (0:05)

CLOCK: [2024-02-03 Sat 20:50]--[2024-02-03 Sat 22:23] (1:33)

CLOCK: [2023-10-27 Fri 00:26]--[2023-10-27 Fri 01:02] (0:36)

CLOCK: [2023-08-03 Thu 07:00]--[2023-08-03 Thu 07:59] (0:59)

CLOCK: [2023-07-30 Sun 01:17]--[2023-07-30 Sun 05:02] (3:45)

CLOCK: [2023-07-29 Sat 06:53]--[2023-07-29 Sat 07:10] (0:17)

CLOCK: [2023-07-29 Sat 02:10]--[2023-07-29 Sat 04:56] (2:46)

CLOCK: [2023-07-28 Fri 20:44]--[2023-07-28 Fri 22:21] (1:37)

CLOCK: [2023-07-27 Thu 22:30]--[2023-07-28 Fri 00:25] (1:55)

CLOCK: [2023-07-27 Thu 03:33]--[2023-07-27 Thu 04:28] (0:55)

CLOCK: [2023-07-16 Sun 23:10]--[2023-07-17 Mon 00:49] (1:39)

CLOCK: [2023-07-16 Sun 13:30]--[2023-07-16 Sun 14:32] (1:02)

CLOCK: [2023-07-13 Thu 16:35]--[2023-07-13 Thu 18:52] (2:17)

CLOCK: [2023-07-13 Thu 15:55]--[2023-07-13 Thu 16:04] (0:09)

CLOCK: [2023-07-12 Wed 14:00]--[2023-07-12 Wed 15:23] (1:23)

CLOCK: [2023-07-11 Tue 14:27]--[2023-07-11 Tue 17:02] (2:35)

CLOCK: [2023-07-11 Tue 12:33]--[2023-07-11 Tue 13:46] (1:13)

CLOCK: [2023-07-09 Sun 07:57]--[2023-07-09 Sun 09:58] (2:01)

CLOCK: [2023-07-09 Sun 04:39]--[2023-07-09 Sun 07:06] (2:27)

CLOCK: [2023-07-08 Sat 14:36]--[2023-07-08 Sat 17:15] (2:39)

CLOCK: [2023-07-08 Sat 11:46]--[2023-07-08 Sat 13:55] (2:09)

CLOCK: [2023-07-08 Sat 08:08]--[2023-07-08 Sat 11:01] (2:53)

CLOCK: [2023-07-08 Sat 05:21]--[2023-07-08 Sat 06:17] (0:56)

CLOCK: [2024-03-02 Sat 05:02]--[2024-03-02 Sat 06:18] (1:16)

CLOCK: [2024-03-02 Sat 04:15]--[2024-03-02 Sat 04:53] (0:38)

CLOCK: [2024-03-02 Sat 04:11]--[2024-03-02 Sat 04:12] (0:01)

CLOCK: [2024-03-02 Sat 01:29]--[2024-03-02 Sat 04:11] (2:42)

CLOCK: [2024-02-29 Thu 01:44]--[2024-02-29 Thu 03:37] (1:53)

CLOCK: [2024-02-28 Wed 01:42]--[2024-02-28 Wed 04:51] (3:09)

CLOCK: [2024-02-28 Wed 00:35]--[2024-02-28 Wed 00:44] (0:09)

CLOCK: [2024-02-28 Wed 00:11]--[2024-02-28 Wed 00:13] (0:02)

CLOCK: [2024-02-03 Sat 17:57]--[2024-02-03 Sat 18:56] (0:59)

CLOCK: [2023-11-08 Wed 23:48]--[2023-11-09 Thu 00:57] (1:09)

CLOCK: [2023-11-08 Wed 10:45]--[2023-11-08 Wed 10:50] (0:05)

CLOCK: [2023-11-08 Wed 05:37]--[2023-11-08 Wed 06:18] (0:41)

CLOCK: [2023-11-08 Wed 03:50]--[2023-11-08 Wed 05:37] (1:47)

CLOCK: [2023-10-22 Sun 04:56]--[2023-10-22 Sun 05:59] (1:03)

CLOCK: [2023-10-14 Sat 01:48]--[2023-10-14 Sat 05:22] (3:34)

CLOCK: [2023-10-14 Sat 00:27]--[2023-10-14 Sat 01:30] (1:03)

CLOCK: [2023-08-05 Sat 06:49]--[2023-08-05 Sat 08:50] (2:01)

CLOCK: [2023-08-05 Sat 04:54]--[2023-08-05 Sat 06:25] (1:31)

CLOCK: [2023-08-04 Fri 09:22]--[2023-08-04 Fri 11:37] (2:15)

CLOCK: [2023-08-04 Fri 08:04]--[2023-08-04 Fri 08:58] (0:54)

CLOCK: [2023-08-04 Fri 06:59]--[2023-08-04 Fri 07:00] (0:01)

CLOCK: [2023-08-03 Thu 10:18]--[2023-08-03 Thu 11:56] (1:38)

CLOCK: [2023-08-03 Thu 07:59]--[2023-08-03 Thu 08:43] (0:44)

CLOCK: [2023-07-27 Thu 01:50]--[2023-07-27 Thu 03:33] (1:43)

Currently studying (Thalji et al., 2017). Unfortunately the author did not provide any implementation to her claims (not any that I could find online) I like the approach though. It’s disappointing that she also didn’t care to mention how they ’automatically’ extracted the roots.

Anyway, I think even such a corpus will be actually incompetent to be tested against because it is still limited to the dictionary resource collection. I also question the method that they used to normalize Arabic, “5) Replace hamza‟s forms ‫ء‬ , ‫آ‬, ‫إ‬ , ‫ا‬ ,‫ة‬ with‫أ‬ .”, it seems reckless.

I will investigate these questions on my paper soon; A Comparative Study of Modern Stemming Methods for The Arabic Language (if there is no link when you click on the title, this means it is not published yet).

My proposed corpus will probably follow the following approach: after collecting all possible patterns from a place like (Amil, 1993), it will be much but not too much work to collect manually. Right after that I shall generate a dataset of all possible permutation which will probably be so big. Most of them will not be even words [roots], which will be validated using the lexicons that (Thalji et al., 2017) actually used. I will not have to extract anything or recomputerize/reformat the computerized versions (like Shamela’s) because all what I will need to do is only search for the permutation and check whether it exists or not, if it does then it’s a valid word.

My corpus implementation will be on https://github.com/larrasket/corpus (if it says not found that mean it is not public yet).

DONE Are conservative women more beautiful   @read

CLOCK: [2023-07-25 Tue 22:46]--[2023-07-25 Tue 23:21] (0:35)

Facial beauty prediction is still a relatively nascent domain; most of the time the results are not credible, + the public dataset they used in the study(Rasmussen et al., 2023) is pretty inexhaustive (5500 for 60 raters) with only frontal faces. The dailymail statement is just too far from what is actually proposed in the original paper. I should write soon about how this relates to the propaganda model.

DONE Zeller`s Congruence   @read

CLOCK: [2023-07-24 Mon 23:38]--[2023-07-25 Tue 00:27] (0:49)

CLOCK: [2023-07-24 Mon 22:21]--[2023-07-24 Mon 22:45] (0:24)

CLOCK: [2023-07-24 Mon 22:09]--[2023-07-24 Mon 22:17] (0:08)

Pretty clever formula indeed. I believe the best way to think about what it does, is thinking about a normalization for the day number (like convert every Gregorian date to a unified number). There are some obstacles to handle here, like: Leap years. A leap year occurs on any year evenly divisible by 4, but not on a century unless it is divisible by 400 (this is for the orbital period is actually 364.2425). The last term handles this issue. Let’s play with it quickly so you can imagine how the values are normalized. Contemplate the following and try it with other values:

for Y in 1992:1:2018
    result = (Y + floor(Y / 4))
    if Y % 400 == 0
        s = "Y (divisible by 400)"
        println("$s = $Y, Output = $result")
    elseif Y % 100 == 0
        s = "Y (divisible by 100)"
        println("$s = $Y, Output = $result")
    elseif Y % 4 == 0
        s = "Y (divisible by 4)"
        println("$s = $Y, Output = $result")
    else
        println("Y = $Y, Output = $result")
    end
end
Y (divisible by 4) = 1992, Output = 2490.0
Y = 1993, Output = 2491.0
Y = 1994, Output = 2492.0
Y = 1995, Output = 2493.0
Y (divisible by 4) = 1996, Output = 2495.0
Y = 1997, Output = 2496.0
Y = 1998, Output = 2497.0
Y = 1999, Output = 2498.0
Y (divisible by 400) = 2000, Output = 2500.0
Y = 2001, Output = 2501.0
Y = 2002, Output = 2502.0
Y = 2003, Output = 2503.0
Y (divisible by 4) = 2004, Output = 2505.0
Y = 2005, Output = 2506.0
Y = 2006, Output = 2507.0
Y = 2007, Output = 2508.0
Y (divisible by 4) = 2008, Output = 2510.0
Y = 2009, Output = 2511.0
Y = 2010, Output = 2512.0
Y = 2011, Output = 2513.0
Y (divisible by 4) = 2012, Output = 2515.0
Y = 2013, Output = 2516.0
Y = 2014, Output = 2517.0
Y = 2015, Output = 2518.0
Y (divisible by 4) = 2016, Output = 2520.0
Y = 2017, Output = 2521.0
Y = 2018, Output = 2522.0

In the original formula:

\(\scriptsize{{h=\left(q+\left\lfloor {\frac {13(m+1)}{5}}\right\rfloor +Y+\left\lfloor {\frac {Y}{4}}\right\rfloor -\left\lfloor {\frac {Y}{100}}\right\rfloor +\left\lfloor {\frac {Y}{400}}\right\rfloor \right){\bmod {7}}}}\)

The 4 is related to the fact we have a leap year every 4 years (remember, a year is actually 364).

The 100 and 400 comes from the observation that:

For every multiple of 100, we back-off one, and for every multiple of 400 we add one back on.

What is really clever here is the month manipulation:

Zeller’s brilliant idea was to imagine starting a year in March instead of January. (Another way to think of this is making January the equivalent of the 13th month of the previous year, and February the 14th month). With the problem child of February now right at the end of the ’year’, we don’t have to worry about the variance of its days. With this shift complete, the number of days in each month are as follows: {31,30,31,30,31,31,30,31,30,31,31,28/29}. However, we’re only concerned with the modulos of the number of days, and these are {3,2,3,2,3,3,2,3,2,3,3,0}.

So the 5 actually comes from:

For every 5 months advancing, the cummulative count increases by 13. We can approximate this with a line of gradient 13/5, and use the ceiling function to snap to the answer we want.

Bibliography

Amil, Y., 1993. Mu’jam al-awzan al-sarfiah. ’Alam al-Kutub.
Rasmussen, S.H.R., Ludeke, S.G., Klemmensen, R., 2023. Using deep learning to predict ideology from facial photographs: expressions, beauty, and extra-facial information. Scientific reports 13, 5257.
Thalji, N., Binti Zahri, N.A.H., Mohd Yacob, Y., Al-Hakeem, S., 2017. Corpus for test, compare and enhance arabic root extraction algorithms. International journal of advanced computer science and applications 8. https://doi.org/10.14569/IJACSA.2017.080529

I seek refuge in God, from Satan the rejected. Generated by: Emacs 29.4 (Org mode 9.6.17). Written by: Salih Muhammed, by the date of: . Last build date: 2024-07-04 Thu 21:55.