Talk to Emacs with a GPT4 Co-Worker

Gallagher PryorAI, Education, Open Source Leave a Comment

With the successful construction of a GPT4 co-worker, we can now talk to emacs. (And also understand how disturbingly simple it is to build one – read on!) WARNING The AI can make mistakes and you might say something horrible on accident like “Man, I hate my harddrive!” I hope you understand the ramifications 😀 With a voice interface, ask the AI to do work or answer questions for you in the context of the current buffer (file/directory). The AI will do the job asynchronously out of the way, leaving you to move on to the next task while the AI plugs away and speaks to you about its completed task. Demo: The code is posted at https://github.com/pv-pterab-s/emacs-pinky-saver. It requires some …

Checkpoint and Restore Emacs into Immortality

Gallagher PryorComputing Topics, Education, Open Source Leave a Comment

TL;DR. An Emacs death is horrible to endure. Checkpoint Emacs’ state at regular intervals to bring it back to life with CRIU. Yup, CRIU can handle Emacs, now! The steps, nowadays, are simple and this post quickly outlines the constraints and the commands to make it work. This post is short and to the point. The build choices, configurations, etc. have been stripped again and again to make things as simple as possible. Also, these instructions are given for a recent Ubuntu in order to be more canonical 😄 Make a Place for bins at ~/.bin Grab an Emacs without DBUS Grab CRIU Configure Emacs Your immortal Emacs will be in daemon mode and will talk with emacsclients over a …

Learn Pipes via Old Serial Terminals with Your Kid

Gallagher PryorEducation Leave a Comment

TL;DR. A lab for STEM middle school students using vintage serial terminals to illustrate that: computers communicate by sending numbers, numbers arrive one by one in order (serial), numbers travel over wires (pipes). These notes include links to materials and instructions that take you and a student through (1) connecting a serial terminal to a computer, (2) configuration, (3) playing with pipes by sending messages, and (4) logging into a serial Linux console to see how pipes scale! This is the latest in our series of education-with-old-hardware posts beginning with “Build a 486 Bootloader with Your Kid“. Required Materials A serial terminal like one of: A Wyse terminal (link to eBay). This is the best because it uses standard serial. …

Build a 486 Bootloader with Your Kid

Gallagher PryorEducation Leave a Comment

TL;DR. A lab at an elementary school level to illustrate to children that: computers must be instructed, instruction is stored on media, the most basic instruction is a series of numbers. These notes include links to materials and instructions that take you and a student through (1) starting linux on a vintage 486 computer, (2) assembling a boot-loader, (3) writing it to a floppy, and (4) starting a computer to show a message. Intro I built a bootloader with my children and share our work in this post. It is a lab, at an elementary school level, that you can repeat for yourself and share with the rising generation. The intent of this activity is to drive home the idea …

Building a C++ Interpreter (Cling) for x86 and ARM

Gallagher PryorC/C++ Leave a Comment

A C++ interpreter compiled for ARM running on an x86 EC2 instance after following the given instructions. As C++ becomes more mature and high-level, an interpreted workflow might lead to mainstream C++ productivity in addition to development! Development through a C++ interpreter (Cling) as opposed to a standard compiler is an amazing leap in productivity and a window into the newest features of C++. This post tells you how to get your own bleeding-edge C++ interpreter built right on top of the development version of LLVM. We give you a repeatable procedure via Amazon EC2. With our prescribed steps in place, you can always have an up-to-date development version of Cling. This allows quick testing and investigation of LLVM’s newest …

RIP, Leonard Nimoy

Gallagher PryorArrayFire Leave a Comment

This past week marked the passage of Leonard Nimoy. Here at ArrayFire, we are deeply saddened and touched by his departure. While Mr. Nimoy was anything but a scientist, mathematician, or programmer, he portrayed a character that embodied the best of all of those professions. Whereas Mr. Nimoy has had a send off on major news outlets regarding his amazing career throughout his entire life, we would rather like to express how he specifically inspired us to ultimately pursue our careers and why we toil under the ArrayFire banner. As everyone (hopefully) knows, Leonard Nimoy portrayed the character of Spock on Star Trek. Logical, brilliant, and supposedly emotionless, Spock served as friend and counter-balance to Kirk – the brash, head-strong, …

Cross Compile to Windows From Linux

Gallagher PryorArrayFire, C/C++ 7 Comments

Why did I not know about this? It’s like I just discovered the screw driver! On Debian and variants (from tinc’s windows cross-compilation page), sudo apt-get install mingw-w64 # C i686-w64-mingw32-gcc hello.c -o hello32.exe # 32-bit x86_64-w64-mingw32-gcc hello.c -o hello64.exe # 64-bit # C++ i686-w64-mingw32-g++ hello.cc -o hello32.exe # 32-bit x86_64-w64-mingw32-g++ hello.cc -o hello64.exe # 64-bit Granted, this isn’t a silver bullet, but rather a quick way to get a Windows build of platform independent code that you might already have running in Linux. I’ve found that this approach makes it easy to get binaries out the door in a hurry when it’s hard to get a project building with Visual Studio or even on the Windows platform itself (due …

Computer Vision Demos at SC’10 with 8-GPU Colfax CXT8000

Gallagher PryorCase Studies, Events 2 Comments

We just returned from SC’10, the biggest supercomputing show of the year.  At the show, we demoed Jacket driving computer vision demos on an 8-GPU Colfax CXT8000 system… pure eye candy! We had CPU and GPU versions of the demos running on 8 different monitors, each attached to the 8 Tesla C2050 GPUs in the system.  Input data for the various demos was sourced from 3 webcams and 2 Blu-ray video inputs. Checkout the demo details, below: Demo 1 Sobel edge detection with image dilation and interpolation overlaid on Blu-ray video in realtime. Demo 2 Feature detection on a 4-level pyramid of 640×480 realtime webcam video. Demo 3 Gradient descent feature tracking , a stripped down version of KLT, tracking …

Crushing MATLAB Loop Runtimes with BSXFUN

Gallagher PryorBenchmarks 1 Comment

One of the slowest blocks of code that inflate runtimes in MATLAB are for/while loops. In this blog post, I’m going to talk about a little known way of crushing MATLAB loop runtimes for many commonplace use cases by utilizing one of the most amazingly underrated and unknown functions in MATLAB’s repertoire: bsxfun. Using this function, one can break seemingly iterative code into clean, vectorized, snippets that beat the socks off even MATLAB’s JIT engine. Better still, Jacket fully supports bsxfun meaning that if you thought a vectorized loop was fast, you haven’t seen anything, yet. Also, in the end, a loop represented using bsxfun is just good programming practice. As we’ll see, the technique I’m going to describe is …

Accelerate Computer Vision Data Access Patterns with Jacket & GPUs

Gallagher PryorArrayFire Leave a Comment

For computer vision, we’ve found that efficient implementations require a new data access pattern that MATLAB does not currently support.  MATLAB and the M language is great for linear algebra where blocks of matrices are the typical access pattern, but not for Computer Vision where algorithms typically operate on patches of imagery. For instance, to pull out patches of imagery in M, one must do a double nested for loop, A = rand(100,100) for xs = -W:W for ys = -W:W patch(xs+W+1, ys+W+1) = A(xs+1+x, ys+1+y); end end …with guards for boundary conditions, etc. It gets even more complicated with non-square patches. On top of that, these implementations don’t translate to the GPUs memory hierarchy at all and are thus …