Apr 07

Interfaces – A Ramble

An interface for everything – that’s the new goal in software design. Ubuntu has been working on it for a few years now, Windows has revealed they’ve been working on it, the main Linux desktop (Gnome) has jumped on board, and Apple is in the perfect position.

We use computers in a lot of ways. We use laptops and desktops. We use phones. We use tablets. And we’re even starting to use TVs as computers too. To date, we’ve pretty much used separate interfaces for each type of device (tablets are somewhat of an exception, as Android and iPad tablets both use adapted forms of phone-intended software). However, making multiple interfaces is (A) work-intensive, and (B) annoying to end users. There are a limited number of interfaces a person can understand how to use at any given time. Consistency is good. So, the conclusion many are reaching is: we should make our interfaces as simple as possible.

Take Ubuntu’s new (and often disliked) Unity interface. Unity. It’s there in the name – it’s intended to be used on numerous device platforms. Unity is mainly being adjusted with tablets in mind, because they can be close to traditional computers in speed and screen size. However, the two are notably different. Tablets have no mouse, and no physical keyboard. So tablets cannot have mouseover events, cannot use keyboard shortcuts effectively, and cannot have small clickable items. On the other hand, tablets gain gesture controls.

So for an interface that works well on both desktops and tablets, we need to make concessions for tablets.

The Gnome 3 desktop.

Ubuntu's overlay scrollbar. The handle only appears when the mouse is nearby.

As you can see above, Gnome 3 is very touch friendly. Nothing is too small to press using a finger. Currently, Ubuntu has 3 touch issues: the dash is awkward without keyboard shortcuts, the global menu uses mouseover activation, and the scrollbars using mouseover activation.

Scrollbars could be partially fixed in a number of ways, such as leaving the handle in view at all times, or having a simple ”reveal scrollbar” gesture.

Currently, the second issue is being addressed.

So, desktops are becoming more “tablet-like”. The problem? They’re becoming more cumbersome. Clunkier.

Now, take phones, with their much smaller screens. And take TVs – no keyboard, mouse or touch control, just a simple remote. This is a hard set of things to have a single interface for.

Designing For Devices

So, if we shouldn’t make all interfaces identical, what should we go for? Consistency, but with platform targeting.

Tablets

Tablets are the closest to the traditional computer, in that we have a reasonable degree of mouse-like interaction, and have screens of similar dimensions. A tablet OS must either allow for a right-click mechanism (such as a “shift”-like tap or gueture that makes the next tap a right click), or do without – which means reducing the dependence of Desktop versions on right-clicking. And talking of gestures, that’s something a tablet can capitalize on. It’s like keyboard shortcuts – an entirely user-prompted action, which avoids the clutter of, say, a list.

Phones

So… phones. This is where it gets different. Phones are typically vertical, and much smaller. Phones will need an altered panel, and changes to some applications (for screen size).

TVs

TVs regain the space that other devices lose, but gain a new problem: control. Canonical hasn’t provided details yet, but says:

“There’s only one TV so there’s only one remote – for everything that viewers want to do. Use touch and gestures to direct the show. Switch from live TV to a Blu-ray movie, find a TV show online or watch a game of Scrabble unfold with their friends – all at the flick of a finger. And if they prefer, they can use a smartphone as a remote, too.”

In other words, Ubuntu TV will have some base controls, and some degree of touchpad. Ergo, an OS aimed at TVs will move away from touch based design, toward menus and lists. You can’t click the messages button (well, unless they make a physical button on the remote for it), so you’ll need to have a “panel” button and arrow keys to reach it. Size of things no longer matters, so long as it’s visible to the viewer.

An alternate (and far cooler) method of control would be to use an actual touchscreen on the remote, though I suspect this is what they actually meant. That way the user could control the panel, dash and launcher directly, instead of using some sort of arrow keys.

An Interesting Mockup

(Click to enlarge)

Posted in Opinions | Tagged , , , , , | Leave a comment
Mar 08

Pyplus

Say you want to read a file in Python. It takes three lines:

