Logtalk : Load a file with camelcase naming on Windows - logtalk

With logtalk 3.1.2, under OS X and Linux, no problem to load a file with a camelcase name, but an exception is thrown on Windows (ERROR : file does not exist).
logtalk_load(mypath(myFileNameInCameCase))
What's wrong ?

Some backend Prolog compilers, such as SWI-Prolog when running on Windows, down-case file names when expanding file paths into absolute file paths. This caused a failure in the Logtalk compiler when going from the file argument in the compilation and loading predicates to an absolute file path and its components (directory, name, and extension). A workaround have been found and committed to the current git version. Thanks for the bug report.

Related

Pyomo with octeract - Failed to create solver with name 'octeract-engine'

When trying to use octeract with pyomo, I uncounter the following error.
2022-06-22 15:48:44,451 [ WARNING][pyomo.opt] Failed to create solver with name 'octeract-engine':
Failed to set executable for solver asl. File with name=octeract-engine either does not exist or it is not executable. To skip this validation, call set_executable with validate=False.
[...]
The SolverFactory was unable to create the solver "octeract-engine"
and returned an UnknownSolver object. This error is raised at the point
where the UnknownSolver object was used as if it were valid (by calling
method "solve").
The original solver was created with the following parameters:
executable: octeract-engine
type: octeract-engine
_args: ()
options: {}
I've tried following both octerat doc and this doc unsuccessfully.
This is the classic Pyomo message when the binary it's told to invoke (in this case octeract-engine) is not in the system PATH.
You can fix this by adding the engine to the PATH. The way to verify that this was done correctly is to start up the terminal that you use to invoke Pyomo (e.g. linux terminal or powershell), and type octeract-engine (linux) or octeract-engine.exe (windows). If the engine is in the PATH, this will print the engine's help menu, otherwise the system will complain that the binary was not found.
What's actually happening here is that Octeract Engine connects to Pyomo through an ASL interface. Pyomo simply looks for a binary in the system PATH with the "name" specified in the command. As long as that binary has an ASL interface, it will just work, however Pyomo leaves it up to the user to ensure that the binary is visible in the PATH.
Our installers actually add the binary to the PATH on all platforms by default for this reason, so try a clean reinstall and see if that fixes your issue. Otherwise, it's likely that you don't have the right permissions set up on your machine i.e., the Python version that runs Pyomo doesn't see the right PATH (e.g. if you use octeract-engine.exe on powershell but run Pyomo from cmd.exe).

Error while compiling the substrate-node-template on windows vscode

