comp runs like its stuck in a windows update

New at this and not sure how to ask this accurately/succinctly. Occasionally my machine runs like an old windows box stuck in an update. The mouse hangs, doesn’t respond to movement or clicks, or the pointer disappears. Is there a way I can monitor activity to see what’s hogging resources? Is that even the right approach? running Ubuntu 18.04.3 LTS machine is a Dell SFF from about 2013. i5 2400 quad core 4gb ram 250gb hdd

systemctl Service that runs an executable that never returns

I’m having some trouble figuring out how the services work on CentOS. Right now I have the following service file:

[Unit] Description=SelfTester After=network.target  [Service] Type=simple ExecStart=/usr/bin/selftester  [Install] WantedBy=multi-user.target 

This will launch a script that calls an executable that will never return:

#!/bin/bash export LD_LIBRARY_PATH=SOMEPATH && cd SOMEOTHERPATH && ./EXECUTABLE 

The executable never returns. When I launch the service, it runs for a while but then exits due to timeout:

Job for selftester.service failed because a timeout was exceeded. See "systemctl status selftester.service" and "journalctl -xe" for details. 

Thanks inadvance

Why say that breadth-first search runs in time $O(|V|+|E|)$?

It’s often stated (e.g., in Wikipedia) that the running time of breadth-first search (BFS) on a graph $ G=(V,E)$ is $ O(|V|+|E|)$ . However, any connected graph has $ |V|\leq |E|+1$ and, even in a non-connected graph, BFS will never look at a vertex outside the component that contains the start vertex. That component contains at most $ |E|$  edges, so it contains at most $ |E|+1$ vertices, and those are the only ones that the algorithm will visit.

This means that $ |V|+|E|\leq 2|E|+1$ , so why don’t we say that the running time is just $ O(|E|)$ ?

This came up in comments on a question about the running time of Disjkstra’s algorithm.

New laptop runs hot and has low battery life

my laptop runs super hot on ubuntu 18.4, all iam doing is some simple coding and web browsing (not even watching movies). My laptop always gets hot as if iam gaming on it on windows (duel boot).however the fans do kick in, but it drains my battery life like crazy.

i read through some posts on the internet and on google, that it might be related to the drivers installed, i have installed some programs to monitor the laptops thermals and lower them, but it hasnt helped much.

Simple python scheduled tasks script that runs once daily

I want to execute a python script daily and thereby want to schedules task as follows.

The idea is that the script will run once daily, and the script will then decide what tasks to be done today.

The reason is that I can’t use cron or windows scheduled task on my environment.

from datetime import datetime import os  from sheduled_tasks import daily_task1, daily_task2, weekly_task, monthly_tasks  tasks = {} # or open from saved pickel file  schedule = {     1: [daily_task1, daily_task2],     7: [weekly_task],     30: [monthly_tasks], }  for delta, tasks in schedule['week']:     for task in tasks:         name = task.__name__         if ((task not in tasks) or             (datetime.now() - tasks[name]) >= delta):             task()             tasks[task.name] = datetime.now().replace(hour=6)  # pickle tasks 

Node program runs in Terminal, but not as a service or on command “do shell script” from AppleScript

I have a call (mercury-parser via Yarn) that converts Web pages to lines of structured text. It runs in node on 3.5 GHz, 6-Core Mac Pro (MacPro6,1) with 16GB RAM and D700 GPUs, running macOS 10.14.5 very well, but I’m struggling to run it as a service / on demand without opening terminal app and typing.

I would much prefer it to run within an AppleScript. Here is the line of code:

/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source 

If I run it in Terminal (using either /bin/bash or /bin/sh), I get the proper result: fourteen lines of structured text from the Web page.

If I run it in a shell script, starting with either “#!/bin/sh” or “#!/bin/bash”, I get: env: node: No such file or directory If I run it in Script Editor as: do shell script “/Users/me/.yarn/bin/mercury-parser https://postlight.com/trackchanges/mercury-goes-open-source” I get: env: node: No such file or directory

