Mathematica interface using Windows Subsystem for Linux

I would like to build the Mathematica interface following the instructions in section 4 of the following article https://arxiv.org/pdf/1802.02720.pdf

When I run the command line make mathematica To build the interface I get the following errors:

/bin/sh: 1: math: not found 
/bin/sh: 1: math: not found
/wscc -O3  -b64 -Wl,thermal_funcs.o,zeta.o,derivatives.o -lgsl -lgslcblas -I -I./ math.tm math.c -o math.exe
make: /wscc: Command not found
makefile:31: recipe for target 'math.exe' failed
make: *** (math.exe) Error 127 

I assumed I couldn't find the wscc command because I installed Mathematica on Windows. I use Windows Subsystem for Linux (WSL) to run those command lines.

Is there a way to build this Mathematica interface with Mathematica installed on Windows and using WSL?

graphical interface – How to make a Dynamic component panel with a GridLayout that Accommodate as Checkboxes are activated? (Java GUI)

In a Java project that I carry out I have several JCheckbox which when selected show a panel with a text field.

The problem is that I would like them to be accommodated as they are selected and user-friendly.

enter the image description here

Code where panels are shown and hidden with the text field

private void chkNombreStateChanged(javax.swing.event.ChangeEvent evt) {                                       
    // TODO add your handling code here:
    if (chkNombre.isSelected()) {
        pnlFilNombre.setVisible(true);
    } else {
        pnlFilNombre.setVisible(false);
    }
    pnlFilText.validate();
    pnlFilText.repaint();
}     

Me GridLayout has the following properties:

  • Columns: 1.
  • Rows: 3.
  • Vertical groove: 5.
  • Horizontal groove: 5.

Fortran-Python interface – Software Engineering Stack Exchange

Disclaimers:

  1. This question is republished from SO at the suggestion of the SO user to put it here since there is no specific code in question.
  2. This question is a subset of my broader topic of Fortran modernization.
  3. There are already helpful versions of this question (1, 2, 3) and blog posts, and while they are helpful, I'm curious what the best practice is now (some of those posts are 5-10 years old) and the context of my situation, which is why it is asked in a similar way.

Our current code base is largely Fortran (400K LOC, mostly F90 / some F77 / maybe some newer versions), scattered among some 10 separate (organizationally) development teams in (somewhat) separate modules.

We are exploring the best practice idea of ‚Äč‚Äčtaking one of those modules and writing it in a faster development language (Python), and wrapping and extending bottlenecks in Fortran.

However, since the module is currently fully in Fortran and interacts with other Fortran modules and a main Fortran loop, we must keep the appearance or interface of the module with the main Fortran loop the same.

So the incremental change approach for this Fortran module, and other Fortran modules of similar architecture, is to keep the interfaces the same and change the internal parts.

In other words, the shell or signature of the Fortran subroutines or functions would not change, but the functionality within the function would be changed.

This functionality within the function is what we want to rewrite in Python.

From the online discussions, and from my intuition, whatever is worth it seems inadvisable to embed Python in this way, and instead do the opposite: extend Python with Fortran (for bottlenecks as needed).

However, this embedded Python approach seems like the only logical, smaller, and more atomic step forward to isolate changes to the larger Fortran system.

There seem to be a few options for this Python embedding issue.

The most stable and future proof way is through ISO_C_BINDING and using the Python C API (in theory …).

There are also stable solutions through Cython and perhaps ctypes that are reliable and well maintained.

There are more dependency-dependent approaches, such as cffi and forpy, that introduce complexity for the benefit of not writing the extra C interface code.

We are also aware of simple Python scripting calls from Fortran, but these seem to be too heavy on write / read to disk; We would really like to do minimal read / write to disk and keep the array passing in memory (hopefully only the pointer locations were passed, not the array copies).

Another restriction is that this Fortran-Python interface should be able to handle the most common data types and structures, including multi-dimensional arrays, or at least have a way to decompose complex custom data types into some collection of simpler data types. , like strings and arrays.

