Ubuntu 16.04 shuts down on it’s own

I have the following problem: I have a 32-Bit Pc with an AMD-Athlon X2 processor. It’s harddisk has two partitions. One of them has Windows 7 and the other one has Ubuntu 16.04. The Windows 7 partition works fine. However, the Ubuntu partition ramdonly shots down itself since a few days ago. The last thing I did before the problems began was install chromium and IG:DM (Instagram Direct Messenger) and resolve a critical problem with Firefox. Afterwards, it shotsdown itself even while I work only with a terminal and/or a ZSNES emulator. Using fcsk did not solved the problem. I searched into the log files and I didn’t find a clue. The only thing couldn’t test was if upgrading the kernel from a 4.x.x version to a 5.0.8 version would solve the problem, because Ubuntu shots down itself even while compiling the kernel. Also, I don’t know if backing up my Firefox configuration and then uninstalling Firefox and Chromium and re-installing Firefox is the solution. I cannot say the problem is the PC’s fan because if it were for that, Windows 7 also would shotdown itself.

Also, I don’t know if the following is related: in Windows 7 ramdomly my Internet Connection is interrupted once in a day since my parents changed the Internet Service provider and it’s solved using the Window’s Problem Solver.

Given the description above, do you have any ideas of what could cause the Ubuntu shotdown? Thanks in advance.

Multiprocessing slowing script down

I am writing a script to help me analyze and get statistics for poker hands. After a lot of research I was able to work with bit manipulation and get my statistics very efficiently for one hand. I want, thought, to be able to run it for several times (millions) and I don’t know how to to this efficiently. I tried using multiprocess map (probably wrong) and it slowed the script down significantly.

This is what I had originally:

def get_best_combination(hand, board):   candidate_hand = []  best_score = 9999   best_rank = -1  for h in itertools.combinations(hand, 2):   for b in itertools.combinations(board,3):    candidate_hand = h + b    score = eval_hand(candidate_hand)    if (score < best_score):     best_score = score     best_rank = hand_rank(best_score)  return best_score, best_rank 

What the function is doing: – It combines 2 cards from hand = [Card1, Card2, Card3, Card4, Card5] and 3 cards from board = [Card1, Card2, Card3, Card4, Card5] – Evaluates the combination and assign a score for it – Stores and returns the best score and best rank for all possible combinations between hand and board (total of 100 combinations).

This runs really fast for (1 hand, 1 board) (0.02s) but I want to call this function for a lot of different hands and a lot of different boards for every hand. Tried to implement multiprocessing for this but for my surprise it slowed down to almost 40s.

This is what I tried:

def get_best_combination(hand, board):   candidate_hand = []  best_score = 9999   best_rank = -1  p = Pool()  for h in itertools.combinations(hand, 2):   for b in itertools.combinations(board,3):     candidate_hand.append(h+b)  results = p.map(eval_hand, candidate_hand)  for score in results:   if (score < best_score):    best_score = score    best_rank = hand_rank(best_score)  return best_score, best_rank 

What is wrong with it? Whys is it slowing the script down instead of speeding it up?


How to scale down Princes of the Apocalypse for a 3-adventurer party?

I recently just finished DMing Lost Mines of Phandelver with a 3 player party and it went great. Just removed a couple of enemies here and there and it was smooth. I ordered PotA and have started reading the handbook and I realised that the higher level encounters have extremely tough enemies!

I just don’t want them to get to the Prophets or the Princes of Elemental Evil and getting absolutely crushed. I can remove enemies from encounters but:

To what point will I have to scale down the encounters so I don’t get a TPK after 10 minutes of starting the adventure? How do I scale down a very powerful enemy so 3 players can handle it?

Related: Is it possible to play the D&D Starter Set with fewer than recommended players?

Drupal 8 Webform Issue with Drop Down and Key not Equaling Value

I have written a custom handler in Drupal 8 D8 that grabs submitted data from a webform and reformats it and sends it to a JSON webservice. That is all working perfectly. My issue is that the submitted data from 2 of the dropdowns is an integer (the key of the dropdown), rather than the value of the drop down, like it was when in D7 I called:

$ components = $ node->webform[‘components’];

which gave me the value of the data from the dropdowns. Now I am calling:

$ values = $ webform_submission->getData();

Which gives me the submission data. However, what I need to do is translate the number to the value. For example:

for a component (or element) drop down called ‘numbers’ the options are: 1|One 2|Two 3|Three

When I grab the submission data I get “1” but I want to send the word “One”.

How do I load the dropdown element to translate the value ‘1’ to the word “One” in Drupal 8?


Chitika Is Shutting Down Effectively immediately

Dear Publisher,

After 15+ years in business and millions of publisher relationships, Chitika is hereby shutting down and closing its business. Our sincere thanks to all our publishers with whom we have enjoyed wonderful relationships over the years. We wish you the best of luck and success as you continue to grow your traffic and revenue.



EC2 Instance restarted through AWS Console, started, stopped: site still down. SSH still works

Not sure what else to say, have little experience with EC2, but today I uploaded a new .crt ssl certificate to a website on EC2 ia FileZilla.

Then I logged into the AWS Console, restarted the EC2 Instance, tried starting and stopping the instance.

All says online, running, green dot, but my site is inaccessible, yet SSH still lets me log in with FileZilla.

Anything obvious I can do?