Friday, April 15, 2011

How to move documents and list items in Windows SharePoint Services?

I need to provide users with an easy way to move documents and lists items in WSS 3.0. They want to be able to move across lists, sites and site collections without loss of version history, metadata, and author/date info. This functionality is unfortunately not available OOB. Anyone know a good solution/product?

From stackoverflow
  • None of the products out there can do it and even if they do, all of them would modify the dates and the by's (modified by). We developed a custom solution to do that.

  • Ok, we also ended up developing a custom solution to meet the requirements of the customer. It turned out pretty good and we decided to make a small product out of it. For those interested a free version is now available @ www.sharepointproducts.com However, the full version is not free.

    Kirk Liemohn : Look slick, Lars. Nice job.

How to best execute a set of methods even if an exception happens

In a current Java project we have code similar to the following example:

try {
    doSomeThing(anObject);
}
catch (SameException e) {
    // Do nothing or log, but don't abort current method.
}

try {
    doOtherThing(anObject);
}
catch (SameException e) {
    // Do nothing or log, but don't abort current method.
}

// ... some more calls to different method ...

try {
    finallyDoYetSomethingCompletelyDifferent(anObject);
}
catch (SameException e) {
    // Do nothing or log, but don't abort current method.
}

As you can see, several different method are called with the exact same object and for every call the same exception is caught and handled the same (or in a very similar) way. The exception is not re-thrown, but may only be logged and then discarded.

The only reason why there is a try-catch around every single method, is to always execute all of the methods, no matter if a previously executed method failed.

I don't like the above code at all. It takes up a lot of space, is very repetitive (especially the logging done in the catch-block; not presented here) and just looks bad.

I can think of some other ways to write this code, but don't like them very much, either. The following options came to my mind:

Loop-switch sequence / for-case paradigm

(See Wikipedia or The Daily WTF)

for (int i = 0; i <= 9; i++) {
    try {
     switch (i) {
      case 0:
       doSomeThing(anObject); break;
      case 1:
       doOtherSomeThing(anObject); break;
      // ...More cases...
      case 9:
       doYetSomethingCompletelyDifferent(anObject); break;
     }
    }
    catch (SameException e) {
     // Do nothing or log, but don't abort current method.
    }
}

This is obviously bad code, very error-prone and looks amateurish.

Reflection

Use reflection to get Method objects for the methods to call and store them in a list in the order they are supposed to be executed. Then iterate over this list and call the method using anObject as only parameter. The exception is handled inside of the loop.

I don't like this approach, as bugs (for example typos in the method names) only pop up during runtime and the Reflection API is somewhat chatty.

Functor

Create a Functor class like this:

private class Functor
{
    void doStuff(MyObject object) throws SameException;
}

Then create a list of Functor objects that call the methods. Like this:

List<Functor> functors = new ArrayList<Functor>();

functors.add(new Functor() {
    @Override
    public void execute(MyObject anObject) {
     doSomeThing(anObject);
    }
});

functors.add(new Functor() {
    @Override
    public void execute(MyObject anObject) {
     doOtherSomeThing(anObject);
    }
});

Later, iterate this list and call execute() on every Functor object. I can summarize my feeling about this approach with two words: Code bloat.


As I don't really like all four approaches, I would like to discuss this problem here. What do you feel is the best approach? How did you solve similar problems in the past? Is there maybe a much simpler solution I missed completely?

