Why can't #Include work? - autohotkey

Why does this not work?
#Include D:\Data\Download\Scripts Latex2Unicode.ahk
It says
Include file "D:\Data\Download\Scripts Latex2Unicode.ahk" cannot be opened. The program will exit.
It isn't different from the help page.

Probably you mean:
#Include D:\Data\Download\Scripts\Latex2Unicode.ahk
presuming the directory is "Scripts" and the file name "Latex2Unicode.ahk"
Let us know . . .
EDIT: Note, in the Help example:
#Include C:\My Documents\Scripts\Utility Subroutines.ahk
the file name is "Utility Subroutines.ahk" in the "Scripts" directory -- the directory is not "Utilities" and the file name is not "Subroutines.ahk"

Related

Deploying app, troubles to reffer to datasets. Streamlit

Hello i have one more problem with deploying my app by Streamlit. It works localy but when I want to upload it on git hub it doesnt work..Have no idea whats wrong. It seems that there is problem with path to the file:
"File "/app/streamlit/bobrza.py", line 14, in <module>
bobrza_locations = pd.read_csv(location)"
Here is link to my github repo. Will be very very grateful for help. Thank in advance.
https://github.com/Bordonous/streamlit
The problem is you are hard coding the path of the bobrza1.csv and route.csv to the path on your computer so when running the code on a different environment the path in not legal.
The solution is to make location independent from running environment, for this we will use the following:
__file__ variable - the path to the current python module (the .py file).
os.path.dirname() - a function to get directory name from path.
os.path.abspath() - a function to get a normalized absolutized version of path.
os.path.join() - a function to join one or more path components.
Now you need to change your location and location2 variables in the code to the following:
# get the absolute path to the directory contain the .csv file
dir_name = os.path.abspath(os.path.dirname(__file__))
# join the bobrza1.csv to directory to get file path
location = os.path.join(dir_name, 'bobrza1.csv')
# join the route.csv to directory to get file path
location2 = os.path.join(dir_name, 'route.csv')
Resulting in an independent path of the bobrza1.csv and route.csv.

VSCode- exclude specific folder/file from IntelliSense parsing

I have an issue with C/C++ intelliSense parsing. When the function declaration described in one file and the same name is used for typedef in another file.
Explanation:
Image we have next structure of folders and files:
file dir1/f1.h contains:
typedef int func1;
file dir2/f1.h contains:
void func1(void);
file dir2/f1.c contains:
#include "f1.h"
void func1(void) {
// do something
}
file main.c contains:
#include "f1.h"
int main(void) {
func1();
}
When I use command go to definition, the IntelliSense goes to the dir1/f1.h file because the last open file was dir1/f1.h. If the last opened file was dir2/f1.h the IntelliSense will jump to dir2/f1.h or dir2/f1.c.
I am wondering how to exclude dir1 or dir1/f1.h from IntelliSense parsing but not from workspace and searching results? So I need next:
IntelliSense ignore/do not parse dir1 or dir1/f1.h
dir1 and dir1/f1.h present in workspace view
searcher do not ignore dir1/f1.h

WinDbg TTD: No trace files were identified from this record session

Trying to record execution of Hello World with WinDbg from store.
WinDbg settings:
Executable path: C:\Users\...\Documents\Visual Studio 2017\Projects\TestApplication\Debug\TestApplication.exe
Output directory: c:\Users\...\Documents\
Code:
#include "stdafx.h"
#include "iostream"
using namespace std;
int main()
{
std::cout << "Hello World!\n";
return 0;
}
Error:
TTD: No trace files were identified from this record session
The debugging session could not be started: Path cannot be null.
Parameter name: path
Why it's does not work? What I am missing?
Occasionally TTD recording has trouble creating TTD files to paths with spaces. Recommend entering or pointing Output Directory to save TTD files to a path with no spaces.

How can I call functions in a different C source file from a Perl XS module?

I am building an XS extension with Perl. I have two files:
A C header file (.h)
A C source file (.c)
Currently what i did is to put all the C file code before the Model= on the XS file and wrap the functions I want after the Model=.
The compliation works with no problem and i am able to call the specific functions from perl.
But I want to separate the .xs file from the C file.
I want the .xs file to contain only the wrap functions, and those functions will call the functions on the .c file, but when I do that and run the dmake command i get error code 129 undefined reference to 'parse.c' file.
I tried to include the .c file using C and OBJECT properties for WriteMakerFile and still get an error any idea how to split the xs file to 2 one c file and the other xs which wrap the c function which are part of the .c file using ExtUtils::MakeMaker.
Examples would be appreciated.
This is actually rather straightforward:
hello.h
#ifndef H_HELLO
const char *hello(void);
#define H_HELLO
#endif
hello.c
const char *
hello(void) {
return "Hello";
}
Example.xs
#define PERL_NO_GET_CONTEXT
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include "hello.h"
MODULE = My::Example PACKAGE = My::Example PREFIX = MY_
PROTOTYPES: DISABLE
const char *
MY_hello()
CODE:
RETVAL = hello();
OUTPUT:
RETVAL
t/My-Example.t
use strict;
use warnings;
use Test::More;
BEGIN { use_ok('My::Example') };
is(My::Example::hello(), 'Hello', 'hello returns "Hello"');
done_testing;
[~/tmp/My-Example]$ prove -vb t/My-Example.t
t/My-Example.t ..
ok 1 - use My::Example;
ok 2 - hello returns "Hello"
1..2
ok
All tests successful.
Files=1, Tests=2, 0 wallclock secs
( 0.04 usr 0.01 sys + 0.03 cusr 0.00 csys = 0.08 CPU)
Result: PASS
The Makefile.PL was generated by h2xs. The only thing I changed was to uncomment the following line:
# Un-comment this if you add C files to link with later:
OBJECT => '$(O_FILES)', # link all the C files too
I think this is a rather old post but I admit that the key is the proper directory structure and file placement. You must put the other .c source files into the same directory where your xs file is. And put your xs file into the directory where your Makefile.PL is. (I assume you do not set MULTIXS as 1 in your Makefile.PL). The reason for this placement restriction is that CCCMD compile command in generated makefile does not have -o option, so all output object files will be placed into the directory where your generated Makefile is.
On CPAN I have found/checked some modules having source files in different sub dirs than xs file but they overrides ExtUtils::MakeMaker const_cccmd sub and append -o option on the fly during Makefile generation.

Including Allegro 5 Issue

I just installed Allegro 5 from the terminal as outlined here: http://wiki.allegro.cc/index.php?title=Install_Allegro5_From_SVN/OSX#Preliminaries. However, when I try to write a program, it has trouble including allegro.h. I have tried:
#include <"allegro5/allegro5.h">
#include <iostream>
using namespace std;
int main () {
cout<<"foo"<<endl;
}
but I get the following error when I compile (using g++):
foo.cpp:1:33: error: "allegro5/allegro5.h": No such file or directory
I have also tried:
#include <"/usr/local/include/allegro5/allegro5.h">
#include <iostream>
using namespace std;
int main () {
cout<<"foo"<<endl;
}
but I get the following error when I try to compile:
foo.cpp:1:52: error: "/usr/local/include/allegro5/allegro5.h": No such file or directory
I know the file at /usr/local/include/allegro5/allegro5.h exists. I have already tried #include <"/usr/local/include/allegro5/allegro.h"> and #include <"allegro5/allegro.h"> as well all with similar results. I know this is a pretty basic question and I just want to be able to write a program which can successfully include allegro.
The double quotes are erroneous and the file is not correct. It should be:
#include <allegro5/allegro.h>