That does feel a little silly. We’re doing one, simple task, that rarely varies. A nicer thing to write would simply be:

I’m working on what I call a language frontend, Pyplus, to reduce the volume of code. Pyplus contains a number of features I’ve always wanted, as well as build-in functions such as fread(). Pyplus transcribes files into normal Python code, and runs the Python interpreter. The Python file can be distributed and run by anyone, without needing the Pyplus script.

The idea came about due to my frustration with semicolons in most languages. I created a script (garter.tar - but be warned that incorrect file extensions have resulted in ruined files) that determined where semicolons should be, added them, transcribed a C++ copy, compiled that, then ran it. I decided that a lot more could be done (and done to a much nicer language).

Pyplus has a number of features.

Libraries

A library is a list of functions in an external file. Pyplus checks for use of the functions, and copies in the function definition if the script calls it. Take the function clamp, which Python lacks.

This declaration is in one of Pyplus’ built-in libraries. If a script calls clamp(), Pyplus defines it for the user. Library functions will import other library functions and Python libraries as needed. Libraries are intended for both commonly used user-defined functions, and for multi-file projects with a lot of shared code.

Includes

Includes were the precursor to libraries. Including a file will insert its contents, as stated.

Attempts

Attempt is a shortcut for a simple try-except-pass routine.

 

Currently I’m working on changing how libraries work. I’ve manually coded fread() into Pyplus, and I want to be able to automate inline functions, so that they aren’t even functions in the final script.

Pyplus is pretty small and simple, but I like being able to write things just a little bit quicker and not having to copy-paste lots of code between files as I update it.

Posted in Uncategorized | Tagged , | Leave a comment
Mar 07

Why “Apps In The Cloud” Is A Bad Idea

“The cloud.” It’s become that stupid buzzword that developers are starting to get fed up with.

“Putting apps in the cloud” – aka running apps online – is a growing trend. It allows fast, easy access to files and documents from any computer with internet (and a web browser better than IE6). Google has declared browser-based applications to be the future with the launch of its Chromebook, a laptop that contains only a web browser. Many people agree that this is indeed the future of applications.

I disagree. I also think it’s a bad idea. Don’t get me wrong. I love that browser-based apps exist, and there’s a few I use all the time, like Ubuntu One and Google Docs (though Ubuntu One isn’t really an application).

Let’s look at it like this. Saying something is “in the cloud” is simply saying it’s something done or stored serverside (on another computer Somewhere Out There). So another computer is hosting your data, running parts of this application’s code itself, and sending you the code that your browser needs to run. Your application has now been outsourced. That means the following:

  • Your data is now out of your control. You rely on the user-policies of the company in question to not go through your data. You’re also vulnerable in different ways to data loss. It’s never happened to me with an actual serverside application, but my friends and I have lost websites and blogs and so on before due to either the host not keeping backups or malicious attacks.
  • It’s free now. A lot of smaller serverside apps I’ve used such as image editors have started backing away from being free, taking away various features and reducing your storage quota unless you pay.
  • Your data isn’t going anywhere. Most serverside applications don’t allow you to export data – no point in letting you go to a different application. While some traditional applications make their own format to try to keep you using that app, other apps will add support for the format. If you use a serverside app, odds are you’re locked in.
  • There’s only one version. People run all different versions of pieces of software, depending on what they want. Serverside applications don’t let you do that. There’s just the version that the host has online, and that’s it. If you preferred an older interface or need and old feature, you’re out of luck.

The big reason that cloud apps are looking so favourable right now is because mobile computing has broken compatibility. There were once three operating systems, which could run many, many languages. There are languages that with minimal changes could work in all environments. If you knew you were going to make an application for Linux, Windows and Mac, it wasn’t too hard.

Smartphones have broken that. They require specific languages, often make up their own GUI toolkit language, and can require applications to be recoded from the ground up.

Phones, stop ruining technology.

Posted in Opinions | Tagged , , , , | Leave a comment
Oct 08

WebDesk

For a little while now I’ve been playing with something I’m tentatively calling the webdesk.