From stackoverflow
  • The functor approach is the nicest one to my mind - it's just a shame that Java doesn't have a nicer way of representing closures or delegates. That's basically what you're really after, and in C# (and many other languages) it would be trivial.

    You can cut down on the physical bloat somewhat by using something like:

    Functor[] functors = new Functor[] {
        new Functor() { @Override public void execute(MyObject anObject) {
            doSomeThing(anObject);
        }},
        new Functor() { @Override public void execute(MyObject anObject) {
            doSomeOtherThing(anObject);
        }}
    };
    

    The whitespace collapsing here may well be against the style guide you're using, but I think it makes the code easier to actually read, in that you can see the meat more easily.

    Better start lobbying for closures in Java 8 ;)

    Michael Myers : The bloat is even worse than that--you (and he) forgot the throws clause.
    Tobias Müller : Wow, you are fast! :) I also thought about closures/delegates. But, as you said, the most similar construct Java has to offer are functors. Maybe you are right about using a code formatting that is best for reading, but does not necessarily respect the style guide we use.
    Tobias Müller : @mmyers In the original code the exception caught is a RuntimeException. So this is not a problem in this particular case. (In others it may be, of course.)
    Jon Skeet : Style guides should be used as "pretty stern guides" rather than "absolutely concrete rules" IMO. Just occasionally, breaking the guidelines can make life a lot nicer. (switch/case can have this, if each case is a single return statement. Put each case/return on a single line.)
    Michael Myers : Another note: The @Override annotation isn't strictly necessary here. If the anonymous classes fail to implement the interface, they will fail to compile anyway. So that's a tiny bit less clutter.
    Sandman : And another note: Functor here doesn't need to be a class, it should be an interface
  • I would advocate the refactoring approach (or "Why did we get here in the first place?"):

    Consider why the individual methods can throw the exception after doing "stuff" with myObject and that exception can then be safely ignored. Since the exception escapes the method, myObject must be in an unknown state.

    If it's safe to ignore the exception, surely it must be the wrong way to communicate that something went wrong in each method.

    Instead, maybe it's each method that needs to do some logging on failure. If you don't use static loggers, you can pass a logger to each method.

    Tobias Müller : Unfortunately the original exception is of type ConstraintViolationException thrown by (I think) Hibernate. This can not be changed. We could catch and handle the exception in each method. But that would not make the code any better. Ideally I would like to only have one catch-clause for all calls.
    PeterR : But that would mean that nothing got written to the database, so why try and continue with the transaction? Depending on underlying database, it will already be marked for rollback.
    PeterR : Unless you're taking the exception to mean "Object already exists in tabel, so we ignore failure on insert". The right way is to first try and load the object into Hibernates session cache, then execute save (or saveOrUpdate). I know because I've been there myself :)
    Tobias Müller : I'll definitely look into that. It currently works fine with Oracle and Derby. Our use case says that it's ok if some information could not make it into the database. Our input data can sometimes be quite flaky. Some of the later application are ok with it, though. We don't like that either.
    Tobias Müller : We usually do this check ("does it already exist?"). I wonder why we don't do it in this case. Maybe just some precaution. I'll have to ask the original developer (and document it accordingly). But probably it's because "damaged" data is fine in this use case. Well...
  • I agree with PeterR. I find it hard to believe that you really want to continue execution of something after an exception has been thrown. If you do, then something exceptional probably has not actually happened.

    Put another way, exceptions should not be used for logging or flow control. They should only be used when something exceptional has happened that the code at the level where the exception was thrown cannot deal with.

    As such, I would internalize the logging messages and remove the exceptions that are being thrown.

    At a minimum, I think you need to go back and re-understand what the code is trying to do and what business value or rules are being implemented. As PeterR said, try to understand "why did we get here in the first place?" part of the code and what exactly the exceptions mean.

  • Are the methods you're calling under your control? If so, in this special case returning error codes (or objects) might yield to a better overall design than using exceptions:

    handle(doSomething(anObject));
    handle(doOtherThing(anObject));
    // some more calls to different methods
    handle(finallyDoYetSomethingCompletelyDifferent(anObject));
    

    with

    private void handle(ErrorCode errorCode) {
      // Do something about it
    }
    

    and

    private ErrorCode doSomething(Object anObject) {
      // return ErrorCode describing the operation's outcome
    }
    

    This seems less verbose, although not DRY.

    Alternatively, you use some AOP mechanism to intercept the calls to doSomething, doOtherThing and finallyDoYetSomethingCompletelyDifferent with an Around Advice that first handles and then discards the Exception. Combine that with RuntimeExceptions and a pointcut based on some nice descriptive annotation and you perfectly capture what seems to be some kind of hidden crosscutting concern.

    I do confess that I like the Functor approach, tho.

    EDIT: Just saw your comment on one of the answers. I would probably go with the AOP approach in that case.

  • On the first look, I agree with PeterR: if it is safe to ignore the exception that easily, maybe that method should not be throwing an exception at all.

    However, if you're sure that's exactly what you want, say, perhaps you're working with methods from a 3rd party library which insist on throwing specific exceptions, I would opt for the following approach:

    1. create an interface containing all the methods that can be called:

            
      public interface XyzOperations {
           public void doSomething(Object anObject);
           public void doOtherThing(Object anObject);
           ...
           public void finallyDoYetSomethingCompletelyDifferent(Object anObject);
      
    2. create a default implementation class for those methods appropriate methods, possibly refactoring them from some other place:

          public class DefaultXyzOperations implements XyzOperations {
          ... 
          }
      
    3. use a Java Proxy class to create a dynamic proxy on XyzOperations which would delegate all methods to DefaultXyzOperations, but, would have centralized exception handling in its InvocationHandler. I didn't compile the following, but it's a basic outline:

        XyzOperations xyz = (XyzOperations)Proxy.newProxyInstance(
              XyzOperations.class.getClassLoader(),
              new Class[] { XyzOperations.class },
              new InvocationHandler() {
                  public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                       try {
                            method.invoke(new DefaultXyzOperations(), args);
                       }
                       catch(SameException e) {
                           // desired exception handling
                       }
                  }
              });
      
    4. use that proxy instance from then on, simply calling the desired methods

    Alternatively, you could use AspectJ or similar AOP solution to add around advice to all methods of XyzOperations and do the exception handling there.

    Whether you would rather introduce a new dependency, or write proxies manually is up to your personal preference and the total amount of code where you need such behavior.

  • Leaving aside the refactoring issue, AspectJ (or similar) seems the easiest way to transparently catch/report these exceptions. You should be able to configure such that it'll weave the try/catch around the method calls even if you add new ones (the code block above would, I suspect, be quite fragile in the face of someone modifying that code without fully understanding the rationale behind it)

  • If you are going the different code style route, I would stick with a simple:

    try { doSomeThing(anObject); } catch (SameException e) { Log(e); }
    try { doOtherThing(anObject); } catch (SameException e) { Log(e); }
    // ... some more calls to different method ...
    

    Update: I don't see how going with a syntax like the Functor's approach reduces any of the code involved. As mentioned by Jon, java doesn't support a simple syntax to reduce it further. If it were c# there are plenty of variations you can do, all around the fact that there isn't much extra syntax to compose methods like that i.e. an expression like actions.Add(() => doSomething(anObject));

    Phil H : Others disagree, but I'm with you Freddy. The code does what is wanted of it, and it's only aesthetics and a desire to complicate things otherwise. If there were going to be hundreds of these calls, then perhaps Functors or a refactor. But at the moment, leave it alone.
  • Let me elaborate on the functor approach a bit more...

    Depending on the complexity of your app, sometimes it is worth to move part of your business logic to a conf file, where it can be expressed more appropriately and briefly. This way you separate the technical details (the functor creation/invocation, exception handling) from the business logic - the definition of which methods and in what order are to be called.

    In the simplest form it could be something like this:

    mypackage.Action1
    mypackage.Action2
    ...
    

    where ActionX is a class implementing the Functor class (or interface).