error: failed to write bytecode to F:\substrate-node-template\substrate-node-template-master\target\release\wbuild\node-template-runtime\target\wasm32-unknown-unknown\release\deps\pallet_transaction_payment_rpc_runtime_api-927dd9f7f5859937.pallet_transaction_payment_rpc_runtime_api.a5dcb31e-cgu.0.rcgu.bc: The system cannot find the path specified. (os error 3)
enter image description here
Note that Windows systems have a restriction on path length, and sometimes substrate runs into this! Better to put your build folder closer to your root dir to minimize path length. More in this issue(https://github.com/substrate-developer-hub/substrate-node-template/issues/185)
it's a dup question, though.

Errors in Castalia while importing in Omnet++

i had installed Omnet++ version 4 and also 5.I had imported castalia 3.2 and tested the simulation with radiotest.While running the simulation i am getting an error like
" Exception occurred executing command line.
Cannot run program "D:/MTECH/M.TECH" (in directory "D:\MTECH\M.TECH PROJECT\NEW OMNET++ FILES\Casssss\Simulations\radioTest"): CreateProcess error=2, The system cannot find the file specified"
Not only in radiotest and i am also getting these types of errors for many simulation models.How to resolve it.Help me please.
I had also changed the Environmental variables with java.I am not getting a solution.Please recommend a solution or please tell me which are the perfect versions to use castalia 3.2.
Your path contains spaces. A path for OMNeT++ simulator, projects, etc must not contain spaces nor special characters.

Error resurce compiling

I have problem. I add new dialog in old project, and I have some error:
X:MEATFACTORYMaterialsMaterials.rc (22): error RC2135 : file not found: 0x19
X:MEATFACTORYMaterialsMaterials.rc (74): error RC2135 : file not found: 128
X:MEATFACTORYMaterialsMaterials.rc (1764): error RC2104 : undefined keyword or key name: IDC_LIST_RESULT
Error executing rc.exe.
What is it means?
codepage in file - win1251
what do me?
I need resolve this problem only for VC6.0
At all, the cause of this error was that in the process of adding resources VS6.0 then why (why ? This is not understood) has created another new file resourse.h in the expansion which was added two do not read Unicode characters. That is, were present in the directory two files resourse.h - and with different content. When I set up the conditions as compile / c 68001 - then picked up by a file with Unicode but not complete - and that caused a second group of errors. And if the file is compiled as ASCII - from the point of view of the file system at the studio had two files with the same name - and not one of them could not read ( of course). That is, if you get this error - check the file resource.h - and places without glitches such as in this case .
It is also (probably) this is due to the fact that VS works for me on virtualke to Linux - but from the point of view of the file system of Linux is nothing extraordinary - just two files with different names.

Resurrecting old PLT-Scheme project (pre-1999)

I'm trying to resurrect an old (1999 or earlier) project written in Scheme (PLT-Scheme, using the mzscheme interpreter (?) commandline tool). To make the matters worse, I don't know Scheme, or Lisp (in fact, I want to learn, but that's another story).
I have the source code of the project at:
github.com/akavel/sherman
Now, when running the code, it bails out with an error message like below:
Sherman runtime version 0.5
Hosted on MzScheme version 52, Copyright (c) 1995-98 PLT (Matthew Flatt)
reference to undefined identifier: list->block
(I've tried PLT-Scheme versions 52, 53, 103, 103p1. Earlier versions don't allow mzscheme -L option, which is referenced in the sherman.bat script used in the project. Later versions also have some more serious problems with the code or options.)
The difficulty is, that from what I see, list->block actually is defined - see: collects/sherman/BLOCK.SS line 48. So, what is wrong?
To run the code, I perform the following steps:
Download PLT-Scheme v. 103p1 (from the old versions download page - first closing the "PLT Scheme is now Racket" banner) - for Windows, use: mz-103p1-bin-i386-win32.zip.
Unzip (e.g. to directory c:\PLT).
Copy c:\sherman\collects\sherman directory with contents to: c:\PLT\collects\sherman (where c:\sherman contains the contents of the github repository).
Run cmd.exe, then cd c:\sherman.
set PATH=c:\PLT;%PATH%
sherman.bat run trivial.s
this command is in fact, from what I understand, equivalent to:
(require-library "runtime.ss" "sherman")
(parameterize ((current-namespace sherman-namespace)) (load "trivial.s"))
(current-namespace sherman-namespace)
After that, I get the error as described above (MzScheme version would be reported as 103p1 or whatever).
Could you help me solve the problem?
EDIT 2: SOLVED!
To whom it may concern, I've added a fully fledged "How to use this project" instruction on the project page, detailing the solution to the problem thanks to soegaard's help.
In short:
copy trivial.s trivial.rs
rem (the above is workaround for problems with 'r2s.exe < trivial.r > trivial.rs')
sherman.bat compile trivial.rs
sherman.bat run trivial.zo
rem (or: sherman.bat run trivial.ss)
Not an answer, but a few notes too big for a comment.
1. Sanity Check
The error message says list->block is undefined.
Make sure that the code in block.ss is run, by
inserting (display "block.ss is loaded!") in block.ss
just to make sure, the code is run.
2. Random Thoughts
The file blocks.ss begins with:
(require-library "functios.ss")
(require-library "synrule.ss")
(require-library "stream.ss" "sherman")
The file "sherman/stream.ss" is in the repository,
but where is "synrule.ss" and "functios.ss" ?
Ah... This code is old! Here is a description of
how require-library worked. It lists functios.ss
and synrule.ss as part of MzLib.
http://www.informatik.uni-kiel.de/~scheme/doc/mzscheme/node158.htm
Let's check out how require-library worked:
When require-library is used to load a file, the library name and the
resulting value(s) are recored in a table associated with the current
namespace. If require-library is evaluated for a library that is
already registered in the current namespace's load table, then the
library is not loaded again; the result(s) recorded in the load table
is returned, instead.
So when the code in block.ss is run, the names are stored in a namespace. If the current namespace is the wrong one, when the code in block.ss is evaluated, it would explain you error message of list->block being undefined.

Resources