TeraTerm Invalid Host when running .ttl file - teraterm

Running on a new Windows install. I installed tera Term and copied over a .ttl file I used on a previous windows version. When I try to launch the macro I get an Invalid Host pop-up error.
I can open Tera Term as normal and connect to the host defined in my .ttl file without any problems, it's only when I try to run my script.
I've tested this on both Tera Term Version 4.78 as well as Version 4.105

After some messing around I managed to solve this problem, giving it a real answer so that hopefully if someone else has this problem they will find this.
The problem was that by default my .ttl files were set to open with Tera Term I instead had to set it to open with Tera Term Macro Interpreter, which is an executable that lives in your Tera Term install directory.

Related

Linux - Open terminal for input/output

I'm coding a Rust app and since it's fairly small and there don't appear to be any stable UI frameworks, I've made it run in the console using println! and whatnot for input/output. However since this program is intended to be used by people directly after downloading from the internet (due to its use case), they're likely to just double click on it instead of navigating to their downloads directory in a terminal and running it from there.
This is a problem because on Linux, it runs in the background waiting for input and looks like it's not working. On Windows, Rust programs do open in CMD by default. (and in fact many of the search results for my question were about disabling this behavior - the exact opposite of what I want!).
So is it possible to somehow make my application open in the system's default terminal? My preferred way would be to somehow embed in the executable to open in terminal (similar to the -mconsole compiler flag on MinGW). Otherwise would it be possible to detect it's in the background and fork it into a terminal? If that's not possible then is it at least possible to detect that the app is not running in a terminal and throw up a message box telling the user to run in a terminal?
My app is cross-platform but I'm OK with writing code conditionally compiled on one OS.
One typical way would be to distribute a program.sh along with your executable. If .sh extension is bound to opening a terminal in their window manager of choice, it would open automatically. If not - it is enough of a hint for running it from the shell.
Without this file you could:
Detect if the program is already running inside a terminal can be done with isatty(). There's a crate for it.
If not, spawn the terminal app process (see process::Command) and relaunch the program with it by passing its path to the terminal command line options. As #Caesar mentioned there's a bunch of popular terminals that you might want to check for presence on Linux. If nothing is found, xterm could sometimes be a fallback.

Mac executable not working when downloaded online

I have made a small (8 MB) program into a MAC executable (.app?)
It works great if I share it using a thumbstick, but if I try to upload it to google drive and then download it it doesn't work. By this I mean It first tells me that It is an unidentified source (this seems reasonable)
But then if I click "open"
It opens as a text file with junk data:
If I try to force it to open on the terminal, how the other program opens, it just shows the heartbeat thing that MACs do when opening a file, but never opens anything.
It is certifiably the same exact file. Same size, same name, same goobldygoop if I open both of them as text files instead of executables.
I am really confused, the only thing I can think of is the "signature" that apple uses is lost when it is compressed into a zip, but I'm probably totally off base.
The code uses python 3.7, pyinstaller, pynput, and selenium.
I am using MAC OS Catalina to write and make into an EXE, then another Catalina to try to run the program.
EDIT: Clarify what doesn't work means
Please help.
I found the answer, simply zip the file from my mac and send it that way!
Yay!

Using Atom with Stack (Haskell) - How to interactively evaluate from within IDE

I am new to Atom / Stack / Haskell and after a fair bit of hand wringing managed to get set up on my windows 10 box.
One thing I am still stumped on is finding a way to set up interactive evaluation from within Atom (like "debugging" in Leksah)?
I have installed the "Script" which looks promising but all I get is:
'ghc' is not recognized as an internal or external command,operable program or batch file.
I presume I need some kind of configuration but I can't work out what's required. I think need a way to pipe through to an open ghci console.
Is there a way of setting this up with "Script"or any similar package?
Thanks
John
as you checked for yourself the ide-haskell-repl atom-package should work here

Python win32 ShellExecute error 31: 'A device attached to the system is not functioning.'

I have a python program where I try to send a document to a printer. It works fine in my machine with a local printer set as the default printer and connected with my laptop via USB. However, when I tried it with another computer with its default printer being in a network it doesn't work. The error I get is:
pywintypes.error: (31, 'ShellExecute', 'A device attached to the system is not functioning.')
The piece of code is giving problems is the following one:
win32api.ShellExecute(0,"print",doc_path,None,".",0)
I think the problem is because of the printer being connected using the network and not the USB, but it might be another thing.
Thanks for any help.
I found the cause of the error: the computer didn't have a pdf reader installed and that was causing that error (the file to print was a pdf).
Installing Foxit reader (and making it the default program to open pdfs) fixed the problem.
I've got this error when executing a simple print() command but in a command window with utf-8 enabled via the following commands:
chcp 65001
set PYTHONIOENCODING=UTF-8
This caused the error; probably because the string python tried to print on the terminal was in a different encodign than utf-8.
I had the same problem. Simply installing a pdf reader wasn't enough though, I had to make it the default program to open pdfs too to get it to work.

Embedded ttf font in itext program not getting loaded in a Linux machine

In my program I use something like this -
String arielunicodePath = config_Folder_Path+File.separatorChar
+"resources"+File.separatorChar + "ARIALUNI.ttf";
arielunicodebase = BaseFont.createFont(arielunicodePath, BaseFont.WINANSI, BaseFont.EMBEDDED);
I have put the ARIALUNI.ttf file in the correct location in my project.
Its working fine on my windows machine. But when i deploy it to our Linux server, the font creating command above fails with below error -
java.io.IOException: /x/programs/reporttransformationmsgd/config/resources/ARIALUNI.ttf not found as file or resource.
I confirmed that the file is available on the exact location the program is looking for.
What am I missing here?
When developing on Windows and deploying on Linux, one sometimes forgets that Linux generally handles file names in a case-sensitive manner while Windows does not.
In the case at hand the file name the program sought for was ARIALUNI.ttf while the font file actually (just like in the Windows fonts folder) was named ARIALUNI.TTF.
Testing on Windows the lower case extension meant no problem while on Linux it gave rise to the not found as file or resource IOException.

Resources