Preventing DB password from being accidentally checked into public SVN

Does anyone know of a technique to prevent someone (me!) accidentally committing a file with a public database connection string in it to Google Code. I need to run some unit tests on the database from my local machine (to update the DB schema) but I'm concerned that I'll forget that I've changed the connection to point to the public DB and then check the code into SVN.

Of course it's not likely to happen the first time but probably after 5 or 10 times.

What's the easiest way to handle this?

From stackoverflow
  • I usually create a default config file called something like myapp.config.default, that doesn't contain any passwords, and add that file to the repository instead of my actual configuration file.

  • Allow your configuration data to be overridden by a local config file, some file in your home directory. Include in the application logic a heirarchy of locations for locating the config file.

  • I second Emil H proposal with one addition: you should ignore via svn:ignore-property the correct configuration file

    eg your config-file should reside on:

    ./config/app.conf
    

    then you should ignore this file for subversion:

    svn propset svn:ignore "app.conf" ./conf
    

    and copy the app.conf to app.conf.example and add this file to subversion: cp app.conf app.conf.example svn add app.conf.example

    Now Subversion will never try to add your app.conf file to your repository(and also your colleagues cannot accidentially commit this file!)

  • Here's the solution I use for a web app. First, I don't want to ignore the Web.config file in svn because it contains important information that can and will change. Thus, I pull the connection string out of the Web.Config, place it in a file called WebCS.config and then use the SVN .ignore directive to avoid checking in just that one file.

    To do this, place the following "include" line in the Web.Config:

     <connectionStrings configSource="WebCS.config"/>
    

    Then, create the WebCS.config file and enter the following:

    <connectionStrings>
    <add name="ConnString" 
             connectionString="Data Source=YourServer;Initial Catalog=YourDB;etc..
             providerName="System.Data.SqlClient"/>
    </connectionStrings>
    

    This also makes it easy to update web sites: just upload all but the WebCS.config file (I have a batch file to remove the file after "publishing" the site). You'll then be assured that all of the Web.Config file settings go with you without messing with your connection string AND you'll be assured that your repository isn't missing an important file AND you won't be exposing your connection string.

