J53Go


# MANJARO BLOG UPDATED/CONTINUED (quick notes)
----------------------------------------------

  http://nelus.tpt.edu.ee/txt/i3M9o-manjaro.txt

Programming tools evolution

  http://nelus.tpt.edu.ee/big/Flowgorithm.exe

  0/1                            http://www.logisim.altervista.org/
  assembler                      flatassembler
  command -key --longKey arg1 ..
  templates/regular expressions
  moninor                        do it yourself
  sh   1973?   powershell 1999?  out-of-the-box / aur
  awk  1979?                     gawk, out-of-the-box
  perl 1983?                     5.x, out-of-the-box
  C    1972?
  C++  1983?   C# 2001?          mono
  python/php   python/php        thonny / lamp

  systemctl enable sshd
  systemctl start sshd

Within the Manjaro guest VM all you need are the extramodules for each kernel you have installed.

  https://forum.manjaro.org/t
    /help-with-virtualbox-6-installing-guest-additions/72996

Install linux419-virtualbox-guest-modules. Memorize which modules have to be loaded (use modprobe)

https://ephos.github.io/posts/2018-9-17-Pwsh-ArchLinux

https://www.archlinux.org/packages/extra/x86_64/jdk-openjdk/

  jdk-openjdk 11.0.3.u4-1

SimulIDE

  Checked out revision 493.

