Integrating TeX into a Java desktop application

Looking to integrate TeX equations in a TeX-agnostic fashion, suitable for either ConTeXt or LaTeX, into a Java-based desktop Markdown editor. The possibilities are numerous, but I’m not sure what approach to take.

JMathTex outputs to MathML, which must be transformed. JEuclid can transform MathML to BufferedImages (not 100% sure). Neither are JDK 14-friendly and may be too slow to render in real-time. I haven’t looked because I read that they didn’t work with Java 9 (without porting effort), much less 14. Also, the licensing isn’t LGPL, which probably won’t work with the MIT licensing.

The NTS library is reported to compile gentle.tex in about 3 seconds. The spin-off project, εχTEX improves upon NTS, but I don’t know to what extent.

Java LaTeX Report requires a TeX engine.

Yet another possibility is to try JavaTex or rework the project using web2java to transpile WEB files into Java files.

JLaTeXMath does an exceptional job at rendering, though investigation would be required to see if it can perform real-time renders, output as SVG, or otherwise determine if it can integrate with FlyingSaucer.

The HTML preview panel uses FlyingSaucer. The SVG documents are rendered using SVG Salamander. If it was possible to go from TeX to SVG, that could work quite handily, architecturally. Some documentation stated FlyingSaucer can also render MathML, but I suspect the doc is wrong. FlyingSaucer doesn’t integrate with JavaScript. For that I’d have to add a JavaScript Engine.

If a JavaScript Engine is necessary, then using KaTeX may be an option.

Still another possibility is the TeX to MathML service. This is written in Java, but the source code is not available anywhere. I’ve reached out to some people involved in the project.

For native speeds, there may be a (cross-platform?) C-based TeX engine that can generate MathML or SVG from a TeX input. If so, it may be possible to integrate with the JNI.

Here’s a demo video of the app, to give you an idea of what is needed:

The goal is to produce real-time rendering of math, ideally in pure Java (no JavaScript).

What approach would you take and what do you see as its benefits and drawbacks?

Go to Source
Author: Dave Jarvis

Is it normal for MySQL to gradually increase memory usage over time?

Is it normal for MySQL to increase memory usage over time? See image below of my server’s memory usage over the last two weeks. After “service mysql restart” it drops to 40%. The database is used by a node.js app.

Server has 4GB of RAM with below additions to mysqld.cnf:

innodb_ft_min_token_size = 1
ft_min_word_len = 1
innodb_buffer_pool_size = 3G
innodb_buffer_pool_instances = 5
innodb_read_io_threads = 8
innodb_write_io_threads = 8
innodb_log_file_size = 128M
innodb_flush_method = O_DIRECT
max_connections = 300
long_query_time = 1
innodb_ft_enable_stopword = 0

Thank you!

Go to Source
Author: steven

How to set values.yaml of subchart in helmfile

I have created a helmfile to install helm chart of loki-stack and trying to pass values.yaml but I am not able to do so. The following is my helmfile

repositories:
  - name: loki 
    url: https://grafana.github.io/loki/charts

releases:
  - name: loki
    namespace: logs
    chart: loki/loki-stack
    values:
    - "./loki-stack/charts/loki/values.yaml"

The problem might have occurred because Loki is a sub chart of Loki-chart. I have changed the ingress in the above and it does not work. Is there any way so that I can pass the file for variables?

Go to Source
Author: Err0rr

Can security modules completely override Linux Kernel’s access model?

I am aware of Apparmor and specifically how it can be used to limit a program’s access rights where of the file-system permissions otherwise allow. What I’m less clear on is whether it’s possible for Apparmor or any similar security module to completely override a program’s access rights. Can they grant a program access to read/write/execute files that the user otherwise has no access to.

I’m asking for what the Linux Kernel will allow such a security module to do, not what existing security modules can be configured to do.

Can security modules completely override Linux Kernel’s access model?

Go to Source
Author: Philip Couling

WP Custom fields – Add class to button element