Here are both my .profile and my .bash_profile texts:

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$  PATH"  export PATH="$  HOME/.yarn/bin:$  HOME/.config/yarn/global/node_modules/.bin:$  PATH"  [[ -s $  HOME/.nvm/nvm.sh ]] && . $  HOME/.nvm/nvm.sh  # This loads NVM  source ~/.nvm/nvm.sh  export NVM_DIR="$  HOME/.nvm" [ -s "$  NVM_DIR/nvm.sh" ] && . "$  NVM_DIR/nvm.sh" # This loads nvm 

What do I have to do to get the code to run outside of Terminal?

jquery.done runs before when – deferred promise

I have placed a SEWP in an editform and the code is supposed to do the following: check if the logged in user is site administrator and web administrator – if not then hide a specific field. These two checks runs async and the method that does the hiding should not execute until it is checked that the user is siteadmin and webadmin.

$  (document).ready(function () { SP.SOD.executeFunc('sp.js', 'SP.ClientContext', readyFunction); });  var isSiteAdmin = false; var isWebAdmin = false; var context; var web;  function readyFunction() {    $  .when(isUserSiteAdmin(), isUserWebAdmin()).done(hideSiteManagerField()) }  function isUserSiteAdmin() {   var currentSite = _spPageContextInfo.siteAbsoluteUrl;   var currentUserID = _spPageContextInfo.userId;    return $  .ajax({     url: currentSite + "/_api/web/siteUsers?$  select=Id,IsSiteAdmin&$  filter=id eq " + currentUserID,     method: "GET",     dataType: "JSON",     headers: { "accept": "application/json; odata=verbose" },     success: function (data) {         $  .each(data.d.results, function (index, item1) {             isSiteAdmin = item1.IsSiteAdmin;             console.log("User is admin on site: " + item1.IsSiteAdmin)         });     },     error: function (error) {         alert(JSON.stringify(error));     } }) }  //If a user is admin he/she will have manageWeb permissions. function isUserWebAdmin() {   var deferred = $  .Deferred(function () {     context = new SP.ClientContext.get_current();     web = context.get_web();     context.load(web, 'EffectiveBasePermissions');     context.executeQueryAsync(onSuccess, onFailure);      function onSuccess() {         if (web.get_effectiveBasePermissions().has(SP.PermissionKind.manageWeb)) {             isWebAdmin = true;             console.log("User is admin on web: true");             deferred.resolve();         }     }      function onFailure(sender, args) {         alert('failed: ' + args.get_message() + 'n' + args.get_stackTrace());     } });  return deferred.promise(); }  function hideSiteManagerField() { //hide field Site Manager if permissions != full access or administator on site collection if (!isSiteAdmin && !isWebAdmin) {     $  ('div[title="SiteManager"]').parents().eq(2).hide()   } } 

When I debug I see that isSiteAdmin and isWebAdmin always returns false inside the isUserWebAdmin method, and some time later it runs the content inside success and gives me the console.log message. The problem with this is of course that the field has already been hidden, and it doesn’t wait until I get the result from my two other methods.

Can anyone see what is wrong here? I have tried linking to newer jQuery versions to see if that helped, but nothing so far. I had an understanding that one can return $ .ajax directly as it is deferred compatible and that the internal jQuery code will call resolve for me. Is this not the case?

How do I import database data to a new host that runs a newer version of MySQL without ssh access?

My current host for an old website has only MySQL 5.0 (serverVersion=10.2.12-MariaDB-log).

I want to move this website to a host that has either 5.5 or 5.6 or 5.7 MySQL (depending which server I move to).

