Many of my traditional blog post live on this site, but a great majority of my social-style posts can be found on my much-busier microbloging site at updates.passthejoe.net. It's busier because my BlogPoster "microblogging" script generates short, Twitter-style posts from the Linux or Windows (or anywhere you can run Ruby with too many Gems) command line, uploads them to the web server and send them out on my Twitter and Mastodon feeds.
I used to post to this blog via scripts and Unix/Linux utilities (curl and Unison) that helped me mirror the files locally and on the server. Since this site recently moved hosts, none of that is set up. I'm just using SFTP and SSH to write posts and manage the site.
Disqus comments are not live just yet because I'm not sure about what I'm going to do for the domain on this site. I'll probably restore the old domain at first just to have some continuity, but for now I like using the "free" domain from this site's new host, NearlyFreeSpeech.net.
The friendly Javascript for Cats tutorial recommends the Underscore.js library, which does look pretty useful.
One of the things that would get me using (and learning) more JavaScript would be the ability to take care of all the administrative things I do in (mostly) Bash, (occasionally) Ruby and (very occasionally) Perl using JavaScript via Node on the command line.
I have played a bit with creating and writing files in that environment, and I found the following posts to help in that effort:
2ality: Write your shell scripts in JavaScript, via Node.js (from 2011 but probably still relevant)
Via Shell scripting with Node.js on StackOverflow: I can't wrap my head around it just yet, but some suggest that Grunt can help in this effort
Also via Shell scripting with Node.js on StackOverflow: Commander.js - node.js command-line interfaces made easy
Dreamsys Software's JavaScript Shell Scripting Tutorial
Atlassian Developers: Building command line tools with Node.js
Trausti Kristjansson: Shell scripts in Javascript (Includes Replicating sed with Javascript and node.js – a Javascript shell script template, and Processing large files)
George Ornbo: Command Line Utilities with Node.js
Glynn Phillips: Command-line utilities with Node.js
Loyola Marymount University: Command Line JavaScript. Also worth checking out are the university's textbook, Programming with JavaScript: Algorithms and Applications for Desktop and Mobile Browsers, though it's hella expensive. On the department's main page, there are links near the bottom to more JavaScript resources.
I have a bunch of files in a directory, and I want to delete all that begin their filename with the letters X16 (e.g. X16data.xml)
I used Dir.glob to select the files and iterated over what comes up in the pattern, using File.delete to get rid of what I don't want (Thanks, Stack Overflow):
Dir.glob("X16*") do |file|
File.delete(file)
end
You can put any kind of regex in here, and it'll probably work. That's the theory anyway.
On my current project, I am trying to use using rubyzip to unzip an archive.
So far it's not working, and I'll probably shell out to Bash and Linux/Unix's unzip to get it done.
I figured it out. Now I have to manage the unzipped files (deleting the unused, renaming the good, then deleting the good at the beginning of the run) and account for NOT running the program if there is no file on the other end.
Cormen's "Introduction to Algorithms" (aka CLRS) looks hard. People who understand the material say the math involved is trivial, but I'm not anywhere near there.
So how do you get comfortable with the math before tackling CLRS itself?
A writer on Quora suggests reading a free textbook from an MIT open course called "Mathematics for Computer Science."
Others suggest that the appendix in CLRS serves as a guide to the mathematics needed to understand the rest of the book.
Another Quora writer recommends algorithm books by Sedgewick and Dasgupta (the latter available for free) as alternatives to CLRS.