I have looked into similar discussions in the forum. Most circle around my issue but non gave a definitive answer.

Working on an Intranet site running on WP (v. 4.8.14). I have been trying to style banners appearing on the home page. The intent is, each banner would appear in different colour combination. Each banner leads to a post type: Page. It is also intended once the code works to integrate it in the The Loop for those banners.

Banners on home page

I have been trying to get my head around WP custom fields and found the resource below, that seemed easy enough:

Style Individual Posts Using Custom Fields

Have added a Custom Field Key: cssclass with Value: bnr-yellow. This is a CSS class with some basic (for now) colour styling.

.bnr-yellow {
background: rgba(250, 240, 72, 1)!important; 
color: rgba(57, 185, 186, 1);}

The class itself works as I tested it manually from the Inspector.

Custom Field with value bnr-yellow

Updated (saved) the Page.

The issue

However I have been unable to make it work.
Although the code below returns all (possible) custom fields as a class, it does not return mine.

Image demonstrates missing class

The Image above demonstrates the returning output of the code below. Note the button requires .col-sm and .hmBanner which are passing through alright, (as evident).

Basic Loop…

<?php $custom_values = get_post_meta($post->ID, 'cssclass'); ?>

…and the button.

<button onClick="window.location.href='<?php the_permalink() ?>'" type="button" <?php post_class('col-sm hmBanner ' . $custom_values); ?> >
    <span>
        <i class="hmBannerImg animate__animated animate__backInDown " style="background-image: url(<?php echo wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) ); ?>)"></i>
<div class="hvr-wobble-vertical brTtlDiv">
    <h3><?php the_title(); ?></h3>
</div>
        </span>

Have tried various iterations of the PHP, for example alter the code, as per a web resource, but same issue…

<?php $customField = get_post_custom_values("cssclass"); ?>

Regarding the post ID, I am not interested in it… So I have not been using it. Though if it proves it is needed for the function then I will add it.

What possibly am I missing here?

Any point to the right direction would be greatly appreciated.

Please help!…
Thank you for your time in advance.

P.S. I am not a novice nor am I clever.

Go to Source
Author: Jason

Restaurant reservations – Tables combinations

I have 3 tables in a reservation system for a restaurant. So far the software was used only by restaurant’s staff, however we want to accept reservations online as well. We have some small tables for 2 that can be easily moved to each other and make room for bigger parties and I want to accept reservations automatically if all of the tables that can be combined are available.

tables: holds all tables for each area in the restaurant.

| id | min_capacity | max_capacity | name | area   |
|----|--------------|--------------|------|--------|
| 1  | 2            | 4            | #1   | Inside |
| 2  | 6            | 8            | #2   | Inside |

reservations: holds reservation details

| id | datetime            | name     | status   |
|----|---------------------|----------|----------|
| 1  | 2020-09-01 20:00:00 | John Doe | Upcoming |
| 2  | 2020-09-05 13:00:00 | Jane Doe | Upcoming |

And one pivot table that holds reservation <=> table relation:

| id | table_id | reservation_id |
|----|----------|----------------|
| 1  | 1        | 1              |
| 2  | 2        | 2              |

How can I store different combinations of tables (manually entered) and “attach” reservations to tables/table combinations (so I can check if tables are available for specific time) efficiently?

Go to Source
Author: Clarissa

How to show Snap app icon properly on Ubuntu Unity desktop

Had this issue where after I logged into my Ubuntu desktop all Snap apps icons do not show properly. Instead I see a plain icon in place of what the app icon should be. Have you the same experience?

This might have been fixed in later Ubuntu LTS releases, I really don’t know. But I am still on 16.04 Xenial Xerus until its EOL. Also, the reason is that I love the Unity Desktop. The Gnome Shell replacement just doesn’t cut it for me.

I have been looking for a solution on this issue for some time. The 2 main things people point out are:

– Add /snap/bin to the /etc/environment file, and;

– Something to do with the profile.