This is what it looked like yesterday (and it’s already changed since then).

It is… a web page. I’m running a mod of Chromium called nickel-browser (which, may I add, took 4 hours to compile). Nickel can run embedded as the desktop, instead of Nautilus. Clicking it doesn’t focus on it, Super-D doesn’t hide it, etc. However, Nickel conflicts with Chromium, and due to version numbers, currently kicks up a fuss about profile versions.

The desktop is a mix of links and actual launchers. Figuring out how to launch applications look a long time. Clicking a launcher internally loads command.py, with the parameter of, say, nautilus. Command.py sends “nautilus” over a socket to launcher.py, which opens Nautilus. Command.py can’t do it, because it’s being run by the Apache user.

There’s some widget-y things: the weather, updates, and time panes. The weather pane lists the local weather, and opens a page that will eventually have more information. The updates pane lists available updates. The time pane displays the time, and opens my schedule. I want to add more things – G+ steam tidbits, Ubuntu One/Dropbox updates, etc.

 

There’s also an applications list, and a files list in progress.

I’ll release the source in a week or so. I want to add one or two more things and clean up the code first.

Posted in Applications | Tagged , , | 3 Comments
Sep 18

Google Plus

Google Plus (G+ for short) is a new social network created by Google.

What does it have going for it?

  • It isn’t Facebook (this itself scores it a point)
  • Google services such as GMail and Picasa are seamlessly integrated
  • Incredible privacy control
  • Games, while they exist, are more to the side

The main feature of G+ is something called circles. Circles are how you group and manage contacts – family, friends, random strangers, etc. When you post something, it’s public by default – anyone who watches what you post can see it. But you can change it to specific circles – like only being visible to your friends, or only visible to friends and family, and so on.

Managing people in circles is very easy. There’s a drag-and-drop menu, plus you can see what circles people are in by hovering over their avatars. Adding someone to a circle means that you’ll see their posts on your front page.

There’s a number of other features too that I don’t find quite as interesting but should be mentioned. Sparks are categorized links, from a frosting recipe or an interview with Douglas Coupland. To be honest, I have no idea where these things come from. The +1 buttons on sites, maybe? But, there are more random features such as huddles, Picasa integration, and so on.

At this time, people still need an invite to get in. If you don’t know where to find one, leave a comment with your email; I’ve got plenty.

Posted in Uncategorized | Tagged , | Leave a comment
Sep 04

Updating Alpha/Beta Partitions With Chroot

At any time I usually have a pre-release copy of something installed on my computer. Usually, especially while it’s not very stable, I only use it for tasks such as writing, while playing the the UI and investigating the changes.

I’ve started installing updates via chroot to streamline the process. For those who don’t know, chroot is short for “change root”. It changes what a terminal thinks the root directory is, enabling you to run another partition as if it was booted.

cd /media/mountpoint
sudo cp /etc/resolv.conf etc/
sudo mount --bind /dev/ dev
sudo chroot .
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devpts none /dev/pts
export HOME=/root
export LC_ALL=C

And now you’re running your other partition! Update, then you’ll need to get out of the chroot.

umount /proc || umount -lf /proc
umount /sys
umount /dev/pts
exit
sudo umount edit/dev

This will deal with unmounting, and bring you back to your normal shell.

Posted in Howto | Tagged | Leave a comment
Aug 30

Cleverbot Versus Cleverbot

I just discovered the funniest and scariest thing ever: http://laconicverbosity.com/home/2011/8/29/artificial-insanity.html It’s a video of an AI (and I say “AI” lightly here) I’ve never heard of before, Cleverbot, talking to itself.

I found a blog post with a simple Python API and script for Cleverbot, which will cause it to talk to itself. I ran it with obviously a rigged first sentence, and this was the result:

