imports

Imports or Long Class format?

Should I use this. Imports System.IO Dim myStream As New Stream or this.. Dim myStream As New System.IO.Stream Does it make any difference to performance / memory usage? ...

Problem with imports in java?

I'm having a problem with imports in one of my java applications. I've Taken a working JSP out of one Eclipse project, Jar'd up all the classes from that project and put it into a new project. In the new Project I've imported the jar file generated from the original, and pasted the jsp code into a new JSP document. I'm getting "The im...

Documenting a File Format

We're developing an application that receives a lot of it's input from a custom file format we've defined. The input files are produced by an application being developed by a third party so naturally we need to be able to communicate effectively what is and isn't acceptable input into our program. The file has a header portion of 10 li...

Relative imports from __init__ in multi-file Django apps

I have a Django project located at /var/django/project/ where /var/django/ is in the PATH within that project I have: ___init__.py manage.py utils/ __init__.py tools.py utils/__init__.py contains a function named get_preview utils/tools.py contains a function named get_related How can utils/__init__.py import get_related fr...

paths not being consistent python django.

I'm trying to import sorl-thumbnail into my app in django. Now the way that i have the site set up, using mod_wsgi on centos5 with cpanel the path for the apps must have the project name when importing... which is a pain. Obviously this is a cause of concern with portability of the app. I'm importing sorl-thumbnail, in previous apps i'v...

Import a DLL with C++ (Win32)

How do I import a DLL (minifmod.dll) in C++ ? I want to be able to call a function inside this DLL. I already know the argument list for the function but I don't know how to call it. Is there a way of declaring an imported function in C++ like in C# ? ...

pylint seems to not handle "from . import foo" style imports

If I do: from . import foo In a script and run pylint over it, I get: F: 1: Unable to import %r Is there a way a work around for getting pylint to understand this syntax? ...

How do I determine which methods are used by a Java class

I need to provide a report of which APIs are used by our code, and exactly which methods are called. For a Windows DLL, I would use "dumpbin /imports" - is there an equivalent for a Java .class file? javap seems to be the obvious place to look, but I can't find any options that seem to do what I'm after. ...

Imports failing for pylint

I'm testing my project using pylint and currently getting fatal error when importing the internal apps into the project using. According to pylint, the import should be something like from <appname>.models import ... as opposed to what I currently have: from <projectname>.<appname>.models import My problem is that when I use the recomm...

Vim's omnicompletion fails with "from" imports in Python

Omnicompletion for Python seems to fail when there is a "from" import instead of a normal one. For example, if I have these two files: Test.py: class Test: def method(self): pass main.py: from Test import Test class Test2: def __init__(self): self.x = Test() If I try to activate omnicompletion for self.x......

Working of "imports namespace"

I knew from here that we have to do the explicit imports for child namespace because imports will not include the child namespace. But my question is that if I do "imports System" whether it will include all the classes/methods inside that namespace in the IL/native code or only referred ( used inside the application) will be included ...

imports java.util.zip in a vb.net project.

I need to import java.util.zip for my project to zip and unzip chosen files/folders in vb.net. But when i say imports java.util.zip, i get the error "Namespace cannot be found". I went in the add reference and checked in both .net and COM components bout found nothing for java. What dll would i need to make this work? thanks ...

Find out which classes of a given API are used

In a Java Project of mine, I would like to find out programmatically which classes from a given API are used. Is there a good way to do that? Through source code parsing or byte code parsing maybe? Because Reflection won't be of any use, I'm afraid. To make things simpler: there are no wildcard imports (import com.mycompany.api.*;) anyw...

VB.NET to C#: Imports/using

Is there a way to "Import" a static class in C# such as System.Math? I have included a comparison. Imports System.Math Module Module1 Sub Main() Dim x As Double = Cos(3.14) ''//This works End Sub End Module Vs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Math; /...

Unused imports in .NET

The VB.Net IDE allows me to scan for unused references. But I also have a lot of unused imports in my application. Is there a way to scan for unused imports in all classes, or does having an unused import not hurt the performance of my application? ...

Getting Disk Size Properly

I am trying to get the physical device size of a connected USB flash drive. I have tried using WMI. ManagementObjectSearcher mosDisks = new ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive WHERE Model = '" + cmbHdd.SelectedItem + "'"); foreach (ManagementObject moDisk in mosDisks.Get()) { lblCa...