Difference in the paths in .gitignore file?

I've been using git but still having confusion about the .gitignore file paths.

So, what is the difference between the following two paths in .gitignore file?

tmp/*
public/documents/**/*

I can understand that tmp/* will ignore all the files and folders inside it. Am I right? But does that second line path means?

From stackoverflow
  • If you're using a shell such as Bash 4, then ** is essentially a recursive version of *, which will match any number of subdirectories.

    This makes more sense if you add a file extension to your examples. To match log files immediately inside tmp, you would type:

    /tmp/*.log
    

    To match log files anywhere in any subdirectory of tmp, you would type:

    /tmp/**/*.log
    

    But testing with git version 1.6.0.4 and bash version 3.2.17(1)-release, it appears that git does not support ** globs at all. The most recent man page for gitignore doesn't mention **, either, so this is either (1) very new, (2) unsupported, or (3) somehow dependent on your system's implementation of globbing.

    Also, there's something subtle going on in your examples. This expression:

    tmp/*
    

    ...actually means "ignore any file inside a tmp directory, anywhere in the source tree, but don't ignore the tmp directories themselves". Under normal circumstances, you'd probably just write:

    /tmp
    

    ...which would ignore a single top-level tmp directory. If you do need to keep the tmp directories around, while ignoring their contents, you should place an empty .gitignore file in each tmp directory to make sure that git actually creates the directory.

    Jörg W Mittag : The answer is (3): the manpage clearly says that the glob will be passed un-altered to the system's fnmatch library function. Therefore the behavior of gitignore globs is system dependent.
    emk : You're right--the man page does suggest case (3) is the right answer. But I've encountered quite a few cases where the git man pages are slightly out of date, so I'm not going to commit to a specific answer without reading the code.
  • This depends on the behavior of your shell. Git doesn't do any work to determine how to expand these. In general, * matches any single file or folder:

    /a/*/z
     matches        /a/b/z
     matches        /a/c/z
     doesn't match  /a/b/c/z
    

    ** matches any string of folders:

    /a/**/z
     matches        /a/b/z
     matches        /a/b/c/z
     matches        /a/b/c/d/e/f/g/h/i/z
     doesn't match  /a/b/c/z/d.pr0n
    

    Combine ** with * to match files in an entire folder tree:

    /a/**/z/*.pr0n
     matches        /a/b/c/z/d.pr0n
     matches        /a/b/z/foo.pr0n
     doesn't match  /a/b/z/bar.txt
    
  • ** doesn't work for me.

    But you could create a new .gitignore in that subdirectory :

    tmp/*/.log

    can be replaced by a .gitignore in tmp :

    *.log

  • Just wrote post about function in git everyone wants - http://constantinz.wordpress.com/2009/08/20/git-gitignore-file-missunderstanding/

  • Just wrote post about function in git everyone wants - http://constantinz.wordpress.com/2009/08/20/git-gitignore-file-missunderstanding/