Neither of those solutions worked for me. But it did work for others according to what I have read so far.

ANSWER

To fix this icon issue, create a symlink of the Snap’s .desktop shortcut file to your user’s .local/share/applications directory.

It is as simple as that. Once done the problem will go away, and you will be left with a nice-looking icon that came with the Snap installation. This won’t go away on following restarts.

For more details on how to do this fix exactly, refer to this article – https://www.joseyamut.xyz/2020/08/13/getting-that-ubuntu-snap-icon-right-on-unity-shell/

Dual network interface control with systemd

On a debian machine, I have two network interfaces: eth1 and eth2.

Eth1 is static and eth2 is using dhcp. How to make so that when the eth1 interface is active, the eth2 interface is down and vice versa? Basically I want the two interfaces never to be active at the same time.
I’ve started to make a script with ifdown ifup in the crontab but obviously we should be able to do it with systemd.

Do you have any idea how to make this easy?

Go to Source
Author: Rig0L

Kubuntu 18: Dolphin as FTP

When editing code online, I use Dolphin for FTP. I can double-click and the file opens in my editor, no problem. When I save in the editor, it uploads the changes. It’s ideal.

Right now, the double-clicked file just comes down to a random temp location, and since I have many files that are similarly named, it gets confusing in a hurry. Is it possible to control the location where the file is downloaded when operating in that way?

Go to Source
Author: Bill in Kansas City

Can’t run Google Chrome on Ubuntu 18/20

I’ve installed Ubuntu 20 LTS from official site with Rufus. And then I downloaded Google Chrome from google.com/chrome 64 bit.deb for Ubuntu
The first time I open, Chrome works nomally but after that time I can’t manage to open it, I tried to launch it from terminal/gnome it yeilds:
NaCl helper process running without a sandbox! Most likely you need to configure your SUID sandbox correctly
This also happens on Ubuntu 18.04
Any help is appreciated!

Go to Source
Author: Phạm Văn Tiến

Where are default aliases defined

I’ve got a fresh install of CentOS 8 (minimal ISO). I notice that, despite none being listed in either .bashrc or .bash_profile, a bunch of aliases are defined by default in bash. For example,

alias cp='cp -i'
alias egrep='egrep --color=auto'
...

Many of these aliases I’d like to keep. However, where can I find/edit the sources of those definitions?

Go to Source
Author: Daniel Walker

Applicability of Java skills to Groovy development

Hi all: if you have meaningful Java experience, was it enough to develop basic Groovy code as well?

Leverice opened up its platform API and wondering how much overlap there is between Java and Groovy skills. If you’ve made the transition, how much time/work did it require to get up to speed with Groovy?

Go to Source
Author: deevee

How Do I See the List of Users Allowed on a MS SQL Server Database

I want to know the users that are allowed access to a MS SQL Server database. I only want a specific database. Is there a user list hidden somewhere?

What are the ways to go about doing this? Is there an app or through a SQL query?

ANSWER

Use Microsoft SQL Server Management Studio. That is the fastest way to do it. Find the database from the explorer menu on the left-hand side. Expand the folder icon. Go to the Security folder, then click on Users next. That’s it!

If you’re using a different SQL client and you can’t see Security > Users from the GUI. Then your other option is through a SQL query.

This is the query below. More details at this page here: https://www.joseyamut.xyz/2020/08/06/get-user-list-in-a-microsoft-sql-server-database/.

USE <database_name>;
SELECT name AS username,
       type_desc AS type,
       authentication_type_desc AS auth_type
FROM sys.database_principals
ORDER BY type;

Happy user hunting! =)

How to turn off mouse acceleration in Windows 10?

After the recent Windows 10 update, my mouse has had mouse acceleration on even though I turned it off. I also uninstalled Logitech G Hub (I have Logitech G302 gaming mouse) and reinstalled it. I tried doing clean boots, removing the device from the computers through Control Panel, but nothing has worked so far. What should I do?

Go to Source
Author: Ryan Hong