This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Lupus590's profile picture

The art of the bodge

Started by Lupus590, 31 December 2015 - 06:25 PM
Lupus590 #1
Posted 31 December 2015 - 07:25 PM
Had to share this. I think it characterises a lot of our programs, definitely many of mine.

[media]http://www.youtube.com/watch?v=lIFE7h3m40U[/media]

video link for those without flash: https://www.youtube.com/watch?v=lIFE7h3m40U
Edited on 31 December 2015 - 06:38 PM
Creator #2
Posted 31 December 2015 - 07:35 PM
DemHydraz will love this guy:

- "I use Windows, because it's cheaper."

-"By the way, if anyone suggests using Linux… NO, simply NO."

~The guy from the video.
FUNCTION MAN! #3
Posted 31 December 2015 - 08:49 PM
This could be shortened to 10 lines of bash. I'm not angry, just disappointed.
Pyuu #4
Posted 31 December 2015 - 09:45 PM
This could be shortened to 10 lines of bash. I'm not angry, just disappointed.

Let's see it.
Edited on 31 December 2015 - 08:45 PM
FUNCTION MAN! #5
Posted 31 December 2015 - 11:09 PM

sudo evtest /dev/input/by-id/usb-*-event-kbd |grep --line-buffered 'EV_KEY.*value 1\>'|while read line; do code=`echo "$line"|sed 's/.*code \([0-9]*\).*/\1/'`; xdotool key `printf U%X $((code+0x1F601))`; done

Single line.

EDIT: Here's some sample output. You can see residual characters because this isn't generating keybindings, this is filtering USB keyboard events (for every USB keyboard on the system, regardless) into xdotool key commands.
Edited on 31 December 2015 - 10:16 PM
Pyuu #6
Posted 01 January 2016 - 12:20 AM
Where is the GUI? Everyone wants GUI.
Creator #7
Posted 01 January 2016 - 12:54 AM
Where is the GUI? Everyone wants GUI.

Apparently not DemHydraz.
Agent Silence #8
Posted 01 January 2016 - 02:12 AM
Until now I called it "Duct Tape Coding."
That aside, great video.
H4X0RZ #9
Posted 01 January 2016 - 02:24 AM
Where is the GUI? Everyone wants GUI.

GUIs are for the weak.
FUNCTION MAN! #10
Posted 01 January 2016 - 01:35 PM
Where is the GUI? Everyone wants GUI.

I said 10 lines of bash, not 8000 lines of Vala.
Dragon53535 #11
Posted 01 January 2016 - 06:57 PM
To be honest, Tom isn't a programmer by trade, he's a linguist. The fact that he knew enough of what he knew to get this working is astounding in of itself. As for better coding practices, of course people who program for a job will have better more robust solutions.
Lupus590 #12
Posted 01 January 2016 - 07:25 PM
Sometimes it's fun to look at a fun program idea and think "Let's try it this unorthodox way" or "I wonder if I could do it without using…".