In C++, how can I avoid #including a header file when I need to use an enumeration?

In my C++ header files I try to use forward declarations (class MyClass;) instead of #including the class header, as recommended in many C++ coding standards (the Google C++ Style Guide is one).

Unfortunately, when I introduce enumerations, I can't do the forward declaration any more. Like this:

//// myclass1.hpp ////

class MyClass1
{
    enum MyEnum1
    {
        Enum_A, Enum_B, Enum_C
    };
};

//// myclass2.hpp ////

// I want to avoid this
#include "myclass1.hpp"

// I'd prefer to do this (forward declaration)
class MyClass1;

class MyClass2
{
    // This is o.k.: I only need to forward declare MyClass1
    MyClass1* ptr;

    // This forces me to #include, but I don't want to!
    void func( MyClass1::MyEnum1 e );
};

The best solution I can think of so far is to replace enums with member constants:

//// myclass1.hpp  ////

MyClass1
{
    static const int Enum_A;
    static const int Enum_B;
    static const int Enum_C;
};

//// myclass1.cpp ////

const int Enum_A = 1;
const int Enum_B = 2;
const int Enum_C = 3;

In this case, though, the solution seems worse than the problem.

I'm currently looking through Large Scale C++ Software Design (Lakos) and Working Effectively with Legacy Code (Feathers) for dependency breaking techniques, but I haven't found a good solution yet.

