What’s the difference between import java.util.*; and import java.util.stream;?

I doubt that the second attempt (import java.util.stream;) works. As JonSkeet pointed out in their comment, it should result in a compilation error: error: cannot find symbol. Maybe you wanted to import java.util.stream.*;? To the actual question: If we import with a wildcard, that is the asterisk (*) character, only the direct classes in this package will be imported, not the … Read more

Why java unknown: import org.apache.commons.codec.binary.Base64;?

You need to add the Apache Commons Codec library to your project. You either need to download the *.jar file and add it to the project folder and project configuration or you let your build processor automatically download it. See https://mvnrepository.com/artifact/commons-codec/commons-codec/1.9 Latest is version 1.15 This website provides a download link for the *.jar file as well … Read more

Python circular importing?

I think the answer by jpmc26, while by no means wrong, comes down too heavily on circular imports. They can work just fine, if you set them up correctly. The easiest way to do so is to use import my_module syntax, rather than from my_module import some_object. The former will almost always work, even if my_module included imports us back. The latter … Read more

Java Package Does Not Exist Error

Are they in the right subdirectories? If you put /usr/share/stuff on the class path, files defined with package org.name should be in /usr/share/stuff/org/name. EDIT: If you don’t already know this, you should probably read this doc about understanding classpath. EDIT 2: Sorry, I hadn’t realised you were talking of Java source files in /usr/share/stuff. Not only they need to be in the … Read more

The difference between “require(x)” and “import x”

This simple diagram will help you understand the difference between require and import. Apart from that, You can’t selectively load only the pieces you need with require but with import, you can selectively load only the pieces you need, which can save memory. Loading is synchronous(step by step) for require on the other hand import can be asynchronous(without waiting for previous import) so it can perform a little better … Read more

How do I import an SQL file using the command line in MySQL?

Try: Check MySQL Options. Note 1: It is better to use the full path of the SQL file file.sql. Note 2: Use -R and –triggers to keep the routines and triggers of original database. They are not copied by default. Note 3 You may have to create the (empty) database from MySQL if it doesn’t exist already and the exported SQL don’t contain CREATE DATABASE (exported … Read more

Call a function from another file?

There isn’t any need to add file.py while importing. Just write from file import function, and then call the function using function(a, b). The reason why this may not work, is because file is one of Python’s core modules, so I suggest you change the name of your file. Note that if you’re trying to import functions from a.py to a file called b.py, … Read more

How do I import an SQL file using the command line in MySQL?

Try: Check MySQL Options. Note 1: It is better to use the full path of the SQL file file.sql. Note 2: Use -R and –triggers to keep the routines and triggers of original database. They are not copied by default. Note 3 You may have to create the (empty) database from MySQL if it doesn’t exist already and the exported SQL don’t contain CREATE DATABASE (exported … Read more