probe.h

  class MAINMODULE_EXPORT Probe : public Component, public eElement
  {
      Q_OBJECT
>     Q_PROPERTY( probeColor Color READ color WRITE setColor DESIGNABLE true USER true )
      Q_PROPERTY( bool Show_volt READ showVal  WRITE setShowVal DESIGNABLE true USER true )
>     Q_ENUMS( probeColor )
      Q_PROPERTY( int PlotterCh  READ plotter  WRITE setPlotter )

      public:
          Probe( QObject* parent, QString type, QString id );
          ~Probe();

  static Component* construct(QObject* parent, QString type, QString id);
  static LibraryItem* libraryItem();

>         enum probeColor {
>             yellow = 0,
>             red,
>             green,
>             blue,
>             orange,
>             purple
>         };

>         void setColor( probeColor color ) { m_probeColor = color; }
>         probeColor color() { return m_probeColor; }

          void setVolt( double volt );
  ..

      protected:
>         probeColor m_probeColor;
          void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
  ..

probe.cpp

  void Probe::paint( QPainter *p,
                     const QStyleOptionGraphicsItem *option,
                     QWidget *widget )
  {
    Component::paint( p, option, widget );

>   QColor color = QColor( 255, 255, 0 ); // Default = yellow

>   if     ( m_probeColor == red )    color = QColor( 255,  0, 0 );
>   else if( m_probeColor == green )  color = QColor( 0, 255, 0 );
>   else if( m_probeColor == blue )   color = QColor( 0, 0, 255 );
>   else if( m_probeColor == orange ) color = QColor( 255,  192, 0 );
>   else if( m_probeColor == purple ) color = QColor( 255,  0,  192 );

    if( m_plotterLine > 0 )           p->setBrush( m_plotterColor );
>   else if ( m_voltIn > m_voltTrig)  p->setBrush( color );
    else                              p->setBrush( QColor( 230, 230, 255 ) );

Install also:

  + sudo pacman -Syu qt5-script qt5-tools

Build now:

  qmake
  time make -j4    ( ~15min )

---------------------

LAMP

  pacman -Syu apache mysql php php-apache tk
  systemctl enable httpd
  systemctl start httpd
  mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
  systemctl enable mysqld
  systemctl start mysqld

  systemctl list-units --type service

  cat -n /etc/httpd/conf/httpd.conf

    66  #LoadModule mpm_event_module modules/mod_mpm_event.so
    67  LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
    68  #LoadModule mpm_worker_module modules/mod_mpm_worker.so
    69  LoadModule php7_module modules/libphp7.so
    ..
   497  AddHandler php7-script php
   498  Include conf/extra/php7_module.conf

  cat -n /srv/http/pi.php
     1  <?php
     2      phpinfo();
     3  ?>

ca.php

  // https://stackoverflow.com/questions/44968757
  //       /only-php-code-calculator-with-clickable-buttons-as-input

  <!DOCTYPE html>
  <html lang="en">
  <head>
    <meta http-equiv="Content-Type"
          content="text/html; charset=ISO-8859-1">
    <title>Basic PHP Calculator</title>
  </head>
  <body>
  <?php
  //var_export($_POST);
  //echo "<br>";
  $buttons=[1,2,3,'+',4,5,6,'-',7,8,9,'*','C',0,'.','/','='];
  $pressed='';
    if(isset($_POST['pressed']) && in_array($_POST['pressed'],$buttons)){
        $pressed=$_POST['pressed'];
  }
  $stored='';
    if(isset($_POST['stored']) &&
       preg_match('~^(?:[\d.]+[*/+-]?)+$~',$_POST['stored'],$out)){
        $stored=$out[0];
  //echo "<br>~~~~~~~~~~" . $stored . "~~~~~~~~~<br>"
  }
  $display=$stored.$pressed;
  //echo "$pressed & $stored & $display<br>";
  if($pressed=='C'){
      $display='';
  }elseif($pressed=='=' &&
          preg_match('~^\d*\.?\d+(?:[*/+-]\d*\.?\d+)*$~',$stored)){
      $display.=eval("return $stored;");
  }

  echo "<form action=\"\" method=\"POST\">";
      echo "<table style=\"width:300px;border:solid thick black;\">";
          echo "<tr>";
              echo "<td colspan=\"4\">$display</td>";
          echo "</tr>";
          foreach(array_chunk($buttons,4) as $chunk){
              echo "<tr>";
                  foreach($chunk as $button){
                      echo "<td",
                           (sizeof($chunk)!=4?" colspan=\"4\"":""),
                           "><button name=\"pressed\" value=\"$button\">".
                           $button."</button></td>";
                  }
              echo "</tr>";
          }
      echo "</table>";
      echo "<input type=\"hidden\" name=\"stored\" value=\"$display\">";
  echo "</form>";
  ?>
  </body>
  </html>

-------------------

Python

  http://nelus.tpt.edu.ee/txt/iB15j-notes4nov1.txt

  sudo python3 -m pip install --upgrade pip
  sudo python3 -m pip install --upgrade thonny
  sudo python3 -m pip install --upgrade vpython
  thonny

------------

# LINKS

  1. https://ephos.github.io/posts/2018-9-17-Pwsh-ArchLinux

  2. https://stromasys.atlassian.net/wiki/spaces/KBP/pages/15138858
       /Cannot+get+correct+line+drawing+on+Linux+UNIX+with+Putty

  3. http://alexander.holbreich.org/systemd-services/

  4. https://stackoverflow.com/questions/44968757
       /only-php-code-calculator-with-clickable-buttons-as-input

  5. https://putty.org.ru/articles/netstat-linux-examples.html

========================================================================

# ANNEX A. UBUNTU 19.04 DISCO

  sudo apt install python3-pip python3-tk

  sudo python3 -m pip install --upgrade pip
  sudo python3 -m pip install --upgrade thonny
  sudo python3 -m pip install --upgrade vpython
  thonny

test0.py

  from vpython import *
  sphere()

-------

QT5

  # apt-get install arduino gpsim* libqt5svg5* \
          glib2.0-dev libelf-dev git qt5-default
  # apt-get install libqt5multimedia5 qtmultimedia5-dev \
          libqt5multimedia5-plugins libqt5multimediawidgets5
  # apt-get install libqt5serialport5 libqt5serialport5-dev
  # apt-get install qtscript5-dev
  # apt-get install qttools5-dev-tools

  $ cd ~
  $ svn checkout https://svn.code.sf.net/p/simulide/svnrepo/trunk simulide
  $ cd ~/simulide/build_XX
  $ qmake -qt=qt5
  $ make -j4      # ~10 min

  $ cd ~/simulide/build_XX/release/SimulIDE_0.3.11/bin/
  $ ./simulide