From stackoverflow
  • You can use forward declarations only when you are declaring a pointer. If you are declaring a non-pointer variable, you will have to include the relevant header file.

    Since an enum variable is not a pointer you can't use forward declarations. And I don't think there's an alternative solution.

    David Rodríguez - dribeas : There are other uses of forward declarations, as for example, declaring the signature of a function that takes that type as a parameter. It is just that enums cannot be forward declared: 'class X; X f( X*, X&, X );' compiles fine.
  • This is difficult to do nicely. Perhaps moving enums to a common header file would be a reasonable solution?

    Edit: I know the question asked to avoid including a header file, but there's just no way (AFAIK) to do this. Moving enums to a separate header file at least minimises the amount of stuff in the header file you do need to include. It's certainly better than the craziness suggested in the question!

  • You cannot forward declare enum values - and your workaround is a step down the path to complete madness.

    Are you experiencing any major compilation slowdowns caused by #including headers? If not, just #include them. Use of forward declarations is not "best practice" it is a hack.

    David Rodríguez - dribeas : It is a good practice to forward declare (whenever possible) in headers. That reduces dependencies. If you use an internal class in the signature of your private members and not in public/protected methods then the user does not even need access to the header file that defines the type.
    anon : We will have to disagree.
    David Rodríguez - dribeas : ... cont'd: think as an example of the PIMPL idiom. The whole idea is that the user of the class does not know how/what the internal class is. While that is a very concrete it is also quite graphic. I could work on other examples.
    David Rodríguez - dribeas : Of course, not everyone does agree on every topic :)
    Dave Van den Eynde : I'm with Neil. I don't want to reduce dependencies if they help me find compiler errors sooner than later.
    Michael : Neil, I don't understand your statement about forward decelerations being hacks. If I have a file in which I have a reference to SomeClass*, and I never dereference it, why would I ever want to include that class? If I use a forward declaration, I eliminate the dependency. If I accidentally dereference the pointer, the compiler will shout at me about "incomplete type" and I'll be able to fix it. What the problem with the concept of forward declarations?
  • I don't think (I can be proven incorrect) that you can forward declare an internal type, nor an enumeration. You will need the definition of the enclosing class to use the enum.

    While most style guides enforce not including unnecessary headers, in your case the header is necessary. Other options you can consider if you really want to avoid the inclusion would be defining the enumeration outside of the class and including the header that defines the enum.

  • You can use template arguments to program against 'general' enum types. Much like this:

    // enum.h
    struct MyClass1 { enum e { cE1, cE2, cELast }; };
    
    // algo.h
    // precondition: tEnum contains enumerate type e
    template< typename tEnum > typename tEnum::e get_second() { 
        return static_cast<typename tEnum::e>(1); 
    }
    
    // myclass1.h
    
    // myclass.h
    template< typename tClass1 >
    class MyClass2
    {
        tClass1 * ptr;
        void func( tClass1::e e );
    };
    // main.cpp
    #include "enum.h"
    #include "algo.h"
    int main(){ return get_second<Enum>(); }
    
  • C++0x's strongly typed enums can be forward declared. GCC 4.4.0 and CodeGear C++Builder 2009 support strongly typed enums.

    There are a few enum-like classes floating around like the (proposed but never finalized and accepted) Boost.Enum available for download from the Boost Vault at this link. Since Boost.Enums are classes, they can be forward declared.

    However, just putting enums in a separate file (as in this answer) seems the simplest, best solution (barring C++0x suport).

  • Forward declaration of enumerations has actually been proposed by the C++ standards committee. See this paper (pdf). It would certainly be a good feature!

  • If you are really running into compilation slowdowns because of header inclusion, the other option is to use an int instead of an enum. This is a rather unpopular approach since it degrades type safety. If you do take this approach, then I would also recommend adding code to programmatically do the bounds checking:

    // in class1.h
    class Class1 {
    public:
        enum Blah {
           kFirstBlah, // this is always first
           eOne = kFirstBlah,
           ...
           kLastBlah // this is always last
        };
    };
    
    // in checks.h
    #include <stdexcept>
    namespace check {
    template <typename T, typename U>
    U bounds(U lower, T value, U upper) {
        U castValue = static_cast<U>(value);
        if (castValue < lower || castValue >= upper) {
            throw std::domain_error("check::bounds");
        }
        return castValue;
    }
    } // end check namespace
    
    // in class2.h
    class Class2 {
    public:
        void func(int blah);
    };
    
    // in class2.cpp
    #include "class2.h"
    #include "class1.h"
    #include "checks.h"
    
    void Class2::func(int blah) {
        Class1::Blah blah_;
        blah_ = check::bounds(Class1::kFirstBlah, blah, Class1::kLastBlah);
    }
    

    It's not the prettiest solution, but it does solve the header dependency problem by moving some of the type safety that static compilation gives you into runtime code. I've use similar approaches in the past and found that a check namespace used in this way can make the resulting code almost as readable as enum based code with very little effort.

    The caveat is that you do have to make an effort to write exception-safe code which I recommend regardless of whether you adopt this approach or not ;)

How to get the default printer name with network path

Hi guys, I want to get the default printer name with the network path. Because i am using the network printer as a default printer. So i need this in VB.NET or C#.Net. Kind help needed. Thanks in advance

Sivakumar.P

From stackoverflow
  • Here's a link that tells you what APIs to search for MSDN. And some code too.

  • Try enumerating System.Drawing.Printing.PrinterSettings.InstalledPrinters.

    using System.Drawing.Printing;
    string GetDefaultPrinter()
    {
        PrinterSettings settings = new PrinterSettings();
        foreach (string printer in PrinterSettings.InstalledPrinters)
        {
            settings.PrinterName = printer;
            if (settings.IsDefaultPrinter)
                return printer;
        }
        return string.Empty;
    }
    
  • This does not work too well. I had better experience on more machines with

    DllImport("winspool.drv", CharSet=CharSet.Auto, SetLastError=true)] public static extern bool GetDefaultPrinter(StringBuilder pszBuffer, ref int size);

    StringBuilder dp = new StringBuilder(256); int size = dp.Capacity; if (GetDefaultPrinter(dp, ref size)) { Console.WriteLine(String.Format("Printer: {0}, name length {1}", dp.ToString().Trim(), size)); } else { int rc = GetLastError(); Console.WriteLine(String.Format("Failed. Size: {0}, error: {1:X}", size, rc)); }

