Feed Aggregator Page 8797

Rendered on Thu, 27 Feb 2025 09:09:19 GMT  newer   latest   older 

Apa yang Dilakukan Rezim Putin terhadap Anarkis Rusia

via Center for a Stateless Society by Citizen Ilya on Fri, 21 Feb 2025 17:20:06 GMT
Oleh: Citizen Ilya. Teks aslinya berjudul “How Putin’s Government Deals With Russian Anarchists.” Diterjemahkan ke dalam Bahasa Indonesia oleh Ameyuri Ringo. Support Ringo by considering becoming his Patron. Jika kalian mengikuti berita mengenai Rusia, kalian pasti mengetahui tentang apa yang terjadi saat ini terhadap para oposisi dan aktivis politik. Kediktatoran Putin sedang berfokus pada penyiksaan...

Templates for Bluesky?

via Scripting News on Fri, 21 Feb 2025 15:20:20 GMT

A note to designers of Bluesky as a platform.

I've been playing with adding metadata to posts in a thread.

As you can see the metadata, in the screen shot below, overwhelms the content in the post.

Wouldn't it be nice to have a set of templates to choose from, post types? Let designers be part of the platform.

Playing with metadata in a post in a thread.

Who is Elon Musk?

via Scripting News on Fri, 21 Feb 2025 13:17:12 GMT

Journalism is as usual writing news they could have written last year and should have if they weren't dreaming that somehow we'd escape End of Democracy 2.0. And we know how that turned out, about the same as Hillary's Emails.

Who is Elon Musk? Until I read his Wikipedia profile last week, I only had a vague idea. I wanted to know if he was actually raised in South Africa, when he left, and what influence it had on him. I'll let you read the article. We should be examining every nook and cranny of who this unelected guy who never was in a debate, or won a primary or an election, or had his background investigated, and remains untouched by any kind of examination.

His security detail was just deputized by the US Marshals Service. What next? Maybe they'll just give him control of the military and get on with it. You can see that's coming, maybe in March, or sooner.

Do you think he'd have any compunction against using the military against Americans? This isn't his country. So Americans probably mean nothing special to him. Since we played a role in the overthrow of their apartheid, probably the opposite. I wonder who or what he cares about. Has he ever answered a question without deflecting? Is there any reporter who could or would interview him?

If journalism were really doing their job seriously, they would report on this because this is what we're thinking. When will jouralism get that they are one of us, not above us? The sooner that light goes on, the better.

Here's a good story for one of fierce courageous reporters at the NY Times. Who should be more scared of what's coming? Blacks or Jews?

No Title

via Scripting News on Fri, 21 Feb 2025 13:12:41 GMT
Something you hear from Democratic politicians and MSNBC hosts. "We know why Musk is cutting so much, it's to fund a huge tax cut for billionaires." They don't actually know that and I doubt it's true. Show me another example where Musk did anything to benefit anyone but himself? Why should he share the loot he's grabbing with other rich folk? What did they do to help? Nah I think it's all for him, with a taste going to the Trump and Putin families. He's going to use his new power to buy something else. The question is what? What else could he want? I imagine he wants all the money in the world not just the most.

Mokita

via The Z Blog by thezman on Fri, 21 Feb 2025 13:12:39 GMT
In every human organization there are things that are true but for one reason or another, everyone agrees to ignore them. It may be that these things are just annoying, like the personal ticks of the boss. In other cases, … Continue reading

Musk's exclusive

via Scripting News on Fri, 21 Feb 2025 13:11:37 GMT

Can you imagine how livid developers of other AI platforms are that Musk gets exclusive access to all the private information stored in US government databases.

Imagine Bezos calling Trump.

"Hey I thought we were friends. I can send you another billion. 2 billion? 100 billion?"

"Call Elon, if he says it's OK I'll sign the order."

Microsoft, Facebook, Apple, Oracle, OpenAI, etc etc.

Seaton: Sick of Snow, Send Help

via Simple Justice by Chris Seaton on Fri, 21 Feb 2025 12:43:57 GMT
Friends, it’s February 20, 2025, and I’m officially declaring war on snow. Yes, that fluffy white bastard that turns Knoxville into a scene from The Shining minus the charm of Jack Nicholson chasing me with an axe. I’ve had it. Done. Finito. If I see one more snowflake drift down like it’s auditioning for a Hallmark […]

How Dare ALJs Not Answer To The President

