Oh hi Slash Art

April 18th, 2012

Inspired (well, pretty much blatantly copied) by a talk I saw yesterday by seb.ly (who I think said that he took it from someone else..?) I made this javascript slash art page: clicky.

I gave it very limited testing so sorry if it looks completely screwy for anyone (and sorry to my girlfriend who said that it nearly broke her pc…), maybe if you leave a comment here I’ll have a look, but it’s very basic, so I make no promises that I can fix it!

It’s actually quite a messy script compared to Seb’s who was showing off computer generated art with just one line of code in a Commodore 64 emulator! From the top of my head the code was something like this:

10 PRINT(205+RANDOM(1)); : GOTO 10

I guess if you know anything about programming for a Commodore 64 then you’ll know how to fix any mistakes I’ve made, but if you don’t then hopefully you get the idea of how it works. If I’m correct then the character code for \ is 205 and / is 206, so it’s just randomly choosing one of those to print and doing it forever.

My code is uglier and has another section just to style it properly. Here’s the javascript:

<script type=”text/javascript”>
(function printLoop() {
setTimeout(function() {
document.getElementById(“console”).innerHTML += String.fromCharCode(47 + (45*(Math.round(Math.random()))));
window.scrollTo(0,document.body.scrollHeight);
printLoop();
},5);
})();
</script>

Here I’ve got a function instead of a go to and the function simply registers another function to be called in 5ms which calls the parent function, causing the loop. The actual printing just appends a character either 47 or 92 for \ and / to a div with id “console” which is defined after the script block as:

<div id=”console” style=”white-space: pre-wrap; word-wrap: break-word;font-size: 40px; line-height: 29px;font-family:courier; letter-spacing: -10px; font-weight: bold;”></div>

The style seems to make it pretty similar to a console output for the few browsers I tried it on. The word wrapping isn’t great outside of Chrome, but I’m sure it’s possible to improve it with effort.

So yeah, that’s how to do slash art that’s one line on a Commodore 64 emulator in nearly a dozen html/javascript lines!

Lin-Kuh-Din-Uh

May 31st, 2011

I went to Thinking Digital 2011 this past week. It was the first conference I’ve been too and was certainly very educational even if it wasn’t immediately useful. Being paid for by my boss and all, I was tasked with writing down what I had learnt over the 2 days of the conference and writing out my notes in expanded form really helped hammer home the bits I’d picked up.

The title of this piece is from a talk given by a founder of professional social networking site Viadeo in which he mentioned that they were given a little boost against their major competitors LinkedIn because people with French as their mother-tongue find it hard to pronounce their name. Now I don’t know that many french people and the guy is from a competitor company so he could be embellishing this a bit, but I quite liked that subtle difference. Read on for more thoughts from Thinking Digital.

Read the rest of this entry »

NSScrollView top-left pinning and isFlipped

August 25th, 2010

Working on the settings page of the application I’m developing at work I stumbled across a rather annoying characteristic of NSScrollViews. The NSScrollView allows you to fit a larger custom view into a smaller view which the user then can scroll up/down/left/right to see all the content in the custom view. For our application we need more space to fit all the settings and so I put the controls into an NSScrollView. The problem that occurs is that when you load the page with the NSScrollView it starts at the bottom-left of the custom view inside. This is pretty irritating, every implementation you see of a scroll view starts at the top left – it’s what everyone expects.

So off to google and Stack Overflow I go, apparently this a very frequently brought up question and as such there’s a solution: flip the view. However, this has rather unfortunate consequences for the poor developer (me!) and an awful lot of the mailing lists and posts I’ve read on the subject seem to suggest that we have to man up and get on with it. I find this rather odd, because the solution I’ve come up with is stupidly simple and I cannot be the only one to figure it out. Read on for an example of the problem and my solution.

Read the rest of this entry »

Reactionary Posters

July 7th, 2010

Joe Alterio has designed 3 posters for the Institute of Physics which change their appearance in the presence/absence of light or heat. They will be put up in schools around the UK in efforts to rekindle children’s fascination with science. Of the three posters, one reacts to heat and the other two to the light. There’s a mention of them being made for sale to the public and I’m sure there’s enough demand, personally I’d love one of the Earth/Moon ones.

You can read the full article and see the posters on Joe’s website here: http://joealterio.com/2010/07/get-physical/

This is the Earth/Moon one. The top half is visible when the lights are on, the other half when they’re off.

Bad. Bad bad bad.

July 7th, 2010

Update: Blizzard have thankfully decided to bench this change for the time being.

Recently (Activision-)Blizzard has updated the Battle.net service. Part of this update is the RealId feature. RealId is supposed to be an all encompassing profile for all games linked with battle.net (Warcraft, StarCraft, Diablo) allowing players to read and broadcast messages amongst their friends. Seems fairly innocent enough, need a 10th player for a WoW raid, grab someone from their Diablo III game, it’s basically Facebook for games (That’s pretty much what they’re aiming for). The implementation is contentious though, the amount of information shared about exactly what you’re doing and who you are friends with is rather over the top and there are no granular controls to change this. This really isn’t a huge problem though – for the most part, people will only become friends with people they trust, alternatively they don’t have to use it at all since it’s voluntary and there are simple alternatives – However, the latest advancement of the RealId programme is rather a step too far. Here’s a snippet from a press release yesterday:

The first and most significant change is that in the near future, anyone posting or replying to a post on official Blizzard forums will be doing so using their Real ID — that is, their real-life first and last name — with the option to also display the name of their primary in-game character alongside it. These changes will go into effect on all StarCraft II forums with the launch of the new community site prior to the July 27 release of the game, with the World of Warcraft site and forums following suit near the launch of Cataclysm. Certain classic forums, including the classic Battle.net forums, will remain unchanged.

A couple of quick things about the WoW forums: There’s nothing forcing you to post on there (there are thousands of other sites you can discuss the game on) but it’s widely read, contains very useful guides contributed by the community and allows communication with Blizzard themselves. From late July, every post anyone makes will be under the account holders name. This is Bad. Bad bad bad. Here’s why:

Read the rest of this entry »

A Brief Glastonbury Roundup

July 5th, 2010

I returned from Glastonbury 2010 late on monday evening along with the first signs of a crappy cold. 9 hour stuffy coach trips are great incubators… It could have been worse, I did notice a couple of sniffles during the festival itself, but they seemed to stay away long enough! The lovely weather made for a more pleasant experience than last year – shame it’s exceptional. I still struggled with an inability to stay upright for very long. Fuck my life, or posture.

As for the music, I’ve compiled a little spotify playlist from the bands I managed to see albeit short and uncomprehensive. It can be viewed/listened to here: Glasto
Read the rest of this entry »