I installed the PhotoViewer as explained in: https://github.com/sarriaroman/photoviewer
When I add import like this the project:
import {PhotoViewer} from 'ionic-native';
it doesn't compile and it says that PhotoViewer is not part of 'ionic-native'
Anyone knows why?
import { PhotoViewer } from '#ionic-native/photo-viewer'
http://ionicframework.com/docs/native/photo-viewer/
Fix your import. Just 'ionic-native' won't work.
Related
I'm getting this error on the airflow UI. the code line I've entered is:
from airflow.contrib.sensors.file_sensor import FileSensor
any ideas?
found nothing on google.
thanks
Are you using an Airflow version < 1.10, e.g. 1.9?
In that case, try the following:
from airflow.contrib.operators.fs_operator import FileSensor
I tried this in v1.10.9 and the following both work.
from airflow.contrib.sensors.file_sensor import FileSensor
from airflow.contrib.operators.fs_operator import FileSensor
See the following links for reference:
https://github.com/apache/airflow/blob/v1-9-stable/airflow/contrib/operators/fs_operator.py
https://github.com/apache/airflow/blob/v1-9-stable/airflow/contrib/operators/init.py
As suggested I installed using
npm install #reactivex/rxjs#5.0.0-beta.11
I can import almost everything this way:
import { Observable, Subscriber } from '#reactivex/rxjs';
but not WebSocketSubject. I've tried:
import { WebSocketSubject } from '#reactivex/rxjs';
import { WebSocketSubject } from '#reactivex/rxjs/observable/dom';
... and many other variations.
dom is not a file, but a folder, so there will nothing to import :)
Try this one:
import { WebSocketSubject } from '#reactivex/rxjs/src/observable/dom/WebSocketSubject';
The import will give you the TypeScript source file, but I would recommend installing rxjs#5.0.0-beta.11 rather than #reactivex/rxjs so you can do this:
import { WebSocketSubject } from 'rxjs/observable/dom/WebSocketSubject';
The above import will give you the .js file, not the .ts file. Autocompletion and all the good TypeScript stuff will still work, because the package has the .d.ts files!
One more tip: If you having problems finding the correct import path:
Go to node_modules/[<organization_name>/]<package_name> (the organization name is optional, they all start with #).
This is your starting point for all imports, from there you can append any folder/file path to the [<organization_name>/]<package_name> and the import should work.
But if you only point to the import statement to [<organization_name>/]<package_name> Typescript will pick up the real path to the import file from the main property of the package.json. Which in the case of #reactivex/rxjs points to index.js and that file again will do a require('./dist/cjs/Rx'). So when you do #reactivex/rxjs the path gets resolved to node_modules/#reactivex/rxjs/dist/cjs/Rx.js.
Hope this explaination wasn't to confusing, but the path resolution sometimes can be :-x
Simple question I am trying to import Java.io.* to use
BufferedInputStream
FileOutputStream
BufferOutputStream
However even when I import them I get the following error:
"The package “java.io.BufferOutputStream” does not exist. You might be missing a library."
What am I missing here?
Its cool guys it was a classic FAIL... java typo.
it should be:
import java.io.BufferedOutputStream
I try to call the ExpFloat64() function of the rand package (http://golang.org/pkg/rand/). However, it gives following error "prog.go:4: imported and not used: rand prog.go:7: undefined: ExpFloat64". Can anybody help me why is it giving error ? Code given below.
package main
import "fmt"
import "rand"
func main() {
fmt.Println(ExpFloat64())
}
The error message explains it perfectly - in Go, you can't import packages and not use them. Here, it says you're importing rand and not using it, so either use it or don't import it. Your main function should be:
fmt.Println(rand.ExpFloat64())
To add to what Chris Bunch said, if you really wanted to use the names in the package (e.g. ExpFloat64) directly without using the package name, you can do this:
import . "rand"
With halfdans advice, I was successfully able to use goinstall github.com/hoisie/web.go without any errors after installing git first. However, now when I try to compile the sample code given, go is not finding the web package. I get the error,
main.go:4: can't find import: web
On this code
package main
import (
"web"
)
func hello(val string) string { return "hello " + val }
func main() {
web.Get("/(.*)", hello)
web.Run("0.0.0.0:9999")
}
Is there something special I need to do in order for it to recognize the package? I found the package source at $GOROOT/src/pkg/github.com/hoisie/web.go/web. I tried github.com/hoisie/web.go/web as the import and it still did not like that.
If you install web.go through goinstall, you need to do:
import "github.com/hoisie/web.go"
Goinstall is still an experimental system. It would be nice if you didn't have to include the full path.
import web "github.com/hoisie/web.go"