Which is the best UI from the movies

I see movies as a rich vein of design ideas to make our interaction with computers better. I'm sure there are many brilliant examples out there, I've put in some of my favourites, I'd like you to let your imagination and memory run free and feed the wiki.

Clearly HAL had a pretty good UI, but it lacks much that we can build on today. HAL's eye

my personal favourite is the data glove UI that Tom Cruise used in Minority report.

Minority Report

The interface that Dekard used to zoom into a photo in Bladerunner was pretty good, and would be feasible today, can't find an image of it - can anyone grab the frame.

The same goes for the Hitchhikers guide to the galaxy - brilliant UI, probably feasible today.

alt text

From stackoverflow
  • multi-touch interface?

  • I like the heads up display robocop has, pretty neat with the targeting,zoom and memory recording etc

  • Take a look at Serial Experiments Lain. It's a cyber-punk anime that is already 10 years old but still right about how the world behave when everyone is connected.

    There is two interesting thematics (it's full of thematics) for you : - the UI of the fictive "Copland OS" that evolves through the episodes (13); - SPOIL : the theme of a network that don't require hardware at all;

    Anyway it's full of interface designs. You can see some premises of the IPhone in this anime.

  • Pretty much any interface that can stream a 3D interactive user interface that you have to fly around slowly in order to find what you need, when a command like "find . -name secrethackerdocuments.*" would do it instantly. Especially if said 3D interface is being streamed over a very low bandwidth internet connection...

    Christian Witts : Hack The Planet!!
  • If you are seriously interested into the future of user interface design, may I recommend a recently started blog to you, "Do What I Dance"?

    http://dowhatidance.wordpress.com/

    "News and Articles on Humane Computer Interfaces and Inspiring UI Design"

  • I nominate the second Matrix movie: you see a half-second snip of Trinity using a green-on-black command line interface.

    Not only are command-line interfaces useful, it also conveys a realistic view of computer security and how the evil hackers work: you run nmap to see what your target is running. They run an old and unpatched (and therefore insecure) version of ssh, which you then run a pre-canned exploit on.

  • Hackers, nothing can beat the Gibson for lunacy.

  • I think the question has a flaw.

    The purpose of a movie is to tell a story. When the story involves computers, the movies has to tell what happens on the computer. Typically, that has to be told to a very broad audience and in very little time. That constrains what you can have the computers display, in a way different from what good real-world user interfaces can do.

    In the real world, you learn how a piece of software works by interacting with it several times. It needs to tell the user what it's doing to some extent, but it can make some assumptions about the user's preexisting knowledge and ability to learn from observation and inference.

    For example, if your mail program has a button labeled "Send this mail", and you press it, and something changes (say, your compose-mail window disappears and you see a small green check mark in your status bar), that might be fine; you don't particularly want a big pop-up box saying "the program worked correctly" every time it does something.

    In a movie, you want to convey that the user is asking the computer to send the mail, that the computer works on it, and then succeeds. The best way to do that is for the screen to show nothing except "SENDING EMAIL..." and then "MAIL SENT."

    That's not useful to work with, however.

    It's known in the usability world that it's generally good to present the user with real-world metaphors, because they help explain to the user what to do and how the system works. It's also known that it's generally desirable to not stick to the restrictions of the real-world objects when they don't serve a useful purpose.

    Consider for instance the Trash Can: that's where you put stuff you want to get rid of. However, you don't need a system to move trash from your private trash can to the public landfill, because that's not how it works.

    In movies, you only care about conveying the idea of how the system works, not about how useful the system is.

    So, the thing that forces movies to display unrealistic user interfaces is the excessive emphasis on conveying in an abundantly clear way what's happening, to the detriment of the system being useful. That's why it's a dangerous idea to let yourself be inspired by the movies in your own designs: the purposes are different (in a way that matters).