Is there a commonly used term for a number divided by its greatest common divisor?

Does the expression $ \frac{a}{\gcd(a, b)}$ have a common name?

This type of expression occurs frequently in a program I’m writing. Since $ \forall a,b \in \mathbb{N^{*}}: \frac{a}{\gcd(a, b)} \perp \frac{b}{\gcd(a, b)}$ , I’ve been calling this the coprime part or coprime residue. I’d prefer to use a term of art if one exists.

Another – ERROR: column “da2.dependency_device_name” must appear in the GROUP BY clause or be used in an aggregate function

I am attempting to aggregate dependency_device_name into one string, “Dependency List”. Here is the error:

ERROR: column “da2.dependency_device_name” must appear in the GROUP BY clause or be used in an aggregate function.

Here is the sql. I have added the field to the group by and still have the same error message:

Select xy1."Dependency Count", xy1."Dependency List", ag2.report_type_name, xy1.dependent_device_name from view_affinitygroup_v2 ag2  left join  (     Select    da2.dependency_device_name,           da2.effective_to,    da2.dependent_device_name,    da2.dependent_device_fk,    sum(1) "Dependency Count",   string_agg(da2.dependency_device_name,', ') "Dependency List"   from     view_deviceaffinity_v2 da2         ) as  xy1       on xy1.dependent_device_fk = ag2.primary_device_fk and xy1.effective_to is null     where ag2.report_type_id = 1    group by      da2.dependency_device_name,      ag2.report_type_name,      xy1.dependent_device_name,      xy1.effective_to 

Which book or books are being used in these lectures on Distributed Systems?

Kindly take a look at these lecture materials.

The instructor is suggesting to study books of Tanenbaum along with his supplied reading list. But, I am not finding any similarity of the content between the lectures slides and Tanenbaum‘s books and other reading materials.

Take for example the following slides from Lecture#2:

enter image description here

Where are these images sourced from?

Kindly, provide me some suggestions regarding any book or additional reading material.

Is less toner used, if you print only after the last page is spooled?


Reduce Stop/Start Cycles

In addition to waiting to change your toner cartridge, you can also avoid using stop/start cycles to further reduce your usage. During the stop/start cycle, toner will accumulate on the drum even if you are not printing anything. This is a wasteful practice that many people do not even realize their printers are doing. To avoid this, go into your “Printer Properties” tab on your computer and adjust the settings so that your pages will only start printing after the last page is spooled. This will reduce the number of times your printer will stop and start up again, saving you a lot of toner.

Who’s correct in this Reddit post? Many comments there rebuff the quote overhead.

u/unclefisty

The amount of toner that will attach to an uncharged drum is pretty low. However this may reduce the amount of extra revolutions in the drum unit which will reduce wear.

u/m0j0r0lla

I have worked in printing for 15, and this is just not true.

In a toner based system, there is no toner on a drum surface in a resting state. In all toner based system, the drum(s) are cleaned after every page. This cleaning not only uses a blade to to physically remove the image, but most also use an erase lamp to take the charge from the drum surface.

If you want to save toner, there should be a toner save feature in the print driver or in the printer settings.

How to restore GBWhatsApp chats & media from Google drive, when you’ve forgotten the email address you used to back up

My GBWHATSAPP became obsolete & I couldn’t access it anymore to be able to do a proper backup and it was equally challenging to update it directly from the app. After several trials, I uninstalled it and installed a different version I downloaded from a site on the internet. Now, the challenge is to restore my data. When tab on RESTORE they b tell me “No backup in my SD card”. I checked in my Google drive, but couldn’t find the backup. I’ve attached a picture to show the backup that is shown there. It’s an old (as of Oct 2018) & the phone backup. How do I restore my data, please? I really don’t want to lose it.enter image description here

Menu link title used as page title on first access

Simple problem: I defined some main menu links under /admin/structure/menu. Whenever i access the linked page, the page title shows the menu link title and not the title set in .module. Every access after that shows the correct title from the .module-file. At same point this is reset and it shows the menu link title again for one visit.

This is a problem since i want the menu link titles and the .module titles to be different but always show the .module-title when accessing the page.

Is it okay to have a class where some attributes won’t always be used?

I’m designing an app which use a Knowledge Base filled with rules. Depending on the context some rules will be applicable and others will not.

  • I need to get first the list of the applicable rules and optionally later the list of non applicable rules.
  • The system doesn’t need both at the same time and I want to avoid keeping them in memory while not needed.
  • I also want to search through my list of rules only one time for optimization purpose.

I thought of having a KnowledgeBase object containing a list of all rules with two empty attributes for applicable and non applicable rules at the creation of the object. When created, I only need the full list of rules without context being necessary.

KnowledgeBase class

I don’t give more details about the context because id doesn’t matter.