via Simple Justice by SHG on Fri, 21 Feb 2025 12:41:35 GMT
Having already raised the issues with the effort to overrule Humphrey’s Executor, fundamentally shift the mechanisms of government such that the independent boards and agencies created by Congress and placed under the Executive Branch’s umbrella will no longer be independent but serve the whims of the president, the next shoe has fallen. The Trump administration […]

Joe Marshall: Advent of Code 2024: Day 10

via Planet Lisp on Fri, 21 Feb 2025 10:00:00 GMT

For Day 10, we are given a topographic map as a grid of elevations.

;;; -*- Lisp -*-

(in-package "ADVENT2024/DAY10")

(defun read-grid (input-pathname)
  (read-file-into-grid #’char->decimal input-pathname))

The trailheads are at elevation 0.

(defun find-trailheads (grid)
  (gethash 0 (invert-grid grid)))

At any elevation, we can take a step to a neighboring cell if it is at 1 unit higher elevation.

(defun take-step (grid location)
  (let ((target-elevation (1+ (grid-ref grid location))))
    (collect ’list
      (choose-if (lambda (loc)
                   (and (on-grid? grid loc)
                        (= (grid-ref grid loc) target-elevation)))
                 (scan ’list (list
                              (coord-north location)
                              (coord-east  location)
                              (coord-south location)
                              (coord-west  location)))))))

The trail-walker is a trail collector that takes a trailhead and does a breadth-first search to find the highest elevations reachable from that trailhead.

(defun trail-walker (grid)
  (lambda (trailhead)
    (collect-last
     (scan-fn ’list
              (lambda () (list trailhead))
              (lambda (frontiers)
                (remove-duplicates
                 (collect-append
                  (#Mtake-step (series grid) (scan frontiers)))
                 :test #’equal))
              #’null))))

A scorer is a curried function that takes a collector, then a grid, then a trailhead, and returns the score for that trailhead, which is the number of collected trails.

(defun scorer (collector)
  (lambda (grid)
    (let ((collect-trails (funcall collector grid)))
      (lambda (trailhead)
        (length (funcall collect-trails trailhead))))))

The puzzle takes a grid and a scorer, and sums the scores of the trailheads in the grid.

(defun puzzle (grid trailhead-scorer)
  (collect-sum
    (map-fn ’integer
            (funcall trailhead-scorer grid)
            (scan ’list (find-trailheads grid)))))

For the first part of the puzzle, we are to sum the scores of the trailheads using the trail-walker as the scorer. That is, for each trailhead, the number of highest points we can reach.

(defun part-1 ()
  (puzzle (read-grid (input-pathname)) (scorer #’trail-walker)))

For part two, we sum the number of paths to the highest points reachable from each trailhead. When we do the breadth-first search, we keep the history of the path we have taken.

(defun extend-path (grid path)
  (map ’list (lambda (step) (cons step path)) (take-step grid (car path))))

(defun trail-collector (grid)
  (lambda (trailhead)
    (collect-last
     (scan-fn ’list
              (lambda () (list (list trailhead)))
              (lambda (paths)
                (collect-append
                 (#Mextend-path
                    (series grid)
                    (scan ’list paths))))
              (lambda (paths)
                (every (lambda (path)
                         (= (length path) 11))
                       paths))))))

(defun part-2 ()
  (puzzle (read-grid (input-pathname)) (scorer #’trail-collector)))

Star Wars.

via Day By Day by Chris Muir on Fri, 21 Feb 2025 04:02:18 GMT

Old Think New Think

via The Z Blog by thezman on Thu, 20 Feb 2025 15:15:42 GMT
One of the new features of life since Trump came back to town is that things move quickly and if you are not careful, they will move without you. Ten thousand USAID employees learned this in week one. One day … Continue reading

No Title

via Scripting News on Thu, 20 Feb 2025 13:59:23 GMT
I'm starting to use the rewrite of my thread publisher on Bluesky. Here's an example. And here's the version of the thread without being broken up into 300-character chunks (you can get it by clicking in the metadata box below the text of the post). I don't like it. The software is as good as it can be, given the extreme limits of the twitter-like environment. I went all the way with this, but I'm not sure I'm going to release it. But I'm going to keep using it, and maybe I'll think of something that makes it fun or worthwhile, or maybe I'll just chalk it up to another learning experience.

No Title

via Scripting News on Thu, 20 Feb 2025 13:49:16 GMT
Once again Maddow is must-watch destination TV this year. Keep on going. One thing to watch out for, Bluesky will disappoint you. Don't blame them when it happens, because they can't be as good as people think they are. They're a startup in a tough market. Sooner or later Musk is going to aim at them (maybe he already is) and they will have to seek refuge somewhere, and all big tech companies are bastards. There isn't one of them you can trust with your democracy. So keep that in mind, and when you see open billionaire-proof social networks rise up, give them a little the Rachel we love.

No Title

via Scripting News on Thu, 20 Feb 2025 13:40:24 GMT
Favorite part of the SNL50 show. Eddie Murphy impersonating Tracy Morgan, while standing next to him on Black Jeopardy. It's really hard to see the resemblance between today's Eddie and young Eddie, but there it was, the comic brilliance. Then they ask the real Tracy if they are related and he said he doesn't see it.

No Title

via Scripting News on Thu, 20 Feb 2025 13:40:09 GMT
Yes it's me I'm the pride of Cucamonga.

No Title

via Scripting News on Thu, 20 Feb 2025 13:37:58 GMT
In the Catskills, we've been getting so much snow this winter and super cold weather and huge winds. And Trump & Musk. A quadruple threat.

Judge Hos Unasked Question

via Simple Justice by SHG on Thu, 20 Feb 2025 11:51:46 GMT
There were two amici who sought a say in the matter, which otherwise included a defendant and the government, by Acting Deputy Attorney General Emil Bove III. Judge Dale Ho has yet to permit the amici to appear, but without them, there would be no evidence proffered in the case other than the mutual love […]

Joe Marshall: Advent of Code 2024: Day 9

via Planet Lisp on Thu, 20 Feb 2025 08:00:00 GMT

On Day 9 we are simulating defragging a disk. The input is a list of digits that alternate between a file size and a gap size. No file or gap is larger than 9 blocks.

The first part of the problem is to simply move the rightmost block that contains a file to the leftmost empty space. We repeat until there are no more empty spaces. Again, we could attempt to shoehorn this into a series approach, but it is straightforward to use an array to represent our disk and use side effects to simulate moving the blocks around.

Whenever you use an array, you’ll virtually always want to side effect the array contents, and you’ll virtually always iterate over the array. As a result, the do macro and its varaints such as dotimes will be useful interation constructs. The code will be definitely not be functional, but imperative in nature. There is just going to be state hanging out everywhere in this code.

The first thing we have to do is read the input:

;;; -*- Lisp -*-

(in-package "ADVENT2024/DAY9")

(defun read-input (input-file)
  (with-open-file (stream input-file :direction :input)
    (read-line stream nil nil)))

(defun read-layout (input-file)
  (let* ((line             (read-input input-file))
         (file-count       (/ (1+ (length line)) 2))
         (files            (make-simple-vector file-count))
         (free-block-count (1- file-count))
         (free-blocks      (make-simple-vector free-block-count)))
    (do ((input-index      0 (1+ input-index))
         (disk-loc         0 (+ disk-loc (char->decimal (schar line input-index))))
         (file-flag        t (not file-flag))
         (file-id          0 (if file-flag
                                 (1+ file-id)
                                 file-id))
         (free-block-index 0 (if file-flag
                                 free-block-index
                                 (1+ free-block-index))))
        ((>= input-index (length line)) (values files free-blocks))
      (if file-flag
          (setf (svref files file-id)
                (cons disk-loc (char->decimal (schar line input-index))))
          (setf (svref free-blocks free-block-index)
                (cons disk-loc (make-simple-vector (char->decimal (schar line input-index))
                                                   :initial-element nil)))))))

The main iteration alternates between reading a file block and a free block. The blocks are placed in a file array or a free-block array depending on the file-flag, which toggles on each pass through the loop. The disk-loc is updated with the size of the file or free block. File blocks are just the disk-loc consed to the file size, but free blocks are the disk-loc consed to an empty array that will be filled in later.

We’ll be required to compute a “checksum” of the disk, which will, for each block, the number of the block multplied by the file id of the file in the block. Since the files and the freelist are represented differently, we need a separate routine for each one and we’ll add them at the end.

(defun files-checksum (files)
  (collect-sum
    (#M(lambda (file-id)
         (let ((file-record (svref files file-id)))
           (collect-sum
             (#M(lambda (i)
                  (* file-id (+ (car file-record) i)))
              (scan-range :below (cdr file-record))))))
        (scan-range :below (length files)))))

The outer collect-sum loop iterates over each file summing the checksums. The inner collect-sum iterates over the blocks (stored in the cdr of the file record) in the file summing the product of the file-id and the offset of the block itself.

We handle freelist segments differently. They have an array into which we have moved file blocks, so we iterate over the array and multiply the file-id in the array (if there is one) by the freelist block offset and sum them:

(defun freelist-checksum (freelist)
  (collect-sum
   (#M(lambda (freelist-record)
        (let* ((segment-base (car freelist-record))
               (segment (cdr freelist-record)))
         (collect-sum
           (#M(lambda (offset-in-segment)
                (let ((file-id (or (svref segment offset-in-segment) 0)))
                  (* file-id (+ segment-base offset-in-segment))))
            (scan-range :below (length segment))))))
    (scan ’vector freelist))))

(defun filesystem-checksum (files freelist)
  (+ (files-checksum files)
     (freelist-checksum freelist)))

The two parts of the day’s puzzle involve two different strategies for “defragging” the disk. For part 1, we repeatedly move the rightmost file block to the leftmost free block. To find the rightmost occupied block, we iterate over the file list from right to left:

(defun source-block (files)
  (do ((file-id (1- (length files)) (1- file-id)))
      ((not (zerop (cdr (svref files file-id))))
       (values (+ (car (svref files file-id)) (cdr (svref files file-id)))
               (svref files file-id)
               file-id))))

To find the leftmost free block, we search the free blocks until we find one that is not fully occupied.

(defun target-block (freelist)
  (let* ((free-segment (find-if (lambda (segment)
                                  (position nil (cdr segment)))
                                freelist))
         (offset (position nil (cdr free-segment))))
    (values (+ (car free-segment) offset)
            (cdr free-segment)
            offset)))

These aren’t the most efficient because they forget the information from the previous search, but presumably a defragging process would be dominated by the disk reads and writes.

Once we have the source and target blocks, we move the source block to the target block:

(defun move-block! (files freelist)
  (multiple-value-bind (source-block source-record file-id) (source-block files)
    (multiple-value-bind (target-block target-segment target-offset) (target-block freelist)
      (when (< target-block source-block)
        (decf (cdr source-record))
        (setf (svref target-segment target-offset) file-id)
        t))))

We only move blocks to lower addresses and return NIL if we cannot move a block.

To defrag with this strategy, we just repeatedly call move-block! until it returns NIL:

(defun defrag1! (files freelist)
  (when (move-block! files freelist)
    (defrag1! files freelist)))

(defun puzzle (input-pathname defrag)
  (multiple-value-bind (files freelist) (read-layout input-pathname)
    (funcall defrag files freelist)
    (filesystem-checksum files freelist)))

(defun part-1 ()
  (puzzle (input-pathname) #’defrag1!))

Part 2 uses a different strategy to defrag the disk. Instead of blocks, we move entire files, and we move them to the leftmost block that they’ll fit. To find that leftmost block, we scan the freelist:

(defun defrag2-target (file freelist)
  (collect-first
   (choose-if
    (lambda (free-record)
      (and (< (car free-record) (car file))
           (<= (cdr file) (count nil (cdr free-record)))))
    (scan ’vector freelist))))

We iterate over the files from right to left:

(defun defrag2! (files freelist)
  (do ((file-id (1- (length files)) (- file-id 1)))
      ((zerop file-id))
    (let* ((file (svef files file-id))
           (target (defrag2-target file freelist)))
      (when target
        (let* ((start (position nil (cdr target)))
               (end (+ start (cdr file))))
          (fill (cdr target) file-id :start start :end end)
          (setf (cdr file) 0))))))

(defun part-2 ()
  (puzzle (input-pathname) #’defrag2!))

Red Notice.

via Day By Day by Chris Muir on Thu, 20 Feb 2025 04:02:54 GMT

No Title

via Scripting News on Thu, 20 Feb 2025 03:18:24 GMT
One more thing. I like watching Maddow nowadays. She seems unstuck. And she's talking straight to the Repubs, and not with resignation, with the idea that maybe finally enough is enough, and they might work with us to save what we can of this great country. Also like that Bernie Sanders is on the road campaigning in swing districts that are held by Repubs, to see if he can squeeze out a few defectors from the ranks of House Republicans. Very important, because the Repub margin there is only 3. Just have to flip 2. America has to start moving now, or it's going to take a long long time to come back from this. The sooner we all get that, and that we are part of it, the better things will turn out, imho.

 newer   latest   older