macOS randomly locks up, forcing a hard reboot

I’ve got a brand new Mac mini 2018 running macOS 10.14.2. At random times, the system locks up completely (except for the mouse). So I can move the mouse around, but all windows and the dock are frozen. The only thing I can do is hold the power button to shut down.

I have no idea how to begin troubleshooting this. Should I look at /var/log/system.log around the time of the lock-up for anything fishy? Or somewhere else? (I’ll update this post as necessary) I already did a reset of the SMC & NVRAM, which didn’t help.

Envelope Question: Five letters addressed to individuals 1,2,3,4 and 5 are randomly placed in five addressed envelopes, one letter in each envelope.

I’m trying to find the probability of:

  1. Exactly three letters go in the correct envelopes.
  2. Exactly two letters go in the correct envelopes
  3. No letters go in the correct envelopes

Here is my approach:

So there is clearly a total of 5! distinct ways of arranging the letters.

  1. If exactly three letters go in the correct envelopes, then there are $ 5 \choose 3$ ways of choosing the positions for the three correct envelopes, and for the remaining two letters, there are 2! ways of organizing them. Thus, probability = $ \frac{{5 \choose 3} * 2!}{5!}$ .

  2. If exactly two letters go in the correct envelopes, then there are $ 5 \choose 2$ ways of choosing the positions for the two correct envelopes, and for the remaining three letters, there are 3! ways of organizing them. Thus, probability = $ \frac{{5 \choose 2} * 3!}{5!}$ .

  3. I’m not really sure how to approach this problem.

Any input would be great.

Mojave screen saver starts randomly

I have a new Mojave (10.14.1) installation on an iMac (Retina 5K, 27-inch, 2017). My screen saver is set to start after 5 minutes. I have a hot corner defined to start the screen saver.

I have noticed that periodically, the screen saver just starts up out of the blue. Typically this happens while I am scrolling with the magic mouse. I am definitely not hitting the hot corner.

Any suggestions for why this is happening and how to stop it?

External (Thunderbolt 2) drive keeps changing to read-only randomly

I’m running macOS 10.14.2 on a 2018 Mac mini. I have an Akitio enclosure, connected to the Mac via a Thunderbolt 2<->3 adapter. At random, one of the drives in the enclosure becomes read-only (the other drives are fine). I’m not really sure where to begin troubleshooting this. This also happened on my 2013 Mac Pro running High Sierra.

Pointer Randomly Jumps Ahead in Ubuntu 18.04 (Razer Blade 2017)

So I recently upgraded from Ubuntu 16.04 to Ubuntu 18.04, and my mouse pointer has been acting weird. When I use an external mouse, the pointer works relatively smoothly, but when I use my synaptic touchpad built into my Razer Blade 2017, it is slightly laggy and jumps ahead, up to an inch, in the direction my pointer is moving to. When I restart my laptop, the jumpiness is minimised. However, when I suspend my computer and resume after a fresh restart, the jumpiness is increased. Furthermore, the more programs I run at once, the jumpier the pointer is. The pointer was never a problem in 16.04.

This is my xinput list output:

$   xinput list ⎡ Virtual core pointer                      id=2    [master pointer  (3)] ⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)] ⎜   ↳ xwayland-pointer:15                       id=6    [slave  pointer  (2)] ⎜   ↳ xwayland-relative-pointer:15              id=7    [slave  pointer  (2)] ⎣ Virtual core keyboard                     id=3    [master keyboard (2)]     ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]     ↳ xwayland-keyboard:15 

If I recall the xinput list from ubntu 16.04 correctly, an element with the words “synaptics” and “touchpad” should be displayed within the “Virtual core pointer” section. Also, the list doesn’t change when my external mouse is connected.

When I try the synclient command, I get this:

$   synclient -l Couldn't find synaptics properties. No synaptics driver loaded? 

In 16.04 this command worked and displayed the setting values.

I tried this:

$   sudo apt install xserver-xorg-input-synaptics 

However, it didn’t fix anything.

I also tried this command suggested by a person with the exact same laptop and LTS version as me:

$   sudo apt install libinput-tools 

There was no noticeable improvements. I have also tried other methods, but they also didn’t fix the problem.

It might be worth mentioning that when I was upgrading to 18.04, it failed/crashed mid installation. I used these steps to finish upgrading to 18.04.

Google Timeline randomly working

I have a new Android phone and Google Maps Timeline isn’t working how it should. Since getting the phone a week ago, it has accurately tracked me twice (which shows it can). Sometimes it knows where I started a journey and knows where I ended it and just plots a straight line between the two points, even though I’ve driven miles away from that line inbetween starting and ending my journey. Other times it plots random zigzag lines in the general area I’ve been but doesn’t show the roads I’ve been on. Today there’s nothing on it at all, despite me driving to work and going for a walk. While I was walking today, I had Google Maps on the screen and the blue dot was following my path accurately. It just didn’t add it to the timeline. Any ideas?

Chrome recently randomly downloaded a file (20bytes long) when I clicked on a normal link on reddit(is this a virus)

I clicked on link and chrome randomly downloaded a file and it went to my downloads folder .. I didn’t click on it I just deleted it.

I started searching for any random like files and came across something called “Enlightened” that has an magnifying glass as the icon, said it was created right around the time the file was downloaded, and it is a .lnk file… I am unsure of what to do with this, how can I investigate it further?

Validate movement of a randomly moving object

I am to simulate a robot moving around a 9×9 grid, the first robot starts at (0,0) and another starts at (9,9). The program is to generate random moves until they both land on the same spot.

The issue is that there is supposed to be a validation to make sure that the robot doesn’t move off grid. So they should never land on coordinates like (-1,3) or (10,2). The program I wrote is below, I’m just trying to get the validation part to work but I’m not sure how to implement this problem using ONLY the methods I’m given… To clarify, I can only have the methods as written below but the methods themselves can be changed.

