News for hackers. Stuff that matters.

peterhil

The third option is to install some Linux like Ubuntu or Linux Mint on it.

It is nowadays actually easier to install Ubuntu Linux than a Windows. Just be sure to back up your data to an external hard drive, and restore it from there after the install.

Re:Emacs Is My New Window Manager on Tuesday August 01, 2023 @03:47PM (#36961629)
I came here to recommend AwesomeWM also.

Here is my setup, written in Fennel Lisp: peterhil/awesome-ultraviolet: Awesome WM theme with dark violet colours https://github.com/peterhil/awesome-ultraviolet

Peter Pan on Twitter: "@app4soft @probonopd @MX_Linux Screenshot of my #AwesomeWM setup. https://t.co/2XMnDEdJfN" / X https://twitter.com/peterhil/status/1463914949491761164/phot...

Re:Why Architecture Oriented Programming Matters (2019) on Sunday March 26, 2023 @06:12PM (#35320186)
The bold point really resonates with me.

Lately I’ve been writing a CLI application in Python to analyse and generally handle possibly megabytes of DNA data.

At first I wrote the code quickly and in haste of inspiration using some Numpy constructs, some functional maps (with list) and an occasional list comprehension. It has took WAY too long to convert to code to use iterators, because the syntax and semantics are so different.

In Lisp I could usually just switch the kind of map function to be lazy, iterative, or whatever I would like without changing and carefully thinking about the rest of the code.

I think this is the kind of glue the article points to.

Re:How Python virtual environments work on Monday March 13, 2023 @05:30PM (#35143077)
I just compared and evaluated Hatch, Flit, Poetry and Pdm and found Pdm to be most robust and slimmest. Hatch was a good second option, and Poetry and Hatch are easy to use, but have too much bloat and magic.
Re:How Python virtual environments work on Monday March 13, 2023 @05:29PM (#35143045)
Numpy and Scipy are good reasons. Unfortunately Scipy does not even compile on FreeBSD lately, and I have opened three issues about it against Scipy and Pythran (and the fix was with xsimd).

https://github.com/serge-sans-paille/pythran/issues/2070

Re:How Python virtual environments work on Monday March 13, 2023 @05:24PM (#35142962)
I strongly agree with this, and I have been actively using Python since 2009.

Trying top keep a Pygame/Numpy/Scipy project working has been a real struggle. I started it with Python 2 and ported to Python 3 some years ago. The whole Python 3 transition is a huge mess with every Python 3 point release breaking some things. No other interpreted language’s packaging system is so fucked up.

On a positive note: Lately I've liked using pdm instead of pip, and things seem to work quite a lot better. I evaluated Poetry, Flit and something else also.

I just commented about this on Twitter, when someone asked “Which programming language do you consider beginner's friendly?” https://twitter.com/peterhil/status/1633793218411126789

I used to think like this, but then I read this:

Troy Hunt: Here's Why Your Static Website Needs HTTPS https://www.troyhunt.com/heres-why-your-static-website-needs...

Re:Twitter starts limiting how many Tweets you can post per Day on Wednesday February 08, 2023 @05:36PM (#34716536)
I can’t post, retweet or follow. Loading Tweets work.
Re:A Perceptually Meaningful Audio Visualizer on Tuesday January 24, 2023 @04:55PM (#34511065)
I have this exact same idea on my audio synthesis and DSP exploration project called Akasha, that I have developed on and off for more than 13 years. I have plans to open source at least parts of it, once I get to clean up the code. I was inspired by Julius O. Smith III's writings on DSP algorithms: https://ccrma.stanford.edu/~jos/

Unfortunately my web pages are not online, I have some video samples of Björk, Gotan Project and some classical and electronic music samples.

In the analytical audio signal, the musical intervals can sometimes be easily seen, and it is mesmerizing to look at.

On this video demo by OP, when the waveform appears stationary with loops, there are intervals in (at least close to) just intonation – meaning the frequencies have integer ratio relationships.

https://en.wikipedia.org/wiki/Just_intonation

I mean, I am inspired to create some music with the Reaper DAW software. :-D
This is great! Some suggestions:

  - Add download links with download attribute:
    https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download
  - Make the grid responsive with CSS minmax (and media queries):
    https://developer.mozilla.org/en-US/docs/Web/CSS/minmax
  - Display a (visual?) score for closeness of match
  - Add link to similar sounds (by the vector database closeness)
  - Add query parameter so the results can be bookmarked
  - Use HTML5 History API
  - Show tags from freesound.org (and allow to filter by tags from search results)
  - Generate visual previews for the sounds (like in Soundcloud)
I tried this with wonderful results – where is my Reaper now? cyberpunk pad "amiga game" "without beats"
On Firefox you can right click and then choose "Save audio as..."
I was going to suggest this. It's cool that you build a file based database (IIRC) and query language in the third chapter!
Re:For your next side project, make a browser extension on Sunday January 15, 2023 @08:08PM (#34395546)
I have already made one browser extension for easily adding bookmarks into the category (folder) you want to, or create a new subcategory while adding a bookmark. Try it out!

peterhil/spellbook: Spellbook is a bookmark extension for Chrome and Firefox https://github.com/peterhil/spellbook

Re:For your next side project, make a browser extension on Sunday January 15, 2023 @08:06PM (#34395532)
I have made this even easier with Rosegarden, so that you can just use a promisified browser object in both Firefox and Chrome!

The library is tiny, under 5 kb.

https://github.com/peterhil/rosegarden

Re:Ask HN: What sub $200 product improved your 2022 on Friday January 06, 2023 @10:56AM (#34276132)
An Acer video projector I bought for 50€. I also got a few years old Thinkpad X230 for 100€.
Excellent collection of reasons for not using AWS.
Re:Guile Steel: a proposal for a systems Lisp on Monday July 11, 2022 @11:36AM (#32057523)
Carp Lisp is one lisp that has Rust like memory management without garbage collection.
Re:Joy: A maximalist web framework for Lisp aficionados on Tuesday June 07, 2022 @01:21PM (#31657458)
Writing web applications with Lisp is a joy, so this is aptly named.

I wrote one app with Uncommon Web framework on Common Lisp around 2009, with it you could similarly render the HTML from Lisp functions, and use continuations for multi part form submissions.

I have also used Fennel recently, and if Janet is anything as good, I'll try Joy on my next suitable project!

Re:Without Systemd on Friday May 27, 2022 @05:23PM (#31535092)
These are my main reasons to avoid systemd as much as possible. And a bug in systemd-udev on 32-bit Linux systems that periodically halted the performance of the system into unusable state for long times that is probably never going to get fixed.

Update: The bug was related with integrated Bluetooth card on some Dell laptops and is fixed on Ubuntu 22.04: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/17598...

Re:Switching from pyenv, rbenv, goenv and nvm to asdf on Tuesday April 05, 2022 @11:04AM (#30919932)
My first reaction was to see if the project is made with Commnon Lisp's ASDF, and cool now it has plugins for different languages. Common Lisp ASDF is very well thought out, but not the easiest package management system.
Re:Shabdle: Wordle in Hindi on Monday March 21, 2022 @10:37AM (#30754614)
I just get black background on the letters in Firefox – I tried all the letters. Does this work in Firefox?
Here is a single commit that shows what this library basically does:

https://github.com/peterhil/spellbook/commit/d3dd9626ef59792...

Re:How to write untestable code (2008) on Monday February 14, 2022 @08:19AM (#30331633)
I would add:

* Throw useless errors on getter or has methods!

I recently gave up on using MapboxGL.js because of this.

Rosegarden gives you the promises for writing cross platform webextensions on Chrome and other browsers missing the promise based API.

## Rationale

I know Mozilla provides webextension-polyfill, but I find even that too complicated.

With my Spellbook bookmark browser extension I promisified the required callback based methods from Chrome API and checked the chrome.runtime.lastError. Eventually I promisified the whole API, while planning on writing another cross platform browser extension.

I have used only bookmarks and tabs APIs, so beware when using other APIs, in case they differ between Firefox and Chrome.

## Usage

import { browser } from 'rosegarden'

Then just use that browser object as you would use the Mozilla's promise based WebExtension API!

It just gives the global object on Firefox, but on Chrome it gives a promisified version of the chrome global object. The browser object has chrome as prototype, so everything should work as expected as long as the APIs work in a similar way.

Re:PHP in 2022 on Tuesday January 11, 2022 @08:08AM (#29891034)
Can't wait for:

  - Pattern matching in switch statements (done horribly wrong)
  - If, while, and switch expressions
  - Inferred type system
  - Consistent array method argument order
  - Actually usable higher order functions and reflection

Big reminder: Php is a fractal of bad design, and I intensely hated using it at work for many years. The only good thing in Php is Symfony2 framework.

https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

Re:PHP in 2022 on Tuesday January 11, 2022 @08:03AM (#29890993)
Wow, Php almost catches up with majority of programming languages!

Older »