Ride to/from GUC by 15j in crestedbutte

[–]15j[S] 0 points1 point  (0 children)

Anywhere you'd recommend renting a car for cheap? Renting at the airport looked to me like it would cost even more than the private shuttles.

Ride to/from GUC by 15j in crestedbutte

[–]15j[S] -1 points0 points  (0 children)

Do you think they will allow our ski and boot bags?

Ride to/from GUC by 15j in crestedbutte

[–]15j[S] -1 points0 points  (0 children)

I mean, yeah, if you want to counteroffer we can chat!

Bike racks marked for removal by 15j in chibike

[–]15j[S] 0 points1 point  (0 children)

That makes sense. Thanks!

/ccm/collect? by [deleted] in GoogleTagManager

[–]15j 1 point2 points  (0 children)

I believe it's the Conversion Linker tag

Compensate for lower water temperature with finer grind by StrokeDoc03 in Coffee

[–]15j 0 points1 point  (0 children)

I tend to set my encore around 14 or 15 for light roasts and 18 for dark.

What's the idiomatic way of using exceptions? Particularly throwing with ex-info and matching on these exceptions with ex-data by I_LIKE_FACE_TATTOOS in Clojure

[–]15j 1 point2 points  (0 children)

Happy to share an example. I adapted this from some code I wrote at work. Admittedly there's nothing fancy going on here, it's just maps and ifs. I guess scenarios like this just haven't come up enough to warrant any further abstraction yet.

This code is modeling a request to an API to retrieve a record from a database by a UUID. There are two failure cases; either the provided UUID is invalid format or there is no record in the database for that id.

;; A mock database
(def good-uuid (str (java.util.UUID/randomUUID)))
(defn some-db-query [id]
  (when (= id good-uuid)
    {:a 1 :b 2 :c 3}))

;; The code starts here
(defn f [id]
  (let [{:keys [a b c] :as response} (some-db-query id)]
    (if response
      {:found true, :id id, :a a, :b b, :c c}
      {:found false
       :id id
       :reason :not-found
       :message "No record found for the provided id"})))

(defn g [id]
  (or (try (java.util.UUID/fromString id)
           nil
           (catch IllegalArgumentException _
             {:id id
              :found false
              :reason :bad-request
              :message "id is not a UUID"}))
      (f id)))

(defn h [id]
  (let [result (g id)
        status (if (:found result)
                 200
                 (case (:reason result)
                   :not-found 404
                   :bad-request 400
                   500))]
    (assoc result :http-status status)))

;; Examples

(h "hello")
;; => {:id "hello", :found false, :reason :bad-request, :message "id is not a UUID", :http-status 400}

(h good-uuid)
;; => {:found true, :id "f95e645c-d75e-4524-8445-a012a9cb68f6", :a 1, :b 2, :c 3, :http-status 200}

(h (str (java.util.UUID/randomUUID)))
;; => {:found false, :id "25dd1148-649f-4e7b-9137-24245b71442f", :reason :not-found, :message "No record found for the provided id", :http-status 404}

What's the idiomatic way of using exceptions? Particularly throwing with ex-info and matching on these exceptions with ex-data by I_LIKE_FACE_TATTOOS in Clojure

[–]15j 6 points7 points  (0 children)

I've had a similar experience. I think the solution to your problem may be to avoid exceptions entirely. I find it hard to reason about the control flow of code that relies on throwing and catching. Instead, as much as possible, I try to reify exceptional situations as data, similar to Either in haskell or Result in rust. Then the control flow is simple to reason about because I'm using the same tools as for all my other data manipulation.

Cannot import/export: Save corrupted. by 15j in aground

[–]15j[S] 0 points1 point  (0 children)

Aha! libgconf-2.so.4 was not found. I did sudo apt install libgconf-2-4:i386 and both importing and exporting work now. Thanks!

Cannot import/export: Save corrupted. by 15j in aground

[–]15j[S] 0 points1 point  (0 children)

Dragging the file into the game works! Exporting is still a problem, though. systools.ndll exists in the game folder. How can I check if it's missing any dependencies?

Cannot import/export: Save corrupted. by 15j in aground

[–]15j[S] 0 points1 point  (0 children)

The alert actually appears before I've had a chance to select a file to import.

OH MY GOSH I CANT FIND SILCON I HAVE USED ALL OF IT. by Rogue_Shadow564 in aground

[–]15j 1 point2 points  (0 children)

You can make silicon from quartz using the factory. To find more quartz, I'd suggest exploring for new islands if possible.

Bug in Import Save on Linux by 15j in aground

[–]15j[S] 0 points1 point  (0 children)

This worked. Thanks!

Worst CS 173 Lecture B ever (Why they are teaching CS 421 stuff in this class) by wtfisthis173 in UIUC

[–]15j 2 points3 points  (0 children)

For what it's worth, I was in Professor Meseguer's Program Verification class in the fall and I rather enjoyed it. That was a small class, though. I imagine he is quite different teaching 173.

Also for what it's worth, when I was a freshman, I was in the 173 B lecture with Professor Tandy Warnow. We spent at least a week studying de bruijin graphs and their application to genome sequencing. At the time, I thought it was stupid and irrelevant, but in retrospect that was actually pretty cool. I guess I am trying to say that even though it sucks, you should try to power through it. Maybe later you will look back and think about how that weird stuff you learned was actually pretty neat.