I thought about having the robot move first, land on an illegal coordinate but have the validateNextMove() return false and then just have it move in the reverse direction, but that’s not what the assignment wants. The program needs to “look ahead and know”.

So I’m thinking maybe I should have a method variable to store the next move and validate those coordinates, but I’m not sure how to do that without breaking the assignments rule of only having certain methods and variables.

Other more elegant solutions are welcome!


package assignment1;  public class Robot {      public static void main(String[] args) {         // TODO Auto-generated method stub      }      int x;     int y;     public static final int DOWN = 1;     public static final int LEFT = 2;     public static final int LEFT_DOWN_CORNER = 3;     public static final int LEFT_UP_CORNER = 4;     public static final int RIGHT = 5;     public static final int RIGHT_DOWN_CORNER = 6;     public static final int RIGHT_UP_CORNER = 7;     public static final int UP = 8;       public Robot(int x, int y) {         this.x = x;         this.y = y;     }      public int getX() {         return x;     }     public void setX(int x) {         this.x = x;     }     public int getY() {         return y;     }     public void setY(int y) {         this.y = y;     }   }

package assignment1;  import java.util.ArrayList;  public class MovingRobot extends Robot {      public static void main(String[] args) {          MovingRobot r1 = new MovingRobot(0, 0);         MovingRobot r2 = new MovingRobot(9, 9);          r1.move();         System.out.println(r1.x + " " + r1.y);         r1.move();         System.out.println(r1.x + " " + r1.y);         r1.move();         System.out.println(r1.x + " " + r1.y);         r1.move();         System.out.println(r1.x + " " + r1.y);         r1.move();         System.out.println(r1.x + " " + r1.y);         r1.move();         System.out.println(r1.x + " " + r1.y);         r1.move();         System.out.println(r1.x + " " + r1.y);         r1.move();         System.out.println(r1.x + " " + r1.y);         /*          * while (sameSlot(r1, r2) == false) { r1.move(); r2.move(); }          */     }      ArrayList<Integer> moves;     int nextMove;      public boolean validateNextMove() {         if (x < 0 || x > 9 || y < 0 || y > 9) {             return false;         }          else             return true;      }      public MovingRobot(int x, int y) {         super(x, y);     }      public int generateNextMove() {         return (int) (Math.random() * 8 + 1);     }      public static boolean sameSlot(Robot r1, Robot r2) {         return (r1.x == r2.x && r1.y == r2.y);     }      public void move() {         switch (nextMove = generateNextMove()) {          case 1:              x = x - 1;             System.out.println(nextMove);             //LEFT             break;         case 2:             x = x - 1;             y = y + 1;             System.out.println(nextMove);             //LEFT DOWN             break;         case 3:             x = x - 1;             y = y - 1;             System.out.println(nextMove);             //LEFT UP             break;         case 4:             x = x + 1;              System.out.println(nextMove);             break;             //RIGHT         case 5:             x = x + 1;             y = y + 1;             System.out.println(nextMove);             break;             // Right down         case 6:             x = x + 1;             y = y - 1;             System.out.println(nextMove);             break;             // right up         case 7:              y = y -1;             System.out.println(nextMove);             break;             // up         case 8:             y = y + 1;             System.out.println(nextMove);             break;             //DOWN         }      }  } 

Pointer to linkedlist randomly changing

For one of my school assignments I have to make my own stack library and a POSTFIX calculator. The calculator has to make use of the stack library and do some calculations.

I am pushing two different numbers to my stack. Number 6 and 3. The header should point to the most recently added node (LIFO). So when 6 is added:


When 3 is being added:

HEADER -> 3 -> 6 -> NULL

When I print the value of my header after adding ‘6’ it’s good. It’s printing 6. However, when I print the value of my header BEFORE adding ‘3’ it’s printing ‘3’. When it still should print 6.

So a summary of my problem: When adding another node to my linkedlist, the header suddenly points to the newest node before even changing it.

You may understand me better with some code and debugging results.

int mystack_push(int handle, void* obj) { if (obj == NULL ||  handle <= 0) {     return -1; } pStackMeta_t currentMeta = gStackList; while (currentMeta != NULL) {     if (currentMeta->handle == handle)     {         pStackObject_t newObject = malloc(sizeof(StackObject_t));         newObject->obj = obj;         printf("%s%d\n", "Wanting to push int to stack:  ", *(int*)obj);          //First node         if (currentMeta->stack == NULL)         {             currentMeta->stack = newObject;             currentMeta->stack->next = NULL;             printf("%s%d\n", " FIRST Curentmeta->stack pointing to  ", *(int*)currentMeta->stack->obj);             return 0;         }         else         {             printf("%s%d\n", "NOT FIRST Currentmeta->stack pointing to ", *(int*)currentMeta->stack->obj);             newObject->next = currentMeta->stack;             currentMeta->stack = newObject;             printf("%s%d\n", "Currentmeta->stack ", *(int*)currentMeta->stack->obj);             printf("%s%d\n", "Currentmeta->stack->next ", *(int*)currentMeta->stack->next->obj);             printf("%s%d\n", "Succesful pushed int to stack:  ", *(int*)currentMeta->stack->obj);             return 0;         }     }     currentMeta = currentMeta->next; } DBG_PRINTF("handle: %d\n, obj: %p\n", handle, obj); return -1; } 


Created stack with handle: 1 and objsize 4 bytes Wanting to push int to stack:  6 FIRST Curentmeta->stack pointing to  6 Wanting to push int to stack:  3 NOT FIRST Currentmeta->stack pointing to 3 Currentmeta->stack 3 Currentmeta->stack->next 3 Succesful pushed int to stack:  3