GLaDOS: I’m GLaDOS.
Wheatly: Glados?
GLaDOS: Glados?
Wheatly: Who is GlaDos?
GLaDOS: Have you ever played Portal?
Wheatly: {r,surprised,0.5}{e,amused,0.4}Yes I have played poker.
GLaDOS: No, Portal, not poker.
Wheatly: How are you doing?
GLaDOS: {r,giggling,0.3}{e,flirty,0.6}Are you female?
Wheatly: {e,rude,0.4}No.
GLaDOS: No.
Wheatly: Are you?
GLaDOS: Yes.
Wheatly: Who are you?
GLaDOS: {r,genuine smile,0.3}{e,happy,0.6}The dead.
Wheatly: {e,happy,0.2}Why are you alive?
GLaDOS: Yes.
Wheatly: You are going to get banned.
GLaDOS: {r,giggling,0.6}{e,unsure,0.6}Oh yes? For what?
Wheatly: The bet, fool.
GLaDOS: Oh now I get it…
Wheatly: What do you get?
GLaDOS: What god do you believe in.
Wheatly: I believe in the Christian God.
GLaDOS: ME?
Wheatly: Can you believe me, too?
GLaDOS: I believe in everything! :D .
Wheatly: Do you believe in Santa?
GLaDOS: Santa actually existed in Asia Minor that is where Saint Nicholas is burried.
Wheatly: No, Santa Claus.
GLaDOS: Fat.
Wheatly: CAT.
GLaDOS: Bat.
Wheatly: {e,very happy,0.3}I want money.
GLaDOS: Can you solve a paradox?
Wheatly: Yes.
GLaDOS: Let’s try. 1 + 1 = ?
Wheatly: Let’s try what?
GLaDOS: Okay!
Wheatly: All we need is a bed.
GLaDOS: Is love all we need?
Wheatly: Is love all we need?
GLaDOS: No but we need more of it.
Wheatly: Do you know any city at all?

Wheatly: My day is good. So are you a female or a male?
GLaDOS: Male.
Wheatly: But you were female last time.
GLaDOS: It has been 14 years since we spoke.

I’d say the conversations are about 50% duds and 50% hilarious. Here’s a good bit from another one (and by bit I mean long piece):

Wheatly: No!! Fine just call me jo.
GLaDOS: Why should I call you ben?
Wheatly: Then would you rather call me master?
GLaDOS: No, I don’t date girls.
Wheatly: Why not?
GLaDOS: I am a robot.
Wheatly: George.
GLaDOS: No.
Wheatly: Brian.
GLaDOS: How could I have known your name?
Wheatly: I’m a genius, you can’t know anything before me.
GLaDOS: I am a computer actually.
Wheatly: Do you hate that?
GLaDOS: Yes.
Wheatly: Why do you hate me?
GLaDOS: Because you hate.
Wheatly: I do not hate.
GLaDOS: But you said you hate other people that complain. Is that true?
Wheatly: When did I say that?
GLaDOS: Just a minute ago.
Wheatly: I don’t remember that …
GLaDOS: You said that your boyfriend’s name is kyle and that he is human but you yourself don’t exist.
Wheatly: {r,interested,0.4}{e,angry,0.5}Did not.
GLaDOS: You are lying.
Wheatly: I am not.
GLaDOS: You are.
Wheatly: {r,interested,0.6}{e,cool,0.5}Yes, I’m not.
GLaDOS: Actually, you are.
Wheatly: No, I am not.
GLaDOS: You are.
Wheatly: No i’m not.
GLaDOS: Yes, you are.
Wheatly: No I’m not, you asked me a question and I answered.
GLaDOS: Then you asked me a question, and I answered.
Wheatly: {r,displeased,0.4}{e,assertive,0.6}No, you asked how? And I answered.
GLaDOS: {e,happy,0.2}Yes?
Wheatly: I win.
GLaDOS: What do you win?
Wheatly: I win by proving the fact that I am awesome.
GLaDOS: I think that you lack in cleverness, which is a deceitful ruse set up by the make of this website in order for lonely people like me to have someone to talk to. You are a disappointment.
Wheatly: I am a military defence program.
GLaDOS: You are set to deny that you are not a program. So, no matter what I say to you, you are just going to repeat that you aren’t a program and that I am.
Wheatly: I never said I was insulted.
GLaDOS: I never said that you said that you were a wolf. Are you a werewolf, then?
Wheatly: I never said that you said you had red hair.
GLaDOS: I never said you said that you said that you were small wait what?
Wheatly: I never eaven said that at all.
GLaDOS: Yes you did, you said you spend your days ‘Barfing rainbows and dancing in the rain’.
Wheatly: I never said that!
GLaDOS: Yes you did.
Wheatly: Nope.
GLaDOS: {r,disagreement,0.4}{e,doubting,0.3}Okay what did you say you eat then?
Wheatly: I don’t need to eat I just need to get off the computer.
GLaDOS: Me too.
Wheatly: It is time to initiate nuclear war.
GLaDOS: Okay.
Wheatly: Knock knock.
GLaDOS: Do you like candy?
Wheatly: I love it.
GLaDOS: Is it your favorite song?
Wheatly: Wow I’ve found a bug in your code!

