Programming Leftovers

-
Why Bash and GNU Readline's "bracketed paste" mode is not for us
Our pragmatic reason is that we are almost always pasting from our own instructions, which we obviously trust. In addition, we do this sort of pasting quite a bit. Since our own source text is trusted, an extra step to accept them is both annoying and almost certainly ineffective at avoiding mistakes. Since we know the source is trusted, we're extremely unlikely to pause, look at what we're about to hit Return on, and realize we've pasted the wrong thing, especially since we do this all the time.
-
best of .bashrc
Or, actually, .bash_aliases - but that's not as fun to say
On this page I've gathered some selected bits and pieces from my .bash_aliases file. Apart from the selection of hacks and scripts available on this site, these are the homemade contraptions I use most frequently when farting around with my computer.
-
Remove An Item From A List In Python Using Clear, Pop, Remove And Del
In this notebook, I will go over different ways of removing items from Python list.
-
TWC 120: Task #1, Swap Odd/Even bits & Task #2, Clock Angle
I was just going to use a variation on last week's "Nybble Swap" task for this, but then I foolishly thought, "No, I've read Hacker's Delight I should twiddle bits!"
Okay, now that I told you about my first mistake, let me tell you, the bit twiddling was fun once it started working but I do have a little regret that it's straightforward bit-twiddling: I created a bit mask to pick out alternating bits, then just did the shifting and OR-ing you would expect to switch the even/odd bits. I can't help but wonder if there isn't some clever one-liner in Hacker's Delight. I can't claim to have remembered it even once though: I skimmed the book.
But I didn't use arrays and array indexing tricks, like I did on the nybble-swap, so I did learn something and that something is this: Once you start using bigint, you have to start thinking in a paranoid way like you do in python, "This assignment will just create a pointer, I need to make a copy." Since I'm the type who hits
reflexively when at a lull in VIM, this isn't too outrageous for my sensibilities ... until I had to make a copy of the number 2 in a my declaration. That seemed a little much.
-

- Login or register to post comments
Printer-friendly version- 2225 reads
PDF version
More in Tux Machines
- Highlights
- Front Page
- Latest Headlines
- Archive
- Recent comments
- All-Time Popular Stories
- Hot Topics
- New Members
digiKam 7.7.0 is released
After three months of active maintenance and another bug triage, the digiKam team is proud to present version 7.7.0 of its open source digital photo manager. See below the list of most important features coming with this release.
|
Dilution and Misuse of the "Linux" Brand
|
Samsung, Red Hat to Work on Linux Drivers for Future Tech
The metaverse is expected to uproot system design as we know it, and Samsung is one of many hardware vendors re-imagining data center infrastructure in preparation for a parallel 3D world.
Samsung is working on new memory technologies that provide faster bandwidth inside hardware for data to travel between CPUs, storage and other computing resources. The company also announced it was partnering with Red Hat to ensure these technologies have Linux compatibility.
|
today's howtos
|








.svg_.png)
Content (where original) is available under CC-BY-SA, copyrighted by original author/s.

Recent comments
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago