Importing Cubical Agda modules in Agda - agda

I am using agda in Emacs mode. I am trying to start a project which relies on the cubical library. I want to import the module Cubical.Core.Everything. I have only written the following
{-# OPTIONS --without-K #-}
open import Cubical.Core.Everything
When I try to load the file I receive the following error
/home/rymndbkr/myHoTT/Agda/intro.agda:3,1-36
Importing module Cubical.Core.Everything using the
--cubical/--erased-cubical flag from a module which does not.
when scope checking the declaration
open import Cubical.Core.Everything
/home/rymndbkr/myHoTT/Agda/intro.agda:3,1-36
Importing module Cubical.Core.Everything using the --two-level flag
from a module which does not.
when scope checking the declaration
open import Cubical.Core.Everything
I've read through the relevant agda documentation and I don't see anything that addresses this. Does anyone have an idea of whats happening here?

The Cubical Agda libraries can only be used from Cubical Agda. The error message is telling you to change your source file to use Cubical mode:
{-# OPTIONS --cubical #-}

Related

Where is _≡⟨_⟩_ Agda standard lib?

I read such a piece of code in plfa.
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; cong; sym)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _≡⟨_⟩_; _∎)
but _≡⟨_⟩_ is not in PropositionalEquality
The module Eq.≡-Reasoning doesn't export the following: _≡⟨_⟩_
when scope checking the declaration
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _≡⟨_⟩_; _∎)
I only find it in Function.Related and Relation.Binary.HeterogeneousEquality. What is happening?
_≡⟨_⟩_ is a syntax notation for step-≡ as you can see in Relation.Binary.PropositionalEquality.Core.
So if you want to control what you are importing, you need to refer to step-≡
instead.

how to install model_evaluation_utils

I'm trying to model evaluate the performance of our deep learning models. And below is my code. However, I still get
No module named 'model_evaluation_utils'
Is there any pip installation or conda that could solve this problem?
from keras.preprocessing.image import load_img, img_to_array, array_to_img
from keras.models import load_model
import model_evaluation_utils as meu # throws error
Implementation of "model_evaluation_utils" can be found in the following github repository:
link
I think it's not a publicly available library, there must be a model_evaluation_utils.py file which is imported in the code and is used.

when using exporting(highchart) in angular 7 got the the error

using exporting(highchart) getting below error:
ERROR in src/app/desktop/module/dashboard/dashboard.module.ts(24,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'typeof import("C:/website/UI_Dashboard/node_modules/highchart
s/modules/exporting.src")' has no compatible call signatures.
in the module:
import {ChartModule, HIGHCHARTS_MODULES} from 'angular-highcharts';
import * as more from 'highcharts/highcharts-more.src';
import * as highcharts from 'highcharts';
import * as exporting from 'highcharts/modules/exporting.src';
import * as offline from 'highcharts/modules/offline-exporting';
exporting(highcharts);
offline(highcharts);
what should I do for solving this issue?
Have you tried with import exporting from 'highcharts/modules/exporting.src';?
It's the suggested way of module working as documented in the official Highcharts wrapper for Angular - https://github.com/highcharts/highcharts-angular#core
You should also load all Highcharts related files as src or minified - mixing might cause some TS issues.
An import path for src version of Highcharts core is 'highcharts/highcharts.src'.
Also (I'm not sure if this applies here since the code might not be complete), highcharts-more needs to be initialized as any other module. Usually it is loaded before other modules - initialization order is rarely important (some series types are based on optional modules) and you will get an error if the order is wrong, so it's important to test this.
In case anyone encounters this problem nowadays, changing this:
import * as exporting from 'highcharts/modules/exporting.src';
To this:
import Exporting from 'highcharts/modules/exporting';
Solved the problem for me.
I'm using Angular CLI 11.1.4 and the Highcharts npm package v9.2.2

Unhandled exception: type 'A' is not a subtype of type 'A' of 'x' where A is from

I get a runtime error that reads something like this:
Unhandled exception:
type 'A' is not a subtype of type 'A' of 'x' where
A is from file:///path/to/source/a.dart
A is from package:my_package/a.dart
A is the exact same type as the other A -- there is no naming conflict.
The two indented lines ('A is from ...') only differ in their way of specifying the path. One goes through 'package:' and the second one is the file path on the file system.
TL;DR:
Use import 'package:...' everywhere, even when importing files from your own package.
Explanation:
The two URLs (file:///... and package:...) are equivalent but Dart has no way of knowing that. When you import source via both relative path and via the package: scheme, you'll get this error.
To fix this issue, make sure to be consistent in how you import files in your own package.
Wrong:
In file foo.dart:
import '../path/to/a.dart';
In file bar.dart:
import 'package:my_package/a.dart';
This results in an error.
Correct:
In file foo.dart:
import 'package:my_package/a.dart';
In file bar.dart:
import 'package:my_package/a.dart';
This will be fine.

Could not load lang::java::jdt::Java

When trying to import JAVA modules I receive an error:
// JAVA imports
import lang::java::jdt::Java;
import lang::java::jdt::JDT;
import lang::java::jdt::JavaADT;
Could not load lang::java::jdt::Java
In the console:
rascal>import lang::java::jdt::Java;
|prompt:///|(0,29,<1,0>,<1,29>): Could not import module lang::java::jdt::Java: can not find in search path
Advice: |http://tutor.rascal-mpl.org/Errors/Static/ModuleImport/ModuleImport.html|
I'm using Eclipse and am trying to use the AstNode datatype. Any ideas?
The JDT modules have been replaced a while back by the m3 model.
While they are a bit different, the AST part should be comparable.
Check the m3 ast documentation and the Measuring java recipe.
Is this an old project you are trying to get up and running?

Resources