But the only instructions I can find for updating database data from 5.0 to 5.6/5.7 are run from the command line, requiring ssh access that I do not have.
For example these are the best, clearest instructions I have found, but I cannot use them because, as AFAIK, I do not have ssh, nor do no fully understand the references ([he?] makes. (e.g. he says --no faults “for simplicity” but even if I had ssh, I don’t know if I should also use that flag or others.)

  • http://mysqlserverteam.com/upgrading-directly-from-mysql-5-0-to-5-7-using-an-in-place-upgrade/
  • https://mysqlserverteam.com/upgrading-directly-from-mysql-5-0-to-5-6-with-mysqldump/

I usually use MySQL Workbench to connect to remote databases, but when I connect to that old host via MySQL Workbench, a message pops up saying [Workbench] is not compatible with 5.0.
So for that host, I have either used MySQL Workbench anyway to make a backup (which probably probably means the backup is no good), or I use the host’s web-based tool (not my preference, but obviously better). I have also recently installed HeidiSQL because it seems to be compatible with 5.0 (I does not give a warning/error message anyway). So I have started making backups and minor data changes on that host using HeidiSQL.

The only reason I have continued to use the host running MySQL 5.0 is because I haven’t yet found instructions on how to migrate data for websites on that server, whether it’s via a hosting provider’s online database tool, MySQL Workbench, or HeidiSQL !
Everything I see is for for doing step-wise data upgrades using the command line, and/or for upgrading the database server itself.

I need a way to upgrade the data from 5.0 to 5.6 or 5.0 to 5.7, probably in 1 step, using a gui database connection tool, or some other independent method. I will not have access to any mySQL servers other than the server I’m migrating away from (5.0), and the server I am migrating to (5.5 or 5.6 or 5.7).

Does anyone know how to do this?

EDIT:

  • I usually choose “Export” from the gui to export and choose all tables, when I do a database backup. I assume this is the same as a “database dump” that I see referenced everywhere.
    Is this correct? If not, how do I generate a proper dump file?
  • What export “settings” should I use when the goal is to upgrade and migrate?
  • I also see some references to users table. Do I need to perform any other exports in order to fully transfer and upgrade my database to a new server with a more recent version?

How do I import database data to a new host that runs a newer version of MySQL without ssh access?

My current host for an old website has only MySQL 5.0 (serverVersion=10.2.12-MariaDB-log).

I want to move this website to a host that has either 5.5 or 5.6 or 5.7 MySQL (depending which server I move to).

But the only instructions I can find for updating database data from 5.0 to 5.6/5.7 are run from the command line, requiring ssh access that I do not have.
For example these are the best, clearest instructions I have found, but I cannot use them because, as AFAIK, I do not have ssh, nor do no fully understand the references ([he?] makes. (e.g. he says --no faults “for simplicity” but even if I had ssh, I don’t know if I should also use that flag or others.)

  • http://mysqlserverteam.com/upgrading-directly-from-mysql-5-0-to-5-7-using-an-in-place-upgrade/
  • https://mysqlserverteam.com/upgrading-directly-from-mysql-5-0-to-5-6-with-mysqldump/

I usually use MySQL Workbench to connect to remote databases, but when I connect to that old host via MySQL Workbench, a message pops up saying [Workbench] is not compatible with 5.0.
So for that host, I have either used MySQL Workbench anyway to make a backup (which probably probably means the backup is no good), or I use the host’s web-based tool (not my preference, but obviously better). I have also recently installed HeidiSQL because it seems to be compatible with 5.0 (I does not give a warning/error message anyway). So I have started making backups and minor data changes on that host using HeidiSQL.

The only reason I have continued to use the host running MySQL 5.0 is because I haven’t yet found instructions on how to migrate data for websites on that server, whether it’s via a hosting provider’s online database tool, MySQL Workbench, or HeidiSQL !
Everything I see is for for doing step-wise data upgrades using the command line, and/or for upgrading the database server itself.

I need a way to upgrade the data from 5.0 to 5.6 or 5.0 to 5.7, probably in 1 step, using a gui database connection tool, or some other independent method. I will not have access to any mySQL servers other than the server I’m migrating away from (5.0), and the server I am migrating to (5.5 or 5.6 or 5.7).

Does anyone know how to do this?

EDIT:

  • I usually choose “Export” from the gui to export and choose all tables, when I do a database backup. I assume this is the same as a “database dump” that I see referenced everywhere.
    Is this correct? If not, how do I generate a proper dump file?
  • What export “settings” should I use when the goal is to upgrade and migrate?
  • I also see some references to users table. Do I need to perform any other exports in order to fully transfer and upgrade my database to a new server with a more recent version?