function applicableRules(context) {     if !isset(applicableRules) {        sortRules(context);     }      return applicableRules; }  function inapplicableRules(context) {     if !isset(applicableRules) {         sortRules(context);     }      return inapplicableRules; }  function sortRules(context) {     foreach rules {         if rule.isApplicable(context) {             applicableRules.add(rule);         } else {             nonApplicableRules.add(rule);         }     }     unset(rules); }  function rules() { //Return all the rules     if !isset(rules) {         return applicableRules+inapplicableRules;     } else {         return rules;     } } 

But doing this means I have 3 attributes in my object that will never be instantiated at the same time (rules VS applicableRules + nonApplicableRules)

The programming language doesn’t matters, I’m just trying to know if the concept is okay

So is it a good way to do things or is this just awful ?

Error fetching OAuth credentials: “OAuthException: This authorization code has been used.”

I have found many tutorials about this issue. But no one of them solved my problem. So, i’m trying on Symfony 4 to follow this tutorial for OAuth2 Facebook

When i click on my button “Connexion with Facebook”, i have a blank page with the message :

Error fetching OAuth credentials: “OAuthException: This authorization code has been used.”.

I saw on some tutorials that is a problem about accessToken, longliveAccessToken, etc.

But i have no idea what to do in my code to solve this issue.

Here is my code of my FacebookAuthenticator.php :

    <?php  namespace App\Security;  use App\Entity\User; // your user entity use Doctrine\ORM\EntityManagerInterface; use KnpU\OAuth2ClientBundle\Security\Authenticator\SocialAuthenticator; use KnpU\OAuth2ClientBundle\Client\Provider\FacebookClient; use KnpU\OAuth2ClientBundle\Client\ClientRegistry; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Core\User\UserProviderInterface;  class FacebookAuthenticator extends SocialAuthenticator {     private $  clientRegistry;     private $  em;      public function __construct(ClientRegistry $  clientRegistry, EntityManagerInterface $  em)     {         $  this->clientRegistry = $  clientRegistry;         $  this->em = $  em;     }      public function supports(Request $  request)     {         // continue ONLY if the current ROUTE matches the check ROUTE         return $  request->attributes->get('_route') === 'connect_facebook_check';     }      public function getCredentials(Request $  request)     {         // this method is only called if supports() returns true          // For Symfony lower than 3.4 the supports method need to be called manually here:         // if (!$  this->supports($  request)) {         //     return null;         // }          return $  this->fetchAccessToken($  this->getFacebookClient());     }      public function getUser($  credentials, UserProviderInterface $  userProvider)     {         /** @var FacebookUser $  facebookUser */         $  facebookUser = $  this->getFacebookClient()             ->fetchUserFromToken($  credentials);           // 1) have they logged in with Facebook before? Easy!         $  existingUser = $  this->em->getRepository(User::class)             ->findOneBy(['facebookId' => $  facebookUser->getId()]);         if ($  existingUser) {             return $  existingUser;         }          // 2) do we have a matching user by email?         $  user = $  this->em->getRepository(User::class)             ->findOneBy(['email' => $  email]);          // 3) Maybe you just want to "register" them by creating         // a User object         $  chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$  %&*_";          $  user = new User();         $  user->setFacebookId($  facebookUser->getId());         $  user->setUsername($  facebookUser->getEmail());         $  user->setPassword(password_hash(substr( str_shuffle( $  chars ), 0, 10), PASSWORD_DEFAULT));         $  user->setPrenom($  facebookUser->getFirstName());         $  user->setNom($  facebookUser->getLastName());         $  user->setEmail($  facebookUser->getEmail());         $  user->setEnabled(true);         $  user->setSocialAuthentication(true);         $  this->em->persist($  user);         $  this->em->flush();           return $  user;      }      /**      * @return FacebookClient      */     private function getFacebookClient()     {          return $  this->clientRegistry             // "facebook_main" is the key used in config/packages/knpu_oauth2_client.yaml             ->getClient('facebook_main');     }      public function onAuthenticationSuccess(Request $  request, TokenInterface $  token, $  providerKey)     {         // on success, let the request continue         return null;     }      public function onAuthenticationFailure(Request $  request, AuthenticationException $  exception)     {         $  message = strtr($  exception->getMessageKey(), $  exception->getMessageData());          return new Response($  message, Response::HTTP_FORBIDDEN);     }      /**      * Called when authentication is needed, but it's not sent.      * This redirects to the 'login'.      */     public function start(Request $  request, AuthenticationException $  authException = null)     {         return new RedirectResponse(             '/connect/', // might be the site, where users choose their oauth provider             Response::HTTP_TEMPORARY_REDIRECT         );     }   } 

Thanks for help me, if you want the code for FacebookController.php , tell me, then i will edit my post.

Does Digital Wellbeing affect battery life when the phone is not used?

I know the point of this app is to reduce usage of the phone (specific apps), which results in longer battery life. And maybe reduces battery usage a little by making the screen black and white, when the phone is used.

But does it do anything when the Wind Down mode is turned on, but the phone is not used and screen is off?

Bundle identifier of Zathura (not listed in ‘Applications’ folder, to be used in Karabiner)

I installed a PDF reader called Zathura in MacOS Mojave 10.14.4. Zathura’s version is 0.4.3, and I installed it through Homebrew (brew install zathura).

It works correctly: I can open PDFs in Terminal with zathura example.pdf.

I would like to find Zathura’s bundle identifier, so I tried this answer, namely: osascript -e 'id of app "Zathura"' and also mdls -name kMDItemCFBundleIdentifier -r Zathura.app. I tried also with zathura instead of Zathura.

The output was

0:2: execution error: Can’t get application "zathura". (-1728) 

Interestingly, in Finder > Applications, I do not find Zathura listed. Why? How can I get Zathura’s bundle identifier?

Note: I would like to get the bundle identifier to define some custom shortcuts with Karabiner. Any workaround that might get this done would be very welcome.