Given the description above, do you have any advice on what are the best practices currently available for calling Python (or other similar flexible language) from Fortran (for example using 2003 or 2008 versions; I'm not sure if all the features from 2018 are implemented in our Intel Fortran compiler)?

networks: route traffic from the wlan0 interface through the Wireguard wg0 interface

I built a Wireguard client on my Raspberry Pi based on this tutorial: https://blog.stigok.com/2019/03/26/raspberry-pi-wifi-ap-wireguard-port-53.html

My interfaces are:

eth0  (192.168.1.40/24) <-> router (192.168.1.1/24) <-> internet

wg0   (10.1.1.100/24)

wlan0 (192.168.254.1/24 dnsmasq + hostapd) <-> mobile clients connected (192.168.254.x/24)

The way i have it /etc/wireguard/wg0.conf

using AllowedIPs = 0.0.0.0/0 makes all my traffic go through Wireguard wg0 Interface

using AllowedIPs = 192.168.254.0/24 I have to sudo ip addr flush dev wlan0 before it brings wg0 and I can't access the internet directly using eth0 Interface.

How to fix my routes?

Linux: measure the latency / packet drop between the input and output interface of a speed limit transfer host

Somewhere between my sender and receiver, there is a host that explicitly limits my transfer speed.

I know it is a Linux host. The login interface for my traffic is eth0 and the output interface is eth1. The speed limiter is probably done somehow using Linux traffic control (tc), but I don't know the details.

From a previous offline comparison between pcap files recorded in eth0 Y eth1 interfaces I know the speed limiter adds significant packet latency (up to 15 seconds!) and packet loss (up to 16%), when I try carry out as much data as possible using iperf.

All traffic is TCP / IP. The source IP, destination IP, and destination port are known and constant. Only the source port switches between consecutive flows.

Given (root) access, is there a way to do a live measurement of packet latency and counters / drop rates? Or recorded in a file as time series data?

php: correct use of an interface when two different classes are valid as parameter?

In one of my projects I wrote a small tournament platform, but the way I handle the participants is a bit messy and I want to clean this up.

So in my case, a Tournament can have participants, but a User or a Team can register to become participants. A participant now has a user_id or team_id in the database, and depending on which one is full, I determine if a user is linked to the participant or if it is a team.

I rewrote the registration part of my Tournament model to accept a User or a Team as parameter through the am interface and I was wondering if this is the correct way to do it.

ICandidate.php

interface ICandidate
{
    public function getName();
    public function hasCorrectGamesSet($tournamentGame);
}

User.php

class User implements ICandidate
{
    private $game;

    public function __construct($game)
    {
        $this->game = $game;
    }

    public function getName()
    {
        return 'Username';
    }

    public function hasCorrectGamesSet($tournamentGame)
    {
        if($this->game != $tournamentGame){
            throw new Exception('Incorrect name');
        };

        return true;
    }
}

Team.php

class Team implements ICandidate
{
    private $users;

    public function __construct($users)
    {
        $this->users = $users;
    }

    public function getName()
    {
        return 'Teamname';
    }

    public function hasCorrectGamesSet($tournamentGame)
    {
        foreach($this->users as $user){
            $user->hasCorrectGamesSet($tournamentGame);
        }
    }
}

Participant.php

class Participant
{
    private $name;
    private $class;

    public function setName($name)
    {
        $this->name = $name;
    }

    public function setClass($class)
    {
        $this->class = $class;
    }
}

Tournament.php

class Tournament
{
    private $participants;
    private $game;

    public function __construct($game)
    {
        $this->game = $game;
    }

    public function signUp(ICandidate $candidate)
    {
        $candidate->hasCorrectGamesSet($this->game);

        $participant = new Participant();
        $participant->setName($candidate->getName());
        $participant->setClass(get_class($candidate));

        $this->participants() = $participant;
    }

    public function getParticipants()
    {
        var_dump($this->participants);
    }
}

So with this set, I can register a User or a Team, do a little checking and, if that happens, add them as tournament participants.

Logic

$tournament = new Tournament('fifa');

$user1 = new User('fifa');
$user2 = new User('fifa');
$user3 = new User('fifa');
$user4 = new User('fifa');

$team = new Team(($user2, $user3, $user4));

$tournament->signUp($user1);
$tournament->signUp($team);

$tournament->getParticipants();

Is this a correct way to implement this and make use of the interface?

networks: add multiple IP addresses from 2 different subnets to my interface

I am trying to configure squid with my Ubuntu 16.04 server. I configured everything with my first subnet (which shares the gateway with my server's IP address). My provider has added 2 different networks to my server, and I can't add the second half to my interface. For clarity purposes, I will use fake IP to explain my problem:

My server IP: 178.212.145.130

Running sudo ip addr gives me:

1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp1s0f0:  mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether ac:1f:6b:9b:31:f2 brd ff:ff:ff:ff:ff:ff
3: enp1s0f1:  mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether ac:1f:6b:9b:31:f3 brd ff:ff:ff:ff:ff:ff
    inet 178.212.145.130/25 brd 178.212.145.255 scope global enp1s0f1
       valid_lft forever preferred_lft forever
    inet6 fe80::ae1f:645f:f22b:31f3/64 scope link
       valid_lft forever preferred_lft forever

So as I understand I have 2 network adapters to work: enp1s0f0 Y enp1s0f1

First network I received:

178.212.145.131
178.212.145.132
178.212.145.133
...
...
...
178.212.145.254

Gateway of my first network: 178.212.145.129

Second network I received:

81.12.206.130
81.12.206.131
81.12.206.132
81.12.206.133
...
...
...
81.12.206.254

Second network gateway: 81.12.206.129

My default Network Interfaces setting (with only my server IP added):

auto lo
iface lo inet loopback
auto enp1s0f1
iface enp1s0f1 inet static
    address 178.212.145.130
    netmask 255.255.255.128
    gateway 178.212.145.129

I have added the first half of my network using the following method:

auto lo
iface lo inet loopback
auto enp1s0f1
iface enp1s0f1 inet static
    address 178.212.145.130
    netmask 255.255.255.128
    gateway 178.212.145.129

auto enp1s0f1:1

iface enp1s0f1:2 inet static
address 178.212.145.131
netmask 255.255.255.128

auto enp1s0f1:2

iface enp1s0f1:2 inet static
address 178.212.145.132
netmask 255.255.255.128

..... (and so on)

auto enp1s0f1:124

iface enp1s0f1:124 inet static
address 178.212.145.254
netmask 255.255.255.128

Now when I try to do the same for the second part, that's where my problem occurs.
I tried to use the same adapter and add this to my network interface:

auto enp1s0f1:125
iface enp1s0f1:125 inet static
    address 81.12.206.130
    netmask 255.255.255.128
    gateway 81.12.206.129

and tried to use the other free adapter:

auto enp1s0f0
iface enp1s0f0 inet static
    address 81.12.206.130
    netmask 255.255.255.128
    gateway 81.12.206.129

After changing this in my interfaces file I do the old service networking restart however I receive

Job for networking.service failed because the control process exited with error code. See "systemctl status networking.service" and "journalctl -xe" for details.

The error occurs due to: Failed to bring up enp1s0f1:125. (method 1) or Failed to bring up enp1s0f0. (method 2)

What exactly am I doing wrong here?

Thanks in advance and I hope I have given enough information!

How can I customize the user interface in Tkinter?

I wanted to change the default TKinter interface to something a little more streamlined. I made a model of what I would like to change:

enter the image description here

How can I edit the UI graphics to match something closer to this? If not, what other GUI library should I use?

information visualization: guidelines for creating connections between different areas of a user interface

Previous discussion What is an intuitive interface to make connections between elements of the user interface?

We have a web application called the genome browser, and we want to establish connections between different areas of the genome. Since this is an application-specific type of context, let's imagine a more general idea. Let's say you have two different graphics and you want to connect points between them.

So we can make fun of this like this

enter the image description here

Now what if, instead of just a bar graph at the top and bottom, we have two at the top and two at the bottom, where the top two are related by their genomic region and the two at the bottom are related by their genomic region? . So if we want to establish connections between them, there are many cross-cutting elements

enter the image description here

Now at this point, the user interface seems quite chaotic. There are also other concerns like

  • connecting lines need to be drawn on an overlay, and this really limits how we can interact with it because in HTML, overlays really mess up handling of your event: you need to put pointer events: none in the overlay to click underlying , and you can possibly disable it to interact with the overlay, but this requires a manual change
  • What if we just render the connection lines independently of the graphics at the top and bottom, because maybe we're only interested in the connections and the pattern that do more than the actual bar graphs? in that case, we can render to a middle area instead of an overlay, but it gets a little confusing what "state" it now has in the app, how it turns on and off if it is separated from the rows in the up and down?

Those are just a couple of concerns. Overlapping often results in at least a bit of visual chaos and conceptual confusion, although it can also help in some cases. Are there similar guidelines or user interfaces in other applications that have such concerns?

Drupal 8 Views – Filter nodes by today's date in the views user interface

This is my first time posting, so please forgive me if I post incorrectly and I will be happy to republish as needed with guidance.

This query is related to the following previous query that I recently found:

The view filter criteria date field is greater than the current date

I have used this method (operator> = today) with some success, however I would like to create "future" nodes and they should be filtered too. What I need is a date Y time field to filter just today's date. I have tried many things to include:

  • operator = today + either value type, machine readable or offset (does not return results)

  • operator = now + either value type, machine readable or offset (does not return results)

  • context filter: summary links (non-adjustable granularity I can find, so it returns multiple summary links for single date and summary + one summary link is not a good user interface for the app)

  • context filter: default – "current date" (does not work; known issue with effectively variable patch to kernel that I would like to avoid) ref: https://www.drupal.org/project/drupal/issues/ 2325899

  • date field only (does not work due to UTC time and changes during daylight saving time)

Thank you very much for your review / assistance. -C