I'm a beginner in the developers world and i'm getting myself ready with Udemy Assit Video tutorial by Paul Dichone so i'm having a little problem which i need help on.
this is what am supposed to import
'import: ./ui/home.dart'; in containers and layouts so i'm using visual studio code and what it gives me is
'import 'package:intro_layout_containers/ui/home.dart';
How am i going to get it right?
These two are equivalent.
It is just a different syntax:
import './ui/home.dart'; is a relative import
import 'package:intro_layout_containers/ui/home.dart'; is an absolute import.
But the imported file is the same
Related
I'm trying to learn Gensim using its site.
There is a function named 'remove_stopword_tokens' which is useful for my research.
Now, although the module is defined and is present on their website (exact link: link),I can't import it on my colab
Note: This is my code:
import gensim
from gensim.parsing.preprocessing import remove_stopword_tokens
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-dbd838c83237> in <module>
----> 1 from gensim.parsing.preprocessing import remove_stopword_tokens
ImportError: cannot import name 'remove_stopword_tokens' from 'gensim.parsing.preprocessing' (/usr/local/lib/python3.7/dist-packages/gensim/parsing/preprocessing.py)
---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the
"Open Examples" button below.
updated & corrected answer
You've run into a limitation of Google Colab - it may not have the most-recent version of libraries.
You can see this by checking what the value of gensim.__version__ is. In my check of Google Colab right now (September 2022), it reports 3.6.0 – a version of Gensim that's about 4 years old, and lacks later fixes & addtions. The remove_stopwords_tokens() function was only added recently.
Fortunately, you can update the gensim package backing the Colab notebook yourself, using a shell-escape to run pip. Inside a Colab cell, run:
!pip install gensim -U
If you'd already done an import gensim, it will warn you that you must restart the runtime for the new code to be found.
Note that for clarity reasons you might choose to prefer using more-specific imports, as many project style guides suggest, rather than doing any broad top-level import gensim at all. Just mport the individual classes and/or functions you need, specifically & explicitly. That is, just:
from gensim.parsing.preprocessing import remove_stopword_tokens
# ... other exact class/function/variable imports you'll use...
remove_stopword_tokens(sentence)
On the other hand, if you want things simple-but-sloppy (not recommended), once you import gensim, it has already (via its own custom initialization routines) imported all of its submodules for you. So you could do:
import gensim # parsing & all gensim's other submodules now referenceable!
gensim.parsing.remove_stopword_tokens(sentence)
(Pro Python programmer style tends not to do this latter approach, of prefixing all in-the-actual-code calls with long dot-paths.)
I am trying to import Temenos T24 versions from DataBase to Design Studio. I can easily import all kinds of data using import option in DS, except T24 Versions which are not importing. And while importing I got error message like "Unable to import, Unordered add not supported". Any idea regarding the import versions in data.eson format?
You need to import T24 Versions using option "Import T24 Screens", and you need to import the versions, i.e. screens under "xxxxx-models" project. Best to create a separate folder, like "L3" under your "-models" project.
Same goes for Enquiries, Menus, Composite Screens and Tabbed Screens.
TL;DR:
Using Rollup, can I import D3 like Debug or can I only build a custom library?
Background
I'm trying to build my first webapp with Rollup, D3 (v4 - ES2015) and others. In search of an education, I followed Jason Lengstorf's tutorial. There I learned how to import Debug (CommonJS) and use its facilities. Works like a champ. I then tried to use D3 in the same way, only there are no default exports so used import * as d3 from 'd3' instead of the import debug from debug-style. For love or money I can't get it to work. I keep getting errors that look like:
'request' is not exported by
node_modules/d3-request/build/d3-request.js
https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
I opened an issue with the Rollup guys. They are busy and gave me what they could — and I remain stumped. Both of Mike Bostock's examples (I and II) just show how to build custom bundles, not how to import into working code a la Debug (which is, again, CommonJS not ES2015 like D3). Is that the only way to use it? I have not experimented with another ES2015 library (not that I know any) so I don't know if this is D3-specific or I just don't understand how to deal with ES2015 libraries generally (or just simply don't understand browser-based architecture period).
Follow-on questions
Is there a web app architecture tutorial/book/something that includes ES2015-specific issues?
There seems to be as many project structures out there as people coding. Is there One True Church? Do I just have to keep bleeding from my eyes until I get my own, phoenix-like kung fu about all this (reference Jose Aguinaga's piece)?
New Go programmer here -- apologies if this is well worn territory, but my google searching hasn't turned up the answer I'm looking for.
Short Version: Can I, as a programmer external to the core Go project, force my packages to be imported with a specific name. If so, how?
Long Version: I recently tried to install the bcrypt package from the following GitHub repository, with the following go get
go get github.com/golang/crypto
The package downloaded correctly into my workspace, but when I tried to import it, I got the following error
$ go run main.go main.go:10:2: code in directory /path/to/go/src/github.com/golang/crypto/bcrypt expects import "golang.org/x/crypto/bcrypt"
i.e. something told Go this package was supposed to be imported with golang.org/x/crypto/bcrypt. This tipped me off that what I actually wanted was
go get golang.org/x/crypto/bcrypt
I'd like to do something similar in my own packages — is this functionality built into Go packaging? Or are the authors of crypto/bcrypt doing something at runtime to detect and reject invalid package import names?
Yes it's built in, I can't seem to find the implementation document (it's a relatively new feature in 1.5 or 1.6) however the syntax is:
package name // import "your-custom-path"
Example: https://github.com/golang/crypto/blob/master/bcrypt/bcrypt.go#L7
// edit
The design document for this feature is https://docs.google.com/document/d/1jVFkZTcYbNLaTxXD9OcGfn7vYv5hWtPx9--lTx1gPMs/edit
// edit
#JimB pointed out to https://golang.org/cmd/go/#hdr-Import_path_checking, and in the go1.4 release notes: https://golang.org/doc/go1.4#canonicalimports
I am following this tutorial:
http://www.raywenderlich.com/25205/beginning-unity-3d-for-ios-part-13
In the middle of it, there is
Assets\Import Package\Scripts\SmoothFollow.js
part.
but I guess that menu is gone for Unity 5?
Where did SmoothFollow.js go ??
You have to install the Standard Assets to get the standard import packages.
See here: http://answers.unity3d.com/questions/917023/unity-5-standard-assets-are-missing.html