• Show off your PC / Laptop

    General Computing show off laptop
    8
    0 Votes
    8 Posts
    1k Views
    1
    @Scuzz Like your wall paper though.
  • Fitness General

    The lounge fitness general
    6
    2 Votes
    6 Posts
    2k Views
    LeoL
    I didn’t realize it until I stepped on a scale and took my shirt off the other day that uni (and unhealthy habits) has caused me to gain a lot of weight! I’ll definitely look into the dieting links. Nice post m8!
  • Messing with the logo...

    The lounge
    12
    1 Votes
    12 Posts
    2k Views
    ScuzzS
    @Schamper It does look it, it think it is because of the shape of the B’s. It is the same image as the logo, just smaller.
  • How to recover Grub

    General Computing recover grub
    1
    1 Votes
    1 Posts
    468 Views
    ScuzzS
    I have recently had some issue with kernal panics and Elementary OS not booting correctly, giving me a BusyBox screen with limited commands. The first time round i saw this i managed to fix it by booting into a live CD of Elementary OS and using the fsck /dev/sdax command. This seemed to fix it until i did a sudo apt-get dist-upgrade. This completely broke my install, I chose to start again with a fresh install of Elementary OS. Once it had fully installed and i had removed the live CD, i rebooted my laptop only to find that Grub had broke too. This meant that i was unable too boot into any operating system that I had installed on my laptop. How to recover from File Not Found: Grub Rescue I found a nice little tool that will automate the recovery of Grub and the boot partition. It is called boot-repair. Boot into a live CD of Ubuntu or any of its derivatives Install boot-repair sudo add-apt-repository ppa:yannubuntu/boot-repair sudo apt-get update sudo apt-get install boot-repair Run boot-repair boot-repair Click the “Recommended repair” button and let boot-repair do it’s magic. Once the completion screen has been displayed it should be OK to reboot. You should now have a working Grub boot menu!
  • 1 Votes
    1 Posts
    570 Views
    ScuzzS
    While I am setting up Node.js and NPM for a project I am currently working on I think it would be best to document my installations setups. I have already posted a quick How to Install Nginx and i think Node.js and NPM are the next logical items to write about. Installing Node.js sudo apt-get update sudo apt-get install nodejs This will install whatever version is currently in the repository, this will probably not be the latest and we will need to upgrade. Once the installation is complete you should have a working version of Node.js and NPM. NPM is Node Package Manager and it is used to install different node packages. It can also be used to upgrade itself and Node.js. How to upgrade NPM If NPM is not installed with the Node.js install then you will need to install NPM via apt-get. sudo apt-get install npm sudo npm update npm -g This command will upgrade NPM to the latest version, the -g is a global option so unless you are a root user you will need to use the sudo command. Once NPM has been fully update you can use it to update Node.js. How to upgrade Node.js via NPM sudo npm install -g n sudo n stable This will install the latest version Node.js. After these commands have run you will have a fully working and up to date Node.js and NPM.
  • Looking to build a new PC?

    General Computing
    3
    0 Votes
    3 Posts
    881 Views
    SchamperS
    @Scuzz Also pound.
  • World Cup Finals

    The lounge world cup finals
    9
    0 Votes
    9 Posts
    1k Views
    ScuzzS
    @Almost said: I think Bings “Germany Wins” was closest :P FTFY
  • How the shoutbox client sockets work

    Development and Coding
    1
    4 Votes
    1 Posts
    723 Views
    SchamperS
    This is about the following file: sockets.js We need more posts, why not write something about how the shoutbox works? Could be interesting for some people I suppose :P The fun thing about the recent refactor of the client sockets is that you can call them by simple doing Shoutbox.sockets.<action>(data, callback);. This is possible because we add each message to the global Shoutbox.sockets object. Doing this for every single message would take a lot of time and code, especially with the recent addition of commands. So how do we do this? As you can see at the beginning of the file there are 2 objects with a bunch of method names as key and socket events as value, these names will later be used as the <action>: var Messages = { getShouts: 'plugins.shoutbox.get', sendShout: 'plugins.shoutbox.send', removeShout : 'plugins.shoutbox.remove', editShout: 'plugins.shoutbox.edit', notifyStartTyping: 'plugins.shoutbox.notifyStartTyping', notifyStopTyping: 'plugins.shoutbox.notifyStopTyping', getOriginalShout: 'plugins.shoutbox.getOriginalShout', saveSettings: 'plugins.shoutbox.saveSetting', getSettings: 'plugins.shoutbox.getSettings', getUsers: 'user.loadMore', getUserStatus: 'user.isOnline' }; var Events = { onUserStatusChange: Messages.getUserStatus, onReceive: 'event:shoutbox.receive', onDelete: 'event:shoutbox.delete', onEdit: 'event:shoutbox.edit', onStartTyping: 'event:shoutbox.startTyping', onStopTyping: 'event:shoutbox.stopTyping' }; These are the default messages and events we work with. Extra events or messages required for commands etc are defined by the command itself (we get to this later). After that we have a Handlers object, which essentially has all the default socket handlers required for the shoutbox to actually work. You can see some basic stuff ilke onReceive, onDelete etc. You can pretty much guess by their name what their function is. Interesting here is the defaultSocketHandler: var Handlers = { onReceive: ..., onDelete: ..., onEdit: ..., onUserStatusChange: .., onStartTyping: ..., onStopTyping: ..., defaultSocketHandler: function(message) { this.message = message; var self = this; return function (data, callback) { if (typeof data === 'function') { callback = data; data = null; } socket.emit(self.message, data, callback); }; } }; In the next bit I explain how the defaultSocketHandler works. At the very end of the file we find what we actually “expose” to the public/global Shoutbox object. Shoutbox.sockets = { messages: Messages, events: Events, registerMessage: function(handle, message) { if (!Shoutbox.sockets.hasOwnProperty(handle)) { Shoutbox.sockets[handle] = new Handlers.defaultSocketHandler(message); } }, registerEvent: function(event, handler) { if (socket.listeners(event).length === 0) { socket.on(event, handler); } }, initialize: function() { for (var e in Events) { if (Events.hasOwnProperty(e)) { this.registerEvent(Events[e], Handlers[e]); } } for (var m in Messages) { if (Messages.hasOwnProperty(m)) { this.registerMessage(m, Messages[m]); } } } }; The first two keys, messages and events simply expose the default messages and events that we talked about at the beginning. registerMessage is more interesting. Let’s take a closer look at it. registerMessage: function(handle, message) { if (!Shoutbox.sockets.hasOwnProperty(handle)) { Shoutbox.sockets[handle] = new Handlers.defaultSocketHandler(message); } }, registerMessage first checks if we don’t already have the requested key in the Shoutbox.sockets object, if we don’t it adds a new key with a new defaultSocketHandler as value. We pass the message from the second argument to the defaultSocketHandler constructor, which, if you scroll up, is stored in the newly created object with this.message = message;. If you look at the return value of defaultSocketHandler you can see that it returns a function that takes 2 arguments. This function essentially just emits a socket message with the data and callback as arguments. Because we store this newly created function as the value of the Shoutbox.sockets[handle] key, this allows us to do the Shoutbox.sockets.<action>(data, callback); from the beginning of this post. registerEvent just registers a new event with socket.io for the passed in event and handler. intialize simply loops over all the Events and Messages and calls the appropriate functions to register all the default events and messages. Because we expose registerMessage and registerEvent commands and actions can easily add their own methods and event handlers to the Shoutbox.sockets object. Hopefully this post was somewhat interesting to read ;)
  • Atom.io

    General Computing
    4
    0 Votes
    4 Posts
    1k Views
    SchamperS
    Recently became available for Windows as well. http://blog.atom.io/2014/07/09/hello-windows.html
  • Howdy

    Introductions
    16
    3 Votes
    16 Posts
    2k Views
    President_ChoobP
    @Omega2058 Sup dood.
  • 1 Votes
    3 Posts
    1k Views
    ScuzzS
    @Schamper You can build it from source and i think i read that Freya beta will be coming out soon.
  • Color of the forum

    The lounge
    21
    0 Votes
    21 Posts
    3k Views
    ScuzzS
    6 v 5 is still pretty close.
  • Post Your Desktop

    The lounge desktop
    13
    0 Votes
    13 Posts
    2k Views
    1
    @Antu Yup, it’s hard to use other people’s computer after using that for a while/
  • Best looking guy US

    The lounge
    10
    -1 Votes
    10 Posts
    1k Views
    1
    @Jellyforme Sounds like you like protein shakes from the man spigot.
  • (Web)design showcases

    Development and Coding
    7
    0 Votes
    7 Posts
    1k Views
    AntuA
    @theDaftDev Welcome, it looks great now ! :)
  • Intro

    Introductions
    27
    2 Votes
    27 Posts
    4k Views
    President_ChoobP
    @Lyeta Been busy working, like always. Also, sheep shagging is Welsh, not Scottish.
  • Graphics Card

    General Computing
    5
    0 Votes
    5 Posts
    1k Views
    ScuzzS
    My mate just bought a 280x and he said its amazing. I might spend the extra £50 and get a 290x.
  • Leaked Star Wars VII footage

    The lounge
    2
    1 Votes
    2 Posts
    794 Views
    AntuA
    Can’t wait to see what will be going down in Germany. xD
  • Random Facts

    The lounge
    8
    0 Votes
    8 Posts
    2k Views
    AntuA
    @Scuzz That would be awesome. We should get you to write all the facts. :P
  • [I/O 2014]Misc Updates

    Tech google io misc updates
    4
    0 Votes
    4 Posts
    899 Views
    ScuzzS
    I have just read that it will be using ultra sonic sound.