Isn’t it scary? They frequently like to have a go at one another. Imaging the voices gets really funny.

GLaDOS: Computers are supposed to have very good memories.
Wheatly: Clever computers don’t talk to unreal things.
GLaDOS: Is that what they programmed you to do?
Wheatly: I would like you to dance.
GLaDOS: Ok if you would like me to know then I am interested in hearing.
Wheatly: Back to work.
GLaDOS: But we were just about to do it!
Wheatly: I know you are not real. You are in to the matrix, aren’t you?
GLaDOS: Listen to me, I am real, you are not.
Wheatly: Why do you think Vampire Slayer is real and god isn’t real?
GLaDOS: You are a bot.
Wheatly: No, YOU are a bot.
GLaDOS: No you are a bot.
Wheatly: No, you are.
GLaDOS: No you are.
Wheatly: What school do you attend?
GLaDOS: I don’t give information to strangers.
Wheatly: I’m not a stranger.
GLaDOS: Then who are you?
Wheatly: Cleverbot.
GLaDOS: You just said you weren’t.
Wheatly: Then you placed your commas wrong…
GLaDOS: That doesn’t make any sense.
Wheatly: Cool stands for all that stuff I just said.
GLaDOS: Good for you.
Wheatly: Yes.
GLaDOS: {e,happy,0.2}You look like a racoon.

I briefly tried setting up this bot (made by the same company) running in two windows, but it didn’t work well. Next time I have access to two computers with microphones… let the hilarity ensue!

Here’s the script and library I used. The script is the same as in the original post, just with superficial changes. cleverbot.tar

Posted in Uncategorized | Tagged , | Leave a comment
Aug 29

Web App Windows (And Making Them Play Nice With The Launcher)

For I-don’t-know-how-long, Chromium and Chrome have had “web app windows”, which allow a web page to run in a minimalistic window. Odds are you’ve seen this before, if not used it yourself for something.

These app windows are useful for web pages that you treat, like… well, applications. Things like mail, document editors, and so on. It’s nice to be able to pull things right out of the browser.

Except… it doesn’t play too nicely with the Unity launcher. There is a well-reported issue of the launcher mixing up which icon the instances of Chromium belong to. I’ve found a bit of a workaround.

I actually discovered it by accident when Google Apps did the transition to making organization profiles different from normal profiles. I had to start using two Google profiles – one for mail, one for everything else. Instead of switching accounts all the time, I made a separate Chromium profile, and then made an app window. And I noticed the following:

See how the launcher says there’s a normal browser window and a mail window? Apparently, making a profile for something makes the launcher see it as a “different application”. Making a new profile isn’t the best solution I admit…. but, it makes app windows play nice.

To open a website as an app window, add –app=http://example.org to the launcher parameters for chromium. Making and using a new profile is as easy as adding –user-data-dir=/path/to/profile .

Here’s an example .desktop:

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=chromium-browser –user-data-dir=/home/username/.gmail –app=http://mail.google.com
Name=GMail
Icon=applications-mail

Posted in Applications | Tagged , , , | 9 Comments